@blukavantui/charts-community 0.0.0-stage → 1.0.1

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 (206) hide show
  1. package/LICENSE.txt +105 -0
  2. package/README.md +93 -2
  3. package/THIRD_PARTY_NOTICES.txt +288 -0
  4. package/dist/accessibility.d.ts +53 -0
  5. package/dist/async.d.ts +2 -0
  6. package/dist/bar.css +1 -0
  7. package/dist/bar.d.ts +5 -0
  8. package/dist/bar.js +1 -0
  9. package/dist/browser/charts-community.css +1 -0
  10. package/dist/browser/charts-community.js +52 -0
  11. package/dist/build-audit.json +164 -0
  12. package/dist/builders/bar.d.ts +6 -0
  13. package/dist/builders/doughnut.d.ts +6 -0
  14. package/dist/builders/heatmap.d.ts +16 -0
  15. package/dist/builders/line.d.ts +6 -0
  16. package/dist/builders/pie.d.ts +6 -0
  17. package/dist/builders/radar.d.ts +6 -0
  18. package/dist/builders/scatter.d.ts +6 -0
  19. package/dist/catalogue-model.d.ts +11 -0
  20. package/dist/catalogue-runtime.d.ts +11 -0
  21. package/dist/catalogue-types.d.ts +167 -0
  22. package/dist/chart-state.d.ts +18 -0
  23. package/dist/chunk-5NXLEMCV.js +3 -0
  24. package/dist/chunk-FHHQWCUO.js +1 -0
  25. package/dist/chunk-FZ7J7BEC.js +1 -0
  26. package/dist/chunk-JNSBTZUP.js +2 -0
  27. package/dist/chunk-KCW3WN5P.js +1 -0
  28. package/dist/chunk-MSZ5J5WG.js +1 -0
  29. package/dist/chunk-QBKO4AG7.js +1 -0
  30. package/dist/chunk-QETOF22L.js +1 -0
  31. package/dist/chunk-QFXXWRD5.js +1 -0
  32. package/dist/chunk-YJKEV5J7.js +2 -0
  33. package/dist/colors.d.ts +15 -0
  34. package/dist/community.d.ts +11 -0
  35. package/dist/doughnut.css +1 -0
  36. package/dist/doughnut.d.ts +5 -0
  37. package/dist/doughnut.js +1 -0
  38. package/dist/export.d.ts +5 -0
  39. package/dist/fonts/dm-sans-LICENSE.txt +93 -0
  40. package/dist/fonts/dm-sans-latin-ext-wght-italic.woff2 +0 -0
  41. package/dist/fonts/dm-sans-latin-ext-wght-normal.woff2 +0 -0
  42. package/dist/fonts/dm-sans-latin-wght-italic.woff2 +0 -0
  43. package/dist/fonts/dm-sans-latin-wght-normal.woff2 +0 -0
  44. package/dist/fonts/ibm-plex-mono-LICENSE.txt +93 -0
  45. package/dist/fonts/ibm-plex-mono-latin-100-italic.woff2 +0 -0
  46. package/dist/fonts/ibm-plex-mono-latin-100-normal.woff2 +0 -0
  47. package/dist/fonts/ibm-plex-mono-latin-200-italic.woff2 +0 -0
  48. package/dist/fonts/ibm-plex-mono-latin-200-normal.woff2 +0 -0
  49. package/dist/fonts/ibm-plex-mono-latin-300-italic.woff2 +0 -0
  50. package/dist/fonts/ibm-plex-mono-latin-300-normal.woff2 +0 -0
  51. package/dist/fonts/ibm-plex-mono-latin-400-italic.woff2 +0 -0
  52. package/dist/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
  53. package/dist/fonts/ibm-plex-mono-latin-500-italic.woff2 +0 -0
  54. package/dist/fonts/ibm-plex-mono-latin-500-normal.woff2 +0 -0
  55. package/dist/fonts/ibm-plex-mono-latin-600-italic.woff2 +0 -0
  56. package/dist/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
  57. package/dist/fonts/ibm-plex-mono-latin-700-italic.woff2 +0 -0
  58. package/dist/fonts/ibm-plex-mono-latin-700-normal.woff2 +0 -0
  59. package/dist/fonts/ibm-plex-mono-latin-ext-100-italic.woff2 +0 -0
  60. package/dist/fonts/ibm-plex-mono-latin-ext-100-normal.woff2 +0 -0
  61. package/dist/fonts/ibm-plex-mono-latin-ext-200-italic.woff2 +0 -0
  62. package/dist/fonts/ibm-plex-mono-latin-ext-200-normal.woff2 +0 -0
  63. package/dist/fonts/ibm-plex-mono-latin-ext-300-italic.woff2 +0 -0
  64. package/dist/fonts/ibm-plex-mono-latin-ext-300-normal.woff2 +0 -0
  65. package/dist/fonts/ibm-plex-mono-latin-ext-400-italic.woff2 +0 -0
  66. package/dist/fonts/ibm-plex-mono-latin-ext-400-normal.woff2 +0 -0
  67. package/dist/fonts/ibm-plex-mono-latin-ext-500-italic.woff2 +0 -0
  68. package/dist/fonts/ibm-plex-mono-latin-ext-500-normal.woff2 +0 -0
  69. package/dist/fonts/ibm-plex-mono-latin-ext-600-italic.woff2 +0 -0
  70. package/dist/fonts/ibm-plex-mono-latin-ext-600-normal.woff2 +0 -0
  71. package/dist/fonts/ibm-plex-mono-latin-ext-700-italic.woff2 +0 -0
  72. package/dist/fonts/ibm-plex-mono-latin-ext-700-normal.woff2 +0 -0
  73. package/dist/fonts/inter-LICENSE.txt +93 -0
  74. package/dist/fonts/inter-latin-ext-wght-italic.woff2 +0 -0
  75. package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
  76. package/dist/fonts/inter-latin-wght-italic.woff2 +0 -0
  77. package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
  78. package/dist/fonts/jetbrains-mono-LICENSE.txt +93 -0
  79. package/dist/fonts/jetbrains-mono-latin-ext-wght-italic.woff2 +0 -0
  80. package/dist/fonts/jetbrains-mono-latin-ext-wght-normal.woff2 +0 -0
  81. package/dist/fonts/jetbrains-mono-latin-wght-italic.woff2 +0 -0
  82. package/dist/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  83. package/dist/fonts/lora-LICENSE.txt +93 -0
  84. package/dist/fonts/lora-latin-ext-wght-italic.woff2 +0 -0
  85. package/dist/fonts/lora-latin-ext-wght-normal.woff2 +0 -0
  86. package/dist/fonts/lora-latin-wght-italic.woff2 +0 -0
  87. package/dist/fonts/lora-latin-wght-normal.woff2 +0 -0
  88. package/dist/fonts/manifest.json +618 -0
  89. package/dist/fonts/manrope-LICENSE.txt +93 -0
  90. package/dist/fonts/manrope-latin-ext-wght-normal.woff2 +0 -0
  91. package/dist/fonts/manrope-latin-wght-normal.woff2 +0 -0
  92. package/dist/fonts/merriweather-LICENSE.txt +93 -0
  93. package/dist/fonts/merriweather-latin-ext-wght-italic.woff2 +0 -0
  94. package/dist/fonts/merriweather-latin-ext-wght-normal.woff2 +0 -0
  95. package/dist/fonts/merriweather-latin-wght-italic.woff2 +0 -0
  96. package/dist/fonts/merriweather-latin-wght-normal.woff2 +0 -0
  97. package/dist/fonts/montserrat-LICENSE.txt +93 -0
  98. package/dist/fonts/montserrat-latin-ext-wght-italic.woff2 +0 -0
  99. package/dist/fonts/montserrat-latin-ext-wght-normal.woff2 +0 -0
  100. package/dist/fonts/montserrat-latin-wght-italic.woff2 +0 -0
  101. package/dist/fonts/montserrat-latin-wght-normal.woff2 +0 -0
  102. package/dist/fonts/playfair-display-LICENSE.txt +93 -0
  103. package/dist/fonts/playfair-display-latin-ext-wght-italic.woff2 +0 -0
  104. package/dist/fonts/playfair-display-latin-ext-wght-normal.woff2 +0 -0
  105. package/dist/fonts/playfair-display-latin-wght-italic.woff2 +0 -0
  106. package/dist/fonts/playfair-display-latin-wght-normal.woff2 +0 -0
  107. package/dist/fonts/roboto-LICENSE.txt +93 -0
  108. package/dist/fonts/roboto-latin-ext-wght-italic.woff2 +0 -0
  109. package/dist/fonts/roboto-latin-ext-wght-normal.woff2 +0 -0
  110. package/dist/fonts/roboto-latin-wght-italic.woff2 +0 -0
  111. package/dist/fonts/roboto-latin-wght-normal.woff2 +0 -0
  112. package/dist/fonts/source-sans-3-LICENSE.txt +93 -0
  113. package/dist/fonts/source-sans-3-latin-ext-wght-italic.woff2 +0 -0
  114. package/dist/fonts/source-sans-3-latin-ext-wght-normal.woff2 +0 -0
  115. package/dist/fonts/source-sans-3-latin-wght-italic.woff2 +0 -0
  116. package/dist/fonts/source-sans-3-latin-wght-normal.woff2 +0 -0
  117. package/dist/heatmap.css +1 -0
  118. package/dist/heatmap.d.ts +3 -0
  119. package/dist/heatmap.js +1 -0
  120. package/dist/index.css +1 -0
  121. package/dist/index.d.ts +11 -0
  122. package/dist/index.js +1 -0
  123. package/dist/legend-export.d.ts +9 -0
  124. package/dist/legend-model.d.ts +39 -0
  125. package/dist/legend.d.ts +19 -0
  126. package/dist/limits.d.ts +16 -0
  127. package/dist/line.css +1 -0
  128. package/dist/line.d.ts +5 -0
  129. package/dist/line.js +1 -0
  130. package/dist/loading-state.d.ts +6 -0
  131. package/dist/map-assets.d.ts +4 -0
  132. package/dist/map-resources.d.ts +24 -0
  133. package/dist/messages.d.ts +3 -0
  134. package/dist/model.d.ts +41 -0
  135. package/dist/options.d.ts +11 -0
  136. package/dist/pie.css +1 -0
  137. package/dist/pie.d.ts +5 -0
  138. package/dist/pie.js +1 -0
  139. package/dist/radar.css +1 -0
  140. package/dist/radar.d.ts +4 -0
  141. package/dist/radar.js +1 -0
  142. package/dist/runtime.d.ts +4 -0
  143. package/dist/scatter.css +1 -0
  144. package/dist/scatter.d.ts +5 -0
  145. package/dist/scatter.js +1 -0
  146. package/dist/sparkline-runtime/runtime.d.ts +10 -0
  147. package/dist/sparkline-validation.d.ts +3 -0
  148. package/dist/sparkline.css +25 -0
  149. package/dist/sparkline.d.ts +44 -0
  150. package/dist/sparkline.js +1 -0
  151. package/dist/state-announcement.d.ts +6 -0
  152. package/dist/styles.css +488 -0
  153. package/dist/theme.css +1391 -0
  154. package/dist/types.d.ts +137 -0
  155. package/dist/validation.d.ts +8 -0
  156. package/dist/web-api.json +4145 -0
  157. package/edition.json +48 -0
  158. package/package.json +96 -4
  159. package/scripts/build.mjs +31 -0
  160. package/src/accessibility.ts +81 -0
  161. package/src/assets.d.ts +1 -0
  162. package/src/async.ts +12 -0
  163. package/src/bar.ts +13 -0
  164. package/src/builders/bar.ts +39 -0
  165. package/src/builders/doughnut.ts +66 -0
  166. package/src/builders/heatmap.ts +60 -0
  167. package/src/builders/line.ts +39 -0
  168. package/src/builders/pie.ts +66 -0
  169. package/src/builders/radar.ts +65 -0
  170. package/src/builders/scatter.ts +34 -0
  171. package/src/catalogue-model.ts +235 -0
  172. package/src/catalogue-runtime.ts +200 -0
  173. package/src/catalogue-types.ts +163 -0
  174. package/src/chart-state.ts +35 -0
  175. package/src/charts.css +135 -0
  176. package/src/colors.ts +277 -0
  177. package/src/community.ts +11 -0
  178. package/src/doughnut.ts +12 -0
  179. package/src/export.ts +50 -0
  180. package/src/heatmap.ts +11 -0
  181. package/src/index.ts +11 -0
  182. package/src/legend-export.ts +36 -0
  183. package/src/legend-model.ts +76 -0
  184. package/src/legend.css +64 -0
  185. package/src/legend.ts +90 -0
  186. package/src/limits.ts +7 -0
  187. package/src/line.ts +13 -0
  188. package/src/loading-state.ts +39 -0
  189. package/src/map-assets.ts +1 -0
  190. package/src/map-resources.ts +46 -0
  191. package/src/messages.ts +5 -0
  192. package/src/model.ts +32 -0
  193. package/src/options.ts +24 -0
  194. package/src/pie.ts +12 -0
  195. package/src/radar.ts +12 -0
  196. package/src/runtime.ts +7 -0
  197. package/src/scatter.ts +13 -0
  198. package/src/sparkline-runtime/runtime.d.ts +10 -0
  199. package/src/sparkline-runtime/runtime.js +263 -0
  200. package/src/sparkline-validation.ts +19 -0
  201. package/src/sparkline.css +25 -0
  202. package/src/sparkline.ts +68 -0
  203. package/src/state-announcement.ts +17 -0
  204. package/src/types.ts +104 -0
  205. package/src/validation.ts +75 -0
  206. package/tsconfig.json +16 -0
@@ -0,0 +1 @@
1
+ import{a as We,b as Ze,c as ie,f as xe,g as $e,h as I,i as le,j as U,k as j}from"./chunk-QETOF22L.js";import*as Ke from"echarts/core";import{LabelLayout as Tt,LegacyGridContainLabel as $t}from"echarts/features";import{TooltipComponent as Ot,AriaComponent as Rt,GraphicComponent as Nt}from"echarts/components";import{SVGRenderer as Vt}from"echarts/renderers";var Qe={Title:"Chart",Description:"",Height:320,ValueFormat:"Number",CurrencyCode:"USD",Locale:"en-US",UseCustomPrecision:!1,DecimalPlaces:2,AccessibleLabel:"",ExtendedClass:"",ResetKey:"",Messages:{},ShowHeader:!0,ShowToolbar:!0,ShowLegend:!0,LegendStyle:"Standard",LegendPosition:"Top",LegendShowValues:!0,LegendShowPercentages:!1,ShowTooltip:!0,ShowLabels:!1,ShowDataTable:!0,ShowPatterns:!1,EnableSelection:!0,EnableAnimation:!0,IsLoading:!1,EmptyMessage:"No data to display",SelectedKey:null,ExportFootnote:"BluKavantUI Charts"};function Z(n,a,e=!1){return n===null?a.Messages?.NoData??"No data":new Intl.NumberFormat(a.Locale||"en-US",{style:a.ValueFormat==="Currency"?"currency":a.ValueFormat==="Percent"?"percent":"decimal",currency:a.CurrencyCode||"USD",notation:e?"compact":"standard",...e?{maximumFractionDigits:1}:a.UseCustomPrecision?{minimumFractionDigits:a.DecimalPlaces??2,maximumFractionDigits:a.DecimalPlaces??2}:a.ValueFormat==="Currency"?{}:{maximumFractionDigits:12}}).format(n)}function et(n,a){return n===null?"No data":a??String(n)}function tt(n,a,e=0){let t=n.Categories[a],o=n.Series[e];return t&&o?{Key:t.Key,CategoryLabel:t.Label,SeriesKey:o.Key,SeriesName:o.Name,Value:o.Values[a]}:null}function at(n,a){let e=n.Cells[a];return e?{...e,XLabel:n.XCategories.find(t=>t.Key===e.XKey).Label,YLabel:n.YCategories.find(t=>t.Key===e.YKey).Label}:null}function zt(n){let a=0,e=0;for(let t of n.Cells)t.Value!==null&&(a=Math.min(a,t.Value),e=Math.max(e,t.Value));return a=n.MinValue??a,e=n.MaxValue??e,a>=e&&(n.MaxValue!==void 0?a=e-1:e=a+1),{min:a,max:e}}function c(n,a){if(!n)throw new Error(a)}function se(n,a){U(n,a);let e=new Set;for(let t of n)c(t&&j(t.Key)&&t.Key.length>0&&j(t.Label),`${a} require a non-empty Key and a Label within the text limit.`),c(!e.has(t.Key),`${a} contain a duplicate key: ${t.Key}.`),e.add(t.Key);return e}function pe(n){return n===null||le(n)}function _e(n){c(n.Height===void 0||Number.isFinite(n.Height)&&n.Height>=160&&n.Height<=1e3,"Height must be between 160 and 1000 pixels."),c(n.ValueFormat===void 0||["Currency","Number","Percent"].includes(n.ValueFormat),"Invalid ValueFormat.");for(let a of["UseCustomPrecision","ShowHeader","ShowToolbar","ShowLegend","LegendShowValues","LegendShowPercentages","ShowTooltip","ShowLabels","ShowDataTable","ShowPatterns","EnableSelection","EnableAnimation","IsLoading"])c(n[a]===void 0||typeof n[a]=="boolean",`${a} must be a boolean.`);for(let a of["AccessibleLabel","ExtendedClass","ResetKey","Title","Description","EmptyMessage","ExportFootnote","Locale","CurrencyCode"])c(n[a]===void 0||j(n[a]),`${a} must be text within the text limit.`);c(n.LegendStyle===void 0||["Standard","ValueList","Compact","SummaryCards"].includes(n.LegendStyle),"Invalid LegendStyle."),c(n.LegendPosition===void 0||["Top","Left","Right","Bottom"].includes(n.LegendPosition),"Invalid LegendPosition."),c(n.DecimalPlaces===void 0||Number.isInteger(n.DecimalPlaces)&&n.DecimalPlaces>=0&&n.DecimalPlaces<=12,"DecimalPlaces must be an integer from 0 to 12."),c(n.Messages===void 0||!!n.Messages&&typeof n.Messages=="object"&&!Array.isArray(n.Messages)&&Object.keys(n.Messages).length<=100&&Object.values(n.Messages).every(j),"Messages must contain plain text translations."),new Intl.NumberFormat(n.Locale||"en-US",n.ValueFormat==="Currency"?{style:"currency",currency:n.CurrencyCode||"USD"}:{})}function nt(n){_e(n);let a=se(n.Categories,"Categories");c(n.SelectedKey==null||a.has(n.SelectedKey),"SelectedKey must match a category."),c(n.BarLayout===void 0||["Stacked","Grouped"].includes(n.BarLayout),"Invalid BarLayout."),c(n.SmoothLines===void 0||typeof n.SmoothLines=="boolean","SmoothLines must be a boolean."),U(n.Series,"Series"),c(n.Categories.length*n.Series.length<=I.observations,"Too many chart observations. Aggregate the data first.");let e=new Set;for(let t of n.Series)c(t&&j(t.Key)&&t.Key.length&&!e.has(t.Key),"Each series needs a unique, non-empty Key."),e.add(t.Key),c(j(t.Name)&&["Bar","Line"].includes(t.Type),"Each series needs a Name and a Bar or Line Type."),c(Array.isArray(t.Values)&&t.Values.length===n.Categories.length,`${t.Key}: Values must match the category count.`),c(t.Values.every(pe),`${t.Key}: Values must be finite numbers or null.`),c(t.Color===void 0||ie(t.Color),"Series Color must be a ComponentColor or hex color."),c(t.IsDashed===void 0||typeof t.IsDashed=="boolean","IsDashed must be a boolean.")}function rt(n){_e(n);let a=se(n.XCategories,"XCategories"),e=se(n.YCategories,"YCategories");U(n.Cells,"Cells"),c(a.size*e.size<=I.observations,"Too many heatmap positions. Aggregate the data first.");let t=new Set,o=new Set;for(let r of n.Cells){c(r&&typeof r.Key=="string"&&r.Key.length&&!t.has(r.Key),"Each cell needs a unique, non-empty Key."),c(a.has(r.XKey)&&e.has(r.YKey),`${r.Key}: XKey and YKey must match category keys.`);let i=JSON.stringify([r.XKey,r.YKey]);c(!o.has(i),"Only one cell may occupy each X/Y position."),c(pe(r.Value),`${r.Key}: Value must be a finite number or null.`),o.add(i),t.add(r.Key)}c(n.SelectedKey==null||t.has(n.SelectedKey),"SelectedKey must match a cell."),c(n.ColorScale===void 0||Ze(n.ColorScale)||["Automatic","Teal","Diverging"].includes(n.ColorScale),"Invalid ColorScale."),c(n.MinValue===void 0||Number.isFinite(n.MinValue),"MinValue must be finite."),c(n.MaxValue===void 0||Number.isFinite(n.MaxValue),"MaxValue must be finite."),c(n.MinValue===void 0||n.MaxValue===void 0||n.MinValue<n.MaxValue,"MinValue must be less than MaxValue.")}function f(n){return n.replace(/[&<>"']/g,a=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[a])}function Oe(n){let a=getComputedStyle(n),e=(r,i)=>a.getPropertyValue(r).trim()||i,t=document.documentElement.dataset.bluuiTheme==="dark",o=matchMedia("(forced-colors: active)").matches;if(o){let r=document.createElement("span");r.style.cssText="position:absolute;visibility:hidden;color:Canvas;background-color:CanvasText;forced-color-adjust:none",n.append(r);let i=getComputedStyle(r),u=i.color,d=i.backgroundColor;return r.remove(),{surface:u,text:d,muted:d,border:d,dark:t,forcedColors:o,read:()=>"",palette:Array(8).fill(d)}}return{forcedColors:o,surface:e("--bluui-surface","#fff"),text:e("--bluui-text","#182230"),muted:e("--bluui-text-muted","#667085"),border:e("--bluui-border","#e3e5ed"),dark:t,read:r=>a.getPropertyValue(r),palette:We(t)}}function ot(n){let a="",e=0;return{update(t){if(t===a)return;let o=!a;if(a=t,window.clearTimeout(e),o){n.textContent=t;return}n.textContent="",e=window.setTimeout(()=>{n.isConnected&&(n.textContent=t)},150)},destroy(){window.clearTimeout(e)}}}import{createSkeleton as Re}from"@blukavantui/community/skeleton";import"@blukavantui/community/skeleton.css";function it(n){let a=document.createElement("div");a.className="blu-chart__skeleton",a.setAttribute("aria-hidden","true");let e=document.createElement("div");e.className="blu-chart__skeleton-key";let t=document.createElement("div"),o=document.createElement("div");e.append(t,o);let r=document.createElement("div");r.className="blu-chart__skeleton-plot",a.append(e,r);let i=document.createElement("span");i.className="blu-chart__state-message",n.replaceChildren(a,i);let u=[Re(t,{Shape:"Text",Width:"88px",Height:"12px",IsAnimated:!1}),Re(o,{Shape:"Text",Width:"64px",Height:"12px",IsAnimated:!1}),Re(r,{Shape:"Rectangle",Width:"100%",Height:"100%",IsAnimated:!1})],d=!1;return{update(l,S,g,x){n.hidden=!l&&!S,n.classList.toggle("blu-chart__state--loading",l),a.hidden=!l,i.textContent=g;let b=l&&x;b!==d&&(d=b,u.forEach(v=>v.update({IsAnimated:b})))},destroy(){u.forEach(l=>l.destroy())}}}import{createChip as Lt}from"@blukavantui/community/chip";import"@blukavantui/community/chip.css";function te(n,a,e,t={}){return(n.Messages?.[a]??e).replace(/\{(\w+)\}/g,(o,r)=>t[r]??o)}function J(n,a,e="Label"){U(n,a);let t=new Set;for(let o of n)c(o&&j(o.Key)&&o.Key.length&&!t.has(o.Key),`${a} require unique, non-empty keys.`),c(!e||j(o[e]),`${o.Key}: ${e} must be text within the text limit.`),c(o.Color===void 0||ie(o.Color),`${o.Key}: Color must be a shared ComponentColor or hex color.`),t.add(o.Key);return t}var B=le;function Ce(n){return n===null||B(n)&&n>=0}function D(n,a,e){c(n[a]===void 0||e.includes(n[a]),`Invalid ${a}. Choose ${e.join(", ")}.`)}function Se(n){c(n?.type==="FeatureCollection"&&Array.isArray(n.features)&&n.features.length>0,"GeoJSON must be a non-empty FeatureCollection."),U(n.features,"Map features",I.mapFeatures);let a=0,e=new Set;n.features.forEach(t=>{c(t?.type==="Feature"&&typeof t.properties?.name=="string"&&t.properties.name.length&&!e.has(t.properties.name),"Each map feature needs a unique properties.name region key."),e.add(t.properties.name),c(["Polygon","MultiPolygon"].includes(t.geometry?.type),"Map geometry must be Polygon or MultiPolygon.");let o=t.geometry.type==="Polygon"?[t.geometry.coordinates]:t.geometry.coordinates;c(Array.isArray(o)&&o.length>0,"Map polygons must contain coordinates.");for(let r of o){c(Array.isArray(r)&&r.length>0,"Each polygon needs rings.");for(let i of r)c(Array.isArray(i)&&i.length>=4,"Each polygon ring needs at least four coordinates."),a+=i.length,c(a<=I.mapCoordinates,"Map has too many coordinates. Use a simplified boundary file."),i.forEach(u=>c(Array.isArray(u)&&u.length>=2&&B(u[0])&&B(u[1])&&Math.abs(u[0])<=180&&Math.abs(u[1])<=90,"Map coordinates must be longitude/latitude in degrees.")),c(i[0][0]===i.at(-1)[0]&&i[0][1]===i.at(-1)[1],"Polygon rings must close.")}})}function Ne(n){return typeof n=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(n)&&Number.isFinite(Date.parse(n+"T00:00:00Z"))&&new Date(n+"T00:00:00Z").toISOString().slice(0,10)===n}function lt(n,a){_e(a),"Series"in a&&(U(a.Series,"Series"),U(a.Categories,"Categories"),c(a.Series.length*a.Categories.length<=I.observations,"Too many chart observations. Aggregate the data first."));for(let e of["ShowArea","Nested","Bubble","Drilldown","ShowConversion","Roam"])c(a[e]===void 0||typeof a[e]=="boolean",`${e} must be a boolean.`);if(n==="radar"){let e=a;se(e.Categories,"Categories"),c(e.Categories.length===0||e.Categories.length>=3&&e.Categories.length<=12,"Radar needs 3\u201312 categories, or an empty array for an empty state."),J(e.Series,"Series"),e.Categories.forEach(t=>c(t.Max===void 0||B(t.Max)&&t.Max>0,`${t.Key}: Max must be a positive number.`)),e.Series.forEach(t=>{c(Array.isArray(t.Values)&&t.Values.length===e.Categories.length&&t.Values.every(Ce),`${t.Key}: Values must match categories and contain non-negative numbers or null.`),t.Values.forEach((o,r)=>c(o===null||e.Categories[r].Max===void 0||o<=e.Categories[r].Max,`${t.Key}: Value exceeds ${e.Categories[r].Label} Max.`))}),D(e,"GridShape",["Polygon","Circle"]),c(e.SplitNumber===void 0||Number.isInteger(e.SplitNumber)&&e.SplitNumber>=2&&e.SplitNumber<=8,"SplitNumber must be an integer from 2 to 8."),c(e.ShowAxisBounds===void 0||typeof e.ShowAxisBounds=="boolean","ShowAxisBounds must be Boolean.")}else if(["line","bar","polar"].includes(n)){let e=a;se(e.Categories,"Categories"),J(e.Series,"Series"),e.Series.forEach(t=>{c(Array.isArray(t.Values)&&t.Values.length===e.Categories.length&&t.Values.every(pe),`${t.Key}: Values must match categories and contain finite numbers or null.`),e.Stacking==="Percent"&&c(t.Values.every(o=>o===null||o>=0),"Percentage stacks require non-negative values.")}),D(e,"Orientation",["Vertical","Horizontal"]),D(e,"Stacking",["None","Stacked","Percent"]),D(e,"LineStyle",["Straight","Smooth","Step"]),D(e,"PolarType",["Bar","Line"])}else if(["pie","doughnut","nightingale","funnel"].includes(n)){let e=a;if(J(e.Items,"Items"),e.Items.forEach(t=>c(Ce(t.Value),`${t.Key}: Value must be non-negative or null.`)),n!=="funnel"){let t=J(e.Rings||[],"Rings");e.Items.forEach(o=>c(!o.RingKey||t.has(o.RingKey),`${o.Key}: RingKey must match a ring.`)),e.Nested&&(c(t.size>0,"Nested charts need Rings."),e.Items.forEach(o=>c(o.RingKey&&t.has(o.RingKey),`${o.Key}: nested items need RingKey.`))),D(e,"Shape",["Full","Half"]),D(e,"LabelPosition",["Outside","Inside"]),D(e,"RoseMode",["Area","Radius"]),c(e.InnerRadius===void 0||B(e.InnerRadius)&&e.InnerRadius>=0&&e.InnerRadius<=75,"InnerRadius must be 0\u201375 percent."),c(e.CenterLabel===void 0||typeof e.CenterLabel=="string","CenterLabel must be text.")}else D(a,"Sort",["Input","Descending","Ascending"])}else if(n==="calendar-heatmap"){let e=a;c(Ne(e.RangeStart)&&Ne(e.RangeEnd),"RangeStart and RangeEnd must be real dates in YYYY-MM-DD format.");let t=(Date.parse(e.RangeEnd)-Date.parse(e.RangeStart))/864e5;c(t>=0&&t<=365,"Choose a calendar range of 1\u2013366 days."),J(e.Items,"Items");let o=new Set;e.Items.forEach(r=>{c(Ne(r.Date),`${r.Key}: Date must be a real YYYY-MM-DD date.`),c(r.Date>=e.RangeStart&&r.Date<=e.RangeEnd,`${r.Key}: Date must be within the calendar range.`),c(!o.has(r.Date),"Use one item per date. Aggregate observations before passing the data."),c(Ce(r.Value),`${r.Key}: Value must be non-negative or null.`),o.add(r.Date)}),D(e,"FirstDay",["Monday","Sunday"]),c(e.ColorScale===void 0||e.ColorScale==="Automatic"||ie(e.ColorScale),"Invalid ColorScale.");for(let r of["ShowMonthLabels","ShowDayLabels"])c(e[r]===void 0||typeof e[r]=="boolean",`${r} must be a boolean.`)}else if(n==="scatter"){let e=a;J(e.Points,"Points"),e.Points.forEach(t=>{c(B(t.X)&&B(t.Y),`${t.Key}: X and Y must be finite numbers.`),c(t.Size===void 0||B(t.Size)&&t.Size>=0,`${t.Key}: Size must be non-negative.`),c(t.Group===void 0||typeof t.Group=="string","Group must be text.")});for(let t of["XLabel","YLabel"])c(e[t]===void 0||typeof e[t]=="string",`${t} must be text.`)}else if(n==="treemap"){let e=a,t=J(e.Nodes,"Nodes");e.Nodes.forEach(i=>{c(i.ParentKey===null||typeof i.ParentKey=="string"&&t.has(i.ParentKey),`${i.Key}: ParentKey must be null or match a node.`),c(Ce(i.Value),`${i.Key}: Value must be non-negative or null.`)});let o=we(e.Nodes),r=new Set(e.Nodes.map(i=>i.ParentKey));e.Nodes.forEach(i=>{r.has(i.Key)&&i.Value!==null&&c(o.get(i.Key)!==null&&Math.abs(o.get(i.Key)-i.Value)<1e-6,`${i.Key}: branch Value must equal its leaf total, or use null to calculate it.`)})}else if(n==="sankey"){let e=a,t=J(e.Nodes,"Nodes");J(e.Links,"Links",""),U(e.Nodes,"Flow nodes",I.flowNodes),U(e.Links,"Flow links",I.flowLinks);let o=new Map(e.Nodes.map(l=>[l.Key,[]]));e.Links.forEach(l=>{c(t.has(l.SourceKey)&&t.has(l.TargetKey),`${l.Key}: link endpoints must match node keys.`),c(B(l.Value)&&l.Value>=0,`${l.Key}: Value must be non-negative.`),o.get(l.SourceKey).push(l.TargetKey)});let r=new Map,i=new Map;for(let l of e.Links)r.set(l.TargetKey,(r.get(l.TargetKey)||0)+l.Value),i.set(l.SourceKey,(i.get(l.SourceKey)||0)+l.Value);c([...r.values(),...i.values()].every(le),"Flow totals exceed the supported numeric range.");let u=new Map(e.Nodes.map(l=>[l.Key,0]));e.Links.forEach(l=>u.set(l.TargetKey,u.get(l.TargetKey)+1));let d=[...u].filter(([,l])=>!l).map(([l])=>l);for(let l=0;l<d.length;l++)for(let S of o.get(d[l])){let g=u.get(S)-1;u.set(S,g),g||d.push(S)}c(d.length===t.size,"Sankey links cannot contain cycles."),D(e,"Orientation",["Horizontal","Vertical"]),D(e,"NodeAlign",["Justify","Left","Right"]),c(e.Links.every(l=>!t.has(l.Key)),"Link keys must be distinct from node keys.")}else{let e=a;J(e.Regions,"Regions"),J(e.Locations,"Locations"),e.Regions.forEach(t=>c(pe(t.Value),`${t.Key}: Value must be finite or null.`)),e.Locations.forEach(t=>{c(B(t.Longitude)&&Math.abs(t.Longitude)<=180&&B(t.Latitude)&&Math.abs(t.Latitude)<=90,`${t.Key}: invalid longitude/latitude.`),c(B(t.Value)&&t.Value>=0,`${t.Key}: Value must be non-negative.`)}),c(e.Locations.every(t=>!e.Regions.some(o=>o.Key===t.Key)),"Location and region keys must be distinct."),D(e,"Map",["World","US","Custom"]),D(e,"MapView",["Mainland","Full"]),c(e.MapURL===void 0||j(e.MapURL)&&!!e.MapURL,"MapURL must be non-empty text."),c(!e.MapURL||!e.GeoJSON,"Supply either MapURL or GeoJSON, not both."),c(!e.MapURL||e.Map==="Custom","MapURL requires Map Custom."),D(e,"MapMode",["Regions","Locations","Combined"]),c(e.ColorScale===void 0||e.ColorScale==="Automatic"||ie(e.ColorScale),"Invalid ColorScale."),e.GeoJSON!==void 0&&Se(e.GeoJSON),e.Map==="Custom"&&(c(e.GeoJSON||e.MapURL,"Custom maps need GeoJSON or MapURL."),e.GeoJSON&&ce(e,e.GeoJSON))}c(a.SelectedKey==null||Ve(n,a).some(e=>e.Key===a.SelectedKey),"SelectedKey must match an input key.")}function ce(n,a){let e=new Set(a.features.map(t=>t.properties.name));n.Regions.forEach(t=>c(e.has(t.Key),`Region ${t.Key} does not exist in this map. Use its properties.name key.`))}function we(n){U(n,"Tree nodes",I.treeNodes);let a=new Map,e=new Map;for(let o of n){let r=a.get(o.ParentKey)||[];r.push(o),a.set(o.ParentKey,r)}let t=(a.get(null)||[]).map(o=>({n:o,depth:1}));for(let o=0;o<t.length;o++){let{n:r,depth:i}=t[o];c(i<=I.treeDepth,"Tree exceeds maximum depth.");for(let u of a.get(r.Key)||[])t.push({n:u,depth:i+1});c(t.length<=n.length,"Tree nodes cannot contain cycles.")}c(t.length===n.length,"Tree nodes cannot contain cycles or disconnected parents.");for(let o=t.length-1;o>=0;o--){let r=t[o].n,i=a.get(r.Key)||[],u=i.map(l=>e.get(l.Key)).filter(l=>l!=null),d=i.length?u.length?u.reduce((l,S)=>l+S,0):null:r.Value;c(d===null||le(d),"Tree total exceeds the supported numeric range."),e.set(r.Key,d)}return e}function Ve(n,a){if(n==="radar"){let t=a;return t.Series.flatMap(o=>t.Categories.map((r,i)=>({Key:o.Key,Label:r.Label,Value:o.Values[i],CategoryKey:r.Key,SeriesKey:o.Key,SeriesName:o.Label})))}if(["line","bar","polar"].includes(n)){let t=a;return t.Series.flatMap(o=>t.Categories.map((r,i)=>({Key:r.Key,Label:r.Label,Value:o.Values[i],SeriesKey:o.Key,SeriesName:o.Label})))}if(["pie","doughnut","nightingale","funnel"].includes(n))return a.Items.map(t=>({Key:t.Key,Label:t.Label,Value:t.Value,RingKey:t.RingKey}));if(n==="calendar-heatmap")return a.Items.map(t=>({...t}));if(n==="scatter")return a.Points.map(t=>({...t,Value:t.Y}));if(n==="treemap"){let t=a,o=we(t.Nodes);return t.Nodes.map(r=>({Key:r.Key,Label:r.Label,Value:o.get(r.Key),ParentKey:r.ParentKey}))}if(n==="sankey"){let t=a;return[...t.Nodes.map(o=>({Key:o.Key,Label:o.Label,PointType:"Node",Value:Math.max(t.Links.filter(r=>r.SourceKey===o.Key).reduce((r,i)=>r+i.Value,0),t.Links.filter(r=>r.TargetKey===o.Key).reduce((r,i)=>r+i.Value,0))})),...t.Links.map(o=>({Key:o.Key,Label:`${t.Nodes.find(r=>r.Key===o.SourceKey)?.Label} \u2192 ${t.Nodes.find(r=>r.Key===o.TargetKey)?.Label}`,Value:o.Value,SourceKey:o.SourceKey,TargetKey:o.TargetKey,PointType:"Link"}))]}let e=a;return[...e.Regions.map(t=>({...t,PointType:"Region"})),...e.Locations.map(t=>({...t,PointType:"Location"}))]}function st(n,a,e,t){let o=e.series||[],r=[],i=(g,x,b={})=>te(a,g,x,b),u=(g,x)=>g?.itemStyle?.color||g?.itemStyle?.areaColor||x?.itemStyle?.color||x?.lineStyle?.color||t.palette[0],d=(g,x,b,v,_,w,h,m,R)=>r.push({id:w,label:_,color:u(g,x),value:Z(h,a),compactValue:Z(h,a,!0),detail:m,percent:R,targets:[{seriesIndex:b,dataIndex:v}]});if(a.Series)a.Series.forEach((g,x)=>{let b=o[x],v=g.Values.flatMap((h,m)=>h===null?[]:[{v:h,i:m}]),_=v.at(-1),w=n==="radar";r.push({id:g.Key,label:g.Label||g.Name,color:b?.lineStyle?.color||u(null,b),line:b?.type==="line"||w,symbol:b?.symbol,dash:b?.lineStyle?.type,value:w?`${v.length} / ${a.Categories.length}`:Z(_?.v??null,a),compactValue:w?void 0:Z(_?.v??null,a,!0),detail:w?i("MeasuresReported","Measures reported"):_?i("Latest","Latest \xB7 {label}",{label:a.Categories[_.i].Label}):i("LatestValue","Latest value"),targets:[{seriesIndex:x}]})});else if(["pie","doughnut","nightingale","funnel"].includes(n))o.forEach((g,x)=>{let b=g.data.reduce((_,w)=>_+(w.value??0),0),v=a.Nested?a.Rings?.[x]?.Label:void 0;g.data.forEach((_,w)=>d(_,g,x,w,_.name,_.point.Key,_.value,v,n!=="funnel"&&_.value!==null&&b>0?_.value/b:void 0))});else if(n==="scatter")o.forEach((g,x)=>r.push({id:g.name,label:g.name,color:u(null,g),symbol:g.symbol,value:String(g.data.length),detail:i("Observations","Observations"),targets:[{seriesIndex:x}]}));else if(n==="treemap"){let g=we(a.Nodes),x=a.Nodes.filter(h=>h.ParentKey===null),b=x.reduce((h,m)=>h+(g.get(m.Key)??0),0),v=new Map,_=1,w=h=>h.forEach(m=>{v.set(m.id,_++),w(m.children||[])});w(o[0].data),x.forEach((h,m)=>{let R=g.get(h.Key);d(o[0].data[m],o[0],0,v.get(h.Key),h.Label,h.Key,R,i("TopLevelGroup","Top-level group"),b>0&&R!==null?R/b:void 0)})}else n==="sankey"&&a.Nodes.forEach((g,x)=>{let b=a.Links.filter(_=>_.TargetKey===g.Key).reduce((_,w)=>_+w.Value,0),v=a.Links.filter(_=>_.SourceKey===g.Key).reduce((_,w)=>_+w.Value,0);d(o[0].data[x],o[0],0,x,g.Label,g.Key,Math.max(b,v),i("NodeThroughput","Node throughput"))});let l=Array.isArray(e.visualMap)?e.visualMap[0]:e.visualMap,S=l?{label:n==="geo-map"?i("RegionValue","Region value"):n==="calendar-heatmap"?i("DailyValue","Daily value"):i("CellValue","Cell value"),min:l.min,max:l.max,colors:[...l.inRange.color]}:void 0;return n==="geo-map"?o.forEach((g,x)=>g.data.forEach((b,v)=>{(g.type==="scatter"||a.Regions.find(_=>_.Key===b.point.Key)?.Color)&&d(b,g,x,v,b.point.Label,b.point.Key,b.point.Value,g.type==="scatter"?i("LocationValue","Location \xB7 size = value"):i("CustomRegionColor","Custom region color"))})):n==="calendar-heatmap"&&o[0]?.data.forEach((g,x)=>{a.Items.find(b=>b.Key===g.point.Key)?.Color&&d(g,o[0],0,x,g.point.Label,g.point.Key,g.point.Value,i("CustomDayColor","Custom day color"))}),{entries:r,scale:S,note:n==="scatter"&&a.Bubble?i("BubbleSize","Bubble size represents Size."):void 0}}function Ae(n,a){return{value:a.LegendShowValues===!1?"":n.compactValue||n.value||"",detail:a.LegendShowValues===!1?"":n.detail||"",percent:a.LegendShowPercentages&&n.percent!==void 0?new Intl.NumberFormat(a.Locale||"en-US",{style:"percent",maximumFractionDigits:1}).format(n.percent):""}}function ct(n){let a=f(n.color),e=n.symbol||"rect",t=e.startsWith("empty"),o=e.replace(/^empty/,"").toLowerCase(),r=t?"none":a,i=n.dash==="dashed"?"5 3":n.dash==="dotted"?"2 3":"",u=o.includes("diamond")?'<path d="M14 2 20 8 14 14 8 8Z"':o.includes("triangle")||o==="arrow"?'<path d="M14 2 20 13 8 13Z"':o.includes("circle")||o==="pin"?'<circle cx="14" cy="8" r="4"':'<rect x="9" y="3" width="10" height="10" rx="2"';return`<svg viewBox="${n.line?"0 0 28 16":"6 0 16 16"}" width="${n.line?28:16}" height="16" aria-hidden="true">${n.line?`<path d="M1 8H27" fill="none" stroke="${a}" stroke-width="2" stroke-dasharray="${i}"/>`:""}${u} fill="${r}" stroke="${a}" stroke-width="1.5"/></svg>`}function dt(n,a,e){let t=n.querySelector(".blu-chart__stage"),o=document.createElement("div");o.className="blu-chart__body",t.before(o),o.append(t);let r=document.createElement("div");r.className="blu-chart__legend",r.setAttribute("role","group"),r.setAttribute("aria-label","Chart legend"),o.append(r);let i=null,u={entries:[]},d={},l="",S=[],g=n.querySelector(".blu-chart__status");function x(h){let m=Ae(h,d);return`<span class="blu-chart__legend-heading"><span class="blu-chart__legend-marker">${ct(h)}</span><span class="blu-chart__legend-text blu-chart__legend-label">${f(h.label)}</span><span class="blu-chart__legend-text blu-chart__legend-check" aria-hidden="true">\u2713</span></span>${m.value||m.percent?`<span class="blu-chart__legend-numbers">${m.value?`<span class="blu-chart__legend-text blu-chart__legend-value">${f(m.value)}</span>`:""}${m.percent?`<span class="blu-chart__legend-text blu-chart__legend-percent">${f(m.percent)}</span>`:""}</span>`:""}${m.detail?`<span class="blu-chart__legend-text blu-chart__legend-detail">${f(m.detail)}</span>`:""}${d.LegendStyle==="ValueList"?`<span class="blu-chart__legend-track" aria-hidden="true"><span style="width:${h.percent===void 0?100:Math.max(0,Math.min(100,h.percent*100))}%;background:${f(h.color)}"></span></span>`:""}`}function b(h,m){let R=Ae(m,d);h.dataset.legendKey=m.id,h.setAttribute("aria-label",`${te(d,"Highlight","Highlight {label}",{label:m.label})}${R.detail?" \xB7 "+R.detail:""}${R.value?": "+m.value:""}${R.percent?" \xB7 "+R.percent:""}`),h.innerHTML=x(m)}function v(){a.dispatchAction({type:"downplay"}),u.entries.find(m=>m.id===i)?.targets.forEach(m=>a.dispatchAction({type:"highlight",...m})),S.forEach(m=>{m.instance.update({IsSelected:m.entry.id===i}),b(m.host.querySelector("button"),m.entry)}),r.querySelectorAll("[data-legend-key]").forEach(m=>m.setAttribute("aria-pressed",String(m.dataset.legendKey===i)))}function _(h){i=i===h?null:h,v(),g.textContent=i?te(d,"Highlighting","Highlighting {label}. Activate again to clear.",{label:u.entries.find(m=>m.id===i).label}):te(d,"HighlightCleared","Legend highlight cleared.")}function w(){S.splice(0).forEach(h=>h.instance.destroy())}return{prepare(h,m){d=h,r.setAttribute("aria-label",te(h,"Legend","Chart legend"));let R=h.LegendPosition||"Top",z=n.clientWidth<520&&["Left","Right"].includes(R)?"Bottom":R;o.dataset.legendPosition=z,r.hidden=h.ShowLegend===!1||m,o.classList.toggle("blu-chart__body--no-legend",r.hidden),r.dataset.style=h.LegendStyle||"Standard",r.hidden&&(i=null)},render(h,m,R){u=st(e,h,m,R),u.entries.some(P=>P.id===i)||(i=null),!u.entries.length&&!u.scale&&(r.hidden=!0,o.classList.add("blu-chart__body--no-legend"));let z=Math.max(1,Math.min(4,Math.floor((r.clientWidth-30)/150))),Y=Math.ceil(u.entries.length/Math.ceil(u.entries.length/z))||1;r.style.setProperty("--legend-columns",String(Y));let F=JSON.stringify([u,h.LegendStyle,h.LegendShowValues,h.LegendShowPercentages,h.Messages,R.surface,R.text]);if(F!==l){let P=r.contains(document.activeElement)?document.activeElement.dataset.legendKey:void 0;l=F,w(),r.innerHTML=`${u.scale?`<div class="blu-chart__legend-scale"><span class="blu-chart__legend-text blu-chart__legend-scale-title">${f(u.scale.label)}</span><div class="blu-chart__legend-gradient" style="background:linear-gradient(90deg,${u.scale.colors.map(f).join(",")})" aria-hidden="true"></div><div class="blu-chart__legend-range"><span class="blu-chart__legend-text">${f(Z(u.scale.min,h))}</span><span class="blu-chart__legend-text">${f(Z(u.scale.max,h))}</span></div></div>`:""}<div class="blu-chart__legend-items"></div>${u.note?`<span class="blu-chart__legend-text blu-chart__legend-note">${f(u.note)}</span>`:""}`;let G=r.querySelector(".blu-chart__legend-items");u.entries.forEach(N=>{if(h.LegendStyle==="Compact"){let k=document.createElement("div");k.className="blu-chart__legend-chip-host",G.append(k);let A=Lt(k,{Label:N.label,Color:"Secondary",IsSelectable:!0,IsSelected:N.id===i,ExtendedClass:"blu-chart__legend-chip"},{SelectionChanged:()=>_(N.id)});S.push({entry:N,host:k,instance:A})}else{let k=document.createElement("button");k.type="button",k.className="blu-chart__legend-entry",b(k,N),k.onclick=()=>_(N.id),G.append(k)}}),v(),P&&[...r.querySelectorAll("[data-legend-key]")].find(N=>N.dataset.legendKey===P)?.focus({preventScroll:!0})}else v()},exportLayout(){return{body:o,stage:t,legend:r,model:u}},reset(){i=null},destroy(){w(),r.replaceChildren()}}}function ut(n){let{body:a,legend:e,model:t}=n;if(e.hidden)return"";let o=a.getBoundingClientRect(),r=[],i=d=>{let l=d.getBoundingClientRect();return{x:l.x-o.x,y:l.y-o.y,w:l.width,h:l.height}};for(let d of e.querySelectorAll(".blu-chart__legend-entry,.blu-chart__legend-chip,.blu-chart__legend-scale")){let l=i(d),S=getComputedStyle(d);r.push(`<rect x="${l.x}" y="${l.y}" width="${l.w}" height="${l.h}" rx="${Math.min(parseFloat(S.borderRadius)||0,l.w/2,l.h/2)}" fill="${f(S.backgroundColor)}" stroke="${parseFloat(S.borderWidth)>0?f(S.borderColor):"none"}" stroke-width="${parseFloat(S.borderWidth)||0}"/>`)}for(let d of e.querySelectorAll(".blu-chart__legend-marker svg")){let l=i(d);r.push(`<svg x="${l.x}" y="${l.y}" width="${l.w}" height="${l.h}" viewBox="${f(d.getAttribute("viewBox")||"0 0 28 16")}">${d.innerHTML}</svg>`)}let u=e.querySelector(".blu-chart__legend-gradient");if(u&&t.scale){let d=i(u);r.push(`<defs><linearGradient id="blu-export-legend-scale">${t.scale.colors.map((l,S)=>`<stop offset="${S/(t.scale.colors.length-1)*100}%" stop-color="${f(l)}"/>`).join("")}</linearGradient></defs><rect x="${d.x}" y="${d.y}" width="${d.w}" height="${d.h}" rx="4" fill="url(#blu-export-legend-scale)"/>`)}for(let d of e.querySelectorAll(".blu-chart__legend-track,.blu-chart__legend-track>span")){let l=i(d);l.w&&l.h&&r.push(`<rect x="${l.x}" y="${l.y}" width="${l.w}" height="${l.h}" rx="2" fill="${f(getComputedStyle(d).backgroundColor)}"/>`)}for(let d of e.querySelectorAll(".blu-chart__legend-text")){let l=d.firstChild;if(!l||l.nodeType!==Node.TEXT_NODE)continue;let S=getComputedStyle(d);if(!d.getClientRects().length||S.visibility==="hidden")continue;let g=parseFloat(S.fontSize),x=document.createRange(),b=[];for(let v=0;v<l.textContent.length;v++){x.setStart(l,v),x.setEnd(l,v+1);let _=x.getBoundingClientRect(),w=b.at(-1);w&&Math.abs(w.y-_.y)<1?w.text+=l.textContent[v]:b.push({x:_.x,y:_.y,text:l.textContent[v]})}for(let v of b)r.push(`<text x="${v.x-o.x}" y="${v.y-o.y+g*.86}" font-size="${g}" font-weight="${S.fontWeight}" fill="${f(S.color)}"${S.textDecorationLine.includes("underline")?' text-decoration="underline"':""}>${f(v.text)}</text>`)}return r.join("")}async function he(n,a,e,t){a?.aborted&&(n.catch(()=>{}),a.throwIfAborted());let o,r=()=>{};try{return await Promise.race([n,new Promise((i,u)=>{r=()=>u(a?.reason??new DOMException("Operation aborted.","AbortError")),a?.addEventListener("abort",r,{once:!0}),o=setTimeout(()=>u(new Error(t)),e)})])}finally{clearTimeout(o),a?.removeEventListener("abort",r)}}function Kt(n,a){let e=URL.createObjectURL(n),t=document.createElement("a");t.href=e,t.download=a,document.body.append(t),t.click(),t.remove(),setTimeout(()=>URL.revokeObjectURL(e),1e3)}function pt(n,a){let e=[];for(let t of n.split(/\s+/))!e.length||e[e.length-1].length+t.length>a?e.push(t):e[e.length-1]+=` ${t}`;return e.slice(0,4)}async function ht(n,a,e,t,o,r,i,u,d){d?.throwIfAborted();let l=u?.body.clientWidth||n.getWidth(),S=u?.body.getBoundingClientRect().height||n.getHeight(),g=u?.body.getBoundingClientRect(),x=u?.stage.getBoundingClientRect(),b=g&&x?x.x-g.x:0,v=g&&x?x.y-g.y:0;if(l<=0||n.getHeight()<=0)throw new Error("Show the chart before downloading it.");let _=pt(a.Title||"Chart",Math.max(16,Math.floor((l-32)/10))),w=pt(a.Description||"",Math.max(24,Math.floor((l-32)/6))),h=_.length*22+w.length*15+24,m=S+h+32,R=_.map((P,G)=>`<text x="16" y="${26+G*22}" font-size="17" font-weight="600" fill="${r}">${f(P)}</text>`).join(""),z=w.map((P,G)=>`<text x="16" y="${28+_.length*22+G*15}" font-size="11" fill="${i}">${f(P)}</text>`).join(""),Y=`<svg xmlns="http://www.w3.org/2000/svg" width="${l}" height="${m}" viewBox="0 0 ${l} ${m}" role="img" aria-labelledby="chart-title chart-description"><title id="chart-title">${f(a.Title||"Chart")}</title><desc id="chart-description">${f(a.Description||"Chart visualization. Exact values are available in the source chart data table.")}</desc><rect width="100%" height="100%" fill="${o}"/><g font-family="Inter,system-ui,sans-serif">${R}${z}<g transform="translate(0 ${h})"><g transform="translate(${b} ${v})">${n.renderToSVGString()}</g>${u?ut(u):""}</g><text x="16" y="${m-12}" fill="${i}" font-size="9">${f(a.ExportFootnote||"BluKavantUI")}</text></g></svg>`,F=new Blob([Y],{type:"image/svg+xml"});if(e==="png"){if(l*2>16384||m*2>16384||l*m*4>32e6)throw new Error("This chart is too large for PNG. Use SVG or reduce the displayed data.");let P=URL.createObjectURL(F);try{let G=new Image;G.src=P,await he(G.decode(),d,15e3,"PNG decoding timed out. Try SVG."),d?.throwIfAborted();let N=document.createElement("canvas");N.width=Math.ceil(l*2),N.height=Math.ceil(m*2);let k=N.getContext("2d");if(!k)throw new Error("PNG export is unavailable. Try SVG.");k.drawImage(G,0,0,N.width,N.height),F=await he(new Promise((A,T)=>N.toBlob(H=>H?A(H):T(new Error("PNG export failed. Try SVG.")),"image/png")),d,15e3,"PNG encoding timed out. Try SVG.")}finally{URL.revokeObjectURL(P)}}d?.throwIfAborted(),Kt(F,t)}function ve(n,a){n==="mixed"?nt(a):n==="heatmap"?rt(a):lt(n,a)}function ke(n,a){if(n==="mixed"){let e=a;return e.Series.flatMap((t,o)=>e.Categories.map((r,i)=>({...tt(e,i,o),Label:r.Label,CategoryKey:r.Key})))}return n==="heatmap"?a.Cells.map((e,t)=>{let o=at(a,t);return{...o,Label:`${o.YLabel}, ${o.XLabel}`}}):Ve(n,a)}function Le(n,a){return JSON.stringify([n,a.Key,a.SeriesKey||"",a.CategoryKey||"",a.RingKey||"",a.PointType||""])}function gt(n,a,e){let t={...a,...structuredClone(e)};ve(n,{...t,SelectedKey:null});let r=t.SelectedKey!=null&&!ke(n,t).some(i=>i.Key===t.SelectedKey)&&(!Object.hasOwn(e,"SelectedKey")||e.SelectedKey===a.SelectedKey);return r&&(t.SelectedKey=null),ve(n,t),{next:t,cleared:r}}function mt(n,a){let e=[];return(n?.series||[]).forEach((t,o)=>{if(t.type==="treemap"){let r=1,i=u=>u.forEach(d=>{let l=r++;d.id===a&&e.push({seriesIndex:o,dataIndex:l}),i(d.children||[])});i(t.data||[])}else(t.data||[]).forEach((r,i)=>{r?.point?.Key===a&&e.push({seriesIndex:o,dataIndex:i,...t.type==="sankey"?{dataType:"node"}:{}})});(t.links||[]).forEach((r,i)=>{r?.point?.Key===a&&e.push({seriesIndex:o,dataIndex:i,dataType:"edge"})})}),e}function bt(n,a,e){return n.Messages?.[a]??e}import{registerMap as Mt}from"echarts/core";var Pe={World:new URL("./maps/world.geojson",import.meta.url).href,US:new URL("./maps/us-states.geojson",import.meta.url).href};async function yt(n,a){let e=new AbortController,t=()=>e.abort(a?.reason);a?.addEventListener("abort",t,{once:!0}),a?.aborted&&t();try{return await he((async()=>{let o=new URL(n,typeof location>"u"?"http://localhost/":location.href);if(!["http:","https:"].includes(o.protocol)||o.username||o.password)throw new Error("Map URL must be an HTTP resource without embedded credentials.");let r=await fetch(o.href,{signal:e.signal,credentials:"same-origin"});if(!r.ok)throw new Error(`Map resource failed (${r.status}).`);if(Number(r.headers.get("Content-Length"))>I.mapBytes)throw new Error("Map resource exceeds the size limit.");let i="";if(r.body){let d=r.body.getReader(),l=new TextDecoder,S=0;try{for(;;){let g=await d.read();if(g.done)break;if(S+=g.value.length,S>I.mapBytes)throw new Error("Map resource exceeds the size limit.");i+=l.decode(g.value,{stream:!0})}i+=l.decode()}finally{await d.cancel().catch(()=>{})}}else if(i=await r.text(),new TextEncoder().encode(i).length>I.mapBytes)throw new Error("Map resource exceeds the size limit.");e.signal.throwIfAborted();let u=JSON.parse(i);return Se(u),u})(),e.signal,1e4,"Map resource timed out. Retry the update.")}finally{e.abort(),a?.removeEventListener("abort",t)}}function Et(n=Mt,a=16){let e=[];return{acquire(t){let o=JSON.stringify(t);if(new TextEncoder().encode(o).length>I.mapBytes)throw new Error("Map resource exceeds the size limit.");let r=e.find(d=>d.refs>0&&d.signature===o);if(!r){if(r=e.find(d=>!d.refs),!r){if(e.length>=a)throw new Error("Too many different maps are active.");r={name:`blu-charts-map-v1-${e.length}`,signature:"",refs:0},e.push(r)}n(r.name,t),r.signature=o}r.refs++;let i=!1,u=r;return{name:r.name,release(){i||(i=!0,--u.refs||(u.signature="",n(u.name,{type:"FeatureCollection",features:[]})))}}},stats(){return{slots:e.length,active:e.filter(t=>t.refs>0).length}}}}var Ie=Et();async function ft(n,a){let e=n.Map==="Custom"?n.GeoJSON??await yt(n.MapURL,a):await yt(n.Map==="US"?Pe.US:Pe.World,a);return a.throwIfAborted(),Se(e),ce(n,e),e}function rn(n,a,e,t,o){return At(n,a,e,t,o)}function At(n,a,e,t,o){let r={...Qe,...structuredClone(e)},i=r,u=(s,...p)=>{if(!d)try{s?.(...p)}catch(y){console.error("Chart event handler failed.",y)}},d=!1,l=!1,S=0,g=0,x=0,b=!1,v=!1,_="",w="";try{ve(a,r)}catch(s){throw u(t.Error,{Message:String(s.message),Code:"InvalidData"}),s}let h,m,R,z,Y,F="",P,G=new AbortController,N,k="treemapRootToNode",A=document.createElement("section");A.className="blu-chart",A.innerHTML='<div class="blu-chart__heading"><div><h3></h3><p></p></div><div class="blu-chart__export"><select aria-label="Chart download format"><option value="png">PNG image</option><option value="svg">SVG vector</option></select><button type="button" aria-label="Download chart">\u2193 <span>Download</span></button></div></div><div class="blu-chart__stage"><div class="blu-chart__plot" role="img"></div><div class="blu-chart__state" aria-hidden="true" hidden></div></div><p class="blu-chart__missing-note" hidden></p><div class="blu-chart__navigation" role="group" aria-label="Chart navigation" hidden></div><details class="blu-chart__data"><summary>View data & keyboard selections</summary><label class="blu-chart__patterns"><input type="checkbox"><span>Use fill patterns</span></label><div class="blu-chart__table" tabindex="0" role="region"></div></details><div class="blu-chart__state-announcement" role="status" aria-live="polite" aria-atomic="true"></div><div class="blu-chart__status" role="status" aria-live="polite"></div>',n.append(A);let T=s=>A.querySelector(s),H=T(".blu-chart__plot"),Q=T(".blu-chart__table"),ae=T(".blu-chart__status"),W=T(".blu-chart__navigation"),De=it(T(".blu-chart__state")),ze=ot(T(".blu-chart__state-announcement")),ne=T(".blu-chart__export button"),me=T(".blu-chart__patterns input"),be=matchMedia("(prefers-reduced-motion: reduce)"),Me=matchMedia("(forced-colors: active)"),Ge=matchMedia("(prefers-color-scheme: dark)"),re=()=>ke(a,r),Ee=()=>re().some(s=>s.Value!==null),$=(s,p)=>bt(r,s,p);function ye(){if(d)throw new Error("This chart has been destroyed.")}function de(s,p="InvalidData",y=""){d||(ae.textContent=s instanceof Error?s.message:String(s),u(t.Error,{Message:ae.textContent,Code:p,RequestId:y}),Fe("Error"))}function Fe(s){s!==_&&(_=s,u(t.StateChange,{State:s,Revision:S}))}function Ct(s){if(h?.dispatchAction({type:"downplay"}),!(!s||b||r.IsLoading)){if(a==="mixed"){let p=r,y=p.Categories.findIndex(C=>C.Key===s);y>=0&&p.Series.forEach((C,M)=>h?.dispatchAction({type:"highlight",seriesIndex:M,dataIndex:y}));return}if(a==="heatmap"){let p=r.Cells.findIndex(y=>y.Key===s);p>=0&&h?.dispatchAction({type:"highlight",seriesIndex:0,dataIndex:p});return}for(let p of mt(R,s))h?.dispatchAction({type:"highlight",...p})}}function St(){if(!(h||H.clientWidth<=0||H.clientHeight<=0)){Ke.use([Tt,$t,Ot,Rt,Nt,Vt]),h=Ke.init(H,void 0,{renderer:"svg"}),m=dt(A,h,a),h.on("click","series",s=>{let p=s.data?.point;if(a==="mixed"){let y=r;p=re().find(C=>C.Key===y.Categories[s.dataIndex]?.Key&&C.SeriesKey===y.Series[s.seriesIndex]?.Key)}a==="heatmap"&&(p=re()[s.dataIndex]),p&&Be(p,"Chart")});for(let[s,p]of[["treemaproottonode","treemapRootToNode"],["treemapzoomtonode","treemapZoomToNode"]])h.on(s,y=>{N=y.targetNodeId||y.targetNode?.getId?.(),k=p})}}function ue(s){return s.Value===null?$("NoData","No data"):et(s.Value,r.__valueText?.[Le(a,s)])}function Ue(s){cancelAnimationFrame(x),x=requestAnimationFrame(()=>{if(d||!A.isConnected)return;let p=document.activeElement;if(p!==document.body&&p!==Q&&p?.dataset.point!==s)return;([...Q.querySelectorAll("[data-point]")].find(C=>C.dataset.point===s)||Q).focus({preventScroll:!0})})}function wt(){let s=re(),p=document.activeElement,y=p&&Q.contains(p)?p.dataset.point:void 0,C=(O,L)=>r.EnableSelection&&O.Value!==null?`<button type="button" data-point="${f(Le(a,O))}" aria-label="${f(`${O.Label}${O.SeriesName?", "+O.SeriesName:""}: ${ue(O)}`)}" aria-pressed="${r.SelectedKey===O.Key}">${f(L)}</button>`:f(L),M="",E="";if(a==="mixed"){let O=r,L=new Map(s.map(K=>[JSON.stringify([K.Key,K.SeriesKey]),K]));M=`<tr><th scope="col">${f($("Category","Category"))}</th>${O.Series.map(K=>`<th scope="col">${f(K.Name)}</th>`).join("")}</tr>`,E=O.Categories.map(K=>`<tr><th scope="row">${f(K.Label)}</th>${O.Series.map(V=>{let q=L.get(JSON.stringify([K.Key,V.Key]));return`<td>${C(q,ue(q))}</td>`}).join("")}</tr>`).join("")}else if(a==="heatmap"){let O=r,L=new Map(s.map(K=>[JSON.stringify([K.XKey,K.YKey]),K]));M=`<tr><th scope="col">${f($("Category","Category"))}</th>${O.XCategories.map(K=>`<th scope="col">${f(K.Label)}</th>`).join("")}</tr>`,E=O.YCategories.map(K=>`<tr><th scope="row">${f(K.Label)}</th>${O.XCategories.map(V=>{let q=L.get(JSON.stringify([V.Key,K.Key]));return`<td>${q?C(q,ue(q)):f($("NoData","No data"))}</td>`}).join("")}</tr>`).join("")}else{let O=["Key","Label","Date","Value","CategoryKey","SeriesKey","RingKey","ParentKey","X","Y","Size","Group","SourceKey","TargetKey","Longitude","Latitude","PointType"].filter(L=>s.some(K=>K[L]!==void 0));M=`<tr>${O.map(L=>`<th scope="col">${f($(L,L))}</th>`).join("")}</tr>`,E=s.map(L=>`<tr>${O.map(K=>{let V=L[K],q=K==="Value"?ue(L):V===null?"null":String(V??"");return`<td>${K==="Label"?C(L,q):f(q)}</td>`}).join("")}</tr>`).join("")}Q.setAttribute("aria-label",`${r.Title} ${$("Values","values")}`),Q.innerHTML=`<table><caption>${f(r.Title||"Chart")} \u2014 ${f($("ExactValues","original values"))}</caption><thead>${M}</thead><tbody>${E}</tbody></table>`,y&&Ue(y)}function ee(s=!1){if(d)return;let p=b||!!r.IsLoading,y=!Ee(),C=!!w&&!p;if(A.className=`blu-chart ${r.ExtendedClass||""}`,A.setAttribute("aria-label",r.AccessibleLabel||r.Title||"Chart"),T("h3").textContent=r.Title||"Chart",T(".blu-chart__heading p").textContent=r.Description||"",T(".blu-chart__heading").hidden=!r.ShowHeader&&!r.ShowToolbar,T("h3").parentElement.hidden=!r.ShowHeader,T(".blu-chart__export").hidden=!r.ShowToolbar,ne.querySelector("span").textContent=$("Download","Download"),ne.setAttribute("aria-label",$("DownloadChart","Download chart")),T("select").setAttribute("aria-label",$("DownloadFormat","Chart download format")),T('option[value="png"]').textContent=$("PNG","PNG image"),T('option[value="svg"]').textContent=$("SVG","SVG vector"),W.setAttribute("aria-label",$("Navigation","Chart navigation")),T(".blu-chart__patterns").hidden=!["mixed","line","radar","bar","polar","pie","doughnut","nightingale","treemap","sankey","funnel"].includes(a),T(".blu-chart__patterns span").textContent=$("Patterns",a==="line"||a==="radar"?"Use fill patterns (with Area fill)":"Use fill patterns"),me.checked=!!r.ShowPatterns,T(".blu-chart__data").hidden=p||y,T(".blu-chart__data").classList.toggle("blu-chart__data--compact",!r.ShowDataTable),T(".blu-chart__data summary").textContent=r.ShowDataTable?$("ViewData","View data & keyboard selections"):$("ExploreData","Explore chart data"),H.style.height=`${r.Height}px`,H.style.visibility=p||y?"hidden":"visible",H.setAttribute("aria-busy",String(p)),a==="calendar-heatmap"){let L=r,K=Math.ceil(((Date.parse(L.RangeEnd)-Date.parse(L.RangeStart))/864e5+7)/7);H.style.minWidth=`${Math.max(300,K*12+56)}px`;let V=T(".blu-chart__stage");V.style.overflowX="auto",V.tabIndex=0,V.setAttribute("role","region"),V.setAttribute("aria-label",$("CalendarScroll","Calendar plot; scroll horizontally for more dates"))}let M=p?$("Loading",b?"Loading map\u2026":"Loading chart\u2026"):r.EmptyMessage||"No data to display";De.update(p,y,M,!!r.EnableAnimation&&!be.matches),ze.update(C?w:!p&&!y?$("Ready","Chart ready."):M),ne.disabled=l||p||y||C,W.hidden=p||y||C||!(a==="geo-map"&&r.Roam!==!1||a==="treemap"&&r.Drilldown),a==="geo-map"&&!W.children.length&&(W.innerHTML=["in","out","left","right","up","down","reset","full"].map(L=>`<button type="button" data-nav="${L}"></button>`).join("")),a==="treemap"&&!W.children.length&&(W.innerHTML='<button type="button" data-nav="reset"></button>');let E={in:"Zoom in",out:"Zoom out",left:"Pan left",right:"Pan right",up:"Pan up",down:"Pan down",reset:a==="treemap"?"Show entire tree":"Reset map",full:"Show full map"};if(W.querySelectorAll("[data-nav]").forEach(L=>{L.textContent=$("Map_"+L.dataset.nav,E[L.dataset.nav])}),St(),s&&m?.reset(),m?.prepare(r,p||y),h&&!b&&(a!=="geo-map"||z)){let L=!s&&h.getOption()?.geo?.[0],K=Oe(A),V=o({...r,ShowLegend:!1},K,z?.name,be.matches,H.clientWidth);delete V.legend,V.aria={...V.aria,description:`${r.Title}. ${r.Description||""} ${$("DataAlternative","Original values and keyboard selection are in the data table.")}`},V.geo&&L&&(V.geo.zoom=L.zoom,L.center&&(V.geo.center=L.center)),h.resize(),h.setOption(V,{notMerge:!0}),R=V,s&&(N=void 0),a==="treemap"&&N&&re().some(q=>q.Key===N)&&h.dispatchAction({type:k,seriesIndex:0,targetNodeId:N}),m?.render(r,V,K)}let O=T(".blu-chart__missing-note");if(a==="radar"){let L=r.Series.filter(K=>K.Values.some(V=>V===null));O.hidden=!L.length||p||y,O.textContent=`${L.map(K=>K.Label).join(", ")}: ${$("IncompleteRadar","incomplete profile. Available measurements remain in the data table; missing values are not drawn as zero.")}`}wt(),Me.matches&&!p&&!y&&(T(".blu-chart__data").open=!0),h&&!b&&!C&&!v&&(a!=="geo-map"||z)&&(v=!0,u(t.Ready)),d||Fe(p?"Loading":C?"Error":y?"Empty":"Ready")}function fe(s,p,y=z,C=Y,M=F){let E={options:r,map:z,geometry:Y,geometryKey:F,resourceError:w};r=s,z=y,Y=C,F=M;try{w="",ae.textContent="",ee(E.options.ResetKey!==s.ResetKey||E.geometryKey!==M)}catch(O){r=E.options,z=E.map,Y=E.geometry,F=E.geometryKey,w=E.resourceError,i=r;try{ee()}catch{}throw y!==E.map&&y?.release(),O}E.map!==y&&E.map?.release(),p&&u(t.SelectionChange,{Key:null,Reason:"DataChanged"})}function Te(s,p=!1){let y=++S;if(P?.abort(),b=!1,i=s,a!=="geo-map"){fe(s,p);return}let C=s,M=JSON.stringify([C.Map||"World",C.MapURL||"",C.GeoJSON||null]);if(Y&&M===F){ce(C,Y),fe(s,p);return}if(C.Map==="Custom"&&C.GeoJSON){ce(C,C.GeoJSON);let E=Ie.acquire(C.GeoJSON);fe(s,p,E,C.GeoJSON,M);return}b=!0,P=new AbortController,ee(),ft(C,P.signal).then(E=>{if(d||y!==S)return;b=!1;let O=Ie.acquire(E);fe(s,p,O,E,M)}).catch(E=>{d||y!==S||(b=!1,i=r,w=E instanceof Error?E.message:String(E),ee(),de(E,"ResourceLoadFailed"))})}function Be(s,p){if(d||b||r.IsLoading||s.Value===null&&!(a==="radar"&&s.PointType==="Series"))return;let y={...structuredClone(s),ValueText:s.Value===null?"":ue(s)},C=!!r.EnableSelection,M=r.SelectedKey===s.Key?null:s.Key;if(C){let E={...r,SelectedKey:M};if(a==="treemap"&&p==="Table"&&E.Drilldown&&(N=s.Key,k="treemapRootToNode"),Te(E),d)return;ae.textContent=M?`${$("Selected","Selected")} ${s.Label}.`:$("SelectionCleared","Selection cleared.")}u(t.PointClick,y,p),C&&!d&&u(t.SelectionChange,{Key:M,Reason:"User"})}Q.onclick=s=>{let p=s.target.closest("[data-point]"),y=p?.dataset.point,C=p&&re().find(M=>Le(a,M)===y);C&&(Be(C,"Table"),!d&&A.isConnected&&(document.activeElement===document.body||A.contains(document.activeElement))&&Ue(y))},me.onchange=()=>{oe.update({ShowPatterns:me.checked}),u(t.PatternsChange,{ShowPatterns:me.checked})},W.onclick=s=>{let p=s.target.closest("[data-nav]")?.dataset.nav;if(!(!p||!h)){if(p==="full"){oe.update({MapView:"Full",ResetKey:crypto.randomUUID()});return}if(p==="reset"){N=void 0,ee(!0);return}h.dispatchAction({type:"geoRoam",componentType:"geo",geoIndex:0,dx:p==="left"?-60:p==="right"?60:0,dy:p==="up"?-60:p==="down"?60:0,zoom:p==="in"?1.3:p==="out"?1/1.3:1,originX:H.clientWidth/2,originY:H.clientHeight/2}),ae.textContent=$("Map_"+p,vt(p))}};function vt(s){return`Map view changed: ${s}.`}let X=()=>{try{ee()}catch(s){de(s,"RenderFailed")}},qe=s=>{s.key==="Escape"&&h?.dispatchAction({type:"hideTip"})},je=0,Je=0,Ye=new ResizeObserver(()=>{let s=H.clientWidth,p=H.clientHeight;s===je&&p===Je||(je=s,Je=p,cancelAnimationFrame(g),g=requestAnimationFrame(()=>{!d&&s>0&&p>0&&X()}))}),Xe=new MutationObserver(X);Xe.observe(document.documentElement,{attributes:!0,attributeFilter:["data-bluui-theme"]}),be.addEventListener("change",X),Me.addEventListener("change",X),Ge.addEventListener("change",X),document.addEventListener("keydown",qe);let oe={update(s){ye();try{let{next:p,cleared:y}=gt(a,i,s);Te(p,y)}catch(p){if(!b){i=r;try{ee()}catch{}}throw de(p,/SelectedKey/.test(p.message)?"InvalidSelection":"InvalidData"),p}},resize(){ye(),X()},setSelection(s){oe.update({SelectedKey:s})},highlight(s){ye(),Ct(s)},async download(s="png",p=`blukavant-${a}.${s}`,y=crypto.randomUUID()){ye();let C=!1;try{if(!["png","svg"].includes(s))throw new Error("Choose PNG or SVG.");if(l)throw new Error("ExportBusy");if(!h||b||w||r.IsLoading||!Ee())throw new Error("Wait for a visible chart with valid data before downloading.");l=!0,C=!0,ne.disabled=!0;let M=Oe(A);await ht(h,r,s,p,M.surface,M.text,M.muted,m?.exportLayout(),G.signal),d||(ae.textContent=$("ExportStarted","Chart download started."),u(t.ExportStarted,{Format:s,FileName:p,RequestId:y}),u(t.ExportComplete,{Format:s,FileName:p}))}catch(M){throw d||de(M,M instanceof Error&&M.message==="ExportBusy"?"ExportBusy":"ExportFailed",y),M}finally{C&&(l=!1,d||(ne.disabled=b||!!w||!!r.IsLoading||!Ee()))}},destroy(){d||(d=!0,S++,P?.abort(),G.abort(),cancelAnimationFrame(g),cancelAnimationFrame(x),Ye.disconnect(),Xe.disconnect(),be.removeEventListener("change",X),Me.removeEventListener("change",X),Ge.removeEventListener("change",X),document.removeEventListener("keydown",qe),ze.destroy(),De.destroy(),m?.destroy(),h?.dispose(),z?.release(),A.remove())}};ne.onclick=()=>{oe.download(T("select").value).catch(()=>{})},Ye.observe(A);try{Te(r)}catch(s){throw de(s),oe.destroy(),s}return oe}var kt=3.2;function He(n){if(n.startsWith("#")){let e=n.slice(1);return e.length<=4&&(e=e.split("").map(t=>t+t).join("")),[0,2,4].map(t=>parseInt(e.slice(t,t+2),16)).concat(e.length===8?parseInt(e.slice(6),16)/255:1)}let a=n.match(/[\d.]+/g)?.map(Number);return a&&a.length>=3?[...a.slice(0,3),a[3]??1]:[24,34,48,1]}function Pt(n){return`rgb(${n.slice(0,3).map(a=>Math.round(a)).join(",")})`}function It(n,a){let e=He(n),t=He(a);return Pt(e.slice(0,3).map((o,r)=>o*e[3]+t[r]*(1-e[3])))}function xt(n){let a=He(n).slice(0,3).map(e=>{let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4});return a[0]*.2126+a[1]*.7152+a[2]*.0722}function ge(n,a){let e=xt(n),t=xt(a);return(Math.max(e,t)+.05)/(Math.min(e,t)+.05)}function _t(n,a,e=kt){let t=It(n,a);if(ge(t,a)>=e)return t;let o=ge("#000",a)>=ge("#fff",a)?"#000":"#fff",r=Math.min(e,ge(o,a)),i=0,u=1;for(let d=0;d<20;d++){let l=(i+u)/2;ge(xe([t,o],l),a)>=r?u=l:i=l}return xe([t,o],u)}function sn(n,a){let e=_t(n,a,9);return[_t(xe([a,e],.12),a),e]}var cn=n=>["circle","diamond","triangle","rect","roundRect","pin","arrow","emptyCircle","emptyDiamond","emptyTriangle","emptyRect","emptyRoundRect"][n%12],dn=n=>["solid","dashed","dotted"][(n+Math.floor(n/12))%3];function Ht(n,a){let e=[{symbol:"rect",symbolSize:0,dashArrayX:[1,0],dashArrayY:[1,8],rotation:0},{symbol:"rect",symbolSize:1,dashArrayX:[1,0],dashArrayY:[1,8],rotation:Math.PI/4},{symbol:"circle",symbolSize:1,dashArrayX:[2,7],dashArrayY:[2,7],rotation:0},{symbol:"rect",symbolSize:1,dashArrayX:[1,0],dashArrayY:[1,8],rotation:-Math.PI/4},{symbol:"rect",symbolSize:1,dashArrayX:[1,0],dashArrayY:[1,6],rotation:0},{symbol:"rect",symbolSize:1,dashArrayX:[3,5],dashArrayY:[3,5],rotation:Math.PI/4},{symbol:"triangle",symbolSize:1,dashArrayX:[4,6],dashArrayY:[4,6],rotation:0},{symbol:"diamond",symbolSize:1,dashArrayX:[4,6],dashArrayY:[4,6],rotation:0},{symbol:"rect",symbolSize:1,dashArrayX:[1,0],dashArrayY:[1,3,1,7],rotation:Math.PI/4},{symbol:"circle",symbolSize:1,dashArrayX:[2,3],dashArrayY:[2,3],rotation:0},{symbol:"rect",symbolSize:1,dashArrayX:[1,0],dashArrayY:[3,4],rotation:-Math.PI/4},{symbol:"rect",symbolSize:1,dashArrayX:[4,4],dashArrayY:[1,5],rotation:0}];return{...e[n%e.length],color:$e(a),backgroundColor:"none"}}function Dt(n){return{color:n,borderColor:$e(n),borderWidth:2,borderType:"solid"}}function un(n,a,e=!1,t){return{color:n,opacity:1,borderColor:a,borderWidth:1.5,borderType:"solid",...e?Dt(n):{},...t===void 0?{}:{decal:Ht(t,n)}}}function pn(n,a,e=8){return({labelRect:t})=>({hideOverlap:!0,dx:Math.max(0,8-t.x)+Math.min(0,n-8-t.x-t.width),dy:Math.max(0,e-t.y)+Math.min(0,a-8-t.y-t.height)})}export{f as a,Ve as b,Z as c,at as d,zt as e,_t as f,sn as g,cn as h,dn as i,Ht as j,Dt as k,un as l,pn as m,rn as n,At as o};
@@ -0,0 +1,2 @@
1
+ import{a as i,b as w,c as C,f as T,j as K,k as v,l as P,n as N}from"./chunk-QFXXWRD5.js";import{e as $,g as y}from"./chunk-QETOF22L.js";function I(d,o,S,R=!1,Y=640){let n=d,L=w("pie",d),M=(t,e)=>n.ShowPatterns?K(t,e):void 0,c=o.palette,m=(t,e)=>T(o.forcedColors?o.text:$(t,c[e%c.length],o.dark,o.read),o.surface,3.2),V=(t,e,s)=>P(m(e,s),o.surface,n.SelectedKey===t),z=(t,e)=>L.find(s=>s.Key===t&&(!e||s.SeriesKey===e)),D={data:["line","radar","bar","polar"].includes("pie")?n.Series.map(t=>t.Label):["pie","doughnut","nightingale","funnel"].includes("pie")?[...new Set(n.Items.map(t=>t.Label))]:[],show:n.ShowLegend,type:"scroll",top:6,left:10,right:10,itemWidth:24,itemHeight:12,selectedMode:!1,pageTextStyle:{color:o.muted},pageIconColor:o.text,textStyle:{color:o.muted,fontSize:11}},E={show:n.ShowLabels,color:y(o.surface),fontSize:11,backgroundColor:o.surface,padding:[2,3],borderRadius:2},H={show:n.ShowTooltip,confine:!0,enterable:!0,backgroundColor:o.surface,borderColor:o.border,textStyle:{color:o.text,fontSize:12},formatter:t=>{let e=t.data?.point;if(!e)return`${i(t.name||"")}${t.value==null||Number.isNaN(t.value)?" \xB7 No data":""}`;let s=e.Date?`<br/>${i(e.Date)}<br/><strong>${i(C(e.Value,n))}</strong>`:e.X!==void 0?`<br/>${i(n.XLabel||"X")}: ${e.X}<br/>${i(n.YLabel||"Y")}: ${e.Y}${e.Size===void 0?"":`<br/>Size: ${e.Size}`}`:`<br/><strong>${i(C(e.Value,n))}</strong>`;return`${i(e.SeriesName?`${e.SeriesName} \xB7 ${e.Label}`:e.Label)}${s}${t.data?.conversion?`<br/>${i(t.data.conversion)}`:""}`}},F={backgroundColor:o.surface,color:c.map((t,e)=>m(t,e)),animation:!!n.EnableAnimation&&!R,animationDuration:300,animationDurationUpdate:150,textStyle:{fontFamily:"Inter,system-ui,sans-serif",color:o.text},aria:{enabled:!0,description:`${n.Title}. ${n.Description||""} Exact values and keyboard selection are in the data table.`},tooltip:H},W={axisLine:{show:!1},axisTick:{show:!1},axisLabel:{color:o.muted,fontSize:10,hideOverlap:!0},splitLine:{lineStyle:{color:o.border,type:"dashed"}}},r=d,l=r.Nested?r.Rings:[{Key:"",Label:""}],h=r.Shape==="Half",x=!!r.Nested&&l.length>1,k=0,f=r.LabelPosition!=="Inside",g=f?66:76,A=[...new Set(r.Items.map(t=>t.Label))],O=l.map((t,e)=>{let s=x?e===0?[0,32]:[44+(g-44)*(e-1)/(l.length-1),44+(g-44)*e/(l.length-1)-(e===l.length-1?0:2)]:[k,Math.max(g,k+5)],p=!f||x&&e<l.length-1;return{type:"pie",id:t.Key||"pie",name:t.Label,top:n.ShowLegend?28:0,bottom:2,center:["50%",h?"72%":"55%"],radius:s.map(a=>`${a}%`),startAngle:h?180:90,endAngle:h?360:"auto",roseType:!1,avoidLabelOverlap:!0,stillShowZeroSum:!1,label:{...E,position:p?"inside":"outside",backgroundColor:p?void 0:o.surface,alignTo:"none",bleedMargin:6,distanceToLabelLine:4,formatter:`{b}
2
+ {d}%`,lineHeight:15},labelLine:{show:!!n.ShowLabels&&!p,length:12,length2:8,smooth:.15},labelLayout:{hideOverlap:!0},emphasis:{scale:!0},data:r.Items.filter(a=>!r.Nested||a.RingKey===t.Key).map(a=>{let b=A.indexOf(a.Label),u=m(a.Color,b);return{id:a.Key,name:a.Label,value:a.Value,point:z(a.Key),label:{color:y(p?u:o.surface),backgroundColor:p?u:o.surface},labelLine:{lineStyle:{color:u,width:1.25}},itemStyle:{...V(a.Key,a.Color,b),decal:M(b,u),borderRadius:3},emphasis:{itemStyle:v(u)}}})}}),Z=L.find(t=>t.Key===n.SelectedKey)?.Value??r.Items.reduce((t,e)=>t+(e.Value||0),0);return{...F,legend:D,series:O,media:f?[{query:{maxWidth:420},option:{series:O.map(t=>({id:t.id,radius:t.radius.map(e=>`${parseFloat(e)*.84}%`)}))}}]:[],graphic:[]}}import{use as X}from"echarts/core";import{PieChart as B}from"echarts/charts";function ce(d,o,S={}){return X([B]),N(d,"pie",o,S,I)}export{ce as a};
@@ -0,0 +1,15 @@
1
+ import type { ComponentColor, ChartColor } from './types.ts';
2
+ export declare function automaticPalette(dark: boolean): string[];
3
+ export declare const componentColors: readonly ["Default", "Primary", "Secondary", "Success", "Processing", "Warning", "Error", "Danger", "Magenta", "Red", "Volcano", "Orange", "Gold", "Lime", "Green", "Cyan", "Blue", "GeekBlue", "Purple"];
4
+ export declare const isComponentColor: (value: unknown) => value is ComponentColor;
5
+ export declare const isChartColor: (value: unknown) => value is ChartColor;
6
+ export declare function componentPalette(name: ComponentColor, dark: boolean, read?: (token: string) => string): {
7
+ soft: string;
8
+ solid: string;
9
+ text: string;
10
+ };
11
+ export declare function resolveChartColor(color: ChartColor | undefined, automatic: string, dark: boolean, read?: (token: string) => string): string;
12
+ /** Match the linear RGB interpolation used by continuous ECharts color scales. */
13
+ export declare function interpolateColor(colors: string[], position: number): string;
14
+ /** Pick dark or white text with at least 4.5:1 contrast against an opaque mark. */
15
+ export declare function contrastText(color: string): string;
@@ -0,0 +1,11 @@
1
+ export type * from './types.ts';
2
+ export type * from './catalogue-types.ts';
3
+ export { createLineChart } from './line.ts';
4
+ export { createBarChart } from './bar.ts';
5
+ export { createPieChart } from './pie.ts';
6
+ export { createDoughnutChart } from './doughnut.ts';
7
+ export { createScatterChart } from './scatter.ts';
8
+ export { createRadarChart } from './radar.ts';
9
+ export { createHeatmap } from './heatmap.ts';
10
+ export { createSparkline } from './sparkline.ts';
11
+ export type { BluSparklinePoint, SparklineOptions, SparklineEvents, SparklineInstance } from './sparkline.ts';
@@ -0,0 +1 @@
1
+ .blu-chart__body{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;min-width:0}.blu-chart__body[data-legend-position=Top] .blu-chart__legend{grid-row:1}.blu-chart__body[data-legend-position=Bottom] .blu-chart__legend{grid-row:2}.blu-chart__body[data-legend-position=Left]{grid-template-columns:190px minmax(0,1fr);align-items:center}.blu-chart__body[data-legend-position=Right]{grid-template-columns:minmax(0,1fr) 190px;align-items:center}.blu-chart__body[data-legend-position=Left] .blu-chart__legend{grid-column:1;grid-row:1}.blu-chart__body[data-legend-position=Left] .blu-chart__stage,.blu-chart__body[data-legend-position=Right] .blu-chart__legend{grid-column:2;grid-row:1}.blu-chart__body[data-legend-position=Right] .blu-chart__stage{grid-column:1;grid-row:1}.blu-chart__body.blu-chart__body--no-legend{grid-template-columns:minmax(0,1fr);gap:0}.blu-chart__body--no-legend .blu-chart__stage{grid-column:1!important;grid-row:1!important}.blu-chart__legend{--legend-selected:color-mix(in srgb,var(--bluui-primary) 9%,var(--bluui-surface));min-width:0;padding:8px 20px 16px;font:12px/1.45 var(--bluui-font,Inter,system-ui,sans-serif);color:var(--bluui-text)}.blu-chart__legend-items{display:flex;flex-wrap:wrap;gap:8px}.blu-chart__legend-entry{min-width:0;max-width:100%;display:flex;align-items:center;gap:10px;border:1px solid transparent;background:transparent;color:inherit;font:inherit;text-align:left;padding:7px 8px;border-radius:8px;cursor:pointer;min-height:36px}.blu-chart__legend-entry:hover{background:var(--bluui-surface-muted)}.blu-chart__legend-entry[aria-pressed=true]{text-decoration:none;background:var(--legend-selected)}.blu-chart__legend-heading{display:flex;align-items:center;gap:7px;min-width:0}.blu-chart__legend-marker{display:flex;flex-shrink:0}.blu-chart__legend-text{overflow-wrap:anywhere}.blu-chart__legend-label{font-weight:500}.blu-chart__legend-detail,.blu-chart__legend-percent,.blu-chart__legend-note{font-size:11px;color:var(--bluui-text-muted)}.blu-chart__legend-numbers{display:flex;align-items:baseline;gap:10px;min-width:0;font-variant-numeric:tabular-nums}.blu-chart__legend-value{font-weight:600;letter-spacing:-.25px}.blu-chart__legend-check{visibility:hidden;margin-left:auto;color:var(--bluui-primary);font-weight:700;font-size:12px}[aria-pressed=true] .blu-chart__legend-check{visibility:visible}.blu-chart__legend[data-style=Standard] .blu-chart__legend-detail,.blu-chart__legend[data-style=Standard] .blu-chart__legend-check{display:none}.blu-chart__legend[data-style=Standard] .blu-chart__legend-value{font-size:11px;color:var(--bluui-text-muted)}.blu-chart__legend-track{display:none;height:3px;background:var(--bluui-border);border-radius:2px;overflow:hidden}.blu-chart__legend-track>span{display:block;height:100%}.blu-chart__legend-chip-host{min-width:0;max-width:100%}.blu-chart__legend .blu-chip.blu-chart__legend-chip{--chip-bg:transparent;--chip-fg:var(--bluui-text);--chip-border:var(--bluui-border);max-width:100%;box-shadow:none}.blu-chart__legend .blu-chart__legend-chip.blu-chip--selected{--chip-bg:var(--legend-selected);--chip-border:var(--bluui-primary);box-shadow:none}.blu-chart__legend .blu-chart__legend-chip .blu-chip__select{min-height:38px;padding:9px 12px;gap:10px;font:inherit;font-size:11px;text-align:left;justify-content:flex-start}.blu-chart__legend-chip .blu-chart__legend-label{font-weight:500}.blu-chart__legend-chip .blu-chart__legend-detail,.blu-chart__legend-chip .blu-chart__legend-check{display:none}.blu-chart__legend-chip [aria-pressed=true]{text-decoration:none}.blu-chart__legend-chip [aria-pressed=true] .blu-chart__legend-label{text-decoration:underline;text-underline-offset:3px}.blu-chart__legend-chip .blu-chart__legend-numbers{gap:7px;flex-wrap:wrap}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-items,.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-items{display:grid;grid-template-columns:repeat(var(--legend-columns,1),minmax(0,1fr));gap:10px}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-entry{display:flex;flex-direction:column;align-items:stretch;gap:5px;padding:10px 11px;border:0}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-numbers{margin-left:23px;justify-content:space-between}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-value{font-size:19px;letter-spacing:-.4px;line-height:1.3}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-detail{margin-left:23px}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-track{display:block;margin:3px 0 0 23px}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-entry{display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;gap:0;padding:12px;min-height:36px;align-self:start;border-color:var(--bluui-border);border-radius:12px}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-entry[aria-pressed=true]{border-color:var(--bluui-primary)}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-heading{font-size:11px}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-numbers{flex-direction:column;align-items:stretch;gap:6px;margin-top:10px}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-value{font-size:24px;letter-spacing:-.6px;line-height:1.2}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-detail{margin-top:6px}.blu-chart__body:is([data-legend-position=Left],[data-legend-position=Right]) .blu-chart__legend{padding:8px 12px 16px}.blu-chart__body:is([data-legend-position=Left],[data-legend-position=Right]) .blu-chart__legend-items{display:flex;flex-direction:column}.blu-chart__body:is([data-legend-position=Left],[data-legend-position=Right]) .blu-chart__legend-entry{width:100%}.blu-chart__body:is([data-legend-position=Left],[data-legend-position=Right]) .blu-chart__legend[data-style=Standard] .blu-chart__legend-entry{flex-wrap:wrap;gap:4px 10px}.blu-chart__legend-scale{max-width:360px;min-width:0;margin:0 0 8px}.blu-chart__legend-scale-title{display:block;font-size:11px;font-weight:500;margin-bottom:10px;color:var(--bluui-text-muted)}.blu-chart__legend-gradient{height:8px;border-radius:4px}.blu-chart__legend-range{display:flex;justify-content:space-between;gap:12px;margin-top:8px;font-variant-numeric:tabular-nums}.blu-chart__legend[data-style=Compact] .blu-chart__legend-scale{padding:12px 16px;border:1px solid var(--bluui-border);border-radius:18px}.blu-chart__legend[data-style=ValueList] .blu-chart__legend-scale{padding:10px 11px}.blu-chart__legend[data-style=SummaryCards] .blu-chart__legend-scale{padding:16px;border:1px solid var(--bluui-border);border-radius:12px}.blu-chart__legend-note{display:block;margin-top:10px}@media(forced-colors:active){.blu-chart__legend-entry{border:1px solid ButtonText!important}.blu-chart__legend-entry[aria-pressed=true],.blu-chart__legend .blu-chart__legend-chip.blu-chip--selected{outline:1px solid Highlight}.blu-chart__legend-marker svg{forced-color-adjust:none}.blu-chart__legend-gradient{background:Canvas!important;border:1px solid CanvasText}}.blu-chart{width:100%;min-width:0;color:var(--bluui-text,#182230);background:var(--bluui-surface,#fff);font:13px/1.5 var(--blu-font-family,Inter,system-ui,sans-serif)}.blu-chart [hidden]{display:none!important}.blu-chart__heading{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:18px 16px 12px}.blu-chart__heading>div:first-child{min-width:0}.blu-chart__heading h3{margin:0;color:inherit;font-size:16px;font-weight:650;letter-spacing:-.3px;overflow-wrap:anywhere}.blu-chart__heading p{margin:5px 0 0;font-size:11px;color:var(--bluui-text-muted,#667085);line-height:1.6;overflow-wrap:anywhere}.blu-chart__export{display:flex;gap:5px;flex-shrink:0;margin-left:auto}.blu-chart__export :is(select,button){font:inherit;font-size:11px;border:1px solid var(--bluui-border,#ddd);color:inherit;border-radius:6px;background:var(--bluui-surface,#fff);min-height:34px;padding:6px 8px;cursor:pointer}.blu-chart__export button:disabled{opacity:.5;cursor:default}.blu-chart__stage{position:relative;min-width:0}.blu-chart__plot{width:100%;min-width:0}.blu-chart__state{position:absolute;inset:0;display:grid;place-items:center;background:var(--bluui-surface-muted,#f8f8fa);color:var(--bluui-text-muted,#667085);padding:20px;text-align:center}.blu-chart__state--loading{grid-template-rows:minmax(0,1fr) auto;gap:14px;place-items:stretch;background:var(--bluui-surface,#fff);padding:16px}.blu-chart__skeleton{display:flex;flex-direction:column;gap:24px;min-width:0;min-height:0}.blu-chart__skeleton-key{display:flex;gap:16px;align-items:center;flex-wrap:wrap}.blu-chart__skeleton-plot{flex:1;min-height:0}.blu-chart__skeleton-plot>div{height:100%}.blu-chart__state-message{font-size:12px}.blu-chart__data{margin:12px 16px 0;border-top:1px solid var(--bluui-border,#ddd);font-size:11px}.blu-chart__data summary{cursor:pointer;padding:12px 0;color:var(--bluui-text-muted,#667085)}.blu-chart__data--compact{margin-top:0;border-top:0}.blu-chart__data--compact summary{padding:6px 0}.blu-chart__table{overflow:auto;max-height:320px}.blu-chart__table table{width:100%;border-collapse:collapse;white-space:nowrap;font-size:11px;font-variant-numeric:tabular-nums}.blu-chart__table caption{text-align:left;color:var(--bluui-text-muted,#667085);padding:8px}.blu-chart__table th,.blu-chart__table td{padding:8px;border-bottom:1px solid var(--bluui-border,#ddd);text-align:right}.blu-chart__table th:first-child{text-align:left}.blu-chart__table button{font:inherit;color:var(--bluui-primary,#6557e8);background:transparent;border:0;border-radius:3px;padding:5px;cursor:pointer}.blu-chart__table button[aria-pressed=true]{background:var(--bluui-selected,#eeeaff);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px;font-weight:700}.blu-chart :is(button,select,summary,[tabindex]):focus-visible{outline:2px solid var(--bluui-primary,#6557e8);outline-offset:2px}.blu-chart__status{font-size:11px;color:var(--bluui-text-muted,#667085);margin:0 16px}.blu-chart__status:not(:empty){padding:8px 0}@media(max-width:640px){.blu-chart__heading{flex-wrap:wrap;padding-inline:12px}.blu-chart__export{margin-left:0}.blu-chart__data{margin-inline:12px}}.blu-chart__navigation{display:flex;flex-wrap:wrap;gap:6px;padding:8px 16px}.blu-chart__navigation button{min-width:32px;min-height:32px;padding:5px 9px;font:inherit;font-size:12px;color:var(--bluui-text);background:var(--bluui-surface);border:1px solid var(--bluui-control-border);border-radius:5px;cursor:pointer}.blu-chart__stage[tabindex]:focus-visible{outline-offset:-3px}.blu-chart__state-announcement{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.blu-chart__patterns{display:flex;align-items:center;gap:8px;font-size:12px;padding:6px 0 12px;cursor:pointer}.blu-chart__patterns input{width:24px;height:24px;margin:0;accent-color:var(--bluui-color-primary-solid)}.blu-chart__missing-note{margin:8px 12px;color:var(--bluui-text-muted);font-size:12px;line-height:1.5}.blu-chart .blu-chart__patterns input[type=checkbox]{-webkit-appearance:none;appearance:none;box-sizing:border-box;position:relative;display:inline-block;flex:0 0 22px;width:22px;height:22px;min-width:22px;min-height:22px;margin:0;padding:0;border:1.5px solid var(--bluui-control-border,#7b8799);border-radius:6px;background-color:var(--bluui-surface,#fff);background-image:none;box-shadow:0 1px 2px #0f172a0f;vertical-align:middle;cursor:pointer;opacity:1;filter:none;transition:background-color .12s ease,border-color .12s ease,box-shadow .12s ease}.blu-chart .blu-chart__patterns input[type=checkbox]:after{content:none}.blu-chart .blu-chart__patterns input[type=checkbox]:checked,.blu-chart .blu-chart__patterns input[type=checkbox]:indeterminate{border-color:var(--bluui-color-primary-solid,#4f46e5);background-color:var(--bluui-color-primary-solid,#4f46e5)}.blu-chart .blu-chart__patterns input[type=checkbox]:checked:after,.blu-chart .blu-chart__patterns input[type=checkbox]:indeterminate:after{content:"";box-sizing:content-box;position:absolute;width:10px;height:6px;inset:5px auto auto 4px;border:solid var(--bluui-color-primary-contrast,#fff);border-width:0 0 2px 2px;border-radius:0;background:none;-webkit-mask:none;mask:none;transform:rotate(-45deg);pointer-events:none}.blu-chart .blu-chart__patterns input[type=checkbox]:indeterminate:after{height:0;top:8px;border-width:0 0 2px;transform:none}.blu-chart .blu-chart__patterns input[type=checkbox]:hover:not(:disabled){border-color:var(--bluui-color-primary-solid,#4f46e5);box-shadow:0 0 0 3px var(--bluui-color-primary-soft,#eef2ff)}.blu-chart .blu-chart__patterns input[type=checkbox]:focus-visible{outline:2px solid var(--bluui-color-primary-solid,#4f46e5);outline-offset:3px}.blu-chart .blu-chart__patterns input[type=checkbox]:disabled{border-color:var(--bluui-border-strong,#b8c4d4);background-color:var(--bluui-surface-muted,#f7f8fb);box-shadow:none;cursor:not-allowed}.blu-chart .blu-chart__patterns input[type=checkbox]:disabled:checked,.blu-chart .blu-chart__patterns input[type=checkbox]:disabled:indeterminate{border-color:var(--bluui-text-muted,#5c6b80);background-color:var(--bluui-text-muted,#5c6b80)}@media(prefers-reduced-motion:reduce){.blu-chart .blu-chart__patterns input[type=checkbox]{transition:none}}.blu-chart .blu-chart__patterns input[type=checkbox]:before{content:none}@media(forced-colors:active){.blu-chart .blu-chart__patterns input[type=checkbox],.blu-chart .blu-chart__patterns input[type=checkbox]:checked,.blu-chart .blu-chart__patterns input[type=checkbox]:indeterminate,.blu-chart .blu-chart__patterns input[type=checkbox]:disabled,.blu-chart .blu-chart__patterns input[type=checkbox]:disabled:checked,.blu-chart .blu-chart__patterns input[type=checkbox]:disabled:indeterminate{-webkit-appearance:checkbox;appearance:auto;background:revert;border:revert;box-shadow:none;forced-color-adjust:auto}.blu-chart .blu-chart__patterns input[type=checkbox]:checked:after,.blu-chart .blu-chart__patterns input[type=checkbox]:indeterminate:after{content:none}}
@@ -0,0 +1,5 @@
1
+ import type { OptionsByKind, ChartPoint } from './catalogue-types.ts';
2
+ import type { ChartEvents } from './types.ts';
3
+ export type { OptionsByKind, ChartPoint } from './catalogue-types.ts';
4
+ export type DoughnutChartOptions = OptionsByKind['doughnut'];
5
+ export declare function createDoughnutChart(host: HTMLElement, options: DoughnutChartOptions, events?: ChartEvents<ChartPoint>): import("./types.ts").ChartInstance<import("./catalogue-types.ts").CircularOptions>;
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-5NXLEMCV.js";import"./chunk-QFXXWRD5.js";import"./chunk-QETOF22L.js";export{a as createDoughnutChart};
@@ -0,0 +1,5 @@
1
+ import { type LegendExportLayout } from './legend-export.ts';
2
+ import type { EChartsType } from 'echarts/core';
3
+ import type { ChartFormat, ChartOptions } from './types.ts';
4
+ export declare function saveBlob(blob: Blob, filename: string): void;
5
+ export declare function exportImage(chart: EChartsType, options: ChartOptions, format: ChartFormat, filename: string, surface: string, text: string, muted: string, legend?: LegendExportLayout, signal?: AbortSignal): Promise<void>;
@@ -0,0 +1,93 @@
1
+ Copyright 2014 The DM Sans Project Authors (https://github.com/googlefonts/dm-fonts) DMSans-Italic[opsz,wght].ttf: Copyright 2014 The DM Sans Project Authors (https://github.com/googlefonts/dm-fonts)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-ThinItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-ExtraLight.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-ExtraLightItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Light.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-LightItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Regular.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Italic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Medium.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-MediumItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-SemiBold.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-SemiBoldItalic.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-Bold.ttf: Copyright 2017 IBM Corp. All rights reserved. IBMPlexMono-BoldItalic.ttf: Copyright 2017 IBM Corp. All rights reserved.
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,93 @@
1
+ Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter) Inter-Italic[opsz,wght].ttf: Copyright 2016 The Inter Project Authors (https://github.com/rsms/inter)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ http://scripts.sil.org/OFL
6
+
7
+
8
+ -----------------------------------------------------------
9
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
+ -----------------------------------------------------------
11
+
12
+ PREAMBLE
13
+ The goals of the Open Font License (OFL) are to stimulate worldwide
14
+ development of collaborative font projects, to support the font creation
15
+ efforts of academic and linguistic communities, and to provide a free and
16
+ open framework in which fonts may be shared and improved in partnership
17
+ with others.
18
+
19
+ The OFL allows the licensed fonts to be used, studied, modified and
20
+ redistributed freely as long as they are not sold by themselves. The
21
+ fonts, including any derivative works, can be bundled, embedded,
22
+ redistributed and/or sold with any software provided that any reserved
23
+ names are not used by derivative works. The fonts and derivatives,
24
+ however, cannot be released under any other type of license. The
25
+ requirement for fonts to remain under this license does not apply
26
+ to any document created using the fonts or their derivatives.
27
+
28
+ DEFINITIONS
29
+ "Font Software" refers to the set of files released by the Copyright
30
+ Holder(s) under this license and clearly marked as such. This may
31
+ include source files, build scripts and documentation.
32
+
33
+ "Reserved Font Name" refers to any names specified as such after the
34
+ copyright statement(s).
35
+
36
+ "Original Version" refers to the collection of Font Software components as
37
+ distributed by the Copyright Holder(s).
38
+
39
+ "Modified Version" refers to any derivative made by adding to, deleting,
40
+ or substituting -- in part or in whole -- any of the components of the
41
+ Original Version, by changing formats or by porting the Font Software to a
42
+ new environment.
43
+
44
+ "Author" refers to any designer, engineer, programmer, technical
45
+ writer or other person who contributed to the Font Software.
46
+
47
+ PERMISSION & CONDITIONS
48
+ Permission is hereby granted, free of charge, to any person obtaining
49
+ a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
+ redistribute, and sell modified and unmodified copies of the Font
51
+ Software, subject to the following conditions:
52
+
53
+ 1) Neither the Font Software nor any of its individual components,
54
+ in Original or Modified Versions, may be sold by itself.
55
+
56
+ 2) Original or Modified Versions of the Font Software may be bundled,
57
+ redistributed and/or sold with any software, provided that each copy
58
+ contains the above copyright notice and this license. These can be
59
+ included either as stand-alone text files, human-readable headers or
60
+ in the appropriate machine-readable metadata fields within text or
61
+ binary files as long as those fields can be easily viewed by the user.
62
+
63
+ 3) No Modified Version of the Font Software may use the Reserved Font
64
+ Name(s) unless explicit written permission is granted by the corresponding
65
+ Copyright Holder. This restriction only applies to the primary font name as
66
+ presented to the users.
67
+
68
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
+ Software shall not be used to promote, endorse or advertise any
70
+ Modified Version, except to acknowledge the contribution(s) of the
71
+ Copyright Holder(s) and the Author(s) or with their explicit written
72
+ permission.
73
+
74
+ 5) The Font Software, modified or unmodified, in part or in whole,
75
+ must be distributed entirely under this license, and must not be
76
+ distributed under any other license. The requirement for fonts to
77
+ remain under this license does not apply to any document created
78
+ using the Font Software.
79
+
80
+ TERMINATION
81
+ This license becomes null and void if any of the above conditions are
82
+ not met.
83
+
84
+ DISCLAIMER
85
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
+ OTHER DEALINGS IN THE FONT SOFTWARE.