@martinomagnifico/tablechart 1.0.5 → 1.0.7
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/CHANGELOG.md +29 -0
- package/README.md +1 -1
- package/dist/tablechart-core.d.mts +1 -1
- package/dist/tablechart-shared.d.mts +4 -2
- package/dist/tablechart-shared.mjs +184 -151
- package/dist/tablechart.css +1 -1
- package/dist/tablechart.js +1 -1
- package/package.json +1 -1
package/dist/tablechart.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root{--cssimported-tablechart:true}.tablechart,:where([data-chart]){margin:var(--tablechart-margin,0);color:var(--tablechart-color,currentColor);font-size:var(--tablechart-font-size,1em);line-height:var(--tablechart-line-height,1.25)}.tablechart :where(figcaption),:where([data-chart]) :where(figcaption){margin-bottom:var(--tablechart-caption-gap,.5em);text-align:var(--tablechart-caption-align,left)}.tablechart,:where([data-chart]){position:relative}.tablechart :where(table),.tablechart :where(.chart-annotations),:where([data-chart]) :where(table),:where([data-chart]) :where(.chart-annotations){inset-inline:0;clip-path:inset(50%);margin:0;position:absolute;top:0}.tablechart[data-table]>:where(table),:where([data-chart])[data-table]>:where(table){border-collapse:collapse;margin-top:.75em}.tablechart[data-table]>:where(table) :where(th,td),:where([data-chart])[data-table]>:where(table) :where(th,td){text-align:start;padding:.2em 1.25em .2em 0}.tablechart[data-table]>:where(table) :where(td,thead th:not(:first-child)),:where([data-chart])[data-table]>:where(table) :where(td,thead th:not(:first-child)){text-align:end;font-variant-numeric:tabular-nums}.tablechart[data-table=always]>:where(table),:where([data-chart])[data-table=always]>:where(table){clip-path:none;position:static}@media (scripting:none){.tablechart :where(table),.tablechart :where(.chart-annotations),:where([data-chart]) :where(table),:where([data-chart]) :where(.chart-annotations){clip-path:none;position:static}}@media (scripting:enabled){.tablechart:where(:not([data-chart-empty]):not(:has(>.tablechart-plot))):after,:where([data-chart]):where(:not([data-chart-empty]):not(:has(>.tablechart-plot))):after{content:"";height:0;padding-top:max(var(--tablechart-min-height,200px), var(--_room,.38) * 100%);padding-bottom:1.5em;display:block}.tablechart :where(.tablechart-plot:not(.is-placed)),:where([data-chart]) :where(.tablechart-plot:not(.is-placed)){height:0;padding-top:max(var(--tablechart-min-height,200px), var(--_room,.38) * 100%);overflow:hidden}}:where([data-chart=donut]){--_room:.66}:where([data-chart=bar]){--_room:.5}.tablechart-plot{position:relative}.tablechart-plot :where(svg){width:100%;height:auto;display:block;overflow:visible}.tablechart-plot:not(.is-placed) :where(.tablechart-value,.tablechart-badge,.tablechart-name){visibility:hidden}.tablechart-sr{white-space:nowrap;clip-path:inset(50%);width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.tablechart-value{white-space:nowrap;font-size:var(--tablechart-value-size,calc(var(--tablechart-name-size,var(--tablechart-category-size,.95em)) * 1.3));position:absolute;transform:translate(-50%,-100%)}.tablechart-value[data-place=outside]{color:var(--tablechart-value-color,currentColor)}.tablechart-value:where([data-place=outside],[data-place=below]) :where(.tablechart-minus){position:absolute;right:100%}.tablechart-value[data-place=inside]{color:var(--tablechart-bar-value-color,var(--tablechart-bar-ink,oklch(from var(--tablechart-bar-color,currentColor) calc(.18 + .8 * clamp(0, (.68 - l) * 1000, 1)) 0 0)));transform:translate(-50%,-50%)}.tablechart-value[data-place=around]{color:var(--tablechart-value-color,currentColor);transform:translate(-50%,-50%)}.tablechart-value[data-place=below]{color:var(--tablechart-value-color,currentColor);transform:translate(-50%)}.tablechart-value[data-place=middle]{color:var(--tablechart-value-color,currentColor);transform:translate(-50%,-50%)}.tablechart-value[data-place=after]{color:var(--tablechart-value-color,currentColor);transform:translateY(-50%)}.tablechart-value[data-place=before]{color:var(--tablechart-value-color,currentColor);transform:translate(-100%,-50%)}.tablechart-value[data-place=none]{display:none}.tablechart-value[data-left-out]{visibility:hidden}.tablechart-value[data-place=inside][data-kind=up]{color:var(--tablechart-up-value-color,var(--tablechart-up-ink,oklch(from var(--tablechart-up-color,var(--tablechart-bar-color,currentColor)) calc(.18 + .8 * clamp(0, (.68 - l) * 1000, 1)) 0 0)))}.tablechart-value[data-place=inside][data-kind=down]{color:var(--tablechart-down-value-color,var(--tablechart-down-ink,oklch(from var(--tablechart-down-color,var(--tablechart-bar-color,currentColor)) calc(.18 + .8 * clamp(0, (.68 - l) * 1000, 1)) 0 0)))}.tablechart-value[data-place=inside][data-series]{color:var(--tablechart-piece-value-color,var(--tablechart-piece-ink,oklch(from var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas)))) calc(.18 + .8 * clamp(0, (.68 - l) * 1000, 1)) 0 0)))}.tablechart-value[data-place=inside][data-kind=total]{color:var(--tablechart-total-value-color,var(--tablechart-total-ink,oklch(from var(--tablechart-total-color,var(--tablechart-bar-color,currentColor)) calc(.18 + .8 * clamp(0, (.68 - l) * 1000, 1)) 0 0)))}.tablechart-name{white-space:nowrap;font-size:var(--tablechart-name-size,var(--tablechart-category-size,.95em));color:var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas))));position:absolute;transform:translateY(-50%)}.tablechart-legend{box-sizing:border-box;width:fit-content;max-width:100%;padding:var(--tablechart-legend-padding,0);border:var(--tablechart-legend-border,none);border-radius:var(--tablechart-legend-radius,0);background:var(--tablechart-legend-surface,none);margin-inline:auto;margin-top:var(--tablechart-legend-gap,.6em);font-size:var(--tablechart-name-size,var(--tablechart-category-size,.95em));flex-wrap:wrap;justify-content:center;gap:.3em 1.2em;display:flex}.tablechart-name[data-place=legend]{color:inherit;font-size:inherit;position:static;transform:none}.tablechart-name[data-place=legend]:before{content:"";vertical-align:-.05em;background:var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas))));width:1.6em;height:.8em;mask-image:var(--_line), var(--_mark,none);margin-right:.4em;display:inline-block;mask-position:50%;mask-size:contain;mask-repeat:no-repeat}.tablechart-name[data-place=legend][data-swatch=box]:before{vertical-align:-.05em;background:var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas))));border-radius:.15em;width:.7em;height:.7em;mask:none}.tablechart-name[data-place=legend],.tablechart-tooltip-key[data-sample]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H24'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-line=dashed],.tablechart-tooltip-key[data-sample][data-line=dashed]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H24' stroke-dasharray='4 2.5' stroke-linecap='butt'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-line=dotted],.tablechart-tooltip-key[data-sample][data-line=dotted]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H24' stroke-dasharray='0 3'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=circle],.tablechart-tooltip-key[data-sample][data-marker=circle]{--_mark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='6' r='3.4' fill='white'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=circle][data-open],.tablechart-tooltip-key[data-sample][data-marker=circle][data-open]{--_mark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='6' r='3.4'/%3E%3C/svg%3E");--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H8.6 M15.4 6H24'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=circle][data-open][data-line=dashed],.tablechart-tooltip-key[data-sample][data-marker=circle][data-open][data-line=dashed]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H8.6 M15.4 6H24' stroke-dasharray='4 2.5' stroke-linecap='butt'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=circle][data-open][data-line=dotted],.tablechart-tooltip-key[data-sample][data-marker=circle][data-open][data-line=dotted]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H8.6 M15.4 6H24' stroke-dasharray='0 3'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=square],.tablechart-tooltip-key[data-sample][data-marker=square]{--_mark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='6' stroke-linecap='butt' fill='white'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=square][data-open],.tablechart-tooltip-key[data-sample][data-marker=square][data-open]{--_mark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='6' stroke-linecap='butt'/%3E%3C/svg%3E");--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H9 M15 6H24'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=square][data-open][data-line=dashed],.tablechart-tooltip-key[data-sample][data-marker=square][data-open][data-line=dashed]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H9 M15 6H24' stroke-dasharray='4 2.5' stroke-linecap='butt'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=square][data-open][data-line=dotted],.tablechart-tooltip-key[data-sample][data-marker=square][data-open][data-line=dotted]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H9 M15 6H24' stroke-dasharray='0 3'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=diamond],.tablechart-tooltip-key[data-sample][data-marker=diamond]{--_mark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpolygon points='12,1.9 16.1,6 12,10.1 7.9,6' fill='white'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=diamond][data-open],.tablechart-tooltip-key[data-sample][data-marker=diamond][data-open]{--_mark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpolygon points='12,1.9 16.1,6 12,10.1 7.9,6'/%3E%3C/svg%3E");--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H7.9 M16.1 6H24'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=diamond][data-open][data-line=dashed],.tablechart-tooltip-key[data-sample][data-marker=diamond][data-open][data-line=dashed]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H7.9 M16.1 6H24' stroke-dasharray='4 2.5' stroke-linecap='butt'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=diamond][data-open][data-line=dotted],.tablechart-tooltip-key[data-sample][data-marker=diamond][data-open][data-line=dotted]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H7.9 M16.1 6H24' stroke-dasharray='0 3'/%3E%3C/svg%3E")}.tablechart-categories :where(span[data-kind=total]){display:none}.tablechart-categories :where(span[data-kind=slice]):before{content:"";width:var(--tablechart-legend-key-size,var(--tablechart-key-size,.6em));height:var(--tablechart-legend-key-size,var(--tablechart-key-size,.6em));background:var(--palette,color-mix(in oklab, var(--tablechart-slice-color,currentColor) max(var(--tablechart-slice-min,20%), calc(100% - var(--n) * var(--tablechart-slice-fade,15%))), var(--tablechart-surface,Canvas)));border-radius:50%;margin-right:.4em;display:inline-block}.tablechart-categories[data-place=key]{box-sizing:border-box;width:fit-content;max-width:100%;padding:var(--tablechart-legend-padding,0);border:var(--tablechart-legend-border,none);border-radius:var(--tablechart-legend-radius,0);background:var(--tablechart-legend-surface,none);flex-wrap:wrap;justify-content:center;gap:.3em 1.2em;margin-inline:auto;display:flex}.tablechart-categories[data-place=key] :where(span){white-space:nowrap;padding:0}.tablechart-categories[data-place=beside]{pointer-events:none;margin:0;display:block;position:absolute;inset:0}.tablechart-categories[data-place=beside] :where(span){text-align:right;width:max-content;max-width:min(var(--tablechart-name-max,40%), var(--_beside,100%));text-wrap:balance;hyphens:auto;hyphenate-limit-chars:6 3 3;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;overflow-wrap:break-word;min-width:min-content;padding:0;position:absolute;transform:translate(-100%,-50%)}.tablechart-categories{grid-template-columns:repeat(var(--_columns,1), minmax(0, 1fr));margin-top:var(--tablechart-name-gap,var(--tablechart-categories-gap,.45em));display:grid}.tablechart-categories :where(span){text-align:center;padding:var(--tablechart-name-padding,var(--tablechart-category-padding,0 .2em));font-size:calc(var(--tablechart-name-size,var(--tablechart-category-size,.95em)) * var(--_name-fit,1));hyphens:manual;overflow-wrap:normal}.tablechart-bar{fill:var(--tablechart-bar-color,currentColor)}.tablechart-bar[data-kind=up]{fill:var(--tablechart-up-color,var(--tablechart-bar-color,currentColor))}.tablechart-bar[data-kind=down]{fill:var(--tablechart-down-color,var(--tablechart-bar-color,currentColor))}.tablechart-bar[data-kind=total]{fill:var(--tablechart-total-color,var(--tablechart-bar-color,currentColor))}.tablechart-bar[data-series],.tablechart-piece{fill:var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas))))}.tablechart-plot[data-grouped] :where(.tablechart-value){font-size:calc(var(--tablechart-value-group-size,.95em) * var(--_fit,1))}.tablechart-rule{stroke:var(--tablechart-baseline-color,var(--tablechart-rule-color,currentColor));stroke-width:var(--tablechart-baseline-width,var(--tablechart-rule-width,1px));opacity:var(--tablechart-baseline-opacity,var(--tablechart-rule-opacity,.45));vector-effect:non-scaling-stroke}.tablechart-connector{stroke:var(--tablechart-connector-color,currentColor);stroke-width:var(--tablechart-connector-width,1px);stroke-dasharray:var(--tablechart-connector-dash,2 3);opacity:var(--tablechart-connector-opacity,.55);fill:none;vector-effect:non-scaling-stroke}.tablechart-series{stroke:var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas))));stroke-width:var(--tablechart-series-width,2px);stroke-linecap:round;fill:none;vector-effect:non-scaling-stroke}.tablechart-area{fill:var(--tablechart-area-color,var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas)))));opacity:var(--tablechart-area-opacity,.25)}.tablechart-area[data-muted]{opacity:calc(var(--tablechart-area-opacity,.25) / 2)}.tablechart-area[data-stacked]{opacity:var(--tablechart-area-opacity,.5)}.tablechart-area[data-stacked][data-muted]{opacity:calc(var(--tablechart-area-opacity,.5) / 2)}.tablechart-series[data-line=dashed]{stroke-dasharray:var(--tablechart-series-dash,var(--tablechart-dash,6 4))}.tablechart-series[data-line=dotted]{stroke-dasharray:var(--tablechart-series-dot,var(--tablechart-dot,0 4))}.tablechart-point{fill:var(--tablechart-point-color,var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas)))))}.tablechart-point[data-open]{fill:none;stroke:var(--tablechart-point-color,var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas)))));stroke-width:var(--tablechart-series-width,2px);vector-effect:non-scaling-stroke}.tablechart-slice{fill:none;stroke:var(--palette,color-mix(in oklab, var(--tablechart-slice-color,currentColor) max(var(--tablechart-slice-min,20%), calc(100% - var(--n) * var(--tablechart-slice-fade,15%))), var(--tablechart-surface,Canvas)))}.tablechart-divide{stroke:#000;stroke-width:var(--tablechart-slice-gap,4);fill:none}.tablechart-leader{stroke:var(--tablechart-leader-color,currentColor);stroke-width:var(--tablechart-leader-width,1px);opacity:var(--tablechart-leader-opacity,.45);fill:none;vector-effect:non-scaling-stroke}.tablechart-centre{white-space:nowrap;text-align:center;font-size:var(--tablechart-centre-size,1.6em);color:var(--tablechart-centre-color,currentColor);position:absolute;transform:translate(-50%,-50%)}.tablechart-break[data-part=edge]{fill:none;stroke:var(--tablechart-break-color,currentColor);stroke-width:var(--tablechart-break-width,1px);opacity:var(--tablechart-break-opacity,1);stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}.tablechart-line{stroke:var(--tablechart-annotation-color,currentColor);stroke-width:var(--tablechart-annotation-width,1.25px);fill:none;stroke-linecap:butt;stroke-linejoin:miter;vector-effect:non-scaling-stroke}.tablechart-head{fill:var(--tablechart-annotation-color,currentColor)}.tablechart-badge{background:var(--tablechart-badge-surface,none);color:var(--tablechart-annotation-color,currentColor);border:var(--tablechart-badge-border-width,1px) solid currentColor;border-radius:var(--tablechart-badge-radius,50%);padding:var(--tablechart-badge-padding,.5em 1.25em);white-space:nowrap;line-height:1;position:absolute;transform:translate(-50%,-50%)}.tablechart-badge :where(.tablechart-caption){color:var(--tablechart-color,currentColor);background:0 0;border:0;position:absolute;bottom:calc(100% + .45em);left:50%;transform:translate(-50%)}@media screen{:where([data-animate],[data-animate] .tablechart-plot){--_el:var(--tablechart-animation-element-duration,var(--tablechart-duration,.5s));--_max:var(--tablechart-animation-max,calc(4 * var(--_el)));--_r:var(--tablechart-animation-stagger,var(--_ratio,.24));--_dur:min(var(--_el), calc(var(--_max) / (1 + var(--_keep,0) * (var(--count,1) - 1) * var(--_r))));--_stg:min(var(--tablechart-stagger,calc(var(--_r) * var(--_el))), max(0s, calc((var(--_max) - var(--_dur)) / max(var(--count,1) - 1, 1))));--_fade:min(var(--_dur), calc(var(--_max) / 4));--_ease:var(--tablechart-animation-ease,var(--tablechart-easing,cubic-bezier(.26, .86, .44, .985)));--_build:min(calc(.6 * var(--count,1) * var(--_dur)), calc(var(--_max) - var(--_fade)));--_steptime:min(calc(.65 * var(--_dur)), calc(var(--_max) / (var(--count,1) - .08)));--_rise:min(calc(var(--_el) * 1.6), calc(var(--_max) - var(--_fade)));--_ring:calc(var(--_dur) + (var(--count,1) - 1) * var(--_stg))}:where([data-animate]) :where(.tablechart-bar){transform-box:fill-box;transform-origin:bottom;transition:transform var(--_dur) var(--_ease);transition-delay:calc(var(--i) * var(--_stg));transform:scaleY(0)}:where([data-animate]) :where(.tablechart-bar[data-grow=down]){transform-origin:top}:where([data-animate]) :where(.tablechart-bar[data-grow=right]){transform-origin:0;transform:scaleX(0)}:where([data-animate]) :where(.tablechart-bar[data-grow=left]){transform-origin:100%;transform:scaleX(0)}:where([data-animate]) :where(.tablechart-series){clip-path:inset(-10px calc(100% + 10px) -10px -10px);transition:clip-path calc(var(--d,1) * var(--_stg)) linear;transition-delay:calc(max(var(--i) - 1, 0) * var(--_stg))}:where([data-animate]) :where(.tablechart-area-fill){opacity:0;transition:opacity calc(max(var(--rows) - 1, 1) * var(--_stg)) linear;transition-delay:calc(max(var(--i) - 1, 0) * var(--_stg))}:where([data-animate]) :where(.tablechart-point,.tablechart-hole){opacity:0;transition:opacity var(--_fade) ease;transition-delay:calc(var(--i) * var(--_stg) + .048 * var(--_dur))}:where([data-animate]) :where(.tablechart-hole[data-for=badge]){transition:opacity .3s;transition-delay:calc(var(--after) * var(--_stg) + .35s)}:where([data-animate]) :where(.tablechart-value,.tablechart-name){opacity:0;transition:opacity var(--_fade) ease;transition-delay:calc(var(--i) * var(--_stg) + .096 * var(--_dur))}:where([data-animate]) :where(.tablechart-connector){clip-path:inset(-10px calc(100% + 10px) -10px -10px);transition:clip-path calc(var(--_dur) / 3) linear;transition-delay:calc(var(--i) * var(--_stg))}:where([data-animate]) :where(.tablechart-slice){stroke-dasharray:0 var(--circ);transition:stroke-dasharray var(--_dur) var(--_ease);transition-delay:calc(var(--i) * var(--_stg))}:where([data-animate]) :where(.tablechart-centre){opacity:0;transition:opacity var(--_fade) ease;transition-delay:calc(var(--i,0) * var(--_stg) + .5 * var(--_dur))}:where([data-animate]) :where(.tablechart-leader){stroke-opacity:0;transition:stroke-opacity var(--_fade) ease;transition-delay:calc(var(--i,0) * var(--_stg) + .5 * var(--_dur))}:where([data-animate]) :where([data-chart=donut] .tablechart-value){transition-delay:calc(var(--i,0) * var(--_stg) + .5 * var(--_dur))}:where([data-animate]) :where(.tablechart-break[data-part=edge]){stroke-opacity:0;transition:stroke-opacity .2s;transition-delay:calc((var(--after) + .9) * var(--_stg))}:where([data-animate]) :where(.tablechart-line){stroke-dasharray:var(--len);stroke-dashoffset:var(--len);transition:stroke-dashoffset var(--tablechart-annotation-duration,.6s) var(--_ease);transition-delay:calc(var(--after) * var(--_stg))}:where([data-animate]) :where(.tablechart-head){opacity:0;transition:opacity .2s;transition-delay:calc(var(--after) * var(--_stg) + .55s)}:where([data-animate]) :where(.tablechart-badge){opacity:0;transition:opacity .3s;transition-delay:calc(var(--after) * var(--_stg) + .35s)}:where([data-chart=waterfall]:not([data-animate=sweep])){--_ratio:.6;--_keep:1}:where([data-animate=sweep][data-chart=waterfall]:not([data-steps])) :where(.tablechart-bar,.tablechart-connector){transition-duration:calc(var(--span,1) * var(--_build));transition-timing-function:var(--ease,linear);transition-delay:calc(var(--start,0) * var(--_build))}:where([data-animate=sweep][data-chart=waterfall]:not([data-steps])) :where(.tablechart-value){transition-delay:calc((var(--start,0) + .5 * var(--span,0)) * var(--_build))}:where([data-animate=sweep][data-chart=waterfall]:not([data-steps])) :where(.tablechart-badge,.tablechart-hole[data-for=badge]){transition-delay:calc(var(--_build) + .2s)}:where([data-animate=sweep][data-chart=waterfall]:not([data-steps])) :where(.tablechart-break[data-part=edge]){transition-delay:calc((var(--start,0) + var(--span,1)) * var(--_build))}:where([data-animate][data-chart=waterfall][data-steps]) :where(.tablechart-bar){transition-duration:calc(.923 * var(--_steptime));transition-delay:calc(var(--i) * var(--_steptime))}:where([data-animate][data-chart=waterfall][data-steps]) :where(.tablechart-connector){transition:clip-path calc(.308 * var(--_steptime)) linear;transition-delay:calc((var(--i) - 1) * var(--_steptime) + calc(.692 * var(--_steptime)))}:where([data-animate][data-chart=waterfall][data-steps]) :where(.tablechart-value){transition-delay:calc(var(--i) * var(--_steptime) + calc(.923 * var(--_steptime)) * .5)}:where([data-animate][data-chart=waterfall][data-steps]) :where(.tablechart-badge,.tablechart-hole[data-for=badge]){transition-delay:calc(var(--after) * var(--_steptime) + .2s)}:where([data-animate].is-shown) :where(.tablechart-bar){transform:scaleY(1)}:where([data-animate].is-shown) :where(.tablechart-bar:is([data-grow=right],[data-grow=left])){transform:scaleX(1)}:where([data-animate].is-shown) :where(.tablechart-series){clip-path:inset(-10px)}:where([data-animate].is-shown) :where(.tablechart-point),:where([data-animate].is-shown) :where(.tablechart-hole),:where([data-animate].is-shown) :where(.tablechart-area-fill),:where([data-animate].is-shown) :where(.tablechart-value),:where([data-animate].is-shown) :where(.tablechart-name),:where([data-animate].is-shown) :where(.tablechart-head),:where([data-animate].is-shown) :where(.tablechart-badge),:where([data-animate].is-shown) :where(.tablechart-centre){opacity:1}:where([data-animate].is-shown) :where(.tablechart-leader),:where([data-animate].is-shown) :where(.tablechart-break[data-part=edge]){stroke-opacity:1}:where([data-animate].is-shown) :where(.tablechart-slice){stroke-dasharray:var(--arc) calc(var(--circ) - var(--arc))}:where([data-animate].is-shown) :where(.tablechart-connector){clip-path:inset(-10px)}:where([data-animate].is-shown) :where(.tablechart-line){stroke-dashoffset:0}:where([data-animate=grow]:is([data-chart=line],[data-chart=area])) :where(.tablechart-series,.tablechart-area){clip-path:none;transform-box:view-box;transform-origin:0 var(--_base);transition:transform var(--_rise) var(--_ease);transition-delay:0s;transform:scaleY(0)}:where([data-animate=grow]:is([data-chart=line],[data-chart=area])) :where(.tablechart-area-fill){opacity:1;transition:none}:where([data-animate=grow]:is([data-chart=line],[data-chart=area])) :where(.tablechart-point,.tablechart-hole:not([data-for])){opacity:0;transform:translateY(var(--rise,0));transition:transform var(--_rise) var(--_ease), opacity .15s ease;transition-delay:0s}:where([data-animate=grow]:is([data-chart=line],[data-chart=area])) :where(.tablechart-value,.tablechart-name){transition-delay:var(--_rise)}:where([data-animate=grow]:is([data-chart=line],[data-chart=area]).is-shown) :where(.tablechart-series,.tablechart-area){transform:scaleY(1)}:where([data-animate=grow]:is([data-chart=line],[data-chart=area]).is-shown) :where(.tablechart-point,.tablechart-hole:not([data-for])){opacity:1;transform:none}:where([data-animate=sweep][data-chart=donut]) :where(.tablechart-slice){transition:stroke-dasharray calc(var(--span,1) * var(--_ring)) var(--ease,linear);transition-delay:calc(var(--start,0) * var(--_ring))}:where([data-animate=sweep][data-chart=donut]) :where(.tablechart-leader,.tablechart-value){transition-delay:calc((var(--start,0) + var(--span,0)) * var(--_ring))}:where([data-animate=sweep][data-chart=donut]) :where(.tablechart-centre){transition-delay:calc(.5 * var(--_ring))}:where([data-animate]){transition:opacity var(--tablechart-queue-duration,.4s) ease}:where([data-animate].tablechart-queued){opacity:0}}@media screen and (prefers-reduced-motion:reduce){:where([data-animate]) :where(*){transition-duration:1ms!important;transition-delay:0s!important}}@media screen{:where([data-animate][data-steps]) :where(.tablechart-series),:where([data-animate][data-steps]) :where(.tablechart-area-fill>*){clip-path:inset(-10px calc(100% + 10px) -10px -10px);transition:clip-path var(--_dur) ease}:where([data-animate][data-steps]) :where(.tablechart-area-fill){opacity:1;transition:none}:where([data-animate][data-steps]) :where(.tablechart-piece){transform-box:fill-box;transform-origin:bottom;transition:transform var(--_dur) var(--_ease);transition-delay:calc(var(--i,0) * var(--_stg))}:where([data-animate][data-steps]) :where(.tablechart-piece[data-grow=right]){transform-origin:0}:where([data-animate][data-steps]) :where(.tablechart-piece[data-grow=down]){transform-origin:top}:where([data-animate][data-steps]) :where(.tablechart-piece[data-grow=left]){transform-origin:100%}:where([data-animate][data-steps].is-shown) :where(.tablechart-bar){transform:scaleY(clamp(0, var(--_step,0) - var(--step,-1), 1))}:where([data-animate][data-steps].is-shown) :where(.tablechart-bar:is([data-grow=right],[data-grow=left])){transform:scaleX(clamp(0, var(--_step,0) - var(--step,-1), 1))}:where([data-animate][data-steps].is-shown) :where(.tablechart-piece){transform:scaleY(clamp(0, var(--_step,0) - var(--step,-1), 1))}:where([data-animate][data-steps].is-shown) :where(.tablechart-piece:is([data-grow=right],[data-grow=left])){transform:scaleX(clamp(0, var(--_step,0) - var(--step,-1), 1))}:where([data-animate][data-steps].is-shown) :where(.tablechart-value),:where([data-animate][data-steps].is-shown) :where(.tablechart-name),:where([data-animate][data-steps].is-shown) :where(.tablechart-head),:where([data-animate][data-steps].is-shown) :where(.tablechart-badge),:where([data-animate][data-steps].is-shown) :where(.tablechart-centre),:where([data-animate][data-steps].is-shown) :where(.tablechart-point),:where([data-animate][data-steps].is-shown) :where(.tablechart-hole){opacity:clamp(0, var(--_step,0) - var(--step,-1), 1)}:where([data-animate][data-steps].is-shown) :where(.tablechart-leader),:where([data-animate][data-steps].is-shown) :where(.tablechart-break[data-part=edge]){stroke-opacity:clamp(0, var(--_step,0) - var(--step,-1), 1)}:where([data-animate][data-steps].is-shown) :where(.tablechart-line){stroke-dashoffset:calc(var(--len) * (1 - clamp(0, var(--_step,0) - var(--step,-1), 1)))}:where([data-animate][data-steps].is-shown) :where(.tablechart-connector){clip-path:inset(-10px calc((1 - clamp(0, var(--_step,0) - var(--step,-1), 1)) * (100% + 20px) - 10px) -10px -10px)}:where([data-animate][data-steps].is-shown) :where(.tablechart-series),:where([data-animate][data-steps].is-shown) :where(.tablechart-area-fill>*){clip-path:inset(-10px calc((1 - var(--reveal,0)) * (100% + 20px) - 10px) -10px -10px)}:where([data-animate][data-steps].is-shown) :where(.tablechart-slice){stroke-dasharray:calc(var(--arc) * clamp(0, var(--_step,0) - var(--step,-1), 1)) calc(var(--circ) - var(--arc) * clamp(0, var(--_step,0) - var(--step,-1), 1))}}:where(.tablechart-controls){justify-content:var(--tablechart-control-justify,var(--tablechart-controls-justify,space-between));margin-top:var(--tablechart-control-gap,var(--tablechart-controls-gap,.75em));align-items:center;gap:.5em;display:flex}:where(.tablechart-controls) :where(button){padding:var(--tablechart-control-padding,.3em .7em);border:var(--tablechart-control-border,1px solid color-mix(in oklab, currentColor 30%, transparent));border-radius:var(--tablechart-control-radius,.4em);background:var(--tablechart-control-surface,none);color:inherit;font:inherit;cursor:pointer;align-items:center;gap:.35em;display:inline-flex}:where(.tablechart-controls) :where(button:disabled){opacity:.35;cursor:default}:where(.tablechart-controls) :where(.tablechart-control-icon svg){fill:none;stroke:currentColor;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;width:.8em;height:.8em;display:block}@media print{:where([data-steps]){--_step:999!important}:where([data-steps] [data-from]){--reveal:1!important}:where(.tablechart-controls){display:none}}.tablechart-plot[data-hover]{cursor:default}.tablechart-plot[data-hover] :where(.tablechart-value){-webkit-user-select:none;user-select:none}.tablechart-tooltip{z-index:1000;box-sizing:border-box;min-width:7em;max-width:min(18em,100vw - 16px);padding:var(--tablechart-tooltip-padding,.45em .7em);border:var(--tablechart-tooltip-border,1px solid color-mix(in oklab, currentColor 28%, transparent));border-radius:var(--tablechart-tooltip-radius,.4em);background:var(--tablechart-tooltip-surface,light-dark(#fff,oklch(from var(--tablechart-surface,Canvas) calc(l + .06) c h)));color:var(--tablechart-tooltip-color,var(--_color,CanvasText));box-shadow:var(--tablechart-tooltip-shadow,0 1px 3px #0000001f, 0 6px 18px #0000002e);line-height:1.35;position:fixed;top:0;left:0}.tablechart-tooltip[hidden]{display:none}.tablechart-tooltip-title{font-weight:600}.tablechart-tooltip-line{align-items:baseline;gap:.45em;display:flex}.tablechart-tooltip-name,.tablechart-tooltip-title{min-width:0}.tablechart-tooltip-value{white-space:nowrap;font-variant-numeric:tabular-nums;flex:none;margin-left:auto;padding-left:1em}.tablechart-tooltip-key{border-radius:50%;flex:none;align-self:center;width:.6em;height:.6em}.tablechart-tooltip-key[data-sample=line]{width:1.6em;height:.8em;mask-image:var(--_line), var(--_mark,none);border-radius:0;mask-position:50%;mask-size:contain;mask-repeat:no-repeat}.tablechart-tooltip-key[data-sample=box]{border-radius:.15em;width:.7em;height:.7em}.tablechart-tooltip-arrow{border:inherit;background:inherit;width:.6em;height:.6em;position:absolute;transform:translate(-50%,-50%)rotate(45deg)}[data-side=top]>.tablechart-tooltip-arrow{border-top-color:#0000;border-left-color:#0000;top:100%}[data-side=bottom]>.tablechart-tooltip-arrow{border-bottom-color:#0000;border-right-color:#0000;top:0}@media print{.tablechart-tooltip,:where(.tablechart,[data-chart]) :where(table,.chart-annotations){display:none}:where(.tablechart-plot){break-inside:avoid;page-break-inside:avoid}:where(.tablechart,[data-chart])>:where(figcaption){break-after:avoid;page-break-after:avoid}:where(.tablechart-categories,.tablechart-legend){break-before:avoid;page-break-before:avoid}[data-table=print]>:where(table),[data-table=always]>:where(table),[data-table=auto][data-left-out]>:where(table){clip-path:none;display:table;position:static}}.is-printing,.is-printing *{transition:none!important;animation:none!important}
|
|
1
|
+
:root{--cssimported-tablechart:true}.tablechart,:where([data-chart]){margin:var(--tablechart-margin,0);color:var(--tablechart-color,currentColor);font-size:var(--tablechart-font-size,1em);line-height:var(--tablechart-line-height,1.25)}.tablechart :where(figcaption),:where([data-chart]) :where(figcaption){margin-bottom:var(--tablechart-caption-gap,.5em);text-align:var(--tablechart-caption-align,left)}.tablechart,:where([data-chart]){position:relative}.tablechart :where(table),.tablechart :where(.chart-annotations),:where([data-chart]) :where(table),:where([data-chart]) :where(.chart-annotations){inset-inline:0;clip-path:inset(50%);margin:0;position:absolute;top:0}.tablechart[data-table]>:where(table),:where([data-chart])[data-table]>:where(table){border-collapse:collapse;margin-top:.75em}.tablechart[data-table]>:where(table) :where(th,td),:where([data-chart])[data-table]>:where(table) :where(th,td){text-align:start;padding:.2em 1.25em .2em 0}.tablechart[data-table]>:where(table) :where(td,thead th:not(:first-child)),:where([data-chart])[data-table]>:where(table) :where(td,thead th:not(:first-child)){text-align:end;font-variant-numeric:tabular-nums}.tablechart[data-table=always]>:where(table),:where([data-chart])[data-table=always]>:where(table){clip-path:none;position:static}@media (scripting:none){.tablechart :where(table),.tablechart :where(.chart-annotations),:where([data-chart]) :where(table),:where([data-chart]) :where(.chart-annotations){clip-path:none;position:static}}@media (scripting:enabled){.tablechart:where(:not([data-chart-empty]):not(:has(>.tablechart-plot))):after,:where([data-chart]):where(:not([data-chart-empty]):not(:has(>.tablechart-plot))):after{content:"";height:0;padding-top:max(var(--tablechart-min-height,200px), var(--_room,.38) * 100%);padding-bottom:1.5em;display:block}.tablechart :where(.tablechart-plot:not(.is-placed)),:where([data-chart]) :where(.tablechart-plot:not(.is-placed)){height:0;padding-top:max(var(--tablechart-min-height,200px), var(--_room,.38) * 100%);overflow:hidden}}:where([data-chart=donut]){--_room:.66}:where([data-chart=bar]){--_room:.5}.tablechart-plot{position:relative}.tablechart-plot :where(svg){width:100%;height:auto;display:block;overflow:visible}.tablechart-plot:not(.is-placed) :where(.tablechart-value,.tablechart-badge,.tablechart-name){visibility:hidden}.tablechart-sr{white-space:nowrap;clip-path:inset(50%);width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.tablechart-value{white-space:nowrap;font-size:var(--tablechart-value-size,calc(var(--tablechart-name-size,var(--tablechart-category-size,.95em)) * 1.3));position:absolute;transform:translate(-50%,-100%)}.tablechart-value[data-place=outside]{color:var(--tablechart-value-color,currentColor)}.tablechart-value:where([data-place=outside],[data-place=below]) :where(.tablechart-minus){position:absolute;right:100%}.tablechart-value[data-place=inside]{color:var(--tablechart-bar-value-color,var(--tablechart-bar-ink,oklch(from var(--tablechart-bar-color,currentColor) calc(.18 + .8 * clamp(0, (.68 - l) * 1000, 1)) 0 0)));transform:translate(-50%,-50%)}.tablechart-value[data-place=around]{color:var(--tablechart-value-color,currentColor);transform:translate(-50%,-50%)}.tablechart-value[data-place=below]{color:var(--tablechart-value-color,currentColor);transform:translate(-50%)}.tablechart-value[data-place=middle]{color:var(--tablechart-value-color,currentColor);transform:translate(-50%,-50%)}.tablechart-value[data-place=after]{color:var(--tablechart-value-color,currentColor);transform:translateY(-50%)}.tablechart-value[data-place=before]{color:var(--tablechart-value-color,currentColor);transform:translate(-100%,-50%)}.tablechart-value[data-place=none]{display:none}.tablechart-value[data-left-out]{visibility:hidden}.tablechart-value[data-place=inside][data-kind=up]{color:var(--tablechart-up-value-color,var(--tablechart-up-ink,oklch(from var(--tablechart-up-color,var(--tablechart-bar-color,currentColor)) calc(.18 + .8 * clamp(0, (.68 - l) * 1000, 1)) 0 0)))}.tablechart-value[data-place=inside][data-kind=down]{color:var(--tablechart-down-value-color,var(--tablechart-down-ink,oklch(from var(--tablechart-down-color,var(--tablechart-bar-color,currentColor)) calc(.18 + .8 * clamp(0, (.68 - l) * 1000, 1)) 0 0)))}.tablechart-value[data-place=inside][data-series]{color:var(--tablechart-piece-value-color,var(--tablechart-piece-ink,oklch(from var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas)))) calc(.18 + .8 * clamp(0, (.68 - l) * 1000, 1)) 0 0)))}.tablechart-value[data-place=inside][data-kind=total]{color:var(--tablechart-total-value-color,var(--tablechart-total-ink,oklch(from var(--tablechart-total-color,var(--tablechart-bar-color,currentColor)) calc(.18 + .8 * clamp(0, (.68 - l) * 1000, 1)) 0 0)))}.tablechart-name{white-space:nowrap;font-size:var(--tablechart-name-size,var(--tablechart-category-size,.95em));color:var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas))));position:absolute;transform:translateY(-50%)}.tablechart-legend{box-sizing:border-box;width:fit-content;max-width:100%;padding:var(--tablechart-legend-padding,0);border:var(--tablechart-legend-border,none);border-radius:var(--tablechart-legend-radius,0);background:var(--tablechart-legend-surface,none);margin-inline:auto;margin-top:var(--tablechart-legend-gap,.6em);font-size:var(--tablechart-name-size,var(--tablechart-category-size,.95em));flex-wrap:wrap;justify-content:center;gap:.3em 1.2em;display:flex}.tablechart-name[data-place=legend]{color:inherit;font-size:inherit;position:static;transform:none}.tablechart-name[data-place=legend]:before{content:"";vertical-align:-.05em;background:var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas))));width:1.6em;height:.8em;mask-image:var(--_line), var(--_mark,none);margin-right:.4em;display:inline-block;mask-position:50%;mask-size:contain;mask-repeat:no-repeat}.tablechart-name[data-place=legend][data-swatch=box]:before{vertical-align:-.05em;background:var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas))));border-radius:.15em;width:.7em;height:.7em;mask:none}.tablechart-name[data-place=legend],.tablechart-tooltip-key[data-sample]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H24'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-line=dashed],.tablechart-tooltip-key[data-sample][data-line=dashed]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H24' stroke-dasharray='4 2.5' stroke-linecap='butt'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-line=dotted],.tablechart-tooltip-key[data-sample][data-line=dotted]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H24' stroke-dasharray='0 3'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=circle],.tablechart-tooltip-key[data-sample][data-marker=circle]{--_mark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='6' r='3.4' fill='white'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=circle][data-open],.tablechart-tooltip-key[data-sample][data-marker=circle][data-open]{--_mark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='6' r='3.4'/%3E%3C/svg%3E");--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H8.6 M15.4 6H24'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=circle][data-open][data-line=dashed],.tablechart-tooltip-key[data-sample][data-marker=circle][data-open][data-line=dashed]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H8.6 M15.4 6H24' stroke-dasharray='4 2.5' stroke-linecap='butt'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=circle][data-open][data-line=dotted],.tablechart-tooltip-key[data-sample][data-marker=circle][data-open][data-line=dotted]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H8.6 M15.4 6H24' stroke-dasharray='0 3'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=square],.tablechart-tooltip-key[data-sample][data-marker=square]{--_mark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='6' stroke-linecap='butt' fill='white'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=square][data-open],.tablechart-tooltip-key[data-sample][data-marker=square][data-open]{--_mark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='9' y='3' width='6' height='6' stroke-linecap='butt'/%3E%3C/svg%3E");--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H9 M15 6H24'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=square][data-open][data-line=dashed],.tablechart-tooltip-key[data-sample][data-marker=square][data-open][data-line=dashed]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H9 M15 6H24' stroke-dasharray='4 2.5' stroke-linecap='butt'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=square][data-open][data-line=dotted],.tablechart-tooltip-key[data-sample][data-marker=square][data-open][data-line=dotted]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H9 M15 6H24' stroke-dasharray='0 3'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=diamond],.tablechart-tooltip-key[data-sample][data-marker=diamond]{--_mark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpolygon points='12,1.9 16.1,6 12,10.1 7.9,6' fill='white'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=diamond][data-open],.tablechart-tooltip-key[data-sample][data-marker=diamond][data-open]{--_mark:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpolygon points='12,1.9 16.1,6 12,10.1 7.9,6'/%3E%3C/svg%3E");--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H7.9 M16.1 6H24'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=diamond][data-open][data-line=dashed],.tablechart-tooltip-key[data-sample][data-marker=diamond][data-open][data-line=dashed]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H7.9 M16.1 6H24' stroke-dasharray='4 2.5' stroke-linecap='butt'/%3E%3C/svg%3E")}.tablechart-name[data-place=legend][data-marker=diamond][data-open][data-line=dotted],.tablechart-tooltip-key[data-sample][data-marker=diamond][data-open][data-line=dotted]{--_line:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 12' fill='none' stroke='white' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M0 6H7.9 M16.1 6H24' stroke-dasharray='0 3'/%3E%3C/svg%3E")}.tablechart-categories :where(span[data-kind=total]){display:none}.tablechart-categories :where(span[data-kind=slice]):before{content:"";width:var(--tablechart-legend-key-size,var(--tablechart-key-size,.6em));height:var(--tablechart-legend-key-size,var(--tablechart-key-size,.6em));background:var(--palette,color-mix(in oklab, var(--tablechart-slice-color,currentColor) max(var(--tablechart-slice-min,20%), calc(100% - var(--n) * var(--tablechart-slice-fade,15%))), var(--tablechart-surface,Canvas)));border-radius:50%;margin-right:.4em;display:inline-block}.tablechart-categories[data-place=key]{box-sizing:border-box;width:fit-content;max-width:100%;padding:var(--tablechart-legend-padding,0);border:var(--tablechart-legend-border,none);border-radius:var(--tablechart-legend-radius,0);background:var(--tablechart-legend-surface,none);flex-wrap:wrap;justify-content:center;gap:.3em 1.2em;margin-inline:auto;display:flex}.tablechart-categories[data-place=key] :where(span){white-space:nowrap;padding:0}.tablechart-categories[data-place=beside]{pointer-events:none;margin:0;display:block;position:absolute;inset:0}.tablechart-categories[data-place=beside] :where(span){text-align:right;width:max-content;max-width:min(var(--tablechart-name-max,40%), var(--_beside,100%));text-wrap:balance;hyphens:auto;hyphenate-limit-chars:6 3 3;-webkit-hyphenate-limit-before:3;-webkit-hyphenate-limit-after:3;overflow-wrap:break-word;min-width:min-content;padding:0;position:absolute;transform:translate(-100%,-50%)}.tablechart-categories{grid-template-columns:repeat(var(--_columns,1), minmax(0, 1fr));margin-top:var(--tablechart-name-gap,var(--tablechart-categories-gap,.45em));display:grid}.tablechart-categories :where(span){text-align:center;padding:var(--tablechart-name-padding,var(--tablechart-category-padding,0 .2em));font-size:calc(var(--tablechart-name-size,var(--tablechart-category-size,.95em)) * var(--_name-fit,1));hyphens:manual;overflow-wrap:normal}.tablechart-bar{fill:var(--tablechart-bar-color,currentColor)}.tablechart-bar[data-kind=up]{fill:var(--tablechart-up-color,var(--tablechart-bar-color,currentColor))}.tablechart-bar[data-kind=down]{fill:var(--tablechart-down-color,var(--tablechart-bar-color,currentColor))}.tablechart-bar[data-kind=total]{fill:var(--tablechart-total-color,var(--tablechart-bar-color,currentColor))}.tablechart-bar[data-series],.tablechart-piece{fill:var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas))))}.tablechart-plot[data-grouped] :where(.tablechart-value){font-size:calc(var(--tablechart-value-group-size,.95em) * var(--_fit,1))}.tablechart-rule{stroke:var(--tablechart-baseline-color,var(--tablechart-rule-color,currentColor));stroke-width:var(--tablechart-baseline-width,var(--tablechart-rule-width,1px));opacity:var(--tablechart-baseline-opacity,var(--tablechart-rule-opacity,.45));vector-effect:non-scaling-stroke}.tablechart-connector{stroke:var(--tablechart-connector-color,currentColor);stroke-width:var(--tablechart-connector-width,1px);stroke-dasharray:var(--tablechart-connector-dash,2 3);opacity:var(--tablechart-connector-opacity,.55);fill:none;vector-effect:non-scaling-stroke}.tablechart-series{stroke:var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas))));stroke-width:var(--tablechart-series-width,2px);stroke-linecap:round;fill:none;vector-effect:non-scaling-stroke}.tablechart-area{fill:var(--tablechart-area-color,var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas)))));opacity:var(--tablechart-area-opacity,.25)}.tablechart-area[data-muted]{opacity:calc(var(--tablechart-area-opacity,.25) / 2)}.tablechart-area[data-stacked]{opacity:var(--tablechart-area-opacity,.5)}.tablechart-area[data-stacked][data-muted]{opacity:calc(var(--tablechart-area-opacity,.5) / 2)}.tablechart-series[data-line=dashed]{stroke-dasharray:var(--tablechart-series-dash,var(--tablechart-dash,6 4))}.tablechart-series[data-line=dotted]{stroke-dasharray:var(--tablechart-series-dot,var(--tablechart-dot,0 4))}.tablechart-point{fill:var(--tablechart-point-color,var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas)))))}.tablechart-point[data-open]{fill:none;stroke:var(--tablechart-point-color,var(--tablechart-series-own-color,var(--tablechart-series-ink,color-mix(in oklab, var(--palette,color-mix(in oklab, var(--tablechart-series-color,var(--tablechart-bar-color,currentColor)) max(var(--tablechart-series-min,40%), calc((100% - var(--n,0) * min(var(--tablechart-series-fade,30%), calc((100% - var(--tablechart-series-min,40%)) / max(var(--_series-count,2) - 1, 1)))) * (1 - var(--m,0)) + var(--m,0) * 100%)), var(--tablechart-surface,Canvas))) calc(100% - var(--m,0) * (100% - var(--tablechart-series-muted-share,var(--tablechart-muted-share,45%)))), var(--tablechart-surface,Canvas)))));stroke-width:var(--tablechart-series-width,2px);vector-effect:non-scaling-stroke}.tablechart-slice{fill:none;stroke:var(--palette,color-mix(in oklab, var(--tablechart-slice-color,currentColor) max(var(--tablechart-slice-min,20%), calc(100% - var(--n) * var(--tablechart-slice-fade,15%))), var(--tablechart-surface,Canvas)))}.tablechart-divide{stroke:#000;stroke-width:var(--tablechart-slice-gap,4);fill:none}.tablechart-leader{stroke:var(--tablechart-leader-color,currentColor);stroke-width:var(--tablechart-leader-width,1px);opacity:var(--tablechart-leader-opacity,.45);fill:none;vector-effect:non-scaling-stroke}.tablechart-centre{white-space:nowrap;text-align:center;font-size:var(--tablechart-centre-size,1.6em);color:var(--tablechart-centre-color,currentColor);position:absolute;transform:translate(-50%,-50%)}.tablechart-break[data-part=edge]{fill:none;stroke:var(--tablechart-break-color,currentColor);stroke-width:var(--tablechart-break-width,1px);opacity:var(--tablechart-break-opacity,1);stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}.tablechart-line{stroke:var(--tablechart-annotation-color,currentColor);stroke-width:var(--tablechart-annotation-width,1.25px);fill:none;stroke-linecap:butt;stroke-linejoin:miter;vector-effect:non-scaling-stroke}.tablechart-head{fill:var(--tablechart-annotation-color,currentColor)}.tablechart-badge{background:var(--tablechart-badge-surface,none);color:var(--tablechart-annotation-color,currentColor);border:var(--tablechart-badge-border-width,1px) solid currentColor;border-radius:var(--tablechart-badge-radius,50%);padding:var(--tablechart-badge-padding,.5em 1.25em);white-space:nowrap;line-height:1;position:absolute;transform:translate(-50%,-50%)}.tablechart-badge :where(.tablechart-caption){color:var(--tablechart-color,currentColor);background:0 0;border:0;position:absolute;bottom:calc(100% + .45em);left:50%;transform:translate(-50%)}@media screen{:where([data-animate],[data-animate] .tablechart-plot){--_el:var(--tablechart-animation-element-duration,var(--tablechart-duration,.5s));--_max:var(--tablechart-animation-max,calc(4 * var(--_el)));--_r:var(--tablechart-animation-stagger,var(--_ratio,.24));--_dur:min(var(--_el), calc(var(--_max) / (1 + var(--_keep,0) * (var(--count,1) - 1) * var(--_r))));--_stg:min(var(--tablechart-stagger,calc(var(--_r) * var(--_el))), max(0s, calc((var(--_max) - var(--_dur)) / max(var(--count,1) - 1, 1))));--_fade:min(var(--_dur), calc(var(--_max) / 4));--_ease:var(--tablechart-animation-ease,var(--tablechart-easing,cubic-bezier(.26, .86, .44, .985)));--_build:min(calc(.6 * var(--count,1) * var(--_dur)), calc(var(--_max) - var(--_fade)));--_steptime:min(calc(.65 * var(--_dur)), calc(var(--_max) / (var(--count,1) - .08)));--_rise:min(calc(var(--_el) * 1.6), calc(var(--_max) - var(--_fade)));--_ring:calc(var(--_dur) + (var(--count,1) - 1) * var(--_stg))}:where([data-animate]) :where(.tablechart-bar){transform-box:fill-box;transform-origin:bottom;transition:transform var(--_dur) var(--_ease);transition-delay:calc(var(--i) * var(--_stg));transform:scaleY(0)}:where([data-animate]) :where(.tablechart-bar[data-grow=down]){transform-origin:top}:where([data-animate]) :where(.tablechart-bar[data-grow=right]){transform-origin:0;transform:scaleX(0)}:where([data-animate]) :where(.tablechart-bar[data-grow=left]){transform-origin:100%;transform:scaleX(0)}:where([data-animate]) :where(.tablechart-series){clip-path:inset(-10px calc(100% + 10px) -10px -10px);transition:clip-path calc(var(--d,1) * var(--_stg)) linear;transition-delay:calc(max(var(--i) - 1, 0) * var(--_stg))}:where([data-animate]) :where(.tablechart-area-fill){opacity:0;transition:opacity calc(max(var(--rows) - 1, 1) * var(--_stg)) linear;transition-delay:calc(max(var(--i) - 1, 0) * var(--_stg))}:where([data-animate]) :where(.tablechart-point,.tablechart-hole){opacity:0;transition:opacity var(--_fade) ease;transition-delay:calc(var(--i) * var(--_stg) + .048 * var(--_dur))}:where([data-animate]) :where(.tablechart-hole[data-for=badge]){transition:opacity .3s;transition-delay:calc(var(--after) * var(--_stg) + .35s)}:where([data-animate]) :where(.tablechart-value,.tablechart-name){opacity:0;transition:opacity var(--_fade) ease;transition-delay:calc(var(--i) * var(--_stg) + .096 * var(--_dur))}:where([data-animate]) :where(.tablechart-connector){clip-path:inset(-10px calc(100% + 10px) -10px -10px);transition:clip-path calc(var(--_dur) / 3) linear;transition-delay:calc(var(--i) * var(--_stg))}:where([data-animate]) :where(.tablechart-slice){stroke-dasharray:0 var(--circ);transition:stroke-dasharray var(--_dur) var(--_ease);transition-delay:calc(var(--i) * var(--_stg))}:where([data-animate]) :where(.tablechart-centre){opacity:0;transition:opacity var(--_fade) ease;transition-delay:calc(var(--i,0) * var(--_stg) + .5 * var(--_dur))}:where([data-animate]) :where(.tablechart-leader){stroke-opacity:0;transition:stroke-opacity var(--_fade) ease;transition-delay:calc(var(--i,0) * var(--_stg) + .5 * var(--_dur))}:where([data-animate]) :where([data-chart=donut] .tablechart-value){transition-delay:calc(var(--i,0) * var(--_stg) + .5 * var(--_dur))}:where([data-animate]) :where(.tablechart-break[data-part=edge]){stroke-opacity:0;transition:stroke-opacity .2s;transition-delay:calc((var(--after) + .9) * var(--_stg))}:where([data-animate]) :where(.tablechart-line){stroke-dasharray:var(--len);stroke-dashoffset:var(--len);transition:stroke-dashoffset var(--tablechart-annotation-duration,.6s) var(--_ease);transition-delay:calc(var(--after) * var(--_stg))}:where([data-animate]) :where(.tablechart-head){opacity:0;transition:opacity .2s;transition-delay:calc(var(--after) * var(--_stg) + .55s)}:where([data-animate]) :where(.tablechart-badge){opacity:0;transition:opacity .3s;transition-delay:calc(var(--after) * var(--_stg) + .35s)}:where([data-chart=waterfall]:not([data-animate=sweep])){--_ratio:.6;--_keep:1}:where([data-animate=sweep][data-chart=waterfall]:not([data-steps])) :where(.tablechart-bar,.tablechart-connector){transition-duration:calc(var(--span,1) * var(--_build));transition-timing-function:var(--ease,linear);transition-delay:calc(var(--start,0) * var(--_build))}:where([data-animate=sweep][data-chart=waterfall]:not([data-steps])) :where(.tablechart-value){transition-delay:calc((var(--start,0) + .5 * var(--span,0)) * var(--_build))}:where([data-animate=sweep][data-chart=waterfall]:not([data-steps])) :where(.tablechart-badge,.tablechart-hole[data-for=badge]){transition-delay:calc(var(--_build) + .2s)}:where([data-animate=sweep][data-chart=waterfall]:not([data-steps])) :where(.tablechart-break[data-part=edge]){transition-delay:calc((var(--start,0) + var(--span,1)) * var(--_build))}:where([data-animate][data-chart=waterfall][data-steps]) :where(.tablechart-bar){transition-duration:calc(.923 * var(--_steptime));transition-delay:calc(var(--i) * var(--_steptime))}:where([data-animate][data-chart=waterfall][data-steps]) :where(.tablechart-connector){transition:clip-path calc(.308 * var(--_steptime)) linear;transition-delay:calc((var(--i) - 1) * var(--_steptime) + calc(.692 * var(--_steptime)))}:where([data-animate][data-chart=waterfall][data-steps]) :where(.tablechart-value){transition-delay:calc(var(--i) * var(--_steptime) + calc(.923 * var(--_steptime)) * .5)}:where([data-animate][data-chart=waterfall][data-steps]) :where(.tablechart-badge,.tablechart-hole[data-for=badge]){transition-delay:calc(var(--after) * var(--_steptime) + .2s)}:where([data-animate].is-shown) :where(.tablechart-bar){transform:scaleY(1)}:where([data-animate].is-shown) :where(.tablechart-bar:is([data-grow=right],[data-grow=left])){transform:scaleX(1)}:where([data-animate].is-shown) :where(.tablechart-series){clip-path:inset(-10px)}:where([data-animate].is-shown) :where(.tablechart-point),:where([data-animate].is-shown) :where(.tablechart-hole),:where([data-animate].is-shown) :where(.tablechart-area-fill),:where([data-animate].is-shown) :where(.tablechart-value),:where([data-animate].is-shown) :where(.tablechart-name),:where([data-animate].is-shown) :where(.tablechart-head),:where([data-animate].is-shown) :where(.tablechart-badge),:where([data-animate].is-shown) :where(.tablechart-centre){opacity:1}:where([data-animate].is-shown) :where(.tablechart-leader),:where([data-animate].is-shown) :where(.tablechart-break[data-part=edge]){stroke-opacity:1}:where([data-animate].is-shown) :where(.tablechart-slice){stroke-dasharray:var(--arc) calc(var(--circ) - var(--arc))}:where([data-animate].is-shown) :where(.tablechart-connector){clip-path:inset(-10px)}:where([data-animate].is-shown) :where(.tablechart-line){stroke-dashoffset:0}:where([data-animate=grow]:is([data-chart=line],[data-chart=area])) :where(.tablechart-series,.tablechart-area){clip-path:none;transform-box:view-box;transform-origin:0 var(--_base);transition:transform var(--_rise) var(--_ease);transition-delay:0s;transform:scaleY(0)}:where([data-animate=grow]:is([data-chart=line],[data-chart=area])) :where(.tablechart-area-fill){opacity:1;transition:none}:where([data-animate=grow]:is([data-chart=line],[data-chart=area])) :where(.tablechart-point,.tablechart-hole:not([data-for])){opacity:0;transform:translateY(var(--rise,0));transition:transform var(--_rise) var(--_ease), opacity .15s ease;transition-delay:0s}:where([data-animate=grow]:is([data-chart=line],[data-chart=area])) :where(.tablechart-value,.tablechart-name){transition-delay:var(--_rise)}:where([data-animate=grow]:is([data-chart=line],[data-chart=area]).is-shown) :where(.tablechart-series,.tablechart-area){transform:scaleY(1)}:where([data-animate=grow]:is([data-chart=line],[data-chart=area]).is-shown) :where(.tablechart-point,.tablechart-hole:not([data-for])){opacity:1;transform:none}:where([data-animate=sweep][data-chart=donut]) :where(.tablechart-slice){transition:stroke-dasharray calc(var(--span,1) * var(--_ring)) var(--ease,linear);transition-delay:calc(var(--start,0) * var(--_ring))}:where([data-animate=sweep][data-chart=donut]) :where(.tablechart-leader,.tablechart-value){transition-delay:calc((var(--start,0) + var(--span,0)) * var(--_ring))}:where([data-animate=sweep][data-chart=donut]) :where(.tablechart-centre){transition-delay:calc(.5 * var(--_ring))}:where([data-animate]){transition:opacity var(--tablechart-queue-duration,.4s) ease}:where([data-animate].tablechart-queued){opacity:0}}@media screen and (prefers-reduced-motion:reduce){:where([data-animate]) :where(*){transition-duration:1ms!important;transition-delay:0s!important}}@media screen{:where([data-animate][data-steps]) :where(.tablechart-series),:where([data-animate][data-steps]) :where(.tablechart-area-fill>*){clip-path:inset(-10px calc(100% + 10px) -10px -10px);transition:clip-path var(--_dur) ease}:where([data-animate][data-steps]) :where(.tablechart-area-fill){opacity:1;transition:none}:where([data-animate][data-steps]) :where(.tablechart-piece){transform-box:fill-box;transform-origin:bottom;transition:transform var(--_dur) var(--_ease);transition-delay:calc(var(--i,0) * var(--_stg))}:where([data-animate][data-steps]) :where(.tablechart-piece[data-grow=right]){transform-origin:0}:where([data-animate][data-steps]) :where(.tablechart-piece[data-grow=down]){transform-origin:top}:where([data-animate][data-steps]) :where(.tablechart-piece[data-grow=left]){transform-origin:100%}:where([data-animate][data-steps].is-shown) :where(.tablechart-bar){transform:scaleY(clamp(0, var(--_step,0) - var(--step,-1), 1))}:where([data-animate][data-steps].is-shown) :where(.tablechart-bar:is([data-grow=right],[data-grow=left])){transform:scaleX(clamp(0, var(--_step,0) - var(--step,-1), 1))}:where([data-animate][data-steps].is-shown) :where(.tablechart-piece){transform:scaleY(clamp(0, var(--_step,0) - var(--step,-1), 1))}:where([data-animate][data-steps].is-shown) :where(.tablechart-piece:is([data-grow=right],[data-grow=left])){transform:scaleX(clamp(0, var(--_step,0) - var(--step,-1), 1))}:where([data-animate][data-steps].is-shown) :where(.tablechart-value),:where([data-animate][data-steps].is-shown) :where(.tablechart-name),:where([data-animate][data-steps].is-shown) :where(.tablechart-head),:where([data-animate][data-steps].is-shown) :where(.tablechart-badge),:where([data-animate][data-steps].is-shown) :where(.tablechart-centre),:where([data-animate][data-steps].is-shown) :where(.tablechart-point),:where([data-animate][data-steps].is-shown) :where(.tablechart-hole){opacity:clamp(0, var(--_step,0) - var(--step,-1), 1)}:where([data-animate][data-steps].is-shown) :where(.tablechart-leader),:where([data-animate][data-steps].is-shown) :where(.tablechart-break[data-part=edge]){stroke-opacity:clamp(0, var(--_step,0) - var(--step,-1), 1)}:where([data-animate][data-steps].is-shown) :where(.tablechart-line){stroke-dashoffset:calc(var(--len) * (1 - clamp(0, var(--_step,0) - var(--step,-1), 1)))}:where([data-animate][data-steps].is-shown) :where(.tablechart-connector){clip-path:inset(-10px calc((1 - clamp(0, var(--_step,0) - var(--step,-1), 1)) * (100% + 20px) - 10px) -10px -10px)}:where([data-animate][data-steps].is-shown) :where(.tablechart-series),:where([data-animate][data-steps].is-shown) :where(.tablechart-area-fill>*){clip-path:inset(-10px calc((1 - var(--reveal,0)) * (100% + 20px) - 10px) -10px -10px)}:where([data-animate][data-steps].is-shown) :where(.tablechart-slice){stroke-dasharray:calc(var(--arc) * clamp(0, var(--_step,0) - var(--step,-1), 1)) calc(var(--circ) - var(--arc) * clamp(0, var(--_step,0) - var(--step,-1), 1))}}:where(.tablechart-controls){justify-content:var(--tablechart-control-justify,var(--tablechart-controls-justify,space-between));margin-top:var(--tablechart-control-gap,var(--tablechart-controls-gap,.75em));align-items:center;gap:.5em;display:flex}:where(.tablechart-controls) :where(button){padding:var(--tablechart-control-padding,.3em .7em);border:var(--tablechart-control-border,1px solid color-mix(in oklab, currentColor 30%, transparent));border-radius:var(--tablechart-control-radius,.4em);background:var(--tablechart-control-surface,none);color:inherit;font:inherit;cursor:pointer;align-items:center;gap:.35em;display:inline-flex}:where(.tablechart-controls) :where(button:disabled){opacity:.35;cursor:default}:where(.tablechart-controls) :where(.tablechart-control-icon svg){fill:none;stroke:currentColor;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;width:.8em;height:.8em;display:block}@media print{:where([data-steps]){--_step:999!important}:where([data-steps] [data-from]){--reveal:1!important}:where(.tablechart-controls){display:none}}.tablechart-plot[data-hover]{cursor:default}.tablechart-plot[data-hover] :where(.tablechart-value){-webkit-user-select:none;user-select:none}.tablechart-tooltip{pointer-events:auto;text-align:start;z-index:1000;box-sizing:border-box;min-width:7em;max-width:min(18em,100vw - 16px);padding:var(--tablechart-tooltip-padding,.45em .7em);border:var(--tablechart-tooltip-border,1px solid color-mix(in oklab, currentColor 28%, transparent));border-radius:var(--tablechart-tooltip-radius,.4em);background:var(--tablechart-tooltip-surface,light-dark(#fff,oklch(from var(--tablechart-surface,Canvas) calc(l + .06) c h)));color:var(--tablechart-tooltip-color,var(--_color,CanvasText));box-shadow:var(--tablechart-tooltip-shadow,0 1px 3px #0000001f, 0 6px 18px #0000002e);line-height:1.35;position:fixed;top:0;left:0}.tablechart-tooltip[hidden]{display:none}.tablechart-tooltip-title{font-weight:600}.tablechart-tooltip-line{align-items:baseline;gap:.45em;display:flex}.tablechart-tooltip-name,.tablechart-tooltip-title{min-width:0}.tablechart-tooltip-value{white-space:nowrap;font-variant-numeric:tabular-nums;flex:none;margin-left:auto;padding-left:1em}.tablechart-tooltip-key{border-radius:50%;flex:none;align-self:center;width:.6em;height:.6em}.tablechart-tooltip-key[data-sample=line]{width:1.6em;height:.8em;mask-image:var(--_line), var(--_mark,none);border-radius:0;mask-position:50%;mask-size:contain;mask-repeat:no-repeat}.tablechart-tooltip-key[data-sample=box]{border-radius:.15em;width:.7em;height:.7em}.tablechart-tooltip-arrow{border:inherit;background:inherit;width:.6em;height:.6em;position:absolute;transform:translate(-50%,-50%)rotate(45deg)}[data-side=top]>.tablechart-tooltip-arrow{border-top-color:#0000;border-left-color:#0000;top:100%}[data-side=bottom]>.tablechart-tooltip-arrow{border-bottom-color:#0000;border-right-color:#0000;top:0}@media print{.tablechart-tooltip,:where(.tablechart,[data-chart]) :where(table,.chart-annotations){display:none}:where(.tablechart-plot){break-inside:avoid;page-break-inside:avoid}:where(.tablechart,[data-chart])>:where(figcaption){break-after:avoid;page-break-after:avoid}:where(.tablechart-categories,.tablechart-legend){break-before:avoid;page-break-before:avoid}[data-table=print]>:where(table),[data-table=always]>:where(table),[data-table=auto][data-left-out]>:where(table){clip-path:none;display:table;position:static}}.is-printing,.is-printing *{transition:none!important;animation:none!important}
|
|
2
2
|
/*$vite$:1*/
|
package/dist/tablechart.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){var t="tablechart",e="tablechart-value",n="tablechart-bar",a="tablechart-rule",o="tablechart-line",r="tablechart-head",s="tablechart-slice",c="tablechart-legend",l="tablechart-hole",i="tablechart-centre",u="tablechart-break",d="tablechart-sr",h="is-printing",f=1e3,b={selector:"[data-chart]",aspect:.38,barfill:.58,ringfill:.42,animate:!0,entrance:.5,labels:"outside",shape:"straight",legend:!1,tooltip:"auto",table:"never",totallabel:"Total",controls:!0,previouslabel:"Previous",nextlabel:"Next",stephint:"step of the chart",threshold:.5,replay:!1,langattribute:"data-i18n"},m="cubic-bezier(0.3, 0.3, 0.6, 1)",g=(t,e,n=1)=>({start:t,span:e,easing:t+e>=n-1e-4?m:"linear"}),p=(t,e)=>`${t}:${e}`,w=t=>Math.round(100*t)/100,$=(t,e={})=>{const n=document.createElementNS("http://www.w3.org/2000/svg",t);for(const a in e){const t=e[a];n.setAttribute(a,String("number"==typeof t?w(t):t))}return n},y=(t,e)=>[t,...e.classes].join(" "),M=(t,e)=>{const n=document.createElement("span");return n.className=t,n.inert=!0,e.appendChild(n),n},v=(t,e,n,a,o)=>{t.style.left=e/a*100+"%",t.style.top=n/o*100+"%"},k=0,x=(t,e,n,a)=>{if(!e.length)return;const o="tablechart-cut-"+ ++k,r=$("mask",{id:o,maskUnits:"userSpaceOnUse"});r.appendChild($("rect",{x:-n,y:-a,width:3*n,height:3*a,fill:"white"}));for(const l of e)l.setAttribute("fill","black"),r.appendChild(l);let s=t.querySelector(":scope > defs");s||(s=$("defs"),t.prepend(s)),s.appendChild(r);const c=$("g",{mask:`url(#${o})`});for(const l of Array.from(t.childNodes))l!==s&&c.appendChild(l);t.appendChild(c)},A=0,N={create:()=>null,draw(t,e,a){const{rows:o,y:r,svg:s,breakAt:c}=a;if(null===c)return;const l="zigzag"===t.getAttribute("data-mark"),i=(t,e)=>{const n=t.sideways?t.height:t.width,a=.09*n,o=n+2*a,r=.3*o,s=.06*o;if(t.sideways){const n=t.y-a;if(!l)return[[e-r/2,n],[e+r/2,n+o]];const c=o/3;return[[e-s,n],[e+s,n+c],[e-s,n+2*c],[e+s,n+o]]}const c=t.x-a;if(!l)return[[c,e+r/2],[c+o,e-r/2]];const i=o/3;return[[c,e+s],[c+i,e-s],[c+2*i,e+s],[c+o,e-s]]},d=(t,e=!1)=>t.map(([t,e],n)=>`${0===n?"M":"L"} ${t.toFixed(1)} ${e.toFixed(1)}`).join(" ")+(e?" Z":""),h="tablechart-break-"+ ++A,f=$("mask",{id:h,maskUnits:"userSpaceOnUse"});f.appendChild($("rect",{x:-1e3,y:-a.height,width:3e3,height:3*a.height,fill:"white"}));const b=[],m=r(c);for(const M of(t=>Array.from(t.querySelectorAll(`.${n}`)).map(t=>{const e="rect"===t.tagName?[t]:Array.from(t.querySelectorAll("rect")),n=(t,e)=>Number(t.getAttribute(e)),a=Math.min(...e.map(t=>n(t,"x"))),o=Math.min(...e.map(t=>n(t,"y"))),r=Math.max(...e.map(t=>n(t,"x")+n(t,"width"))),s=Math.max(...e.map(t=>n(t,"y")+n(t,"height"))),c=["--start","--span"].map(e=>t.style.getPropertyValue(e)&&`${e}:${t.style.getPropertyValue(e)}`).filter(Boolean).join("; ");return{row:Number(t.dataset.row),x:a,y:o,width:r-a,height:s-o,sideways:"right"===t.dataset.grow,part:c}}))(s)){const t=M.sideways?a.breakX:m;if(void 0===t)continue;if(!(M.sideways?M.x<t&&M.x+M.width>t:M.y<m&&M.y+M.height>m))continue;const[e,n]=M.sideways?[i(M,t),i(M,t+a.breakGap)]:[i(M,m-a.breakGap),i(M,m)];f.appendChild($("path",{d:d([...e,...n.slice().reverse()],!0),fill:"black"})),b.push(e,n);const r=[p("--after",o[M.row-1]?.slot??0),M.part].filter(Boolean).join("; ");for(const o of[e,n])s.appendChild($("path",{class:u,"data-part":"edge","data-note":a.note,d:d(o),style:r}))}if(!b.length)return;const g=Array.from(s.querySelectorAll(`.${u}`)),w=$("g",{mask:`url(#${h})`});for(const n of Array.from(s.childNodes))g.includes(n)||w.appendChild(n);const y=$("defs");y.appendChild(f),s.prepend(y,w)}},S=t=>{let e=Number.NEGATIVE_INFINITY;for(const n of t)e=Math.max(e,n);return e},H=t=>(t.split(/[.,]/)[1]||"").length,T=(t,e,n)=>{const a=((t,e)=>new Intl.NumberFormat(e||document.documentElement.lang||void 0,{minimumFractionDigits:t,maximumFractionDigits:t}))(e,n).formatToParts(t),o="minusSign"===a[0]?.type?a[0].value:"";return[o,a.slice(o?1:0).map(t=>t.value).join("")]},z=(t,e)=>{const n=document.createElement("span");if(n.className="tablechart-badge",n.inert=!0,t.childElementCount>0)for(const a of Array.from(t.children))n.appendChild(a.cloneNode(!0));else{n.textContent=(t.textContent||"").trim();const e=t.getAttribute("data-i18n");e&&n.setAttribute("data-i18n",e)}return e.appendChild(n),n},C=(e,n,a,o)=>{const r=(s=e?.textContent||"",Number.parseFloat((s.match(/-?[\d.,]+/)||["NaN"])[0].replace(",",".")));var s;const c=!!Number.isNaN(r)||Math.abs(n-r)<=.5,l={label:a,computed:n,stated:r,agrees:c};o.checks.push(l),c||console.warn(`[${t}] An annotation reads ${r}%, but ${a} is ${n.toFixed(1)}%. The chart shows your number.`)},L={create:z,draw(e,n,a){const{rows:s,cx:c,y:l,unit:i,labelHeight:u,badgeHeight:d,height:h,svg:b,after:m}=a,[g,w]=((t,e)=>{const n=(e,n)=>{const a=Number.parseInt(t.getAttribute(e)??"",10);return Number.isFinite(a)?a-1:n};return[n("data-from",0),n("data-to",e-1)]})(e,s.length),y=s[g],M=s[w];if(!y||!M)return void console.warn(`[${t}] A bracket points at a row that is not there (row ${g+1} to ${w+1}, of ${s.length}).`);const k=7*i,x=4*i,A=c(g),N=c(w),S=Math.min(l(y.value),l(M.value))-u-x-.9*d,H=t=>l(t)-u-x,T=`M ${A} ${H(y.value)} L ${A} ${S} L ${N} ${S} L ${N} ${H(M.value)-k}`,z=(H(y.value)-S+Math.abs(N-A)+(H(M.value)-k-S))/i+1;b.appendChild($("path",{class:o,"data-note":a.note,d:T,style:`--len:${z.toFixed(1)}; ${p("--after",m)}`}));const L=H(M.value);var O;b.appendChild($("polygon",{class:r,"data-note":a.note,points:`${N},${L} ${N-.45*k},${L-k} ${N+.45*k},${L-k}`,style:p("--after",m)})),n&&(v(n,(A+N)/2,S,f,h),n.style.setProperty("--after",String(m))),C(n,(O=y.value,(M.value-O)/Math.abs(O)*100),`${y.value} to ${M.value}`,a)}},O=new WeakMap,B=t=>O.get(t)??{width:t.offsetWidth,height:t.offsetHeight},U={create:z,draw(t,e,n){const{rows:a,cx:s,y:c,unit:l,labelHeight:i,height:u,svg:d,values:h,after:b}=n,m=a[0],g=a[a.length-1];if(!m||!g)return;const w=i+18*l,y=10*l,M=10*l;let k=s(0),x=c(m.value)-w,A=s(a.length-1),N=c(g.value)-w,S=0;a.forEach((t,e)=>{const n=A===k?0:(s(e)-k)/(A-k),a=x+n*(N-x)-(c(t.value)-w);a>S&&(S=a)}),x-=S,N-=S;const H=A-k,T=N-x,z=Math.hypot(H,T)||1,L=H/z,O=T/z;k-=L*y,x-=O*y,A+=L*y,N+=O*y;const U=Number.parseFloat(t.getAttribute("data-at")||"0.5");if(e){const t=k+(A-k)*U,n=x+(N-x)*U,o=B(e).width*l/2,r=n+B(e).height*l/2+8*l;let u=0;a.forEach((e,n)=>{const a=(h[n]?B(h[n]).width:0)*l/2;if(Math.abs(s(n)-t)>=o+a)return;const d=c(e.value)-7*l-i;u=Math.max(u,r-d)}),x-=u,N-=u}const _=A-L*M,E=N-O*M,F=Math.hypot(_-k,E-x)/l+1;d.appendChild($("line",{class:o,"data-note":n.note,x1:k,y1:x,x2:_,y2:E,style:`--len:${F.toFixed(1)}; ${p("--after",b)}`}));const j=-O,P=L,q=.42*M;d.appendChild($("polygon",{class:r,"data-note":n.note,points:[`${A},${N}`,`${_+j*q},${E+P*q}`,`${_-j*q},${E-P*q}`].join(" "),style:p("--after",b)})),e&&(v(e,k+(A-k)*U,x+(N-x)*U,f,u),e.style.setProperty("--after",String(b)));const R=Number.parseFloat(t.getAttribute("data-years")||"");!Number.isNaN(R)&&R>0&&C(e,((t,e,n)=>100*(Math.pow(e/t,1/n)-1))(m.value,g.value,R),`${m.value} to ${g.value} over ${R} years`,n)}},_=(t,e,n)=>{const a=.15,o=Math.min(.7*t/(e+(e-1)*a),n),r=e*o+(e-1)*o*a;return{size:o,gap:o*a,offset:t=>-r/2+t*o*1.15}},E=(t,e,n)=>{const a=t.series[n],o=t.series.some(t=>t.focus)&&!a.focus;return{"data-series":n+1,...o&&{"data-muted":""},style:`--n:${n}; --m:${o?1:0}; --palette:var(--tablechart-color-${n+1}); ${p("--i",e.slot)}`}},F=(t,e,n=!1)=>{let a=0,o=0;return Array.from({length:e},(e,r)=>{const s=t.cells[r]??t.cells[0],c=s.missing?0:s.value;if(n){const t=a;return a+=c,{from:t,to:a,cell:s}}if(c<0){const t=o;return o+=c,{from:t,to:o,cell:s}}const l=a;return a+=c,{from:l,to:a,cell:s}})},j=(t,e,n=!1)=>{const a=F(t,e,n);return{top:Math.max(0,...a.map(t=>t.to)),bottom:Math.min(0,...a.map(t=>t.to))}},P=(t,e)=>{const{top:n,bottom:a}=j(t,e);return n+a},q=(t,e,n)=>{const a=e.series.some(t=>t.focus);t.style.setProperty("--n",String(n)),t.style.setProperty("--m",a&&!e.series[n].focus?"1":"0"),t.style.setProperty("--palette",`var(--tablechart-color-${n+1})`)},R=(t,e,a,o={},r="")=>{const s={class:y(n,e),"data-kind":"bar","data-row":a+1,...o},c=p("--i",e.slot)+(r?`; transform-origin: ${r}`:""),l=$("g",{...s,"data-stack":"",style:c});return t.svg.appendChild(l),(n,r)=>{const s=void 0!==o["data-grow"]?{"data-grow":o["data-grow"]}:{};l.appendChild($("rect",{...s,...r,class:y("tablechart-piece",e),"data-row":a+1,...E(t,e,n)}))}},W=(t,e,n)=>t.some(t=>B(t).width*n>e-6*n),D=(t,e,n)=>e>=B(t).height*n*1.6,V=(t,e,n)=>e>=B(t).width*n*1.5,K=(t,e,n,a,o=.7)=>{t.style.setProperty(a,"1");let r=1;for(const c of e){const{size:t,room:e}=n(c);t>e&&(r=Math.min(r,e/t))}const s=r>=o?r:0;return t.style.setProperty(a,String(s||o)),s},I={segments:t=>t.map(t=>({...t,from:0,to:t.value,kind:"bar"})),series:!0,legend:"box",stackable:!0,totals:!0,breakable:!0,aspect:.5,minHeight:({labelHeight:t,nameHeight:e,rows:n,series:a,stacked:o})=>{const r=1.1*t,s=a>1&&!o?r*(a+.15*(a-1))/.7:r/.58;return n*Math.max(s,1.2*e)},categories:"beside",headroom:()=>0,draw(t){const{segments:e,height:o,unit:r,svg:s,values:c,categories:l,config:i,barMax:u}=t,d=t.series.length>1,h=Math.max(S(l.map(t=>B(t).width*r)),0),b=Math.min(h+10*r,420);l[0]?.parentElement?.style.setProperty("--_beside",`${((b-8*r)/f*100).toFixed(2)}%`);const m=f-4*r,g=t.stacked?Math.max(S(t.rows.map(e=>j(e,t.series.length).top)),0)||1:Math.max(S(t.rows.flatMap(e=>e.cells.slice(0,t.series.length).map(t=>Math.abs(t.value)))),0)||1,w=t.stacked?Math.max(S(t.rows.map(e=>-j(e,t.series.length).bottom)),0):Math.max(S(t.rows.flatMap(e=>e.cells.slice(0,t.series.length).map(t=>-t.value))),0),M=Math.max(g,t.squeeze?.hi??0)+w,k=(e,n)=>((t,e,n,a,o)=>{if(!a)return t/e*n;const{lo:r,hi:s,gap:c,share:l}=a,i=n*l,u=(n-i-o)/(r+(e-s)),d=i/(s-r);return t<=r?t*u:t<=c?r*u+(t-r)*d:t<=s?r*u+(t-r)*d+o:r*u+i+o+(t-s)*u})(Math.abs(e),M,n,t.squeeze,t.breakGap),x=o/e.length,A=t=>(t+.5)*x,N=Math.min(x*i.barfill,u),H=_(x,t.series.length,u),T=c[0]??t.totals[0],z=T?B(T).height*r*.56:0,C=Math.max(((d&&!t.stacked?H.size:N)-z)/2,5*r),L=t=>B(t).width*r,O=t=>t.length?S(t.map(L))+C+4*r:0,U=(e,n)=>(t.rows[n].cells[e]??t.rows[n].cells[0]).value,P=t.seriesValues.flatMap((t,e)=>t.map((t,n)=>({label:t,value:U(e,n)}))),W=e=>{const n=j(t.rows[e],t.series.length);return 0===n.top&&n.bottom<0};let D=t.stacked?O(t.totals.filter((t,e)=>!W(e))):d?O(P.filter(t=>t.value>=0).map(t=>t.label)):0,I=t.stacked?O(t.totals.filter((t,e)=>W(e))):d?O(P.filter(t=>t.value<0).map(t=>t.label)):0;if(!d&&!t.stacked)for(let n=0;n<3;n++){const t=m-b-D-I,n=e.map((t,e)=>({seg:t,label:c[e]})).filter(({seg:e,label:n})=>!V(n,k(e.value,t),r)),a=O(n.filter(({seg:t})=>t.value>=0).map(({label:t})=>t)),o=O(n.filter(({seg:t})=>t.value<0).map(({label:t})=>t));if(a<=D&&o<=I)break;D=Math.max(D,a),I=Math.max(I,o)}const G=m-b-D-I,Z=b+I+k(w,G),J=t=>t<0?Z-k(t,G):Z+k(t,G);if(t.squeeze&&(t.breakX=J(t.squeeze.gap)),t.stacked)return t.rows.forEach((e,n)=>{const a=j(e,t.series.length),s=R(t,e,n,{"data-grow":"right"},a.bottom<0?Z-J(a.bottom)+"px center":""),c=A(n)-N/2;F(e,t.series.length).forEach(({from:e,to:a,cell:l},i)=>{const u=t.seriesValues[i][n];if(u.dataset.place="none",l.missing||a===e)return;const d=Math.min(J(e),J(a)),h=Math.max(J(e),J(a));s(i,{x:d,y:c,width:Math.max(h-d,1),height:N,...a<e&&{"data-grow":"left"}}),u.dataset.place="inside",u.toggleAttribute("data-left-out",!V(u,h-d,r)||B(u).height*r>N),q(u,t,i),v(u,(d+h)/2,A(n),f,o)});const i=t.totals[n];i&&(i.dataset.place=W(n)?"before":"after",v(i,W(n)?J(a.bottom)-C:J(a.top)+C,A(n),f,o));const u=l[n];u&&v(u,b-8*r,A(n),f,o)}),void s.appendChild($("line",{class:a,x1:Z,x2:Z,y1:0,y2:o}));if(d){t.plot.dataset.grouped="";const e=t.seriesValues.flat().filter(t=>void 0===t.dataset.missing),c=K(t.plot,e,t=>({size:B(t).height*r,room:H.size+.5*H.gap}),"--_fit");return t.rows.forEach((e,a)=>{t.series.forEach((r,l)=>{const i=e.cells[l]??e.cells[0],u=t.seriesValues[l][a];if(i.missing)return void(u.dataset.place="none");const d=J(i.value),h=i.value<0,b=A(a)+H.offset(l);s.appendChild($("rect",{class:y(n,e),"data-kind":"bar","data-row":a+1,"data-grow":h?"left":"right",x:Math.min(d,Z),y:b,width:Math.max(Math.abs(d-Z),1),height:H.size,...E(t,e,l)})),u.dataset.place=h?"before":"after",u.toggleAttribute("data-left-out",!c),v(u,h?d-C:d+C,b+H.size/2,f,o)});const i=l[a];i&&v(i,b-8*r,A(a),f,o)}),void s.appendChild($("line",{class:a,x1:Z,x2:Z,y1:0,y2:o}))}const Q=e.map((t,e)=>V(c[e],Math.abs(J(t.value)-Z),r));e.forEach((e,a)=>{const i=J(e.value),u=A(a),d=e.value<0,h=Math.abs(i-Z);s.appendChild($("rect",{class:y(n,e),"data-kind":e.kind,"data-row":a+1,"data-grow":d?"left":"right",x:Math.min(i,Z),y:u-N/2,width:Math.max(h,1),height:N,style:p("--i",e.slot)}));const m=c[a],g=Math.max(Math.min(C,h-L(m)-6*r),6*r),w=d?1:-1;m.dataset.place=Q[a]?"inside":d?"before":"after",m.dataset.kind=e.kind,v(m,Q[a]?"center"===t.insideAlign?(Z+i)/2:"start"===t.insideAlign?Z-w*(g+L(m)/2):i+w*(g+L(m)/2):i-w*C,u,f,o);const M=l[a];M&&v(M,b-8*r,u,f,o)}),s.appendChild($("line",{class:a,x1:Z,x2:Z,y1:0,y2:o}))}},G={segments:t=>t.map(t=>({...t,from:0,to:t.value,kind:"bar"})),series:!0,legend:"box",stackable:!0,totals:!0,breakable:!0,headroom:({labelHeight:t,badgeHeight:e,hasAnnotations:n,unit:a})=>t+4*a+(n?1.6*e:0),draw(t){const{segments:e,cx:o,y:r,barWidth:s,height:c,unit:l,svg:i,values:u,labels:d,insideAlign:h}=t,b=r(0);if(t.stacked)return t.rows.forEach((e,n)=>{const a=j(e,t.series.length),i=R(t,e,n,{},a.bottom<0?`center ${b-r(a.top)}px`:""),u=o(n)-s/2;F(e,t.series.length).forEach(({from:e,to:a,cell:d},h)=>{const b=t.seriesValues[h][n];if(b.dataset.place="none",d.missing||a===e)return;const m=Math.min(r(a),r(e)),g=Math.max(r(a),r(e));i(h,{x:u,y:m,width:s,height:Math.max(g-m,1),...a<e&&{"data-grow":"down"}}),b.dataset.place="inside",b.toggleAttribute("data-left-out",!D(b,g-m,l)||B(b).width*l>s-4*l),q(b,t,h),v(b,o(n),(m+g)/2,f,c)});const d=t.totals[n];if(d){const t=0===a.top&&a.bottom<0;d.dataset.place=t?"below":"outside",v(d,o(n),t?r(a.bottom)+4*l:r(a.top)-4*l,f,c)}}),void i.appendChild($("line",{class:a,x1:0,x2:f,y1:b,y2:b}));if(t.series.length>1){const e=o(1)-o(0)||2*o(0),s=_(e,t.series.length,t.barMax);t.plot.dataset.grouped="";const u=t.seriesValues.flat().filter(t=>void 0===t.dataset.missing),d=K(t.plot,u,t=>({size:B(t).width*l,room:s.size+.5*s.gap}),"--_fit");return t.rows.forEach((e,a)=>{t.series.forEach((u,h)=>{const m=e.cells[h]??e.cells[0],g=t.seriesValues[h][a],p=o(a)+s.offset(h);if(m.missing)return void(g.dataset.place="none");const w=r(m.value),M=m.value<0;i.appendChild($("rect",{class:y(n,e),"data-kind":"bar","data-row":a+1,...M&&{"data-grow":"down"},x:p,y:Math.min(w,b),width:s.size,height:Math.max(Math.abs(b-w),1),...E(t,e,h)})),g.dataset.place=M?"below":"outside",g.toggleAttribute("data-left-out",!d),v(g,p+s.size/2,M?w+4*l:w-4*l,f,c)})}),void i.appendChild($("line",{class:a,x1:0,x2:f,y1:b,y2:b}))}const m=W(u,s,l),g=e.map((t,e)=>"inside"===d&&!m&&!t.missing&&D(u[e],Math.abs(b-r(t.value)),l)),w=u[0]?B(u[0]).height*l*.56:0;let M=Number.POSITIVE_INFINITY;for(const[n,a]of u.entries())g[n]&&(M=Math.min(M,(s-B(a).width*l)/2));e.forEach((t,e)=>{const a=r(t.value),d=t.value<0;if(t.missing)return v(u[e],o(e),b-4*l,f,c),void(u[e].dataset.place="outside");i.appendChild($("rect",{class:y(n,t),"data-kind":t.kind,"data-row":e+1,...d&&{"data-grow":"down"},x:o(e)-s/2,y:Math.min(a,b),width:s,height:Math.max(Math.abs(b-a),1),style:p("--i",t.slot)}));const m=d?-1:1,k=Math.min(M,(Math.abs(b-a)-w)/2),x="center"===h?(a+b)/2:"start"===h?b-m*(k+w/2):a+m*(k+w/2),A=d?a+4*l:a-4*l;v(u[e],o(e),g[e]?x:A,f,c),u[e].dataset.place=g[e]?"inside":d?"below":"outside"}),i.appendChild($("line",{class:a,x1:0,x2:f,y1:b,y2:b}))}},Z=0,J={aspect:.66,centre:!0,headroom:()=>0,segments:t=>t.map(t=>({...t,from:0,to:t.value,kind:"bar"})),draw({rows:t,height:e,unit:n,labelHeight:a,svg:o,values:r,config:c,centre:l}){const i=500,u=e/2,d=(t=>t.filter(t=>!t.isTotal))(t).reduce((t,e)=>t+Math.abs(e.value),0);if(!d)return;const h=1.2*a+10*n,b=Math.max(Math.min(f,e)/2-h,10),m=b*c.ringfill,w=b-m/2,M=2*Math.PI*w,k=[];let x=0,A=0,N=0;if(t.forEach((t,c)=>{const l=r[c];if(t.isTotal)return void(l.dataset.place="none");const h=Math.abs(t.value)/d,S=g(N,h),H=`--share:${h.toFixed(4)}; --start:${S.start.toFixed(4)}; --span:${S.span.toFixed(4)};`,T=h*M,z=x/M*2*Math.PI-Math.PI/2;k.push(z),o.appendChild($("circle",{class:y(s,t),"data-slice":A+1,"data-row":c+1,cx:i,cy:u,r:w,"stroke-width":m,transform:`rotate(-90 500 ${u})`,"stroke-dasharray":`${T.toFixed(1)} ${(M-T).toFixed(1)}`,"stroke-dashoffset":(-x).toFixed(1),style:`--n:${A}; --palette:var(--tablechart-color-${A+1}); --arc:${T.toFixed(1)}; --circ:${M.toFixed(1)}; ${H} --ease:${S.easing}; ${p("--i",t.slot)}`}));const C=z+T/M*Math.PI,L=Math.cos(C),O=Math.sin(C);o.appendChild($("line",{class:"tablechart-leader",x1:i+L*(b+2*n),y1:u+O*(b+2*n),x2:i+L*(b+7*n),y2:u+O*(b+7*n),"data-row":c+1,style:`${H} ${p("--i",t.slot)}`})),l.style.setProperty("--start",S.start.toFixed(4)),l.style.setProperty("--span",S.span.toFixed(4));const U=b+9*n,_=B(l).width*n/2;v(l,i+L*(U+Math.abs(L)*_),u+O*(U+Math.abs(O)*a*.7),f,e),l.dataset.place="around",x+=T,N+=h,A+=1}),k.length>1){const t=w-m/2-1,n=w+m/2+1,a="tablechart-slices-"+ ++Z,r=$("mask",{id:a,maskUnits:"userSpaceOnUse"});r.appendChild($("rect",{x:0,y:0,width:f,height:e,fill:"white"}));for(const e of k)r.appendChild($("line",{class:"tablechart-divide",x1:i+Math.cos(e)*t,y1:u+Math.sin(e)*t,x2:i+Math.cos(e)*n,y2:u+Math.sin(e)*n}));const c=$("g",{mask:`url(#${a})`});for(const e of Array.from(o.querySelectorAll(`.${s}`)))c.appendChild(e);const l=$("defs");l.appendChild(r),o.prepend(l,c)}l&&v(l,i,u,f,e)}},Q=["circle","square","diamond"],X=(t,e)=>{const n=t[e]?.marker?.toLowerCase().split(/\s+/)??[],a=Q.find(t=>n.includes(t));return{shape:a??Q[Math.floor(e/2)%Q.length],open:n.includes("open")||!n.includes("filled")&&!a&&e%2==1}},Y=t=>Number(t.toFixed(2));function tt(t,e,n){const a=new Array(t).fill(0);let o=[];const r=()=>{(function(t,e){const n=t.length;if(n<2)return t.map(()=>0);const a=n=>(e[n+1]-e[n])/(t[n+1]-t[n]||1),o=new Array(n).fill(0);for(let s=1;s<n-1;s++){const e=a(s-1),n=a(s);if(e*n<=0)continue;const r=t[s]-t[s-1],c=t[s+1]-t[s],l=(e*c+n*r)/(r+c||1),i=Math.min(2*Math.abs(e),2*Math.abs(n),Math.abs(l));o[s]=Math.sign(e)*i||0}if(2===n)return o[0]=a(0),o[1]=a(0),o;const r=(n,a,o)=>{const r=t[a]-t[n];return r?((e[a]-e[n])/r*3-o)/2:o};return o[0]=r(0,1,o[1]),o[n-1]=r(n-2,n-1,o[n-2]),o})(o.map(t=>n(t)[0]),o.map(t=>n(t)[1])).forEach((t,e)=>{a[o[e]]=t}),o=[]};for(let s=0;s<t;s++)e(s)?r():o.push(s);return r(),a}var et,nt,at=t=>t.map(t=>({...t,from:0,to:t.value,kind:"bar"})),ot=t=>({segments:at,series:!0,stackable:!0,running:!0,swatch:t?"box":void 0,headroom:({labelHeight:t,unit:e})=>1.6*t+6*e,footroom:({labelHeight:e,unit:n,series:a,focused:o,stacked:r})=>t||r||2!==a||o?0:e+7*n,draw(e){const{rows:n,series:o,seriesValues:r,names:s,cx:c,y:i,height:u,unit:d,labelHeight:h,svg:b,stacked:m}=e,g="step"===e.shape,p="smooth"===e.shape,w=o.length>1,y=o.some(t=>t.focus),M=n.length-1,k=i(0),A=n.length>1?c(1)-c(0):2*c(0);b.style.setProperty("--_base",`${Y(k)}px`);const N=(t,e)=>n[e]?.cells[t]??n[e]?.cells[0],S=(t,e)=>!N(t,e)||!!N(t,e)?.missing,H=n.map(t=>m?F(t,o.length,!0):null),T=(t,e)=>H[e]?.[t].to??N(t,e)?.value??0,z=(t,e)=>H[e]?.[t].from??0,C=(t,e)=>[c(e),i(T(t,e))],L=o.map((t,e)=>{if(!w)return{attrs:{},ink:""};const n=y&&!t.focus;return{attrs:{"data-series":e+1,...n&&{"data-muted":""}},ink:`--n:${e}; --m:${n?1:0}; --palette:var(--tablechart-color-${e+1}); `}}),O=Math.min(M,6);e.plot.style.setProperty("--count",String(O+1));const U=M>0?O/(g?n.length:M):1,_=t=>t*U,E=t=>`--i:${Y(_(t))}`,j=t=>{const e=[];let a=-1;return n.forEach((n,o)=>{S(t,o)||(a<0&&(a=o),(o===M||S(t,o+1))&&((g||o>a)&&e.push([a,o]),a=-1))}),e},P=(t,e)=>`--i:${Y(_(t)+1)}; --d:${Y(_(g?e+1:e)-_(t))}`,q=(t,e)=>({"data-from":t+1,"data-to":e+1,...g&&{"data-flat":""}}),R=p?o.map((t,e)=>tt(n.length,t=>S(e,t),t=>C(e,t))):[],W=p&&t?o.map((t,e)=>tt(n.length,t=>S(e,t),t=>[c(t),i(z(e,t))])):[],D=(t,e,n)=>{const a=[];return t.forEach(([o,r],s)=>{g?(a.push(`H${Y(o+n*A/2)}`),s<t.length-1&&a.push(`V${Y(t[s+1][1])}`)):s>0&&a.push(e?function(t,e,n,a){const[o,r]=function(t,e,n,a){const o=(e[0]-t[0])/3;return[[t[0]+o,t[1]+n*o],[e[0]-o,e[1]-a*o]]}(t,e,n,a),s=([t,e])=>`${Y(t)},${Y(e)}`;return`C${s(o)} ${s(r)} ${s(e)}`}(t[s-1],[o,r],e[s-1],e[s]):`L${Y(o)},${Y(r)}`)}),a},V=(t,e,a,o)=>n.slice(e,a+1).map((n,a)=>[c(e+a),i(o(t,e+a))]),K=(t,e,n,a)=>p?t[e].slice(n,a+1):null,I=t=>c(t)-(g?A/2:0),G=t=>c(t)+(g?A/2:0);t&&o.forEach((t,e)=>(t=>{const e=$("g",{class:"tablechart-area",...L[t].attrs,...m&&{"data-stacked":""},style:L[t].ink}),n=j(t),a=$("g",{class:"tablechart-area-fill",style:`--rows:${Y(O+1)}; ${n.length?P(...n[0]):""}`});e.appendChild(a);for(const[o,r]of n){const e=V(t,o,r,T),n=V(t,o,r,z),s=K(W,t,o,r)?.reverse()??null,c=[`M${Y(I(o))},${Y(n[0][1])}`,`L${Y(I(o))},${Y(e[0][1])}`,...D(e,K(R,t,o,r),1),`L${Y(G(r))},${Y(n[n.length-1][1])}`,...D(n.reverse(),s,-1),"Z"].join(" ");a.appendChild($("path",{d:c,...q(o,r),style:P(o,r)}))}b.appendChild(e)})(e)),o.forEach((t,e)=>(t=>{const e=o[t];for(const[n,a]of j(t)){const o=V(t,n,a,T),r=[`M${Y(I(n))},${Y(o[0][1])}`,...D(o,K(R,t,n,a),1)].join(" ");b.appendChild($("path",{class:"tablechart-series",...L[t].attrs,d:r,...e.line&&{"data-line":e.line},...q(n,a),style:`${L[t].ink}${P(n,a)}`}))}})(e)),g||(()=>{const t=o.map((t,e)=>w?X(o,e):{shape:"circle",open:!1}),e=(e,n,a)=>{const[o,r]=C(e,n);return((t,e,n,a,o={})=>{if("square"===t){const t=.88*a;return $("rect",{x:e-t,y:n-t,width:2*t,height:2*t,...o})}if("diamond"===t){const t=1.2*a;return $("polygon",{points:`${e},${n-t} ${e+t},${n} ${e},${n+t} ${e-t},${n}`,...o})}return $("circle",{cx:e,cy:n,r:a,...o})})(t[e].shape,o,r,4*d,{...a,style:`${a.style??""}${s=r,`--rise:${Y(k-s)}px; `}${E(n)}`});var s},a=t=>n.map((t,e)=>e).filter(e=>!S(t,e)),r=o.flatMap((n,o)=>t[o].open?a(o).map(t=>e(o,t,{class:l,"data-row":t+1,...w&&{"data-series":o+1}})):[]);x(b,r,f,u),o.forEach((n,o)=>{for(const r of a(o))b.appendChild(e(o,r,{class:"tablechart-point",...L[o].attrs,"data-marker":t[o].shape,...t[o].open&&{"data-open":""},"data-row":r+1,style:L[o].ink}))})})();const Z=(t,e)=>{let n=e;for(;n<M&&!S(t,n+1)&&N(t,n+1)?.value===N(t,e)?.value;)n++;return n};r.forEach((e,n)=>{e.forEach((e,a)=>{e.style.setProperty("--i",String(Y(g?(_(a)+_(a+1))/2:_(a))));const s=((e,n)=>{const a=N(e,n);if(!a||a.missing)return"none";if(g&&n>0&&!S(e,n-1)&&N(e,n-1)?.value===a.value)return"none";if(y&&!o[e].focus)return"none";if(m)return"middle";const r=a.value<0?"below":"above";if(!w||y||o.length>2)return r;const s=N(1-e,n);return!s||s.missing?r:a.value>s.value||a.value===s.value&&0===e||t&&a.value>=0&&C(e,n)[1]+7*d+h>k?"above":"below"})(n,a);if(e.dataset.place="above"===s?"outside":s,e.toggleAttribute("data-left-out","none"!==s&&((t,e)=>m||g?B(r[t][e]).width*d>(g?Z(t,e)-e+1:1)*A-4*d||!!(m&&t>0&&T(t,e)<z(t,e))||m&&Math.abs(i(z(t,e))-i(T(t,e)))<1.2*h:w&&!y&&o.length>2)(n,a)),g&&"none"!==s?e.dataset.rowEnd=String(Z(n,a)+1):delete e.dataset.rowEnd,"none"===s)return;const l=B(e).width*d/2+4*d;let b=c(a);g?b=(c(a)+c(Z(n,a)))/2:"middle"===s&&0===a?b+=l:"middle"===s&&a===M&&(b-=l);const p=i(T(n,a)),$={middle:(i(z(n,a))-p)/2,above:-7*d,below:7*d};v(e,b,p+$[s],f,u)})});const J=s.map((t,e)=>{let n=M;for(;n>0&&S(e,n);)n--;const[a,o]=C(e,n);return{name:t,x:(g?a+A/2:a)+10*d,y:m?(o+i(z(e,n)))/2:o}}),Q=(s[0]?B(s[0]).height:0)*d;for(const t of((t,e)=>(t.sort((t,e)=>t.y-e.y),t.forEach((n,a)=>{const o=t[a-1];o&&n.y<o.y+e&&(n.y=o.y+e)}),t))(J,Q))v(t.name,t.x,t.y,f,u);const et=n.some(t=>t.cells.some(t=>!t.missing&&t.value<0)),nt=t||m||2!==o.length||y||et?k:u-2*d;b.appendChild($("line",{class:a,x1:0,x2:c(M)+c(0),y1:nt,y2:nt}))}}),rt=ot(!1),st=ot(!0),ct=new Set,lt={segments:e=>{let n=0,a=!1;return e.map(e=>{if(e.isTotal)return a&&((e,n)=>{if(Math.abs(e-n)<=Math.abs(n)/100)return;const a=`[${t}] A total reads ${e}, but the steps before it add up to ${Number(n.toFixed(6))}. The chart shows your number.`;ct.has(a)||(ct.add(a),console.warn(a))})(e.value,n),a=!1,n=e.value,{...e,from:0,to:e.value,kind:"total"};const o=n;return n+=e.value,a=!0,{...e,from:o,to:n,kind:e.value>=0?"up":"down"}})},breakable:!0,headroom:({labelHeight:t,badgeHeight:e,hasAnnotations:n,unit:a})=>t+6*a+(n?1.6*e:0),draw({segments:t,cx:e,y:o,barWidth:r,height:s,unit:c,svg:l,values:i,breakAt:u,insideAlign:d}){const h=o(0),b=W(i,r,c),g=d??"center",w=t.map((e,n)=>{const a=o(Math.max(e.from,e.to)),r=Math.abs(o(e.from)-o(e.to)),s=null!==u&&Math.min(e.from,e.to)<u&&Math.max(e.from,e.to)>u,l="total"===e.kind&&n>0&&n===t.length-1;return{top:a,length:r,down:"down"===e.kind||"total"===e.kind&&(l?e.to>=0:e.to<0),inside:!s&&!b&&D(i[n],r,c)}}),M=i[0]?B(i[0]).height*c*.56:0;let k=Number.POSITIVE_INFINITY;for(const[n,a]of w.entries())a.inside&&(k=Math.min(k,(r-B(i[n]).width*c)/2));const x=t.length,A=(t,e,n=!1)=>`--start:${(t/x).toFixed(4)}; --span:${(e/x).toFixed(4)}; --ease:${n?m:"linear"};`;t.forEach((n,a)=>{const s=t[a+1];if(!s)return;const c=o(n.to),i=e(a)+r/2,u=e(a+1)-r/2;l.appendChild($("line",{class:"tablechart-connector",x1:i,x2:u,y1:c,y2:c,"data-row":a+2,style:`${p("--i",s.slot)}; ${A(a+1,1/3)}`}))}),t.forEach((a,o)=>{const{top:u,length:d,down:h,inside:b}=w[o];l.appendChild($("rect",{class:y(n,a),"data-kind":a.kind,"data-row":o+1,"data-grow":h?"down":"up",x:e(o)-r/2,y:u,width:r,height:Math.max(d,1),style:`${p("--i",a.slot)}; ${A(o,1,o===t.length-1)}`}));const m=i[o];m.style.setProperty("--start",(o/x).toFixed(4)),m.style.setProperty("--span",(1/x).toFixed(4));const N=Math.min(k,(d-M)/2),S="center"===g?u+d/2:"end"===g!==h?u+N+M/2:u+d-N-M/2;m.dataset.place=b?"inside":"outside",m.dataset.kind=a.kind;const H=b?S:"down"===a.kind?u+d+B(m).height*c+3*c:u-3*c;v(m,e(o),H,f,s)}),l.appendChild($("line",{class:a,x1:0,x2:f,y1:h,y2:h}))}},it={enabled:!1,log(...e){it.enabled&&console.log(`[${t}]`,...e)},timed(e,n,a){if(!it.enabled)return a();const o=performance.now(),r=a(),s=performance.now()-o,c=n.querySelectorAll("tbody tr").length;return s>50?console.warn(`[${t}] ${e} took ${s.toFixed(1)} ms for ${c} rows, more than 50 ms.`,n):it.log(`${e} took ${s.toFixed(1)} ms for ${c} rows.`,n),r}},ut=t=>{const e=(t?.textContent||"").trim(),n=e.match(/^(.*?)(-?\d+(?:[.,]\d+)?)(.*)$/);return{raw:e,number:n?.[2]??"",prefix:n?.[1]??"",suffix:n?.[3]??"",missing:!n,value:n?Number.parseFloat(n[2].replace(",",".")):0}},dt=t=>Array.from(t.querySelector("thead tr:last-child")?.children??[]).slice(1),ht=["axis-break","trend","bracket"],ft=t=>{const e=t.plan;if(!e)return;const n=e=>null===e||t.step-e>=1;for(const a of t.figure.querySelectorAll("[data-from]")){const t=Number(a.dataset.from)-1,o=Number(a.dataset.to)-1,r=a.closest("[data-series]")?.dataset.series,s=r?Number(r)-1:0,c=e.series[s],l=t=>e.cells[t]?.[s]?.step??e.rows[t]?.step??null;let i=t-1;if(c&&null!==c.step)i=n(c.step)?o:t-1;else for(;i<o&&n(l(i+1));)i++;const u=a.hasAttribute("data-flat")?(i-t+1)/(o-t+1):o>t?Math.max(0,i-t)/(o-t):0;a.style.setProperty("--reveal",String(u))}},bt=(t,e,n=!1)=>{const a=t.plan;if(!a)return;const o=Math.min(Math.max(Math.round(e),0),a.count),r=o!==t.step;t.step=o,t.figure.style.setProperty("--_step",String(o)),ft(t);const[s,c]=t.controls?.querySelectorAll("button")??[];s&&(s.disabled=0===o),c&&(c.disabled=o===a.count),r&&!n&&t.figure.dispatchEvent(new CustomEvent("tablechart:step",{bubbles:!0,detail:{step:o,steps:a.count}}))},mt="tablechart-tooltip",gt=["--tablechart-surface","--tablechart-tooltip-surface","--tablechart-tooltip-color","--tablechart-tooltip-border","--tablechart-tooltip-radius","--tablechart-tooltip-padding","--tablechart-tooltip-shadow"],pt=null,wt=null,$t=null,yt=0,Mt=()=>{clearTimeout(yt),pt&&wt&&(pt.hidden=!0,wt=null,$t=null)},vt=()=>{clearTimeout(yt),yt=window.setTimeout(Mt,120)},kt=(t,e)=>{const n=e?e.style.getPropertyValue("--step"):"x";return""===n||Number(n)<t.step},xt=(t,e)=>{const n=t.svg.querySelector(`[data-series="${e+1}"]:not(.tablechart-hole)`);if(!n)return;const a=getComputedStyle(n);return a.fill&&"none"!==a.fill?a.fill:a.stroke},At=(t,e,n)=>{const a=t.series.length>1,o=[];for(const[s,c]of t.seriesValues.entries()){if(!kt(t,c[e]))continue;const n=a?t.figure.querySelector(`.tablechart-name[data-series="${s+1}"]`):null;o.push({name:a?n?.textContent??t.series[s].name:"",value:c[e].textContent??"",colour:a?xt(t,s):void 0,sample:n?{marker:n.dataset.marker??null,open:n.hasAttribute("data-open"),line:n.dataset.line??null,box:"box"===n.dataset.swatch}:void 0})}const r=t.totals[e];return o.length>1&&kt(t,r)&&o.push({name:n.totallabel,value:r.textContent??""}),o},Nt=(t,e,n)=>{if(clearTimeout(yt),wt===t&&$t===e)return;const a=(t.type.tooltip??At)(t,e,n);if(!a.length)return Mt();wt&&wt!==t&&Mt(),pt??(pt=(()=>{const t=document.createElement("div");return t.className=mt,t.setAttribute("aria-hidden","true"),t.hidden=!0,et=document.createElement("div"),(nt=document.createElement("div")).className=`${mt}-arrow`,t.append(et,nt),document.body.append(t),t.addEventListener("pointerenter",()=>clearTimeout(yt)),t.addEventListener("pointerleave",t=>"mouse"===t.pointerType&&vt()),document.addEventListener("keydown",t=>"Escape"===t.key&&Mt()),document.addEventListener("pointerdown",e=>{const n=e.target;!wt||wt.plot.contains(n)||t.contains(n)||Mt()}),window.addEventListener("scroll",Mt,{capture:!0,passive:!0}),window.addEventListener("resize",Mt),t})());const o=(t,e,n,a=!1,o)=>{const r=document.createElement("div");if(r.className=`${mt}-line`,n){const t=document.createElement("span");t.className=`${mt}-key`,t.style.background=n,o?.box?t.dataset.sample="box":o&&(t.dataset.sample="line",o.marker&&(t.dataset.marker=o.marker),o.line&&(t.dataset.line=o.line),t.toggleAttribute("data-open",o.open)),r.append(t)}const s=document.createElement("span");if(s.className=`${mt}-${a?"title":"name"}`,s.textContent=t,r.append(s),e){t&&s.append(":");const n=document.createElement("span");n.className=`${mt}-value`,n.textContent=e,r.append(n)}return r},r=t.categories[e]?.textContent??t.rows[e].label,s=1===a.length&&!a[0].name;et.replaceChildren(o(r,s?a[0].value:"",void 0,!0),...s?[]:a.map(({name:t,value:e,colour:n,sample:a})=>o(t,e,n,!1,a)));const c=getComputedStyle(t.figure);for(const l of gt){const t=c.getPropertyValue(l).trim();t?pt.style.setProperty(l,t):pt.style.removeProperty(l)}pt.style.setProperty("--_color",c.color),pt.style.colorScheme=c.colorScheme,pt.style.fontFamily=c.fontFamily,pt.style.fontSize=c.fontSize,wt=t,$t=e,pt.hidden=!1,pt.style.left="0px",((t,e,n,a=10,o=8,r=12)=>{const{offsetWidth:s,offsetHeight:c}=t,{clientWidth:l,clientHeight:i}=document.documentElement,u=n.top-o,d=i-n.bottom-o,h=c+a<=u||!(c+a<=d)&&u>=d,f=h?n.top-a-c:n.bottom+a,b=n.left+n.width/2,m=Math.max(o,Math.min(b-s/2,l-s-o));t.style.left=`${m}px`,t.style.top=`${Math.max(o,Math.min(f,i-c-o))}px`,t.dataset.side=h?"top":"bottom",e.style.left=`${Math.max(r,Math.min(b-m,s-r))}px`})(pt,nt,((t,e)=>{if(t.type.centre&&t.values[e])return t.values[e].getBoundingClientRect();const n=t.svg.querySelectorAll(`[data-row="${e+1}"]:not(.tablechart-connector, .tablechart-leader)`);let a=null;for(const i of n){const t=i.getBoundingClientRect();(t.width||t.height)&&(a=a?new DOMRect(Math.min(a.left,t.left),Math.min(a.top,t.top),Math.max(a.right,t.right)-Math.min(a.left,t.left),Math.max(a.bottom,t.bottom)-Math.min(a.top,t.top)):t)}if(a)return a;const o=t.plot.getBoundingClientRect(),[r,s,c,l]=t.rowBox?.(e)??[0,0,100,100];return new DOMRect(o.left+o.width*r/100,o.top+o.height*s/100,o.width*c/100,o.height*l/100)})(t,e))},St=t=>{wt===t&&Mt()},Ht={area:st,bar:I,column:G,donut:J,line:rt,waterfall:lt},Tt={"axis-break":N,trend:U,bracket:L},zt=Object.keys(Tt),Ct=t=>{let e="";for(let n=t.previousSibling;n&&(e=(n.textContent??"")+e,!e.trim());n=n.previousSibling);return e.trim()},Lt=["straight","step","smooth"],Ot=(t,e)=>{const n=t.dataset.chartShape;return n&&Lt.includes(n)?n:Lt.includes(e.shape)?e.shape:"straight"},Bt=0,Ut=(n,a,o=null)=>{const r=o??(n.getAttribute("data-chart")||"column"),s=Ht[r];if(!s)return console.warn(`[${t}] Unknown chart type "${r}". Known types: ${Object.keys(Ht).join(", ")}.`),n.setAttribute("data-chart-empty",""),null;const l=((t,e="data-i18n")=>Array.from(t.querySelectorAll("tbody tr")).map((t,n)=>{const a=t.querySelector("th"),o=Array.from(t.querySelectorAll("td")).map(ut);return o.length||o.push(ut(null)),{...o[0],label:(a?.textContent||"").trim(),key:e&&a?.getAttribute(e)||null,cells:o,classes:Array.from(t.classList),isTotal:"total"===t.getAttribute("data-kind"),slot:n}}))(n,a.langattribute);if(!l.length)return console.warn(`[${t}] A chart has no rows in its table, so there is nothing to draw.`),n.setAttribute("data-chart-empty",""),null;(t=>{const e=t.querySelector(":scope > figcaption");if(!e)return;(t=>{for(const e of t.querySelectorAll("br")){if(e.previousElementSibling?.classList.contains("tablechart-sr"))continue;if(/[.!?:;,…]$/.test(Ct(e)))continue;const t=document.createElement("span");t.className=d,t.textContent=". ",e.before(t)}})(e);const n=t=>t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby"),a=t=>{e.id||(e.id="tablechart-caption-"+ ++Bt),t.setAttribute("aria-labelledby",e.id)};"FIGURE"!==t.tagName||n(t)||a(t);const o=t.querySelector("table");!o||n(o)||o.querySelector(":scope > caption")||a(o)})(n);let u=((t,e,n="data-i18n")=>{const a=dt(t),o=Math.max(1,S(e.map(t=>t.cells.length)));return Array.from({length:o},(t,e)=>{const o=a[e];return{name:(o?.textContent||"").trim(),key:n&&o?.getAttribute(n)||null,focus:"focus"===o?.getAttribute("data-kind"),marker:o?.getAttribute("data-marker")??null,line:(r=o?.getAttribute("data-line"),"dashed"===r||"dotted"===r?r:null)};var r})})(n,l,a.langattribute);u.length>1&&!s.series&&(console.warn(`[${t}] A ${r} chart uses only the first of its ${u.length} value columns.`),u=u.slice(0,1));const h=u.length>1;h&&n.style.setProperty("--_series-count",String(u.length));const f=n.hasAttribute("data-chart-stack");f&&!s.stackable&&console.warn(`[${t}] A ${r} chart cannot be stacked.`);const b=f&&!!s.stackable&&h,m=document.createElement("div");m.className="tablechart-plot",m.setAttribute("aria-hidden","true");const g=$("svg",{role:"presentation",focusable:"false"});m.appendChild(g),n.appendChild(m);const p=s.centre?l.filter(t=>!t.isTotal):l,w=Math.max(0,S(p.flatMap(t=>t.cells.slice(0,u.length).map(t=>H(t.number))))),y=u.map((t,n)=>l.map((t,a)=>{const o=t.cells[n]??t.cells[0],r=M(e,m);return r.classList.add(...t.classes),r.dataset.value=String(o.value),o.prefix&&(r.dataset.prefix=o.prefix),o.suffix&&(r.dataset.suffix=o.suffix),o.missing&&(r.dataset.missing=o.raw),h&&(r.dataset.series=String(n+1)),r.dataset.row=String(a+1),r.style.setProperty("--i",String(t.slot)),r})),v=y[0],k=b&&s.totals?l.map((t,n)=>{const a=M(e,m);a.classList.add(...t.classes),a.dataset.kind="total",a.dataset.row=String(n+1),a.dataset.value=String(P(t,u.length));const o=t.cells[0];return o.prefix&&(a.dataset.prefix=o.prefix),o.suffix&&(a.dataset.suffix=o.suffix),a.style.setProperty("--i",String(t.slot)),a}):[],x=l[l.length-1],A=u.some(t=>t.focus),N=n.getAttribute("data-chart-legend"),T=h&&(null===N?a.legend||void 0!==s.legend:"false"!==N)?document.createElement("div"):null;T&&(T.className=c,T.setAttribute("aria-hidden","true"),T.inert=!0);const z=h?u.map((t,e)=>{const o=M("tablechart-name",T??m);T&&(o.dataset.place="legend");const r=s.legend??s.swatch;if(r&&(o.dataset.swatch=r),o.textContent=t.name,!r&&"step"!==Ot(n,a)){const t=X(u,e);o.dataset.marker=t.shape,o.toggleAttribute("data-open",t.open)}return t.line&&!r&&(o.dataset.line=t.line),t.key&&a.langattribute&&o.setAttribute(a.langattribute,t.key),o.dataset.series=String(e+1),o.style.setProperty("--n",String(e)),o.style.setProperty("--palette",`var(--tablechart-color-${e+1})`),o.style.setProperty("--m",A&&!t.focus?"1":"0"),o.style.setProperty("--i",String(x.slot)),o}):[],C=s.centre?M(i,m):null;if(C){const t=l.find(t=>t.isTotal),e=t?t.value:l.reduce((t,e)=>t+Math.abs(e.value),0);C.dataset.value=String(e),t&&(C.dataset.decimals=String(H(t.number)))}const L=C&&!l.some(t=>t.isTotal)?((t,e,n)=>{const a=t.querySelector("table");if(!a)return null;const o=a.querySelector("tfoot [data-chart-total]");if(o)return o.dataset.value=e.dataset.value??"0",o;const r=(a.tFoot??a.createTFoot()).insertRow(),s=document.createElement("th");s.scope="row",s.textContent=n.totallabel;const c=t.getAttribute("data-chart-keys");c&&n.langattribute&&s.setAttribute(n.langattribute,`${c}-total`);const l=r.insertCell();return l.setAttribute("data-chart-total",""),l.dataset.value=e.dataset.value??"0",r.prepend(s),l})(n,C,a):null,O="beside"===s.categories,B=document.createElement("div");B.className="tablechart-categories",B.setAttribute("aria-hidden","true"),B.inert=!0,O?B.dataset.place="beside":s.centre&&(B.dataset.place="key"),B.style.setProperty("--_columns",String(l.length));let U=0;for(const[t,e]of l.entries()){const n=document.createElement("span");n.classList.add(...e.classes),n.textContent=e.label,e.key&&a.langattribute&&n.setAttribute(a.langattribute,e.key),s.centre&&(n.dataset.kind=e.isTotal?"total":"slice",e.isTotal||(n.dataset.slice=String(U+1),n.style.setProperty("--n",String(U)),n.style.setProperty("--palette",`var(--tablechart-color-${U+1})`),U+=1)),n.style.setProperty("--i",String(e.slot)),n.dataset.row=String(t+1),B.appendChild(n)}(O?m:n).appendChild(B),T&&n.appendChild(T);const _=a.animate?(t=>{const e=t.hasAttribute("data-fragment"),n=Array.from(t.querySelectorAll("tbody tr")),a=Array.from(t.querySelector("thead tr:last-child")?.children??[]).slice(1),o=Array.from(t.querySelectorAll("[data-annotation]")).filter(t=>ht.includes(t.getAttribute("data-annotation")??"")),r=t=>t.hasAttribute("data-fragment"),s=n.map(t=>Array.from(t.querySelectorAll(":scope > td")));if(!(e||n.some(r)||a.some(r)||s.flat().some(r)||o.some(r)))return null;const c=[],l=new Map,i=[],u=t=>{let e=null!==t?l.get(t):void 0;return void 0===e&&(e=c.length,c.push(t),i.push(0),null!==t&&l.set(t,e)),e};let d=0;const h="donut"===t.getAttribute("data-chart"),f=t=>h&&"total"===t.getAttribute("data-kind"),b=n.map(t=>{if(f(t))return{step:null,slot:0};if(!e&&!r(t))return{step:null,slot:d++};const n=u(t.getAttribute("data-fragment-index"));return{step:n,slot:i[n]++}}),m=Math.max(-1,...b.map(t=>t.step??-1));if(m>=0)for(const[$,y]of n.entries())f(y)&&(b[$]={step:m,slot:i[m]++});const g=a.map(t=>({step:r(t)?u(t.getAttribute("data-fragment-index")):null})),p=s.map(t=>t.map(()=>({step:null,slot:0}))),w=Math.max(0,...s.map(t=>t.length));for(let $=0;$<w;$++)for(const[t,e]of s.entries()){const n=e[$];if(!n||!r(n))continue;const a=u(n.getAttribute("data-fragment-index"));p[t][$]={step:a,slot:i[a]++}}return{rows:b,series:g,cells:p,notes:o.map(t=>{const e=(e,n)=>{const a=Number.parseInt(t.getAttribute(e)??"",10);return Number.isFinite(a)?a-1:n},[n,a]="bracket"===t.getAttribute("data-annotation")?[e("data-from",0),e("data-to",b.length-1)]:[0,b.length-1];let o=null;for(let r=Math.min(n,a);r<=Math.max(n,a);r++)for(const t of[b[r]?.step??null,...(p[r]??[]).map(t=>t.step)])null!==t&&(null===o||t>o)&&(o=t);const s=g[e("data-series",0)]?.step??null;null!==s&&(null===o||s>o)&&(o=s),r(t)&&(o=u(t.getAttribute("data-fragment-index")));const c=null===o?b.length:b.filter(t=>t.step===o).length;return{step:o,after:c}}),count:c.length,indexes:c}})(n):null;_&&n.setAttribute("data-steps","");const E=n.getAttribute("data-chart-keys"),F=_&&a.controls?((t,e,n)=>{const a=document.createElement("div");a.className="tablechart-controls";const o=a=>{const o=document.createElement("button");o.type="button",o.className=`tablechart-${a}`,o.dataset.go=a;const r=document.createElement("span");r.className="tablechart-control-icon",r.setAttribute("aria-hidden","true");const s=$("svg",{viewBox:"0 0 16 16",focusable:"false"});s.appendChild($("path",{d:"next"===a?"M6 3l5 5-5 5":"M10 3L5 8l5 5"})),r.appendChild(s);const c=document.createElement("span");c.className="tablechart-control-label",c.textContent=t[a];const l=e[a];l&&n&&c.setAttribute(n,l);const i=document.createElement("span");return i.className=d,i.textContent=t.hint,e.hint&&n&&i.setAttribute(n,e.hint),o.append(..."next"===a?[c,i,r]:[r,c,i]),o};return a.append(o("previous"),o("next")),a})({previous:a.previouslabel,next:a.nextlabel,hint:a.stephint},{previous:E&&`${E}-previous`,next:E&&`${E}-next`,hint:E&&`${E}-step`},a.langattribute):null;F&&n.appendChild(F);const j=n.getAttribute("data-chart-table"),q=j&&Et.includes(j)?j:a.table;if("never"===q)n.removeAttribute("data-table");else{n.setAttribute("data-table",q);const t=n.querySelector(":scope > table");t&&n.append(t)}const R=Array.from(n.querySelectorAll("[data-annotation]")).map(e=>{const n=e.getAttribute("data-annotation"),a=Tt[n];if(!a)return console.warn(`[${t}] Unknown annotation "${n}". Known annotations: ${Object.keys(Tt).join(", ")}.`),null;const o=Number.parseInt(e.getAttribute("data-series")??"1",10),r=o>=1&&o<=u.length?o-1:0;return o!==r+1&&console.warn(`[${t}] An annotation reads line ${o}, which is not there; it reads line 1.`),{spec:e,type:a,badge:a.create(e,m),series:r,after:l.length}}).filter(t=>null!==t);a.animate&&n.setAttribute("data-animate",jt(n,r,a,Boolean(_)));const W={figure:n,plot:m,svg:g,rows:l,decimals:w,type:s,values:v,series:u,seriesValues:y,names:T?[]:z,categories:Array.from(B.children),centre:C,stacked:b,totals:k,totalCell:L,rowAt:null,rowBox:null,annotations:R,checks:[],plan:_,step:0,controls:F};F?.addEventListener("click",t=>{const e=t.target.closest("button")?.dataset.go;e&&bt(W,W.step+("next"===e?1:-1))}),bt(W,0,!0);const D=n.getAttribute("data-chart-tooltip")??n.getAttribute("data-chart-hover"),V="false"!==D&&("auto"===D?"auto":null!==D||!1!==a.hover&&a.tooltip);return V&&((t,e,n=!1)=>{const{plot:a}=t;a.setAttribute("data-hover","");const o=new Set,r=t=>{for(const e of o)if(e.isConnected){if(e.getAttribute("data-row")===String(t+1))return!0}else o.delete(e);return!1};let s=null;const c=o=>{if(!a.classList.contains("is-placed")||!t.figure.classList.contains("is-shown"))return;if(n&&!t.figure.hasAttribute("data-left-out"))return wt===t?Mt():void 0;const c=(e=>{if(t.rowAt){const n=a.getBoundingClientRect(),o=n.width/a.offsetWidth||1;return t.rowAt((e.clientX-n.left)/o,(e.clientY-n.top)/o)}const n=e.target.closest?.("[data-row]")?.getAttribute("data-row");return n?Number(n)-1:null})(o);if(s=c,null===c||r(c))return wt===t?vt():void 0;Nt(t,c,e)},l=e=>{const n=e.target;return t.svg.contains(n)&&n.hasAttribute("data-row")?n:null};t.svg.addEventListener("transitionrun",t=>{const e=l(t);e&&o.add(e)});const i=n=>{const a=l(n);if(!a)return;o.delete(a);const c=Number(a.getAttribute("data-row"))-1;s!==c||r(c)||Nt(t,c,e)};t.svg.addEventListener("transitionend",i),t.svg.addEventListener("transitioncancel",i),a.addEventListener("pointermove",c),a.addEventListener("pointerdown",c),a.addEventListener("pointerleave",e=>{"mouse"===e.pointerType&&(s=null,wt===t&&vt())})})(W,a,"auto"===V),Wt(W,a),W},_t={grow:"grow",sweep:"sweep"},Et=["never","auto","print","always"],Ft={..._t,up:"grow",across:"sweep"},jt=(t,e,n,a)=>{const o="line"===e||"area"===e,r=o?Ft:_t,s=r[t.getAttribute("data-chart-animate")??""]??r[String(n.animate)];return o?a?"sweep":s??"sweep":"donut"===e||"waterfall"===e?s??"grow":"grow"},Pt=t=>{const e=getComputedStyle(t),n=(e.getPropertyValue("--tablechart-value-align")||e.getPropertyValue("--tablechart-inside-align")).trim();return"start"===n||"center"===n||"end"===n?n:null},qt=(t,e,n,a)=>{const o=getComputedStyle(t),r=(o.getPropertyValue(n).trim()||a).match(/^(\d+(?:\.\d+)?)(px|%|em|rem)$/);if(!r)return null;const s=Number(r[1]);return"%"===r[2]?s/100*f:s*("em"===r[2]?Number.parseFloat(o.fontSize):"rem"===r[2]?Number.parseFloat(getComputedStyle(document.documentElement).fontSize):1)*e},Rt=(t,e)=>qt(t,e,"--tablechart-bar-max","60px")??Number.POSITIVE_INFINITY,Wt=(t,e)=>{const n=[...t.seriesValues.flat(),...t.totals,...t.totalCell?[t.totalCell]:[]];for(const a of t.centre?[...n,t.centre]:n){const{missing:n,prefix:o="",suffix:r=""}=a.dataset;if(void 0!==n){a.textContent=n;continue}const s=Number.parseFloat(a.dataset.value||"0"),c=a.dataset.decimals?Number(a.dataset.decimals):t.decimals,[l,i]=T(s,c,e.locale);if(a.textContent=o+(o?l:"")+i+r,l&&!o){const t=document.createElement("span");t.className="tablechart-minus",t.textContent=l,a.prepend(t)}}},Dt=(t,e)=>{t.figure.classList.toggle("is-shown",e)},Vt=t=>"id"===t||"style"===t||t.startsWith("data-chart"),Kt=/^\s*(?:Table)?:\s+/,It=t=>"P"===t?.tagName&&Kt.test(t.textContent??""),Gt=/^\s*([a-z][\w-]*)((?:\s+[\w-]+=[^\s:]+)*)\s*(:\s*|$)/,Zt=t=>{const e=Qt(t);return"P"===e?.tagName?e:t},Jt=t=>{if(!t||"object"!=typeof t)return;const e=Object.entries(t),n=t=>null===t||"string"==typeof t||"number"==typeof t;return e.length&&e.every(([,t])=>n(t)||Array.isArray(t)&&t.every(n))?e.map(([t,e])=>Array.isArray(e)?{label:t,values:e}:{label:t,value:e}):void 0},Qt=t=>{const e=Array.from(t.childNodes).filter(t=>t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&t.textContent?.trim());return 1===e.length&&e[0]instanceof HTMLElement?e[0]:null},Xt="strong, b, span.total",Yt="data-chart-made",te=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,ee=new Set,ne=null,ae=["column","bar"],oe=t=>{const e=t.getAttribute("data-chart")||"column";if(!ae.includes(e))return null;const n=getComputedStyle(t).getPropertyValue("--tablechart-type").trim();return ae.includes(n)?n:e},re=async(e,n)=>{const a=(t=>t.map(t=>{const e=t.closest("p"),n=It(e)?e:t;if("TABLE"!==n.tagName&&"P"!==n.tagName)return n;const a=document.createElement("div");((t,e)=>{for(const{name:n,value:a}of Array.from(t.attributes))("class"===n||Vt(n))&&(e.setAttribute(n,a),t.removeAttribute(n))})(t,a),t.classList.length||t.removeAttribute("class");const o="TABLE"===n.tagName?n:null,r=n.previousElementSibling;let s=n.nextElementSibling;const c=o?It(r)?r:It(s)?s:null:n;o&&c===s&&(s=s?.nextElementSibling??null);const l=s?.classList.contains("chart-annotations")?s:(t=>{if("UL"!==t?.tagName&&"OL"!==t?.tagName)return null;const e=Array.from(t.children),n=e.map(t=>t.hasAttribute("data-annotation")?null:(t=>{const e=Zt(t).firstChild;if(e?.nodeType!==Node.TEXT_NODE)return null;const n=Gt.exec(e.textContent??"");if(!n||!zt.includes(n[1]))return null;if(!n[3]&&e.nextSibling)return null;const a=n[2].trim().split(/\s+/).filter(Boolean).map(t=>t.split("="));return{name:n[1],options:a,text:e,length:n[0].length}})(t));return!e.length||e.some((t,e)=>!n[e]&&!t.hasAttribute("data-annotation"))?null:(e.forEach((t,e)=>{const a=n[e],o=Zt(t);if(o!==t&&o.replaceWith(...o.childNodes),a){t.setAttribute("data-annotation",a.name);for(const[e,n]of a.options)t.setAttribute(`data-${e}`,n);a.text.textContent=(a.text.textContent??"").slice(a.length)}t.children.length&&Array.from(t.childNodes).filter(t=>t.nodeType===Node.ELEMENT_NODE||t.textContent?.trim()).forEach((t,e)=>{const n=document.createElement("span");0===e&&t instanceof HTMLElement&&t.matches("em, i")?(n.className="tablechart-caption",n.append(...t.childNodes),t.replaceWith(n)):t.nodeType===Node.TEXT_NODE&&(n.textContent=(t.textContent??"").trim(),t.replaceWith(n))})}),t.classList.add("chart-annotations"),t)})(s);return n.replaceWith(a),c&&a.append((t=>{const e=document.createElement("figcaption");for(const{name:r,value:s}of Array.from(t.attributes))e.setAttribute(r,s);const n=t.firstChild;n?.nodeType===Node.TEXT_NODE&&(n.textContent=(n.textContent??"").replace(Kt,""),n.textContent||n.remove());const a=Array.from(t.childNodes),o=a.findIndex(t=>"BR"===t.nodeName);if(e.append(...-1===o?a:a.slice(0,o+1)),-1!==o&&o<a.length-1){const t=document.createElement("span");t.append(...a.slice(o+1)),e.append(t)}return t.remove(),e})(c)),o&&a.append(o),l&&a.append(l),it?.log?.(`A ${o?"table":"caption"} with chart attributes was wrapped in a figure of its own`),a}))(e.filter(t=>!t.hasAttribute(Yt)));return await(async e=>{await Promise.all(e.filter(t=>t.hasAttribute("data-chart-src")).map(async e=>{const n=e.getAttribute("data-chart-src"),a=Array.from(e.querySelectorAll("table")).find(t=>t.tHead)??null;for(const t of e.querySelectorAll("table"))t!==a&&t.remove();try{const t=await fetch(n);if(!t.ok)throw new Error(`${t.status} ${t.statusText}`);const o=await t.json(),r=Array.isArray(o)?o:o?.rows?Array.isArray(o.rows)?o.rows:Jt(o.rows):Jt(o);if(!Array.isArray(r))throw new Error("no rows in it: a list of rows, an object with rows, or names with their values");const s=((t,e,n,a=document.createElement("table"))=>{for(const r of a.querySelectorAll(":scope > tbody, :scope > tfoot, :scope > tr"))r.remove();if(!a.tHead&&(e.length||n)){const t=a.createTHead().insertRow(),o=document.createElement("th");o.textContent=n,t.append(o);for(const n of e){const e=document.createElement("th");e.textContent=n,t.append(e)}}const o=document.createElement("tbody");a.append(o);for(const r of t){const t=o.insertRow();"total"===r.kind&&(t.dataset.kind="total");const e=document.createElement("th");e.textContent=String(r.label??""),t.append(e);for(const n of r.values??[r.value??null])t.insertCell().textContent=null===n?"":String(n)}return a})(r,Array.isArray(o?.series)?o.series.map(String):[],"string"==typeof o?.label?o.label:"",a??void 0);if(!a){const t=e.querySelector(":scope > figcaption");t?t.after(s):e.prepend(s)}s.tHead||it?.log?.(`The table from "${n}" has no header row, so a screen reader cannot name its columns.`),it?.log?.(`Read ${r.length} rows from "${n}"`)}catch(o){const e="file:"===window.location.protocol;console.warn(`[${t}] Could not read the chart data in "${n}": ${o.message}.`+(e?" A page opened as a file cannot fetch files; open it from a server.":""))}}))})(a),(t=>{for(const e of t){for(const n of e.querySelectorAll("tbody tr")){const t=n.cells[0];if("TD"!==t?.tagName||n.cells.length<2)continue;const e=document.createElement("th");for(const{name:n,value:a}of Array.from(t.attributes))e.setAttribute(n,a);e.append(...t.childNodes),t.replaceWith(e);for(let a=Qt(e);a?.matches(Xt);a=Qt(e))n.dataset.kind="total",a.replaceWith(...a.childNodes)}const t=Array.from(e.querySelector("thead tr:last-child")?.children??[]);for(const e of t.slice(1))for(let t=Qt(e);t?.matches(Xt);t=Qt(e))e.setAttribute("data-kind","focus"),t.replaceWith(...t.childNodes)}})(a),((e,n)=>{if(!n)return;const a=new Map;for(const o of e){let e=o.getAttribute("data-chart-keys")||null;if(!e)continue;if(a.has(e)){const n=a.get(e)+1;a.set(e,n),console.warn(`[${t}] Two charts have data-chart-keys="${e}", so this one uses "${e}-${n}" to keep their translations apart.`),e=`${e}-${n}`}else a.set(e,1);o.querySelectorAll("tbody th").forEach((t,a)=>{t.getAttribute(n)||t.setAttribute(n,`${e}-row${a+1}`)});const r=dt(o);r.length>1&&r.forEach((t,a)=>{t.getAttribute(n)||t.setAttribute(n,`${e}-col${a+1}`)}),it?.log?.(`Keys for "${e}" written onto ${o.querySelectorAll("tbody th").length} rows`)}})(a,n.langattribute),a},se=(e,a)=>{const o=it.timed("Building",e,()=>Ut(e,a));return o?(e.setAttribute(Yt,""),((e,a)=>{let o=e,r=oe(o.figure),u=null,d=!1,b=!1;const m=async()=>{if(!a.animate)return Dt(o,!0);const t=o.figure.classList.contains("is-shown");if(!d||null===u||t||b)!d&&a.replay&&t&&Dt(o,!1);else{b=!0;const t=te()?null:(t=>{for(let e=t;e&&e!==document.body;e=e.parentElement)if("0"===getComputedStyle(e).opacity)return e;return null})(o.figure);t&&await(e=t,new Promise(t=>{const n=["animationstart","transitionrun"],a=()=>{for(const t of n)document.removeEventListener(t,o,!0);r.disconnect(),t()},o=t=>{t.target instanceof Node&&t.target.contains(e)&&a()},r=new MutationObserver(()=>{"0"!==getComputedStyle(e).opacity&&a()});for(const e of n)document.addEventListener(e,o,!0);r.observe(e,{attributes:!0,attributeFilter:["class","style"]})})),await(async(t,e)=>{if(te())return;await new Promise(requestAnimationFrame);const n=t.getAnimations().filter(t=>t instanceof CSSAnimation);for(let r=t.parentElement;r&&r!==document.body;r=r.parentElement)n.push(...r.getAnimations());let a=0;for(const r of n){const t=r.effect?.getComputedTiming(),n=Number(t?.activeDuration??0);if(!t||!Number.isFinite(n))continue;const o=Number(t.delay??0)+n*e;a=Math.max(a,o-Number(r.currentTime??0))}var o;a>0&&await(o=a,new Promise(t=>setTimeout(t,o)))})(o.figure,((t,e)=>{const n=Number.parseFloat(t.dataset.chartEntrance??""),a=Number.isFinite(n)?n:e.entrance;return Math.min(Math.max(a,0),1)})(o.figure,a)),b=!1,!d&&a.replay||Dt(o,!0)}var e},p=()=>{const t=oe(o.figure);if(!t||t===r)return;const e=it.timed("Building",o.figure,()=>Ut(o.figure,a,t));e&&((t=>{St(t),t.plot.remove(),t.categories[0]?.parentElement?.remove(),t.figure.querySelector(`:scope > .${c}`)?.remove(),t.controls?.remove()})(o),bt(e,o.step,!0),o=e,r=t,u=null)},y=()=>{p();const e=o.plot.clientWidth;e&&e!==u&&it.timed("Layout",o.figure,()=>((e,a)=>{const{plot:o,svg:r,rows:c,type:u,values:d,series:h,seriesValues:b,names:m,annotations:p}=e,y=o.clientWidth;if(!y)return!1;const M=f/y,v=Number.parseFloat(e.figure.dataset.chartAspect??""),k=f*(v>0?v:u.aspect??a.aspect);o.classList.add("is-placed");for(const t of[...b.flat(),...e.totals])delete t.dataset.place;o.style.removeProperty("--_fit"),e.categories[0]?.parentElement?.style.removeProperty("--_beside"),(t=>{const e=[...t].filter(t=>!!t),n=e.map(t=>({width:t.offsetWidth,height:t.offsetHeight}));e.forEach((t,e)=>O.set(t,n[e]))})([...b.flat(),...e.totals,...m,...e.categories,...p.map(t=>t.badge)]);const A=(d[0]?B(d[0]).height:0)*M,N=p[0]?.badge?B(p[0].badge).height*M:0,H=Math.max(k,qt(e.figure,M,"--tablechart-min-height","200px")??0,u.minHeight?.({labelHeight:A,nameHeight:Math.max(0,S(e.categories.map(t=>B(t).height)))*M,unit:M,rows:c.length,series:h.length,stacked:e.stacked})??0),T=e.stacked?c.map(t=>{const e=P(t,h.length);return{...t,value:e,cells:t.cells.map((t,n)=>0===n?{...t,value:e}:t)}}):c,z=(u.segments??(t=>t.map(t=>({...t,from:0,to:t.value,kind:"bar"}))))(e.stacked?T.map(t=>({...t,cells:[t.cells[0]]})):c),C={labelHeight:A,badgeHeight:N,hasAnnotations:p.length>0,unit:M,series:h.length,focused:h.some(t=>t.focus),stacked:e.stacked},L=Math.max((U=S,e.stacked?U(c.map(t=>j(t,h.length,u.running).top)):U([...z.flatMap(t=>[t.from,t.to,t.value]),...c.flatMap(t=>t.cells.slice(0,h.length).map(t=>t.value))])),0);var U;const _=z.some(t=>"up"===t.kind||"down"===t.kind)?z.flatMap(t=>[t.from,t.to]):e.stacked?c.map(t=>j(t,h.length,u.running).bottom):c.flatMap(t=>t.cells.slice(0,h.length).map(t=>t.value)),E=Math.min(-S(_.map(t=>-t)),0),F=u.headroom?.(C)??A,q=2*M+(u.footroom?.(C)??0)+(E<0?A+4*M:0),R=H-F-q,W=1.02*L,D=1.02*E,V=p.find(t=>"axis-break"===t.spec.getAttribute("data-annotation"))?.spec,I=t=>{const e=Number.parseFloat(V?.getAttribute(t)??"");return Number.isFinite(e)?e:null},G=I("data-from")??I("data-at"),Z=I("data-to");let J=null;if(V&&(null!==G||null!==Z)){const e=G??0,n=Z??W,a=null===Z?e:null===G?n:(e+n)/2,o=V.getAttribute("data-size"),r=o?.match(/^\s*(\d+(?:\.\d+)?)\s*%\s*$/);null===o||r||console.warn(`[${t}] data-size="${o}" is not a percentage, such as 30%. Using the default.`);const s=Math.min(Math.max(r?Number(r[1])/100:null===Z?.22:.3,.05),.8),c=z.filter(t=>("up"===t.kind||"down"===t.kind)&&Math.max(t.from,t.to)>e&&Math.min(t.from,t.to)<n);u.breakable?E<0?console.warn(`[${t}] A chart with values below zero cannot break its scale.`):e<0||n<=e||n>W||0===e&&n===W?console.warn(`[${t}] A break from ${e} to ${n} does not fit a scale that runs from 0 to ${L}.`):c.length?console.warn(`[${t}] A break from ${e} to ${n} would cut a step that floats. Keep it below or above the steps.`):J={lo:e,hi:n,gap:a,share:s}:console.warn(`[${t}] This kind of chart cannot break its scale.`)}const Q=J?J.gap:null,X=(J&&qt(e.figure,M,"--tablechart-break-gap",""))??13,Y=H-q,tt=W-D||1;let et=t=>Y-(t-D)/tt*R;if(J){const{lo:t,hi:e,gap:n,share:a}=J,o=R*a,r=(R-o-X)/(t+(W-e)),s=o/(e-t);et=a=>a<=t?Y-a*r:a<=n?Y-t*r-(a-t)*s:a<=e?Y-t*r-(a-t)*s-X:Y-t*r-o-X-(a-e)*r}const nt=m.length?S(m.map(t=>B(t).width))*M+12*M:0,at=e.categories[0]?.parentElement;at&&(at.style.paddingRight=nt?nt/f*100+"%":"");const ot=(f-nt)/c.length,rt=t=>t>=0&&t<c.length?t:null;e.rowAt=u.centre?null:"beside"===u.categories?(t,e)=>rt(Math.floor(e*M/(H/c.length))):t=>rt(Math.floor(t*M/ot));const st=ot/f*100,ct=100/c.length;e.rowBox="beside"===u.categories?t=>[0,t*ct,100,ct]:t=>[t*st,0,st,100],r.setAttribute("viewBox",`0 0 1000 ${w(H)}`),r.textContent="",e.checks=[];const lt={rows:c,segments:z,cx:t=>(t+.5)*ot,y:et,barWidth:Math.min(ot*a.barfill,Rt(e.figure,M)),barMax:Rt(e.figure,M),height:H,unit:M,labelHeight:A,badgeHeight:N,after:c.length,note:0,labels:"inside"===e.figure.dataset.chartLabels||"outside"!==e.figure.dataset.chartLabels&&"inside"===a.labels?"inside":"outside",insideAlign:Pt(e.figure),breakAt:Q,squeeze:J,breakGap:X,stacked:e.stacked,shape:Ot(e.figure,a),totals:e.totals,svg:r,plot:o,values:d,series:h,seriesValues:b,names:m,categories:e.categories,centre:e.centre,config:a,checks:e.checks};o.style.setProperty("--count",String(Math.max(1,...c.map(t=>t.slot+1)))),u.draw(lt);for(const[t,n]of p.entries()){n.badge?.setAttribute("data-note",String(t+1));const a=n.series,o=t=>({...t,...t.cells[a]??t.cells[0]});n.type.draw(n.spec,n.badge,{...lt,...e.stacked&&{rows:T,...e.totals.length&&{values:e.totals}},...a>0&&!e.stacked&&{rows:c.map(o),segments:z.map(t=>{const e=o(t);return"bar"===t.kind?{...e,to:e.value}:e}),values:b[a]},after:n.after,note:t+1})}(t=>{const e=t.plan;if(!e)return;const a=e.rows.length-1,o=t=>e.series.map((n,a)=>e.cells[t]?.[a]?.step??n.step??e.rows[t]?.step??null),r=t=>{const e=o(t);return e.some(t=>null===t)?null:Math.min(...e)},c=new Set(t.totals),l=(t,e,n,a)=>{t.style.setProperty(n,String(a)),t.style.removeProperty("--d"),null===e?t.style.removeProperty("--step"):t.style.setProperty("--step",String(e))};for(const n of t.figure.querySelectorAll("[data-row], [data-series], [data-note]")){if(n.closest("table, .tablechart-controls")||n.hasAttribute("data-from"))continue;const t=Number(n.dataset.note);if(t>0){const a=e.notes[t-1];a&&l(n,a.step,"--after",a.after);continue}const s=n.dataset.row?Number(n.dataset.row)-1:a;if(n.classList.contains("tablechart-connector")){const t=e.rows[s-1],a=e.rows[s];if(t&&a){const e=(t.step??-1)>(a.step??-1);l(n,e?t.step:a.step,"--i",e?t.slot+1:a.slot)}continue}if(c.has(n)){const t=o(s).filter(t=>null!==t);l(n,t.length?Math.max(...t):null,"--i",e.rows[s]?.slot??0);continue}if(n.hasAttribute("data-stack")){l(n,r(s),"--i",e.rows[s]?.slot??0);continue}const i=n.dataset.series?Number(n.dataset.series)-1:0,u=n.dataset.series?e.series[i]:void 0;if(n.classList.contains("tablechart-piece")){const t=o(s)[i]??null,a=e.cells[s]?.[i];l(n,t===r(s)?null:t,"--i",a&&null!==a.step?a.slot:s);continue}if("legend"===n.dataset.place){const t=Math.min(...e.cells.map(t=>t[i]?.step??Number.POSITIVE_INFINITY));l(n,u?.step??(Number.isFinite(t)?t:null),"--i",0);continue}const d=e.cells[s]?.[i];d&&null!==d.step?l(n,d.step,"--i",d.slot):u&&null!==u.step?l(n,u.step,"--i",s):e.rows[s]&&l(n,e.rows[s].step,"--i",e.rows[s].slot)}const u=t.figure.querySelector(`.${i}`);if(u){const t=[...e.rows,...e.cells.flat()].map(t=>t.step??-1),n=Math.max(-1,...t);n<0?l(u,null,"--i",0):l(u,n,"--i",t.filter(t=>t===n).length)}const d=[...e.rows,...e.cells.flat()].map(t=>t.slot+1),h=e.series.some(t=>null!==t.step)?e.rows.length:1;t.plot.style.setProperty("--count",String(Math.max(h,...d)));const f=t.figure.querySelectorAll(`.${n}`),b=f[f.length-1];if("waterfall"===t.figure.dataset.chart&&"total"===b?.dataset.kind&&f.length>1){const t=Number(b.dataset.row)-1;(e.rows[t-1]?.step??-1)>(e.rows[t]?.step??-1)&&(b.dataset.grow="down"===b.dataset.grow?"up":"down")}const m=Array.from(t.figure.querySelectorAll(`.${s}`));if(m.length){const e=t=>t.style.getPropertyValue("--step")||"none",n=t=>Number(t.style.getPropertyValue("--share")||0),a=m.length,o=Math.max(0,m.findIndex((t,n)=>e(t)!==e(m[(n-1+a)%a]))),r=[];for(let t=0;t<a;t++){const n=m[(o+t)%a],s=r[r.length-1];s&&e(s[0])===e(n)?s.push(n):r.push([n])}const s=new Map;for(const t of r){const e=t.reduce((t,e)=>t+n(e),0);let a=0;for(const o of t)s.set(o.dataset.row??"",g(a,n(o),e)),a+=n(o)}for(const c of t.figure.querySelectorAll("[data-row]")){const t=s.get(c.dataset.row??"");t&&c.style.getPropertyValue("--start")&&(c.style.setProperty("--start",t.start.toFixed(4)),c.style.setProperty("--span",t.span.toFixed(4)),c.classList.contains("tablechart-slice")&&c.style.setProperty("--ease",t.easing))}}ft(t)})(e);const it=e.categories[0]?.parentElement;it&&"beside"!==u.categories&&!u.centre&&K(it,e.categories.filter(t=>null!==t.offsetParent),t=>({size:t.scrollWidth,room:t.clientWidth}),"--_name-fit");const ut=p.flatMap(({badge:t})=>{if(!(t instanceof HTMLElement&&t.offsetWidth))return[];const e=t.offsetWidth*M,n=t.offsetHeight*M,a=Number.parseFloat(t.style.left)/100*f,o=Number.parseFloat(t.style.top)/100*H,r=getComputedStyle(t).borderTopLeftRadius,s=r.endsWith("%")?Number.parseFloat(r)/100:null,c=(Number.parseFloat(r)||0)*M;return[$("rect",{class:l,"data-for":"badge","data-note":t.dataset.note??"",x:a-e/2,y:o-n/2,width:e,height:n,rx:null===s?c:e*s,ry:null===s?c:n*s,style:["--after","--step"].map(e=>t.style.getPropertyValue(e)&&`${e}:${t.style.getPropertyValue(e)}`).filter(Boolean).join("; ")})]});x(r,ut,f,H);const dt=t=>"none"!==t.dataset.place&&!t.hasAttribute("data-left-out");return e.figure.toggleAttribute("data-left-out",[...b,e.totals].some(t=>t.some(e=>!(t=>void 0!==t.dataset.missing||u.centre&&c[Number(t.dataset.row)-1]?.isTotal)(e)&&!dt(e)&&!((t,e)=>{const n=Number(t.dataset.row);return e.some(t=>dt(t)&&Number(t.dataset.row)<=n&&n<=Number(t.dataset.rowEnd??t.dataset.row))})(e,t)))),!0})(o,a))&&(u=e,m())};let M=!1;const v=new ResizeObserver(()=>{M||(M=!0,requestAnimationFrame(()=>{M=!1,y()}))}),k=new IntersectionObserver(t=>{for(const e of t)d=e.isIntersecting,m()},{threshold:a.threshold}),A=()=>{o.figure.classList.add(h),Dt(o,!0),o.figure.offsetWidth},N=()=>o.figure.classList.remove(h),H=()=>{u=null,y()},T={relabel:()=>Wt(o,a),refresh:H};p(),y(),v.observe(o.figure),k.observe(o.figure),window.addEventListener("beforeprint",A),window.addEventListener("afterprint",N),(t=>{ee.add(t),ne||(ne=new MutationObserver(()=>{for(const t of ee)t.relabel();requestAnimationFrame(()=>requestAnimationFrame(()=>{for(const t of ee)t.refresh()}))})).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]})})(T);const z={figure:o.figure,refresh:H,next:()=>bt(o,o.step+1),previous:()=>bt(o,o.step-1),stepTo:t=>bt(o,t),get step(){return o.step},get steps(){return o.plan?.count??0},destroy(){v.disconnect(),k.disconnect(),window.removeEventListener("beforeprint",A),window.removeEventListener("afterprint",N),(t=>{ee.delete(t),!ee.size&&ne&&(ne.disconnect(),ne=null)})(T),St(o),o.figure.tablechart===z&&delete o.figure.tablechart}};return o.figure.tablechart=z,z})(o,a)):null},ce=[["--tablechart-duration","--tablechart-animation-element-duration"],["--tablechart-stagger","--tablechart-animation-stagger, a share of the element time"],["--tablechart-easing","--tablechart-animation-ease"],["--tablechart-category-size","--tablechart-name-size"],["--tablechart-category-padding","--tablechart-name-padding"],["--tablechart-categories-gap","--tablechart-name-gap"],["--tablechart-inside-align","--tablechart-value-align"],["--tablechart-bar-ink","--tablechart-bar-value-color"],["--tablechart-piece-ink","--tablechart-piece-value-color"],["--tablechart-up-ink","--tablechart-up-value-color"],["--tablechart-down-ink","--tablechart-down-value-color"],["--tablechart-total-ink","--tablechart-total-value-color"],["--tablechart-series-ink","--tablechart-series-own-color"],["--tablechart-dash","--tablechart-series-dash"],["--tablechart-dot","--tablechart-series-dot"],["--tablechart-muted-share","--tablechart-series-muted-share"],["--tablechart-rule-color","--tablechart-baseline-color"],["--tablechart-rule-width","--tablechart-baseline-width"],["--tablechart-rule-opacity","--tablechart-baseline-opacity"],["--tablechart-key-size","--tablechart-legend-key-size"],["--tablechart-controls-justify","--tablechart-control-justify"],["--tablechart-controls-gap","--tablechart-control-gap"]],le={up:"grow",across:"sweep"},ie=!1;window.Tablechart={init:async(e={},n=document)=>{const a={...b,...e};a.debug&&(it.enabled=!0);const o=await re(Array.from(n.querySelectorAll(a.selector)),a);((e,n)=>{if(ie)return;const a=t=>{const e=le[String(t)];return e?[`"${t}" is now "${e}"`]:[]},o=new Set(a(n.animate));void 0!==n.hover&&o.add('the "hover" option is now "tooltip"');for(const t of e){t.hasAttribute("data-chart-hover")&&o.add("data-chart-hover is now data-chart-tooltip");const e=getComputedStyle(t);for(const[t,n]of ce)e.getPropertyValue(t).trim()&&o.add(`${t} is now ${n}`);for(const n of a(t.getAttribute("data-chart-animate")))o.add(n)}o.size&&(ie=!0,console.warn(`[${t}] ${[...o].join("; ")}. The old names work until the next minor version.`))})(o,a);const r=o.map(t=>se(t,a)).filter(t=>null!==t);return it.log(`Made ${r.length} chart(s).`),{charts:r,refresh:()=>{for(const t of r)t.refresh()},destroy:()=>{for(const t of r)t.destroy()}}},create:async(t,e={})=>{if(t.tablechart)return t.tablechart;const n={...b,...e};n.debug&&(it.enabled=!0);const[a]=await re([t],n);return a?se(a,n):null},defaultConfig:b}}();
|
|
1
|
+
!function(){var t="tablechart",e="tablechart-value",n="tablechart-bar",a="tablechart-rule",o="tablechart-line",r="tablechart-head",s="tablechart-slice",c="tablechart-legend",l="tablechart-hole",i="tablechart-centre",u="tablechart-break",d="tablechart-sr",h="is-printing",f=1e3,b={selector:"[data-chart]",aspect:.38,barfill:.58,ringfill:.42,animate:!0,entrance:.5,labels:"outside",shape:"straight",legend:!1,tooltip:"auto",tooltipparent:null,table:"never",totallabel:"Total",controls:!0,previouslabel:"Previous",nextlabel:"Next",stephint:"step of the chart",threshold:.5,replay:!1,langattribute:"data-i18n"},m="cubic-bezier(0.3, 0.3, 0.6, 1)",p=(t,e,n=1)=>({start:t,span:e,easing:t+e>=n-1e-4?m:"linear"}),g=(t,e)=>`${t}:${e}`,w=t=>Math.round(100*t)/100,$=(t,e={})=>{const n=document.createElementNS("http://www.w3.org/2000/svg",t);for(const a in e){const t=e[a];n.setAttribute(a,String("number"==typeof t?w(t):t))}return n},y=(t,e)=>[t,...e.classes].join(" "),M=(t,e)=>{const n=document.createElement("span");return n.className=t,n.inert=!0,e.appendChild(n),n},v=(t,e,n,a,o)=>{t.style.left=e/a*100+"%",t.style.top=n/o*100+"%"},k=0,x=(t,e,n,a)=>{if(!e.length)return;const o="tablechart-cut-"+ ++k,r=$("mask",{id:o,maskUnits:"userSpaceOnUse"});r.appendChild($("rect",{x:-n,y:-a,width:3*n,height:3*a,fill:"white"}));for(const l of e)l.setAttribute("fill","black"),r.appendChild(l);let s=t.querySelector(":scope > defs");s||(s=$("defs"),t.prepend(s)),s.appendChild(r);const c=$("g",{mask:`url(#${o})`});for(const l of Array.from(t.childNodes))l!==s&&c.appendChild(l);t.appendChild(c)},N=0,A={create:()=>null,draw(t,e,a){const{rows:o,y:r,svg:s,breakAt:c}=a;if(null===c)return;const l="zigzag"===t.getAttribute("data-mark"),i=(t,e)=>{const n=t.sideways?t.height:t.width,a=.09*n,o=n+2*a,r=.3*o,s=.06*o;if(t.sideways){const n=t.y-a;if(!l)return[[e-r/2,n],[e+r/2,n+o]];const c=o/3;return[[e-s,n],[e+s,n+c],[e-s,n+2*c],[e+s,n+o]]}const c=t.x-a;if(!l)return[[c,e+r/2],[c+o,e-r/2]];const i=o/3;return[[c,e+s],[c+i,e-s],[c+2*i,e+s],[c+o,e-s]]},d=(t,e=!1)=>t.map(([t,e],n)=>`${0===n?"M":"L"} ${t.toFixed(1)} ${e.toFixed(1)}`).join(" ")+(e?" Z":""),h="tablechart-break-"+ ++N,f=$("mask",{id:h,maskUnits:"userSpaceOnUse"});f.appendChild($("rect",{x:-1e3,y:-a.height,width:3e3,height:3*a.height,fill:"white"}));const b=[],m=r(c);for(const M of(t=>Array.from(t.querySelectorAll(`.${n}`)).map(t=>{const e="rect"===t.tagName?[t]:Array.from(t.querySelectorAll("rect")),n=(t,e)=>Number(t.getAttribute(e)),a=Math.min(...e.map(t=>n(t,"x"))),o=Math.min(...e.map(t=>n(t,"y"))),r=Math.max(...e.map(t=>n(t,"x")+n(t,"width"))),s=Math.max(...e.map(t=>n(t,"y")+n(t,"height"))),c=["--start","--span"].map(e=>t.style.getPropertyValue(e)&&`${e}:${t.style.getPropertyValue(e)}`).filter(Boolean).join("; ");return{row:Number(t.dataset.row),x:a,y:o,width:r-a,height:s-o,sideways:"right"===t.dataset.grow,part:c}}))(s)){const t=M.sideways?a.breakX:m;if(void 0===t)continue;if(!(M.sideways?M.x<t&&M.x+M.width>t:M.y<m&&M.y+M.height>m))continue;const[e,n]=M.sideways?[i(M,t),i(M,t+a.breakGap)]:[i(M,m-a.breakGap),i(M,m)];f.appendChild($("path",{d:d([...e,...n.slice().reverse()],!0),fill:"black"})),b.push(e,n);const r=[g("--after",o[M.row-1]?.slot??0),M.part].filter(Boolean).join("; ");for(const o of[e,n])s.appendChild($("path",{class:u,"data-part":"edge","data-note":a.note,d:d(o),style:r}))}if(!b.length)return;const p=Array.from(s.querySelectorAll(`.${u}`)),w=$("g",{mask:`url(#${h})`});for(const n of Array.from(s.childNodes))p.includes(n)||w.appendChild(n);const y=$("defs");y.appendChild(f),s.prepend(y,w)}},S=t=>{let e=Number.NEGATIVE_INFINITY;for(const n of t)e=Math.max(e,n);return e},H=t=>(t.split(/[.,]/)[1]||"").length,T=(t,e,n)=>{const a=((t,e)=>new Intl.NumberFormat(e||document.documentElement.lang||void 0,{minimumFractionDigits:t,maximumFractionDigits:t}))(e,n).formatToParts(t),o="minusSign"===a[0]?.type?a[0].value:"";return[o,a.slice(o?1:0).map(t=>t.value).join("")]},z=(t,e)=>{const n=document.createElement("span");if(n.className="tablechart-badge",n.inert=!0,t.childElementCount>0)for(const a of Array.from(t.children))n.appendChild(a.cloneNode(!0));else{n.textContent=(t.textContent||"").trim();const e=t.getAttribute("data-i18n");e&&n.setAttribute("data-i18n",e)}return e.appendChild(n),n},C=(e,n,a,o)=>{const r=(s=e?.textContent||"",Number.parseFloat((s.match(/-?[\d.,]+/)||["NaN"])[0].replace(",",".")));var s;const c=!!Number.isNaN(r)||Math.abs(n-r)<=.5,l={label:a,computed:n,stated:r,agrees:c};o.checks.push(l),c||console.warn(`[${t}] An annotation reads ${r}%, but ${a} is ${n.toFixed(1)}%. The chart shows your number.`)},L={create:z,draw(e,n,a){const{rows:s,cx:c,y:l,unit:i,labelHeight:u,badgeHeight:d,height:h,svg:b,after:m}=a,[p,w]=((t,e)=>{const n=(e,n)=>{const a=Number.parseInt(t.getAttribute(e)??"",10);return Number.isFinite(a)?a-1:n};return[n("data-from",0),n("data-to",e-1)]})(e,s.length),y=s[p],M=s[w];if(!y||!M)return void console.warn(`[${t}] A bracket points at a row that is not there (row ${p+1} to ${w+1}, of ${s.length}).`);const k=7*i,x=4*i,N=c(p),A=c(w),S=Math.min(l(y.value),l(M.value))-u-x-.9*d,H=t=>l(t)-u-x,T=`M ${N} ${H(y.value)} L ${N} ${S} L ${A} ${S} L ${A} ${H(M.value)-k}`,z=(H(y.value)-S+Math.abs(A-N)+(H(M.value)-k-S))/i+1;b.appendChild($("path",{class:o,"data-note":a.note,d:T,style:`--len:${z.toFixed(1)}; ${g("--after",m)}`}));const L=H(M.value);var O;b.appendChild($("polygon",{class:r,"data-note":a.note,points:`${A},${L} ${A-.45*k},${L-k} ${A+.45*k},${L-k}`,style:g("--after",m)})),n&&(v(n,(N+A)/2,S,f,h),n.style.setProperty("--after",String(m))),C(n,(O=y.value,(M.value-O)/Math.abs(O)*100),`${y.value} to ${M.value}`,a)}},O=new WeakMap,B=t=>O.get(t)??{width:t.offsetWidth,height:t.offsetHeight},U={create:z,draw(t,e,n){const{rows:a,cx:s,y:c,unit:l,labelHeight:i,height:u,svg:d,values:h,after:b}=n,m=a[0],p=a[a.length-1];if(!m||!p)return;const w=i+18*l,y=10*l,M=10*l;let k=s(0),x=c(m.value)-w,N=s(a.length-1),A=c(p.value)-w,S=0;a.forEach((t,e)=>{const n=N===k?0:(s(e)-k)/(N-k),a=x+n*(A-x)-(c(t.value)-w);a>S&&(S=a)}),x-=S,A-=S;const H=N-k,T=A-x,z=Math.hypot(H,T)||1,L=H/z,O=T/z;k-=L*y,x-=O*y,N+=L*y,A+=O*y;const U=Number.parseFloat(t.getAttribute("data-at")||"0.5");if(e){const t=k+(N-k)*U,n=x+(A-x)*U,o=B(e).width*l/2,r=n+B(e).height*l/2+8*l;let u=0;a.forEach((e,n)=>{const a=(h[n]?B(h[n]).width:0)*l/2;if(Math.abs(s(n)-t)>=o+a)return;const d=c(e.value)-7*l-i;u=Math.max(u,r-d)}),x-=u,A-=u}const _=N-L*M,E=A-O*M,F=Math.hypot(_-k,E-x)/l+1;d.appendChild($("line",{class:o,"data-note":n.note,x1:k,y1:x,x2:_,y2:E,style:`--len:${F.toFixed(1)}; ${g("--after",b)}`}));const j=-O,P=L,q=.42*M;d.appendChild($("polygon",{class:r,"data-note":n.note,points:[`${N},${A}`,`${_+j*q},${E+P*q}`,`${_-j*q},${E-P*q}`].join(" "),style:g("--after",b)})),e&&(v(e,k+(N-k)*U,x+(A-x)*U,f,u),e.style.setProperty("--after",String(b)));const R=Number.parseFloat(t.getAttribute("data-years")||"");!Number.isNaN(R)&&R>0&&C(e,((t,e,n)=>100*(Math.pow(e/t,1/n)-1))(m.value,p.value,R),`${m.value} to ${p.value} over ${R} years`,n)}},_=(t,e,n)=>{const a=.15,o=Math.min(.7*t/(e+(e-1)*a),n),r=e*o+(e-1)*o*a;return{size:o,gap:o*a,offset:t=>-r/2+t*o*1.15}},E=(t,e,n)=>{const a=t.series[n],o=t.series.some(t=>t.focus)&&!a.focus;return{"data-series":n+1,...o&&{"data-muted":""},style:`--n:${n}; --m:${o?1:0}; --palette:var(--tablechart-color-${n+1}); ${g("--i",e.slot)}`}},F=(t,e,n=!1)=>{let a=0,o=0;return Array.from({length:e},(e,r)=>{const s=t.cells[r]??t.cells[0],c=s.missing?0:s.value;if(n){const t=a;return a+=c,{from:t,to:a,cell:s}}if(c<0){const t=o;return o+=c,{from:t,to:o,cell:s}}const l=a;return a+=c,{from:l,to:a,cell:s}})},j=(t,e,n=!1)=>{const a=F(t,e,n);return{top:Math.max(0,...a.map(t=>t.to)),bottom:Math.min(0,...a.map(t=>t.to))}},P=(t,e)=>{const{top:n,bottom:a}=j(t,e);return n+a},q=(t,e,n)=>{const a=e.series.some(t=>t.focus);t.style.setProperty("--n",String(n)),t.style.setProperty("--m",a&&!e.series[n].focus?"1":"0"),t.style.setProperty("--palette",`var(--tablechart-color-${n+1})`)},R=(t,e,a,o={},r="")=>{const s={class:y(n,e),"data-kind":"bar","data-row":a+1,...o},c=g("--i",e.slot)+(r?`; transform-origin: ${r}`:""),l=$("g",{...s,"data-stack":"",style:c});return t.svg.appendChild(l),(n,r)=>{const s=void 0!==o["data-grow"]?{"data-grow":o["data-grow"]}:{};l.appendChild($("rect",{...s,...r,class:y("tablechart-piece",e),"data-row":a+1,...E(t,e,n)}))}},D=(t,e,n)=>t.some(t=>B(t).width*n>e-6*n),V=(t,e,n)=>e>=B(t).height*n*1.6,W=(t,e,n)=>e>=B(t).width*n*1.5,I=(t,e,n,a,o=.7)=>{t.style.setProperty(a,"1");let r=1;for(const c of e){const{size:t,room:e}=n(c);t>e&&(r=Math.min(r,e/t))}const s=r>=o?r:0;return t.style.setProperty(a,String(s||o)),s},K={segments:t=>t.map(t=>({...t,from:0,to:t.value,kind:"bar"})),series:!0,legend:"box",stackable:!0,totals:!0,breakable:!0,aspect:.5,minHeight:({labelHeight:t,nameHeight:e,rows:n,series:a,stacked:o})=>{const r=1.1*t,s=a>1&&!o?r*(a+.15*(a-1))/.7:r/.58;return n*Math.max(s,1.2*e)},categories:"beside",headroom:()=>0,draw(t){const{segments:e,height:o,unit:r,svg:s,values:c,categories:l,config:i,barMax:u}=t,d=t.series.length>1,h=Math.max(S(l.map(t=>B(t).width*r)),0),b=Math.min(h+10*r,420);l[0]?.parentElement?.style.setProperty("--_beside",`${((b-8*r)/f*100).toFixed(2)}%`);const m=f-4*r,p=t.stacked?Math.max(S(t.rows.map(e=>j(e,t.series.length).top)),0)||1:Math.max(S(t.rows.flatMap(e=>e.cells.slice(0,t.series.length).map(t=>Math.abs(t.value)))),0)||1,w=t.stacked?Math.max(S(t.rows.map(e=>-j(e,t.series.length).bottom)),0):Math.max(S(t.rows.flatMap(e=>e.cells.slice(0,t.series.length).map(t=>-t.value))),0),M=Math.max(p,t.squeeze?.hi??0)+w,k=(e,n)=>((t,e,n,a,o)=>{if(!a)return t/e*n;const{lo:r,hi:s,gap:c,share:l}=a,i=n*l,u=(n-i-o)/(r+(e-s)),d=i/(s-r);return t<=r?t*u:t<=c?r*u+(t-r)*d:t<=s?r*u+(t-r)*d+o:r*u+i+o+(t-s)*u})(Math.abs(e),M,n,t.squeeze,t.breakGap),x=o/e.length,N=t=>(t+.5)*x,A=Math.min(x*i.barfill,u),H=_(x,t.series.length,u),T=c[0]??t.totals[0],z=T?B(T).height*r*.56:0,C=Math.max(((d&&!t.stacked?H.size:A)-z)/2,5*r),L=t=>B(t).width*r,O=t=>t.length?S(t.map(L))+C+4*r:0,U=(e,n)=>(t.rows[n].cells[e]??t.rows[n].cells[0]).value,P=t.seriesValues.flatMap((t,e)=>t.map((t,n)=>({label:t,value:U(e,n)}))),D=e=>{const n=j(t.rows[e],t.series.length);return 0===n.top&&n.bottom<0};let V=t.stacked?O(t.totals.filter((t,e)=>!D(e))):d?O(P.filter(t=>t.value>=0).map(t=>t.label)):0,K=t.stacked?O(t.totals.filter((t,e)=>D(e))):d?O(P.filter(t=>t.value<0).map(t=>t.label)):0;if(!d&&!t.stacked)for(let n=0;n<3;n++){const t=m-b-V-K,n=e.map((t,e)=>({seg:t,label:c[e]})).filter(({seg:e,label:n})=>!W(n,k(e.value,t),r)),a=O(n.filter(({seg:t})=>t.value>=0).map(({label:t})=>t)),o=O(n.filter(({seg:t})=>t.value<0).map(({label:t})=>t));if(a<=V&&o<=K)break;V=Math.max(V,a),K=Math.max(K,o)}const G=m-b-V-K,Z=b+K+k(w,G),J=t=>t<0?Z-k(t,G):Z+k(t,G);if(t.squeeze&&(t.breakX=J(t.squeeze.gap)),t.stacked)return t.rows.forEach((e,n)=>{const a=j(e,t.series.length),s=R(t,e,n,{"data-grow":"right"},a.bottom<0?Z-J(a.bottom)+"px center":""),c=N(n)-A/2;F(e,t.series.length).forEach(({from:e,to:a,cell:l},i)=>{const u=t.seriesValues[i][n];if(u.dataset.place="none",l.missing||a===e)return;const d=Math.min(J(e),J(a)),h=Math.max(J(e),J(a));s(i,{x:d,y:c,width:Math.max(h-d,1),height:A,...a<e&&{"data-grow":"left"}}),u.dataset.place="inside",u.toggleAttribute("data-left-out",!W(u,h-d,r)||B(u).height*r>A),q(u,t,i),v(u,(d+h)/2,N(n),f,o)});const i=t.totals[n];i&&(i.dataset.place=D(n)?"before":"after",v(i,D(n)?J(a.bottom)-C:J(a.top)+C,N(n),f,o));const u=l[n];u&&v(u,b-8*r,N(n),f,o)}),void s.appendChild($("line",{class:a,x1:Z,x2:Z,y1:0,y2:o}));if(d){t.plot.dataset.grouped="";const e=t.seriesValues.flat().filter(t=>void 0===t.dataset.missing),c=I(t.plot,e,t=>({size:B(t).height*r,room:H.size+.5*H.gap}),"--_fit");return t.rows.forEach((e,a)=>{t.series.forEach((r,l)=>{const i=e.cells[l]??e.cells[0],u=t.seriesValues[l][a];if(i.missing)return void(u.dataset.place="none");const d=J(i.value),h=i.value<0,b=N(a)+H.offset(l);s.appendChild($("rect",{class:y(n,e),"data-kind":"bar","data-row":a+1,"data-grow":h?"left":"right",x:Math.min(d,Z),y:b,width:Math.max(Math.abs(d-Z),1),height:H.size,...E(t,e,l)})),u.dataset.place=h?"before":"after",u.toggleAttribute("data-left-out",!c),v(u,h?d-C:d+C,b+H.size/2,f,o)});const i=l[a];i&&v(i,b-8*r,N(a),f,o)}),void s.appendChild($("line",{class:a,x1:Z,x2:Z,y1:0,y2:o}))}const Q=e.map((t,e)=>W(c[e],Math.abs(J(t.value)-Z),r));e.forEach((e,a)=>{const i=J(e.value),u=N(a),d=e.value<0,h=Math.abs(i-Z);s.appendChild($("rect",{class:y(n,e),"data-kind":e.kind,"data-row":a+1,"data-grow":d?"left":"right",x:Math.min(i,Z),y:u-A/2,width:Math.max(h,1),height:A,style:g("--i",e.slot)}));const m=c[a],p=Math.max(Math.min(C,h-L(m)-6*r),6*r),w=d?1:-1;m.dataset.place=Q[a]?"inside":d?"before":"after",m.dataset.kind=e.kind,v(m,Q[a]?"center"===t.insideAlign?(Z+i)/2:"start"===t.insideAlign?Z-w*(p+L(m)/2):i+w*(p+L(m)/2):i-w*C,u,f,o);const M=l[a];M&&v(M,b-8*r,u,f,o)}),s.appendChild($("line",{class:a,x1:Z,x2:Z,y1:0,y2:o}))}},G={segments:t=>t.map(t=>({...t,from:0,to:t.value,kind:"bar"})),series:!0,legend:"box",stackable:!0,totals:!0,breakable:!0,headroom:({labelHeight:t,badgeHeight:e,hasAnnotations:n,unit:a})=>t+4*a+(n?1.6*e:0),draw(t){const{segments:e,cx:o,y:r,barWidth:s,height:c,unit:l,svg:i,values:u,labels:d,insideAlign:h}=t,b=r(0);if(t.stacked)return t.rows.forEach((e,n)=>{const a=j(e,t.series.length),i=R(t,e,n,{},a.bottom<0?`center ${b-r(a.top)}px`:""),u=o(n)-s/2;F(e,t.series.length).forEach(({from:e,to:a,cell:d},h)=>{const b=t.seriesValues[h][n];if(b.dataset.place="none",d.missing||a===e)return;const m=Math.min(r(a),r(e)),p=Math.max(r(a),r(e));i(h,{x:u,y:m,width:s,height:Math.max(p-m,1),...a<e&&{"data-grow":"down"}}),b.dataset.place="inside",b.toggleAttribute("data-left-out",!V(b,p-m,l)||B(b).width*l>s-4*l),q(b,t,h),v(b,o(n),(m+p)/2,f,c)});const d=t.totals[n];if(d){const t=0===a.top&&a.bottom<0;d.dataset.place=t?"below":"outside",v(d,o(n),t?r(a.bottom)+4*l:r(a.top)-4*l,f,c)}}),void i.appendChild($("line",{class:a,x1:0,x2:f,y1:b,y2:b}));if(t.series.length>1){const e=o(1)-o(0)||2*o(0),s=_(e,t.series.length,t.barMax);t.plot.dataset.grouped="";const u=t.seriesValues.flat().filter(t=>void 0===t.dataset.missing),d=I(t.plot,u,t=>({size:B(t).width*l,room:s.size+.5*s.gap}),"--_fit");return t.rows.forEach((e,a)=>{t.series.forEach((u,h)=>{const m=e.cells[h]??e.cells[0],p=t.seriesValues[h][a],g=o(a)+s.offset(h);if(m.missing)return void(p.dataset.place="none");const w=r(m.value),M=m.value<0;i.appendChild($("rect",{class:y(n,e),"data-kind":"bar","data-row":a+1,...M&&{"data-grow":"down"},x:g,y:Math.min(w,b),width:s.size,height:Math.max(Math.abs(b-w),1),...E(t,e,h)})),p.dataset.place=M?"below":"outside",p.toggleAttribute("data-left-out",!d),v(p,g+s.size/2,M?w+4*l:w-4*l,f,c)})}),void i.appendChild($("line",{class:a,x1:0,x2:f,y1:b,y2:b}))}const m=D(u,s,l),p=e.map((t,e)=>"inside"===d&&!m&&!t.missing&&V(u[e],Math.abs(b-r(t.value)),l)),w=u[0]?B(u[0]).height*l*.56:0;let M=Number.POSITIVE_INFINITY;for(const[n,a]of u.entries())p[n]&&(M=Math.min(M,(s-B(a).width*l)/2));e.forEach((t,e)=>{const a=r(t.value),d=t.value<0;if(t.missing)return v(u[e],o(e),b-4*l,f,c),void(u[e].dataset.place="outside");i.appendChild($("rect",{class:y(n,t),"data-kind":t.kind,"data-row":e+1,...d&&{"data-grow":"down"},x:o(e)-s/2,y:Math.min(a,b),width:s,height:Math.max(Math.abs(b-a),1),style:g("--i",t.slot)}));const m=d?-1:1,k=Math.min(M,(Math.abs(b-a)-w)/2),x="center"===h?(a+b)/2:"start"===h?b-m*(k+w/2):a+m*(k+w/2),N=d?a+4*l:a-4*l;v(u[e],o(e),p[e]?x:N,f,c),u[e].dataset.place=p[e]?"inside":d?"below":"outside"}),i.appendChild($("line",{class:a,x1:0,x2:f,y1:b,y2:b}))}},Z=0,J={aspect:.66,centre:!0,headroom:()=>0,segments:t=>t.map(t=>({...t,from:0,to:t.value,kind:"bar"})),draw({rows:t,height:e,unit:n,labelHeight:a,svg:o,values:r,config:c,centre:l}){const i=500,u=e/2,d=(t=>t.filter(t=>!t.isTotal))(t).reduce((t,e)=>t+Math.abs(e.value),0);if(!d)return;const h=1.2*a+10*n,b=Math.max(Math.min(f,e)/2-h,10),m=b*c.ringfill,w=b-m/2,M=2*Math.PI*w,k=[];let x=0,N=0,A=0;if(t.forEach((t,c)=>{const l=r[c];if(t.isTotal)return void(l.dataset.place="none");const h=Math.abs(t.value)/d,S=p(A,h),H=`--share:${h.toFixed(4)}; --start:${S.start.toFixed(4)}; --span:${S.span.toFixed(4)};`,T=h*M,z=x/M*2*Math.PI-Math.PI/2;k.push(z),o.appendChild($("circle",{class:y(s,t),"data-slice":N+1,"data-row":c+1,cx:i,cy:u,r:w,"stroke-width":m,transform:`rotate(-90 500 ${u})`,"stroke-dasharray":`${T.toFixed(1)} ${(M-T).toFixed(1)}`,"stroke-dashoffset":(-x).toFixed(1),style:`--n:${N}; --palette:var(--tablechart-color-${N+1}); --arc:${T.toFixed(1)}; --circ:${M.toFixed(1)}; ${H} --ease:${S.easing}; ${g("--i",t.slot)}`}));const C=z+T/M*Math.PI,L=Math.cos(C),O=Math.sin(C);o.appendChild($("line",{class:"tablechart-leader",x1:i+L*(b+2*n),y1:u+O*(b+2*n),x2:i+L*(b+7*n),y2:u+O*(b+7*n),"data-row":c+1,style:`${H} ${g("--i",t.slot)}`})),l.style.setProperty("--start",S.start.toFixed(4)),l.style.setProperty("--span",S.span.toFixed(4));const U=b+9*n,_=B(l).width*n/2;v(l,i+L*(U+Math.abs(L)*_),u+O*(U+Math.abs(O)*a*.7),f,e),l.dataset.place="around",x+=T,A+=h,N+=1}),k.length>1){const t=w-m/2-1,n=w+m/2+1,a="tablechart-slices-"+ ++Z,r=$("mask",{id:a,maskUnits:"userSpaceOnUse"});r.appendChild($("rect",{x:0,y:0,width:f,height:e,fill:"white"}));for(const e of k)r.appendChild($("line",{class:"tablechart-divide",x1:i+Math.cos(e)*t,y1:u+Math.sin(e)*t,x2:i+Math.cos(e)*n,y2:u+Math.sin(e)*n}));const c=$("g",{mask:`url(#${a})`});for(const e of Array.from(o.querySelectorAll(`.${s}`)))c.appendChild(e);const l=$("defs");l.appendChild(r),o.prepend(l,c)}l&&v(l,i,u,f,e)}},Q=["circle","square","diamond"],X=(t,e)=>{const n=t[e]?.marker?.toLowerCase().split(/\s+/)??[],a=Q.find(t=>n.includes(t));return{shape:a??Q[Math.floor(e/2)%Q.length],open:n.includes("open")||!n.includes("filled")&&!a&&e%2==1}},Y=t=>Number(t.toFixed(2));function tt(t,e,n){const a=new Array(t).fill(0);let o=[];const r=()=>{(function(t,e){const n=t.length;if(n<2)return t.map(()=>0);const a=n=>(e[n+1]-e[n])/(t[n+1]-t[n]||1),o=new Array(n).fill(0);for(let s=1;s<n-1;s++){const e=a(s-1),n=a(s);if(e*n<=0)continue;const r=t[s]-t[s-1],c=t[s+1]-t[s],l=(e*c+n*r)/(r+c||1),i=Math.min(2*Math.abs(e),2*Math.abs(n),Math.abs(l));o[s]=Math.sign(e)*i||0}if(2===n)return o[0]=a(0),o[1]=a(0),o;const r=(n,a,o)=>{const r=t[a]-t[n];return r?((e[a]-e[n])/r*3-o)/2:o};return o[0]=r(0,1,o[1]),o[n-1]=r(n-2,n-1,o[n-2]),o})(o.map(t=>n(t)[0]),o.map(t=>n(t)[1])).forEach((t,e)=>{a[o[e]]=t}),o=[]};for(let s=0;s<t;s++)e(s)?r():o.push(s);return r(),a}var et,nt,at=t=>t.map(t=>({...t,from:0,to:t.value,kind:"bar"})),ot=t=>({segments:at,series:!0,stackable:!0,running:!0,swatch:t?"box":void 0,headroom:({labelHeight:t,unit:e})=>1.6*t+6*e,footroom:({labelHeight:e,unit:n,series:a,focused:o,stacked:r})=>t||r||2!==a||o?0:e+7*n,draw(e){const{rows:n,series:o,seriesValues:r,names:s,cx:c,y:i,height:u,unit:d,labelHeight:h,svg:b,stacked:m}=e,p="step"===e.shape,g="smooth"===e.shape,w=o.length>1,y=o.some(t=>t.focus),M=n.length-1,k=i(0),N=n.length>1?c(1)-c(0):2*c(0);b.style.setProperty("--_base",`${Y(k)}px`);const A=(t,e)=>n[e]?.cells[t]??n[e]?.cells[0],S=(t,e)=>!A(t,e)||!!A(t,e)?.missing,H=n.map(t=>m?F(t,o.length,!0):null),T=(t,e)=>H[e]?.[t].to??A(t,e)?.value??0,z=(t,e)=>H[e]?.[t].from??0,C=(t,e)=>[c(e),i(T(t,e))],L=o.map((t,e)=>{if(!w)return{attrs:{},ink:""};const n=y&&!t.focus;return{attrs:{"data-series":e+1,...n&&{"data-muted":""}},ink:`--n:${e}; --m:${n?1:0}; --palette:var(--tablechart-color-${e+1}); `}}),O=Math.min(M,6);e.plot.style.setProperty("--count",String(O+1));const U=M>0?O/(p?n.length:M):1,_=t=>t*U,E=t=>`--i:${Y(_(t))}`,j=t=>{const e=[];let a=-1;return n.forEach((n,o)=>{S(t,o)||(a<0&&(a=o),(o===M||S(t,o+1))&&((p||o>a)&&e.push([a,o]),a=-1))}),e},P=(t,e)=>`--i:${Y(_(t)+1)}; --d:${Y(_(p?e+1:e)-_(t))}`,q=(t,e)=>({"data-from":t+1,"data-to":e+1,...p&&{"data-flat":""}}),R=g?o.map((t,e)=>tt(n.length,t=>S(e,t),t=>C(e,t))):[],D=g&&t?o.map((t,e)=>tt(n.length,t=>S(e,t),t=>[c(t),i(z(e,t))])):[],V=(t,e,n)=>{const a=[];return t.forEach(([o,r],s)=>{p?(a.push(`H${Y(o+n*N/2)}`),s<t.length-1&&a.push(`V${Y(t[s+1][1])}`)):s>0&&a.push(e?function(t,e,n,a){const[o,r]=function(t,e,n,a){const o=(e[0]-t[0])/3;return[[t[0]+o,t[1]+n*o],[e[0]-o,e[1]-a*o]]}(t,e,n,a),s=([t,e])=>`${Y(t)},${Y(e)}`;return`C${s(o)} ${s(r)} ${s(e)}`}(t[s-1],[o,r],e[s-1],e[s]):`L${Y(o)},${Y(r)}`)}),a},W=(t,e,a,o)=>n.slice(e,a+1).map((n,a)=>[c(e+a),i(o(t,e+a))]),I=(t,e,n,a)=>g?t[e].slice(n,a+1):null,K=t=>c(t)-(p?N/2:0),G=t=>c(t)+(p?N/2:0);t&&o.forEach((t,e)=>(t=>{const e=$("g",{class:"tablechart-area",...L[t].attrs,...m&&{"data-stacked":""},style:L[t].ink}),n=j(t),a=$("g",{class:"tablechart-area-fill",style:`--rows:${Y(O+1)}; ${n.length?P(...n[0]):""}`});e.appendChild(a);for(const[o,r]of n){const e=W(t,o,r,T),n=W(t,o,r,z),s=I(D,t,o,r)?.reverse()??null,c=[`M${Y(K(o))},${Y(n[0][1])}`,`L${Y(K(o))},${Y(e[0][1])}`,...V(e,I(R,t,o,r),1),`L${Y(G(r))},${Y(n[n.length-1][1])}`,...V(n.reverse(),s,-1),"Z"].join(" ");a.appendChild($("path",{d:c,...q(o,r),style:P(o,r)}))}b.appendChild(e)})(e)),o.forEach((t,e)=>(t=>{const e=o[t];for(const[n,a]of j(t)){const o=W(t,n,a,T),r=[`M${Y(K(n))},${Y(o[0][1])}`,...V(o,I(R,t,n,a),1)].join(" ");b.appendChild($("path",{class:"tablechart-series",...L[t].attrs,d:r,...e.line&&{"data-line":e.line},...q(n,a),style:`${L[t].ink}${P(n,a)}`}))}})(e)),p||(()=>{const t=o.map((t,e)=>w?X(o,e):{shape:"circle",open:!1}),e=(e,n,a)=>{const[o,r]=C(e,n);return((t,e,n,a,o={})=>{if("square"===t){const t=.88*a;return $("rect",{x:e-t,y:n-t,width:2*t,height:2*t,...o})}if("diamond"===t){const t=1.2*a;return $("polygon",{points:`${e},${n-t} ${e+t},${n} ${e},${n+t} ${e-t},${n}`,...o})}return $("circle",{cx:e,cy:n,r:a,...o})})(t[e].shape,o,r,4*d,{...a,style:`${a.style??""}${s=r,`--rise:${Y(k-s)}px; `}${E(n)}`});var s},a=t=>n.map((t,e)=>e).filter(e=>!S(t,e)),r=o.flatMap((n,o)=>t[o].open?a(o).map(t=>e(o,t,{class:l,"data-row":t+1,...w&&{"data-series":o+1}})):[]);x(b,r,f,u),o.forEach((n,o)=>{for(const r of a(o))b.appendChild(e(o,r,{class:"tablechart-point",...L[o].attrs,"data-marker":t[o].shape,...t[o].open&&{"data-open":""},"data-row":r+1,style:L[o].ink}))})})();const Z=(t,e)=>{let n=e;for(;n<M&&!S(t,n+1)&&A(t,n+1)?.value===A(t,e)?.value;)n++;return n};r.forEach((e,n)=>{e.forEach((e,a)=>{e.style.setProperty("--i",String(Y(p?(_(a)+_(a+1))/2:_(a))));const s=((e,n)=>{const a=A(e,n);if(!a||a.missing)return"none";if(p&&n>0&&!S(e,n-1)&&A(e,n-1)?.value===a.value)return"none";if(y&&!o[e].focus)return"none";if(m)return"middle";const r=a.value<0?"below":"above";if(!w||y||o.length>2)return r;const s=A(1-e,n);return!s||s.missing?r:a.value>s.value||a.value===s.value&&0===e||t&&a.value>=0&&C(e,n)[1]+7*d+h>k?"above":"below"})(n,a);if(e.dataset.place="above"===s?"outside":s,e.toggleAttribute("data-left-out","none"!==s&&((t,e)=>m||p?B(r[t][e]).width*d>(p?Z(t,e)-e+1:1)*N-4*d||!!(m&&t>0&&T(t,e)<z(t,e))||m&&Math.abs(i(z(t,e))-i(T(t,e)))<1.2*h:w&&!y&&o.length>2)(n,a)),p&&"none"!==s?e.dataset.rowEnd=String(Z(n,a)+1):delete e.dataset.rowEnd,"none"===s)return;const l=B(e).width*d/2+4*d;let b=c(a);p?b=(c(a)+c(Z(n,a)))/2:"middle"===s&&0===a?b+=l:"middle"===s&&a===M&&(b-=l);const g=i(T(n,a)),$={middle:(i(z(n,a))-g)/2,above:-7*d,below:7*d};v(e,b,g+$[s],f,u)})});const J=s.map((t,e)=>{let n=M;for(;n>0&&S(e,n);)n--;const[a,o]=C(e,n);return{name:t,x:(p?a+N/2:a)+10*d,y:m?(o+i(z(e,n)))/2:o}}),Q=(s[0]?B(s[0]).height:0)*d;for(const t of((t,e)=>(t.sort((t,e)=>t.y-e.y),t.forEach((n,a)=>{const o=t[a-1];o&&n.y<o.y+e&&(n.y=o.y+e)}),t))(J,Q))v(t.name,t.x,t.y,f,u);const et=n.some(t=>t.cells.some(t=>!t.missing&&t.value<0)),nt=t||m||2!==o.length||y||et?k:u-2*d;b.appendChild($("line",{class:a,x1:0,x2:c(M)+c(0),y1:nt,y2:nt}))}}),rt=ot(!1),st=ot(!0),ct=new Set,lt={segments:e=>{let n=0,a=!1;return e.map(e=>{if(e.isTotal)return a&&((e,n)=>{if(Math.abs(e-n)<=Math.abs(n)/100)return;const a=`[${t}] A total reads ${e}, but the steps before it add up to ${Number(n.toFixed(6))}. The chart shows your number.`;ct.has(a)||(ct.add(a),console.warn(a))})(e.value,n),a=!1,n=e.value,{...e,from:0,to:e.value,kind:"total"};const o=n;return n+=e.value,a=!0,{...e,from:o,to:n,kind:e.value>=0?"up":"down"}})},breakable:!0,headroom:({labelHeight:t,badgeHeight:e,hasAnnotations:n,unit:a})=>t+6*a+(n?1.6*e:0),draw({segments:t,cx:e,y:o,barWidth:r,height:s,unit:c,svg:l,values:i,breakAt:u,insideAlign:d}){const h=o(0),b=D(i,r,c),p=d??"center",w=t.map((e,n)=>{const a=o(Math.max(e.from,e.to)),r=Math.abs(o(e.from)-o(e.to)),s=null!==u&&Math.min(e.from,e.to)<u&&Math.max(e.from,e.to)>u,l="total"===e.kind&&n>0&&n===t.length-1;return{top:a,length:r,down:"down"===e.kind||"total"===e.kind&&(l?e.to>=0:e.to<0),inside:!s&&!b&&V(i[n],r,c)}}),M=i[0]?B(i[0]).height*c*.56:0;let k=Number.POSITIVE_INFINITY;for(const[n,a]of w.entries())a.inside&&(k=Math.min(k,(r-B(i[n]).width*c)/2));const x=t.length,N=(t,e,n=!1)=>`--start:${(t/x).toFixed(4)}; --span:${(e/x).toFixed(4)}; --ease:${n?m:"linear"};`;t.forEach((n,a)=>{const s=t[a+1];if(!s)return;const c=o(n.to),i=e(a)+r/2,u=e(a+1)-r/2;l.appendChild($("line",{class:"tablechart-connector",x1:i,x2:u,y1:c,y2:c,"data-row":a+2,style:`${g("--i",s.slot)}; ${N(a+1,1/3)}`}))}),t.forEach((a,o)=>{const{top:u,length:d,down:h,inside:b}=w[o];l.appendChild($("rect",{class:y(n,a),"data-kind":a.kind,"data-row":o+1,"data-grow":h?"down":"up",x:e(o)-r/2,y:u,width:r,height:Math.max(d,1),style:`${g("--i",a.slot)}; ${N(o,1,o===t.length-1)}`}));const m=i[o];m.style.setProperty("--start",(o/x).toFixed(4)),m.style.setProperty("--span",(1/x).toFixed(4));const A=Math.min(k,(d-M)/2),S="center"===p?u+d/2:"end"===p!==h?u+A+M/2:u+d-A-M/2;m.dataset.place=b?"inside":"outside",m.dataset.kind=a.kind;const H=b?S:"down"===a.kind?u+d+B(m).height*c+3*c:u-3*c;v(m,e(o),H,f,s)}),l.appendChild($("line",{class:a,x1:0,x2:f,y1:h,y2:h}))}},it={enabled:!1,log(...e){it.enabled&&console.log(`[${t}]`,...e)},timed(e,n,a){if(!it.enabled)return a();const o=performance.now(),r=a(),s=performance.now()-o,c=n.querySelectorAll("tbody tr").length;return s>50?console.warn(`[${t}] ${e} took ${s.toFixed(1)} ms for ${c} rows, more than 50 ms.`,n):it.log(`${e} took ${s.toFixed(1)} ms for ${c} rows.`,n),r}},ut=t=>{const e=(t?.textContent||"").trim(),n=e.match(/^(.*?)(-?\d+(?:[.,]\d+)?)(.*)$/);return{raw:e,number:n?.[2]??"",prefix:n?.[1]??"",suffix:n?.[3]??"",missing:!n,value:n?Number.parseFloat(n[2].replace(",",".")):0}},dt=t=>Array.from(t.querySelector("thead tr:last-child")?.children??[]).slice(1),ht=["axis-break","trend","bracket"],ft=t=>{const e=t.plan;if(!e)return;const n=e=>null===e||t.step-e>=1;for(const a of t.figure.querySelectorAll("[data-from]")){const t=Number(a.dataset.from)-1,o=Number(a.dataset.to)-1,r=a.closest("[data-series]")?.dataset.series,s=r?Number(r)-1:0,c=e.series[s],l=t=>e.cells[t]?.[s]?.step??e.rows[t]?.step??null;let i=t-1;if(c&&null!==c.step)i=n(c.step)?o:t-1;else for(;i<o&&n(l(i+1));)i++;const u=a.hasAttribute("data-flat")?(i-t+1)/(o-t+1):o>t?Math.max(0,i-t)/(o-t):0;a.style.setProperty("--reveal",String(u))}},bt=(t,e,n=!1)=>{const a=t.plan;if(!a)return;const o=Math.min(Math.max(Math.round(e),0),a.count),r=o!==t.step;t.step=o,t.figure.style.setProperty("--_step",String(o)),ft(t);const[s,c]=t.controls?.querySelectorAll("button")??[];s&&(s.disabled=0===o),c&&(c.disabled=o===a.count),r&&!n&&t.figure.dispatchEvent(new CustomEvent("tablechart:step",{bubbles:!0,detail:{step:o,steps:a.count}}))},mt="tablechart-tooltip",pt=["--tablechart-surface","--tablechart-tooltip-surface","--tablechart-tooltip-color","--tablechart-tooltip-border","--tablechart-tooltip-radius","--tablechart-tooltip-padding","--tablechart-tooltip-shadow"],gt=null,wt=null,$t=null,yt=0,Mt=()=>{clearTimeout(yt),gt&&wt&&(gt.hidden=!0,wt=null,$t=null)},vt=!1,kt=!0,xt=NaN,Nt=NaN,At=!1,St=(t,e)=>e/Number.parseFloat(getComputedStyle(t).width)||1,Ht=()=>{clearTimeout(yt),yt=window.setTimeout(Mt,120)},Tt=(t,e)=>{const n=e?e.style.getPropertyValue("--step"):"x";return""===n||Number(n)<t.step},zt=(t,e)=>{const n=t.svg.querySelector(`[data-series="${e+1}"]:not(.tablechart-hole)`);if(!n)return;const a=getComputedStyle(n);return a.fill&&"none"!==a.fill?a.fill:a.stroke},Ct=(t,e,n)=>{const a=t.series.length>1,o=[];for(const[s,c]of t.seriesValues.entries()){if(!Tt(t,c[e]))continue;const n=a?t.figure.querySelector(`.tablechart-name[data-series="${s+1}"]`):null;o.push({name:a?n?.textContent??t.series[s].name:"",value:c[e].textContent??"",colour:a?zt(t,s):void 0,sample:n?{marker:n.dataset.marker??null,open:n.hasAttribute("data-open"),line:n.dataset.line??null,box:"box"===n.dataset.swatch}:void 0})}const r=t.totals[e];return o.length>1&&Tt(t,r)&&o.push({name:n.totallabel,value:r.textContent??""}),o},Lt=(t,e,n)=>{if(clearTimeout(yt),wt===t&&$t===e)return;const a=(t.type.tooltip??Ct)(t,e,n);if(!a.length)return Mt();wt&&wt!==t&&Mt(),gt??(gt=(()=>{const t=document.createElement("div");return t.className=mt,t.setAttribute("aria-hidden","true"),t.hidden=!0,et=document.createElement("div"),(nt=document.createElement("div")).className=`${mt}-arrow`,t.append(et,nt),document.body.append(t),t.addEventListener("pointerenter",()=>clearTimeout(yt)),t.addEventListener("pointerleave",t=>"mouse"===t.pointerType&&Ht()),document.addEventListener("pointerdown",e=>{const n=e.target;!wt||wt.plot.contains(n)||t.contains(n)||Mt()}),window.addEventListener("resize",Mt),t})());const o=(t,e,n,a=!1,o)=>{const r=document.createElement("div");if(r.className=`${mt}-line`,n){const t=document.createElement("span");t.className=`${mt}-key`,t.style.background=n,o?.box?t.dataset.sample="box":o&&(t.dataset.sample="line",o.marker&&(t.dataset.marker=o.marker),o.line&&(t.dataset.line=o.line),t.toggleAttribute("data-open",o.open)),r.append(t)}const s=document.createElement("span");if(s.className=`${mt}-${a?"title":"name"}`,s.textContent=t,r.append(s),e){t&&s.append(":");const n=document.createElement("span");n.className=`${mt}-value`,n.textContent=e,r.append(n)}return r},r=t.categories[e]?.textContent??t.rows[e].label,s=1===a.length&&!a[0].name;et.replaceChildren(o(r,s?a[0].value:"",void 0,!0),...s?[]:a.map(({name:t,value:e,colour:n,sample:a})=>o(t,e,n,!1,a)));const c=getComputedStyle(t.figure);for(const h of pt){const t=c.getPropertyValue(h).trim();t?gt.style.setProperty(h,t):gt.style.removeProperty(h)}gt.style.setProperty("--_color",c.color),gt.style.colorScheme=c.colorScheme,gt.style.fontFamily=c.fontFamily;const l=(t=>{const e=t.tooltipparent;return("string"==typeof e?document.querySelector(e):e)??document.body})(n);gt.parentElement!==l&&l.append(gt),wt=t,$t=e,gt.hidden=!1,gt.style.left="0px",gt.style.top="0px";const i=gt.getBoundingClientRect(),u={x:i.left,y:i.top,scale:St(gt,i.width)},d=St(t.plot,t.plot.getBoundingClientRect().width);gt.style.fontSize=Number.parseFloat(c.fontSize)*d/u.scale+"px",((t,e,n,a={x:0,y:0,scale:1},o=2,r=8,s=12)=>{const c=t.getBoundingClientRect(),l=c.width,i=c.height,u=Number.parseFloat(getComputedStyle(t).borderLeftWidth)||0,d=e.getBoundingClientRect().height/2+(o-u)*a.scale,h=s*a.scale,{clientWidth:f,clientHeight:b}=document.documentElement,m=n.top-r,p=b-n.bottom-r,g=i+d<=m||!(i+d<=p)&&m>=p,w=g?n.top-d-i:n.bottom+d,$=n.left+n.width/2,y=Math.max(r,Math.min($-l/2,f-l-r));t.style.left=(y-a.x)/a.scale+"px",t.style.top=(Math.max(r,Math.min(w,b-i-r))-a.y)/a.scale+"px",t.dataset.side=g?"top":"bottom",e.style.left=Math.max(h,Math.min($-y,l-h))/a.scale-u+"px"})(gt,nt,((t,e)=>{if(t.type.centre&&t.values[e])return t.values[e].getBoundingClientRect();const n=t.svg.querySelectorAll(`[data-row="${e+1}"]:not(.tablechart-connector, .tablechart-leader)`);let a=null;for(const i of n){const t=i.getBoundingClientRect();(t.width||t.height)&&(a=a?new DOMRect(Math.min(a.left,t.left),Math.min(a.top,t.top),Math.max(a.right,t.right)-Math.min(a.left,t.left),Math.max(a.bottom,t.bottom)-Math.min(a.top,t.top)):t)}if(a)return a;const o=t.plot.getBoundingClientRect(),[r,s,c,l]=t.rowBox?.(e)??[0,0,100,100];return new DOMRect(o.left+o.width*r/100,o.top+o.height*s/100,o.width*c/100,o.height*l/100)})(t,e),u)},Ot=t=>{wt===t&&Mt()},Bt={area:st,bar:K,column:G,donut:J,line:rt,waterfall:lt},Ut={"axis-break":A,trend:U,bracket:L},_t=Object.keys(Ut),Et=t=>{let e="";for(let n=t.previousSibling;n&&(e=(n.textContent??"")+e,!e.trim());n=n.previousSibling);return e.trim()},Ft=["straight","step","smooth"],jt=(t,e)=>{const n=t.dataset.chartShape;return n&&Ft.includes(n)?n:Ft.includes(e.shape)?e.shape:"straight"},Pt=0,qt=(n,a,o=null)=>{const r=o??(n.getAttribute("data-chart")||"column"),s=Bt[r];if(!s)return console.warn(`[${t}] Unknown chart type "${r}". Known types: ${Object.keys(Bt).join(", ")}.`),n.setAttribute("data-chart-empty",""),null;const l=((t,e="data-i18n")=>Array.from(t.querySelectorAll("tbody tr")).map((t,n)=>{const a=t.querySelector("th"),o=Array.from(t.querySelectorAll("td")).map(ut);return o.length||o.push(ut(null)),{...o[0],label:(a?.textContent||"").trim(),key:e&&a?.getAttribute(e)||null,cells:o,classes:Array.from(t.classList),isTotal:"total"===t.getAttribute("data-kind"),slot:n}}))(n,a.langattribute);if(!l.length)return console.warn(n.querySelector("table")?`[${t}] A chart has no rows in its table, so there is nothing to draw.`:`[${t}] A chart has no table, so there is nothing to draw.`,n),n.setAttribute("data-chart-empty",""),null;(t=>{const e=t.querySelector(":scope > figcaption");if(!e)return;(t=>{for(const e of t.querySelectorAll("br")){if(e.previousElementSibling?.classList.contains("tablechart-sr"))continue;if(/[.!?:;,…]$/.test(Et(e)))continue;const t=document.createElement("span");t.className=d,t.textContent=". ",e.before(t)}})(e);const n=t=>t.hasAttribute("aria-label")||t.hasAttribute("aria-labelledby"),a=t=>{e.id||(e.id="tablechart-caption-"+ ++Pt),t.setAttribute("aria-labelledby",e.id)};"FIGURE"!==t.tagName||n(t)||a(t);const o=t.querySelector("table");!o||n(o)||o.querySelector(":scope > caption")||a(o)})(n);let u=((t,e,n="data-i18n")=>{const a=dt(t),o=Math.max(1,S(e.map(t=>t.cells.length)));return Array.from({length:o},(t,e)=>{const o=a[e];return{name:(o?.textContent||"").trim(),key:n&&o?.getAttribute(n)||null,focus:"focus"===o?.getAttribute("data-kind"),marker:o?.getAttribute("data-marker")??null,line:(r=o?.getAttribute("data-line"),"dashed"===r||"dotted"===r?r:null)};var r})})(n,l,a.langattribute);u.length>1&&!s.series&&(console.warn(`[${t}] A ${r} chart uses only the first of its ${u.length} value columns.`),u=u.slice(0,1));const h=u.length>1;h&&n.style.setProperty("--_series-count",String(u.length));const f=n.hasAttribute("data-chart-stack");f&&!s.stackable&&console.warn(`[${t}] A ${r} chart cannot be stacked.`);const b=f&&!!s.stackable&&h,m=document.createElement("div");m.className="tablechart-plot",m.setAttribute("aria-hidden","true");const p=$("svg",{role:"presentation",focusable:"false"});m.appendChild(p),n.appendChild(m);const g=s.centre?l.filter(t=>!t.isTotal):l,w=Math.max(0,S(g.flatMap(t=>t.cells.slice(0,u.length).map(t=>H(t.number))))),y=u.map((t,n)=>l.map((t,a)=>{const o=t.cells[n]??t.cells[0],r=M(e,m);return r.classList.add(...t.classes),r.dataset.value=String(o.value),o.prefix&&(r.dataset.prefix=o.prefix),o.suffix&&(r.dataset.suffix=o.suffix),o.missing&&(r.dataset.missing=o.raw),h&&(r.dataset.series=String(n+1)),r.dataset.row=String(a+1),r.style.setProperty("--i",String(t.slot)),r})),v=y[0],k=b&&s.totals?l.map((t,n)=>{const a=M(e,m);a.classList.add(...t.classes),a.dataset.kind="total",a.dataset.row=String(n+1),a.dataset.value=String(P(t,u.length));const o=t.cells[0];return o.prefix&&(a.dataset.prefix=o.prefix),o.suffix&&(a.dataset.suffix=o.suffix),a.style.setProperty("--i",String(t.slot)),a}):[],x=l[l.length-1],N=u.some(t=>t.focus),A=n.getAttribute("data-chart-legend"),T=h&&(null===A?a.legend||void 0!==s.legend:"false"!==A)?document.createElement("div"):null;T&&(T.className=c,T.setAttribute("aria-hidden","true"),T.inert=!0);const z=h?u.map((t,e)=>{const o=M("tablechart-name",T??m);T&&(o.dataset.place="legend");const r=s.legend??s.swatch;if(r&&(o.dataset.swatch=r),o.textContent=t.name,!r&&"step"!==jt(n,a)){const t=X(u,e);o.dataset.marker=t.shape,o.toggleAttribute("data-open",t.open)}return t.line&&!r&&(o.dataset.line=t.line),t.key&&a.langattribute&&o.setAttribute(a.langattribute,t.key),o.dataset.series=String(e+1),o.style.setProperty("--n",String(e)),o.style.setProperty("--palette",`var(--tablechart-color-${e+1})`),o.style.setProperty("--m",N&&!t.focus?"1":"0"),o.style.setProperty("--i",String(x.slot)),o}):[],C=s.centre?M(i,m):null;if(C){const t=l.find(t=>t.isTotal),e=t?t.value:l.reduce((t,e)=>t+Math.abs(e.value),0);C.dataset.value=String(e),t&&(C.dataset.decimals=String(H(t.number)))}const L=C&&!l.some(t=>t.isTotal)?((t,e,n)=>{const a=t.querySelector("table");if(!a)return null;const o=a.querySelector("tfoot [data-chart-total]");if(o)return o.dataset.value=e.dataset.value??"0",o;const r=(a.tFoot??a.createTFoot()).insertRow(),s=document.createElement("th");s.scope="row",s.textContent=n.totallabel;const c=t.getAttribute("data-chart-keys");c&&n.langattribute&&s.setAttribute(n.langattribute,`${c}-total`);const l=r.insertCell();return l.setAttribute("data-chart-total",""),l.dataset.value=e.dataset.value??"0",r.prepend(s),l})(n,C,a):null,O="beside"===s.categories,B=document.createElement("div");B.className="tablechart-categories",B.setAttribute("aria-hidden","true"),B.inert=!0,O?B.dataset.place="beside":s.centre&&(B.dataset.place="key"),B.style.setProperty("--_columns",String(l.length));let U=0;for(const[t,e]of l.entries()){const n=document.createElement("span");n.classList.add(...e.classes),n.textContent=e.label,e.key&&a.langattribute&&n.setAttribute(a.langattribute,e.key),s.centre&&(n.dataset.kind=e.isTotal?"total":"slice",e.isTotal||(n.dataset.slice=String(U+1),n.style.setProperty("--n",String(U)),n.style.setProperty("--palette",`var(--tablechart-color-${U+1})`),U+=1)),n.style.setProperty("--i",String(e.slot)),n.dataset.row=String(t+1),B.appendChild(n)}(O?m:n).appendChild(B),T&&n.appendChild(T);const _=a.animate?(t=>{const e=t.hasAttribute("data-fragment"),n=Array.from(t.querySelectorAll("tbody tr")),a=Array.from(t.querySelector("thead tr:last-child")?.children??[]).slice(1),o=Array.from(t.querySelectorAll("[data-annotation]")).filter(t=>ht.includes(t.getAttribute("data-annotation")??"")),r=t=>t.hasAttribute("data-fragment"),s=n.map(t=>Array.from(t.querySelectorAll(":scope > td")));if(!(e||n.some(r)||a.some(r)||s.flat().some(r)||o.some(r)))return null;const c=[],l=new Map,i=[],u=t=>{let e=null!==t?l.get(t):void 0;return void 0===e&&(e=c.length,c.push(t),i.push(0),null!==t&&l.set(t,e)),e};let d=0;const h="donut"===t.getAttribute("data-chart"),f=t=>h&&"total"===t.getAttribute("data-kind"),b=n.map(t=>{if(f(t))return{step:null,slot:0};if(!e&&!r(t))return{step:null,slot:d++};const n=u(t.getAttribute("data-fragment-index"));return{step:n,slot:i[n]++}}),m=Math.max(-1,...b.map(t=>t.step??-1));if(m>=0)for(const[$,y]of n.entries())f(y)&&(b[$]={step:m,slot:i[m]++});const p=a.map(t=>({step:r(t)?u(t.getAttribute("data-fragment-index")):null})),g=s.map(t=>t.map(()=>({step:null,slot:0}))),w=Math.max(0,...s.map(t=>t.length));for(let $=0;$<w;$++)for(const[t,e]of s.entries()){const n=e[$];if(!n||!r(n))continue;const a=u(n.getAttribute("data-fragment-index"));g[t][$]={step:a,slot:i[a]++}}return{rows:b,series:p,cells:g,notes:o.map(t=>{const e=(e,n)=>{const a=Number.parseInt(t.getAttribute(e)??"",10);return Number.isFinite(a)?a-1:n},[n,a]="bracket"===t.getAttribute("data-annotation")?[e("data-from",0),e("data-to",b.length-1)]:[0,b.length-1];let o=null;for(let r=Math.min(n,a);r<=Math.max(n,a);r++)for(const t of[b[r]?.step??null,...(g[r]??[]).map(t=>t.step)])null!==t&&(null===o||t>o)&&(o=t);const s=p[e("data-series",0)]?.step??null;null!==s&&(null===o||s>o)&&(o=s),r(t)&&(o=u(t.getAttribute("data-fragment-index")));const c=null===o?b.length:b.filter(t=>t.step===o).length;return{step:o,after:c}}),count:c.length,indexes:c}})(n):null;_&&n.setAttribute("data-steps","");const E=n.getAttribute("data-chart-keys"),F=_&&a.controls?((t,e,n)=>{const a=document.createElement("div");a.className="tablechart-controls";const o=a=>{const o=document.createElement("button");o.type="button",o.className=`tablechart-${a}`,o.dataset.go=a;const r=document.createElement("span");r.className="tablechart-control-icon",r.setAttribute("aria-hidden","true");const s=$("svg",{viewBox:"0 0 16 16",focusable:"false"});s.appendChild($("path",{d:"next"===a?"M6 3l5 5-5 5":"M10 3L5 8l5 5"})),r.appendChild(s);const c=document.createElement("span");c.className="tablechart-control-label",c.textContent=t[a];const l=e[a];l&&n&&c.setAttribute(n,l);const i=document.createElement("span");return i.className=d,i.textContent=t.hint,e.hint&&n&&i.setAttribute(n,e.hint),o.append(..."next"===a?[c,i,r]:[r,c,i]),o};return a.append(o("previous"),o("next")),a})({previous:a.previouslabel,next:a.nextlabel,hint:a.stephint},{previous:E&&`${E}-previous`,next:E&&`${E}-next`,hint:E&&`${E}-step`},a.langattribute):null;F&&n.appendChild(F);const j=n.getAttribute("data-chart-table"),q=j&&Dt.includes(j)?j:a.table;if("never"===q)n.removeAttribute("data-table");else{n.setAttribute("data-table",q);const t=n.querySelector(":scope > table");t&&n.append(t)}const R=Array.from(n.querySelectorAll("[data-annotation]")).map(e=>{const n=e.getAttribute("data-annotation"),a=Ut[n];if(!a)return console.warn(`[${t}] Unknown annotation "${n}". Known annotations: ${Object.keys(Ut).join(", ")}.`),null;const o=Number.parseInt(e.getAttribute("data-series")??"1",10),r=o>=1&&o<=u.length?o-1:0;return o!==r+1&&console.warn(`[${t}] An annotation reads line ${o}, which is not there; it reads line 1.`),{spec:e,type:a,badge:a.create(e,m),series:r,after:l.length}}).filter(t=>null!==t);a.animate&&n.setAttribute("data-animate",Wt(n,r,a,Boolean(_)));const D={figure:n,plot:m,svg:p,rows:l,decimals:w,type:s,values:v,series:u,seriesValues:y,names:T?[]:z,categories:Array.from(B.children),centre:C,stacked:b,totals:k,totalCell:L,rowAt:null,rowBox:null,annotations:R,checks:[],plan:_,step:0,controls:F};F?.addEventListener("click",t=>{const e=t.target.closest("button")?.dataset.go;e&&bt(D,D.step+("next"===e?1:-1))}),bt(D,0,!0);const V=n.getAttribute("data-chart-tooltip")??n.getAttribute("data-chart-hover"),W="false"!==V&&("auto"===V?"auto":null!==V||!1!==a.hover&&a.tooltip);return W&&((t,e,n=!1)=>{const{plot:a}=t;a.setAttribute("data-hover",""),(()=>{if(At)return;At=!0,document.addEventListener("pointermove",t=>{"mouse"===t.pointerType&&(kt=t.screenX!==xt||t.screenY!==Nt,xt=t.screenX,Nt=t.screenY,kt&&(vt=!1))},{capture:!0,passive:!0});const t=()=>{vt=!0,Mt()};document.addEventListener("keydown",t,!0),window.addEventListener("scroll",t,{capture:!0,passive:!0})})();const o=new Set,r=t=>{for(const e of o)if(e.isConnected){if(e.getAttribute("data-row")===String(t+1))return!0}else o.delete(e);return!1};let s=null;const c=o=>{if("pointerdown"===o.type)vt=!1;else if("mouse"===o.pointerType&&(!kt||vt))return;if(!a.classList.contains("is-placed")||!t.figure.classList.contains("is-shown"))return;if(n&&!t.figure.hasAttribute("data-left-out"))return wt===t?Mt():void 0;const c=(e=>{if(t.rowAt){const n=a.getBoundingClientRect(),o=St(a,n.width);return t.rowAt((e.clientX-n.left)/o,(e.clientY-n.top)/o)}const n=e.target.closest?.("[data-row]")?.getAttribute("data-row");return n?Number(n)-1:null})(o);if(s=c,null===c||r(c))return wt===t?Ht():void 0;Lt(t,c,e)},l=e=>{const n=e.target;return t.svg.contains(n)&&n.hasAttribute("data-row")?n:null};t.svg.addEventListener("transitionrun",t=>{const e=l(t);e&&o.add(e)});const i=n=>{const a=l(n);if(!a)return;o.delete(a);const c=Number(a.getAttribute("data-row"))-1;s!==c||r(c)||vt||Lt(t,c,e)};t.svg.addEventListener("transitionend",i),t.svg.addEventListener("transitioncancel",i),a.addEventListener("pointermove",c),a.addEventListener("pointerdown",c),a.addEventListener("pointerleave",e=>{"mouse"===e.pointerType&&(s=null,wt===t&&Ht())})})(D,a,"auto"===W),Zt(D,a),D},Rt={grow:"grow",sweep:"sweep"},Dt=["never","auto","print","always"],Vt={...Rt,up:"grow",across:"sweep"},Wt=(t,e,n,a)=>{const o="line"===e||"area"===e,r=o?Vt:Rt,s=r[t.getAttribute("data-chart-animate")??""]??r[String(n.animate)];return o?a?"sweep":s??"sweep":"donut"===e||"waterfall"===e?s??"grow":"grow"},It=t=>{const e=getComputedStyle(t),n=(e.getPropertyValue("--tablechart-value-align")||e.getPropertyValue("--tablechart-inside-align")).trim();return"start"===n||"center"===n||"end"===n?n:null},Kt=(t,e,n,a)=>{const o=getComputedStyle(t),r=(o.getPropertyValue(n).trim()||a).match(/^(\d+(?:\.\d+)?)(px|%|em|rem)$/);if(!r)return null;const s=Number(r[1]);return"%"===r[2]?s/100*f:s*("em"===r[2]?Number.parseFloat(o.fontSize):"rem"===r[2]?Number.parseFloat(getComputedStyle(document.documentElement).fontSize):1)*e},Gt=(t,e)=>Kt(t,e,"--tablechart-bar-max","60px")??Number.POSITIVE_INFINITY,Zt=(t,e)=>{const n=[...t.seriesValues.flat(),...t.totals,...t.totalCell?[t.totalCell]:[]];for(const a of t.centre?[...n,t.centre]:n){const{missing:n,prefix:o="",suffix:r=""}=a.dataset;if(void 0!==n){a.textContent=n;continue}const s=Number.parseFloat(a.dataset.value||"0"),c=a.dataset.decimals?Number(a.dataset.decimals):t.decimals,[l,i]=T(s,c,e.locale);if(a.textContent=o+(o?l:"")+i+r,l&&!o){const t=document.createElement("span");t.className="tablechart-minus",t.textContent=l,a.prepend(t)}}},Jt=(t,e)=>{t.figure.classList.toggle("is-shown",e)},Qt=t=>"id"===t||"style"===t||t.startsWith("data-chart"),Xt=/^\s*(?:Table)?:\s+/,Yt=t=>"P"===t?.tagName&&Xt.test(t.textContent??""),te=/^\s*([a-z][\w-]*)((?:\s+[\w-]+=[^\s:]+)*)\s*(:\s*|$)/,ee=t=>{const e=ae(t);return"P"===e?.tagName?e:t},ne=t=>{if(!t||"object"!=typeof t)return;const e=Object.entries(t),n=t=>null===t||"string"==typeof t||"number"==typeof t;return e.length&&e.every(([,t])=>n(t)||Array.isArray(t)&&t.every(n))?e.map(([t,e])=>Array.isArray(e)?{label:t,values:e}:{label:t,value:e}):void 0},ae=t=>{const e=Array.from(t.childNodes).filter(t=>t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&t.textContent?.trim());return 1===e.length&&e[0]instanceof HTMLElement?e[0]:null},oe="strong, b, span.total",re="data-chart-made",se=()=>window.matchMedia("(prefers-reduced-motion: reduce)").matches,ce=new Set,le=null,ie=["column","bar"],ue=t=>{const e=t.getAttribute("data-chart")||"column";if(!ie.includes(e))return null;const n=getComputedStyle(t).getPropertyValue("--tablechart-type").trim();return ie.includes(n)?n:e},de=!1,he=async(e,n)=>{const a=(t=>t.map(t=>{const e=t.closest("p"),n=Yt(e)?e:t;if("TABLE"!==n.tagName&&"P"!==n.tagName)return n;const a=document.createElement("figure");((t,e)=>{for(const{name:n,value:a}of Array.from(t.attributes))("class"===n||Qt(n))&&(e.setAttribute(n,a),t.removeAttribute(n))})(t,a),t.classList.length||t.removeAttribute("class");const o="TABLE"===n.tagName?n:null,r=n.previousElementSibling;let s=n.nextElementSibling;const c=o?Yt(r)?r:Yt(s)?s:null:n;o&&c===s&&(s=s?.nextElementSibling??null);const l=s?.classList.contains("chart-annotations")?s:(t=>{if("UL"!==t?.tagName&&"OL"!==t?.tagName)return null;const e=Array.from(t.children),n=e.map(t=>t.hasAttribute("data-annotation")?null:(t=>{const e=ee(t).firstChild;if(e?.nodeType!==Node.TEXT_NODE)return null;const n=te.exec(e.textContent??"");if(!n||!_t.includes(n[1]))return null;if(!n[3]&&e.nextSibling)return null;const a=n[2].trim().split(/\s+/).filter(Boolean).map(t=>t.split("="));return{name:n[1],options:a,text:e,length:n[0].length}})(t));return!e.length||e.some((t,e)=>!n[e]&&!t.hasAttribute("data-annotation"))?null:(e.forEach((t,e)=>{const a=n[e],o=ee(t);if(o!==t&&o.replaceWith(...o.childNodes),a){t.setAttribute("data-annotation",a.name);for(const[e,n]of a.options)t.setAttribute(`data-${e}`,n);a.text.textContent=(a.text.textContent??"").slice(a.length)}t.children.length&&Array.from(t.childNodes).filter(t=>t.nodeType===Node.ELEMENT_NODE||t.textContent?.trim()).forEach((t,e)=>{const n=document.createElement("span");0===e&&t instanceof HTMLElement&&t.matches("em, i")?(n.className="tablechart-caption",n.append(...t.childNodes),t.replaceWith(n)):t.nodeType===Node.TEXT_NODE&&(n.textContent=(t.textContent??"").trim(),t.replaceWith(n))})}),t.classList.add("chart-annotations"),t)})(s);return n.replaceWith(a),c&&a.append((t=>{const e=document.createElement("figcaption");for(const{name:r,value:s}of Array.from(t.attributes))e.setAttribute(r,s);const n=t.firstChild;n?.nodeType===Node.TEXT_NODE&&(n.textContent=(n.textContent??"").replace(Xt,""),n.textContent||n.remove());const a=Array.from(t.childNodes),o=a.findIndex(t=>"BR"===t.nodeName);if(e.append(...-1===o?a:a.slice(0,o+1)),-1!==o&&o<a.length-1){const t=document.createElement("span");t.append(...a.slice(o+1)),e.append(t)}return t.remove(),e})(c)),o&&a.append(o),l&&a.append(l),it?.log?.(`A ${o?"table":"caption"} with chart attributes was wrapped in a figure of its own`),a}))(e.filter(t=>!t.hasAttribute(re)));return(e=>{const n=e.find(t=>"FIGURE"!==t.tagName);!de&&n&&(de=!0,console.warn(`[${t}] A chart is a <${n.tagName.toLowerCase()}>. Use a <figure> with a <figcaption>, so the chart has a title, also for screen readers.`,n))})(a),await(async e=>{await Promise.all(e.filter(t=>t.hasAttribute("data-chart-src")).map(async e=>{const n=e.getAttribute("data-chart-src"),a=Array.from(e.querySelectorAll("table")).find(t=>t.tHead)??null;for(const t of e.querySelectorAll("table"))t!==a&&t.remove();try{const t=await fetch(n);if(!t.ok)throw new Error(`${t.status} ${t.statusText}`);const o=await t.json(),r=Array.isArray(o)?o:o?.rows?Array.isArray(o.rows)?o.rows:ne(o.rows):ne(o);if(!Array.isArray(r))throw new Error("no rows in it: a list of rows, an object with rows, or names with their values");const s=((t,e,n,a=document.createElement("table"))=>{for(const r of a.querySelectorAll(":scope > tbody, :scope > tfoot, :scope > tr"))r.remove();if(!a.tHead&&(e.length||n)){const t=a.createTHead().insertRow(),o=document.createElement("th");o.textContent=n,t.append(o);for(const n of e){const e=document.createElement("th");e.textContent=n,t.append(e)}}const o=document.createElement("tbody");a.append(o);for(const r of t){const t=o.insertRow();"total"===r.kind&&(t.dataset.kind="total");const e=document.createElement("th");e.textContent=String(r.label??""),t.append(e);for(const n of r.values??[r.value??null])t.insertCell().textContent=null===n?"":String(n)}return a})(r,Array.isArray(o?.series)?o.series.map(String):[],"string"==typeof o?.label?o.label:"",a??void 0);if(!a){const t=e.querySelector(":scope > figcaption");t?t.after(s):e.prepend(s)}s.tHead||it?.log?.(`The table from "${n}" has no header row, so a screen reader cannot name its columns.`),it?.log?.(`Read ${r.length} rows from "${n}"`)}catch(o){const e="file:"===window.location.protocol;console.warn(`[${t}] Could not read the chart data in "${n}": ${o.message}.`+(e?" A page opened as a file cannot fetch files; open it from a server.":""))}}))})(a),(t=>{for(const e of t){for(const n of e.querySelectorAll("tbody tr")){const t=n.cells[0];if("TD"!==t?.tagName||n.cells.length<2)continue;const e=document.createElement("th");for(const{name:n,value:a}of Array.from(t.attributes))e.setAttribute(n,a);e.append(...t.childNodes),t.replaceWith(e);for(let a=ae(e);a?.matches(oe);a=ae(e))n.dataset.kind="total",a.replaceWith(...a.childNodes)}const t=Array.from(e.querySelector("thead tr:last-child")?.children??[]);for(const e of t.slice(1))for(let t=ae(e);t?.matches(oe);t=ae(e))e.setAttribute("data-kind","focus"),t.replaceWith(...t.childNodes)}})(a),((e,n)=>{if(!n)return;const a=new Map;for(const o of e){let e=o.getAttribute("data-chart-keys")||null;if(!e)continue;if(a.has(e)){const n=a.get(e)+1;a.set(e,n),console.warn(`[${t}] Two charts have data-chart-keys="${e}", so this one uses "${e}-${n}" to keep their translations apart.`),e=`${e}-${n}`}else a.set(e,1);o.querySelectorAll("tbody th").forEach((t,a)=>{t.getAttribute(n)||t.setAttribute(n,`${e}-row${a+1}`)});const r=dt(o);r.length>1&&r.forEach((t,a)=>{t.getAttribute(n)||t.setAttribute(n,`${e}-col${a+1}`)}),it?.log?.(`Keys for "${e}" written onto ${o.querySelectorAll("tbody th").length} rows`)}})(a,n.langattribute),a},fe=(e,a)=>{const o=it.timed("Building",e,()=>qt(e,a));return o?(e.setAttribute(re,""),((e,a)=>{let o=e,r=ue(o.figure),u=null,d=!1,b=!1;const m=async()=>{if(!a.animate)return Jt(o,!0);const t=o.figure.classList.contains("is-shown");if(!d||null===u||t||b)!d&&a.replay&&t&&Jt(o,!1);else{b=!0;const t=se()?null:(t=>{for(let e=t;e&&e!==document.body;e=e.parentElement)if("0"===getComputedStyle(e).opacity)return e;return null})(o.figure);t&&await(e=t,new Promise(t=>{const n=["animationstart","transitionrun"],a=()=>{for(const t of n)document.removeEventListener(t,o,!0);r.disconnect(),t()},o=t=>{t.target instanceof Node&&t.target.contains(e)&&a()},r=new MutationObserver(()=>{"0"!==getComputedStyle(e).opacity&&a()});for(const e of n)document.addEventListener(e,o,!0);r.observe(e,{attributes:!0,attributeFilter:["class","style"]})})),await(async(t,e)=>{if(se())return;await new Promise(requestAnimationFrame);const n=t.getAnimations().filter(t=>t instanceof CSSAnimation);for(let r=t.parentElement;r&&r!==document.body;r=r.parentElement)n.push(...r.getAnimations());let a=0;for(const r of n){const t=r.effect?.getComputedTiming(),n=Number(t?.activeDuration??0);if(!t||!Number.isFinite(n))continue;const o=Number(t.delay??0)+n*e;a=Math.max(a,o-Number(r.currentTime??0))}var o;a>0&&await(o=a,new Promise(t=>setTimeout(t,o)))})(o.figure,((t,e)=>{const n=Number.parseFloat(t.dataset.chartEntrance??""),a=Number.isFinite(n)?n:e.entrance;return Math.min(Math.max(a,0),1)})(o.figure,a)),b=!1,!d&&a.replay||Jt(o,!0)}var e},g=()=>{const t=ue(o.figure);if(!t||t===r)return;const e=it.timed("Building",o.figure,()=>qt(o.figure,a,t));e&&((t=>{Ot(t),t.plot.remove(),t.categories[0]?.parentElement?.remove(),t.figure.querySelector(`:scope > .${c}`)?.remove(),t.controls?.remove()})(o),bt(e,o.step,!0),o=e,r=t,u=null)},y=()=>{g();const e=o.plot.clientWidth;e&&e!==u&&it.timed("Layout",o.figure,()=>((e,a)=>{const{plot:o,svg:r,rows:c,type:u,values:d,series:h,seriesValues:b,names:m,annotations:g}=e,y=o.clientWidth;if(!y)return!1;const M=f/y,v=Number.parseFloat(e.figure.dataset.chartAspect??""),k=f*(v>0?v:u.aspect??a.aspect);o.classList.add("is-placed");for(const t of[...b.flat(),...e.totals])delete t.dataset.place;o.style.removeProperty("--_fit"),e.categories[0]?.parentElement?.style.removeProperty("--_beside"),(t=>{const e=[...t].filter(t=>!!t),n=e.map(t=>({width:t.offsetWidth,height:t.offsetHeight}));e.forEach((t,e)=>O.set(t,n[e]))})([...b.flat(),...e.totals,...m,...e.categories,...g.map(t=>t.badge)]);const N=(d[0]?B(d[0]).height:0)*M,A=g[0]?.badge?B(g[0].badge).height*M:0,H=Math.max(k,Kt(e.figure,M,"--tablechart-min-height","200px")??0,u.minHeight?.({labelHeight:N,nameHeight:Math.max(0,S(e.categories.map(t=>B(t).height)))*M,unit:M,rows:c.length,series:h.length,stacked:e.stacked})??0),T=e.stacked?c.map(t=>{const e=P(t,h.length);return{...t,value:e,cells:t.cells.map((t,n)=>0===n?{...t,value:e}:t)}}):c,z=(u.segments??(t=>t.map(t=>({...t,from:0,to:t.value,kind:"bar"}))))(e.stacked?T.map(t=>({...t,cells:[t.cells[0]]})):c),C={labelHeight:N,badgeHeight:A,hasAnnotations:g.length>0,unit:M,series:h.length,focused:h.some(t=>t.focus),stacked:e.stacked},L=Math.max((U=S,e.stacked?U(c.map(t=>j(t,h.length,u.running).top)):U([...z.flatMap(t=>[t.from,t.to,t.value]),...c.flatMap(t=>t.cells.slice(0,h.length).map(t=>t.value))])),0);var U;const _=z.some(t=>"up"===t.kind||"down"===t.kind)?z.flatMap(t=>[t.from,t.to]):e.stacked?c.map(t=>j(t,h.length,u.running).bottom):c.flatMap(t=>t.cells.slice(0,h.length).map(t=>t.value)),E=Math.min(-S(_.map(t=>-t)),0),F=u.headroom?.(C)??N,q=2*M+(u.footroom?.(C)??0)+(E<0?N+4*M:0),R=H-F-q,D=1.02*L,V=1.02*E,W=g.find(t=>"axis-break"===t.spec.getAttribute("data-annotation"))?.spec,K=t=>{const e=Number.parseFloat(W?.getAttribute(t)??"");return Number.isFinite(e)?e:null},G=K("data-from")??K("data-at"),Z=K("data-to");let J=null;if(W&&(null!==G||null!==Z)){const e=G??0,n=Z??D,a=null===Z?e:null===G?n:(e+n)/2,o=W.getAttribute("data-size"),r=o?.match(/^\s*(\d+(?:\.\d+)?)\s*%\s*$/);null===o||r||console.warn(`[${t}] data-size="${o}" is not a percentage, such as 30%. Using the default.`);const s=Math.min(Math.max(r?Number(r[1])/100:null===Z?.22:.3,.05),.8),c=z.filter(t=>("up"===t.kind||"down"===t.kind)&&Math.max(t.from,t.to)>e&&Math.min(t.from,t.to)<n);u.breakable?E<0?console.warn(`[${t}] A chart with values below zero cannot break its scale.`):e<0||n<=e||n>D||0===e&&n===D?console.warn(`[${t}] A break from ${e} to ${n} does not fit a scale that runs from 0 to ${L}.`):c.length?console.warn(`[${t}] A break from ${e} to ${n} would cut a step that floats. Keep it below or above the steps.`):J={lo:e,hi:n,gap:a,share:s}:console.warn(`[${t}] This kind of chart cannot break its scale.`)}const Q=J?J.gap:null,X=(J&&Kt(e.figure,M,"--tablechart-break-gap",""))??13,Y=H-q,tt=D-V||1;let et=t=>Y-(t-V)/tt*R;if(J){const{lo:t,hi:e,gap:n,share:a}=J,o=R*a,r=(R-o-X)/(t+(D-e)),s=o/(e-t);et=a=>a<=t?Y-a*r:a<=n?Y-t*r-(a-t)*s:a<=e?Y-t*r-(a-t)*s-X:Y-t*r-o-X-(a-e)*r}const nt=m.length?S(m.map(t=>B(t).width))*M+12*M:0,at=e.categories[0]?.parentElement;at&&(at.style.paddingRight=nt?nt/f*100+"%":"");const ot=(f-nt)/c.length,rt=t=>t>=0&&t<c.length?t:null;e.rowAt=u.centre?null:"beside"===u.categories?(t,e)=>rt(Math.floor(e*M/(H/c.length))):t=>rt(Math.floor(t*M/ot));const st=ot/f*100,ct=100/c.length;e.rowBox="beside"===u.categories?t=>[0,t*ct,100,ct]:t=>[t*st,0,st,100],r.setAttribute("viewBox",`0 0 1000 ${w(H)}`),r.textContent="",e.checks=[];const lt={rows:c,segments:z,cx:t=>(t+.5)*ot,y:et,barWidth:Math.min(ot*a.barfill,Gt(e.figure,M)),barMax:Gt(e.figure,M),height:H,unit:M,labelHeight:N,badgeHeight:A,after:c.length,note:0,labels:"inside"===e.figure.dataset.chartLabels||"outside"!==e.figure.dataset.chartLabels&&"inside"===a.labels?"inside":"outside",insideAlign:It(e.figure),breakAt:Q,squeeze:J,breakGap:X,stacked:e.stacked,shape:jt(e.figure,a),totals:e.totals,svg:r,plot:o,values:d,series:h,seriesValues:b,names:m,categories:e.categories,centre:e.centre,config:a,checks:e.checks};o.style.setProperty("--count",String(Math.max(1,...c.map(t=>t.slot+1)))),u.draw(lt);for(const[t,n]of g.entries()){n.badge?.setAttribute("data-note",String(t+1));const a=n.series,o=t=>({...t,...t.cells[a]??t.cells[0]});n.type.draw(n.spec,n.badge,{...lt,...e.stacked&&{rows:T,...e.totals.length&&{values:e.totals}},...a>0&&!e.stacked&&{rows:c.map(o),segments:z.map(t=>{const e=o(t);return"bar"===t.kind?{...e,to:e.value}:e}),values:b[a]},after:n.after,note:t+1})}(t=>{const e=t.plan;if(!e)return;const a=e.rows.length-1,o=t=>e.series.map((n,a)=>e.cells[t]?.[a]?.step??n.step??e.rows[t]?.step??null),r=t=>{const e=o(t);return e.some(t=>null===t)?null:Math.min(...e)},c=new Set(t.totals),l=(t,e,n,a)=>{t.style.setProperty(n,String(a)),t.style.removeProperty("--d"),null===e?t.style.removeProperty("--step"):t.style.setProperty("--step",String(e))};for(const n of t.figure.querySelectorAll("[data-row], [data-series], [data-note]")){if(n.closest("table, .tablechart-controls")||n.hasAttribute("data-from"))continue;const t=Number(n.dataset.note);if(t>0){const a=e.notes[t-1];a&&l(n,a.step,"--after",a.after);continue}const s=n.dataset.row?Number(n.dataset.row)-1:a;if(n.classList.contains("tablechart-connector")){const t=e.rows[s-1],a=e.rows[s];if(t&&a){const e=(t.step??-1)>(a.step??-1);l(n,e?t.step:a.step,"--i",e?t.slot+1:a.slot)}continue}if(c.has(n)){const t=o(s).filter(t=>null!==t);l(n,t.length?Math.max(...t):null,"--i",e.rows[s]?.slot??0);continue}if(n.hasAttribute("data-stack")){l(n,r(s),"--i",e.rows[s]?.slot??0);continue}const i=n.dataset.series?Number(n.dataset.series)-1:0,u=n.dataset.series?e.series[i]:void 0;if(n.classList.contains("tablechart-piece")){const t=o(s)[i]??null,a=e.cells[s]?.[i];l(n,t===r(s)?null:t,"--i",a&&null!==a.step?a.slot:s);continue}if("legend"===n.dataset.place){const t=Math.min(...e.cells.map(t=>t[i]?.step??Number.POSITIVE_INFINITY));l(n,u?.step??(Number.isFinite(t)?t:null),"--i",0);continue}const d=e.cells[s]?.[i];d&&null!==d.step?l(n,d.step,"--i",d.slot):u&&null!==u.step?l(n,u.step,"--i",s):e.rows[s]&&l(n,e.rows[s].step,"--i",e.rows[s].slot)}const u=t.figure.querySelector(`.${i}`);if(u){const t=[...e.rows,...e.cells.flat()].map(t=>t.step??-1),n=Math.max(-1,...t);n<0?l(u,null,"--i",0):l(u,n,"--i",t.filter(t=>t===n).length)}const d=[...e.rows,...e.cells.flat()].map(t=>t.slot+1),h=e.series.some(t=>null!==t.step)?e.rows.length:1;t.plot.style.setProperty("--count",String(Math.max(h,...d)));const f=t.figure.querySelectorAll(`.${n}`),b=f[f.length-1];if("waterfall"===t.figure.dataset.chart&&"total"===b?.dataset.kind&&f.length>1){const t=Number(b.dataset.row)-1;(e.rows[t-1]?.step??-1)>(e.rows[t]?.step??-1)&&(b.dataset.grow="down"===b.dataset.grow?"up":"down")}const m=Array.from(t.figure.querySelectorAll(`.${s}`));if(m.length){const e=t=>t.style.getPropertyValue("--step")||"none",n=t=>Number(t.style.getPropertyValue("--share")||0),a=m.length,o=Math.max(0,m.findIndex((t,n)=>e(t)!==e(m[(n-1+a)%a]))),r=[];for(let t=0;t<a;t++){const n=m[(o+t)%a],s=r[r.length-1];s&&e(s[0])===e(n)?s.push(n):r.push([n])}const s=new Map;for(const t of r){const e=t.reduce((t,e)=>t+n(e),0);let a=0;for(const o of t)s.set(o.dataset.row??"",p(a,n(o),e)),a+=n(o)}for(const c of t.figure.querySelectorAll("[data-row]")){const t=s.get(c.dataset.row??"");t&&c.style.getPropertyValue("--start")&&(c.style.setProperty("--start",t.start.toFixed(4)),c.style.setProperty("--span",t.span.toFixed(4)),c.classList.contains("tablechart-slice")&&c.style.setProperty("--ease",t.easing))}}ft(t)})(e);const it=e.categories[0]?.parentElement;it&&"beside"!==u.categories&&!u.centre&&I(it,e.categories.filter(t=>null!==t.offsetParent),t=>({size:t.scrollWidth,room:t.clientWidth}),"--_name-fit");const ut=g.flatMap(({badge:t})=>{if(!(t instanceof HTMLElement&&t.offsetWidth))return[];const e=t.offsetWidth*M,n=t.offsetHeight*M,a=Number.parseFloat(t.style.left)/100*f,o=Number.parseFloat(t.style.top)/100*H,r=getComputedStyle(t).borderTopLeftRadius,s=r.endsWith("%")?Number.parseFloat(r)/100:null,c=(Number.parseFloat(r)||0)*M;return[$("rect",{class:l,"data-for":"badge","data-note":t.dataset.note??"",x:a-e/2,y:o-n/2,width:e,height:n,rx:null===s?c:e*s,ry:null===s?c:n*s,style:["--after","--step"].map(e=>t.style.getPropertyValue(e)&&`${e}:${t.style.getPropertyValue(e)}`).filter(Boolean).join("; ")})]});x(r,ut,f,H);const dt=t=>"none"!==t.dataset.place&&!t.hasAttribute("data-left-out");return e.figure.toggleAttribute("data-left-out",[...b,e.totals].some(t=>t.some(e=>!(t=>void 0!==t.dataset.missing||u.centre&&c[Number(t.dataset.row)-1]?.isTotal)(e)&&!dt(e)&&!((t,e)=>{const n=Number(t.dataset.row);return e.some(t=>dt(t)&&Number(t.dataset.row)<=n&&n<=Number(t.dataset.rowEnd??t.dataset.row))})(e,t)))),!0})(o,a))&&(u=e,m())};let M=!1;const v=new ResizeObserver(()=>{M||(M=!0,requestAnimationFrame(()=>{M=!1,y()}))}),k=new IntersectionObserver(t=>{for(const e of t)d=e.isIntersecting,m()},{threshold:a.threshold}),N=()=>{o.figure.classList.add(h),Jt(o,!0),o.figure.offsetWidth},A=()=>o.figure.classList.remove(h),H=()=>{u=null,y()},T={relabel:()=>Zt(o,a),refresh:H};g(),y(),v.observe(o.figure),k.observe(o.figure),window.addEventListener("beforeprint",N),window.addEventListener("afterprint",A),(t=>{ce.add(t),le||(le=new MutationObserver(()=>{for(const t of ce)t.relabel();requestAnimationFrame(()=>requestAnimationFrame(()=>{for(const t of ce)t.refresh()}))})).observe(document.documentElement,{attributes:!0,attributeFilter:["lang"]})})(T);const z={figure:o.figure,refresh:H,next:()=>bt(o,o.step+1),previous:()=>bt(o,o.step-1),stepTo:t=>bt(o,t),get step(){return o.step},get steps(){return o.plan?.count??0},destroy(){v.disconnect(),k.disconnect(),window.removeEventListener("beforeprint",N),window.removeEventListener("afterprint",A),(t=>{ce.delete(t),!ce.size&&le&&(le.disconnect(),le=null)})(T),Ot(o),o.figure.tablechart===z&&delete o.figure.tablechart}};return o.figure.tablechart=z,z})(o,a)):null},be=[["--tablechart-duration","--tablechart-animation-element-duration"],["--tablechart-stagger","--tablechart-animation-stagger, a share of the element time"],["--tablechart-easing","--tablechart-animation-ease"],["--tablechart-category-size","--tablechart-name-size"],["--tablechart-category-padding","--tablechart-name-padding"],["--tablechart-categories-gap","--tablechart-name-gap"],["--tablechart-inside-align","--tablechart-value-align"],["--tablechart-bar-ink","--tablechart-bar-value-color"],["--tablechart-piece-ink","--tablechart-piece-value-color"],["--tablechart-up-ink","--tablechart-up-value-color"],["--tablechart-down-ink","--tablechart-down-value-color"],["--tablechart-total-ink","--tablechart-total-value-color"],["--tablechart-series-ink","--tablechart-series-own-color"],["--tablechart-dash","--tablechart-series-dash"],["--tablechart-dot","--tablechart-series-dot"],["--tablechart-muted-share","--tablechart-series-muted-share"],["--tablechart-rule-color","--tablechart-baseline-color"],["--tablechart-rule-width","--tablechart-baseline-width"],["--tablechart-rule-opacity","--tablechart-baseline-opacity"],["--tablechart-key-size","--tablechart-legend-key-size"],["--tablechart-controls-justify","--tablechart-control-justify"],["--tablechart-controls-gap","--tablechart-control-gap"]],me={up:"grow",across:"sweep"},pe=!1;window.Tablechart={init:async(e={},n=document)=>{const a={...b,...e};a.debug&&(it.enabled=!0);const o=await he(Array.from(n.querySelectorAll(a.selector)),a);((e,n)=>{if(pe)return;const a=t=>{const e=me[String(t)];return e?[`"${t}" is now "${e}"`]:[]},o=new Set(a(n.animate));void 0!==n.hover&&o.add('the "hover" option is now "tooltip"');for(const t of e){t.hasAttribute("data-chart-hover")&&o.add("data-chart-hover is now data-chart-tooltip");const e=getComputedStyle(t);for(const[t,n]of be)e.getPropertyValue(t).trim()&&o.add(`${t} is now ${n}`);for(const n of a(t.getAttribute("data-chart-animate")))o.add(n)}o.size&&(pe=!0,console.warn(`[${t}] ${[...o].join("; ")}. The old names work until the next minor version.`))})(o,a);const r=o.map(t=>fe(t,a)).filter(t=>null!==t);return it.log(`Made ${r.length} chart(s).`),{charts:r,refresh:()=>{for(const t of r)t.refresh()},destroy:()=>{for(const t of r)t.destroy()}}},create:async(t,e={})=>{if(t.tablechart)return t.tablechart;const n={...b,...e};n.debug&&(it.enabled=!0);const[a]=await he([t],n);return a?fe(a,n):null},defaultConfig:b}}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@martinomagnifico/tablechart",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "Simple charts from an HTML or Markdown table: column, bar, line, area, waterfall and donut, with annotations. A chart builds when it scrolls into view.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|