bezel-charts 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  [![Python](https://github.com/ShazMoghaddam/bezel-charts/actions/workflows/python.yml/badge.svg)](https://github.com/ShazMoghaddam/bezel-charts/actions/workflows/python.yml)
10
10
  [![MIT licence](https://img.shields.io/badge/licence-MIT-D99A0E)](LICENSE)
11
11
 
12
- Bezel Charts is a set of free, open-source web components: ten chart tiles drawn in pure SVG, so they stay sharp on a phone, a 4K screen or a printed report. Build one in the Studio, paste one line of HTML into any site, or save any chart as a static SVG for a README, Notion page or slide, where JavaScript can't run.
12
+ Bezel Charts is a set of free, open-source web components: eleven chart tiles drawn in pure SVG, so they stay sharp on a phone, a 4K screen or a printed report. Build one in the Studio, paste one line of HTML into any site, or save any chart as a static SVG for a README, Notion page or slide, where JavaScript can't run.
13
13
 
14
14
  ![Bezel Charts: a sparkline, rings, a gauge, a line chart with a launch day note, a donut, a bar chart with a target, a scatter plot with a trend line and a year-long activity heatmap, in light and dark tiles](docs/bezel-charts.png)
15
15
 
@@ -20,7 +20,7 @@ Bezel Charts is a set of free, open-source web components: ten chart tiles drawn
20
20
  - **Made for READMEs.** Every chart exports as a clean static SVG, so a GitHub README can show a real chart.
21
21
  - **Data science friendly.** Scatter plots with a least-squares trend line and Pearson's r, grouped series, goal lines and notes on key points.
22
22
  - **Speaks your language.** Numbers and dates follow any locale, including Persian.
23
- - **Light.** About 16 kB gzipped for all ten charts, or 7 to 10 kB for a page that loads just one. No dependencies and no build step.
23
+ - **Light.** About 17 kB gzipped for all eleven charts, or 7 to 10 kB for a page that loads just one. No dependencies and no build step.
24
24
  - **Accessible.** Tab to any chart and step through its values with the arrow keys. Screen readers hear each value and get a hidden table of the data. Dashes, shapes and patterns tell series apart without relying on colour, and animation respects reduced-motion settings.
25
25
  - **Python too.** `pip install bezel-charts` draws the same charts straight from a pandas DataFrame, for notebooks, reports and READMEs.
26
26
 
@@ -49,7 +49,7 @@ A sibling of [Bezel](https://github.com/ShazMoghaddam/bezel), the clock, calenda
49
49
  <bezel-bars heading="Commits this week" values="4,9,6,3,8,5,3" labels="M,T,W,T,F,S,S" stat="total"></bezel-bars>
50
50
  ```
51
51
 
52
- `@1` always loads the latest 1.x release, so you get fixes without changing anything. To pin an exact version, use `@v1.3.0` instead.
52
+ `@1` always loads the latest 1.x release, so you get fixes without changing anything. To pin an exact version, use `@v1.4.0` instead.
53
53
 
54
54
  That's all. Charts fill the width of whatever they sit in and redraw when it changes, so they work in a sidebar, a card grid or a full-width section without extra CSS.
55
55
 
@@ -84,9 +84,9 @@ import { toSVG } from 'bezel-charts/line'; // render and toSVG work for every ch
84
84
  | Page | Gzipped |
85
85
  | --- | --- |
86
86
  | One sparkline, ring, donut, gauge, progress bar or heatmap | 7.2 to 7.4 kB |
87
- | One line, scatter or bar chart | 9.2 to 10.1 kB |
88
- | A line and a bar chart | 12.0 kB |
89
- | Every chart: the full bundle | 15.9 kB |
87
+ | One line, area, scatter or bar chart | 9.5 to 10.3 kB |
88
+ | A line and a bar chart | 12.6 kB |
89
+ | Every chart: the full bundle | 17.3 kB |
90
90
 
91
91
  Once a page needs four or five different charts, load the full bundle instead. `<bezel-chart type="…">` works with whichever charts are loaded, and tells you which file to add if its type isn't one of them. The classic `iife.js` script always has every chart, because a classic script can't load the shared file.
92
92
 
@@ -164,6 +164,28 @@ One or more lines over time, with an axis, a legend and notes on key moments. Se
164
164
  | `dash` | a line style per series: `solid`, `dashed`, `dotted`, `dashdot`. On its own, gives each series the next style | off |
165
165
  | `markers` | a shape on each point, per series: `circle`, `square`, `triangle`, `diamond`, `none`. On its own, gives each series the next shape | off |
166
166
 
167
+ ### `<bezel-area>`
168
+
169
+ Filled areas over time. Several series overlap as see-through fills, or add `stacked` to pile them up so the top edge is the total, or `stacked="percent"` to show how each total splits. The axis always starts at zero, since an area's height reads as an amount.
170
+
171
+ ```html
172
+ <bezel-area heading="Energy mix · GWh" values="120,130,125,140,150,160|80,85,90,88,95,100|40,45,60,70,85,110"
173
+ series="Gas,Nuclear,Wind" labels="2021,2022,2023,2024,2025,2026" stacked></bezel-area>
174
+ ```
175
+
176
+ | Attribute | Values | Default |
177
+ | ------------- | -------------------------------------------------------- | ------- |
178
+ | `values` | numbers, series separated by `\|` | |
179
+ | `series` | series names for the legend | |
180
+ | `labels` | one per point, along the bottom | |
181
+ | `stacked` | with several series: on its own to pile them up, or `percent` to scale each column to 100% | off |
182
+ | `height` | chart height in px | `170` |
183
+ | `straight` | boolean, straight edges instead of curves | off |
184
+ | `dash`, `markers` | styles for each series' top edge, as on line charts | off |
185
+ | `patterns` | a fill per series, as on bars | off |
186
+
187
+ The tooltip lists every series, plus the total when stacked, and each series' share in a percent stack. `show-values` writes each value, or the total above each column of a stack. Negative values stack below zero, as stacked bars do, but stacks read best when every value is positive: bands that swing between positive and negative cross over each other.
188
+
167
189
  ### `<bezel-bars>`
168
190
 
169
191
  Bars, vertical or horizontal. Give it more than one series and you get **grouped bars**, side by side with a legend, or add `stacked` to pile each group's series into one bar.
@@ -331,7 +353,7 @@ Any of the above, picked with `type`: `<bezel-chart type="donut" values="3,2,1">
331
353
  | `no-tooltips` | boolean, turns off hover, tap and keyboard values, and leaves the chart out of the Tab order | off |
332
354
  | `static` | boolean, skips the entrance animation | off |
333
355
 
334
- Not every option suits every chart: `notes` works on spark, line and scatter; `show-values` on spark, line and bars; `goal-label` on spark, line, bars and scatter; `stat` on everything except the gauge and scatter. The Studio only shows what applies.
356
+ Not every option suits every chart: `notes` works on spark, line, area and scatter; `show-values` on spark, line, area and bars; `goal-label` on spark, line, area, bars and scatter; `stat` on everything except the gauge and scatter. The Studio only shows what applies.
335
357
 
336
358
  ## Colours and dark mode
337
359
 
@@ -425,7 +447,7 @@ bc.line(df, x="month", y=["sales", "costs"], heading="Sales", prefix="£")
425
447
  bc.spark(df["signups"], heading="Signups").save("docs/signups.svg")
426
448
  ```
427
449
 
428
- All ten charts are available, and the Python output matches the JavaScript byte for byte, checked in CI. `chart.alt` gives ready-made alt text for the saved image. See the [Python README](python/README.md).
450
+ All eleven charts are available, and the Python output matches the JavaScript byte for byte, checked in CI. `chart.alt` gives ready-made alt text for the saved image. See the [Python README](python/README.md).
429
451
 
430
452
  ## Frameworks
431
453
 
@@ -458,7 +480,8 @@ npm run test:browser # click through every Studio control in a real browser (nee
458
480
 
459
481
  ```
460
482
  src/
461
- core/ shared helpers, the bezel frame and the colour themes; series.js has the extras for line, bars and scatter
483
+ core/ shared helpers, the bezel frame and the colour themes; series.js has the extras for line, area, bars
484
+ and scatter, and xy.js the axis frame line and area charts share
462
485
  charts/ one file per chart type: options in, SVG string out
463
486
  render.js picks the chart and returns its SVG
464
487
  element.js the custom element: sizing, theme, tooltips, keyboard and export
@@ -1,9 +1,11 @@
1
- /*! Bezel Charts v1.3.0 | MIT | github.com/ShazMoghaddam/bezel-charts */
2
- var BezelCharts=(()=>{var Ae=Object.defineProperty;var rr=Object.getOwnPropertyDescriptor;var ar=Object.getOwnPropertyNames;var nr=Object.prototype.hasOwnProperty;var ir=(t,e)=>{for(var r in e)Ae(t,r,{get:e[r],enumerable:!0})},lr=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ar(e))!nr.call(t,i)&&i!==r&&Ae(t,i,{get:()=>e[i],enumerable:!(l=rr(e,i))||l.enumerable});return t};var or=t=>lr(Ae({},"__esModule",{value:!0}),t);var yr={};ir(yr,{BezelChart:()=>Mt,render:()=>kt,themes:()=>Wt,toSVG:()=>Ct,types:()=>br,version:()=>xr});var at="ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif",vt="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace",sr=0;function Dt(t){return"bzc"+t+(++sr).toString(36)+Math.random().toString(36).slice(2,6)}function nt(t){return String(t??"").replace(/[&<>"']/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]})}function a(t){return Math.round(t*100)/100}function _(t,e,r){return Math.max(e,Math.min(r,t))}function I(t,e){var r=parseFloat(t);return isFinite(r)?r:e}function v(t){return t!=null&&t!==""}function K(t){return Array.isArray(t)?t.map(function(e){var r=+e;return isFinite(r)?r:0}):v(t)?String(t).split(/[\s,;]+/).filter(Boolean).map(function(e){var r=+e;return isFinite(r)?r:0}):[]}function P(t){return Array.isArray(t)?t.map(String):v(t)?String(t).split(",").map(function(e){return e.trim()}):[]}function At(t){return Array.isArray(t)?Array.isArray(t[0])?t.map(K):[K(t)]:v(t)?String(t).split("|").map(K).filter(function(e){return e.length}):[]}function Tt(t){return t.reduce(function(e,r){return e+r},0)}function bt(t,e,r){return String(t).length*e*(r?.6:.56)}function qt(t,e){return t=String(t),t.length>e?t.slice(0,Math.max(1,e-1))+"\u2026":t}function j(t){return t===!0||t===""||t==="true"||t==="1"}function h(t,e,r){if(!isFinite(t))return"\u2013";var l=Math.abs(t),i;v(e.decimals)?i=_(parseInt(e.decimals,10)||0,0,6):i=t%1===0?0:l<10?2:l<100?1:0;var n={maximumFractionDigits:i,minimumFractionDigits:v(e.decimals)?i:0};(j(e.compact)||r)&&l>=1e4&&(n={notation:"compact",maximumFractionDigits:1});var s;try{s=new Intl.NumberFormat(e.lang||"en-GB",n).format(l)}catch{s=String(a(l))}return(t<0?"\u2212":"")+(e.prefix||"")+s+(e.suffix||"")}function oe(t,e){if(!t.length)return"";for(var r="M"+a(t[0][0])+","+a(t[0][1]),l=1;l<t.length;l++){var i=t[l-1],n=t[l];if(e)r+="L"+a(n[0])+","+a(n[1]);else{var s=(i[0]+n[0])/2;r+="C"+a(s)+","+a(i[1])+" "+a(s)+","+a(n[1])+" "+a(n[0])+","+a(n[1])}}return r}function S(t,e,r,l){return'<text x="'+a(t)+'" y="'+a(e)+'" '+(l||"")+">"+nt(r)+"</text>"}function $(t,e,r,l){return'fill="'+(l||t.muted)+'" font-family="'+vt+'" font-size="'+(e||10)+'"'+(r?" "+r:"")}function yt(t,e,r,l,i){return'<rect class="bzc-hit" x="'+a(t)+'" y="'+a(e)+'" width="'+a(Math.max(1,r))+'" height="'+a(Math.max(1,l))+'" fill="#000" fill-opacity="0" data-tip="'+nt(i)+'"/>'}function lt(t,e,r){return t.animate?' class="'+e+'"'+(r?' style="animation-delay:'+a(r)+'s"':""):""}function ut(t,e){var r=P(t.color).filter(Boolean);return r.length?r:e.palette}function ht(t,e,r,l,i){return S(e+l/2,r+i/2+4,"No data yet",'text-anchor="middle" fill="'+t.muted+'" font-family="'+at+'" font-size="13"')}function Kt(t,e){return v(t.notes)?String(t.notes).split(";").map(function(r){var l=r.indexOf(":");if(l<0)return null;var i=r.slice(0,l).trim(),n=r.slice(l+1).trim(),s=e.map(String).indexOf(i);return s<0&&String(parseInt(i,10))===i&&(s=parseInt(i,10)),s>=0&&n?{i:s,text:n}:null}).filter(Boolean):[]}function Pt(t,e,r,l,i){var n=(v(t.goalLabel)?t.goalLabel:"Goal")+" "+h(I(t.goal,0),t);return'<line x1="'+a(r)+'" x2="'+a(l)+'" y1="'+a(i)+'" y2="'+a(i)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-width="1.25" stroke-dasharray="4 4"/>'+S(l,i-5,n,$(e,10,'text-anchor="end"'))}function zt(t,e,r){var l=String(v(e.stat)?e.stat:r||"").toLowerCase();if(!l||l==="none"||!t.length)return null;var i=Tt(t),n={last:t[t.length-1],total:i,sum:i,average:i/t.length,avg:i/t.length,max:Math.max.apply(null,t),min:Math.min.apply(null,t)};if(!(l in n))return null;var s=null;return l==="last"&&t.length>1&&e.delta!=="none"&&(s=t[t.length-1]-t[0]),{val:n[l],delta:s}}function Yt(t){var e=Math.round(_(I(t.width,360),160,2400)),r=t.frame==="none"?0:4,l=t.frame==="none"?8:20;return{W:e,b:r,P:l,w:e-2*(r+l)}}var fr=".bzc-a{animation:bzc-in .6s ease both}.bzc-d{animation:bzc-draw 1.1s cubic-bezier(.3,.7,.2,1) both}.bzc-g{transform-box:fill-box;transform-origin:50% 100%;animation:bzc-grow .7s cubic-bezier(.2,.8,.2,1) both}.bzc-gn{transform-box:fill-box;transform-origin:50% 0;animation:bzc-grow .7s cubic-bezier(.2,.8,.2,1) both}.bzc-gx{transform-box:fill-box;transform-origin:0 50%;animation:bzc-growx .8s cubic-bezier(.2,.8,.2,1) both}.bzc-s{animation:bzc-sweep 1.1s cubic-bezier(.2,.8,.2,1) both}@keyframes bzc-in{from{opacity:0}}@keyframes bzc-draw{from{stroke-dashoffset:1}}@keyframes bzc-grow{from{transform:scaleY(0)}}@keyframes bzc-growx{from{transform:scaleX(0)}}@keyframes bzc-sweep{from{stroke-dasharray:0 100}}@media (prefers-reduced-motion:reduce){[class^=bzc-]{animation:none!important}}";function mt(t,e,r,l,i){var n=Yt(t),s=n.W,o=n.b,c=n.P,x=n.w,g=_(I(t.corners,22),0,60),d=o+c,f="";v(t.heading)&&(f+=S(o+c,d+10,String(t.heading).toUpperCase(),$(e,11,'font-weight="600" letter-spacing="1.3"')),d+=24);var C=i&&i.stat;if(C){if(f+=S(o+c,d+30,h(C.val,t),'fill="'+e.fg+'" font-family="'+at+'" font-size="32" font-weight="800" letter-spacing="-0.5"'),C.delta!=null){var z=C.delta>0,B=C.delta===0,F=t.delta==="inverse"?!z:z,b=B?e.muted:F?e.up:e.down,L=(B?"\u25CF ":z?"\u25B2 ":"\u25BC ")+h(Math.abs(C.delta),t)+" "+(v(t.deltaLabel)?t.deltaLabel:"since start");f+=S(o+c+x,d+28,L,'text-anchor="end" fill="'+b+'" font-family="'+vt+'" font-size="11" font-weight="600"')}d+=44}var m=l(o+c,d,x,r),A=Math.round(d+r+c+o),E="";t.frame!=="none"?E='<rect width="'+s+'" height="'+A+'" rx="'+g+'" fill="'+e.bezel+'"/><rect x="'+o+'" y="'+o+'" width="'+(s-2*o)+'" height="'+(A-2*o)+'" rx="'+Math.max(0,g-o)+'" fill="'+(t.background||e.tile)+'"/>':v(t.background)&&(E='<rect width="'+s+'" height="'+A+'" rx="'+g+'" fill="'+t.background+'"/>');var y=(v(t.heading)?t.heading+": ":"")+(i&&i.summary||"chart");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+s+" "+A+'" width="'+s+'" height="'+A+'" role="img" aria-label="'+nt(y)+'"><title>'+nt(y)+"</title>"+(t.animate?"<style>"+fr+"</style>":"")+E+f+m+"</svg>"}function se(t,e){var r=K(t.values),l=ut(t,e)[0],i=I(t.height,64),n=P(t.labels),s=Kt(t,n),o=zt(r,t,"last");return mt(t,e,i,function(c,x,g,d){if(!r.length)return ht(e,c,x,g,d);var f=r.length===1?[r[0],r[0]]:r,C=Math.min.apply(null,f),z=Math.max.apply(null,f);v(t.goal)&&(C=Math.min(C,+t.goal),z=Math.max(z,+t.goal));var B=(z-C||Math.abs(z)||1)*.12;C-=B,z+=B;var F=function(k){return c+k*g/(f.length-1)},b=function(k){return x+d-(k-C)/(z-C)*d},L=f.map(function(k,p){return[F(p),b(k)]}),m=oe(L,j(t.straight)),A=Dt("g"),E=L[L.length-1],y='<defs><linearGradient id="'+A+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+l+'" stop-opacity=".32"/><stop offset="1" stop-color="'+l+'" stop-opacity="0"/></linearGradient></defs>';[1/3,2/3].forEach(function(k){y+='<line x1="'+c+'" x2="'+(c+g)+'" y1="'+a(x+d*k)+'" y2="'+a(x+d*k)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'}),y+='<path d="'+m+"L"+a(E[0])+","+(x+d)+"L"+c+","+(x+d)+'Z" fill="url(#'+A+')"'+lt(t,"bzc-a")+"/>",y+='<path d="'+m+'" fill="none" stroke="'+l+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1"'+lt(t,"bzc-d")+"/>",v(t.goal)&&(y+=Pt(t,e,c,c+g,b(+t.goal))),s.forEach(function(k){if(!(k.i>=r.length)){var p=L[k.i];y+='<circle cx="'+a(p[0])+'" cy="'+a(p[1])+'" r="3.5" fill="'+e.fg+'"/>'+S(_(p[0],c+30,c+g-30),p[1]-9,k.text,$(e,10,'text-anchor="middle"',e.fg))}}),y+='<circle cx="'+a(E[0])+'" cy="'+a(E[1])+'" r="9" fill="'+l+'" fill-opacity=".25"/><circle cx="'+a(E[0])+'" cy="'+a(E[1])+'" r="4.5" fill="'+l+'"/>',j(t.showValues)&&L.forEach(function(k,p){p<r.length&&(y+=S(k[0],k[1]-8,h(r[p],t,!0),$(e,9,'text-anchor="middle"')))});var O=r.length>1?g/(r.length-1):g;return r.forEach(function(k,p){y+=yt(F(p)-O/2,x-6,O,d+12,(n[p]||"#"+(p+1))+": "+h(k,t))}),y},{stat:o,summary:r.length?"latest "+h(r[r.length-1],t):"no data"})}se.table=function(t){var e=P(t.labels);return{head:["Label","Value"],rows:K(t.values).map(function(r,l){return[e[l]||"#"+(l+1),h(r,t)]})}};var Wt={dark:{tile:"#15151d",bezel:"#000000",fg:"#f2f1f7",muted:"#8c8aa0",grid:"#2a2935",up:"#5EE6C8",down:"#F675A8",palette:["#9FA1FF","#F675A8","#5EE6C8","#FFC857","#7CC4FF","#FF8A5B"]},light:{tile:"#ffffff",bezel:"#000000",fg:"#17161f",muted:"#6b6980",grid:"#e8e6ef",up:"#12a383",down:"#d63f7c",palette:["#6E70F0","#E2508C","#16A884","#D99A0E","#2F8FE0","#EE6431"]}};var fe=["spark","line","bars","scatter","ring","donut","gauge","progress","heatmap"],ce={};function pt(t,e){ce[t]=e}var cr=t=>t.replace(/-([a-z])/g,(e,r)=>r.toUpperCase());function De(t,e){if(!ce[t])throw new Error(fe.includes(t)?`Bezel Charts: the ${t} chart isn't loaded. Add import 'bezel-charts/${t}', or load dist/charts/${t}.js.`:`Bezel Charts: unknown chart type "${t}". Choose one of: ${fe.join(", ")}.`);let r={};for(let[l,i]of Object.entries(e))r[cr(l)]=i;return r}function kt(t,e={}){let r=De(t,e);r.animate=j(r.animate),r.frame=r.frame==="none"?"none":"bezel";let l=r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme||"dark";return ce[t](r,Wt[l])}function Pe(t,e={}){return ce[t].table(De(t,e))}function Oe(t){return t.replace(/<rect class="bzc-hit"[^>]*\/>/g,"").replace(/<circle[^>]* class="bzc-hit"[^>]*\/>/g,"").replace(/ data-tip="[^"]*"/g,"")}function Ct(t,e={}){return Oe(kt(t,{...e,animate:!1}))}var Ue=["type","values","labels","series","heading","prefix","suffix","decimals","compact","color","theme","frame","width","height","goal","goal-label","notes","show-values","stat","delta","delta-label","max","min","value","zones","horizontal","straight","zero","start","lang","corners","background","center-label","highlight","x","y","x-label","y-label","trend","static","no-tooltips","stacked","angle-labels","dash","markers","patterns"],ur=`:host{display:block;position:relative;max-width:100%}:host([hidden]){display:none}svg{display:block;max-width:100%;height:auto;overflow:visible}.tip{position:absolute;left:0;top:0;pointer-events:none;background:#0b0b10;color:#f2f1f7;font:600 12px/1.5 ${vt};padding:7px 10px;border-radius:10px;white-space:pre;opacity:0;transform:translate(-50%,calc(-100% - 12px));transition:opacity .12s;z-index:3;border:1px solid #2a2935;box-shadow:0 8px 24px rgba(0,0,0,.35)}.tip.on{opacity:1}.c{outline:none}.c:focus-visible{outline:2px solid #fff;outline-offset:3px;box-shadow:0 0 0 7px #000}.k{stroke:currentColor;stroke-width:2;stroke-opacity:1}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media (forced-colors:active){.c:focus-visible{outline-color:Highlight}}`,hr={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1},mr=()=>typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null,pr=()=>{let t=typeof document<"u"&&document.documentElement?.getAttribute?.("data-theme");return t==="light"||t==="dark"?t:null},Te=new Set;typeof MutationObserver=="function"&&typeof document<"u"&&document.documentElement&&new MutationObserver(()=>Te.forEach(t=>t.refresh())).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});var dr=typeof HTMLElement>"u"?class{}:HTMLElement,Mt=class extends dr{static get observedAttributes(){return Ue}static get themes(){return Wt}get resolvedTheme(){let e=this.getAttribute("theme");return e==="light"||e==="dark"?e:this.options.autoTheme}get chartType(){return this.getAttribute("type")||"spark"}connectedCallback(){this.shadowRoot||(this.attachShadow({mode:"open"}).innerHTML=`<style>${ur}</style><div class="c" role="group" aria-roledescription="chart"></div><p class="sr" id="h">Use the arrow keys to step through the values.</p><div class="tip" aria-hidden="true"></div><div class="sr" aria-live="polite"></div><div class="sr"></div>`,[,this.#t,,this.#r,this.#o,this.#c]=this.shadowRoot.children,this.shadowRoot.addEventListener("pointermove",e=>this.#h(e)),this.shadowRoot.addEventListener("pointerdown",e=>this.#h(e)),this.addEventListener("pointerleave",()=>this.#r.classList.remove("on")),this.#t.addEventListener("keydown",e=>this.#v(e)),this.#t.addEventListener("blur",()=>this.#g())),Te.add(this),this.#a=mr(),this.#a?.addEventListener?.("change",this.#u),typeof ResizeObserver=="function"?(this.#l=new ResizeObserver(([e])=>{let r=Math.round(e.contentRect.width);(!this.#n||!this.hasAttribute("width")&&r>0&&Math.abs(r-this.#s)>1)&&this.#i()}),this.#l.observe(this)):this.#i()}disconnectedCallback(){Te.delete(this),this.#l?.disconnect(),this.#a?.removeEventListener?.("change",this.#u)}attributeChangedCallback(){!this.#n||this.#f||(this.#f=!0,queueMicrotask(()=>{this.#f=!1,this.#i()}))}get options(){let e={};for(let r of Ue)this.hasAttribute(r)&&(e[r]=this.getAttribute(r));return e.width||(e.width=this.#s||360),e.autoTheme=pr()||(this.#a?this.#a.matches?"dark":"light":"dark"),e}refresh(){this.#n&&this.#i()}toSVG(e={}){return Oe(kt(this.chartType,{...this.options,...e,animate:!1}))}download(e){let r=URL.createObjectURL(new Blob([this.toSVG()],{type:"image/svg+xml"})),l=Object.assign(document.createElement("a"),{href:r,download:`${(e||this.getAttribute("heading")||this.chartType).replace(/[^\w-]+/g,"-").toLowerCase()}.svg`});document.body.append(l),l.click(),l.remove(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}#l=null;#t=null;#r=null;#o=null;#c=null;#e=-1;#a=null;#s=0;#n=!1;#f=!1;#u=()=>{let e=this.getAttribute("theme");(!e||e==="auto")&&this.refresh()};#i(){if(!this.shadowRoot)return;let e=Math.round(this.getBoundingClientRect?.().width||0);this.#s=e>0?e:360;let r=this.options;r.animate=!this.#n&&!this.hasAttribute("static");let l,i=null;try{l=kt(this.chartType,r),i=Pe(this.chartType,r)}catch(c){l=`<p style="font:13px ${at};color:#d63f7c">${nt(c.message)}</p>`}let n=this.#t;n.innerHTML=l.replace(/<title>[\s\S]*?<\/title>/,"");let s=n.querySelector("svg");s?(n.setAttribute("aria-label",s.getAttribute("aria-label")),s.removeAttribute("role"),s.removeAttribute("aria-label"),s.setAttribute("aria-hidden","true")):n.removeAttribute("aria-label");let o=!!s&&!this.hasAttribute("no-tooltips");o?(n.setAttribute("tabindex","0"),n.setAttribute("aria-describedby","h")):(n.removeAttribute("tabindex"),n.removeAttribute("aria-describedby")),n.style.color=Wt[r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme].fg,n.style.borderRadius=`${r.frame==="none"?4:_(+r.corners||22,0,60)}px`,this.#c.innerHTML=i&&i.rows.length?gr(r.heading,i):"",this.#e>=0&&o&&this.shadowRoot.activeElement===n?this.#d(this.#e):this.#e=-1,this.#n=!0,this.dispatchEvent(new CustomEvent("bezel-render",{bubbles:!0}))}#h(e){if(this.hasAttribute("no-tooltips"))return;let r=e.target?.closest?.("[data-tip]");if(!r){this.#r.classList.remove("on");return}this.#m(r,e.clientX,e.clientY)}#m(e,r,l){let i=this.#r;i.textContent=e.getAttribute("data-tip");let n=this.getBoundingClientRect?.()||{left:0,top:0,width:0},s=i.offsetWidth/2;i.style.left=`${_(r-n.left,s,Math.max(s,n.width-s))}px`,i.style.top=`${l-n.top}px`,i.classList.add("on")}#p(){return[...this.#t.querySelectorAll("[data-tip]:not([data-skip])")]}#v(e){let r=this.#p(),l=r.length;if(!l)return;let i=this.#e,n=hr[e.key];if(n)this.chartType==="heatmap"&&/Left|Right/.test(e.key)&&(n*=7),i=i<0?n>0?0:l-1:_(i+n,0,l-1);else if(e.key==="Home"||e.key==="End")i=e.key==="Home"?0:l-1;else{e.key==="Escape"&&this.#g();return}e.preventDefault(),this.#d(i,!0)}#d(e,r){let l=this.#p();if(!l.length)return;e=_(e,0,l.length-1),this.#t.querySelector(".k")?.classList.remove("k");let i=l[e],n=i.getBoundingClientRect?.()||{left:0,top:0,width:0};i.classList.add("k"),this.#e=e,this.#m(i,n.left+n.width/2,n.top),r&&(this.#o.textContent=`${i.getAttribute("data-tip").replace(/\n/g,", ")}. ${e+1} of ${l.length}`)}#g(){this.#t.querySelector(".k")?.classList.remove("k"),this.#r.classList.remove("on"),this.#o.textContent="",this.#e=-1}};function gr(t,{head:e,rows:r}){let l=i=>i.map((n,s)=>s?`<td>${nt(n)}</td>`:`<th scope="row">${nt(n)}</th>`).join("");return`<table><caption>${nt(t||"Chart data")}</caption><thead><tr>${e.map(i=>`<th scope="col">${nt(i)}</th>`).join("")}</tr></thead><tbody>${r.map(i=>`<tr>${l(i)}</tr>`).join("")}</tbody></table>`}function dt(t){typeof customElements>"u"||typeof HTMLElement>"u"||(customElements.get(`bezel-${t}`)||customElements.define(`bezel-${t}`,class extends Mt{get chartType(){return t}}),customElements.get("bezel-chart")||customElements.define("bezel-chart",class extends Mt{}))}pt("spark",se);dt("spark");function ie(t,e,r){if(t===e)if(t===0)e=1;else{var l=Math.abs(t)*.1;t-=l,e+=l}for(var i=(e-t)/(r||4),n=Math.pow(10,Math.floor(Math.log10(i))),s=i/n,o=(s<=1?1:s<=2?2:s<=5?5:10)*n,c=Math.floor(t/o)*o,x=Math.ceil(e/o)*o,g=[],d=c;d<=x+o/2;d+=o)g.push(+d.toFixed(10));return{lo:c,hi:x,ticks:g}}function Xt(t,e,r,l,i,n,s,o){var c=l,x=i,g="",d=o||13;return t.forEach(function(f,C){var z=d+bt(f,12)+16;c>l&&c+z-16>l+n&&(c=l,x+=20),g+=(s?s(C,c,x):'<circle cx="'+a(c+4)+'" cy="'+a(x+6)+'" r="4" fill="'+e[C%e.length]+'"/>')+S(c+d,x+10,f,'fill="'+r.fg+'" font-family="'+at+'" font-size="12"'),c+=z}),{svg:g,height:x-i+24}}var ue={solid:"",dashed:"7 5",dotted:"1 5",dashdot:"9 4 1 4"},he=["circle","square","triangle","diamond"],Ie=["solid","stripes","dots","grid"];function _t(t,e,r){if(t==null||t===!1||t==="none"||t==="false")return null;var l=t===!0||t===""||t==="auto"?e:P(t).map(function(i){return e.indexOf(i)<0?r:i});return l.length?function(i){return l[i%l.length]}:null}function jt(t,e,r,l,i){var n=l*1.15,s=l*.85;return t==="square"?'<rect x="'+a(e-s)+'" y="'+a(r-s)+'" width="'+a(2*s)+'" height="'+a(2*s)+'" rx="1"'+i+"/>":t==="triangle"?'<path d="M'+a(e)+","+a(r-n)+"L"+a(e+n)+","+a(r+s)+"L"+a(e-n)+","+a(r+s)+'Z"'+i+"/>":t==="diamond"?'<path d="M'+a(e)+","+a(r-n*1.1)+"L"+a(e+n)+","+a(r)+"L"+a(e)+","+a(r+n*1.1)+"L"+a(e-n)+","+a(r)+'Z"'+i+"/>":'<circle cx="'+a(e)+'" cy="'+a(r)+'" r="'+a(l)+'"'+i+"/>"}function qe(t,e,r,l){var i=' stroke="'+l+'" stroke-opacity=".55" stroke-width="1.5"';return'<pattern id="'+t+'" width="6" height="6" patternUnits="userSpaceOnUse"'+(e==="dots"?"":' patternTransform="rotate(45)"')+'><rect width="6" height="6" fill="'+r+'"/>'+(e==="dots"?'<circle cx="3" cy="3" r="1.3" fill="'+l+'" fill-opacity=".55"/>':'<path d="M3,0V6'+(e==="grid"?"M0,3H6":"")+'"'+i+"/>")+"</pattern>"}function Ye(t){return Math.max.apply(null,t.map(function(e){return bt(e,10,!0)}))+10}function me(t,e){for(var r=At(t.values),l=P(t.series),i=P(t.labels),n=[],s=Math.max.apply(null,[0].concat(r.map(function(d){return d.length}))),o=0;o<s;o++){var c=[i[o]||"#"+(o+1)],x=0;r.forEach(function(d){c.push(o<d.length?h(d[o],t):""),x+=o<d.length?d[o]:0}),e&&c.push(h(x,t)),n.push(c)}var g=r.length>1||l.length?r.map(function(d,f){return l[f]||"Series "+(f+1)}):["Value"];return{head:["Label"].concat(g,e?["Total"]:[]),rows:n}}function pe(t,e){var r=At(t.values),l=P(t.series),i=P(t.labels),n=ut(t,e),s=I(t.height,170),o=Math.max.apply(null,[0].concat(r.map(function(B){return B.length}))),c=Kt(t,i),x=r.length>1||l.length>0,g=zt(r[0]||[],t,""),d=_t(t.dash,Object.keys(ue),"solid"),f=_t(t.markers,he,"none"),C=t.background||e.tile,z=(d||f)&&function(B,F,b){var L=n[B%n.length],m=d?ue[d(B)]:"",A=f?f(B):"none";return'<line x1="'+a(F)+'" x2="'+a(F+18)+'" y1="'+a(b+6)+'" y2="'+a(b+6)+'" stroke="'+L+'" stroke-width="2.5" stroke-linecap="round"'+(m?' stroke-dasharray="'+m+'"':"")+"/>"+(A!=="none"?jt(A,F+9,b+6,3.5,' fill="'+L+'" stroke="'+C+'" stroke-width="1.5"'):"")};return mt(t,e,s,function(B,F,b,L){if(!o)return ht(e,B,F,b,L);var m="",A=F;if(x){var E=Xt(r.map(function(R,u){return l[u]||"Series "+(u+1)}),n,e,B,A,b,z,z&&24);m+=E.svg,A+=E.height}var y=[].concat.apply([],r),O=Math.min.apply(null,y),k=Math.max.apply(null,y);v(t.goal)&&(O=Math.min(O,+t.goal),k=Math.max(k,+t.goal)),j(t.zero)&&(O=Math.min(0,O),k=Math.max(0,k));var p=ie(O,k,4),D=p.ticks.map(function(R){return h(R,t,!0)}),M=Math.max.apply(null,D.map(function(R){return bt(R,10,!0)}))+10,w=i.length?20:4,T=B+M,U=b-M,q=L-(A-F)-w,tt=function(R){return o===1?T+U/2:T+R*U/(o-1)},Q=function(R){return A+q-(R-p.lo)/(p.hi-p.lo)*q};if(p.ticks.forEach(function(R,u){var G=Q(R);m+='<line x1="'+a(T)+'" x2="'+a(T+U)+'" y1="'+a(G)+'" y2="'+a(G)+'" stroke="'+e.grid+'"'+(R===0?"":' stroke-dasharray="2 4"')+"/>"+S(T-8,G+3.5,D[u],$(e,10,'text-anchor="end"'))}),i.length){for(var ot=Math.max(1,Math.ceil(o*(Math.max.apply(null,i.map(function(R){return bt(R,10,!0)}))+10)/U)),Y=0;Y<o;Y+=ot)if(i[Y]!=null){var J=o>1&&Y===0?"start":o>1&&Y===o-1?"end":"middle";m+=S(tt(Y),A+q+15,i[Y],$(e,10,'text-anchor="'+J+'"'))}}c.forEach(function(R){if(!(R.i>=o)){var u=tt(R.i);m+='<line x1="'+a(u)+'" x2="'+a(u)+'" y1="'+a(A+12)+'" y2="'+a(A+q)+'" stroke="'+e.fg+'" stroke-opacity=".4" stroke-dasharray="3 3"/>'+S(_(u,T+30,T+U-30),A+8,R.text,$(e,10,'text-anchor="middle"',e.fg))}}),r.forEach(function(R,u){var G=n[u%n.length],N=R.map(function(X,ft){return[tt(ft),Q(X)]});N.length===1&&(N=[[T,N[0][1]],[T+U,N[0][1]]]);var et=oe(N,j(t.straight));if(u===0){var W=Dt("g"),xt=N[N.length-1];m+='<defs><linearGradient id="'+W+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+G+'" stop-opacity=".26"/><stop offset="1" stop-color="'+G+'" stop-opacity="0"/></linearGradient></defs><path d="'+et+"L"+a(xt[0])+","+a(A+q)+"L"+a(N[0][0])+","+a(A+q)+'Z" fill="url(#'+W+')"'+lt(t,"bzc-a")+"/>"}var wt=d?ue[d(u)]:"",Et=f?f(u):"none";if(m+=wt?'<path d="'+et+'" fill="none" stroke="'+G+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="'+wt+'"'+lt(t,"bzc-a",u*.15)+"/>":'<path d="'+et+'" fill="none" stroke="'+G+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1'+(t.animate?";animation-delay:"+u*.15+"s":"")+'"'+(t.animate?' class="bzc-d"':"")+"/>",Et!=="none"){var V=Math.ceil(R.length/40);R.forEach(function(X,ft){(ft%V===0||ft===R.length-1)&&(m+=jt(Et,tt(ft),Q(X),3.5,' fill="'+G+'" stroke="'+C+'" stroke-width="1.5"'+lt(t,"bzc-a",.6+u*.15)))})}else{var Z=N[N.length-1];m+='<circle cx="'+a(Z[0])+'" cy="'+a(Z[1])+'" r="4" fill="'+G+'" stroke="'+C+'" stroke-width="2"/>'}j(t.showValues)&&R.forEach(function(X,ft){m+=S(tt(ft),Q(X)-8,h(X,t,!0),$(e,9,'text-anchor="middle"'))})}),v(t.goal)&&(m+=Pt(t,e,T,T+U,Q(+t.goal)));for(var Ft=o>1?U/(o-1):U,st=0;st<o;st++){var gt=i[st]||"#"+(st+1);r.forEach(function(R,u){st<R.length&&(gt+=`
3
- `+(x?(l[u]||"Series "+(u+1))+": ":"")+h(R[st],t))}),m+=yt(tt(st)-Ft/2,A,Ft,q,gt)}return m},{stat:g,summary:r.length+" series over "+o+" points"})}pe.table=function(t){return me(t)};pt("line",pe);dt("line");var We=40,Xe=24;function de(t,e){for(var r=At(t.values),l=P(t.series),i=P(t.labels),n=ut(t,e),s=r.length,o=Math.max.apply(null,[0].concat(r.map(function(u){return u.length}))),c=s>1,x=j(t.horizontal),g=c&&j(t.stacked),d=!c&&P(t.color).filter(Boolean).length>1,f=r[0]||[],C=[].concat.apply([],r),z=function(u,G){return r.reduce(function(N,et){return u<et.length&&et[u]*G>0?N+et[u]:N},0)},B=[],F=[],b=[],L=0;g&&L<o;L++)F.push(z(L,1)),b.push(z(L,-1)),B.push(F[L]+b[L]);for(var m=g?F.concat(b):C,A=m.length?Math.max.apply(null,m):0,E=function(u){return l[u]||"Series "+(u+1)},y=c?_t(t.patterns,Ie,"solid"):null,O="",k=[],p=0;y&&p<s;p++)if(y(p)!=="solid"){var D=Dt("g");O+=qe(D,y(p),n[p%n.length],t.background||e.tile),k[p]="url(#"+D+")"}var M=function(u,G){return c?k[u]||n[u%n.length]:d?n[G%n.length]:n[0]},w=y&&function(u,G,N){return'<rect x="'+a(G)+'" y="'+a(N+1)+'" width="10" height="10" rx="2" fill="'+M(u)+'"/>'},T=function(u){return c||d||t.highlight==="none"||u===A?1:.5},U=function(u){return i[u]||"#"+(u+1)},q=function(u){return c?U(u)+r.map(function(G,N){return u<G.length?`
4
- `+E(N)+": "+h(G[u],t):""}).join("")+(g?`
5
- Total: `+h(B[u],t):""):U(u)+": "+h(f[u],t)},tt=Yt(t),Q=c||l.length?Xt(r.map(function(u,G){return E(G)}),n,e,0,0,tt.w,w,w&&15).height:0,ot=g?1:s,Y=c&&!g,J=Y?10:14,Ft=3,st=x?ot*J+(ot-1)*Ft+(Y?14:16):0,gt=x?Q+Math.max(1,o)*st-6:I(t.height,140)+Q,R=f.indexOf(Math.max.apply(null,f.length?f:[0]));return mt(t,e,gt,function(u,G,N,et){if(!o)return ht(e,u,G,N,et);var W=O?"<defs>"+O+"</defs>":"",xt=G;Q&&(W+=Xt(r.map(function(H,rt){return E(rt)}),n,e,u,G,N,w,w&&15).svg,xt+=Q);var wt=Math.min(0,Math.min.apply(null,m)),Et=Math.max(0,A);if(v(t.goal)&&(wt=Math.min(wt,+t.goal),Et=Math.max(Et,+t.goal)),Et===wt&&(Et=wt+1),x){for(var V=i.length?Math.min(N*.4,Math.max.apply(null,i.map(function(H){return bt(H,12)}))+10):0,Z=g?[B.map(function(H){return h(H,t)})]:r.map(function(H){return H.map(function(rt){return h(rt,t)})}),X=Math.max.apply(null,[].concat.apply([],Z).map(function(H){return bt(H,Y?10:11,!0)}))+10,ft=u+V,Ot=N-V-X,$t=Math.max(Et,0)||1,it=0;it<o;it++){var Nt=xt+it*st;i[it]!=null&&(W+=S(u,Nt+(st-6)/2+4,qt(i[it],Math.floor(V/6.7)),'fill="'+e.fg+'" font-family="'+at+'" font-size="12"')),g?(W+=Je(it,ft,Nt+5,Ot,$t),W+=S(u+N,Nt+5+J/2+3.8,Z[0][it],'text-anchor="end" fill="'+e.fg+'" font-family="'+vt+'" font-size="11" font-weight="600"')):r.forEach(function(H,rt){if(!(it>=H.length)){var ct=H[it],Lt=Nt+(c?2:5)+rt*(J+Ft),Gt=Math.max(0,ct)/$t*Ot;c||(W+='<rect x="'+a(ft)+'" y="'+a(Lt)+'" width="'+a(Ot)+'" height="'+J+'" rx="'+J/2+'" fill="'+e.grid+'" fill-opacity=".6"/>'),Gt>0&&(W+='<rect x="'+a(ft)+'" y="'+a(Lt)+'" width="'+a(Math.max(J,Gt))+'" height="'+J+'" rx="'+J/2+'" fill="'+M(rt,it)+'" fill-opacity="'+T(ct)+'"'+lt(t,"bzc-gx",it*.06+rt*.03)+"/>"),W+=S(u+N,Lt+J/2+3.8,Z[rt][it],'text-anchor="end" fill="'+e.fg+'" font-family="'+vt+'" font-size="'+(c?10:11)+'" font-weight="600"')}}),W+=yt(u,Nt,N,st-6,q(it))}if(v(t.goal)&&+t.goal>0){var Ce=ft+ +t.goal/$t*Ot;W+='<line x1="'+a(Ce)+'" x2="'+a(Ce)+'" y1="'+a(xt-2)+'" y2="'+a(G+et+2)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-dasharray="3 3"/>'}return W}function Je(H,rt,ct,Lt,Gt){var Rt='<rect x="'+a(rt)+'" y="'+a(ct)+'" width="'+a(Lt)+'" height="'+J+'" rx="'+J/2+'" fill="'+e.grid+'" fill-opacity=".6"/>',Qt=0;return r.forEach(function(ae,Vt){var Jt=H<ae.length?ae[H]:0,Ht=Math.max(0,Jt)/Gt*Lt;if(!(Ht<=0)){var It=Qt>0?1.5:0;Rt+='<rect x="'+a(rt+Qt+It)+'" y="'+a(ct)+'" width="'+a(Math.max(2,Ht-It))+'" height="'+J+'" rx="'+a(Math.min(3,Ht/2))+'" fill="'+M(Vt,H)+'"'+lt(t,"bzc-gx",H*.06+Vt*.03)+"/>",Qt+=Ht}}),Rt}var Fe=i.length?Math.max.apply(null,i.map(function(H){return bt(H,10,!0)})):0,Me=i.length?Math.max(1,Math.ceil(o*(Fe+8)/N)):1,te=j(t.angleLabels)&&Me>1,Ne=We*Math.PI/180,Be=function(H){return te?qt(H,Xe):H};if(te){var Ke=N/o,Zt=0;i.forEach(function(H,rt){Zt=Math.max(Zt,Math.cos(Ne)*bt(Be(H),10,!0)+4-(rt+.5)*Ke)}),Zt=Math.min(Zt,N*.25),u+=Zt,N-=Zt,Me=1}var Ge=j(t.showValues)&&wt<0?14:0,je=te?Math.ceil(Math.sin(Ne)*Math.min(Fe,bt("x".repeat(Xe),10,!0)))+18:20,tr=(i.length?je:2)+Ge,Re=j(t.showValues)?16:4,we=et-(xt-G)-tr-Re,Ve=xt+Re,Bt=function(H){return Ve+we-(H-wt)/(Et-wt)*we},ee=N/o,re=Math.min(ee*(Y?.78:.62),Y?s*30:56),He=Y?Math.min(3,re/s*.15):0,Ut=g?re:(re-He*(s-1))/s,le=Bt(0);W+='<line x1="'+u+'" x2="'+(u+N)+'" y1="'+a(le)+'" y2="'+a(le)+'" stroke="'+e.grid+'"/>';for(var St=0;St<o;St++){var Se=u+St*ee+(ee-re)/2;if(g?W+=er(St,Se):r.forEach(function(H,rt){if(!(St>=H.length)){var ct=H[St],Lt=Se+rt*(Ut+He),Gt=Math.min(Bt(ct),le),Rt=Math.abs(Bt(ct)-le);Rt>.5&&(W+='<rect x="'+a(Lt)+'" y="'+a(Gt)+'" width="'+a(Ut)+'" height="'+a(Rt)+'" rx="'+a(Math.min(6,Ut/2,Rt/2))+'" fill="'+M(rt,St)+'" fill-opacity="'+T(ct)+'"'+lt(t,ct<0?"bzc-gn":"bzc-g",St*.05+rt*.03)+"/>"),j(t.showValues)&&(W+=S(Lt+Ut/2,ct<0?Bt(ct)+12:Bt(ct)-5,h(ct,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+vt+'" font-size="'+(c?9:10)+'" font-weight="600"'))}}),i[St]!=null&&St%Me===0){var ze=Se+re/2,Ee=Ve+we+Ge+(te?12:15);W+=te?S(ze,Ee,Be(i[St]),$(e,10,'text-anchor="end" transform="rotate(-'+We+" "+a(ze)+" "+a(Ee)+')"')):S(ze,Ee,i[St],$(e,10,'text-anchor="middle"'))}W+=yt(u+St*ee,xt,ee,et-(xt-G),q(St))}return v(t.goal)&&(W+=Pt(t,e,u,u+N,Bt(+t.goal))),W;function er(H,rt){var ct="",Lt=0,Gt=0;if(r.forEach(function(Qt,ae){var Vt=H<Qt.length?Qt[H]:0;if(Vt){var Jt=Vt>0?Lt:Gt,Ht=Jt+Vt;Vt>0?Lt=Ht:Gt=Ht;var It=Bt(Math.max(Jt,Ht)),Le=Bt(Math.min(Jt,Ht)),ne=Le-It,$e=Jt!==0?Math.min(1.5,ne/2):0;Vt>0?Le-=$e:It+=$e,ne=Le-It,ne>.5&&(ct+='<rect x="'+a(rt)+'" y="'+a(It)+'" width="'+a(Ut)+'" height="'+a(ne)+'" rx="'+a(Math.min(3,Ut/2,ne/2))+'" fill="'+M(ae,H)+'"'+lt(t,Vt<0?"bzc-gn":"bzc-g",H*.05+ae*.03)+"/>")}}),j(t.showValues)){var Rt=B[H];ct+=S(rt+Ut/2,Rt<0?Bt(b[H])+12:Bt(F[H])-5,h(Rt,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+vt+'" font-size="10" font-weight="600"')}return ct}},{stat:zt(f,t,""),summary:o?g?s+" series stacked across "+o+" groups":c?s+" series across "+o+" groups":"highest "+(i[R]||"")+" "+h(f[R],t):"no data"})}de.table=function(t){return me(t,At(t.values).length>1&&j(t.stacked))};pt("bars",de);dt("bars");function vr(t,e){var r=Math.min(t.length,e.length);if(r<2)return null;var l=0,i=0,n;for(n=0;n<r;n++)l+=t[n],i+=e[n];l/=r,i/=r;var s=0,o=0,c=0;for(n=0;n<r;n++)s+=(t[n]-l)*(t[n]-l),o+=(e[n]-i)*(e[n]-i),c+=(t[n]-l)*(e[n]-i);if(!s)return null;var x=c/s;return{slope:x,intercept:i-x*l,r:o?c/Math.sqrt(s*o):0}}function ge(t,e){for(var r=At(t.x),l=At(t.y),i=P(t.series),n=P(t.labels),s=ut(t,e),o=[],c=0;c<Math.max(r.length,l.length);c++){var x=r[c]||[],g=l[c]||[],d=Math.min(x.length,g.length);o.push({xs:x.slice(0,d),ys:g.slice(0,d)})}o=o.filter(function(O){return O.xs.length});var f=o.reduce(function(O,k){return O+k.xs.length},0),C=I(t.height,210),z=o.length>1||i.length>0,B=j(t.trend),F=function(O){return i[O]||"Group "+(O+1)},b={decimals:t.decimals,compact:t.compact,lang:t.lang},L=Kt(t,n),m=_t(t.markers,he,"circle"),A=t.background||e.tile,E=function(O){var k=m?m(O):"circle";return k==="none"?"circle":k},y=m&&function(O,k,p){return jt(E(O),k+4,p+6,4,' fill="'+s[O%s.length]+'"')};return mt(t,e,C,function(O,k,p,D){if(!f)return ht(e,O,k,p,D);var M="",w=k;if(z){var T=Xt(o.map(function(V,Z){return F(Z)}),s,e,O,w,p,y);M+=T.svg,w+=T.height}var U=[].concat.apply([],o.map(function(V){return V.xs})),q=[].concat.apply([],o.map(function(V){return V.ys})),tt=Math.min.apply(null,q),Q=Math.max.apply(null,q);v(t.goal)&&(tt=Math.min(tt,+t.goal),Q=Math.max(Q,+t.goal)),j(t.zero)&&(tt=Math.min(0,tt),Q=Math.max(0,Q));var ot=ie(tt,Q,4),Y=ie(Math.min.apply(null,U),Math.max.apply(null,U),5),J=ot.ticks.map(function(V){return h(V,t,!0)}),Ft=Ye(J)+(v(t.yLabel)?14:0),st=20+(v(t.xLabel)?16:0),gt=O+Ft,R=p-Ft,u=D-(w-k)-st,G=function(V){return gt+6+(V-Y.lo)/(Y.hi-Y.lo)*(R-12)},N=function(V){return w+6+u-6-(V-ot.lo)/(ot.hi-ot.lo)*(u-6)};ot.ticks.forEach(function(V,Z){var X=N(V);M+='<line x1="'+a(gt)+'" x2="'+a(gt+R)+'" y1="'+a(X)+'" y2="'+a(X)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'+S(gt-8,X+3.5,J[Z],$(e,10,'text-anchor="end"'))});var et=Math.max(1,Math.ceil(Y.ticks.length*44/R));if(Y.ticks.forEach(function(V,Z){if(!(Z%et)){var X=G(V);M+='<line x1="'+a(X)+'" x2="'+a(X)+'" y1="'+a(w)+'" y2="'+a(w+u)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'+S(X,w+u+15,h(V,b,!0),$(e,10,'text-anchor="middle"'))}}),v(t.xLabel)&&(M+=S(gt+R/2,w+u+32,t.xLabel,$(e,10,'text-anchor="middle" font-weight="600"'))),v(t.yLabel)){var W=w+u/2;M+='<text x="'+a(O+4)+'" y="'+a(W)+'" transform="rotate(-90 '+a(O+4)+" "+a(W)+')" text-anchor="middle" '+$(e,10,'font-weight="600"')+' dominant-baseline="hanging">'+String(t.yLabel).replace(/[&<>"]/g,function(V){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[V]})+"</text>"}v(t.goal)&&(M+=Pt(t,e,gt,gt+R,N(+t.goal))),B&&o.forEach(function(V,Z){var X=vr(V.xs,V.ys);if(X){var ft=Math.min.apply(null,V.xs),Ot=Math.max.apply(null,V.xs),$t=X.slope*ft+X.intercept,it=X.slope*Ot+X.intercept,Nt=s[Z%s.length];M+='<line x1="'+a(G(ft))+'" y1="'+a(_(N($t),w,w+u))+'" x2="'+a(G(Ot))+'" y2="'+a(_(N(it),w,w+u))+'" stroke="'+Nt+'" stroke-width="2" stroke-dasharray="6 4" stroke-linecap="round" stroke-opacity=".9"/>',M+=S(Math.min(G(Ot),gt+R)-2,_(N(it),w+10,w+u)-7,"r = "+X.r.toFixed(2),$(e,10,'text-anchor="end" font-weight="600"',Nt))}});var xt=0,wt=f>150?3:4.5;o.forEach(function(V,Z){var X=s[Z%s.length];V.xs.forEach(function(ft,Ot){var $t=G(ft),it=N(V.ys[Ot]),Nt=(n[xt]?n[xt]+`
6
- `:z?F(Z)+`
7
- `:"")+(v(t.xLabel)?t.xLabel:"x")+": "+h(ft,b)+`
8
- `+(v(t.yLabel)?t.yLabel:"y")+": "+h(V.ys[Ot],t);M+=jt(E(Z),$t,it,wt,' fill="'+X+'" fill-opacity=".85" stroke="'+A+'" stroke-width="1.5"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(Math.min(.8,xt*.012))+'s"':"")),M+=yt($t-8,it-8,16,16,Nt),xt++})});var Et=[];return o.forEach(function(V){V.xs.forEach(function(Z,X){Et.push([G(Z),N(V.ys[X])])})}),L.forEach(function(V){var Z=Et[V.i];Z&&(M+='<circle cx="'+a(Z[0])+'" cy="'+a(Z[1])+'" r="'+(wt+4)+'" fill="none" stroke="'+e.fg+'" stroke-width="1.5"/>'+S(_(Z[0],gt+30,gt+R-30),Z[1]-wt-9,V.text,$(e,10,'text-anchor="middle"',e.fg)))}),M},{summary:f+" points"+(z?" in "+o.length+" groups":"")})}ge.table=function(t){var e=At(t.x),r=At(t.y),l=P(t.series),i=P(t.labels),n=e.length>1||l.length>0,s={decimals:t.decimals,compact:t.compact,lang:t.lang},o=[],c=0;return e.forEach(function(x,g){for(var d=r[g]||[],f=0;f<Math.min(x.length,d.length);f++,c++)o.push([i[c]||"#"+(c+1)].concat(n?[l[g]||"Group "+(g+1)]:[],[h(x[f],s),h(d[f],t)]))}),{head:["Point"].concat(n?["Group"]:[],[v(t.xLabel)?t.xLabel:"x",v(t.yLabel)?t.yLabel:"y"]),rows:o}};pt("scatter",ge);dt("scatter");function ve(t,e){var r=K(t.values),l=P(t.labels),i=ut(t,e),n=I(t.max,100)||100,s=I(t.height,140),o=!v(t.prefix)&&!v(t.suffix)&&n===100,c=function(g){return h(g,t)+(o?"%":"")},x=zt(r,t,"");return mt(t,e,s,function(g,d,f,C){if(!r.length)return ht(e,g,d,f,C);var z="",B=r.length===1,F=Math.min(C,B?f:f*.55),b=B?g+f/2:g+F/2,L=d+C/2,m=B?F*.12:_(F*.42/(r.length*1.35),5,16),A=m*.38;if(r.forEach(function(k,p){var D=F/2-m/2-p*(m+A);if(!(D<=m/2)){var M=_(k/n*100,0,100),w=i[p%i.length];z+='<circle cx="'+a(b)+'" cy="'+a(L)+'" r="'+a(D)+'" fill="none" stroke="'+w+'" stroke-opacity=".16" stroke-width="'+a(m)+'"/>',M>0&&(z+='<circle cx="'+a(b)+'" cy="'+a(L)+'" r="'+a(D)+'" fill="none" stroke="'+w+'" stroke-width="'+a(m)+'" stroke-linecap="round" pathLength="100" transform="rotate(-90 '+a(b)+" "+a(L)+')" style="stroke-dasharray:'+a(M)+" 100"+(t.animate?";animation-delay:"+p*.12+"s":"")+'"'+(t.animate?' class="bzc-s"':"")+"/>"),z+='<circle cx="'+a(b)+'" cy="'+a(L)+'" r="'+a(D+m/2)+'" fill="#000" fill-opacity="0" class="bzc-hit" data-tip="'+nt((l[p]||"#"+(p+1))+": "+c(k)+(o?"":" of "+h(n,t)))+'"/>'}}),B)z+=S(b,L+F*.08,c(r[0]),'text-anchor="middle" fill="'+e.fg+'" font-family="'+at+'" font-size="'+a(F*.22)+'" font-weight="800"'),l[0]&&(z+=S(b,L+F*.08+16,l[0],$(e,10,'text-anchor="middle"')));else{var E=g+F+22,y=Math.min(26,C/r.length),O=L-y*r.length/2;r.forEach(function(k,p){var D=O+p*y+y/2;z+='<circle cx="'+a(E+4)+'" cy="'+a(D)+'" r="4" fill="'+i[p%i.length]+'"/>'+S(E+14,D+4,qt(l[p]||"#"+(p+1),Math.floor((g+f-E-60)/6.7)),'fill="'+e.fg+'" font-family="'+at+'" font-size="12"')+S(g+f,D+4,c(k),'text-anchor="end" fill="'+e.fg+'" font-family="'+vt+'" font-size="11" font-weight="600"')})}return z},{stat:x,summary:r.map(function(g,d){return(l[d]?l[d]+" ":"")+c(g)}).join(", ")})}ve.table=function(t){var e=P(t.labels),r=I(t.max,100)||100,l=!v(t.prefix)&&!v(t.suffix)&&r===100;return{head:["Label","Value"],rows:K(t.values).map(function(i,n){return[e[n]||"#"+(n+1),h(i,t)+(l?"%":" of "+h(r,t))]})}};pt("ring",ve);dt("ring");function xe(t,e){var r=K(t.values).map(function(f){return Math.max(0,f)}),l=P(t.labels),i=ut(t,e),n=r.slice(),s=l.slice();if(n.length>6){var o=n.map(function(f,C){return C}).sort(function(f,C){return r[C]-r[f]}),c=o.slice(0,5).sort(function(f,C){return f-C});n=c.map(function(f){return r[f]}),s=c.map(function(f){return l[f]||"#"+(f+1)}),n.push(Tt(o.slice(5).map(function(f){return r[f]}))),s.push("Other")}var x=Tt(n),g=I(t.height,150),d=zt(n,t,"");return mt(t,e,g,function(f,C,z,B){if(!x)return ht(e,f,C,z,B);var F="",b=Math.min(B,z*.5),L=f+b/2,m=C+B/2,A=b*.16,E=(b-A)/2,y=0,O=n.filter(Boolean).length>1?.9:0;n.forEach(function(M,w){var T=M/x*100;if(!(T<=0)){var U=Math.max(.01,T-O);F+='<circle cx="'+a(L)+'" cy="'+a(m)+'" r="'+a(E)+'" fill="none" stroke="'+i[w%i.length]+'" stroke-width="'+a(A)+'" pathLength="100" stroke-dasharray="'+a(U)+" "+a(100-U)+'" stroke-dashoffset="'+a(-y)+'" transform="rotate(-90 '+a(L)+" "+a(m)+')"'+lt(t,"bzc-a",w*.08)+"/>",y+=T}}),F+=S(L,m+2,h(x,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+at+'" font-size="'+a(b*.17)+'" font-weight="800"'),F+=S(L,m+2+14,(v(t.centerLabel)?t.centerLabel:"Total").toUpperCase(),$(e,9,'text-anchor="middle" letter-spacing="1"'));var k=f+b+22,p=Math.min(24,B/n.length),D=m-p*n.length/2;return n.forEach(function(M,w){var T=D+w*p+p/2,U=Math.round(M/x*100),q=(s[w]||"#"+(w+1))+": "+h(M,t)+" ("+U+"%)";F+='<circle cx="'+a(k+4)+'" cy="'+a(T)+'" r="4" fill="'+i[w%i.length]+'"/>'+S(k+14,T+4,qt(s[w]||"#"+(w+1),Math.floor((f+z-k-50)/6.7)),'fill="'+e.fg+'" font-family="'+at+'" font-size="12"')+S(f+z,T+4,U+"%",'text-anchor="end" fill="'+e.muted+'" font-family="'+vt+'" font-size="11" font-weight="600"')+yt(k,T-p/2,f+z-k,p,q)}),y=0,n.forEach(function(M,w){var T=M/x*100;T<=0||(F+='<circle cx="'+a(L)+'" cy="'+a(m)+'" r="'+a(E)+'" fill="none" stroke="#000" stroke-opacity="0" stroke-width="'+a(A)+'" pathLength="100" stroke-dasharray="'+a(T)+" "+a(100-T)+'" stroke-dashoffset="'+a(-y)+'" transform="rotate(-90 '+a(L)+" "+a(m)+')" class="bzc-hit" data-skip="" data-tip="'+nt((s[w]||"#"+(w+1))+": "+h(M,t)+" ("+Math.round(T)+"%)")+'"/>',y+=T)}),F},{stat:d,summary:"total "+h(x,t)+" across "+n.length+" parts"})}xe.table=function(t){var e=K(t.values).map(function(i){return Math.max(0,i)}),r=P(t.labels),l=Tt(e);return{head:["Label","Value","Share"],rows:e.map(function(i,n){return[r[n]||"#"+(n+1),h(i,t),(l?Math.round(i/l*100):0)+"%"]})}};pt("donut",xe);dt("donut");function be(t,e){var r=K(t.values),l=r.length?r[0]:I(t.value,NaN),i=P(t.labels),n=I(t.min,0),s=I(t.max,100),o=I(t.height,130);s===n&&(s=n+1);var c=K(t.zones),x=ut(t,e),g=P(t.color).filter(Boolean).length>1?x:[e.up,e.palette[3],e.down],d=x[0];if(c.length&&isFinite(l)){for(var f=0;f<c.length&&l>=c[f];)f++;d=g[Math.min(f,g.length-1)]}var C=!v(t.prefix)&&!v(t.suffix)&&n===0&&s===100,z=function(B){return h(B,t)+(C?"%":"")};return mt(t,e,o,function(B,F,b,L){if(!isFinite(l))return ht(e,B,F,b,L);var m=Math.min(b/2,L-22),A=m*.16,E=m-A/2,y=B+b/2,O=F+m,k=_((l-n)/(s-n),0,1),p=function(tt,Q){var ot=Math.PI*(1-tt);return[y+Q*Math.cos(ot),O-Q*Math.sin(ot)]},D="M"+a(y-E)+","+a(O)+"A"+a(E)+","+a(E)+" 0 0 1 "+a(y+E)+","+a(O),M='<path d="'+D+'" fill="none" stroke="'+d+'" stroke-opacity=".16" stroke-width="'+a(A)+'" stroke-linecap="round"/>';c.length&&c.forEach(function(tt){var Q=_((tt-n)/(s-n),0,1),ot=p(Q,E-A/2-3),Y=p(Q,E-A/2-8);M+='<line x1="'+a(ot[0])+'" y1="'+a(ot[1])+'" x2="'+a(Y[0])+'" y2="'+a(Y[1])+'" stroke="'+e.muted+'" stroke-width="1.5"/>'}),k>0&&(M+='<path d="'+D+'" fill="none" stroke="'+d+'" stroke-width="'+a(A)+'" stroke-linecap="round" pathLength="100" style="stroke-dasharray:'+a(k*100)+' 100"'+lt(t,"bzc-s")+"/>");var w=p(k,E);if(M+='<circle cx="'+a(w[0])+'" cy="'+a(w[1])+'" r="'+a(A*.26)+'" fill="'+(t.background||e.tile)+'"'+lt(t,"bzc-a",.9)+"/>",v(t.goal)){var T=_((+t.goal-n)/(s-n),0,1),U=p(T,E+A/2+4),q=p(T,E-A/2-4);M+='<line x1="'+a(U[0])+'" y1="'+a(U[1])+'" x2="'+a(q[0])+'" y2="'+a(q[1])+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return M+=S(y,O-m*.12,z(l),'text-anchor="middle" fill="'+e.fg+'" font-family="'+at+'" font-size="'+a(m*.34)+'" font-weight="800"'),i[0]&&(M+=S(y,O-m*.12+16,i[0],$(e,10,'text-anchor="middle"'))),M+=S(y-E,O+18,h(n,t,!0),$(e,10,'text-anchor="middle"'))+S(y+E,O+18,h(s,t,!0),$(e,10,'text-anchor="middle"')),M+=yt(y-m,O-m,m*2,m,(i[0]?i[0]+": ":"")+z(l)+" (range "+h(n,t)+" to "+h(s,t)+")"+(v(t.goal)?`
9
- Goal: `+h(+t.goal,t):"")),M},{summary:isFinite(l)?z(l)+" on a scale of "+h(n,t)+" to "+h(s,t):"no data"})}be.table=function(t){var e=K(t.values),r=e.length?e[0]:I(t.value,NaN),l=P(t.labels),i=I(t.min,0),n=I(t.max,100),s=!v(t.prefix)&&!v(t.suffix)&&i===0&&n===100;return isFinite(r)?{head:["Label","Value"],rows:[[l[0]||"Reading",h(r,t)+(s?"%":"")],["Lowest",h(i,t)],["Highest",h(n,t)]].concat(v(t.goal)?[["Goal",h(+t.goal,t)]]:[])}:{head:["Label","Value"],rows:[]}};pt("gauge",be);dt("gauge");function ye(t,e){var r=K(t.values).map(function(b){return Math.max(0,b)}),l=P(t.labels),i=ut(t,e),n=r.length===1,s=Tt(r),o=v(t.max)?I(t.max,100):n?100:s;o>0||(o=1);var c=!v(t.prefix)&&!v(t.suffix)&&o===100&&n,x=function(b){return h(b,t)+(c?"%":"")},g=Yt(t),d=g.w,f=0,C=[];if(!n&&r.length){var z=0;f=1,r.forEach(function(b,L){var m=l[L]||"#"+(L+1),A=14+bt(m,12)+6+bt(h(b,t),11,!0)+18;z>0&&z+A>d&&(z=0,f++),C.push({x:z,row:f-1,l:m}),z+=A})}var B=36+(f?12+f*20:0),F=zt(r,t,"");return mt(t,e,B,function(b,L,m,A){if(!r.length)return ht(e,b,L,m,A);var E="",y=L+22,O=Dt("c"),k=n?x(r[0])+(c?"":" of "+h(o,t)):h(s,t)+" of "+h(o,t);n&&l[0]&&(E+=S(b,L+11,l[0],'fill="'+e.fg+'" font-family="'+at+'" font-size="12"')),E+=S(b+m,L+11,k,'text-anchor="end" fill="'+e.fg+'" font-family="'+vt+'" font-size="11" font-weight="600"'),E+='<rect x="'+b+'" y="'+y+'" width="'+m+'" height="14" rx="7" fill="'+e.grid+'" fill-opacity=".7"/>',E+='<clipPath id="'+O+'"><rect x="'+b+'" y="'+y+'" width="'+m+'" height="14" rx="7"/></clipPath><g clip-path="url(#'+O+')"><g'+lt(t,"bzc-gx")+">";var p=0;if(r.forEach(function(M,w){var T=Math.min(M,Math.max(0,o-p))/o*m;T>0&&(E+='<rect x="'+a(b+p/o*m)+'" y="'+y+'" width="'+a(T)+'" height="14" fill="'+i[w%i.length]+'"/>'),w>0&&T>0&&(E+='<rect x="'+a(b+p/o*m-1)+'" y="'+y+'" width="2" height="14" fill="'+(t.background||e.tile)+'"/>'),p+=M}),E+="</g></g>",v(t.goal)){var D=b+_(+t.goal/o,0,1)*m;E+='<line x1="'+a(D)+'" x2="'+a(D)+'" y1="'+(y-4)+'" y2="'+(y+18)+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return p=0,r.forEach(function(M,w){var T=Math.min(M,Math.max(0,o-p))/o*m;T>0&&(E+=yt(b+p/o*m,y-4,T,22,(l[w]||(n?"Progress":"#"+(w+1)))+": "+x(M)+(n?"":" ("+Math.round(M/o*100)+"%)"))),p+=M}),C.forEach(function(M,w){var T=b+M.x,U=y+14+12+M.row*20+8;E+='<circle cx="'+a(T+4)+'" cy="'+a(U)+'" r="4" fill="'+i[w%i.length]+'"/><text x="'+a(T+14)+'" y="'+a(U+4)+'" fill="'+e.fg+'" font-family="'+at+'" font-size="12">'+nt(M.l)+'<tspan dx="6" fill="'+e.muted+'" font-family="'+vt+'" font-size="11">'+nt(h(r[w],t))+"</tspan></text>"}),E},{stat:F,summary:n?x(r[0])+(c?"":" of "+h(o,t)):h(s,t)+" of "+h(o,t)})}ye.table=function(t){var e=K(t.values).map(function(s){return Math.max(0,s)}),r=P(t.labels),l=e.length===1,i=v(t.max)?I(t.max,100):l?100:Tt(e);i>0||(i=1);var n=!v(t.prefix)&&!v(t.suffix)&&i===100&&l;return l?{head:["Label","Value"],rows:[[r[0]||"Progress",h(e[0],t)+(n?"%":" of "+h(i,t))]]}:{head:["Label","Value","Share"],rows:e.map(function(s,o){return[r[o]||"#"+(o+1),h(s,t),Math.round(s/i*100)+"%"]})}};pt("progress",ye);dt("progress");var _e={weekday:"short",day:"numeric",month:"short",year:"numeric"};function Ze(t,e){if(v(t.start)&&/^\d{4}-\d{2}-\d{2}$/.test(String(t.start)))return new Date(String(t.start)+"T00:00:00Z");var r=new Date;return new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate())-Math.max(0,e-1)*864e5)}function Qe(t,e){try{return new Intl.DateTimeFormat(t,Object.assign({timeZone:"UTC"},e))}catch{return new Intl.DateTimeFormat("en-GB",Object.assign({timeZone:"UTC"},e))}}function ke(t,e){var r=K(t.values),l=ut(t,e)[0],i=t.lang||"en-GB",n=Ze(t,r.length),s=(n.getUTCDay()+6)%7,o=Math.max(1,Math.ceil((s+r.length)/7)),c=Yt(t),x=28,g=Math.max(1,Math.floor((c.w-x)/10));if(o>g){var d=(o-g)*7-s;r=r.slice(d),n=new Date(n.getTime()+d*864e5),s=0,o=g}var f=Math.min(18,(c.w-x)/o),C=f<8?1:3,z=f-C,B=16+7*f+26,F=r.length?Math.max.apply(null,r):0,b=function(y){return Qe(i,y)},L=b({month:"short"}),m=b({weekday:"short"}),A=b(_e),E=zt(r,t,"");return mt(t,e,B,function(y,O,k,p){if(!r.length)return ht(e,y,O,k,p);var D="",M=y+x,w=O+16,T=-99,U=[.28,.5,.75,1];f>=9&&[0,2,4].forEach(function(W){var xt=new Date(Date.UTC(2024,0,1+W));D+=S(y,w+W*f+z/2+3.5,m.format(xt),$(e,9))});for(var q=0;q<r.length;q++){var tt=s+q,Q=Math.floor(tt/7),ot=tt%7,Y=new Date(n.getTime()+q*864e5),J=M+Q*f,Ft=w+ot*f;(Y.getUTCDate()===1||q===0)&&J-T>30&&(D+=S(J,O+9,L.format(Y),$(e,9)),T=J);var st=r[q]<=0||!F?0:Math.ceil(r[q]/F*4),gt=st?l:e.grid,R=st?U[st-1]:.7;D+='<rect x="'+a(J)+'" y="'+a(Ft)+'" width="'+a(z)+'" height="'+a(z)+'" rx="'+a(z*.24)+'" fill="'+gt+'" fill-opacity="'+R+'"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(Q*.012)+'s"':"")+' data-tip="'+nt(A.format(Y)+": "+h(r[q],t))+'"/>'}var u=w+7*f+14,G=10,N=y+k-5*(G+3)-30;D+=S(y,u+8,h(Tt(r),t,!0)+" in "+r.length+" days",$(e,10)),D+=S(N-6,u+8,"Less",$(e,9,'text-anchor="end"'));for(var et=0;et<5;et++)D+='<rect x="'+a(N+et*(G+3))+'" y="'+u+'" width="'+G+'" height="'+G+'" rx="2.5" fill="'+(et?l:e.grid)+'" fill-opacity="'+(et?U[et-1]:.7)+'"/>';return D+=S(N+5*(G+3)+3,u+8,"More",$(e,9)),D},{stat:E,summary:h(Tt(r),t)+" across "+r.length+" days"})}ke.table=function(t){var e=K(t.values),r=Ze(t,e.length),l=Qe(t.lang||"en-GB",_e);return{head:["Date","Value"],rows:e.map(function(i,n){return[l.format(new Date(r.getTime()+n*864e5)),h(i,t)]})}};pt("heatmap",ke);dt("heatmap");var xr="1.3.0",br=fe.slice();return or(yr);})();
1
+ /*! Bezel Charts v1.4.0 | MIT | github.com/ShazMoghaddam/bezel-charts */
2
+ var BezelCharts=(()=>{var Ge=Object.defineProperty;var sr=Object.getOwnPropertyDescriptor;var fr=Object.getOwnPropertyNames;var cr=Object.prototype.hasOwnProperty;var ur=(t,e)=>{for(var r in e)Ge(t,r,{get:e[r],enumerable:!0})},hr=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of fr(e))!cr.call(t,i)&&i!==r&&Ge(t,i,{get:()=>e[i],enumerable:!(l=sr(e,i))||l.enumerable});return t};var mr=t=>hr(Ge({},"__esModule",{value:!0}),t);var Er={};ur(Er,{BezelChart:()=>wt,render:()=>Mt,themes:()=>Kt,toSVG:()=>Ct,types:()=>zr,version:()=>Sr});var ft="ui-sans-serif,system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif",xt="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace",pr=0;function Ht(t){return"bzc"+t+(++pr).toString(36)+Math.random().toString(36).slice(2,6)}function ct(t){return String(t??"").replace(/[&<>"']/g,function(e){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[e]})}function a(t){return Math.round(t*100)/100}function Q(t,e,r){return Math.max(e,Math.min(r,t))}function W(t,e){var r=parseFloat(t);return isFinite(r)?r:e}function A(t){return t!=null&&t!==""}function rt(t){return Array.isArray(t)?t.map(function(e){var r=+e;return isFinite(r)?r:0}):A(t)?String(t).split(/[\s,;]+/).filter(Boolean).map(function(e){var r=+e;return isFinite(r)?r:0}):[]}function U(t){return Array.isArray(t)?t.map(String):A(t)?String(t).split(",").map(function(e){return e.trim()}):[]}function zt(t){return Array.isArray(t)?Array.isArray(t[0])?t.map(rt):[rt(t)]:A(t)?String(t).split("|").map(rt).filter(function(e){return e.length}):[]}function Nt(t){return t.reduce(function(e,r){return e+r},0)}function Et(t,e,r){return String(t).length*e*(r?.6:.56)}function Zt(t,e){return t=String(t),t.length>e?t.slice(0,Math.max(1,e-1))+"\u2026":t}function K(t){return t===!0||t===""||t==="true"||t==="1"}function h(t,e,r){if(!isFinite(t))return"\u2013";var l=Math.abs(t),i;A(e.decimals)?i=Q(parseInt(e.decimals,10)||0,0,6):i=t%1===0?0:l<10?2:l<100?1:0;var n={maximumFractionDigits:i,minimumFractionDigits:A(e.decimals)?i:0};(K(e.compact)||r)&&l>=1e4&&(n={notation:"compact",maximumFractionDigits:1});var s;try{s=new Intl.NumberFormat(e.lang||"en-GB",n).format(l)}catch{s=String(a(l))}return(t<0?"\u2212":"")+(e.prefix||"")+s+(e.suffix||"")}function Ut(t,e){if(!t.length)return"";for(var r="M"+a(t[0][0])+","+a(t[0][1]),l=1;l<t.length;l++){var i=t[l-1],n=t[l];if(e)r+="L"+a(n[0])+","+a(n[1]);else{var s=(i[0]+n[0])/2;r+="C"+a(s)+","+a(i[1])+" "+a(s)+","+a(n[1])+" "+a(n[0])+","+a(n[1])}}return r}function O(t,e,r,l){return'<text x="'+a(t)+'" y="'+a(e)+'" '+(l||"")+">"+ct(r)+"</text>"}function H(t,e,r,l){return'fill="'+(l||t.muted)+'" font-family="'+xt+'" font-size="'+(e||10)+'"'+(r?" "+r:"")}function Lt(t,e,r,l,i){return'<rect class="bzc-hit" x="'+a(t)+'" y="'+a(e)+'" width="'+a(Math.max(1,r))+'" height="'+a(Math.max(1,l))+'" fill="#000" fill-opacity="0" data-tip="'+ct(i)+'"/>'}function ut(t,e,r){return t.animate?' class="'+e+'"'+(r?' style="animation-delay:'+a(r)+'s"':""):""}function ht(t,e){var r=U(t.color).filter(Boolean);return r.length?r:e.palette}function mt(t,e,r,l,i){return O(e+l/2,r+i/2+4,"No data yet",'text-anchor="middle" fill="'+t.muted+'" font-family="'+ft+'" font-size="13"')}function Yt(t,e){return A(t.notes)?String(t.notes).split(";").map(function(r){var l=r.indexOf(":");if(l<0)return null;var i=r.slice(0,l).trim(),n=r.slice(l+1).trim(),s=e.map(String).indexOf(i);return s<0&&String(parseInt(i,10))===i&&(s=parseInt(i,10)),s>=0&&n?{i:s,text:n}:null}).filter(Boolean):[]}function It(t,e,r,l,i){var n=(A(t.goalLabel)?t.goalLabel:"Goal")+" "+h(W(t.goal,0),t);return'<line x1="'+a(r)+'" x2="'+a(l)+'" y1="'+a(i)+'" y2="'+a(i)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-width="1.25" stroke-dasharray="4 4"/>'+O(l,i-5,n,H(e,10,'text-anchor="end"'))}function kt(t,e,r){var l=String(A(e.stat)?e.stat:r||"").toLowerCase();if(!l||l==="none"||!t.length)return null;var i=Nt(t),n={last:t[t.length-1],total:i,sum:i,average:i/t.length,avg:i/t.length,max:Math.max.apply(null,t),min:Math.min.apply(null,t)};if(!(l in n))return null;var s=null;return l==="last"&&t.length>1&&e.delta!=="none"&&(s=t[t.length-1]-t[0]),{val:n[l],delta:s}}function qt(t){var e=Math.round(Q(W(t.width,360),160,2400)),r=t.frame==="none"?0:4,l=t.frame==="none"?8:20;return{W:e,b:r,P:l,w:e-2*(r+l)}}var dr=".bzc-a{animation:bzc-in .6s ease both}.bzc-d{animation:bzc-draw 1.1s cubic-bezier(.3,.7,.2,1) both}.bzc-g{transform-box:fill-box;transform-origin:50% 100%;animation:bzc-grow .7s cubic-bezier(.2,.8,.2,1) both}.bzc-gn{transform-box:fill-box;transform-origin:50% 0;animation:bzc-grow .7s cubic-bezier(.2,.8,.2,1) both}.bzc-gx{transform-box:fill-box;transform-origin:0 50%;animation:bzc-growx .8s cubic-bezier(.2,.8,.2,1) both}.bzc-s{animation:bzc-sweep 1.1s cubic-bezier(.2,.8,.2,1) both}@keyframes bzc-in{from{opacity:0}}@keyframes bzc-draw{from{stroke-dashoffset:1}}@keyframes bzc-grow{from{transform:scaleY(0)}}@keyframes bzc-growx{from{transform:scaleX(0)}}@keyframes bzc-sweep{from{stroke-dasharray:0 100}}@media (prefers-reduced-motion:reduce){[class^=bzc-]{animation:none!important}}";function pt(t,e,r,l,i){var n=qt(t),s=n.W,o=n.b,f=n.P,u=n.w,p=Q(W(t.corners,22),0,60),m=o+f,c="";A(t.heading)&&(c+=O(o+f,m+10,String(t.heading).toUpperCase(),H(e,11,'font-weight="600" letter-spacing="1.3"')),m+=24);var T=i&&i.stat;if(T){if(c+=O(o+f,m+30,h(T.val,t),'fill="'+e.fg+'" font-family="'+ft+'" font-size="32" font-weight="800" letter-spacing="-0.5"'),T.delta!=null){var w=T.delta>0,B=T.delta===0,N=t.delta==="inverse"?!w:w,L=B?e.muted:N?e.up:e.down,z=(B?"\u25CF ":w?"\u25B2 ":"\u25BC ")+h(Math.abs(T.delta),t)+" "+(A(t.deltaLabel)?t.deltaLabel:"since start");c+=O(o+f+u,m+28,z,'text-anchor="end" fill="'+L+'" font-family="'+xt+'" font-size="11" font-weight="600"')}m+=44}var g=l(o+f,m,u,r),V=Math.round(m+r+f+o),k="";t.frame!=="none"?k='<rect width="'+s+'" height="'+V+'" rx="'+p+'" fill="'+e.bezel+'"/><rect x="'+o+'" y="'+o+'" width="'+(s-2*o)+'" height="'+(V-2*o)+'" rx="'+Math.max(0,p-o)+'" fill="'+(t.background||e.tile)+'"/>':A(t.background)&&(k='<rect width="'+s+'" height="'+V+'" rx="'+p+'" fill="'+t.background+'"/>');var d=(A(t.heading)?t.heading+": ":"")+(i&&i.summary||"chart");return'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '+s+" "+V+'" width="'+s+'" height="'+V+'" role="img" aria-label="'+ct(d)+'"><title>'+ct(d)+"</title>"+(t.animate?"<style>"+dr+"</style>":"")+k+c+g+"</svg>"}function ue(t,e){var r=rt(t.values),l=ht(t,e)[0],i=W(t.height,64),n=U(t.labels),s=Yt(t,n),o=kt(r,t,"last");return pt(t,e,i,function(f,u,p,m){if(!r.length)return mt(e,f,u,p,m);var c=r.length===1?[r[0],r[0]]:r,T=Math.min.apply(null,c),w=Math.max.apply(null,c);A(t.goal)&&(T=Math.min(T,+t.goal),w=Math.max(w,+t.goal));var B=(w-T||Math.abs(w)||1)*.12;T-=B,w+=B;var N=function(v){return f+v*p/(c.length-1)},L=function(v){return u+m-(v-T)/(w-T)*m},z=c.map(function(v,x){return[N(x),L(v)]}),g=Ut(z,K(t.straight)),V=Ht("g"),k=z[z.length-1],d='<defs><linearGradient id="'+V+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+l+'" stop-opacity=".32"/><stop offset="1" stop-color="'+l+'" stop-opacity="0"/></linearGradient></defs>';[1/3,2/3].forEach(function(v){d+='<line x1="'+f+'" x2="'+(f+p)+'" y1="'+a(u+m*v)+'" y2="'+a(u+m*v)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'}),d+='<path d="'+g+"L"+a(k[0])+","+(u+m)+"L"+f+","+(u+m)+'Z" fill="url(#'+V+')"'+ut(t,"bzc-a")+"/>",d+='<path d="'+g+'" fill="none" stroke="'+l+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1"'+ut(t,"bzc-d")+"/>",A(t.goal)&&(d+=It(t,e,f,f+p,L(+t.goal))),s.forEach(function(v){if(!(v.i>=r.length)){var x=z[v.i];d+='<circle cx="'+a(x[0])+'" cy="'+a(x[1])+'" r="3.5" fill="'+e.fg+'"/>'+O(Q(x[0],f+30,f+p-30),x[1]-9,v.text,H(e,10,'text-anchor="middle"',e.fg))}}),d+='<circle cx="'+a(k[0])+'" cy="'+a(k[1])+'" r="9" fill="'+l+'" fill-opacity=".25"/><circle cx="'+a(k[0])+'" cy="'+a(k[1])+'" r="4.5" fill="'+l+'"/>',K(t.showValues)&&z.forEach(function(v,x){x<r.length&&(d+=O(v[0],v[1]-8,h(r[x],t,!0),H(e,9,'text-anchor="middle"')))});var b=r.length>1?p/(r.length-1):p;return r.forEach(function(v,x){d+=Lt(N(x)-b/2,u-6,b,m+12,(n[x]||"#"+(x+1))+": "+h(v,t))}),d},{stat:o,summary:r.length?"latest "+h(r[r.length-1],t):"no data"})}ue.table=function(t){var e=U(t.labels);return{head:["Label","Value"],rows:rt(t.values).map(function(r,l){return[e[l]||"#"+(l+1),h(r,t)]})}};var Kt={dark:{tile:"#15151d",bezel:"#000000",fg:"#f2f1f7",muted:"#8c8aa0",grid:"#2a2935",up:"#5EE6C8",down:"#F675A8",palette:["#9FA1FF","#F675A8","#5EE6C8","#FFC857","#7CC4FF","#FF8A5B"]},light:{tile:"#ffffff",bezel:"#000000",fg:"#17161f",muted:"#6b6980",grid:"#e8e6ef",up:"#12a383",down:"#d63f7c",palette:["#6E70F0","#E2508C","#16A884","#D99A0E","#2F8FE0","#EE6431"]}};var he=["spark","line","area","bars","scatter","ring","donut","gauge","progress","heatmap"],me={};function dt(t,e){me[t]=e}var gr=t=>t.replace(/-([a-z])/g,(e,r)=>r.toUpperCase());function Ze(t,e){if(!me[t])throw new Error(he.includes(t)?`Bezel Charts: the ${t} chart isn't loaded. Add import 'bezel-charts/${t}', or load dist/charts/${t}.js.`:`Bezel Charts: unknown chart type "${t}". Choose one of: ${he.join(", ")}.`);let r={};for(let[l,i]of Object.entries(e))r[gr(l)]=i;return r}function Mt(t,e={}){let r=Ze(t,e);r.animate=K(r.animate),r.frame=r.frame==="none"?"none":"bezel";let l=r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme||"dark";return me[t](r,Kt[l])}function qe(t,e={}){return me[t].table(Ze(t,e))}function He(t){return t.replace(/<rect class="bzc-hit"[^>]*\/>/g,"").replace(/<circle[^>]* class="bzc-hit"[^>]*\/>/g,"").replace(/ data-tip="[^"]*"/g,"")}function Ct(t,e={}){return He(Mt(t,{...e,animate:!1}))}var Ke=["type","values","labels","series","heading","prefix","suffix","decimals","compact","color","theme","frame","width","height","goal","goal-label","notes","show-values","stat","delta","delta-label","max","min","value","zones","horizontal","straight","zero","start","lang","corners","background","center-label","highlight","x","y","x-label","y-label","trend","static","no-tooltips","stacked","angle-labels","dash","markers","patterns"],vr=`:host{display:block;position:relative;max-width:100%}:host([hidden]){display:none}svg{display:block;max-width:100%;height:auto;overflow:visible}.tip{position:absolute;left:0;top:0;pointer-events:none;background:#0b0b10;color:#f2f1f7;font:600 12px/1.5 ${xt};padding:7px 10px;border-radius:10px;white-space:pre;opacity:0;transform:translate(-50%,calc(-100% - 12px));transition:opacity .12s;z-index:3;border:1px solid #2a2935;box-shadow:0 8px 24px rgba(0,0,0,.35)}.tip.on{opacity:1}.c{outline:none}.c:focus-visible{outline:2px solid #fff;outline-offset:3px;box-shadow:0 0 0 7px #000}.k{stroke:currentColor;stroke-width:2;stroke-opacity:1}.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}@media (forced-colors:active){.c:focus-visible{outline-color:Highlight}}`,xr={ArrowLeft:-1,ArrowUp:-1,ArrowRight:1,ArrowDown:1},yr=()=>typeof matchMedia=="function"?matchMedia("(prefers-color-scheme: dark)"):null,br=()=>{let t=typeof document<"u"&&document.documentElement?.getAttribute?.("data-theme");return t==="light"||t==="dark"?t:null},Re=new Set;typeof MutationObserver=="function"&&typeof document<"u"&&document.documentElement&&new MutationObserver(()=>Re.forEach(t=>t.refresh())).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});var kr=typeof HTMLElement>"u"?class{}:HTMLElement,wt=class extends kr{static get observedAttributes(){return Ke}static get themes(){return Kt}get resolvedTheme(){let e=this.getAttribute("theme");return e==="light"||e==="dark"?e:this.options.autoTheme}get chartType(){return this.getAttribute("type")||"spark"}connectedCallback(){this.shadowRoot||(this.attachShadow({mode:"open"}).innerHTML=`<style>${vr}</style><div class="c" role="group" aria-roledescription="chart"></div><p class="sr" id="h">Use the arrow keys to step through the values.</p><div class="tip" aria-hidden="true"></div><div class="sr" aria-live="polite"></div><div class="sr"></div>`,[,this.#t,,this.#r,this.#o,this.#c]=this.shadowRoot.children,this.shadowRoot.addEventListener("pointermove",e=>this.#h(e)),this.shadowRoot.addEventListener("pointerdown",e=>this.#h(e)),this.addEventListener("pointerleave",()=>this.#r.classList.remove("on")),this.#t.addEventListener("keydown",e=>this.#v(e)),this.#t.addEventListener("blur",()=>this.#g())),Re.add(this),this.#a=yr(),this.#a?.addEventListener?.("change",this.#u),typeof ResizeObserver=="function"?(this.#l=new ResizeObserver(([e])=>{let r=Math.round(e.contentRect.width);(!this.#n||!this.hasAttribute("width")&&r>0&&Math.abs(r-this.#s)>1)&&this.#i()}),this.#l.observe(this)):this.#i()}disconnectedCallback(){Re.delete(this),this.#l?.disconnect(),this.#a?.removeEventListener?.("change",this.#u)}attributeChangedCallback(){!this.#n||this.#f||(this.#f=!0,queueMicrotask(()=>{this.#f=!1,this.#i()}))}get options(){let e={};for(let r of Ke)this.hasAttribute(r)&&(e[r]=this.getAttribute(r));return e.width||(e.width=this.#s||360),e.autoTheme=br()||(this.#a?this.#a.matches?"dark":"light":"dark"),e}refresh(){this.#n&&this.#i()}toSVG(e={}){return He(Mt(this.chartType,{...this.options,...e,animate:!1}))}download(e){let r=URL.createObjectURL(new Blob([this.toSVG()],{type:"image/svg+xml"})),l=Object.assign(document.createElement("a"),{href:r,download:`${(e||this.getAttribute("heading")||this.chartType).replace(/[^\w-]+/g,"-").toLowerCase()}.svg`});document.body.append(l),l.click(),l.remove(),setTimeout(()=>URL.revokeObjectURL(r),1e3)}#l=null;#t=null;#r=null;#o=null;#c=null;#e=-1;#a=null;#s=0;#n=!1;#f=!1;#u=()=>{let e=this.getAttribute("theme");(!e||e==="auto")&&this.refresh()};#i(){if(!this.shadowRoot)return;let e=Math.round(this.getBoundingClientRect?.().width||0);this.#s=e>0?e:360;let r=this.options;r.animate=!this.#n&&!this.hasAttribute("static");let l,i=null;try{l=Mt(this.chartType,r),i=qe(this.chartType,r)}catch(f){l=`<p style="font:13px ${ft};color:#d63f7c">${ct(f.message)}</p>`}let n=this.#t;n.innerHTML=l.replace(/<title>[\s\S]*?<\/title>/,"");let s=n.querySelector("svg");s?(n.setAttribute("aria-label",s.getAttribute("aria-label")),s.removeAttribute("role"),s.removeAttribute("aria-label"),s.setAttribute("aria-hidden","true")):n.removeAttribute("aria-label");let o=!!s&&!this.hasAttribute("no-tooltips");o?(n.setAttribute("tabindex","0"),n.setAttribute("aria-describedby","h")):(n.removeAttribute("tabindex"),n.removeAttribute("aria-describedby")),n.style.color=Kt[r.theme==="light"||r.theme==="dark"?r.theme:r.autoTheme].fg,n.style.borderRadius=`${r.frame==="none"?4:Q(+r.corners||22,0,60)}px`,this.#c.innerHTML=i&&i.rows.length?Mr(r.heading,i):"",this.#e>=0&&o&&this.shadowRoot.activeElement===n?this.#d(this.#e):this.#e=-1,this.#n=!0,this.dispatchEvent(new CustomEvent("bezel-render",{bubbles:!0}))}#h(e){if(this.hasAttribute("no-tooltips"))return;let r=e.target?.closest?.("[data-tip]");if(!r){this.#r.classList.remove("on");return}this.#m(r,e.clientX,e.clientY)}#m(e,r,l){let i=this.#r;i.textContent=e.getAttribute("data-tip");let n=this.getBoundingClientRect?.()||{left:0,top:0,width:0},s=i.offsetWidth/2;i.style.left=`${Q(r-n.left,s,Math.max(s,n.width-s))}px`,i.style.top=`${l-n.top}px`,i.classList.add("on")}#p(){return[...this.#t.querySelectorAll("[data-tip]:not([data-skip])")]}#v(e){let r=this.#p(),l=r.length;if(!l)return;let i=this.#e,n=xr[e.key];if(n)this.chartType==="heatmap"&&/Left|Right/.test(e.key)&&(n*=7),i=i<0?n>0?0:l-1:Q(i+n,0,l-1);else if(e.key==="Home"||e.key==="End")i=e.key==="Home"?0:l-1;else{e.key==="Escape"&&this.#g();return}e.preventDefault(),this.#d(i,!0)}#d(e,r){let l=this.#p();if(!l.length)return;e=Q(e,0,l.length-1),this.#t.querySelector(".k")?.classList.remove("k");let i=l[e],n=i.getBoundingClientRect?.()||{left:0,top:0,width:0};i.classList.add("k"),this.#e=e,this.#m(i,n.left+n.width/2,n.top),r&&(this.#o.textContent=`${i.getAttribute("data-tip").replace(/\n/g,", ")}. ${e+1} of ${l.length}`)}#g(){this.#t.querySelector(".k")?.classList.remove("k"),this.#r.classList.remove("on"),this.#o.textContent="",this.#e=-1}};function Mr(t,{head:e,rows:r}){let l=i=>i.map((n,s)=>s?`<td>${ct(n)}</td>`:`<th scope="row">${ct(n)}</th>`).join("");return`<table><caption>${ct(t||"Chart data")}</caption><thead><tr>${e.map(i=>`<th scope="col">${ct(i)}</th>`).join("")}</tr></thead><tbody>${r.map(i=>`<tr>${l(i)}</tr>`).join("")}</tbody></table>`}function gt(t){typeof customElements>"u"||typeof HTMLElement>"u"||(customElements.get(`bezel-${t}`)||customElements.define(`bezel-${t}`,class extends wt{get chartType(){return t}}),customElements.get("bezel-chart")||customElements.define("bezel-chart",class extends wt{}))}dt("spark",ue);gt("spark");function fe(t,e,r){if(t===e)if(t===0)e=1;else{var l=Math.abs(t)*.1;t-=l,e+=l}for(var i=(e-t)/(r||4),n=Math.pow(10,Math.floor(Math.log10(i))),s=i/n,o=(s<=1?1:s<=2?2:s<=5?5:10)*n,f=Math.floor(t/o)*o,u=Math.ceil(e/o)*o,p=[],m=f;m<=u+o/2;m+=o)p.push(+m.toFixed(10));return{lo:f,hi:u,ticks:p}}function Qt(t,e,r,l,i,n,s,o){var f=l,u=i,p="",m=o||13;return t.forEach(function(c,T){var w=m+Et(c,12)+16;f>l&&f+w-16>l+n&&(f=l,u+=20),p+=(s?s(T,f,u):'<circle cx="'+a(f+4)+'" cy="'+a(u+6)+'" r="4" fill="'+e[T%e.length]+'"/>')+O(f+m,u+10,c,'fill="'+r.fg+'" font-family="'+ft+'" font-size="12"'),f+=w}),{svg:p,height:u-i+24}}var Xt={solid:"",dashed:"7 5",dotted:"1 5",dashdot:"9 4 1 4"},ee=["circle","square","triangle","diamond"],pe=["solid","stripes","dots","grid"];function Vt(t,e,r){if(t==null||t===!1||t==="none"||t==="false")return null;var l=t===!0||t===""||t==="auto"?e:U(t).map(function(i){return e.indexOf(i)<0?r:i});return l.length?function(i){return l[i%l.length]}:null}function re(t,e,r,l,i){var n=l*1.15,s=l*.85;return t==="square"?'<rect x="'+a(e-s)+'" y="'+a(r-s)+'" width="'+a(2*s)+'" height="'+a(2*s)+'" rx="1"'+i+"/>":t==="triangle"?'<path d="M'+a(e)+","+a(r-n)+"L"+a(e+n)+","+a(r+s)+"L"+a(e-n)+","+a(r+s)+'Z"'+i+"/>":t==="diamond"?'<path d="M'+a(e)+","+a(r-n*1.1)+"L"+a(e+n)+","+a(r)+"L"+a(e)+","+a(r+n*1.1)+"L"+a(e-n)+","+a(r)+'Z"'+i+"/>":'<circle cx="'+a(e)+'" cy="'+a(r)+'" r="'+a(l)+'"'+i+"/>"}function de(t,e,r,l){var i=' stroke="'+l+'" stroke-opacity=".55" stroke-width="1.5"';return'<pattern id="'+t+'" width="6" height="6" patternUnits="userSpaceOnUse"'+(e==="dots"?"":' patternTransform="rotate(45)"')+'><rect width="6" height="6" fill="'+r+'"/>'+(e==="dots"?'<circle cx="3" cy="3" r="1.3" fill="'+l+'" fill-opacity=".55"/>':'<path d="M3,0V6'+(e==="grid"?"M0,3H6":"")+'"'+i+"/>")+"</pattern>"}function Qe(t){return Math.max.apply(null,t.map(function(e){return Et(e,10,!0)}))+10}function ae(t,e){for(var r=zt(t.values),l=U(t.series),i=U(t.labels),n=[],s=Math.max.apply(null,[0].concat(r.map(function(m){return m.length}))),o=0;o<s;o++){var f=[i[o]||"#"+(o+1)],u=0;r.forEach(function(m){f.push(o<m.length?h(m[o],t):""),u+=o<m.length?m[o]:0}),e&&f.push(h(u,t)),n.push(f)}var p=r.length>1||l.length?r.map(function(m,c){return l[c]||"Series "+(c+1)}):["Value"];return{head:["Label"].concat(p,e?["Total"]:[]),rows:n}}function ge(t,e,r,l,i,n,s){var o="",f=i,u=r.n,p=r.labels;if(r.names){var m=Qt(r.names,r.pal,e,l,f,n,r.key,r.kw);o+=m.svg,f+=m.height}var c=r.lo,T=r.hi;A(t.goal)&&(c=Math.min(c,+t.goal),T=Math.max(T,+t.goal)),r.zero&&(c=Math.min(0,c),T=Math.max(0,T));var w=fe(c,T,4),B=w.ticks.map(r.tick),N=Math.max.apply(null,B.map(function(C){return Et(C,10,!0)}))+10,L=p.length?20:4,z=l+N,g=n-N,V=s-(f-i)-L,k=function(C){return u===1?z+g/2:z+C*g/(u-1)},d=function(C){return f+V-(C-w.lo)/(w.hi-w.lo)*V};if(w.ticks.forEach(function(C,y){var M=d(C);o+='<line x1="'+a(z)+'" x2="'+a(z+g)+'" y1="'+a(M)+'" y2="'+a(M)+'" stroke="'+e.grid+'"'+(C===0?"":' stroke-dasharray="2 4"')+"/>"+O(z-8,M+3.5,B[y],H(e,10,'text-anchor="end"'))}),p.length){for(var b=Math.max(1,Math.ceil(u*(Math.max.apply(null,p.map(function(C){return Et(C,10,!0)}))+10)/g)),v=0;v<u;v+=b)if(p[v]!=null){var x=u>1&&v===0?"start":u>1&&v===u-1?"end":"middle";o+=O(k(v),f+V+15,p[v],H(e,10,'text-anchor="'+x+'"'))}}return r.notes.forEach(function(C){if(!(C.i>=u)){var y=k(C.i);o+='<line x1="'+a(y)+'" x2="'+a(y)+'" y1="'+a(f+12)+'" y2="'+a(f+V)+'" stroke="'+e.fg+'" stroke-opacity=".4" stroke-dasharray="3 3"/>'+O(Q(y,z+30,z+g-30),f+8,C.text,H(e,10,'text-anchor="middle"',e.fg))}}),{svg:o,X:k,Y:d,px:z,pw:g,top:f,ph:V}}function ve(t,e,r,l,i){for(var n=A(t.goal)?It(t,e,r.px,r.px+r.pw,r.Y(+t.goal)):"",s=l>1?r.pw/(l-1):r.pw,o=0;o<l;o++)n+=Lt(r.X(o)-s/2,r.top,s,r.ph,i(o));return n}function xe(t,e,r,l){return function(i,n,s){var o=t[i%t.length],f=e?Xt[e(i)]:"",u=r?r(i):"none";return'<line x1="'+a(n)+'" x2="'+a(n+18)+'" y1="'+a(s+6)+'" y2="'+a(s+6)+'" stroke="'+o+'" stroke-width="2.5" stroke-linecap="round"'+(f?' stroke-dasharray="'+f+'"':"")+"/>"+(u!=="none"?re(u,n+9,s+6,3.5,' fill="'+o+'" stroke="'+l+'" stroke-width="1.5"'):"")}}function ye(t,e,r,l,i){return i?'<path d="'+e+'" fill="none" stroke="'+r+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="'+i+'"'+ut(t,"bzc-a",l*.15)+"/>":'<path d="'+e+'" fill="none" stroke="'+r+'" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" pathLength="1" style="stroke-dasharray:1'+(t.animate?";animation-delay:"+l*.15+"s":"")+'"'+(t.animate?' class="bzc-d"':"")+"/>"}function be(t,e,r,l,i,n,s,o){var f="",u=Math.ceil(r.length/40);return r.forEach(function(p,m){(m%u===0||m===r.length-1)&&(f+=re(e,l(m),i(p),3.5,' fill="'+n+'" stroke="'+s+'" stroke-width="1.5"'+ut(t,"bzc-a",.6+o*.15)))}),f}function ke(t,e){var r=zt(t.values),l=U(t.series),i=U(t.labels),n=ht(t,e),s=W(t.height,170),o=Math.max.apply(null,[0].concat(r.map(function(N){return N.length}))),f=Yt(t,i),u=r.length>1||l.length>0,p=kt(r[0]||[],t,""),m=Vt(t.dash,Object.keys(Xt),"solid"),c=Vt(t.markers,ee,"none"),T=t.background||e.tile,w=(m||c)&&xe(n,m,c,T),B=function(N){return l[N]||"Series "+(N+1)};return pt(t,e,s,function(N,L,z,g){if(!o)return mt(e,N,L,z,g);var V=[].concat.apply([],r),k=ge(t,e,{n:o,names:u?r.map(function(F,P){return B(P)}):null,pal:n,key:w,kw:w&&24,lo:Math.min.apply(null,V),hi:Math.max.apply(null,V),zero:K(t.zero),labels:i,notes:f,tick:function(F){return h(F,t,!0)}},N,L,z,g),d=k.svg,b=k.X,v=k.Y,x=k.px,C=k.pw,y=k.top,M=k.ph;return r.forEach(function(F,P){var _=n[P%n.length],I=F.map(function(lt,at){return[b(at),v(lt)]});I.length===1&&(I=[[x,I[0][1]],[x+C,I[0][1]]]);var J=Ut(I,K(t.straight));if(P===0){var tt=Ht("g"),j=I[I.length-1];d+='<defs><linearGradient id="'+tt+'" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="'+_+'" stop-opacity=".26"/><stop offset="1" stop-color="'+_+'" stop-opacity="0"/></linearGradient></defs><path d="'+J+"L"+a(j[0])+","+a(y+M)+"L"+a(I[0][0])+","+a(y+M)+'Z" fill="url(#'+tt+')"'+ut(t,"bzc-a")+"/>"}var G=c?c(P):"none";if(d+=ye(t,J,_,P,m?Xt[m(P)]:""),G!=="none")d+=be(t,G,F,b,v,_,T,P);else{var et=I[I.length-1];d+='<circle cx="'+a(et[0])+'" cy="'+a(et[1])+'" r="4" fill="'+_+'" stroke="'+T+'" stroke-width="2"/>'}K(t.showValues)&&F.forEach(function(lt,at){d+=O(b(at),v(lt)-8,h(lt,t,!0),H(e,9,'text-anchor="middle"'))})}),d+ve(t,e,k,o,function(F){var P=i[F]||"#"+(F+1);return r.forEach(function(_,I){F<_.length&&(P+=`
3
+ `+(u?B(I)+": ":"")+h(_[F],t))}),P})},{stat:p,summary:r.length+" series over "+o+" points"})}ke.table=function(t){return ae(t)};dt("line",ke);gt("line");function Me(t,e){for(var r=zt(t.values),l=U(t.series),i=U(t.labels),n=ht(t,e),s=W(t.height,170),o=r.length,f=Math.max.apply(null,[0].concat(r.map(function(G){return G.length}))),u=o>1?t.stacked==="percent"?"percent":K(t.stacked)?"stack":"":"",p=Yt(t,i),m=o>1||l.length>0,c=function(G){return l[G]||"Series "+(G+1)},T=function(G,et){return et<r[G].length?r[G][et]:0},w=r.map(function(){return[]}),B=r.map(function(){return[]}),N=[],L=[],z=0;z<f;z++){for(var g=0,V=0,k=0,d=0,b=0;b<o;b++)k+=T(b,z),d+=Math.max(0,T(b,z));for(N.push(k),L.push(d),b=0;b<o;b++){var v=u==="percent"?d?Math.max(0,T(b,z))/d*100:0:T(b,z);u?v>=0?(w[b].push(g),g+=v,B[b].push(g)):(w[b].push(V),V+=v,B[b].push(V)):(w[b].push(0),B[b].push(v))}}for(var x=[].concat.apply([],w.concat(B)),C=Vt(t.dash,Object.keys(Xt),"solid"),y=Vt(t.markers,ee,"none"),M=o>1?Vt(t.patterns,pe,"solid"):null,F=t.background||e.tile,P="",_=[],I=0;M&&I<o;I++)if(M(I)!=="solid"){var J=Ht("g");P+=de(J,M(I),n[I%n.length],F),_[I]="url(#"+J+")"}var tt=M?function(G,et,lt){return'<rect x="'+a(et)+'" y="'+a(lt+1)+'" width="10" height="10" rx="2" fill="'+(_[G]||n[G%n.length])+'"/>'}:(C||y)&&xe(n,C,y,F),j=function(G,et){return L[et]?Math.round(Math.max(0,T(G,et))/L[et]*100):0};return pt(t,e,s,function(G,et,lt,at){if(!f)return mt(e,G,et,lt,at);var ot=ge(t,e,{n:f,names:m?r.map(function(Z,E){return c(E)}):null,pal:n,key:tt,kw:tt&&(M?15:24),lo:Math.min.apply(null,x),hi:Math.max.apply(null,x),zero:!0,labels:i,notes:p,tick:u==="percent"?function(Z){return h(Z,{lang:t.lang},!0)+"%"}:function(Z){return h(Z,t,!0)}},G,et,lt,at),S=(P?"<defs>"+P+"</defs>":"")+ot.svg,Y=ot.X,R=ot.Y,nt=function(Z){var E=Z.map(function(D,X){return[Y(X),R(D)]});return E.length===1?[[ot.px,E[0][1]],[ot.px+ot.pw,E[0][1]]]:E},q=K(t.straight),yt=u?".8":".22",St=function(Z){return u?B[Z]:r[Z]};return r.forEach(function(Z,E){var D=nt(St(E)),X=nt(u?w[E]:St(E).map(function(){return 0})).reverse();S+='<path d="'+Ut(D,q)+Ut(X,q).replace(/^M/,"L")+'Z" fill="'+(_[E]||n[E%n.length])+'" fill-opacity="'+yt+'"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(E*.1)+'s"':"")+"/>"}),r.forEach(function(Z,E){var D=n[E%n.length],X=St(E),bt=nt(X),At=y?y(E):"none";S+=ye(t,Ut(bt,q),D,E,C?Xt[C(E)]:""),At!=="none"?S+=be(t,At,X,Y,R,D,F,E):u||(S+='<circle cx="'+a(bt[bt.length-1][0])+'" cy="'+a(bt[bt.length-1][1])+'" r="4" fill="'+D+'" stroke="'+F+'" stroke-width="2"/>'),K(t.showValues)&&!u&&X.forEach(function(Ft,it){S+=O(Y(it),R(Ft)-8,h(Ft,t,!0),H(e,9,'text-anchor="middle"'))})}),K(t.showValues)&&u==="stack"&&N.forEach(function(Z,E){var D=Math.max.apply(null,B.map(function(X){return X[E]}).concat([0]));S+=O(Y(E),R(D)-8,h(Z,t,!0),H(e,9,'text-anchor="middle"'))}),S+ve(t,e,ot,f,function(Z){var E=i[Z]||"#"+(Z+1);return r.forEach(function(D,X){Z<D.length&&(E+=`
4
+ `+(m?c(X)+": ":"")+h(D[Z],t)+(u==="percent"?" ("+j(X,Z)+"%)":""))}),E+(u?`
5
+ Total: `+h(N[Z],t):"")})},{stat:kt(u?N:r[0]||[],t,""),summary:o+" series "+(u==="percent"?"as shares of each total":u?"stacked":"filled")+" over "+f+" points"})}Me.table=function(t){var e=zt(t.values);return ae(t,e.length>1&&(t.stacked==="percent"||K(t.stacked)))};dt("area",Me);gt("area");var Je=40,je=24;function we(t,e){for(var r=zt(t.values),l=U(t.series),i=U(t.labels),n=ht(t,e),s=r.length,o=Math.max.apply(null,[0].concat(r.map(function(S){return S.length}))),f=s>1,u=K(t.horizontal),p=f&&K(t.stacked),m=!f&&U(t.color).filter(Boolean).length>1,c=r[0]||[],T=[].concat.apply([],r),w=function(S,Y){return r.reduce(function(R,nt){return S<nt.length&&nt[S]*Y>0?R+nt[S]:R},0)},B=[],N=[],L=[],z=0;p&&z<o;z++)N.push(w(z,1)),L.push(w(z,-1)),B.push(N[z]+L[z]);for(var g=p?N.concat(L):T,V=g.length?Math.max.apply(null,g):0,k=function(S){return l[S]||"Series "+(S+1)},d=f?Vt(t.patterns,pe,"solid"):null,b="",v=[],x=0;d&&x<s;x++)if(d(x)!=="solid"){var C=Ht("g");b+=de(C,d(x),n[x%n.length],t.background||e.tile),v[x]="url(#"+C+")"}var y=function(S,Y){return f?v[S]||n[S%n.length]:m?n[Y%n.length]:n[0]},M=d&&function(S,Y,R){return'<rect x="'+a(Y)+'" y="'+a(R+1)+'" width="10" height="10" rx="2" fill="'+y(S)+'"/>'},F=function(S){return f||m||t.highlight==="none"||S===V?1:.5},P=function(S){return i[S]||"#"+(S+1)},_=function(S){return f?P(S)+r.map(function(Y,R){return S<Y.length?`
6
+ `+k(R)+": "+h(Y[S],t):""}).join("")+(p?`
7
+ Total: `+h(B[S],t):""):P(S)+": "+h(c[S],t)},I=qt(t),J=f||l.length?Qt(r.map(function(S,Y){return k(Y)}),n,e,0,0,I.w,M,M&&15).height:0,tt=p?1:s,j=f&&!p,G=j?10:14,et=3,lt=u?tt*G+(tt-1)*et+(j?14:16):0,at=u?J+Math.max(1,o)*lt-6:W(t.height,140)+J,ot=c.indexOf(Math.max.apply(null,c.length?c:[0]));return pt(t,e,at,function(S,Y,R,nt){if(!o)return mt(e,S,Y,R,nt);var q=b?"<defs>"+b+"</defs>":"",yt=Y;J&&(q+=Qt(r.map(function($,st){return k(st)}),n,e,S,Y,R,M,M&&15).svg,yt+=J);var St=Math.min(0,Math.min.apply(null,g)),Z=Math.max(0,V);if(A(t.goal)&&(St=Math.min(St,+t.goal),Z=Math.max(Z,+t.goal)),Z===St&&(Z=St+1),u){for(var E=i.length?Math.min(R*.4,Math.max.apply(null,i.map(function($){return Et($,12)}))+10):0,D=p?[B.map(function($){return h($,t)})]:r.map(function($){return $.map(function(st){return h(st,t)})}),X=Math.max.apply(null,[].concat.apply([],D).map(function($){return Et($,j?10:11,!0)}))+10,bt=S+E,At=R-E-X,Ft=Math.max(Z,0)||1,it=0;it<o;it++){var Bt=yt+it*lt;i[it]!=null&&(q+=O(S,Bt+(lt-6)/2+4,Zt(i[it],Math.floor(E/6.7)),'fill="'+e.fg+'" font-family="'+ft+'" font-size="12"')),p?(q+=ar(it,bt,Bt+5,At,Ft),q+=O(S+R,Bt+5+G/2+3.8,D[0][it],'text-anchor="end" fill="'+e.fg+'" font-family="'+xt+'" font-size="11" font-weight="600"')):r.forEach(function($,st){if(!(it>=$.length)){var vt=$[it],Tt=Bt+(f?2:5)+st*(G+et),Rt=Math.max(0,vt)/Ft*At;f||(q+='<rect x="'+a(bt)+'" y="'+a(Tt)+'" width="'+a(At)+'" height="'+G+'" rx="'+G/2+'" fill="'+e.grid+'" fill-opacity=".6"/>'),Rt>0&&(q+='<rect x="'+a(bt)+'" y="'+a(Tt)+'" width="'+a(Math.max(G,Rt))+'" height="'+G+'" rx="'+G/2+'" fill="'+y(st,it)+'" fill-opacity="'+F(vt)+'"'+ut(t,"bzc-gx",it*.06+st*.03)+"/>"),q+=O(S+R,Tt+G/2+3.8,D[st][it],'text-anchor="end" fill="'+e.fg+'" font-family="'+xt+'" font-size="'+(f?10:11)+'" font-weight="600"')}}),q+=Lt(S,Bt,R,lt-6,_(it))}if(A(t.goal)&&+t.goal>0){var Pe=bt+ +t.goal/Ft*At;q+='<line x1="'+a(Pe)+'" x2="'+a(Pe)+'" y1="'+a(yt-2)+'" y2="'+a(Y+nt+2)+'" stroke="'+e.fg+'" stroke-opacity=".55" stroke-dasharray="3 3"/>'}return q}function ar($,st,vt,Tt,Rt){var Pt='<rect x="'+a(st)+'" y="'+a(vt)+'" width="'+a(Tt)+'" height="'+G+'" rx="'+G/2+'" fill="'+e.grid+'" fill-opacity=".6"/>',jt=0;return r.forEach(function(oe,Dt){var te=$<oe.length?oe[$]:0,$t=Math.max(0,te)/Rt*Tt;if(!($t<=0)){var Wt=jt>0?1.5:0;Pt+='<rect x="'+a(st+jt+Wt)+'" y="'+a(vt)+'" width="'+a(Math.max(2,$t-Wt))+'" height="'+G+'" rx="'+a(Math.min(3,$t/2))+'" fill="'+y(Dt,$)+'"'+ut(t,"bzc-gx",$*.06+Dt*.03)+"/>",jt+=$t}}),Pt}var De=i.length?Math.max.apply(null,i.map(function($){return Et($,10,!0)})):0,Te=i.length?Math.max(1,Math.ceil(o*(De+8)/R)):1,ne=K(t.angleLabels)&&Te>1,$e=Je*Math.PI/180,Ue=function($){return ne?Zt($,je):$};if(ne){var nr=R/o,Jt=0;i.forEach(function($,st){Jt=Math.max(Jt,Math.cos($e)*Et(Ue($),10,!0)+4-(st+.5)*nr)}),Jt=Math.min(Jt,R*.25),S+=Jt,R-=Jt,Te=1}var Ye=K(t.showValues)&&St<0?14:0,ir=ne?Math.ceil(Math.sin($e)*Math.min(De,Et("x".repeat(je),10,!0)))+18:20,lr=(i.length?ir:2)+Ye,Ie=K(t.showValues)?16:4,Ce=nt-(yt-Y)-lr-Ie,Xe=yt+Ie,Gt=function($){return Xe+Ce-($-St)/(Z-St)*Ce},ie=R/o,le=Math.min(ie*(j?.78:.62),j?s*30:56),_e=j?Math.min(3,le/s*.15):0,_t=p?le:(le-_e*(s-1))/s,ce=Gt(0);q+='<line x1="'+S+'" x2="'+(S+R)+'" y1="'+a(ce)+'" y2="'+a(ce)+'" stroke="'+e.grid+'"/>';for(var Ot=0;Ot<o;Ot++){var Fe=S+Ot*ie+(ie-le)/2;if(p?q+=or(Ot,Fe):r.forEach(function($,st){if(!(Ot>=$.length)){var vt=$[Ot],Tt=Fe+st*(_t+_e),Rt=Math.min(Gt(vt),ce),Pt=Math.abs(Gt(vt)-ce);Pt>.5&&(q+='<rect x="'+a(Tt)+'" y="'+a(Rt)+'" width="'+a(_t)+'" height="'+a(Pt)+'" rx="'+a(Math.min(6,_t/2,Pt/2))+'" fill="'+y(st,Ot)+'" fill-opacity="'+F(vt)+'"'+ut(t,vt<0?"bzc-gn":"bzc-g",Ot*.05+st*.03)+"/>"),K(t.showValues)&&(q+=O(Tt+_t/2,vt<0?Gt(vt)+12:Gt(vt)-5,h(vt,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+xt+'" font-size="'+(f?9:10)+'" font-weight="600"'))}}),i[Ot]!=null&&Ot%Te===0){var Ne=Fe+le/2,Ve=Xe+Ce+Ye+(ne?12:15);q+=ne?O(Ne,Ve,Ue(i[Ot]),H(e,10,'text-anchor="end" transform="rotate(-'+Je+" "+a(Ne)+" "+a(Ve)+')"')):O(Ne,Ve,i[Ot],H(e,10,'text-anchor="middle"'))}q+=Lt(S+Ot*ie,yt,ie,nt-(yt-Y),_(Ot))}return A(t.goal)&&(q+=It(t,e,S,S+R,Gt(+t.goal))),q;function or($,st){var vt="",Tt=0,Rt=0;if(r.forEach(function(jt,oe){var Dt=$<jt.length?jt[$]:0;if(Dt){var te=Dt>0?Tt:Rt,$t=te+Dt;Dt>0?Tt=$t:Rt=$t;var Wt=Gt(Math.max(te,$t)),Be=Gt(Math.min(te,$t)),se=Be-Wt,We=te!==0?Math.min(1.5,se/2):0;Dt>0?Be-=We:Wt+=We,se=Be-Wt,se>.5&&(vt+='<rect x="'+a(st)+'" y="'+a(Wt)+'" width="'+a(_t)+'" height="'+a(se)+'" rx="'+a(Math.min(3,_t/2,se/2))+'" fill="'+y(oe,$)+'"'+ut(t,Dt<0?"bzc-gn":"bzc-g",$*.05+oe*.03)+"/>")}}),K(t.showValues)){var Pt=B[$];vt+=O(st+_t/2,Pt<0?Gt(L[$])+12:Gt(N[$])-5,h(Pt,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+xt+'" font-size="10" font-weight="600"')}return vt}},{stat:kt(c,t,""),summary:o?p?s+" series stacked across "+o+" groups":f?s+" series across "+o+" groups":"highest "+(i[ot]||"")+" "+h(c[ot],t):"no data"})}we.table=function(t){return ae(t,zt(t.values).length>1&&K(t.stacked))};dt("bars",we);gt("bars");function wr(t,e){var r=Math.min(t.length,e.length);if(r<2)return null;var l=0,i=0,n;for(n=0;n<r;n++)l+=t[n],i+=e[n];l/=r,i/=r;var s=0,o=0,f=0;for(n=0;n<r;n++)s+=(t[n]-l)*(t[n]-l),o+=(e[n]-i)*(e[n]-i),f+=(t[n]-l)*(e[n]-i);if(!s)return null;var u=f/s;return{slope:u,intercept:i-u*l,r:o?f/Math.sqrt(s*o):0}}function Se(t,e){for(var r=zt(t.x),l=zt(t.y),i=U(t.series),n=U(t.labels),s=ht(t,e),o=[],f=0;f<Math.max(r.length,l.length);f++){var u=r[f]||[],p=l[f]||[],m=Math.min(u.length,p.length);o.push({xs:u.slice(0,m),ys:p.slice(0,m)})}o=o.filter(function(b){return b.xs.length});var c=o.reduce(function(b,v){return b+v.xs.length},0),T=W(t.height,210),w=o.length>1||i.length>0,B=K(t.trend),N=function(b){return i[b]||"Group "+(b+1)},L={decimals:t.decimals,compact:t.compact,lang:t.lang},z=Yt(t,n),g=Vt(t.markers,ee,"circle"),V=t.background||e.tile,k=function(b){var v=g?g(b):"circle";return v==="none"?"circle":v},d=g&&function(b,v,x){return re(k(b),v+4,x+6,4,' fill="'+s[b%s.length]+'"')};return pt(t,e,T,function(b,v,x,C){if(!c)return mt(e,b,v,x,C);var y="",M=v;if(w){var F=Qt(o.map(function(E,D){return N(D)}),s,e,b,M,x,d);y+=F.svg,M+=F.height}var P=[].concat.apply([],o.map(function(E){return E.xs})),_=[].concat.apply([],o.map(function(E){return E.ys})),I=Math.min.apply(null,_),J=Math.max.apply(null,_);A(t.goal)&&(I=Math.min(I,+t.goal),J=Math.max(J,+t.goal)),K(t.zero)&&(I=Math.min(0,I),J=Math.max(0,J));var tt=fe(I,J,4),j=fe(Math.min.apply(null,P),Math.max.apply(null,P),5),G=tt.ticks.map(function(E){return h(E,t,!0)}),et=Qe(G)+(A(t.yLabel)?14:0),lt=20+(A(t.xLabel)?16:0),at=b+et,ot=x-et,S=C-(M-v)-lt,Y=function(E){return at+6+(E-j.lo)/(j.hi-j.lo)*(ot-12)},R=function(E){return M+6+S-6-(E-tt.lo)/(tt.hi-tt.lo)*(S-6)};tt.ticks.forEach(function(E,D){var X=R(E);y+='<line x1="'+a(at)+'" x2="'+a(at+ot)+'" y1="'+a(X)+'" y2="'+a(X)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'+O(at-8,X+3.5,G[D],H(e,10,'text-anchor="end"'))});var nt=Math.max(1,Math.ceil(j.ticks.length*44/ot));if(j.ticks.forEach(function(E,D){if(!(D%nt)){var X=Y(E);y+='<line x1="'+a(X)+'" x2="'+a(X)+'" y1="'+a(M)+'" y2="'+a(M+S)+'" stroke="'+e.grid+'" stroke-dasharray="2 4"/>'+O(X,M+S+15,h(E,L,!0),H(e,10,'text-anchor="middle"'))}}),A(t.xLabel)&&(y+=O(at+ot/2,M+S+32,t.xLabel,H(e,10,'text-anchor="middle" font-weight="600"'))),A(t.yLabel)){var q=M+S/2;y+='<text x="'+a(b+4)+'" y="'+a(q)+'" transform="rotate(-90 '+a(b+4)+" "+a(q)+')" text-anchor="middle" '+H(e,10,'font-weight="600"')+' dominant-baseline="hanging">'+String(t.yLabel).replace(/[&<>"]/g,function(E){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"}[E]})+"</text>"}A(t.goal)&&(y+=It(t,e,at,at+ot,R(+t.goal))),B&&o.forEach(function(E,D){var X=wr(E.xs,E.ys);if(X){var bt=Math.min.apply(null,E.xs),At=Math.max.apply(null,E.xs),Ft=X.slope*bt+X.intercept,it=X.slope*At+X.intercept,Bt=s[D%s.length];y+='<line x1="'+a(Y(bt))+'" y1="'+a(Q(R(Ft),M,M+S))+'" x2="'+a(Y(At))+'" y2="'+a(Q(R(it),M,M+S))+'" stroke="'+Bt+'" stroke-width="2" stroke-dasharray="6 4" stroke-linecap="round" stroke-opacity=".9"/>',y+=O(Math.min(Y(At),at+ot)-2,Q(R(it),M+10,M+S)-7,"r = "+X.r.toFixed(2),H(e,10,'text-anchor="end" font-weight="600"',Bt))}});var yt=0,St=c>150?3:4.5;o.forEach(function(E,D){var X=s[D%s.length];E.xs.forEach(function(bt,At){var Ft=Y(bt),it=R(E.ys[At]),Bt=(n[yt]?n[yt]+`
8
+ `:w?N(D)+`
9
+ `:"")+(A(t.xLabel)?t.xLabel:"x")+": "+h(bt,L)+`
10
+ `+(A(t.yLabel)?t.yLabel:"y")+": "+h(E.ys[At],t);y+=re(k(D),Ft,it,St,' fill="'+X+'" fill-opacity=".85" stroke="'+V+'" stroke-width="1.5"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(Math.min(.8,yt*.012))+'s"':"")),y+=Lt(Ft-8,it-8,16,16,Bt),yt++})});var Z=[];return o.forEach(function(E){E.xs.forEach(function(D,X){Z.push([Y(D),R(E.ys[X])])})}),z.forEach(function(E){var D=Z[E.i];D&&(y+='<circle cx="'+a(D[0])+'" cy="'+a(D[1])+'" r="'+(St+4)+'" fill="none" stroke="'+e.fg+'" stroke-width="1.5"/>'+O(Q(D[0],at+30,at+ot-30),D[1]-St-9,E.text,H(e,10,'text-anchor="middle"',e.fg)))}),y},{summary:c+" points"+(w?" in "+o.length+" groups":"")})}Se.table=function(t){var e=zt(t.x),r=zt(t.y),l=U(t.series),i=U(t.labels),n=e.length>1||l.length>0,s={decimals:t.decimals,compact:t.compact,lang:t.lang},o=[],f=0;return e.forEach(function(u,p){for(var m=r[p]||[],c=0;c<Math.min(u.length,m.length);c++,f++)o.push([i[f]||"#"+(f+1)].concat(n?[l[p]||"Group "+(p+1)]:[],[h(u[c],s),h(m[c],t)]))}),{head:["Point"].concat(n?["Group"]:[],[A(t.xLabel)?t.xLabel:"x",A(t.yLabel)?t.yLabel:"y"]),rows:o}};dt("scatter",Se);gt("scatter");function ze(t,e){var r=rt(t.values),l=U(t.labels),i=ht(t,e),n=W(t.max,100)||100,s=W(t.height,140),o=!A(t.prefix)&&!A(t.suffix)&&n===100,f=function(p){return h(p,t)+(o?"%":"")},u=kt(r,t,"");return pt(t,e,s,function(p,m,c,T){if(!r.length)return mt(e,p,m,c,T);var w="",B=r.length===1,N=Math.min(T,B?c:c*.55),L=B?p+c/2:p+N/2,z=m+T/2,g=B?N*.12:Q(N*.42/(r.length*1.35),5,16),V=g*.38;if(r.forEach(function(v,x){var C=N/2-g/2-x*(g+V);if(!(C<=g/2)){var y=Q(v/n*100,0,100),M=i[x%i.length];w+='<circle cx="'+a(L)+'" cy="'+a(z)+'" r="'+a(C)+'" fill="none" stroke="'+M+'" stroke-opacity=".16" stroke-width="'+a(g)+'"/>',y>0&&(w+='<circle cx="'+a(L)+'" cy="'+a(z)+'" r="'+a(C)+'" fill="none" stroke="'+M+'" stroke-width="'+a(g)+'" stroke-linecap="round" pathLength="100" transform="rotate(-90 '+a(L)+" "+a(z)+')" style="stroke-dasharray:'+a(y)+" 100"+(t.animate?";animation-delay:"+x*.12+"s":"")+'"'+(t.animate?' class="bzc-s"':"")+"/>"),w+='<circle cx="'+a(L)+'" cy="'+a(z)+'" r="'+a(C+g/2)+'" fill="#000" fill-opacity="0" class="bzc-hit" data-tip="'+ct((l[x]||"#"+(x+1))+": "+f(v)+(o?"":" of "+h(n,t)))+'"/>'}}),B)w+=O(L,z+N*.08,f(r[0]),'text-anchor="middle" fill="'+e.fg+'" font-family="'+ft+'" font-size="'+a(N*.22)+'" font-weight="800"'),l[0]&&(w+=O(L,z+N*.08+16,l[0],H(e,10,'text-anchor="middle"')));else{var k=p+N+22,d=Math.min(26,T/r.length),b=z-d*r.length/2;r.forEach(function(v,x){var C=b+x*d+d/2;w+='<circle cx="'+a(k+4)+'" cy="'+a(C)+'" r="4" fill="'+i[x%i.length]+'"/>'+O(k+14,C+4,Zt(l[x]||"#"+(x+1),Math.floor((p+c-k-60)/6.7)),'fill="'+e.fg+'" font-family="'+ft+'" font-size="12"')+O(p+c,C+4,f(v),'text-anchor="end" fill="'+e.fg+'" font-family="'+xt+'" font-size="11" font-weight="600"')})}return w},{stat:u,summary:r.map(function(p,m){return(l[m]?l[m]+" ":"")+f(p)}).join(", ")})}ze.table=function(t){var e=U(t.labels),r=W(t.max,100)||100,l=!A(t.prefix)&&!A(t.suffix)&&r===100;return{head:["Label","Value"],rows:rt(t.values).map(function(i,n){return[e[n]||"#"+(n+1),h(i,t)+(l?"%":" of "+h(r,t))]})}};dt("ring",ze);gt("ring");function Ee(t,e){var r=rt(t.values).map(function(c){return Math.max(0,c)}),l=U(t.labels),i=ht(t,e),n=r.slice(),s=l.slice();if(n.length>6){var o=n.map(function(c,T){return T}).sort(function(c,T){return r[T]-r[c]}),f=o.slice(0,5).sort(function(c,T){return c-T});n=f.map(function(c){return r[c]}),s=f.map(function(c){return l[c]||"#"+(c+1)}),n.push(Nt(o.slice(5).map(function(c){return r[c]}))),s.push("Other")}var u=Nt(n),p=W(t.height,150),m=kt(n,t,"");return pt(t,e,p,function(c,T,w,B){if(!u)return mt(e,c,T,w,B);var N="",L=Math.min(B,w*.5),z=c+L/2,g=T+B/2,V=L*.16,k=(L-V)/2,d=0,b=n.filter(Boolean).length>1?.9:0;n.forEach(function(y,M){var F=y/u*100;if(!(F<=0)){var P=Math.max(.01,F-b);N+='<circle cx="'+a(z)+'" cy="'+a(g)+'" r="'+a(k)+'" fill="none" stroke="'+i[M%i.length]+'" stroke-width="'+a(V)+'" pathLength="100" stroke-dasharray="'+a(P)+" "+a(100-P)+'" stroke-dashoffset="'+a(-d)+'" transform="rotate(-90 '+a(z)+" "+a(g)+')"'+ut(t,"bzc-a",M*.08)+"/>",d+=F}}),N+=O(z,g+2,h(u,t,!0),'text-anchor="middle" fill="'+e.fg+'" font-family="'+ft+'" font-size="'+a(L*.17)+'" font-weight="800"'),N+=O(z,g+2+14,(A(t.centerLabel)?t.centerLabel:"Total").toUpperCase(),H(e,9,'text-anchor="middle" letter-spacing="1"'));var v=c+L+22,x=Math.min(24,B/n.length),C=g-x*n.length/2;return n.forEach(function(y,M){var F=C+M*x+x/2,P=Math.round(y/u*100),_=(s[M]||"#"+(M+1))+": "+h(y,t)+" ("+P+"%)";N+='<circle cx="'+a(v+4)+'" cy="'+a(F)+'" r="4" fill="'+i[M%i.length]+'"/>'+O(v+14,F+4,Zt(s[M]||"#"+(M+1),Math.floor((c+w-v-50)/6.7)),'fill="'+e.fg+'" font-family="'+ft+'" font-size="12"')+O(c+w,F+4,P+"%",'text-anchor="end" fill="'+e.muted+'" font-family="'+xt+'" font-size="11" font-weight="600"')+Lt(v,F-x/2,c+w-v,x,_)}),d=0,n.forEach(function(y,M){var F=y/u*100;F<=0||(N+='<circle cx="'+a(z)+'" cy="'+a(g)+'" r="'+a(k)+'" fill="none" stroke="#000" stroke-opacity="0" stroke-width="'+a(V)+'" pathLength="100" stroke-dasharray="'+a(F)+" "+a(100-F)+'" stroke-dashoffset="'+a(-d)+'" transform="rotate(-90 '+a(z)+" "+a(g)+')" class="bzc-hit" data-skip="" data-tip="'+ct((s[M]||"#"+(M+1))+": "+h(y,t)+" ("+Math.round(F)+"%)")+'"/>',d+=F)}),N},{stat:m,summary:"total "+h(u,t)+" across "+n.length+" parts"})}Ee.table=function(t){var e=rt(t.values).map(function(i){return Math.max(0,i)}),r=U(t.labels),l=Nt(e);return{head:["Label","Value","Share"],rows:e.map(function(i,n){return[r[n]||"#"+(n+1),h(i,t),(l?Math.round(i/l*100):0)+"%"]})}};dt("donut",Ee);gt("donut");function Le(t,e){var r=rt(t.values),l=r.length?r[0]:W(t.value,NaN),i=U(t.labels),n=W(t.min,0),s=W(t.max,100),o=W(t.height,130);s===n&&(s=n+1);var f=rt(t.zones),u=ht(t,e),p=U(t.color).filter(Boolean).length>1?u:[e.up,e.palette[3],e.down],m=u[0];if(f.length&&isFinite(l)){for(var c=0;c<f.length&&l>=f[c];)c++;m=p[Math.min(c,p.length-1)]}var T=!A(t.prefix)&&!A(t.suffix)&&n===0&&s===100,w=function(B){return h(B,t)+(T?"%":"")};return pt(t,e,o,function(B,N,L,z){if(!isFinite(l))return mt(e,B,N,L,z);var g=Math.min(L/2,z-22),V=g*.16,k=g-V/2,d=B+L/2,b=N+g,v=Q((l-n)/(s-n),0,1),x=function(I,J){var tt=Math.PI*(1-I);return[d+J*Math.cos(tt),b-J*Math.sin(tt)]},C="M"+a(d-k)+","+a(b)+"A"+a(k)+","+a(k)+" 0 0 1 "+a(d+k)+","+a(b),y='<path d="'+C+'" fill="none" stroke="'+m+'" stroke-opacity=".16" stroke-width="'+a(V)+'" stroke-linecap="round"/>';f.length&&f.forEach(function(I){var J=Q((I-n)/(s-n),0,1),tt=x(J,k-V/2-3),j=x(J,k-V/2-8);y+='<line x1="'+a(tt[0])+'" y1="'+a(tt[1])+'" x2="'+a(j[0])+'" y2="'+a(j[1])+'" stroke="'+e.muted+'" stroke-width="1.5"/>'}),v>0&&(y+='<path d="'+C+'" fill="none" stroke="'+m+'" stroke-width="'+a(V)+'" stroke-linecap="round" pathLength="100" style="stroke-dasharray:'+a(v*100)+' 100"'+ut(t,"bzc-s")+"/>");var M=x(v,k);if(y+='<circle cx="'+a(M[0])+'" cy="'+a(M[1])+'" r="'+a(V*.26)+'" fill="'+(t.background||e.tile)+'"'+ut(t,"bzc-a",.9)+"/>",A(t.goal)){var F=Q((+t.goal-n)/(s-n),0,1),P=x(F,k+V/2+4),_=x(F,k-V/2-4);y+='<line x1="'+a(P[0])+'" y1="'+a(P[1])+'" x2="'+a(_[0])+'" y2="'+a(_[1])+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return y+=O(d,b-g*.12,w(l),'text-anchor="middle" fill="'+e.fg+'" font-family="'+ft+'" font-size="'+a(g*.34)+'" font-weight="800"'),i[0]&&(y+=O(d,b-g*.12+16,i[0],H(e,10,'text-anchor="middle"'))),y+=O(d-k,b+18,h(n,t,!0),H(e,10,'text-anchor="middle"'))+O(d+k,b+18,h(s,t,!0),H(e,10,'text-anchor="middle"')),y+=Lt(d-g,b-g,g*2,g,(i[0]?i[0]+": ":"")+w(l)+" (range "+h(n,t)+" to "+h(s,t)+")"+(A(t.goal)?`
11
+ Goal: `+h(+t.goal,t):"")),y},{summary:isFinite(l)?w(l)+" on a scale of "+h(n,t)+" to "+h(s,t):"no data"})}Le.table=function(t){var e=rt(t.values),r=e.length?e[0]:W(t.value,NaN),l=U(t.labels),i=W(t.min,0),n=W(t.max,100),s=!A(t.prefix)&&!A(t.suffix)&&i===0&&n===100;return isFinite(r)?{head:["Label","Value"],rows:[[l[0]||"Reading",h(r,t)+(s?"%":"")],["Lowest",h(i,t)],["Highest",h(n,t)]].concat(A(t.goal)?[["Goal",h(+t.goal,t)]]:[])}:{head:["Label","Value"],rows:[]}};dt("gauge",Le);gt("gauge");function Ae(t,e){var r=rt(t.values).map(function(L){return Math.max(0,L)}),l=U(t.labels),i=ht(t,e),n=r.length===1,s=Nt(r),o=A(t.max)?W(t.max,100):n?100:s;o>0||(o=1);var f=!A(t.prefix)&&!A(t.suffix)&&o===100&&n,u=function(L){return h(L,t)+(f?"%":"")},p=qt(t),m=p.w,c=0,T=[];if(!n&&r.length){var w=0;c=1,r.forEach(function(L,z){var g=l[z]||"#"+(z+1),V=14+Et(g,12)+6+Et(h(L,t),11,!0)+18;w>0&&w+V>m&&(w=0,c++),T.push({x:w,row:c-1,l:g}),w+=V})}var B=36+(c?12+c*20:0),N=kt(r,t,"");return pt(t,e,B,function(L,z,g,V){if(!r.length)return mt(e,L,z,g,V);var k="",d=z+22,b=Ht("c"),v=n?u(r[0])+(f?"":" of "+h(o,t)):h(s,t)+" of "+h(o,t);n&&l[0]&&(k+=O(L,z+11,l[0],'fill="'+e.fg+'" font-family="'+ft+'" font-size="12"')),k+=O(L+g,z+11,v,'text-anchor="end" fill="'+e.fg+'" font-family="'+xt+'" font-size="11" font-weight="600"'),k+='<rect x="'+L+'" y="'+d+'" width="'+g+'" height="14" rx="7" fill="'+e.grid+'" fill-opacity=".7"/>',k+='<clipPath id="'+b+'"><rect x="'+L+'" y="'+d+'" width="'+g+'" height="14" rx="7"/></clipPath><g clip-path="url(#'+b+')"><g'+ut(t,"bzc-gx")+">";var x=0;if(r.forEach(function(y,M){var F=Math.min(y,Math.max(0,o-x))/o*g;F>0&&(k+='<rect x="'+a(L+x/o*g)+'" y="'+d+'" width="'+a(F)+'" height="14" fill="'+i[M%i.length]+'"/>'),M>0&&F>0&&(k+='<rect x="'+a(L+x/o*g-1)+'" y="'+d+'" width="2" height="14" fill="'+(t.background||e.tile)+'"/>'),x+=y}),k+="</g></g>",A(t.goal)){var C=L+Q(+t.goal/o,0,1)*g;k+='<line x1="'+a(C)+'" x2="'+a(C)+'" y1="'+(d-4)+'" y2="'+(d+18)+'" stroke="'+e.fg+'" stroke-width="2" stroke-linecap="round"/>'}return x=0,r.forEach(function(y,M){var F=Math.min(y,Math.max(0,o-x))/o*g;F>0&&(k+=Lt(L+x/o*g,d-4,F,22,(l[M]||(n?"Progress":"#"+(M+1)))+": "+u(y)+(n?"":" ("+Math.round(y/o*100)+"%)"))),x+=y}),T.forEach(function(y,M){var F=L+y.x,P=d+14+12+y.row*20+8;k+='<circle cx="'+a(F+4)+'" cy="'+a(P)+'" r="4" fill="'+i[M%i.length]+'"/><text x="'+a(F+14)+'" y="'+a(P+4)+'" fill="'+e.fg+'" font-family="'+ft+'" font-size="12">'+ct(y.l)+'<tspan dx="6" fill="'+e.muted+'" font-family="'+xt+'" font-size="11">'+ct(h(r[M],t))+"</tspan></text>"}),k},{stat:N,summary:n?u(r[0])+(f?"":" of "+h(o,t)):h(s,t)+" of "+h(o,t)})}Ae.table=function(t){var e=rt(t.values).map(function(s){return Math.max(0,s)}),r=U(t.labels),l=e.length===1,i=A(t.max)?W(t.max,100):l?100:Nt(e);i>0||(i=1);var n=!A(t.prefix)&&!A(t.suffix)&&i===100&&l;return l?{head:["Label","Value"],rows:[[r[0]||"Progress",h(e[0],t)+(n?"%":" of "+h(i,t))]]}:{head:["Label","Value","Share"],rows:e.map(function(s,o){return[r[o]||"#"+(o+1),h(s,t),Math.round(s/i*100)+"%"]})}};dt("progress",Ae);gt("progress");var tr={weekday:"short",day:"numeric",month:"short",year:"numeric"};function er(t,e){if(A(t.start)&&/^\d{4}-\d{2}-\d{2}$/.test(String(t.start)))return new Date(String(t.start)+"T00:00:00Z");var r=new Date;return new Date(Date.UTC(r.getFullYear(),r.getMonth(),r.getDate())-Math.max(0,e-1)*864e5)}function rr(t,e){try{return new Intl.DateTimeFormat(t,Object.assign({timeZone:"UTC"},e))}catch{return new Intl.DateTimeFormat("en-GB",Object.assign({timeZone:"UTC"},e))}}function Oe(t,e){var r=rt(t.values),l=ht(t,e)[0],i=t.lang||"en-GB",n=er(t,r.length),s=(n.getUTCDay()+6)%7,o=Math.max(1,Math.ceil((s+r.length)/7)),f=qt(t),u=28,p=Math.max(1,Math.floor((f.w-u)/10));if(o>p){var m=(o-p)*7-s;r=r.slice(m),n=new Date(n.getTime()+m*864e5),s=0,o=p}var c=Math.min(18,(f.w-u)/o),T=c<8?1:3,w=c-T,B=16+7*c+26,N=r.length?Math.max.apply(null,r):0,L=function(d){return rr(i,d)},z=L({month:"short"}),g=L({weekday:"short"}),V=L(tr),k=kt(r,t,"");return pt(t,e,B,function(d,b,v,x){if(!r.length)return mt(e,d,b,v,x);var C="",y=d+u,M=b+16,F=-99,P=[.28,.5,.75,1];c>=9&&[0,2,4].forEach(function(q){var yt=new Date(Date.UTC(2024,0,1+q));C+=O(d,M+q*c+w/2+3.5,g.format(yt),H(e,9))});for(var _=0;_<r.length;_++){var I=s+_,J=Math.floor(I/7),tt=I%7,j=new Date(n.getTime()+_*864e5),G=y+J*c,et=M+tt*c;(j.getUTCDate()===1||_===0)&&G-F>30&&(C+=O(G,b+9,z.format(j),H(e,9)),F=G);var lt=r[_]<=0||!N?0:Math.ceil(r[_]/N*4),at=lt?l:e.grid,ot=lt?P[lt-1]:.7;C+='<rect x="'+a(G)+'" y="'+a(et)+'" width="'+a(w)+'" height="'+a(w)+'" rx="'+a(w*.24)+'" fill="'+at+'" fill-opacity="'+ot+'"'+(t.animate?' class="bzc-a" style="animation-delay:'+a(J*.012)+'s"':"")+' data-tip="'+ct(V.format(j)+": "+h(r[_],t))+'"/>'}var S=M+7*c+14,Y=10,R=d+v-5*(Y+3)-30;C+=O(d,S+8,h(Nt(r),t,!0)+" in "+r.length+" days",H(e,10)),C+=O(R-6,S+8,"Less",H(e,9,'text-anchor="end"'));for(var nt=0;nt<5;nt++)C+='<rect x="'+a(R+nt*(Y+3))+'" y="'+S+'" width="'+Y+'" height="'+Y+'" rx="2.5" fill="'+(nt?l:e.grid)+'" fill-opacity="'+(nt?P[nt-1]:.7)+'"/>';return C+=O(R+5*(Y+3)+3,S+8,"More",H(e,9)),C},{stat:k,summary:h(Nt(r),t)+" across "+r.length+" days"})}Oe.table=function(t){var e=rt(t.values),r=er(t,e.length),l=rr(t.lang||"en-GB",tr);return{head:["Date","Value"],rows:e.map(function(i,n){return[l.format(new Date(r.getTime()+n*864e5)),h(i,t)]})}};dt("heatmap",Oe);gt("heatmap");var Sr="1.4.0",zr=he.slice();return mr(Er);})();