chartist 2.0.0-rc.1 → 2.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/chartist.min.css +1 -1
- package/dist/chartist.min.js +1 -1
- package/dist/compat.cjs +39 -3
- package/dist/compat.cjs.map +1 -1
- package/dist/compat.d.cts +89 -6
- package/dist/compat.d.ts +89 -6
- package/dist/compat.js +39 -3
- package/dist/compat.js.map +1 -1
- package/dist/compat.min.js +1 -1
- package/dist/compat.min.js.map +1 -1
- package/dist/compat.umd.js +1 -1
- package/dist/compat.umd.js.map +1 -1
- package/dist/index.cjs +516 -138
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +154 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +321 -51
- package/dist/index.d.ts +321 -51
- package/dist/index.js +512 -139
- package/dist/index.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.min.css.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/scss/_settings.scss +32 -2
- package/dist/scss/index.scss +10 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,7 +70,7 @@ No bundler? Chartist is a native ES module:
|
|
|
70
70
|
|
|
71
71
|
## Coming from 1.x
|
|
72
72
|
|
|
73
|
-
Your 1.x code keeps working: the chart classes draw what they drew before. 1.x events and plugins work with `chartist/compat`. [Coming from 1.x](https://chartist.dev/docs/coming-from-1x/) explains what changed and how to move to the functions.
|
|
73
|
+
Your 1.x code keeps working: the chart classes draw what they drew before. 1.x events and plugins work with `chartist/compat`. The classes are deprecated, and 3.0 removes them from `chartist`. [Coming from 1.x](https://chartist.dev/docs/coming-from-1x/) explains what changed and how to move to the functions.
|
|
74
74
|
|
|
75
75
|
## Supported by
|
|
76
76
|
|
package/dist/chartist.min.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
.ct-label{fill:var(--ct-label-color,rgba(0,0,0,.4));color:var(--ct-label-color,rgba(0,0,0,.4));font-size:var(--ct-label-size,.75rem);line-height:1}.ct-chart-bar .ct-label,.ct-chart-line .ct-label,foreignObject>.ct-label{display:flex}.ct-chart-donut .ct-label,.ct-chart-pie .ct-label{dominant-baseline:central}.ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left}.ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left}.ct-label.ct-vertical.ct-start{align-items:flex-end;justify-content:flex-end;text-align:right}.ct-label.ct-vertical.ct-end{align-items:flex-end;justify-content:flex-start;text-align:left}.ct-chart-bar .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:center;text-align:center}.ct-chart-bar .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:center;text-align:center}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start{align-items:center;justify-content:flex-end;text-align:right}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end{align-items:center;justify-content:flex-start;text-align:left}.ct-grid{stroke:var(--ct-grid-color,rgba(0,0,0,.2));stroke-width:var(--ct-grid-width,1px);stroke-dasharray:var(--ct-grid-dasharray,2px)}.ct-grid-background{fill:var(--ct-grid-background-fill,none)}.ct-point{stroke-width:var(--ct-point-size,10px);stroke-linecap:var(--ct-point-shape,round)}.ct-line{fill:none;stroke-width:var(--ct-line-width,4px);stroke-dasharray:var(--ct-line-dasharray,none)}.ct-area{stroke:none;fill-opacity:var(--ct-area-opacity,.1)}.ct-bar{fill:none;stroke-width:var(--ct-bar-width,10px)}.ct-slice-donut{fill:none;stroke-width:var(--ct-donut-width,60px)}.ct-series-a{--ct-color:var(--ct-series-a,#d70206)}.ct-series-a .ct-bar,.ct-series-a .ct-line,.ct-series-a .ct-point,.ct-series-a .ct-slice-donut{stroke:var(--ct-color)}.ct-series-a .ct-area,.ct-series-a .ct-slice-pie{fill:var(--ct-color)}.ct-series-b{--ct-color:var(--ct-series-b,#f05b4f)}.ct-series-b .ct-bar,.ct-series-b .ct-line,.ct-series-b .ct-point,.ct-series-b .ct-slice-donut{stroke:var(--ct-color)}.ct-series-b .ct-area,.ct-series-b .ct-slice-pie{fill:var(--ct-color)}.ct-series-c{--ct-color:var(--ct-series-c,#f4c63d)}.ct-series-c .ct-bar,.ct-series-c .ct-line,.ct-series-c .ct-point,.ct-series-c .ct-slice-donut{stroke:var(--ct-color)}.ct-series-c .ct-area,.ct-series-c .ct-slice-pie{fill:var(--ct-color)}.ct-series-d{--ct-color:var(--ct-series-d,#d17905)}.ct-series-d .ct-bar,.ct-series-d .ct-line,.ct-series-d .ct-point,.ct-series-d .ct-slice-donut{stroke:var(--ct-color)}.ct-series-d .ct-area,.ct-series-d .ct-slice-pie{fill:var(--ct-color)}.ct-series-e{--ct-color:var(--ct-series-e,#453d3f)}.ct-series-e .ct-bar,.ct-series-e .ct-line,.ct-series-e .ct-point,.ct-series-e .ct-slice-donut{stroke:var(--ct-color)}.ct-series-e .ct-area,.ct-series-e .ct-slice-pie{fill:var(--ct-color)}.ct-series-f{--ct-color:var(--ct-series-f,#59922b)}.ct-series-f .ct-bar,.ct-series-f .ct-line,.ct-series-f .ct-point,.ct-series-f .ct-slice-donut{stroke:var(--ct-color)}.ct-series-f .ct-area,.ct-series-f .ct-slice-pie{fill:var(--ct-color)}.ct-series-g{--ct-color:var(--ct-series-g,#0544d3)}.ct-series-g .ct-bar,.ct-series-g .ct-line,.ct-series-g .ct-point,.ct-series-g .ct-slice-donut{stroke:var(--ct-color)}.ct-series-g .ct-area,.ct-series-g .ct-slice-pie{fill:var(--ct-color)}.ct-series-h{--ct-color:var(--ct-series-h,#6b0392)}.ct-series-h .ct-bar,.ct-series-h .ct-line,.ct-series-h .ct-point,.ct-series-h .ct-slice-donut{stroke:var(--ct-color)}.ct-series-h .ct-area,.ct-series-h .ct-slice-pie{fill:var(--ct-color)}.ct-series-i{--ct-color:var(--ct-series-i,#e6805e)}.ct-series-i .ct-bar,.ct-series-i .ct-line,.ct-series-i .ct-point,.ct-series-i .ct-slice-donut{stroke:var(--ct-color)}.ct-series-i .ct-area,.ct-series-i .ct-slice-pie{fill:var(--ct-color)}.ct-series-j{--ct-color:var(--ct-series-j,#dda458)}.ct-series-j .ct-bar,.ct-series-j .ct-line,.ct-series-j .ct-point,.ct-series-j .ct-slice-donut{stroke:var(--ct-color)}.ct-series-j .ct-area,.ct-series-j .ct-slice-pie{fill:var(--ct-color)}.ct-series-k{--ct-color:var(--ct-series-k,#eacf7d)}.ct-series-k .ct-bar,.ct-series-k .ct-line,.ct-series-k .ct-point,.ct-series-k .ct-slice-donut{stroke:var(--ct-color)}.ct-series-k .ct-area,.ct-series-k .ct-slice-pie{fill:var(--ct-color)}.ct-series-l{--ct-color:var(--ct-series-l,#86797d)}.ct-series-l .ct-bar,.ct-series-l .ct-line,.ct-series-l .ct-point,.ct-series-l .ct-slice-donut{stroke:var(--ct-color)}.ct-series-l .ct-area,.ct-series-l .ct-slice-pie{fill:var(--ct-color)}.ct-series-m{--ct-color:var(--ct-series-m,#b2c326)}.ct-series-m .ct-bar,.ct-series-m .ct-line,.ct-series-m .ct-point,.ct-series-m .ct-slice-donut{stroke:var(--ct-color)}.ct-series-m .ct-area,.ct-series-m .ct-slice-pie{fill:var(--ct-color)}.ct-series-n{--ct-color:var(--ct-series-n,#6188e2)}.ct-series-n .ct-bar,.ct-series-n .ct-line,.ct-series-n .ct-point,.ct-series-n .ct-slice-donut{stroke:var(--ct-color)}.ct-series-n .ct-area,.ct-series-n .ct-slice-pie{fill:var(--ct-color)}.ct-series-o{--ct-color:var(--ct-series-o,#a748ca)}.ct-series-o .ct-bar,.ct-series-o .ct-line,.ct-series-o .ct-point,.ct-series-o .ct-slice-donut{stroke:var(--ct-color)}.ct-series-o .ct-area,.ct-series-o .ct-slice-pie{fill:var(--ct-color)}.ct-square{display:block;position:relative;width:100%}.ct-square:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:100%}.ct-square:after{content:"";display:table;clear:both}.ct-square>svg{display:block;position:absolute;top:0;left:0}.ct-minor-second{display:block;position:relative;width:100%}.ct-minor-second:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:93.75%}.ct-minor-second:after{content:"";display:table;clear:both}.ct-minor-second>svg{display:block;position:absolute;top:0;left:0}.ct-major-second{display:block;position:relative;width:100%}.ct-major-second:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:88.8888888889%}.ct-major-second:after{content:"";display:table;clear:both}.ct-major-second>svg{display:block;position:absolute;top:0;left:0}.ct-minor-third{display:block;position:relative;width:100%}.ct-minor-third:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:83.3333333333%}.ct-minor-third:after{content:"";display:table;clear:both}.ct-minor-third>svg{display:block;position:absolute;top:0;left:0}.ct-major-third{display:block;position:relative;width:100%}.ct-major-third:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:80%}.ct-major-third:after{content:"";display:table;clear:both}.ct-major-third>svg{display:block;position:absolute;top:0;left:0}.ct-perfect-fourth{display:block;position:relative;width:100%}.ct-perfect-fourth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:75%}.ct-perfect-fourth:after{content:"";display:table;clear:both}.ct-perfect-fourth>svg{display:block;position:absolute;top:0;left:0}.ct-perfect-fifth{display:block;position:relative;width:100%}.ct-perfect-fifth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:66.6666666667%}.ct-perfect-fifth:after{content:"";display:table;clear:both}.ct-perfect-fifth>svg{display:block;position:absolute;top:0;left:0}.ct-minor-sixth{display:block;position:relative;width:100%}.ct-minor-sixth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:62.5%}.ct-minor-sixth:after{content:"";display:table;clear:both}.ct-minor-sixth>svg{display:block;position:absolute;top:0;left:0}.ct-golden-section{display:block;position:relative;width:100%}.ct-golden-section:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:61.804697157%}.ct-golden-section:after{content:"";display:table;clear:both}.ct-golden-section>svg{display:block;position:absolute;top:0;left:0}.ct-major-sixth{display:block;position:relative;width:100%}.ct-major-sixth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:60%}.ct-major-sixth:after{content:"";display:table;clear:both}.ct-major-sixth>svg{display:block;position:absolute;top:0;left:0}.ct-minor-seventh{display:block;position:relative;width:100%}.ct-minor-seventh:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:56.25%}.ct-minor-seventh:after{content:"";display:table;clear:both}.ct-minor-seventh>svg{display:block;position:absolute;top:0;left:0}.ct-major-seventh{display:block;position:relative;width:100%}.ct-major-seventh:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:53.3333333333%}.ct-major-seventh:after{content:"";display:table;clear:both}.ct-major-seventh>svg{display:block;position:absolute;top:0;left:0}.ct-octave{display:block;position:relative;width:100%}.ct-octave:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:50%}.ct-octave:after{content:"";display:table;clear:both}.ct-octave>svg{display:block;position:absolute;top:0;left:0}.ct-major-tenth{display:block;position:relative;width:100%}.ct-major-tenth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:40%}.ct-major-tenth:after{content:"";display:table;clear:both}.ct-major-tenth>svg{display:block;position:absolute;top:0;left:0}.ct-major-eleventh{display:block;position:relative;width:100%}.ct-major-eleventh:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:37.5%}.ct-major-eleventh:after{content:"";display:table;clear:both}.ct-major-eleventh>svg{display:block;position:absolute;top:0;left:0}.ct-major-twelfth{display:block;position:relative;width:100%}.ct-major-twelfth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:33.3333333333%}.ct-major-twelfth:after{content:"";display:table;clear:both}.ct-major-twelfth>svg{display:block;position:absolute;top:0;left:0}.ct-double-octave{display:block;position:relative;width:100%}.ct-double-octave:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:25%}.ct-double-octave:after{content:"";display:table;clear:both}.ct-double-octave>svg{display:block;position:absolute;top:0;left:0}
|
|
1
|
+
.ct-label{fill:var(--ct-label-color,rgba(0,0,0,.4));color:var(--ct-label-color,rgba(0,0,0,.4));font-size:var(--ct-label-size,.75rem);line-height:1}.ct-chart-bar .ct-label,.ct-chart-line .ct-label,foreignObject>.ct-label{display:flex}.ct-chart-donut .ct-label,.ct-chart-pie .ct-label{dominant-baseline:central}.ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left}.ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left}.ct-label.ct-vertical.ct-start{align-items:flex-end;justify-content:flex-end;text-align:right}.ct-label.ct-vertical.ct-end{align-items:flex-end;justify-content:flex-start;text-align:left}.ct-chart-bar .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:center;text-align:center}.ct-chart-bar .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:center;text-align:center}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-start{align-items:flex-end;justify-content:flex-start;text-align:left}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-horizontal.ct-end{align-items:flex-start;justify-content:flex-start;text-align:left}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-start{align-items:center;justify-content:flex-end;text-align:right}.ct-chart-bar.ct-horizontal-bars .ct-label.ct-vertical.ct-end{align-items:center;justify-content:flex-start;text-align:left}.ct-grid{stroke:var(--ct-grid-color,rgba(0,0,0,.2));stroke-width:var(--ct-grid-width,1px);stroke-dasharray:var(--ct-grid-dasharray,2px)}.ct-grid-background{fill:var(--ct-grid-background-fill,none)}.ct-point{stroke-width:var(--ct-point-size,10px);stroke-linecap:var(--ct-point-shape,round)}.ct-line{fill:none;stroke-width:var(--ct-line-width,4px);stroke-dasharray:var(--ct-line-dasharray,none)}.ct-area{stroke:none;fill-opacity:var(--ct-area-opacity,.1)}.ct-bar{fill:none;stroke-width:var(--ct-bar-width,10px)}.ct-slice-donut{fill:none;stroke-width:var(--ct-donut-width,60px)}.ct-series-a{--ct-color:var(--ct-series-a,#d70206)}.ct-series-a .ct-bar,.ct-series-a .ct-line,.ct-series-a .ct-point,.ct-series-a .ct-slice-donut{stroke:var(--ct-color)}.ct-series-a .ct-area,.ct-series-a .ct-slice-pie{fill:var(--ct-color)}.ct-series-b{--ct-color:var(--ct-series-b,#f05b4f)}.ct-series-b .ct-bar,.ct-series-b .ct-line,.ct-series-b .ct-point,.ct-series-b .ct-slice-donut{stroke:var(--ct-color)}.ct-series-b .ct-area,.ct-series-b .ct-slice-pie{fill:var(--ct-color)}.ct-series-c{--ct-color:var(--ct-series-c,#f4c63d)}.ct-series-c .ct-bar,.ct-series-c .ct-line,.ct-series-c .ct-point,.ct-series-c .ct-slice-donut{stroke:var(--ct-color)}.ct-series-c .ct-area,.ct-series-c .ct-slice-pie{fill:var(--ct-color)}.ct-series-d{--ct-color:var(--ct-series-d,#d17905)}.ct-series-d .ct-bar,.ct-series-d .ct-line,.ct-series-d .ct-point,.ct-series-d .ct-slice-donut{stroke:var(--ct-color)}.ct-series-d .ct-area,.ct-series-d .ct-slice-pie{fill:var(--ct-color)}.ct-series-e{--ct-color:var(--ct-series-e,#453d3f)}.ct-series-e .ct-bar,.ct-series-e .ct-line,.ct-series-e .ct-point,.ct-series-e .ct-slice-donut{stroke:var(--ct-color)}.ct-series-e .ct-area,.ct-series-e .ct-slice-pie{fill:var(--ct-color)}.ct-series-f{--ct-color:var(--ct-series-f,#59922b)}.ct-series-f .ct-bar,.ct-series-f .ct-line,.ct-series-f .ct-point,.ct-series-f .ct-slice-donut{stroke:var(--ct-color)}.ct-series-f .ct-area,.ct-series-f .ct-slice-pie{fill:var(--ct-color)}.ct-series-g{--ct-color:var(--ct-series-g,#0544d3)}.ct-series-g .ct-bar,.ct-series-g .ct-line,.ct-series-g .ct-point,.ct-series-g .ct-slice-donut{stroke:var(--ct-color)}.ct-series-g .ct-area,.ct-series-g .ct-slice-pie{fill:var(--ct-color)}.ct-series-h{--ct-color:var(--ct-series-h,#6b0392)}.ct-series-h .ct-bar,.ct-series-h .ct-line,.ct-series-h .ct-point,.ct-series-h .ct-slice-donut{stroke:var(--ct-color)}.ct-series-h .ct-area,.ct-series-h .ct-slice-pie{fill:var(--ct-color)}.ct-series-i{--ct-color:var(--ct-series-i,#e6805e)}.ct-series-i .ct-bar,.ct-series-i .ct-line,.ct-series-i .ct-point,.ct-series-i .ct-slice-donut{stroke:var(--ct-color)}.ct-series-i .ct-area,.ct-series-i .ct-slice-pie{fill:var(--ct-color)}.ct-series-j{--ct-color:var(--ct-series-j,#dda458)}.ct-series-j .ct-bar,.ct-series-j .ct-line,.ct-series-j .ct-point,.ct-series-j .ct-slice-donut{stroke:var(--ct-color)}.ct-series-j .ct-area,.ct-series-j .ct-slice-pie{fill:var(--ct-color)}.ct-series-k{--ct-color:var(--ct-series-k,#eacf7d)}.ct-series-k .ct-bar,.ct-series-k .ct-line,.ct-series-k .ct-point,.ct-series-k .ct-slice-donut{stroke:var(--ct-color)}.ct-series-k .ct-area,.ct-series-k .ct-slice-pie{fill:var(--ct-color)}.ct-series-l{--ct-color:var(--ct-series-l,#86797d)}.ct-series-l .ct-bar,.ct-series-l .ct-line,.ct-series-l .ct-point,.ct-series-l .ct-slice-donut{stroke:var(--ct-color)}.ct-series-l .ct-area,.ct-series-l .ct-slice-pie{fill:var(--ct-color)}.ct-series-m{--ct-color:var(--ct-series-m,#b2c326)}.ct-series-m .ct-bar,.ct-series-m .ct-line,.ct-series-m .ct-point,.ct-series-m .ct-slice-donut{stroke:var(--ct-color)}.ct-series-m .ct-area,.ct-series-m .ct-slice-pie{fill:var(--ct-color)}.ct-series-n{--ct-color:var(--ct-series-n,#6188e2)}.ct-series-n .ct-bar,.ct-series-n .ct-line,.ct-series-n .ct-point,.ct-series-n .ct-slice-donut{stroke:var(--ct-color)}.ct-series-n .ct-area,.ct-series-n .ct-slice-pie{fill:var(--ct-color)}.ct-series-o{--ct-color:var(--ct-series-o,#a748ca)}.ct-series-o .ct-bar,.ct-series-o .ct-line,.ct-series-o .ct-point,.ct-series-o .ct-slice-donut{stroke:var(--ct-color)}.ct-series-o .ct-area,.ct-series-o .ct-slice-pie{fill:var(--ct-color)}.ct-series-p{--ct-color:var(--ct-series-p,var(--ct-series-a,#d70206))}.ct-series-p .ct-bar,.ct-series-p .ct-line,.ct-series-p .ct-point,.ct-series-p .ct-slice-donut{stroke:var(--ct-color)}.ct-series-p .ct-area,.ct-series-p .ct-slice-pie{fill:var(--ct-color)}.ct-series-q{--ct-color:var(--ct-series-q,var(--ct-series-b,#f05b4f))}.ct-series-q .ct-bar,.ct-series-q .ct-line,.ct-series-q .ct-point,.ct-series-q .ct-slice-donut{stroke:var(--ct-color)}.ct-series-q .ct-area,.ct-series-q .ct-slice-pie{fill:var(--ct-color)}.ct-series-r{--ct-color:var(--ct-series-r,var(--ct-series-c,#f4c63d))}.ct-series-r .ct-bar,.ct-series-r .ct-line,.ct-series-r .ct-point,.ct-series-r .ct-slice-donut{stroke:var(--ct-color)}.ct-series-r .ct-area,.ct-series-r .ct-slice-pie{fill:var(--ct-color)}.ct-series-s{--ct-color:var(--ct-series-s,var(--ct-series-d,#d17905))}.ct-series-s .ct-bar,.ct-series-s .ct-line,.ct-series-s .ct-point,.ct-series-s .ct-slice-donut{stroke:var(--ct-color)}.ct-series-s .ct-area,.ct-series-s .ct-slice-pie{fill:var(--ct-color)}.ct-series-t{--ct-color:var(--ct-series-t,var(--ct-series-e,#453d3f))}.ct-series-t .ct-bar,.ct-series-t .ct-line,.ct-series-t .ct-point,.ct-series-t .ct-slice-donut{stroke:var(--ct-color)}.ct-series-t .ct-area,.ct-series-t .ct-slice-pie{fill:var(--ct-color)}.ct-series-u{--ct-color:var(--ct-series-u,var(--ct-series-f,#59922b))}.ct-series-u .ct-bar,.ct-series-u .ct-line,.ct-series-u .ct-point,.ct-series-u .ct-slice-donut{stroke:var(--ct-color)}.ct-series-u .ct-area,.ct-series-u .ct-slice-pie{fill:var(--ct-color)}.ct-series-v{--ct-color:var(--ct-series-v,var(--ct-series-g,#0544d3))}.ct-series-v .ct-bar,.ct-series-v .ct-line,.ct-series-v .ct-point,.ct-series-v .ct-slice-donut{stroke:var(--ct-color)}.ct-series-v .ct-area,.ct-series-v .ct-slice-pie{fill:var(--ct-color)}.ct-series-w{--ct-color:var(--ct-series-w,var(--ct-series-h,#6b0392))}.ct-series-w .ct-bar,.ct-series-w .ct-line,.ct-series-w .ct-point,.ct-series-w .ct-slice-donut{stroke:var(--ct-color)}.ct-series-w .ct-area,.ct-series-w .ct-slice-pie{fill:var(--ct-color)}.ct-series-x{--ct-color:var(--ct-series-x,var(--ct-series-i,#e6805e))}.ct-series-x .ct-bar,.ct-series-x .ct-line,.ct-series-x .ct-point,.ct-series-x .ct-slice-donut{stroke:var(--ct-color)}.ct-series-x .ct-area,.ct-series-x .ct-slice-pie{fill:var(--ct-color)}.ct-series-y{--ct-color:var(--ct-series-y,var(--ct-series-j,#dda458))}.ct-series-y .ct-bar,.ct-series-y .ct-line,.ct-series-y .ct-point,.ct-series-y .ct-slice-donut{stroke:var(--ct-color)}.ct-series-y .ct-area,.ct-series-y .ct-slice-pie{fill:var(--ct-color)}.ct-series-z{--ct-color:var(--ct-series-z,var(--ct-series-k,#eacf7d))}.ct-series-z .ct-bar,.ct-series-z .ct-line,.ct-series-z .ct-point,.ct-series-z .ct-slice-donut{stroke:var(--ct-color)}.ct-series-z .ct-area,.ct-series-z .ct-slice-pie{fill:var(--ct-color)}.ct-square{display:block;position:relative;width:100%}.ct-square:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:100%}.ct-square:after{content:"";display:table;clear:both}.ct-square>svg{display:block;position:absolute;top:0;left:0}.ct-minor-second{display:block;position:relative;width:100%}.ct-minor-second:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:93.75%}.ct-minor-second:after{content:"";display:table;clear:both}.ct-minor-second>svg{display:block;position:absolute;top:0;left:0}.ct-major-second{display:block;position:relative;width:100%}.ct-major-second:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:88.8888888889%}.ct-major-second:after{content:"";display:table;clear:both}.ct-major-second>svg{display:block;position:absolute;top:0;left:0}.ct-minor-third{display:block;position:relative;width:100%}.ct-minor-third:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:83.3333333333%}.ct-minor-third:after{content:"";display:table;clear:both}.ct-minor-third>svg{display:block;position:absolute;top:0;left:0}.ct-major-third{display:block;position:relative;width:100%}.ct-major-third:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:80%}.ct-major-third:after{content:"";display:table;clear:both}.ct-major-third>svg{display:block;position:absolute;top:0;left:0}.ct-perfect-fourth{display:block;position:relative;width:100%}.ct-perfect-fourth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:75%}.ct-perfect-fourth:after{content:"";display:table;clear:both}.ct-perfect-fourth>svg{display:block;position:absolute;top:0;left:0}.ct-perfect-fifth{display:block;position:relative;width:100%}.ct-perfect-fifth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:66.6666666667%}.ct-perfect-fifth:after{content:"";display:table;clear:both}.ct-perfect-fifth>svg{display:block;position:absolute;top:0;left:0}.ct-minor-sixth{display:block;position:relative;width:100%}.ct-minor-sixth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:62.5%}.ct-minor-sixth:after{content:"";display:table;clear:both}.ct-minor-sixth>svg{display:block;position:absolute;top:0;left:0}.ct-golden-section{display:block;position:relative;width:100%}.ct-golden-section:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:61.804697157%}.ct-golden-section:after{content:"";display:table;clear:both}.ct-golden-section>svg{display:block;position:absolute;top:0;left:0}.ct-major-sixth{display:block;position:relative;width:100%}.ct-major-sixth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:60%}.ct-major-sixth:after{content:"";display:table;clear:both}.ct-major-sixth>svg{display:block;position:absolute;top:0;left:0}.ct-minor-seventh{display:block;position:relative;width:100%}.ct-minor-seventh:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:56.25%}.ct-minor-seventh:after{content:"";display:table;clear:both}.ct-minor-seventh>svg{display:block;position:absolute;top:0;left:0}.ct-major-seventh{display:block;position:relative;width:100%}.ct-major-seventh:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:53.3333333333%}.ct-major-seventh:after{content:"";display:table;clear:both}.ct-major-seventh>svg{display:block;position:absolute;top:0;left:0}.ct-octave{display:block;position:relative;width:100%}.ct-octave:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:50%}.ct-octave:after{content:"";display:table;clear:both}.ct-octave>svg{display:block;position:absolute;top:0;left:0}.ct-major-tenth{display:block;position:relative;width:100%}.ct-major-tenth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:40%}.ct-major-tenth:after{content:"";display:table;clear:both}.ct-major-tenth>svg{display:block;position:absolute;top:0;left:0}.ct-major-eleventh{display:block;position:relative;width:100%}.ct-major-eleventh:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:37.5%}.ct-major-eleventh:after{content:"";display:table;clear:both}.ct-major-eleventh>svg{display:block;position:absolute;top:0;left:0}.ct-major-twelfth{display:block;position:relative;width:100%}.ct-major-twelfth:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:33.3333333333%}.ct-major-twelfth:after{content:"";display:table;clear:both}.ct-major-twelfth>svg{display:block;position:absolute;top:0;left:0}.ct-double-octave{display:block;position:relative;width:100%}.ct-double-octave:before{display:block;float:left;content:"";width:0;height:0;padding-bottom:25%}.ct-double-octave:after{content:"";display:table;clear:both}.ct-double-octave>svg{display:block;position:absolute;top:0;left:0}
|
|
2
2
|
/*# sourceMappingURL=index.min.css.map */
|
package/dist/chartist.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Chartist={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};let r={svg:`http://www.w3.org/2000/svg`,xmlns:`http://www.w3.org/2000/xmlns/`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,ct:`http://gionkunz.github.com/chartist-js/ct`},i={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function a(e,t){return typeof e==`number`?e+t:e}function o(e){if(typeof e==`string`){let t=/^(\d+)\s*(.*)$/g.exec(e);return{value:t?+t[1]:0,unit:t?.[2]||void 0}}return{value:Number(e)}}function s(e){return String.fromCharCode(97+e%26)}let c=2221e-19;function l(e){return Math.floor(Math.log(Math.abs(e))/Math.LN10)}function u(e,t,n){return t/n.range*e}function d(e,t){let n=10**(t??8);return Math.round(e*n)/n}function f(e){if(e===1)return e;function t(e,n){return e%n===0?n:t(n,e%n)}function n(e){return e*e+1}let r=2,i=2,a;if(e%2==0)return 2;do r=n(r)%e,i=n(n(i))%e,a=t(Math.abs(r-i),e);while(a===1);return a}function p(e,t,n,r){let i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function m(e,t,n,r=!1){let i={high:t.high,low:t.low,valueRange:0,oom:0,step:0,min:0,max:0,range:0,numberOfSteps:0,values:[]};i.valueRange=i.high-i.low,i.oom=l(i.valueRange),i.step=10**i.oom,i.min=Math.floor(i.low/i.step)*i.step,i.max=Math.ceil(i.high/i.step)*i.step,i.range=i.max-i.min,i.numberOfSteps=Math.round(i.range/i.step);let a=u(e,i.step,i)<n,o=r?f(i.range):0;if(r&&u(e,1,i)>=n)i.step=1;else if(r&&o<i.step&&u(e,o,i)>=n)i.step=o;else{let t=0;for(;;){if(a&&u(e,i.step,i)<=n)i.step*=2;else if(!a&&u(e,i.step/2,i)>=n){if(i.step/=2,r&&i.step%1!=0){i.step*=2;break}}else break;if(t++>1e3)throw Error(`Exceeded maximum number of iterations while optimizing scale step!`)}}i.step=Math.max(i.step,c);function s(e,t){return e===(e+=t)&&(e*=1+(t>0?c:-2221e-19)),e}let p=i.min,m=i.max;for(;p+i.step<=i.low;)p=s(p,i.step);for(;m-i.step>=i.high;)m=s(m,-i.step);i.min=p,i.max=m,i.range=i.max-i.min;let h=[];for(let e=i.min;e<=i.max;e=s(e,i.step)){let t=d(e);t!==h[h.length-1]&&h.push(t)}return i.values=h,i}function h(e={},...t){for(let n=0;n<t.length;n++){let r=t[n],i=Object.getPrototypeOf(e);for(let t in r){if(i!==null&&t in i)continue;let n=r[t];e[t]=typeof n==`object`&&n&&!(n instanceof Array)?h(e[t],n):n}}return e}let g=e=>e;function _(e,t){return Array.from({length:e},t?(e,n)=>t(n):()=>void 0)}let v=(e,t)=>e+(t||0),y=(e,t)=>_(Math.max(...e.map(e=>e.length)),n=>t(...e.map(e=>e[n])));function b(e,t){return typeof e==`object`&&!!e&&Reflect.has(e,t)}function x(e){return e!==null&&isFinite(e)}function S(e){return!e&&e!==0}function C(e){return x(e)?Number(e):void 0}function w(e){return Array.isArray(e)?e.every(Array.isArray):!1}function T(e,t,n=!1){let r=0;e[n?`reduceRight`:`reduce`]((e,n,i)=>t(n,r++,i),void 0)}function E(e,t){let n=Array.isArray(e)?e[t]:b(e,`data`)?e.data[t]:null;return b(n,`meta`)?n.meta:void 0}function D(e){return e==null||typeof e==`number`&&isNaN(e)}function O(e){return Array.isArray(e)&&e.every(e=>Array.isArray(e)||b(e,`data`))}function k(e){return typeof e==`object`&&!!e&&(Reflect.has(e,`x`)||Reflect.has(e,`y`))}function A(e,t=`y`){return k(e)&&b(e,t)?C(e[t]):C(e)}function j(e,t,n,r){t={...t,...n?n===`x`?t.axisX:t.axisY:{}};let i={high:t.high===void 0?-Number.MAX_VALUE:+t.high,low:t.low===void 0?Number.MAX_VALUE:+t.low},a=t.high===void 0,o=t.low===void 0;function s(e){if(!D(e)){if(Array.isArray(e))for(let t=0;t<e.length;t++)s(e[t]);else{let t=Number(n&&b(e,n)?e[n]:e);a&&t>i.high&&(i.high=t),o&&t<i.low&&(i.low=t)}}}return(a||o)&&s(e),r&&(a&&(i.high=Math.max(r.high,i.high)),o&&(i.low=Math.min(r.low,i.low))),(t.referenceValue||t.referenceValue===0)&&(a&&(i.high=Math.max(t.referenceValue,i.high)),o&&(i.low=Math.min(t.referenceValue,i.low))),i.high<=i.low&&(i.low===0?i.high=1:i.low<0?i.high=0:(i.high>0||(i.high=1),i.low=0)),i}function M(e,t=!1,n,r){let i,a={labels:(e.labels||[]).slice(),series:ne(e.series,n,r)},o=a.labels.length;return w(a.series)?(i=Math.max(o,...a.series.map(e=>e.length)),a.series.forEach(e=>{e.push(..._(Math.max(0,i-e.length)))})):i=a.series.length,a.labels.push(..._(Math.max(0,i-o),()=>``)),t&&ee(a),a}function ee(e){e.labels?.reverse(),e.series.reverse();for(let t of e.series)b(t,`data`)?t.data.reverse():Array.isArray(t)&&t.reverse()}function N(e,t){let n,r;if(typeof e!=`object`){let i=C(e);t===`x`?n=i:r=i}else b(e,`x`)&&(n=C(e.x)),b(e,`y`)&&(r=C(e.y));if(n!==void 0||r!==void 0)return{x:n,y:r}}function P(e,t){if(!D(e))return t?N(e,t):C(e)}function te(e,t){return Array.isArray(e)?e.map(e=>b(e,`value`)?P(e.value,t):P(e,t)):te(e.data,t)}function ne(e,t,n){if(O(e))return e.map(e=>te(e,t));let r=te(e,t);return n?r.map(e=>[e]):r}function F(e,t,n){let r={increasingX:!1,fillHoles:!1,...n},i=[],a=!0;for(let n=0;n<e.length;n+=2)A(t[n/2].value)===void 0?r.fillHoles||(a=!0):(r.increasingX&&n>=2&&e[n]<=e[n-2]&&(a=!0),a&&=(i.push({pathCoordinates:[],valueData:[]}),!1),i[i.length-1].pathCoordinates.push(e[n],e[n+1]),i[i.length-1].valueData.push(t[n/2]));return i}function I(e){let t=``;return e==null?e:(t=typeof e==`number`?``+e:typeof e==`object`?JSON.stringify({data:e}):String(e),Object.keys(i).reduce((e,t)=>e.replaceAll(t,i[t]),t))}function re(e){if(typeof e!=`string`)return e;if(e===`NaN`)return NaN;e=Object.keys(i).reduce((e,t)=>e.replaceAll(i[t],t),e);let t=e;if(typeof e==`string`)try{t=JSON.parse(e),t=t.data===void 0?t:t.data}catch{}return t}var ie=class{svgElements=[];constructor(e){for(let t=0;t<e.length;t++)this.svgElements.push(new L(e[t]))}call(e,t){return this.svgElements.forEach(n=>Reflect.apply(n[e],n,t)),this}attr(...e){return this.call(`attr`,e)}elem(...e){return this.call(`elem`,e)}root(...e){return this.call(`root`,e)}getNode(...e){return this.call(`getNode`,e)}foreignObject(...e){return this.call(`foreignObject`,e)}text(...e){return this.call(`text`,e)}empty(...e){return this.call(`empty`,e)}remove(...e){return this.call(`remove`,e)}addClass(...e){return this.call(`addClass`,e)}removeClass(...e){return this.call(`removeClass`,e)}removeAllClasses(...e){return this.call(`removeAllClasses`,e)}animate(...e){return this.call(`animate`,e)}};let ae={easeInSine:[.47,0,.745,.715],easeOutSine:[.39,.575,.565,1],easeInOutSine:[.445,.05,.55,.95],easeInQuad:[.55,.085,.68,.53],easeOutQuad:[.25,.46,.45,.94],easeInOutQuad:[.455,.03,.515,.955],easeInCubic:[.55,.055,.675,.19],easeOutCubic:[.215,.61,.355,1],easeInOutCubic:[.645,.045,.355,1],easeInQuart:[.895,.03,.685,.22],easeOutQuart:[.165,.84,.44,1],easeInOutQuart:[.77,0,.175,1],easeInQuint:[.755,.05,.855,.06],easeOutQuint:[.23,1,.32,1],easeInOutQuint:[.86,0,.07,1],easeInExpo:[.95,.05,.795,.035],easeOutExpo:[.19,1,.22,1],easeInOutExpo:[1,0,0,1],easeInCirc:[.6,.04,.98,.335],easeOutCirc:[.075,.82,.165,1],easeInOutCirc:[.785,.135,.15,.86],easeInBack:[.6,-.28,.735,.045],easeOutBack:[.175,.885,.32,1.275],easeInOutBack:[.68,-.55,.265,1.55]},oe=Symbol.for(`chartist.animationEmitter`);function se(e){for(let t=e;t;t=t.parentElement){let e=t[oe];if(e)return e}}function ce(e,t,n,r=!1,i){let{easing:s,...c}=n,l={},u,d;s&&(u=Array.isArray(s)?s:ae[s]),c.begin=a(c.begin,`ms`),c.dur=a(c.dur,`ms`),u&&(c.calcMode=`spline`,c.keySplines=u.join(` `),c.keyTimes=`0;1`),r&&(c.fill=`freeze`,l[t]=c.from,e.attr(l),d=o(c.begin||0).value,c.begin=`indefinite`);let f=e.elem(`animate`,{attributeName:t,...c});r&&setTimeout(()=>{try{f._node.beginElement()}catch{l[t]=c.to,e.attr(l),f.remove()}},d);let p=f.getNode();i&&p.addEventListener(`beginEvent`,()=>i.emit(`animationBegin`,{element:e,animate:p,params:n})),p.addEventListener(`endEvent`,()=>{i&&i.emit(`animationEnd`,{element:e,animate:p,params:n}),r&&(l[t]=c.to,e.attr(l),f.remove())})}var L=class e{static Easing=ae;_node;constructor(e,t,n,i,a=!1){e instanceof Element?this._node=e:(this._node=(i?._node.ownerDocument??document).createElementNS(r.svg,e),e===`svg`&&this.attr({"xmlns:ct":r.ct})),t&&this.attr(t),n&&this.addClass(n),i&&(a&&i._node.firstChild?i._node.insertBefore(this._node,i._node.firstChild):i._node.appendChild(this._node))}attr(e,t){return typeof e==`string`?t?this._node.getAttributeNS(t,e):this._node.getAttribute(e):(Object.keys(e).forEach(t=>{if(e[t]!==void 0){if(t.indexOf(`:`)!==-1){let n=t.split(`:`);this._node.setAttributeNS(r[n[0]],t,String(e[t]))}else this._node.setAttribute(t,String(e[t]))}}),this)}elem(t,n,r,i=!1){return new e(t,n,r,this,i)}parent(){return this._node.parentNode instanceof SVGElement?new e(this._node.parentNode):null}root(){let t=this._node;for(;t.nodeName!==`svg`&&t.parentElement;)t=t.parentElement;return new e(t)}querySelector(t){let n=this._node.querySelector(t);return n?new e(n):null}querySelectorAll(e){return new ie(this._node.querySelectorAll(e))}getNode(){return this._node}foreignObject(e,t,n,i=!1){let a;if(typeof e==`string`){let t=this._node.ownerDocument.createElement(`div`);t.innerHTML=e,a=t.firstChild}else a=e;a instanceof Element&&a.setAttribute(`xmlns`,r.xmlns);let o=this.elem(`foreignObject`,t,n,i);return o._node.appendChild(a),o}text(e){return this._node.appendChild(this._node.ownerDocument.createTextNode(e)),this}empty(){for(;this._node.firstChild;)this._node.removeChild(this._node.firstChild);return this}remove(){let e=this.parent();return this._node.parentNode?.removeChild(this._node),e}replace(e){return this._node.parentNode?.replaceChild(e._node,this._node),e}append(e,t=!1){return t&&this._node.firstChild?this._node.insertBefore(e._node,this._node.firstChild):this._node.appendChild(e._node),this}classes(){let e=this._node.getAttribute(`class`);return e?e.trim().split(/\s+/):[]}addClass(e){return this._node.setAttribute(`class`,this.classes().concat(e.trim().split(/\s+/)).filter(function(e,t,n){return n.indexOf(e)===t}).join(` `)),this}removeClass(e){let t=e.trim().split(/\s+/);return this._node.setAttribute(`class`,this.classes().filter(e=>t.indexOf(e)===-1).join(` `)),this}removeAllClasses(){return this._node.setAttribute(`class`,``),this}height(){return this._node.clientHeight}width(){return this._node.clientWidth}animate(e,t=!0,n){let r=n??se(this._node);return Object.keys(e).forEach(n=>{let i=e[n];Array.isArray(i)?i.forEach(e=>ce(this,n,e,!1,r)):ce(this,n,i,t,r)}),this}};function le(e,t=`100%`,n=`100%`,i,a){if(!e)throw Error(`Container element is not found`);Array.from(e.querySelectorAll(`svg`)).filter(e=>e.getAttributeNS(r.xmlns,`ct`)).forEach(t=>e.removeChild(t));let o=new L(`svg`).attr({width:t,height:n}).attr({style:`width: ${t}; height: ${n};`});return i&&o.addClass(i),a&&o.attr({viewBox:`0 0 ${a.width} ${a.height}`}),e.appendChild(o.getNode()),o}function ue(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:e===void 0?{top:0,right:0,bottom:0,left:0}:{top:typeof e.top==`number`?e.top:0,right:typeof e.right==`number`?e.right:0,bottom:typeof e.bottom==`number`?e.bottom:0,left:typeof e.left==`number`?e.left:0}}function de(e,t){let n=!!(t.axisX||t.axisY),r=t.axisY?.offset||0,i=t.axisX?.offset||0,a=t.axisY?.position,s=t.axisX?.position,c=t.viewBox?.width||e.width()||o(t.width).value||0,l=t.viewBox?.height||e.height()||o(t.height).value||0,u=ue(t.chartPadding);c=Math.max(c,r+u.left+u.right),l=Math.max(l,i+u.top+u.bottom);let d={x1:0,x2:0,y1:0,y2:0,padding:u,width(){return this.x2-this.x1},height(){return this.y1-this.y2}};return n?(s===`start`?(d.y2=u.top+i,d.y1=Math.max(l-u.bottom,d.y2+1)):(d.y2=u.top,d.y1=Math.max(l-u.bottom-i,d.y2+1)),a===`start`?(d.x1=u.left+r,d.x2=Math.max(c-u.right,d.x1+1)):(d.x1=u.left,d.x2=Math.max(c-u.right-r,d.x1+1))):(d.x1=u.left,d.x2=Math.max(c-u.right,d.x1+1),d.y2=u.top,d.y1=Math.max(l-u.bottom,d.y2+1)),d}function fe(e,t,n,r,i,a,o,s){let c={[`${n.units.pos}1`]:e,[`${n.units.pos}2`]:e,[`${n.counterUnits.pos}1`]:r,[`${n.counterUnits.pos}2`]:r+i},l=a.elem(`line`,c,o.join(` `));s.emit(`draw`,{type:`grid`,axis:n,index:t,group:a,element:l,...c})}function pe(e,t,n,r){let i=e.elem(`rect`,{x:t.x1,y:t.y2,width:t.width(),height:t.height()},n,!0);r.emit(`draw`,{type:`gridBackground`,group:e,element:i})}function me(e,t,n,r,i,a,o,s,c,l){let u={[i.units.pos]:e+o[i.units.pos],[i.counterUnits.pos]:o[i.counterUnits.pos],[i.units.len]:t,[i.counterUnits.len]:Math.max(0,a-10)},d=Math.round(u[i.units.len]),f=Math.round(u[i.counterUnits.len]),p=document.createElement(`span`);p.className=c.join(` `),p.style[i.units.len]=d+`px`,p.style[i.counterUnits.len]=f+`px`,p.textContent=String(r);let m=s.foreignObject(p,{style:`overflow: visible;`,...u});l.emit(`draw`,{type:`label`,axis:i,index:n,group:s,element:m,text:r,...u})}function R(e,t,n){let r,i=[];function a(i){let a=r;r=h({},e),t&&t.forEach(e=>{window.matchMedia(e[0]).matches&&(r=h({},r,e[1]))}),n&&i&&n.emit(`optionsChanged`,{previousOptions:a,currentOptions:r})}function o(){i.forEach(e=>e.removeEventListener(`change`,a))}if(window.matchMedia)t&&t.forEach(e=>{let t=window.matchMedia(e[0]);t.addEventListener(`change`,a),i.push(t)});else throw Error(`window.matchMedia not found! Make sure you're using a polyfill.`);return a(),{removeMediaQueryListeners:o,getCurrentOptions(){return r}}}var he=class{listeners=/* @__PURE__ */ new Map;allListeners=/* @__PURE__ */ new Set;on(e,t){let{allListeners:n,listeners:r}=this;e===`*`?n.add(t):(r.has(e)||r.set(e,/* @__PURE__ */ new Set),r.get(e).add(t))}off(e,t){let{allListeners:n,listeners:r}=this;if(e===`*`)t?n.delete(t):n.clear();else if(r.has(e)){let n=r.get(e);t?n.delete(t):n.clear(),n.size||r.delete(e)}}emit(e,t){let{allListeners:n,listeners:r}=this;r.has(e)&&r.get(e).forEach(e=>e(t)),n.forEach(n=>n(e,t))}};let ge=/* @__PURE__ */ new WeakMap;var _e=class{data;defaultOptions;options;responsiveOptions;svg;container;eventEmitter=new he;resizeListener=()=>this.update();initializeTimeoutId=setTimeout(()=>this.initialize(),0);optionsProvider;constructor(e,t,n,r,i){this.data=t,this.defaultOptions=n,this.options=r,this.responsiveOptions=i;let a=typeof e==`string`?document.querySelector(e):e;if(!a)throw Error(`Target element ${typeof e==`string`?`"${e}"`:``} is not found`);this.container=a;let o=ge.get(a);o&&o.detach(),ge.set(a,this)}update(e,t,n=!1){return e&&(this.data=e||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.eventEmitter.emit(`data`,{type:`update`,data:this.data})),t&&(this.options=h({},n?this.options:this.defaultOptions,t),this.initializeTimeoutId||(this.optionsProvider?.removeMediaQueryListeners(),this.optionsProvider=R(this.options,this.responsiveOptions,this.eventEmitter))),!this.initializeTimeoutId&&this.optionsProvider&&this.createChart(this.optionsProvider.getCurrentOptions()),this}detach(){return this.initializeTimeoutId?clearTimeout(this.initializeTimeoutId):(window.removeEventListener(`resize`,this.resizeListener),this.optionsProvider?.removeMediaQueryListeners()),ge.delete(this.container),this}on(e,t){return this.eventEmitter.on(e,t),this}off(e,t){return this.eventEmitter.off(e,t),this}initialize(){window.addEventListener(`resize`,this.resizeListener),this.optionsProvider=R(this.options,this.responsiveOptions,this.eventEmitter),this.eventEmitter.on(`optionsChanged`,()=>this.update()),this.options.plugins&&this.options.plugins.forEach(e=>{Array.isArray(e)?e[0](this,e[1]):typeof e==`function`&&e(this)}),this.eventEmitter.emit(`data`,{type:`initial`,data:this.data}),this.createChart(this.optionsProvider.getCurrentOptions()),this.initializeTimeoutId=null}};let ve={m:[`x`,`y`],l:[`x`,`y`],c:[`x1`,`y1`,`x2`,`y2`,`x`,`y`],a:[`rx`,`ry`,`xAr`,`lAf`,`sf`,`x`,`y`]},ye={accuracy:3};function z(e,t,n,r,i,a){let o={command:i?e.toLowerCase():e.toUpperCase(),...t,...a?{data:a}:{}};n.splice(r,0,o)}function be(e,t){e.forEach((n,r)=>{ve[n.command.toLowerCase()].forEach((i,a)=>{t(n,i,r,a,e)})})}var B=class e{close;static join(t,n=!1,r){let i=new e(n,r);for(let e=0;e<t.length;e++){let n=t[e];for(let e=0;e<n.pathElements.length;e++)i.pathElements.push(n.pathElements[e])}return i}pathElements=[];pos=0;options;constructor(e=!1,t){this.close=e,this.options={...ye,...t}}position(e){return e===void 0?this.pos:(this.pos=Math.max(0,Math.min(this.pathElements.length,e)),this)}remove(e){return this.pathElements.splice(this.pos,e),this}move(e,t,n=!1,r){return z(`M`,{x:+e,y:+t},this.pathElements,this.pos++,n,r),this}line(e,t,n=!1,r){return z(`L`,{x:+e,y:+t},this.pathElements,this.pos++,n,r),this}curve(e,t,n,r,i,a,o=!1,s){return z(`C`,{x1:+e,y1:+t,x2:+n,y2:+r,x:+i,y:+a},this.pathElements,this.pos++,o,s),this}arc(e,t,n,r,i,a,o,s=!1,c){return z(`A`,{rx:e,ry:t,xAr:n,lAf:r,sf:i,x:a,y:o},this.pathElements,this.pos++,s,c),this}parse(e){let t=e.replace(/([A-Za-z])(-?[0-9])/g,`$1 $2`).replace(/([0-9])([A-Za-z])/g,`$1 $2`).split(/[\s,]+/).reduce((e,t)=>(t.match(/[A-Za-z]/)&&e.push([]),e[e.length-1].push(t),e),[]);t[t.length-1][0].toUpperCase()===`Z`&&t.pop();let n=t.map(e=>{let t=e.shift();return{command:t,...ve[t.toLowerCase()].reduce((t,n,r)=>(t[n]=+e[r],t),{})}});return this.pathElements.splice(this.pos,0,...n),this.pos+=n.length,this}stringify(){let e=10**this.options.accuracy;return this.pathElements.reduce((t,n)=>{let r=ve[n.command.toLowerCase()].map(t=>{let r=n[t];return this.options.accuracy?Math.round(r*e)/e:r});return t+n.command+r.join(`,`)},``)+(this.close?`Z`:``)}scale(e,t){return be(this.pathElements,(n,r)=>{n[r]*=r[0]===`x`?e:t}),this}translate(e,t){return be(this.pathElements,(n,r)=>{n[r]+=r[0]===`x`?e:t}),this}transform(e){return be(this.pathElements,(t,n,r,i,a)=>{let o=e(t,n,r,i,a);(o||o===0)&&(t[n]=o)}),this}clone(t=!1){let n=new e(t||this.close);return n.pos=this.pos,n.pathElements=this.pathElements.slice().map(e=>({...e})),n.options={...this.options},n}splitByCommand(t){let n=[new e];return this.pathElements.forEach(r=>{r.command===t.toUpperCase()&&n[n.length-1].pathElements.length!==0&&n.push(new e),n[n.length-1].pathElements.push(r)}),n}};function V(e){let t={fillHoles:!1,...e};return function(e,n){let r=new B,i=!0;for(let a=0;a<e.length;a+=2){let o=e[a],s=e[a+1],c=n[a/2];A(c.value)===void 0?t.fillHoles||(i=!0):(i?r.move(o,s,!1,c):r.line(o,s,!1,c),i=!1)}return r}}function xe(e){let t={fillHoles:!1,...e};return function e(n,r){let i=F(n,r,{fillHoles:t.fillHoles,increasingX:!0});if(!i.length)return V()([],[]);if(i.length>1)return B.join(i.map(t=>e(t.pathCoordinates,t.valueData)));{if(n=i[0].pathCoordinates,r=i[0].valueData,n.length<=4)return V()(n,r);let e=[],t=[],a=n.length/2,o=[],s=[],c=[],l=[];for(let r=0;r<a;r++)e[r]=n[r*2],t[r]=n[r*2+1];for(let n=0;n<a-1;n++)c[n]=t[n+1]-t[n],l[n]=e[n+1]-e[n],s[n]=c[n]/l[n];o[0]=s[0],o[a-1]=s[a-2];for(let e=1;e<a-1;e++)s[e]===0||s[e-1]===0||s[e-1]>0!=s[e]>0?o[e]=0:(o[e]=3*(l[e-1]+l[e])/((2*l[e]+l[e-1])/s[e-1]+(l[e]+2*l[e-1])/s[e]),isFinite(o[e])||(o[e]=0));let u=new B().move(e[0],t[0],!1,r[0]);for(let n=0;n<a-1;n++)u.curve(e[n]+l[n]/3,t[n]+o[n]*l[n]/3,e[n+1]-l[n]/3,t[n+1]-o[n+1]*l[n]/3,e[n+1],t[n+1],!1,r[n+1]);return u}}}let Se=e=>e.split(/\s+/).filter(Boolean),Ce={attr(e){let t={...this.attrs};for(let[n,r]of Object.entries(e))r==null?delete t[n]:t[n]=r;return H(this,{attrs:t})},addClass(e){let t=Se(e).filter((e,t,n)=>!this.classes.includes(e)&&n.indexOf(e)===t);return t.length?H(this,{classes:[...this.classes,...t]}):this},removeClass(e){let t=Se(e);return H(this,{classes:this.classes.filter(e=>!t.includes(e))})},append(e,t=!1){return H(this,{children:t?[e,...this.children]:[...this.children,e]})},remove(e){return H(this,{children:this.children.filter(t=>t!==e)})},replace(e,t){return H(this,{children:this.children.map(n=>n===e?t:n)})},text(e){return H(this,{content:e})},empty(){return H(this,{children:[],content:void 0})}};function we(e){let t=Object.create(Ce);for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function H(e,t){return we({...e,...t})}function U(e,t={},n=``,r={}){let i={};for(let[e,n]of Object.entries(t))n!=null&&(i[e]=n);return we({name:e,attrs:i,classes:[...new Set(Se(n))],children:[],...r})}let Te={lineSmooth:!0,showPoint:!0,showLine:!0,showArea:!1,areaBase:0},Ee={series:`ct-series`,line:`ct-line`,point:`ct-point`,area:`ct-area`};function De(e){return{name:e.name,className:e.className,meta:e.meta,data:e.values}}function W(e,t,n){let r=t[n]??Te[n];if(b(e,`name`)&&e.name&&t.overrides?.[e.name]){let i=t.overrides[e.name][n];return i===void 0?r:i}return r}function Oe(e={}){let t={...Ee,...e.classNames};return{type:`line`,coordinates:[`cartesian`],axes:{x:e.x,y:e.y},series:e.series,compose({data:n,area:r,axes:i,normalized:a,seriesIndexes:o}){let{x:c,y:l}=i;if(!c||!l||!a)throw Error(`Layer "line" needs an x and a y axis`);if(o&&e.reverseData)throw Error(`Layer "line": a series selection can't be combined with reverseData`);let u=e.align===`center`&&c.kind===`step`&&!c.stretch?(c.step??0)/2:0,d=n.series.map((e,t)=>t);return e.reverseData&&d.reverse(),d.map((i,d)=>{let f=o?.[i]??d,p=De(n.series[i]),m=a.series[d],h=b(p,`name`)&&p.name,g=b(p,`className`)&&p.className,_=b(p,`meta`)?p.meta:void 0,v=[],y=[];m.forEach((e,t)=>{v.push(r.x1+u+c.project(e,t,m),r.y1-l.project(e,t,m)),y.push({value:e,valueIndex:t,meta:E(p,t)})});let S=W(p,e,`lineSmooth`),C=(typeof S==`function`?S:S?xe():V())(v,y),w={series:p,seriesIndex:f,meta:_},T=[];if(W(p,e,`showPoint`)&&(T=C.pathElements.map(e=>{let{data:n}=e,r=n?.value,i=b(r,`x`)?r.x:void 0,a=b(r,`y`)?r.y:void 0;return U(`line`,{x1:e.x,y1:e.y,x2:e.x+.01,y2:e.y,...n&&{"ct:value":[i,a].filter(x).join(`,`),"ct:meta":I(n.meta)}},t.point,{role:`point`,ctx:{...w,valueIndex:n?.valueIndex||0,value:r,meta:n?.meta,x:e.x,y:e.y}})})),W(p,e,`showLine`)&&(T=[U(`path`,{d:C.stringify()},t.line,{role:`line`,ctx:{...w,values:m,path:C.clone()}}),...T]),W(p,e,`showArea`)&&l.range){let n=Math.max(Math.min(W(p,e,`areaBase`),l.range.max),l.range.min),i=r.y1-l.project(n);C.splitByCommand(`M`).filter(e=>e.pathElements.length>1).map(e=>{let t=e.pathElements[0],n=e.pathElements[e.pathElements.length-1];return e.clone(!0).position(0).remove(1).move(t.x,i).line(t.x,t.y).position(e.pathElements.length+1).line(n.x,i)}).forEach(e=>{T=[U(`path`,{d:e.stringify()},t.area,{role:`area`,ctx:{...w,values:m,path:e.clone()}}),...T]})}return H(U(`g`,{"ct:series-name":h||void 0,"ct:meta":_?I(_):void 0},`${t.series} ${g||`${t.series}-${s(f)}`}`,{role:`series`,ctx:w}),{children:T})})}}}let G=e=>e===`top`||e===`bottom`?`x`:`y`;function ke(e){if(e.axes)return e.axes;let t=[];return e.x&&t.push({...e.x,id:`x`,side:e.x.position===`start`?`top`:`bottom`}),e.y&&t.push({...e.y,id:`y`,side:e.y.position===`end`?`right`:`left`}),t}function Ae(e){let t={top:0,bottom:0,left:0,right:0};return e.map(e=>{let n=t[e.side];return t[e.side]+=e.offset||0,n})}function K(e,t){return e===`x`?t.x2-t.x1:t.y1-t.y2}function je(e,t,n,r){let i=Array.isArray(r)?r:ke(r),a={top:0,bottom:0,left:0,right:0};for(let e of i)a[e.side]+=e.offset||0;let o=Math.max(e,a.left+a.right+n.left+n.right),s=Math.max(t,a.top+a.bottom+n.top+n.bottom),c=n.top+a.top,l=Math.max(s-n.bottom-a.bottom,c+1),u=n.left+a.left,d=Math.max(o-n.right-a.right,u+1);return{width:o,height:s,area:{x1:u,y1:l,x2:d,y2:c,width:d-u,height:l-c}}}let q={x:{pos:`x`,len:`width`,dir:`horizontal`,rectStart:`x1`,rectEnd:`x2`,rectOffset:`y2`},y:{pos:`y`,len:`height`,dir:`vertical`,rectStart:`y2`,rectEnd:`y1`,rectOffset:`x1`}};var J=class{units;chartRect;ticks;counterUnits;range;axisLength;gridOffset;constructor(e,t,n){this.units=e,this.chartRect=t,this.ticks=n,this.counterUnits=e===q.x?q.y:q.x,this.axisLength=t[this.units.rectEnd]-t[this.units.rectStart],this.gridOffset=t[this.units.rectOffset]}createGridAndLabels(e,t,n,r){let i=this.units.pos===`x`?n.axisX:n.axisY,a=this.ticks.map((e,t)=>this.projectValue(e,t)),o=this.ticks.map(i.labelInterpolationFnc);a.forEach((s,c)=>{let l=o[c],u={x:0,y:0},d;d=a[c+1]?a[c+1]-s:Math.max(this.axisLength-s,this.axisLength/this.ticks.length),!(l!==``&&S(l))&&(this.units.pos===`x`?(s=this.chartRect.x1+s,u.x=n.axisX.labelOffset.x,u.y=n.axisX.position===`start`?this.chartRect.padding.top+n.axisX.labelOffset.y+5:this.chartRect.y1+n.axisX.labelOffset.y+5):(s=this.chartRect.y1-s,u.y=n.axisY.labelOffset.y-d,u.x=n.axisY.position===`start`?this.chartRect.padding.left+n.axisY.labelOffset.x:this.chartRect.x2+n.axisY.labelOffset.x+10),i.showGrid&&fe(s,c,this,this.gridOffset,this.chartRect[this.counterUnits.len](),e,[n.classNames.grid,n.classNames[this.units.dir]],r),i.showLabel&&me(s,d,c,l,this,i.offset,u,t,[n.classNames.label,n.classNames[this.units.dir],i.position===`start`?n.classNames[i.position]:n.classNames.end],r))})}};function Me(e){return typeof e==`function`&&typeof e.prototype?.projectValue==`function`}function Ne(e){return{kind:`legacy`,create({dimension:t,series:n,area:r,options:i,extent:a}){let o={x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,padding:{top:0,right:0,bottom:0,left:0},width:()=>r.x2-r.x1,height:()=>r.y1-r.y2},s=a&&!i.highLow?{...i,highLow:j(n,i,t,a)}:i,c=new e(q[t],n,o,s);return{dimension:t,kind:typeof c.stretch==`boolean`?`step`:`legacy`,stretch:c.stretch,step:c.stepLength,ticks:c.ticks,range:c.range,length:K(t,r),project:(e,t,n)=>c.projectValue(e,t,n)}}}}function Pe(e,t,n){let r=t=>e.find(e=>G(e.side)===t)?.id,i=new Set(e.map(e=>e.id));return t.map(e=>{for(let t of[e.axes?.x,e.axes?.y])if(t!==void 0&&!i.has(t))throw Error(`Chartist: unknown axis "${t}" in layer "${e.type}"`);let t=e.series?.map(t=>{let r=typeof t==`number`?t:n.series.findIndex(e=>e.name===t);if(r<0||r>=n.series.length)throw Error(`Chartist: unknown series ${JSON.stringify(t)} in layer "${e.type}"`);return r});return{x:e.axes?.x??r(`x`),y:e.axes?.y??r(`y`),series:t}})}function Fe(e,t){let n=Array.from({length:t},(e,t)=>t),r=/* @__PURE__ */ new Map;for(let t of e)if(t.series?.length!==0)for(let e of[t.x,t.y]){if(e===void 0)continue;let i=r.get(e)??/* @__PURE__ */ new Set;(t.series??n).forEach(e=>i.add(e)),r.set(e,i)}return new Map([...r].map(([e,t])=>[e,[...t].sort((e,t)=>e-t)]))}function Ie(e,t=!1,n={}){let r={labels:e.labels,series:e.series.map(e=>({name:e.name,className:e.className,meta:e.meta,data:e.values}))},i=M(e.flat?{labels:e.labels,series:e.series[0].values}:r,t,n.multi??!0,n.distributed);return{labels:i.labels,series:i.series}}function Le(e,t,n,r,i){let a=t=>e.find(e=>G(e.side)===t)?.id,o=/* @__PURE__ */ new Map;return t.forEach((e,t)=>{if(!e.extent)return;let s=n[t]??{},c=r.flat?void 0:s.series,l=e.extent({normalized:c?{...i,series:c.map(e=>i.series[e])}:i,axes:{x:s.x??a(`x`),y:s.y??a(`y`)}});for(let[e,t]of Object.entries(l??{})){let n=o.get(e);o.set(e,n?{low:Math.min(n.low,t.low),high:Math.max(n.high,t.high)}:t)}}),o}function Re(e,t,n,r,i,a){let{type:o,id:s,side:c,...l}=e;return{...(Me(o)?Ne(o):o).create({dimension:G(c),series:n,labels:r.labels,area:i,options:l,...a&&{extent:a}}),id:s,side:c,inset:t,options:l}}function ze(e,t){let n=ke(e),r=Ae(n);return{config:e,definitions:n,area:(e,t,r)=>je(e,t,r,n),create(i,a,o,s){let c=o&&t?.(o,i.series.length),l=Ie(i,e.reverseData,e.normalize),u=s?Le(n,s,o??[],i,l):void 0,d=l.series,f=n.map((e,t)=>{let n=c?.get(e.id),o=n&&!i.flat?n.map(e=>d[e]):d;return Re(e,r[t],o,l,a,u?.get(e.id))});return{normalized:l,axes:{x:f.find(e=>e.dimension===`x`),y:f.find(e=>e.dimension===`y`),all:f}}}}}function Be(e,t={}){let n=(e,t)=>({...e,offset:e.offset??(t===`x`?30:40)}),r=Array.isArray(e)?{...t,axes:e}:{...t,...e},i=ze(r.axes?{...r,axes:r.axes.map(e=>n(e,G(e.side)))}:{...r,x:r.x&&n(r.x,`x`),y:r.y&&n(r.y,`y`)},Fe),a=/* @__PURE__ */ new Set;for(let{id:e}of i.definitions){if(a.has(e))throw Error(`Chartist: the axis id "${e}" is used twice`);a.add(e)}return{...i,bind:(e,t)=>Pe(i.definitions,e,t)}}let Ve=(e,t)=>Number(A(e,t));function He(){return{kind:`step`,create({dimension:e,area:t,labels:n,options:r}){let i=r.ticks??[...n],a=K(e,t),o=a/Math.max(1,i.length-+!!r.stretch);return{dimension:e,kind:`step`,stretch:!!r.stretch,step:o,ticks:i,length:a,project:(e,t=0)=>o*t}}}}function Ue(){return{kind:`autoScale`,create({dimension:e,series:t,area:n,options:r,extent:i}){let a=K(e,n),o=m(a,r.highLow||j(t,r,e,i),r.scaleMinSpace||20,r.onlyInteger);return{dimension:e,kind:`autoScale`,ticks:o.values,range:{min:o.min,max:o.max},length:a,project:t=>a*(Ve(t,e)-o.min)/o.range}}}}function We(){return{kind:`fixedScale`,create({dimension:e,series:t,area:n,options:r,extent:i}){let a=K(e,n),o=r.highLow||j(t,r,e,i),s=r.divisor||1,c=(r.ticks||_(s+1,e=>o.low+(o.high-o.low)/s*e)).sort((e,t)=>Number(e)-Number(t)),l={min:o.low,max:o.high};return{dimension:e,kind:`fixedScale`,ticks:c,range:l,length:a,project:t=>a*(Ve(t,e)-l.min)/(l.max-l.min)}}}}let Ge={axisX:{offset:30,position:`end`,labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:g,type:void 0},axisY:{offset:40,position:`start`,labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:g,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,showGridBackground:!1,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:`ct-chart-line`,label:`ct-label`,labelGroup:`ct-labels`,series:`ct-series`,line:`ct-line`,point:`ct-point`,area:`ct-area`,grid:`ct-grid`,gridGroup:`ct-grids`,gridBackground:`ct-grid-background`,vertical:`ct-vertical`,horizontal:`ct-horizontal`,start:`ct-start`,end:`ct-end`}};function Ke(e,t){return e.filter(e=>t?e.listener!==t:e.owner!==`user`)}function qe(){let e=/* @__PURE__ */ new Map,t=[];function n(e,n){t.forEach(({listener:t})=>t(e,n))}return{on(n,r,i=`user`){n===`*`?t=[...t,{listener:r,owner:i}]:e.set(n,[...e.get(n)??[],{listener:r,owner:i}])},off(n,r){n===`*`?t=Ke(t,r):e.set(n,Ke(e.get(n)??[],r))},transform(t,r){let i=r;for(let{listener:n}of e.get(t)??[]){let e=n(i);if(e===null){i=null;break}e!==void 0&&(i=e)}return n(t,i),i},notify(t,r){(e.get(t)??[]).forEach(({listener:e})=>e(r)),n(t,r)},clear(){e.clear(),t=[]}}}function Je(e,t){return(t.role===void 0||e.role===t.role)&&(t.key===void 0||e.key===t.key)&&(t.seriesIndex===void 0||e.ctx?.seriesIndex===t.seriesIndex)&&(t.valueIndex===void 0||e.ctx?.valueIndex===t.valueIndex)}function Ye(e,t={}){let n=[],r=e=>{Je(e,t)&&n.push(e),e.children.forEach(r)};return r(e),n}function Y(e,t){let n=e.children,r=!1,i=[];for(let e of n){let n=Y(e,t);n!==e&&(r=!0),n&&i.push(n)}r&&(n=i);let a=r?H(e,{children:n}):e,o=t(a);return o===void 0?a:o}function Xe(e,t){return Y(e,e=>{let n=e.ctx?.seriesIndex;if(e.key!==void 0||n===void 0)return;let r=e.ctx?.valueIndex;return H(e,{key:r===void 0?`${t}/${n}`:`${t}/${n}/${r}`})})}let Ze={top:15,right:15,bottom:5,left:10};function Qe(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:{...Ze,...e}}function X(e,t){if(e==null)throw Error(`Chartist: a "${t}" listener returned null`);return e}function $e(e,t){let n={data:t.data,layers:t.layers,coordinates:t.coordinates??`cartesian`,padding:Qe(t.padding),axes:t.axes,width:t.width,height:t.height,viewBox:t.viewBox,className:t.className,labels:t.labels,preset:t.preset},r=X(e.transform(`resolve`,{config:n}),`resolve`).config;for(let e of r.layers)if(!e.coordinates.includes(r.coordinates))throw Error(`Layer "${e.type}" does not support ${r.coordinates} coordinates`);return r}function et(e){if(Array.isArray(e))return{values:e};if(e&&typeof e==`object`&&`data`in e){let{data:t,name:n,className:r,meta:i}=e;return{name:n,className:r,meta:i,values:t}}return{values:[e]}}function tt(e,t){let{labels:n=[],series:r}=t.data,i=r.every(e=>!Array.isArray(e)&&!(e&&typeof e==`object`&&`data`in e))&&r.length?{labels:n,series:[{values:r}],flat:!0}:{labels:n,series:r.map(et)};return X(e.transform(`prepare`,{data:i}),`prepare`).data}function nt(e){let{area:t}=e;if(![e.width,e.height,t.x1,t.x2,t.y1,t.y2,t.width,t.height].every(Number.isFinite)||t.width<0||t.height<0)throw Error(`Chartist: invalid layout after the "layout" phase (area ${JSON.stringify(t)})`)}function rt(e,t,n,r){let{padding:i}=t,a;if(t.axes)a={...t.axes.area(n,r,i),padding:i};else{let e=Math.max(n,i.left+i.right),t=Math.max(r,i.top+i.bottom),o=i.left,s=i.top,c=Math.max(e-i.right,o+1),l=Math.max(t-i.bottom,s+1);a={width:e,height:t,padding:i,area:{x1:o,y1:l,x2:c,y2:s,width:c-o,height:l-s}}}let o=X(e.transform(`layout`,a),`layout`);return nt(o),o}function it(e,t,n,r,i,a={},o,s=t.padding,c=[],l=`html`){let u=[],d=new Map((a.all??[]).map(e=>[e.id,e]));return t.layers.forEach((f,p)=>{let m=c[p]??{},h=n.flat?void 0:m.series,g=h?{...n,series:h.map(e=>n.series[e])}:n,_=h&&o?{...o,series:h.map(e=>o.series[e])}:o,v=f.compose({data:g,area:r,padding:s,layerIndex:p,coordinates:t.coordinates,measureText:i,axes:{x:m.x&&d.get(m.x)||a.x,y:m.y&&d.get(m.y)||a.y,all:a.all},normalized:_,seriesIndexes:h,labels:l});for(let t of v){let n=Y(Xe(t,p),t=>t.role===void 0?void 0:e.transform(`compose`,t));n&&u.push(n)}}),u}function at(e,t,n,r){let i=U(`svg`,{width:r.width,height:r.height,viewBox:t.viewBox?`0 0 ${t.viewBox.width} ${t.viewBox.height}`:void 0},t.className),a=n.length?H(i,{children:n}):i;return X(e.transform(`scene`,{scene:a}),`scene`).scene}function ot(e,t,n,r,i=`resolve`){let a=i===`layout`&&r,o=a?r.config:$e(e,t),s=a?r.data:tt(e,o),c=rt(e,o,n.width,n.height),l=o.axes?.bind?.(o.layers,s)??[],{axes:u={},normalized:d=void 0}=o.axes?.create(s,c.area,l,o.layers)??{},{className:f}=o,p=f?(e,t)=>n.measureText(e,{rootClass:f,...t}):n.measureText;return{config:o,data:s,layout:c,axes:u,normalized:d,scene:at(e,o,it(e,o,s,c.area,p,u,d,c.padding,l,o.labels??n.labels??`html`),n.rootSize??{width:o.width??c.width,height:o.height??c.height})}}let Z=(e,t={})=>{let n=t.fontSize??12;return{width:e.length*n*.6,height:n*1.2,fontSize:n}};function st(e,t,n){let i=t.indexOf(`:`),a=i>0?t.slice(0,i):``;a&&a!==`xmlns`&&r[a]?e.setAttributeNS(r[a],t,String(n)):e.setAttribute(t,String(n))}function ct(e,t,n,i=!1){let a=e.createElementNS(i?r.xhtml:r.svg,t.name);t.classes.length&&a.setAttribute(`class`,t.classes.join(` `));for(let[e,n]of Object.entries(t.attrs))st(a,e,n);t.content&&a.appendChild(e.createTextNode(t.content));let o=i||t.name===`foreignObject`;for(let r of t.children)a.appendChild(ct(e,r,n,o));return n.set(t,a),a}function lt(e){Array.from(e.querySelectorAll(`svg`)).filter(e=>e.getAttributeNS(r.xmlns,`ct`)).forEach(e=>e.remove())}function ut(e){return(t,n={})=>{let i=e.createElementNS(r.svg,`svg`);i.setAttribute(`style`,`position: absolute; visibility: hidden; width: 0; height: 0;`),n.rootClass&&i.setAttribute(`class`,n.rootClass);let a=e.createElementNS(r.svg,`text`);n.classes?.length&&a.setAttribute(`class`,n.classes.join(` `)),n.fontSize&&a.setAttribute(`font-size`,String(n.fontSize)),a.textContent=t,i.appendChild(a),(n.container??e.body).appendChild(i);try{if(typeof a.getBBox!=`function`)return Z(t,n);let r=a.getBBox(),i=parseFloat(e.defaultView?.getComputedStyle(a).fontSize??``);return r.width||r.height?{width:r.width,height:r.height,...i>0&&{fontSize:i}}:Z(t,n)}finally{i.remove()}}}function dt(){return{labels:`html`,render(e,t){let n=t.ownerDocument,i=/* @__PURE__ */ new WeakMap,a=ct(n,e,i);return a.setAttributeNS(r.xmlns,`xmlns:ct`,r.ct),lt(t),t.appendChild(a),{svg:a,elementOf:e=>i.get(e),remove:()=>a.remove()}},measureText(e,t){let n=t?.container?.ownerDocument??globalThis.document;return n?ut(n)(e,t):Z(e,t)}}}function ft(e){let t=e.map(e=>e.chartType??e.type);return t.includes(`bar`)?`ct-chart-bar`:t.includes(`donut`)?`ct-chart-donut`:t.includes(`pie`)?`ct-chart-pie`:`ct-chart-line`}function pt(e){return e.className===void 0?{...e,className:ft(e.layers)}:e}function mt(e,t){return[e,t]}let Q=e=>e,ht=/* @__PURE__ */ new Set([`resolve`,`prepare`,`layout`,`compose`,`scene`,`render`,`mount`]),gt=/* @__PURE__ */ new Set([`data`,`optionsChanged`,`draw`,`created`,`animationBegin`,`animationEnd`]),_t=/* @__PURE__ */ new Set;function vt(e){console.warn(e)}function yt(e){return e.map(e=>{let[t,n]=Array.isArray(e)?e:[e];if(typeof t==`function`)throw Error(`Chartist: the plugin "${t.name||`anonymous`}" is a 1.x plugin (a plain function). chart() and the preset functions accept only v2 plugins; convert it with fromLegacyPlugin() from chartist/compat.`);return[t,n]})}let bt=/* @__PURE__ */ new WeakMap,xt=()=>({owner:`user`});function St(e,t,n){let r=e.owner;e.owner=t;try{n()}finally{e.owner=r}}function Ct(e,t){let n=bt.get(e);n?St(n,`user`,t):t()}function wt(e,t=[],n,r){bt.set(e,r);let i=yt(t);for(let[e]of i)e.provides?.forEach(e=>n.add(e));for(let[t,n]of i)St(r,`plugin`,()=>t.install(e,n))}function Tt(e,t={}){for(let[n,r]of Object.entries(t))r&&Q(e).on(n,r)}function Et(e,t,n,r){return{on:((i,a)=>(gt.has(i)&&!n.has(i)&&!_t.has(i)&&(_t.add(i),vt(`Chartist: "${i}" is a 1.x event. v2 charts emit it only with the compat plugin: add compat from chartist/compat to plugins (see the migration guide).`)),e.on(i,a,r.owner),t())),off:((n,r)=>(e.off(n,r),t())),emit(t,n){if(ht.has(t))throw Error(`Chartist: "${t}" is a phase event; plugins can't emit phase events`);e.notify(t,n)}}}function Dt(e){if(typeof e==`number`)return e;let t=e?.match(/^\s*(\d+(?:\.\d+)?)(?:px)?\s*$/);return t?Number(t[1]):void 0}function Ot(e){let t=typeof e==`string`?document.querySelector(e):e;if(!t)throw Error(`Target element ${typeof e==`string`?`"${e}"`:``} is not found`);return t}function kt(e,t){let n=Ot(e),r=qe(),i=xt(),a=t.renderer??dt(),o=a.measureText,s=!1,c=(e,t)=>(s=!0,o?o(e,{container:n,...t}):Z(e,t)),l=t,u=t,d,f,p,m,h=!1,g=/* @__PURE__ */ new Set,_=n.ownerDocument.fonts,v=()=>{!h&&f&&s&&x(`layout`)};function y(){let e=String(u.width??`100%`),t=String(u.height??`100%`),r=n.ownerDocument.createElementNS(`http://www.w3.org/2000/svg`,`svg`);r.setAttribute(`width`,e),r.setAttribute(`height`,t);let i=e=>typeof e==`number`?`px`:``;r.setAttribute(`style`,`width: ${e}${i(u.width)}; height: ${t}${i(u.height)};`),n.appendChild(r);let a={width:r.clientWidth,height:r.clientHeight};return r.remove(),a}function b(){let e=y();return{width:u.viewBox?.width||e.width||(Dt(u.width)??n.clientWidth),height:u.viewBox?.height||e.height||(Dt(u.height)??n.clientHeight)}}function x(e){let{width:t,height:i}=b();s=!1,f=ot(r,pt(u),{width:t,height:i,measureText:c,labels:a.labels??`html`,rootSize:{width:u.width??`100%`,height:u.height??`100%`}},f,e);let{scene:o}=f;p=a.render(o,n),r.notify(`render`,{scene:o,output:p});let l=p.elementOf??(()=>void 0);r.notify(`mount`,{scene:o,output:p,elementOf:l})}function S(){let e=l.responsive?.entries;u=d?d.matching.reduce((t,n)=>({...t,...e[n][1]}),l):l}function C(){let e=u;S(),T.emit(`responsive`,{previousConfig:e,currentConfig:u}),x(`resolve`)}function w(){d?.stop(),d=l.responsive?.watch(n,()=>{h||C()}),S()}let T={container:n,update(e){return l={...l,...e},`responsive`in e?w():S(),x(`resolve`),T},detach(){return m?.disconnect(),m=void 0,_?.removeEventListener(`loadingdone`,v),d?.stop(),d=void 0,T},destroy(){h||(h=!0,T.detach(),p?.remove?.(),r.clear())},...Et(r,()=>T,g,i)};return wt(T,t.plugins,g,i),Tt(T,t.on),w(),x(`resolve`),_?.addEventListener(`loadingdone`,v),typeof ResizeObserver<`u`&&(m=new ResizeObserver(()=>{if(h||!f)return;if(d?.check()){C();return}let{width:e,height:t}=b();(e!==f.layout.width||t!==f.layout.height)&&x(`layout`)}),m.observe(n)),T}let At={x:{pos:`x`,len:`width`,counterPos:`y`,counterLen:`height`,dir:`horizontal`},y:{pos:`y`,len:`height`,counterPos:`x`,counterLen:`width`,dir:`vertical`}};function jt(e,t){let{area:n,padding:i,classNames:a}=t,o=At[e.dimension],s=t.options??(e.dimension===`x`?t.axisX:t.axisY),c=t.place,l=e.ticks.map((t,n)=>e.project(t,n)),u=e.ticks.map(s.labelInterpolationFnc),d=e.dimension===`x`?n.y2:n.x1,f=e.dimension===`x`?n.height:n.width,p=[],m=[];return l.forEach((h,g)=>{let _=u[g],v=l[g+1]?l[g+1]-h:Math.max(e.length-h,e.length/e.ticks.length);if(_!==``&&S(_))return;let y,b={x:0,y:0};if(c)({position:y,labelOffset:b}=c(e,h,v,s,n));else if(e.dimension===`x`){let e=t.axisX;y=n.x1+h,b.x=e.labelOffset.x,b.y=e.position===`start`?i.top+e.labelOffset.y+5:n.y1+e.labelOffset.y+5}else{let e=t.axisY;y=n.y1-h,b.y=e.labelOffset.y-v,b.x=e.position===`start`?i.left+e.labelOffset.x:n.x2+e.labelOffset.x+10}if(s.showGrid){let t={[`${o.pos}1`]:y,[`${o.pos}2`]:y,[`${o.counterPos}1`]:d,[`${o.counterPos}2`]:d+f};p.push(U(`line`,t,`${a.grid} ${a[o.dir]}`,{role:`grid`,ctx:{axis:e,index:g,...t}}))}if(s.showLabel){let n={[o.pos]:y+b[o.pos],[o.counterPos]:b[o.counterPos],[o.len]:v,[o.counterLen]:Math.max(0,s.offset-10)},i=t.atStart??s.position===`start`,c=[a.label,a[o.dir],i?a.start:a.end].join(` `),l={kind:`axis`,axis:e,index:g,text:_,...n};if(t.svgLabel){let r=t.svgLabel(String(_),n,c,e.dimension,i);r&&m.push(H(r,{role:`label`,ctx:l}));return}let u=U(`span`,{style:`${o.len}: ${Math.round(n[o.len])}px; ${o.counterLen}: ${Math.round(n[o.counterLen])}px;`,xmlns:r.xmlns},c).text(String(_));m.push(U(`foreignObject`,{style:`overflow: visible;`,...n},``,{role:`label`,ctx:l}).append(u))}}),{grids:p,labels:m}}function Mt(e,t){return U(`rect`,{x:e.x1,y:e.y2,width:e.width,height:e.height},t,{role:`gridBackground`})}function Nt(e,t,n){return t===`x`?{vertical:n?`bottom`:`top`,horizontal:e===`bar`?`middle`:`start`}:{vertical:e===`horizontalBar`?`middle`:`bottom`,horizontal:n?`end`:`start`}}function Pt(e,t,n){let r=[],i=``;for(let a of e.split(/\s+/).filter(Boolean)){let e=i?`${i} ${a}`:a;i&&n(e)>t?(r.push(i),i=a):i=e}return i&&r.push(i),r}let Ft=.85;function It(e,t,n={}){return(r,i,a,o,s)=>{let c=a.split(` `),l=t=>e(t,{classes:c}),u=Pt(r,Math.round(i.width),e=>l(e).width);if(!u.length)return;let d=l(u[0]),f=d.fontSize??d.height/1.2,p={...Nt(t,o,s),...n},m=u.length*f,h=p.vertical===`top`?i.y:p.vertical===`middle`?i.y+(i.height-m)/2:i.y+i.height-m,g=p.horizontal===`start`?i.x:p.horizontal===`middle`?i.x+i.width/2:i.x+i.width,_=e=>Math.round(e*100)/100;return H(U(`text`,{x:_(g),y:_(h+Ft*f),"text-anchor":p.horizontal},a),{children:u.map((e,t)=>U(`tspan`,{x:_(g),y:_(h+(t+Ft)*f)}).text(e))})}}function Lt(e){return Object.freeze({type:`container`,query:e})}function Rt(e){return typeof e==`object`&&!!e&&e.type===`container`}let zt=!1;function Bt(){zt||(zt=!0,console.warn(`Chartist: container() needs Element.matchContainer(); load the match-container polyfill. Container entries are ignored.`))}let Vt=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);function Ht(e,t,n,r=!1){let i=typeof window<`u`?window:void 0,a,o=e.map(([e])=>{if(!Rt(e))return i?.matchMedia?.(e);if(!t)return;let n=t.ownerDocument.createElement(`span`);if(typeof n.matchContainer!=`function`)Bt();else{a||(a=t.appendChild(n),a.className=`ct-probe`,a.setAttribute(`aria-hidden`,`true`),a.style.cssText=`position:absolute;width:0;height:0;overflow:hidden`);try{return a.matchContainer(e.query)}catch(t){throw a.remove(),Error(`Chartist: invalid container condition "${e.query}": ${t.message}`)}}}),s=()=>o.flatMap((e,t)=>e?.matches?[t]:[]),c={matching:s(),check(){let e=s();return!Vt(e,c.matching)&&(c.matching=e,!0)},stop(){o.forEach(e=>e?.removeEventListener?.(`change`,l)),u?.disconnect(),a?.remove()}};function l(){c.check()&&n()}o.forEach(e=>e?.addEventListener?.(`change`,l));let u=r&&a&&typeof ResizeObserver<`u`?new ResizeObserver(l):void 0;return u&&t&&u.observe(t),c}function Ut(e){return{entries:e,watch:(t,n)=>Ht(e,t,n)}}function Wt(e,t,n,r){return n.reduce((e,n)=>r(e,t[n][1]),e)}function Gt(e,t,n){return{svgLabel:n,area:t.area,padding:t.padding,axisX:e.axisX,axisY:e.axisY,classNames:e.classNames}}function $(e,t){return H(U(`g`,{},e),{children:t})}function Kt(e,t=[`x`,`y`]){return{type:`grid`,coordinates:[`cartesian`],compose(n){let r=t.flatMap(t=>{let r=n.axes[t];return r?jt(r,Gt(e,n)).grids:[]});return e.showGridBackground&&r.unshift(Mt(n.area,e.classNames.gridBackground)),[$(e.classNames.gridGroup,r)]}}}function qt(e,t=[`x`,`y`]){return{type:`labels`,coordinates:[`cartesian`],compose(n){let r=n.labels===`svg`?It(n.measureText,e.labelKind??`line`):void 0;return[$(e.classNames.labelGroup,t.flatMap(t=>{let i=n.axes[t];return i?jt(i,Gt(e,n,r)).labels:[]}))]}}}function Jt(e){return{...e,compose:t=>[$(``,[...e.compose(t)])]}}let Yt=Symbol.for(`chartist.presetState`);function Xt(e,t){return{name:`preset-root-style`,install(n){Object.defineProperty(n,Yt,{value:t}),n.on(`scene`,({scene:t})=>{let{width:n=`100%`,height:r=`100%`}=e();return{scene:t.attr({style:`width: ${n}; height: ${r};`})}})}}}function Zt(e,t,n,r={},i,a=r.plugins){let o=n,s=h({},e.defaults,r),c=Ht(i??[],(typeof t==`string`?document.querySelector(t):t)??void 0,()=>g(),!0),l=e=>Wt(h({},e),i,c.matching,(e,t)=>h({},e,t)),u=l(s),d=e=>({...e,preset:p}),f={get handle(){return _},setData(e){e.labels=e.labels||[],e.series=e.series||[],o=e},setOptions(t,n=!1){s=h({},n?s:e.defaults,t),u=l(s)},render(){m.update(d(e.config(o,u)))},options:()=>u,data:()=>o},p={kind:e.kind,get options(){return u},get data(){return o},update(e,t,n){e&&f.setData(e),t&&f.setOptions(t,n),f.render()},detach:()=>_.detach()},m=kt(t,{...d(e.config(o,u)),plugins:[Xt(()=>u,p),...a??[]],on:r.on});function g(){let e=u;u=l(s),m.emit(`responsive`,{previousOptions:e,currentOptions:u}),f.render()}let _={container:m.container,update(e){return e.data&&(o=e.data),m.update(e),_},setOptions(e,t){return f.setOptions(e,!t?.replace),f.render(),_},detach(){return c.stop(),m.detach(),_},destroy(){_.detach(),m.destroy()},emit:(e,t)=>Q(m).emit(e,t),on:((e,t)=>(m.on(e,t),_)),off:((e,t)=>(m.off(e,t),_))};return f}function Qt(e){let t=He();return{kind:`step`,create:n=>t.create({...n,options:{...n.options,ticks:n.labels,stretch:e}})}}function $t(e){let{axisX:t,axisY:n}=e;return{x:{...t,type:t.type??Qt(e.fullWidth)},y:n.type===void 0?{...n,type:Ue(),high:x(e.high)?e.high:n.high,low:x(e.low)?e.low:n.low}:{...n,type:n.type},reverseData:e.reverseData}}let en={kind:`line`,defaults:Ge,config(e,t){let n=t,r=n;return{data:e,axes:ze($t(n)),padding:n.chartPadding,width:n.width,height:n.height,viewBox:n.viewBox,className:n.classNames.chart,labels:n.labels,layers:[Kt(r),Jt(Oe({lineSmooth:n.lineSmooth,showPoint:n.showPoint,showLine:n.showLine,showArea:n.showArea,areaBase:n.areaBase,overrides:n.series,reverseData:n.reverseData,classNames:n.classNames})),qt(r)]}}};function tn(e,t,n={},r,i){return Zt(en,e,t,n,r,i??n.plugins)}function nn(e,t,n={},r){return tn(e,t,n,r).handle}let rn=/* @__PURE__ */ new Set,an=/* @__PURE__ */ new Set([`resolve`,`prepare`,`layout`,`compose`,`scene`,`render`,`mount`]);function on(e,t){let n=e.find(e=>typeof e?.legacyPlugin==`function`);return e.flatMap(e=>{let[r,i]=Array.isArray(e)?e:[e];return typeof r==`function`?n?[n.legacyPlugin(r,i,t)]:(rn.has(r)||(rn.add(r),console.warn(`Chartist: the plugin "${r.name||`anonymous`}" looks like a 1.x plugin (a plain function) and was skipped. 1.x plugins run only with the compat plugin: add compat from chartist/compat to plugins.`)),[]):[e]})}var sn=class extends _e{data;chartOptions;chartResponsiveOptions;controller;installing;queued=[];onWindowResize=()=>this.update();wildcards=/* @__PURE__ */ new Map;constructor(e,t,n,r,i){super(e,t,n,h({},n,r),i),this.data=t,this.chartOptions=r,this.chartResponsiveOptions=i,Object.defineProperty(this,"eventEmitter",{value:{on:(e,t)=>this.on(e,t),off:(e,t)=>this.off(e,t),emit:(e,t)=>this.controller&&Q(this.controller.handle).emit(e,t)}})}initialize(){this.initializeTimeoutId=null;let e=this.queued.splice(0),t={name:`chart-listeners`,install:t=>{this.installing=t,Ct(t,()=>e.forEach(([e,t])=>this.on(e,t)))}},n={name:`chart-fields`,install:e=>void e.on(`resolve`,({config:e})=>e.labels?{config:{...e,labels:void 0}}:void 0).on(`mount`,()=>{this.controller&&(this.data=this.controller.data(),this.options=this.controller.options())})};this.controller=this.createController(this.container,this.data,this.chartOptions,this.chartResponsiveOptions?.filter(([e])=>typeof e==`string`),[t,n,...on(this.chartOptions?.plugins??[],this)]),this.installing=void 0,window.addEventListener(`resize`,this.onWindowResize)}createChart(){}update(e,t,n=!1){return e&&(this.data=e),t&&(this.chartOptions=h({},n?this.chartOptions:{},t)),this.controller&&(e&&this.controller.setData(e),t&&this.controller.setOptions(t,n),this.controller.render()),this}detach(){return super.detach(),window.removeEventListener(`resize`,this.onWindowResize),this.controller?.handle.detach(),this}on(e,t){let n=this.controller?.handle??this.installing;if(!n)this.queued.push([e,t]);else if(e===`*`){let e=t,r=(t,n)=>{an.has(t)||e(t,n)};this.wildcards.set(e,r),n.on(`*`,r)}else Q(n).on(e,t);return this}off(e,t){let n=this.controller?.handle??this.installing;if(n){let r=e===`*`&&t?this.wildcards.get(t):t;Q(n).off(e,r)}else{let n=this.queued.findIndex(([n,r])=>n===e&&(!t||r===t));t&&n>=0?this.queued.splice(n,1):t||this.queued.splice(0,this.queued.length,...this.queued.filter(([t])=>t!==e))}return this}};function cn(e,t,n){if(b(e,`name`)&&e.name&&t.series?.[e.name]){let r=(t?.series[e.name])[n];return r===void 0?t[n]:r}return t[n]}var ln=class extends sn{constructor(e,t,n,r){super(e,t,Ge,n,r)}createController(e,t,n,r,i){return tn(e,t,n,r,i)}};function un(e,t){let n=typeof e==`object`&&e?e[t]:e;return x(n)?Number(n):0}function dn(e,t,n=!1){let r=[],i=[],a=1/0,o=-1/0;for(let s of e)s.forEach((e,s)=>{let c=un(e,t),l=n&&c<0?i:r;l[s]=(l[s]??0)+c,a=Math.min(a,l[s]),o=Math.max(o,l[s])});return a<=o?{low:a,high:o}:void 0}function fn(e){return{name:e.name,className:e.className,meta:e.meta,data:e.values}}function pn(e={}){let t={series:`ct-series`,bar:`ct-bar`,...e.classNames},n=!!e.horizontalBars,r=e.seriesBarDistance??15,i=e.stackMode??`accumulate`,a=e.stackBars&&i!==`overlap`&&i!==!0;return{type:`bar`,coordinates:[`cartesian`],axes:{x:e.x,y:e.y},series:e.series,extent({normalized:e,axes:t}){let r=n?t.x:t.y,o=a&&r!==void 0?dn(e.series,n?`x`:`y`,i===`accumulate-relative`):void 0;return r!==void 0&&o?{[r]:o}:{}},compose({data:a,area:o,axes:c,normalized:l,seriesIndexes:u}){let d=n?c.x:c.y,f=n?c.y:c.x;if(!d||!f||!l)throw Error(`Layer "bar" needs an x and a y axis`);let p=n?`y`:`x`,m=n?`x`:`y`,h=l.series,g=a.flat?[...a.series[0].values]:a.series.map(fn),_=g.map((e,t)=>t);e.reverseData&&_.reverse();let v=n?o.x1+d.project(0):o.y1-d.project(0),y=i===`accumulate`,S=i===`accumulate-relative`,C=[],w=[],T=C;if(u&&e.reverseData)throw Error(`Layer "bar": a series selection can't be combined with reverseData`);return _.map((a,c)=>{let l=u?.[a]??c,_=g[a],D=c-(g.length-1)/2,O;O=e.distributeSeries&&!e.stackBars?f.length/h.length/2:e.distributeSeries&&e.stackBars?f.length/2:f.length/h[c].length/2;let k=b(_,`name`)&&_.name,A=b(_,`className`)&&_.className,j=b(_,`meta`)?_.meta:void 0,M=[];return h[c].forEach((a,s)=>{let u=b(a,`x`)&&a.x,g=b(a,`y`)&&a.y,k=e.distributeSeries&&!e.stackBars?c:e.distributeSeries&&e.stackBars?0:s,A=h[c],j=n?{x:o.x1+d.project(u||0,s,A),y:o.y1-f.project(g||0,k,A)}:{x:o.x1+f.project(u||0,k,A),y:o.y1-d.project(g||0,s,A)};f.kind===`step`&&(f.stretch||(j[p]+=O*(n?-1:1)),j[p]+=e.stackBars||e.distributeSeries?0:D*r*(n?-1:1)),S&&(T=Number(n?u:g)<0?w:C);let ee=T[s]||v;if(T[s]=ee-(v-j[m]),a===void 0)return;let N={[`${p}1`]:j[p],[`${p}2`]:j[p]};e.stackBars&&(y||S||!i)?(N[`${m}1`]=ee,N[`${m}2`]=T[s]):(N[`${m}1`]=v,N[`${m}2`]=j[m]),N.x1=Math.min(Math.max(N.x1,o.x1),o.x2),N.x2=Math.min(Math.max(N.x2,o.x1),o.x2),N.y1=Math.min(Math.max(N.y1,o.y2),o.y1),N.y2=Math.min(Math.max(N.y2,o.y2),o.y1);let P=E(_,s);M.push(U(`line`,{...N,"ct:value":[u,g].filter(x).join(`,`),"ct:meta":I(P)},t.bar,{role:`bar`,ctx:{series:_,seriesIndex:l,valueIndex:s,value:a,meta:P,...N}}))}),H(U(`g`,{"ct:series-name":k||void 0,"ct:meta":j?I(j):void 0},`${t.series} ${A||`${t.series}-${s(l)}`}`,{role:`series`,ctx:{series:_,seriesIndex:l,meta:j}}),{children:M})})}}}let mn={axisX:{offset:30,position:`end`,labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:g,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:`start`,labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:g,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,referenceValue:0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:`accumulate`,horizontalBars:!1,distributeSeries:!1,reverseData:!1,showGridBackground:!1,classNames:{chart:`ct-chart-bar`,horizontalBars:`ct-horizontal-bars`,label:`ct-label`,labelGroup:`ct-labels`,series:`ct-series`,bar:`ct-bar`,grid:`ct-grid`,gridGroup:`ct-grids`,gridBackground:`ct-grid-background`,vertical:`ct-vertical`,horizontal:`ct-horizontal`,start:`ct-start`,end:`ct-end`}};function hn(e,t){let n=e.horizontalBars?`x`:`y`,r=t?Me(t)?Ne(t):t:Ue();return{kind:r.kind,create(t){let i=j(t.series,e,n,t.extent);return typeof e.high==`number`&&(i.high=e.high),typeof e.low==`number`&&(i.low=e.low),r.create({...t,options:{...t.options,highLow:i,referenceValue:0}})}}}function gn(e){let t=He();return{kind:`step`,create:n=>t.create({...n,options:{ticks:e.distributeSeries&&e.stackBars?n.labels.slice(0,1):n.labels}})}}function _n(e){let t=e.horizontalBars,n=t?e.axisX:e.axisY,r=t?e.axisY:e.axisX,i={...n,type:hn(e,n.type)},a={...r,type:r.type??gn(e)};return{x:t?i:a,y:t?a:i,reverseData:e.reverseData,normalize:{multi:t?`x`:`y`,distributed:!0}}}let vn={kind:`bar`,defaults:mn,config(e,t){let n=t,r=n,i=n.horizontalBars?[`y`,`x`]:[`x`,`y`],a=pn({horizontalBars:n.horizontalBars,stackBars:n.stackBars,stackMode:n.stackMode,seriesBarDistance:n.seriesBarDistance,distributeSeries:n.distributeSeries,reverseData:n.reverseData,classNames:n.classNames}),o=n.stackMode===`overlap`?pn({horizontalBars:n.horizontalBars,stackBars:n.stackBars}):a,s={...Jt(a),extent:o.extent};return{data:e,axes:ze(_n(n)),padding:n.chartPadding,width:n.width,height:n.height,viewBox:n.viewBox,className:n.classNames.chart+(n.horizontalBars?` ${n.classNames.horizontalBars}`:``),labels:n.labels,layers:[Kt(r,i),s,qt({...r,labelKind:n.horizontalBars?`horizontalBar`:`bar`},i)]}}};function yn(e,t,n={},r,i){return Zt(vn,e,t,n,r,i??n.plugins)}function bn(e,t,n={},r){return yn(e,t,n,r).handle}var xn=class extends sn{constructor(e,t,n,r){super(e,t,mn,n,r)}createController(e,t,n,r,i){return yn(e,t,n,r,i)}};function Sn(e,t,n){let r=t.x>e.x;return r&&n===`explode`||!r&&n===`implode`?`start`:r&&n===`implode`||!r&&n===`explode`?`end`:`middle`}function Cn(e,t,n,r){e.y>t.y-n&&e.y<t.y+n&&e.x>t.x-r*n&&e.x<t.x+r*n&&(e.y-=n,e.x-=n,Cn(e,t,n,r))}let wn={series:`ct-series`,slicePie:`ct-slice-pie`,sliceDonut:`ct-slice-donut`,label:`ct-label`};function Tn(e={}){let t={...wn,...e.classNames},n=e.labelInterpolationFnc??(e=>e);return{type:`pie`,chartType:e.donut?`donut`:`pie`,coordinates:[`polar`],compose({data:r,area:i}){let a=r.flat?[...r.series[0].values]:r.series.map(e=>({name:e.name,className:e.className,meta:e.meta,value:e.values[0]})),c=M({labels:r.labels,series:a}),l=c.series,u=c.labels,d=[],f=e.startAngle??0,m=Math.min(i.width/2,i.height/2),h=e.total||l.reduce(v,0),g=o(e.donutWidth??60);g.unit===`%`&&(g.value*=m/100),m-=e.donut?g.value/2:0;let _;_=e.labelPosition===`center`?0:e.labelPosition===`outside`?e.donut?m+g.value/2:m:e.donut?m:m/2,e.labelOffset&&(_+=e.labelOffset);let y={x:i.x1+i.width/2,y:i.y2+i.height/2},x=a.filter(e=>b(e,`value`)?e.value!==0:e!==0).length===1,C=[],w=[];return a.forEach((r,i)=>{if(l[i]===0&&e.ignoreEmptyValues){C.push(U(`g`));return}let o=b(r,`name`)&&r.name,c=b(r,`className`)&&r.className,v=b(r,`meta`)?r.meta:void 0,T=h>0?f+l[i]/h*360:0,E=Math.max(0,f-(i===0||x?0:.2));T-E>=359.99&&(T=E+359.99);let D=p(y.x,y.y,m,E),O=p(y.x,y.y,m,T),k=new B(!e.donut).move(O.x,O.y).arc(m,m,0,Number(T-f>180),0,D.x,D.y);e.donut||k.line(y.x,y.y);let A=U(`path`,{d:k.stringify(),"ct:value":l[i],"ct:meta":I(v),style:e.donut&&e.donutWidth!==void 0?`stroke-width: ${g.value}px`:void 0},e.donut?t.sliceDonut:t.slicePie,{role:`slice`,ctx:{value:l[i],totalDataSum:h,index:i,seriesIndex:i,valueIndex:0,meta:v,series:r,path:k.clone(),center:y,radius:m,startAngle:f,endAngle:T}});if(C.push(H(U(`g`,{"ct:series-name":o||void 0},`${t.series} ${c||`${t.series}-${s(i)}`}`,{role:`series`,ctx:{seriesIndex:i,series:r,meta:v}}),{children:[A]})),e.showLabel??!0){let o=a.length===1?{x:y.x,y:y.y}:p(y.x,y.y,_,f+(T-f)/2),s=u&&!S(u[i])?u[i]:l[i],c=n(s,i);if(c||c===0){let n=String(c);if(e.preventOverlappingLabelOffset){let t=n.length;d.forEach(n=>Cn(o,n,e.preventOverlappingLabelOffset,t)),d.push(o)}w.push(U(`text`,{dx:o.x,dy:o.y,"text-anchor":Sn(y,o,e.labelDirection??`neutral`)},t.label,{role:`label`,ctx:{kind:`pie`,index:i,seriesIndex:i,valueIndex:0,text:n,series:r,meta:v,x:o.x,y:o.y}}).text(n))}}f=T}),e.showLabel??!0?[...C,H(U(`g`),{children:w})]:C}}}let En={width:void 0,height:void 0,chartPadding:5,classNames:{chartPie:`ct-chart-pie`,chartDonut:`ct-chart-donut`,series:`ct-series`,slicePie:`ct-slice-pie`,sliceDonut:`ct-slice-donut`,label:`ct-label`},startAngle:0,total:void 0,donut:!1,showLabel:!0,labelOffset:0,labelPosition:`inside`,labelInterpolationFnc:g,labelDirection:`neutral`,ignoreEmptyValues:!1,preventOverlappingLabelOffset:0},Dn={kind:`pie`,defaults:En,config(e,t){let n=t;return{data:e,coordinates:`polar`,padding:n.chartPadding,width:n.width,height:n.height,viewBox:n.viewBox,className:n.donut?n.classNames.chartDonut:n.classNames.chartPie,layers:[Tn({startAngle:n.startAngle,total:n.total,donut:n.donut,donutWidth:n.donutWidth,showLabel:n.showLabel,labelOffset:n.labelOffset,labelPosition:n.labelPosition,labelInterpolationFnc:n.labelInterpolationFnc,labelDirection:n.labelDirection,ignoreEmptyValues:n.ignoreEmptyValues,preventOverlappingLabelOffset:n.preventOverlappingLabelOffset,classNames:n.classNames})]}}};function On(e,t,n={},r,i){return Zt(Dn,e,t,n,r,i??n.plugins)}function kn(e,t,n={},r){return On(e,t,n,r).handle}var An=class extends sn{constructor(e,t,n,r){super(e,t,En,n,r)}moveLabel(e,t,n,r){Cn(e,t,n,r)}createController(e,t,n,r,i){return On(e,t,n,r,i)}},jn=class extends J{bounds;range;constructor(e,t,n,r){let i=r.highLow||j(t,r,e.pos),a=m(n[e.rectEnd]-n[e.rectStart],i,r.scaleMinSpace||20,r.onlyInteger),o={min:a.min,max:a.max};super(e,n,a.values),this.bounds=a,this.range=o}projectValue(e){let t=Number(A(e,this.units.pos));return this.axisLength*(t-this.bounds.min)/this.bounds.range}},Mn=class extends J{range;constructor(e,t,n,r){let i=r.highLow||j(t,r,e.pos),a=r.divisor||1,o=(r.ticks||_(a+1,e=>i.low+(i.high-i.low)/a*e)).sort((e,t)=>Number(e)-Number(t)),s={min:i.low,max:i.high};super(e,n,o),this.range=s}projectValue(e){let t=Number(A(e,this.units.pos));return this.axisLength*(t-this.range.min)/(this.range.max-this.range.min)}},Nn=class extends J{stepLength;stretch;constructor(e,t,n,r){let i=r.ticks||[];super(e,n,i);let a=Math.max(1,i.length-+!!r.stretch);this.stepLength=this.axisLength/a,this.stretch=!!r.stretch}projectValue(e,t){return this.stepLength*t}};function Pn(e){let t={divisor:2,fillHoles:!1,...e},n=1/Math.max(1,t.divisor);return function(e,r){let i=new B,a=0,o=0,s;for(let c=0;c<e.length;c+=2){let l=e[c],u=e[c+1],d=(l-a)*n,f=r[c/2];f.value===void 0?t.fillHoles||(a=o=0,s=void 0):(s===void 0?i.move(l,u,!1,f):i.curve(a+d,o,l-d,u,l,u,!1,f),a=l,o=u,s=f)}return i}}function Fn(e){let t={postpone:!0,fillHoles:!1,...e};return function(e,n){let r=new B,i=0,a=0,o;for(let s=0;s<e.length;s+=2){let c=e[s],l=e[s+1],u=n[s/2];u.value===void 0?t.fillHoles||(i=a=0,o=void 0):(o===void 0?r.move(c,l,!1,u):(t.postpone?r.line(c,a,!1,o):r.line(i,l,!1,u),r.line(c,l,!1,u)),i=c,a=l,o=u)}return r}}function In(e){let t={tension:1,fillHoles:!1,...e},n=Math.min(1,Math.max(0,t.tension)),r=1-n;return function e(i,a){let o=F(i,a,{fillHoles:t.fillHoles});if(!o.length)return V()([],[]);if(o.length>1)return B.join(o.map(t=>e(t.pathCoordinates,t.valueData)));{if(i=o[0].pathCoordinates,a=o[0].valueData,i.length<=4)return V()(i,a);let e=new B().move(i[0],i[1],!1,a[0]);for(let t=0,o=i.length;o-2>t;t+=2){let s=[{x:+i[t-2],y:+i[t-1]},{x:+i[t],y:+i[t+1]},{x:+i[t+2],y:+i[t+3]},{x:+i[t+4],y:+i[t+5]}];o-4===t?s[3]=s[2]:t||(s[0]={x:+i[t],y:+i[t+1]}),e.curve(n*(-s[0].x+6*s[1].x+s[2].x)/6+r*s[2].x,n*(-s[0].y+6*s[1].y+s[2].y)/6+r*s[2].y,n*(s[1].x+6*s[2].x-s[3].x)/6+r*s[2].x,n*(s[1].y+6*s[2].y-s[3].y)/6+r*s[2].y,s[2].x,s[2].y,!1,a[(t+2)/2])}return e}}}var Ln=/* @__PURE__ */ n({cardinal:()=>In,monotoneCubic:()=>xe,none:()=>V,simple:()=>Pn,step:()=>Fn});let Rn=e=>String(e).replace(/[&<>"']/g,e=>i[e]);function zn(e,t){let n=[];t===`root`?n.push(`xmlns="${r.svg}"`,`xmlns:ct="${r.ct}"`):t===`html-root`&&n.push(`xmlns="${r.xhtml}"`),e.classes.length&&n.push(`class="${Rn(e.classes.join(` `))}"`);for(let[t,r]of Object.entries(e.attrs))t!==`xmlns`&&n.push(`${t}="${Rn(r)}"`);return n.length?` ${n.join(` `)}`:``}function Bn(e,t){let n=`<${e.name}${zn(e,t)}`,r=e.name===`foreignObject`?`html-root`:`other`,i=(e.content===void 0?``:Rn(e.content))+e.children.map(e=>Bn(e,r)).join(``);return i?`${n}>${i}</${e.name}>`:`${n}/>`}function Vn(e){return Bn(e,`root`)}function Hn(e){throw Error(`Chartist: ${e}() is not available in toScene()`)}function Un(e,t){let n=qe(),r=/* @__PURE__ */ new Set,i=xt(),a={update:()=>Hn(`update`),detach:()=>Hn(`detach`),destroy:()=>Hn(`destroy`),...Et(n,()=>a,r,i)};return wt(a,e.plugins,r,i),Tt(a,e.on),ot(n,pt(e),{width:t.width,height:t.height,measureText:t.measureText??Z,labels:t.labels??`svg`}).scene}let Wn={grid:`ct-grid`,label:`ct-label`,horizontal:`ct-horizontal`,vertical:`ct-vertical`,start:`ct-start`,end:`ct-end`,gridGroup:`ct-grids`,labelGroup:`ct-labels`,gridBackground:`ct-grid-background`};function Gn(e){let t=e.options;return{...t,offset:t.offset??0,position:e.side===`top`||e.side===`left`?`start`:`end`,labelOffset:t.labelOffset??{x:0,y:0},showLabel:t.showLabel??!0,showGrid:t.showGrid??!0,labelInterpolationFnc:t.labelInterpolationFnc??(e=>e)}}function Kn(e,t){let n=e.axes.all??[];return t?t.map(e=>{let t=n.find(t=>t.id===e);if(!t)throw Error(`Chartist: unknown axis "${e}" in an axis layer`);return t}):n}let qn=(e,t)=>(n,r,i,a,o)=>n.dimension===`x`?{position:o.x1+r,labelOffset:{x:a.labelOffset.x,y:e===`top`?o.y2-t-a.offset+a.labelOffset.y+5:o.y1+t+a.labelOffset.y+5}}:{position:o.y1-r,labelOffset:{x:e===`left`?o.x1-t-a.offset+a.labelOffset.x:o.x2+t+a.labelOffset.x+10,y:a.labelOffset.y-i}};function Jn(e,t,n,r){return jt(e,{svgLabel:r,area:t.area,padding:t.padding,classNames:n,options:Gn(e),place:qn(e.side,e.inset),atStart:e.side===`top`||e.side===`left`})}function Yn(e={}){let t={...Wn,...e.classNames};return{type:`axisGrid`,coordinates:[`cartesian`],series:[],compose(n){let r=Kn(n,e.axes).flatMap(e=>Jn(e,n,t).grids);return e.background&&r.unshift(Mt(n.area,t.gridBackground)),[H(U(`g`,{},t.gridGroup),{children:r})]}}}function Xn(e={}){let t={...Wn,...e.classNames};return{type:`axisLabels`,coordinates:[`cartesian`],series:[],compose(n){let r=(e.labels??n.labels)===`svg`?It(n.measureText,`line`,e.align):void 0;return[H(U(`g`,{},t.labelGroup),{children:Kn(n,e.axes).flatMap(e=>Jn(e,n,t,r).labels)})]}}}e.AutoScaleAxis=jn,e.Axis=J,e.BarChart=xn,e.BaseChart=_e,e.EPSILON=c,e.EventEmitter=he,e.FixedScaleAxis=Mn,Object.defineProperty(e,"Interpolation",{enumerable:!0,get:function(){return Ln}}),e.LineChart=ln,e.PieChart=An,e.StepAxis=Nn,e.Svg=L,e.SvgList=ie,e.SvgPath=B,e.alphaNumerate=s,e.autoScaleAxis=Ue,e.axisGrid=Yn,e.axisLabels=Xn,e.axisUnits=q,e.bar=pn,e.barChart=bn,e.cartesianAxes=Be,e.chart=kt,e.container=Lt,e.createChartRect=de,e.createGrid=fe,e.createGridBackground=pe,e.createLabel=me,e.createSvg=le,e.deserialize=re,e.determineAnchorPosition=Sn,e.domRenderer=dt,e.each=T,e.easings=ae,e.ensureUnit=a,e.escapingMap=i,e.estimateText=Z,e.extend=h,e.findAll=Ye,e.fixedScaleAxis=We,e.getBounds=m,e.getHighLow=j,e.getMetaData=E,e.getMultiValue=A,e.getNumberOrUndefined=C,e.getSeriesOption=cn,e.isArrayOfArrays=w,e.isArrayOfSeries=O,e.isDataHoleValue=D,e.isFalseyButZero=S,e.isMultiValue=k,e.isNumeric=x,e.line=Oe,e.lineChart=nn,e.mapNodes=Y,e.namespaces=r,e.node=U,e.noop=g,e.normalizeData=M,e.normalizePadding=ue,e.optionsProvider=R,e.orderOfMagnitude=l,e.pie=Tn,e.pieChart=kn,e.polarToCartesian=p,e.precision=8,e.projectLength=u,e.quantity=o,e.renderToString=Vn,e.responsive=Ut,e.rho=f,e.roundWithPrecision=d,e.safeHasProperty=b,e.serialMap=y,e.serialize=I,e.splitIntoSegments=F,e.stepAxis=He,e.sum=v,e.times=_,e.toScene=Un,e.withOptions=mt});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.Chartist={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.defineProperty,n=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r};let r={svg:`http://www.w3.org/2000/svg`,xmlns:`http://www.w3.org/2000/xmlns/`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,ct:`http://gionkunz.github.com/chartist-js/ct`},i={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function a(e,t){return typeof e==`number`?e+t:e}function o(e){if(typeof e==`string`){let t=/^(\d+)\s*(.*)$/g.exec(e);return{value:t?+t[1]:0,unit:t?.[2]||void 0}}return{value:Number(e)}}function s(e){return String.fromCharCode(97+e%26)}let c=2221e-19;function l(e){return Math.floor(Math.log(Math.abs(e))/Math.LN10)}function u(e,t,n){return t/n.range*e}function d(e,t){let n=10**(t??8);return Math.round(e*n)/n}function f(e){if(e===1||!Number.isFinite(e))return e;function t(e,t){for(let n=0;n<1e3&&Number.isFinite(e)&&t!==0;n++){let n=e%t;if(n===0)return t;e=t,t=n}return NaN}function n(e){return e*e+1}let r=2,i=2,a;if(e%2==0)return 2;do r=n(r)%e,i=n(n(i))%e,a=t(Math.abs(r-i),e);while(a===1);return a}function p(e,t,n,r){let i=(r-90)*Math.PI/180;return{x:e+n*Math.cos(i),y:t+n*Math.sin(i)}}function m(e,t,n,r=!1){let i={high:t.high,low:t.low,valueRange:0,oom:0,step:0,min:0,max:0,range:0,numberOfSteps:0,values:[]};i.valueRange=i.high-i.low,i.oom=l(i.valueRange),i.step=10**i.oom,i.min=Math.floor(i.low/i.step)*i.step,i.max=Math.ceil(i.high/i.step)*i.step,i.range=i.max-i.min,i.numberOfSteps=Math.round(i.range/i.step);let a=u(e,i.step,i)<n,o=r?f(i.range):0;if(r&&u(e,1,i)>=n)i.step=1;else if(r&&o<i.step&&u(e,o,i)>=n)i.step=o;else{let t=0;for(;;){if(a&&u(e,i.step,i)<=n)i.step*=2;else if(!a&&u(e,i.step/2,i)>=n){if(i.step/=2,r&&i.step%1!=0){i.step*=2;break}}else break;if(t++>1e3)throw Error(`Exceeded maximum number of iterations while optimizing scale step!`)}}i.step=Math.max(i.step,c);function s(e,t){return e===(e+=t)&&(e*=1+(t>0?c:-2221e-19)),e}let p=i.min,m=i.max;for(;p+i.step<=i.low;)p=s(p,i.step);for(;m-i.step>=i.high;)m=s(m,-i.step);i.min=p,i.max=m,i.range=i.max-i.min;let h=[];for(let e=i.min;e<=i.max;e=s(e,i.step)){let t=d(e);t!==h[h.length-1]&&h.push(t)}return i.values=h,i}function h(e={},...t){for(let n=0;n<t.length;n++){let r=t[n],i=Object.getPrototypeOf(e);for(let t in r){if(i!==null&&t in i)continue;let n=r[t];if(typeof n==`object`&&n&&!Array.isArray(n)){let r=e[t];e[t]=h(typeof r==`object`&&r?r:{},n)}else e[t]=n}}return e}let g=e=>e;function _(e,t){return Array.from({length:e},t?(e,n)=>t(n):()=>void 0)}let v=(e,t)=>e+(t||0),y=(e,t)=>_(Math.max(...e.map(e=>e.length)),n=>t(...e.map(e=>e[n])));function b(e,t){return typeof e==`object`&&!!e&&Reflect.has(e,t)}function x(e){return e!==null&&isFinite(e)}function S(e){return!e&&e!==0}function C(e){return x(e)?Number(e):void 0}function w(e){return Array.isArray(e)?e.every(Array.isArray):!1}function T(e,t,n=!1){let r=0;e[n?`reduceRight`:`reduce`]((e,n,i)=>t(n,r++,i),void 0)}function E(e,t){let n=Array.isArray(e)?e[t]:b(e,`data`)?e.data[t]:null;return b(n,`meta`)?n.meta:void 0}function D(e){return e==null||typeof e==`number`&&isNaN(e)}function O(e){return Array.isArray(e)&&e.every(e=>Array.isArray(e)||b(e,`data`))}function k(e){return typeof e==`object`&&!!e&&(Reflect.has(e,`x`)||Reflect.has(e,`y`))}function A(e,t=`y`){return k(e)&&b(e,t)?C(e[t]):C(e)}function j(e){let{high:t,low:n}=e;return t>n?{high:t,low:n}:n===0?{high:1,low:n}:n<0?{high:0,low:n}:t>0?{high:t,low:0}:{high:1,low:0}}function M(e,t,n,r){t={...t,...n?n===`x`?t.axisX:t.axisY:{}};let i={high:t.high===void 0?-Number.MAX_VALUE:+t.high,low:t.low===void 0?Number.MAX_VALUE:+t.low},a=t.high===void 0,o=t.low===void 0;function s(e){if(!D(e)){if(Array.isArray(e))for(let t=0;t<e.length;t++)s(e[t]);else{let t=Number(n&&b(e,n)?e[n]:e);a&&t>i.high&&(i.high=t),o&&t<i.low&&(i.low=t)}}}return(a||o)&&s(e),r&&(a&&(i.high=Math.max(r.high,i.high)),o&&(i.low=Math.min(r.low,i.low))),(t.referenceValue||t.referenceValue===0)&&(a&&(i.high=Math.max(t.referenceValue,i.high)),o&&(i.low=Math.min(t.referenceValue,i.low))),j(i)}function N(e,t=!1,n,r){let i,a={labels:(e.labels||[]).slice(),series:ne(e.series,n,r)},o=a.labels.length;return w(a.series)?(i=Math.max(o,...a.series.map(e=>e.length)),a.series.forEach(e=>{e.push(..._(Math.max(0,i-e.length)))})):i=a.series.length,a.labels.push(..._(Math.max(0,i-o),()=>``)),t&&P(a),a}function P(e){e.labels?.reverse(),e.series.reverse();for(let t of e.series)b(t,`data`)?t.data.reverse():Array.isArray(t)&&t.reverse()}function F(e,t){let n,r;if(typeof e!=`object`){let i=C(e);t===`x`?n=i:r=i}else b(e,`x`)&&(n=C(e.x)),b(e,`y`)&&(r=C(e.y));if(n!==void 0||r!==void 0)return{x:n,y:r}}function ee(e,t){if(!D(e))return t?F(e,t):C(e)}function te(e,t){return Array.isArray(e)?e.map(e=>b(e,`value`)?ee(e.value,t):ee(e,t)):te(e.data,t)}function ne(e,t,n){if(O(e))return e.map(e=>te(e,t));let r=te(e,t);return n?r.map(e=>[e]):r}function re(e,t,n){let r={increasingX:!1,fillHoles:!1,...n},i=[],a=!0;for(let n=0;n<e.length;n+=2)A(t[n/2].value)===void 0?r.fillHoles||(a=!0):(r.increasingX&&n>=2&&e[n]<=e[n-2]&&(a=!0),a&&=(i.push({pathCoordinates:[],valueData:[]}),!1),i[i.length-1].pathCoordinates.push(e[n],e[n+1]),i[i.length-1].valueData.push(t[n/2]));return i}function I(e){let t=``;return e==null?e:(t=typeof e==`number`?``+e:typeof e==`object`?JSON.stringify({data:e}):String(e),Object.keys(i).reduce((e,t)=>e.replaceAll(t,i[t]),t))}function ie(e){if(typeof e!=`string`)return e;if(e===`NaN`)return NaN;e=Object.keys(i).reduce((e,t)=>e.replaceAll(i[t],t),e);let t=e;if(typeof e==`string`)try{t=JSON.parse(e),t=t.data===void 0?t:t.data}catch{}return t}var ae=class{svgElements=[];constructor(e){for(let t=0;t<e.length;t++)this.svgElements.push(new ue(e[t]))}call(e,t){return this.svgElements.forEach(n=>Reflect.apply(n[e],n,t)),this}attr(...e){return this.call(`attr`,e)}elem(...e){return this.call(`elem`,e)}root(...e){return this.call(`root`,e)}getNode(...e){return this.call(`getNode`,e)}foreignObject(...e){return this.call(`foreignObject`,e)}text(...e){return this.call(`text`,e)}empty(...e){return this.call(`empty`,e)}remove(...e){return this.call(`remove`,e)}addClass(...e){return this.call(`addClass`,e)}removeClass(...e){return this.call(`removeClass`,e)}removeAllClasses(...e){return this.call(`removeAllClasses`,e)}animate(...e){return this.call(`animate`,e)}};let oe={easeInSine:[.47,0,.745,.715],easeOutSine:[.39,.575,.565,1],easeInOutSine:[.445,.05,.55,.95],easeInQuad:[.55,.085,.68,.53],easeOutQuad:[.25,.46,.45,.94],easeInOutQuad:[.455,.03,.515,.955],easeInCubic:[.55,.055,.675,.19],easeOutCubic:[.215,.61,.355,1],easeInOutCubic:[.645,.045,.355,1],easeInQuart:[.895,.03,.685,.22],easeOutQuart:[.165,.84,.44,1],easeInOutQuart:[.77,0,.175,1],easeInQuint:[.755,.05,.855,.06],easeOutQuint:[.23,1,.32,1],easeInOutQuint:[.86,0,.07,1],easeInExpo:[.95,.05,.795,.035],easeOutExpo:[.19,1,.22,1],easeInOutExpo:[1,0,0,1],easeInCirc:[.6,.04,.98,.335],easeOutCirc:[.075,.82,.165,1],easeInOutCirc:[.785,.135,.15,.86],easeInBack:[.6,-.28,.735,.045],easeOutBack:[.175,.885,.32,1.275],easeInOutBack:[.68,-.55,.265,1.55]},se=Symbol.for(`chartist.animationEmitter`);function ce(e){for(let t=e;t;t=t.parentElement){let e=t[se];if(e)return e}}function le(e,t,n,r=!1,i){let{easing:s,...c}=n,l={},u,d;s&&(u=Array.isArray(s)?s:oe[s]),c.begin=a(c.begin,`ms`),c.dur=a(c.dur,`ms`),u&&(c.calcMode=`spline`,c.keySplines=u.join(` `),c.keyTimes=`0;1`),r&&(c.fill=`freeze`,l[t]=c.from,e.attr(l),d=o(c.begin||0).value,c.begin=`indefinite`);let f=e.elem(`animate`,{attributeName:t,...c});r&&setTimeout(()=>{try{f._node.beginElement()}catch{l[t]=c.to,e.attr(l),f.remove()}},d);let p=f.getNode();i&&p.addEventListener(`beginEvent`,()=>i.emit(`animationBegin`,{element:e,animate:p,params:n})),p.addEventListener(`endEvent`,()=>{i&&i.emit(`animationEnd`,{element:e,animate:p,params:n}),r&&(l[t]=c.to,e.attr(l),f.remove())})}var ue=class e{static Easing=oe;_node;constructor(e,t,n,i,a=!1){typeof e==`string`?(this._node=(i?._node.ownerDocument??document).createElementNS(r.svg,e),e===`svg`&&this.attr({"xmlns:ct":r.ct})):this._node=e,t&&this.attr(t),n&&this.addClass(n),i&&(a&&i._node.firstChild?i._node.insertBefore(this._node,i._node.firstChild):i._node.appendChild(this._node))}attr(e,t){return typeof e==`string`?t?this._node.getAttributeNS(t,e):this._node.getAttribute(e):(Object.keys(e).forEach(t=>{if(e[t]!==void 0){if(t.indexOf(`:`)!==-1){let n=t.split(`:`);this._node.setAttributeNS(r[n[0]],t,String(e[t]))}else this._node.setAttribute(t,String(e[t]))}}),this)}elem(t,n,r,i=!1){return new e(t,n,r,this,i)}parent(){let t=this._node.parentNode;return t?.nodeType===1&&t.namespaceURI===r.svg?new e(t):null}root(){let t=this._node;for(;t.nodeName!==`svg`&&t.parentElement;)t=t.parentElement;return new e(t)}querySelector(t){let n=this._node.querySelector(t);return n?new e(n):null}querySelectorAll(e){return new ae(this._node.querySelectorAll(e))}getNode(){return this._node}foreignObject(e,t,n,r=!1){let i;if(typeof e==`string`){let t=this._node.ownerDocument.createElement(`div`);t.innerHTML=e,i=t.firstChild}else i=e;let a=this.elem(`foreignObject`,t,n,r);return a._node.appendChild(i),a}text(e){return this._node.appendChild(this._node.ownerDocument.createTextNode(e)),this}empty(){for(;this._node.firstChild;)this._node.removeChild(this._node.firstChild);return this}remove(){let e=this.parent();return this._node.parentNode?.removeChild(this._node),e}replace(e){return this._node.parentNode?.replaceChild(e._node,this._node),e}append(e,t=!1){return t&&this._node.firstChild?this._node.insertBefore(e._node,this._node.firstChild):this._node.appendChild(e._node),this}classes(){let e=this._node.getAttribute(`class`);return e?e.trim().split(/\s+/):[]}addClass(e){return this._node.setAttribute(`class`,this.classes().concat(e.trim().split(/\s+/)).filter(function(e,t,n){return n.indexOf(e)===t}).join(` `)),this}removeClass(e){let t=e.trim().split(/\s+/);return this._node.setAttribute(`class`,this.classes().filter(e=>t.indexOf(e)===-1).join(` `)),this}removeAllClasses(){return this._node.setAttribute(`class`,``),this}height(){return this._node.clientHeight}width(){return this._node.clientWidth}animate(e,t=!0,n){let r=n??ce(this._node);return Object.keys(e).forEach(n=>{let i=e[n];Array.isArray(i)?i.forEach(e=>le(this,n,e,!1,r)):le(this,n,i,t,r)}),this}};function de(e,t=`100%`,n=`100%`,i,a){if(!e)throw Error(`Container element is not found`);Array.from(e.querySelectorAll(`svg`)).filter(e=>e.getAttributeNS(r.xmlns,`ct`)).forEach(t=>e.removeChild(t));let o=new ue(`svg`).attr({width:t,height:n}).attr({style:`width: ${t}; height: ${n};`});return i&&o.addClass(i),a&&o.attr({viewBox:`0 0 ${a.width} ${a.height}`}),e.appendChild(o.getNode()),o}function fe(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:e===void 0?{top:0,right:0,bottom:0,left:0}:{top:typeof e.top==`number`?e.top:0,right:typeof e.right==`number`?e.right:0,bottom:typeof e.bottom==`number`?e.bottom:0,left:typeof e.left==`number`?e.left:0}}function pe(e,t){let n=!!(t.axisX||t.axisY),r=t.axisY?.offset||0,i=t.axisX?.offset||0,a=t.axisY?.position,s=t.axisX?.position,c=t.viewBox?.width||e.width()||o(t.width).value||0,l=t.viewBox?.height||e.height()||o(t.height).value||0,u=fe(t.chartPadding);c=Math.max(c,r+u.left+u.right),l=Math.max(l,i+u.top+u.bottom);let d={x1:0,x2:0,y1:0,y2:0,padding:u,width(){return this.x2-this.x1},height(){return this.y1-this.y2}};return n?(s===`start`?(d.y2=u.top+i,d.y1=Math.max(l-u.bottom,d.y2+1)):(d.y2=u.top,d.y1=Math.max(l-u.bottom-i,d.y2+1)),a===`start`?(d.x1=u.left+r,d.x2=Math.max(c-u.right,d.x1+1)):(d.x1=u.left,d.x2=Math.max(c-u.right-r,d.x1+1))):(d.x1=u.left,d.x2=Math.max(c-u.right,d.x1+1),d.y2=u.top,d.y1=Math.max(l-u.bottom,d.y2+1)),d}function me(e,t,n,r,i,a,o,s){let c={[`${n.units.pos}1`]:e,[`${n.units.pos}2`]:e,[`${n.counterUnits.pos}1`]:r,[`${n.counterUnits.pos}2`]:r+i},l=a.elem(`line`,c,o.join(` `));s.emit(`draw`,{type:`grid`,axis:n,index:t,group:a,element:l,...c})}function he(e,t,n,r){let i=e.elem(`rect`,{x:t.x1,y:t.y2,width:t.width(),height:t.height()},n,!0);r.emit(`draw`,{type:`gridBackground`,group:e,element:i})}function ge(e,t,n,r,i,a,o,s,c,l){let u={[i.units.pos]:e+o[i.units.pos],[i.counterUnits.pos]:o[i.counterUnits.pos],[i.units.len]:t,[i.counterUnits.len]:Math.max(0,a-10)},d=Math.round(u[i.units.len]),f=Math.round(u[i.counterUnits.len]),p=s.getNode().ownerDocument.createElement(`span`);p.className=c.join(` `),p.style[i.units.len]=d+`px`,p.style[i.counterUnits.len]=f+`px`,p.textContent=String(r);let m=s.foreignObject(p,{style:`overflow: visible;`,...u});l.emit(`draw`,{type:`label`,axis:i,index:n,group:s,element:m,text:r,...u})}function _e(e,t,n){let r,i=[];function a(i){let a=r;r=h({},e),t&&t.forEach(e=>{window.matchMedia(e[0]).matches&&(r=h({},r,e[1]))}),n&&i&&n.emit(`optionsChanged`,{previousOptions:a,currentOptions:r})}function o(){i.forEach(e=>e.removeEventListener(`change`,a))}if(window.matchMedia)t&&t.forEach(e=>{let t=window.matchMedia(e[0]);t.addEventListener(`change`,a),i.push(t)});else throw Error(`window.matchMedia not found! Make sure you're using a polyfill.`);return a(),{removeMediaQueryListeners:o,getCurrentOptions(){return r}}}var ve=class{listeners=/* @__PURE__ */ new Map;allListeners=/* @__PURE__ */ new Set;on(e,t){let{allListeners:n,listeners:r}=this;e===`*`?n.add(t):(r.has(e)||r.set(e,/* @__PURE__ */ new Set),r.get(e).add(t))}off(e,t){let{allListeners:n,listeners:r}=this;if(e===`*`)t?n.delete(t):n.clear();else if(r.has(e)){let n=r.get(e);t?n.delete(t):n.clear(),n.size||r.delete(e)}}emit(e,t){let{allListeners:n,listeners:r}=this;r.has(e)&&r.get(e).forEach(e=>e(t)),n.forEach(n=>n(e,t))}};let ye=/* @__PURE__ */ new WeakMap;var be=class{data;defaultOptions;options;responsiveOptions;svg;container;eventEmitter=new ve;resizeListener=()=>this.update();initializeTimeoutId=null;optionsProvider;constructor(e,t,n,r,i){this.data=t,this.defaultOptions=n,this.options=r,this.responsiveOptions=i;let a=typeof e==`string`?document.querySelector(e):e;if(!a)throw Error(`Target element ${typeof e==`string`?`"${e}"`:``} is not found`);this.container=a;let o=ye.get(a);o&&o.detach(),ye.set(a,this),this.initializeTimeoutId=setTimeout(()=>this.initialize(),0)}update(e,t,n=!1){return e&&(this.data=e||{},this.data.labels=this.data.labels||[],this.data.series=this.data.series||[],this.eventEmitter.emit(`data`,{type:`update`,data:this.data})),t&&(this.options=h({},n?this.options:this.defaultOptions,t),this.initializeTimeoutId||(this.optionsProvider?.removeMediaQueryListeners(),this.optionsProvider=_e(this.options,this.responsiveOptions,this.eventEmitter))),!this.initializeTimeoutId&&this.optionsProvider&&this.createChart(this.optionsProvider.getCurrentOptions()),this}detach(){return this.initializeTimeoutId?clearTimeout(this.initializeTimeoutId):(this.container.ownerDocument.defaultView?.removeEventListener(`resize`,this.resizeListener),this.optionsProvider?.removeMediaQueryListeners()),ye.delete(this.container),this}on(e,t){return this.eventEmitter.on(e,t),this}off(e,t){return this.eventEmitter.off(e,t),this}initialize(){this.container.ownerDocument.defaultView?.addEventListener(`resize`,this.resizeListener),this.optionsProvider=_e(this.options,this.responsiveOptions,this.eventEmitter),this.eventEmitter.on(`optionsChanged`,()=>this.update()),this.options.plugins&&this.options.plugins.forEach(e=>{Array.isArray(e)?e[0](this,e[1]):typeof e==`function`&&e(this)}),this.eventEmitter.emit(`data`,{type:`initial`,data:this.data}),this.createChart(this.optionsProvider.getCurrentOptions()),this.initializeTimeoutId=null}};let xe={m:[`x`,`y`],l:[`x`,`y`],h:[`x`],v:[`y`],c:[`x1`,`y1`,`x2`,`y2`,`x`,`y`],s:[`x2`,`y2`,`x`,`y`],q:[`x1`,`y1`,`x`,`y`],t:[`x`,`y`],a:[`rx`,`ry`,`xAr`,`lAf`,`sf`,`x`,`y`],z:[]},Se={x:`x`,x1:`x`,x2:`x`,rx:`x`,y:`y`,y1:`y`,y2:`y`,ry:`y`},Ce={x:`x`,x1:`x`,x2:`x`,y:`y`,y1:`y`,y2:`y`},we={accuracy:3},Te=/[MmZzLlHhVvCcSsQqTtAa]/y,L=/[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?/y,Ee=/[01]/y,R=/[\s,]*/y;function De(e){let t=0,n=n=>{R.lastIndex=t,R.exec(e),n.lastIndex=R.lastIndex;let r=n.exec(e);return r&&(t=n.lastIndex),r?.[0]},r=()=>{throw Error(`Invalid SVG path at position ${t}: "${e.slice(t,t+20)}"`)},i=[],a=n(Te)??(e.trim()?r():void 0);for(;a;){let o=xe[a.toLowerCase()],s={};for(let e of o){let t=n(e===`lAf`||e===`sf`?Ee:L);s[e]=t===void 0?r():+t}i.push({command:a,...s});let c=n(Te);if(c)a=c;else{if(R.lastIndex=t,R.exec(e),t=R.lastIndex,t>=e.length)break;o.length===0&&r(),L.lastIndex=t,L.test(e)||r(),a=a===`M`?`L`:a===`m`?`l`:a}}return i}function z(e,t,n,r,i,a){let o={command:i?e.toLowerCase():e.toUpperCase(),...t,...a?{data:a}:{}};n.splice(r,0,o)}function Oe(e,t){e.forEach((n,r)=>{xe[n.command.toLowerCase()].forEach((i,a)=>{t(n,i,r,a,e)})})}var B=class e{close;static join(t,n=!1,r){let i=new e(n,r);for(let e=0;e<t.length;e++){let n=t[e];for(let e=0;e<n.pathElements.length;e++)i.pathElements.push({...n.pathElements[e]})}return i.pos=i.pathElements.length,i}pathElements=[];pos=0;options;constructor(e=!1,t){this.close=e,this.options={...we,...t}}position(e){return e===void 0?this.pos:(this.pos=Math.max(0,Math.min(this.pathElements.length,e)),this)}remove(e){return this.pathElements.splice(this.pos,e),this}move(e,t,n=!1,r){return z(`M`,{x:+e,y:+t},this.pathElements,this.pos++,n,r),this}line(e,t,n=!1,r){return z(`L`,{x:+e,y:+t},this.pathElements,this.pos++,n,r),this}curve(e,t,n,r,i,a,o=!1,s){return z(`C`,{x1:+e,y1:+t,x2:+n,y2:+r,x:+i,y:+a},this.pathElements,this.pos++,o,s),this}arc(e,t,n,r,i,a,o,s=!1,c){return z(`A`,{rx:e,ry:t,xAr:n,lAf:r,sf:i,x:a,y:o},this.pathElements,this.pos++,s,c),this}parse(e){let t=De(e);return t.at(-1)?.command.toUpperCase()===`Z`&&t.pop(),this.pathElements.splice(this.pos,0,...t),this.pos+=t.length,this}stringify(){let{accuracy:e}=this.options,t=10**(e||0);return this.pathElements.reduce((n,r)=>{let i=xe[r.command.toLowerCase()].map(n=>{let i=r[n];return typeof e==`number`?Math.round(i*t)/t:i});return n+r.command+i.join(`,`)},``)+(this.close?`Z`:``)}scale(e,t){return Oe(this.pathElements,(n,r)=>{let i=Se[r];i&&(n[r]*=i===`x`?e:t)}),this}translate(e,t){return Oe(this.pathElements,(n,r)=>{let i=Ce[r];i&&(n[r]+=i===`x`?e:t)}),this}transform(e){return Oe(this.pathElements,(t,n,r,i,a)=>{let o=e(t,n,r,i,a);(o||o===0)&&(t[n]=o)}),this}clone(t=!1){let n=new e(t||this.close);return n.pos=this.pos,n.pathElements=this.pathElements.slice().map(e=>({...e})),n.options={...this.options},n}splitByCommand(t){let n=t.toUpperCase(),r=[[]];return this.pathElements.forEach(e=>{e.command.toUpperCase()===n&&r[r.length-1].length!==0&&r.push([]),r[r.length-1].push({...e})}),r.map((t,n)=>{let i=new e(this.close&&n===r.length-1,this.options);return i.pathElements=t,i.pos=t.length,i})}};function V(e){let t={fillHoles:!1,...e};return function(e,n){let r=new B,i=!0;for(let a=0;a<e.length;a+=2){let o=e[a],s=e[a+1],c=n[a/2];A(c.value)===void 0?t.fillHoles||(i=!0):(i?r.move(o,s,!1,c):r.line(o,s,!1,c),i=!1)}return r}}function ke(e){let{pathCoordinates:t,valueData:n}=e,r=[],i=0;for(let e=0;e<t.length;e+=2){let a=e>=2?t[e]-t[e-2]:0,o=Math.sign(a);e===0||o===0||i!==0&&o!==i?(r.push({pathCoordinates:[],valueData:[]}),i=0):i=o;let s=r[r.length-1];s.pathCoordinates.push(t[e],t[e+1]),s.valueData.push(n[e/2])}return r}function Ae(e){let t={fillHoles:!1,...e};return function e(n,r){let i=re(n,r,{fillHoles:t.fillHoles}).flatMap(ke);if(!i.length)return V()([],[]);if(i.length>1)return B.join(i.map(t=>e(t.pathCoordinates,t.valueData)));{if(n=i[0].pathCoordinates,r=i[0].valueData,n.length<=4)return V()(n,r);let e=[],t=[],a=n.length/2,o=[],s=[],c=[],l=[];for(let r=0;r<a;r++)e[r]=n[r*2],t[r]=n[r*2+1];for(let n=0;n<a-1;n++)c[n]=t[n+1]-t[n],l[n]=e[n+1]-e[n],s[n]=c[n]/l[n];o[0]=s[0],o[a-1]=s[a-2];for(let e=1;e<a-1;e++)s[e]===0||s[e-1]===0||s[e-1]>0!=s[e]>0?o[e]=0:(o[e]=3*(l[e-1]+l[e])/((2*l[e]+l[e-1])/s[e-1]+(l[e]+2*l[e-1])/s[e]),isFinite(o[e])||(o[e]=0));let u=new B().move(e[0],t[0],!1,r[0]);for(let n=0;n<a-1;n++)u.curve(e[n]+l[n]/3,t[n]+o[n]*l[n]/3,e[n+1]-l[n]/3,t[n+1]-o[n+1]*l[n]/3,e[n+1],t[n+1],!1,r[n+1]);return u}}}let je=e=>e.split(/\s+/).filter(Boolean),Me={attr(e){let t={...this.attrs};for(let[n,r]of Object.entries(e))r==null?delete t[n]:t[n]=r;return H(this,{attrs:t})},addClass(e){let t=je(e).filter((e,t,n)=>!this.classes.includes(e)&&n.indexOf(e)===t);return t.length?H(this,{classes:[...this.classes,...t]}):this},removeClass(e){let t=je(e);return H(this,{classes:this.classes.filter(e=>!t.includes(e))})},append(e,t=!1){return H(this,{children:t?[e,...this.children]:[...this.children,e]})},remove(e){return H(this,{children:this.children.filter(t=>t!==e)})},replace(e,t){return H(this,{children:this.children.map(n=>n===e?t:n)})},text(e){return H(this,{content:e})},empty(){return H(this,{children:[],content:void 0})}};function Ne(e){let t=Object.create(Me);for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function H(e,t){return Ne({...e,...t})}function U(e,t={},n=``,r={}){let i={};for(let[e,n]of Object.entries(t))n!=null&&(i[e]=n);return Ne({name:e,attrs:i,classes:[...new Set(je(n))],children:[],...r})}let Pe={lineSmooth:!0,showPoint:!0,showLine:!0,showArea:!1,areaBase:0},Fe={series:`ct-series`,line:`ct-line`,point:`ct-point`,area:`ct-area`};function Ie(e){return{name:e.name,className:e.className,meta:e.meta,data:e.values}}function W(e,t,n){let r=t[n]??Pe[n];if(b(e,`name`)&&e.name&&t.overrides?.[e.name]){let i=t.overrides[e.name][n];return i===void 0?r:i}return r}function Le(e={}){let t={...Fe,...e.classNames};return{type:`line`,coordinates:[`cartesian`],axes:{x:e.x,y:e.y},series:e.series,compose({data:n,area:r,axes:i,normalized:a,seriesIndexes:o}){let{x:c,y:l}=i;if(!c||!l||!a)throw Error(`Layer "line" needs an x and a y axis`);if(o&&e.reverseData)throw Error(`Layer "line": a series selection can't be combined with reverseData`);let u=e.align===`center`&&c.kind===`step`&&!c.stretch?(c.step??0)/2:0,d=n.series.map((e,t)=>t);return e.reverseData&&d.reverse(),d.map((i,d)=>{let f=o?.[i]??d,p=Ie(n.series[i]),m=a.series[d],h=b(p,`name`)&&p.name,g=b(p,`className`)&&p.className,_=b(p,`meta`)?p.meta:void 0,v=[],y=[];m.forEach((e,t)=>{v.push(r.x1+u+c.project(e,t,m),r.y1-l.project(e,t,m)),y.push({value:e,valueIndex:t,meta:E(p,t)})});let S=W(p,e,`lineSmooth`),C=(typeof S==`function`?S:S?Ae():V())(v,y),w={series:p,seriesIndex:f,meta:_},T=[];if(W(p,e,`showPoint`)&&(T=C.pathElements.map(e=>{let{data:n}=e,r=n?.value,i=b(r,`x`)?r.x:void 0,a=b(r,`y`)?r.y:void 0;return U(`line`,{x1:e.x,y1:e.y,x2:e.x+.01,y2:e.y,...n&&{"ct:value":[i,a].filter(x).join(`,`),"ct:meta":I(n.meta)}},t.point,{role:`point`,ctx:{...w,valueIndex:n?.valueIndex||0,value:r,meta:n?.meta,x:e.x,y:e.y}})})),W(p,e,`showLine`)&&(T=[U(`path`,{d:C.stringify()},t.line,{role:`line`,ctx:{...w,values:m,path:C.clone()}}),...T]),W(p,e,`showArea`)&&l.range){let n=Math.max(Math.min(W(p,e,`areaBase`),l.range.max),l.range.min),i=r.y1-l.project(n);C.splitByCommand(`M`).filter(e=>e.pathElements.length>1).map(e=>{let t=e.pathElements[0],n=e.pathElements[e.pathElements.length-1];return e.clone(!0).position(0).remove(1).move(t.x,i).line(t.x,t.y).position(e.pathElements.length+1).line(n.x,i)}).forEach(e=>{T=[U(`path`,{d:e.stringify()},t.area,{role:`area`,ctx:{...w,values:m,path:e.clone()}}),...T]})}return H(U(`g`,{"ct:series-name":h||void 0,"ct:meta":_?I(_):void 0},`${t.series} ${g||`${t.series}-${s(f)}`}`,{role:`series`,ctx:w}),{children:T})})}}}let G=e=>e===`top`||e===`bottom`?`x`:`y`;function Re(e){if(e.axes)return e.axes;let t=[];return e.x&&t.push({...e.x,id:`x`,side:e.x.position===`start`?`top`:`bottom`}),e.y&&t.push({...e.y,id:`y`,side:e.y.position===`end`?`right`:`left`}),t}function ze(e){let t={top:0,bottom:0,left:0,right:0};return e.map(e=>{let n=t[e.side];return t[e.side]+=e.offset||0,n})}function K(e,t){return e===`x`?t.x2-t.x1:t.y1-t.y2}function Be(e,t,n,r){let i=Array.isArray(r)?r:Re(r),a={top:0,bottom:0,left:0,right:0};for(let e of i)a[e.side]+=e.offset||0;let o=Math.max(e,a.left+a.right+n.left+n.right),s=Math.max(t,a.top+a.bottom+n.top+n.bottom),c=n.top+a.top,l=Math.max(s-n.bottom-a.bottom,c+1),u=n.left+a.left,d=Math.max(o-n.right-a.right,u+1);return{width:o,height:s,area:{x1:u,y1:l,x2:d,y2:c,width:d-u,height:l-c}}}let q={x:{pos:`x`,len:`width`,dir:`horizontal`,rectStart:`x1`,rectEnd:`x2`,rectOffset:`y2`},y:{pos:`y`,len:`height`,dir:`vertical`,rectStart:`y2`,rectEnd:`y1`,rectOffset:`x1`}};var J=class{units;chartRect;ticks;counterUnits;range;axisLength;gridOffset;constructor(e,t,n){this.units=e,this.chartRect=t,this.ticks=n,this.counterUnits=e===q.x?q.y:q.x,this.axisLength=t[this.units.rectEnd]-t[this.units.rectStart],this.gridOffset=t[this.units.rectOffset]}createGridAndLabels(e,t,n,r){let i=this.units.pos===`x`?n.axisX:n.axisY,a=this.ticks.map((e,t)=>this.projectValue(e,t)),o=this.ticks.map(i.labelInterpolationFnc);a.forEach((s,c)=>{let l=o[c],u={x:0,y:0},d;d=c+1<a.length?a[c+1]-s:Math.max(this.axisLength-s,this.axisLength/this.ticks.length),!(l!==``&&S(l))&&(this.units.pos===`x`?(s=this.chartRect.x1+s,u.x=n.axisX.labelOffset.x,u.y=n.axisX.position===`start`?this.chartRect.padding.top+n.axisX.labelOffset.y+5:this.chartRect.y1+n.axisX.labelOffset.y+5):(s=this.chartRect.y1-s,u.y=n.axisY.labelOffset.y-d,u.x=n.axisY.position===`start`?this.chartRect.padding.left+n.axisY.labelOffset.x:this.chartRect.x2+n.axisY.labelOffset.x+10),i.showGrid&&me(s,c,this,this.gridOffset,this.chartRect[this.counterUnits.len](),e,[n.classNames.grid,n.classNames[this.units.dir]],r),i.showLabel&&ge(s,d,c,l,this,i.offset,u,t,[n.classNames.label,n.classNames[this.units.dir],i.position===`start`?n.classNames[i.position]:n.classNames.end],r))})}};function Ve(e){return typeof e==`function`&&typeof e.prototype?.projectValue==`function`}function He(e){return{kind:`legacy`,create({dimension:t,series:n,area:r,options:i,extent:a}){let o={x1:r.x1,x2:r.x2,y1:r.y1,y2:r.y2,padding:{top:0,right:0,bottom:0,left:0},width:()=>r.x2-r.x1,height:()=>r.y1-r.y2},s=a&&!i.highLow?{...i,highLow:M(n,i,t,a)}:i,c=new e(q[t],n,o,s);return{dimension:t,kind:typeof c.stretch==`boolean`?`step`:`legacy`,stretch:c.stretch,step:c.stepLength,ticks:c.ticks,range:c.range,length:K(t,r),project:(e,t,n)=>c.projectValue(e,t,n)}}}}function Ue(e,t,n){let r=t=>e.find(e=>G(e.side)===t)?.id,i=new Set(e.map(e=>e.id));return t.map(e=>{for(let t of[e.axes?.x,e.axes?.y])if(t!==void 0&&!i.has(t))throw Error(`Chartist: unknown axis "${t}" in layer "${e.type}"`);let t=e.series?.map(t=>{let r=typeof t==`number`?t:n.series.findIndex(e=>e.name===t);if(r<0||r>=n.series.length)throw Error(`Chartist: unknown series ${JSON.stringify(t)} in layer "${e.type}"`);return r});return{x:e.axes?.x??r(`x`),y:e.axes?.y??r(`y`),series:t}})}function We(e,t){let n=Array.from({length:t},(e,t)=>t),r=/* @__PURE__ */ new Map;for(let t of e)if(t.series?.length!==0)for(let e of[t.x,t.y]){if(e===void 0)continue;let i=r.get(e)??/* @__PURE__ */ new Set;(t.series??n).forEach(e=>i.add(e)),r.set(e,i)}return new Map([...r].map(([e,t])=>[e,[...t].sort((e,t)=>e-t)]))}function Ge(e,t=!1,n={}){let r={labels:e.labels,series:e.series.map(e=>({name:e.name,className:e.className,meta:e.meta,data:e.values}))},i=N(e.flat?{labels:e.labels,series:e.series[0].values}:r,t,n.multi??!0,n.distributed);return{labels:i.labels,series:i.series}}function Ke(e,t,n,r,i){let a=t=>e.find(e=>G(e.side)===t)?.id,o=/* @__PURE__ */ new Map;return t.forEach((e,t)=>{if(!e.extent)return;let s=n[t]??{},c=r.flat?void 0:s.series,l=e.extent({normalized:c?{...i,series:c.map(e=>i.series[e])}:i,axes:{x:s.x??a(`x`),y:s.y??a(`y`)}});for(let[e,t]of Object.entries(l??{})){let n=o.get(e);o.set(e,n?{low:Math.min(n.low,t.low),high:Math.max(n.high,t.high)}:t)}}),o}function qe(e,t,n,r,i,a){let{type:o,id:s,side:c,...l}=e;return{...(Ve(o)?He(o):o).create({dimension:G(c),series:n,labels:r.labels,area:i,options:l,...a&&{extent:a}}),id:s,side:c,inset:t,options:l}}function Je(e,t){let n=Re(e),r=ze(n);return{config:e,definitions:n,area:(e,t,r)=>Be(e,t,r,n),create(i,a,o,s){let c=o&&t?.(o,i.series.length),l=Ge(i,e.reverseData,e.normalize),u=s?Ke(n,s,o??[],i,l):void 0,d=l.series,f=n.map((e,t)=>{let n=c?.get(e.id),o=n&&!i.flat?n.map(e=>d[e]):d;return qe(e,r[t],o,l,a,u?.get(e.id))});return{normalized:l,axes:{x:f.find(e=>e.dimension===`x`),y:f.find(e=>e.dimension===`y`),all:f}}}}}function Ye(e,t={}){let n=(e,t)=>({...e,offset:e.offset??(t===`x`?30:40)}),r=Array.isArray(e)?{...t,axes:e}:{...t,...e},i=Je(r.axes?{...r,axes:r.axes.map(e=>n(e,G(e.side)))}:{...r,x:r.x&&n(r.x,`x`),y:r.y&&n(r.y,`y`)},We),a=/* @__PURE__ */ new Set;for(let{id:e}of i.definitions){if(a.has(e))throw Error(`Chartist: the axis id "${e}" is used twice`);a.add(e)}return{...i,bind:(e,t)=>Ue(i.definitions,e,t)}}let Xe=(e,t)=>Number(A(e,t));function Ze(){return{kind:`step`,create({dimension:e,area:t,labels:n,options:r}){let i=r.ticks??[...n],a=K(e,t),o=a/Math.max(1,i.length-+!!r.stretch);return{dimension:e,kind:`step`,stretch:!!r.stretch,step:o,ticks:i,length:a,project:(e,t=0)=>o*t}}}}function Qe(){return{kind:`autoScale`,create({dimension:e,series:t,area:n,options:r,extent:i}){let a=K(e,n),o=m(a,r.highLow||M(t,r,e,i),r.scaleMinSpace||20,r.onlyInteger);return{dimension:e,kind:`autoScale`,ticks:o.values,range:{min:o.min,max:o.max},length:a,project:t=>a*(Xe(t,e)-o.min)/o.range}}}}function $e(){return{kind:`fixedScale`,create({dimension:e,series:t,area:n,options:r,extent:i}){let a=K(e,n),o=r.highLow||M(t,r,e,i),s=r.divisor||1,c=(r.ticks||_(s+1,e=>o.low+(o.high-o.low)/s*e)).sort((e,t)=>Number(e)-Number(t)),l={min:o.low,max:o.high};return{dimension:e,kind:`fixedScale`,ticks:c,range:l,length:a,project:t=>a*(Xe(t,e)-l.min)/(l.max-l.min)}}}}let et={axisX:{offset:30,position:`end`,labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:g,type:void 0},axisY:{offset:40,position:`start`,labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:g,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,showGridBackground:!1,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:`ct-chart-line`,label:`ct-label`,labelGroup:`ct-labels`,series:`ct-series`,line:`ct-line`,point:`ct-point`,area:`ct-area`,grid:`ct-grid`,gridGroup:`ct-grids`,gridBackground:`ct-grid-background`,vertical:`ct-vertical`,horizontal:`ct-horizontal`,start:`ct-start`,end:`ct-end`}};function tt(e,t){return e.filter(e=>t?e.listener!==t:e.owner!==`user`)}function nt(){let e=/* @__PURE__ */ new Map,t=[];function n(e,n){t.forEach(({listener:t})=>t(e,n))}return{on(n,r,i=`user`){n===`*`?t=[...t,{listener:r,owner:i}]:e.set(n,[...e.get(n)??[],{listener:r,owner:i}])},off(n,r){n===`*`?t=tt(t,r):e.set(n,tt(e.get(n)??[],r))},transform(t,r){let i=r;for(let{listener:n}of e.get(t)??[]){let e=n(i);if(e===null){i=null;break}e!==void 0&&(i=e)}return n(t,i),i},notify(t,r){(e.get(t)??[]).forEach(({listener:e})=>e(r)),n(t,r)},clear(){e.clear(),t=[]}}}function rt(e,t){return(t.role===void 0||e.role===t.role)&&(t.key===void 0||e.key===t.key)&&(t.seriesIndex===void 0||e.ctx?.seriesIndex===t.seriesIndex)&&(t.valueIndex===void 0||e.ctx?.valueIndex===t.valueIndex)}function it(e,t={}){let n=[],r=e=>{rt(e,t)&&n.push(e),e.children.forEach(r)};return r(e),n}function Y(e,t){let n=e.children,r=!1,i=[];for(let e of n){let n=Y(e,t);n!==e&&(r=!0),n&&i.push(n)}r&&(n=i);let a=r?H(e,{children:n}):e,o=t(a);return o===void 0?a:o}function at(e,t){return Y(e,e=>{let n=e.ctx?.seriesIndex;if(e.key!==void 0||n===void 0)return;let r=e.ctx?.valueIndex;return H(e,{key:r===void 0?`${t}/${n}`:`${t}/${n}/${r}`})})}let ot={top:15,right:15,bottom:5,left:10};function st(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:{...ot,...e}}function X(e,t){if(e==null)throw Error(`Chartist: a "${t}" listener returned null`);return e}function ct(e,t){let n={data:t.data,layers:t.layers,coordinates:t.coordinates??`cartesian`,padding:st(t.padding),axes:t.axes,width:t.width,height:t.height,viewBox:t.viewBox,className:t.className,labels:t.labels,preset:t.preset},r=X(e.transform(`resolve`,{config:n}),`resolve`).config;for(let e of r.layers)if(!e.coordinates.includes(r.coordinates))throw Error(`Layer "${e.type}" does not support ${r.coordinates} coordinates`);return r}function lt(e){if(Array.isArray(e))return{values:e};if(e&&typeof e==`object`&&`data`in e){let{data:t,name:n,className:r,meta:i}=e;return{name:n,className:r,meta:i,values:t}}return{values:[e]}}function ut(e,t){let{labels:n=[],series:r}=t.data,i=r.every(e=>!Array.isArray(e)&&!(e&&typeof e==`object`&&`data`in e))&&r.length?{labels:n,series:[{values:r}],flat:!0}:{labels:n,series:r.map(lt)};return X(e.transform(`prepare`,{data:i}),`prepare`).data}function dt(e){let{area:t}=e;if(![e.width,e.height,t.x1,t.x2,t.y1,t.y2,t.width,t.height].every(Number.isFinite)||t.width<0||t.height<0)throw Error(`Chartist: invalid layout after the "layout" phase (area ${JSON.stringify(t)})`)}function ft(e,t,n,r){let{padding:i}=t,a;if(t.axes)a={...t.axes.area(n,r,i),padding:i};else{let e=Math.max(n,i.left+i.right),t=Math.max(r,i.top+i.bottom),o=i.left,s=i.top,c=Math.max(e-i.right,o+1),l=Math.max(t-i.bottom,s+1);a={width:e,height:t,padding:i,area:{x1:o,y1:l,x2:c,y2:s,width:c-o,height:l-s}}}let o=X(e.transform(`layout`,a),`layout`);return dt(o),o}function pt(e,t,n,r,i,a={},o,s=t.padding,c=[],l=`html`,u){let d=[],f=new Map((a.all??[]).map(e=>[e.id,e]));return t.layers.forEach((p,m)=>{let h=c[m]??{},g=n.flat?void 0:h.series,_=g?{...n,series:g.map(e=>n.series[e])}:n,v=g&&o?{...o,series:g.map(e=>o.series[e])}:o,y=p.compose({data:_,area:r,padding:s,layerIndex:m,coordinates:t.coordinates,measureText:i,axes:{x:h.x&&f.get(h.x)||a.x,y:h.y&&f.get(h.y)||a.y,all:a.all},normalized:v,seriesIndexes:g,labels:l,measureStyle:u});for(let t of y){let n=Y(at(t,m),t=>t.role===void 0?void 0:e.transform(`compose`,t));n&&d.push(n)}}),d}function mt(e,t,n,r){let i=U(`svg`,{width:r.width,height:r.height,viewBox:t.viewBox?`0 0 ${t.viewBox.width} ${t.viewBox.height}`:void 0},t.className),a=n.length?H(i,{children:n}):i;return X(e.transform(`scene`,{scene:a}),`scene`).scene}function ht(e,t,n,r,i=`resolve`){let a=i===`layout`&&r,o=a?r.config:ct(e,t),s=a?r.data:ut(e,o),c=ft(e,o,n.width,n.height),l=o.axes?.bind?.(o.layers,s)??[],{axes:u={},normalized:d=void 0}=o.axes?.create(s,c.area,l,o.layers)??{},{className:f}=o,p=e=>f&&e?(t,n)=>e(t,{rootClass:f,...n}):e,m=p(n.measureText),h=p(n.measureStyle);return{config:o,data:s,layout:c,axes:u,normalized:d,scene:mt(e,o,pt(e,o,s,c.area,m,u,d,c.padding,l,o.labels??n.labels??`html`,h),n.rootSize??{width:o.width??c.width,height:o.height??c.height})}}let gt=.85,Z=(e,t={})=>{let n=t.fontSize??12;return{width:e.length*n*.6,height:n*1.2,fontSize:n}};function _t(e,t,n){let i=t.indexOf(`:`),a=i>0?t.slice(0,i):``;a&&a!==`xmlns`&&r[a]?e.setAttributeNS(r[a],t,String(n)):e.setAttribute(t,String(n))}function vt(e,t,n,i=!1){let a=e.createElementNS(i?r.xhtml:r.svg,t.name);t.classes.length&&a.setAttribute(`class`,t.classes.join(` `));for(let[e,n]of Object.entries(t.attrs))_t(a,e,n);t.content&&a.appendChild(e.createTextNode(t.content));let o=i||t.name===`foreignObject`;for(let r of t.children)a.appendChild(vt(e,r,n,o));return n.set(t,a),a}function yt(e){Array.from(e.querySelectorAll(`svg`)).filter(e=>e.getAttributeNS(r.xmlns,`ct`)).forEach(e=>e.remove())}function bt(e,t,n,i){let a=e.createElementNS(r.svg,`svg`);a.setAttribute(`style`,`position: absolute; visibility: hidden; width: 0; height: 0;`),n.rootClass&&a.setAttribute(`class`,n.rootClass);let o=e.createElementNS(r.svg,t);n.classes?.length&&o.setAttribute(`class`,n.classes.join(` `)),a.appendChild(o),(n.container??e.body).appendChild(a);try{return i(o)}finally{a.remove()}}function xt(e){return(t,n={})=>bt(e,`text`,n,r=>{if(n.fontSize&&r.setAttribute(`font-size`,String(n.fontSize)),r.textContent=t,typeof r.getBBox!=`function`)return Z(t,n);let i=r.getBBox(),a=parseFloat(e.defaultView?.getComputedStyle(r).fontSize??``);return i.width||i.height?{width:i.width,height:i.height,...a>0&&{fontSize:a}}:Z(t,n)})}function St(){return{labels:`html`,render(e,t){let n=t.ownerDocument,i=/* @__PURE__ */ new WeakMap,a=vt(n,e,i);return a.setAttributeNS(r.xmlns,`xmlns:ct`,r.ct),yt(t),t.appendChild(a),{svg:a,elementOf:e=>i.get(e),remove:()=>a.remove()}},measureText(e,t){let n=t?.container?.ownerDocument??globalThis.document;return n?xt(n)(e,t):Z(e,t)},measureStyle(e,t={}){let n=t.container?.ownerDocument??globalThis.document,r=n?.defaultView;return r&&bt(n,`path`,t,t=>r.getComputedStyle(t).getPropertyValue(e))||void 0}}}function Ct(e){let t=e.map(e=>e.chartType??e.type);return t.includes(`bar`)?`ct-chart-bar`:t.includes(`donut`)?`ct-chart-donut`:t.includes(`pie`)?`ct-chart-pie`:`ct-chart-line`}function wt(e){return e.className===void 0?{...e,className:Ct(e.layers)}:e}function Tt(e,t){return[e,t]}let Q=e=>e,Et=/* @__PURE__ */ new Set([`resolve`,`prepare`,`layout`,`compose`,`scene`,`render`,`mount`]),Dt=/* @__PURE__ */ new Set([`data`,`optionsChanged`,`draw`,`created`,`animationBegin`,`animationEnd`]),Ot=/* @__PURE__ */ new Set;function kt(e){console.warn(e)}function At(e){return e.map(e=>{let[t,n]=Array.isArray(e)?e:[e];if(typeof t==`function`)throw Error(`Chartist: the plugin "${t.name||`anonymous`}" is a 1.x plugin (a plain function). chart() and the preset functions accept only v2 plugins; convert it with fromLegacyPlugin() from chartist/compat.`);return[t,n]})}let jt=/* @__PURE__ */ new WeakMap,Mt=()=>({owner:`user`});function Nt(e,t,n){let r=e.owner;e.owner=t;try{n()}finally{e.owner=r}}function Pt(e,t){let n=jt.get(e);n?Nt(n,`user`,t):t()}function Ft(e,t=[],n,r){jt.set(e,r);let i=At(t);for(let[e]of i)e.provides?.forEach(e=>n.add(e));for(let[t,n]of i)Nt(r,`plugin`,()=>t.install(e,n))}function It(e,t={}){for(let[n,r]of Object.entries(t))r&&Q(e).on(n,r)}function Lt(e,t,n,r){return{on:((i,a)=>(Dt.has(i)&&!n.has(i)&&!Ot.has(i)&&(Ot.add(i),kt(`Chartist: "${i}" is a 1.x event. v2 charts emit it only with the compat plugin: add compat from chartist/compat to plugins (see the migration guide).`)),e.on(i,a,r.owner),t())),off:((n,r)=>(e.off(n,r),t())),emit(t,n){if(Et.has(t))throw Error(`Chartist: "${t}" is a phase event; plugins can't emit phase events`);e.notify(t,n)}}}function Rt(e){if(typeof e==`number`)return e;let t=e?.match(/^\s*(\d+(?:\.\d+)?)(?:px)?\s*$/);return t?Number(t[1]):void 0}function zt(e){let t=typeof e==`string`?document.querySelector(e):e;if(!t)throw Error(`Target element ${typeof e==`string`?`"${e}"`:``} is not found`);return t}function Bt(e,t){let n=zt(e),r=nt(),i=Mt(),a=t.renderer??St(),o=a.measureText,s=!1,c=(e,t)=>(s=!0,o?o(e,{container:n,...t}):Z(e,t)),l=a.measureStyle,u=l&&((e,t)=>l(e,{container:n,...t})),d=t,f=t,p,m,h,g,_=!1,v=!0,y=/* @__PURE__ */ new Set,b=n.ownerDocument.defaultView,x=n.ownerDocument.fonts,S=()=>{!_&&m&&s&&A(`layout`)},C,w=!1;function T(){C?.removeAttribute(`viewBox`),C=void 0,w&&!f.viewBox&&m&&h?.elementOf&&(C=h.elementOf(m.scene),C?.setAttribute(`viewBox`,`0 0 ${m.layout.width} ${m.layout.height}`))}let E=()=>{w=!0,T()},D=()=>{w=!1,T()};function O(){let e=String(f.width??`100%`),t=String(f.height??`100%`),r=n.ownerDocument.createElementNS(`http://www.w3.org/2000/svg`,`svg`);r.setAttribute(`width`,e),r.setAttribute(`height`,t);let i=e=>typeof e==`number`?`px`:``;r.setAttribute(`style`,`width: ${e}${i(f.width)}; height: ${t}${i(f.height)};`),n.appendChild(r);let a={width:r.clientWidth,height:r.clientHeight};return r.remove(),a}function k(){let e=O();return{width:f.viewBox?.width||e.width||(Rt(f.width)??n.clientWidth),height:f.viewBox?.height||e.height||(Rt(f.height)??n.clientHeight)}}function A(e){let{width:t,height:i}=k();s=!1,m=ht(r,wt(f),{width:t,height:i,measureText:c,measureStyle:u,labels:a.labels??`html`,rootSize:{width:f.width??`100%`,height:f.height??`100%`}},m,e);let{scene:o}=m;h=a.render(o,n),w&&T(),r.notify(`render`,{scene:o,output:h});let l=h.elementOf??(()=>void 0);r.notify(`mount`,{scene:o,output:h,elementOf:l})}function j(){let e=d.responsive?.entries;f=p?p.matching.reduce((t,n)=>({...t,...e[n][1]}),d):d}function M(){let e=f;j(),P.emit(`responsive`,{previousConfig:e,currentConfig:f}),A(`resolve`)}function N(){p?.stop(),p=d.responsive?.watch(n,()=>{_||M()}),j()}let P={container:n,update(e){return d={...d,...e},`responsive`in e?N():j(),A(`resolve`),P},detach(){return v=!1,b?.removeEventListener(`beforeprint`,E),b?.removeEventListener(`afterprint`,D),D(),g?.disconnect(),g=void 0,x?.removeEventListener(`loadingdone`,S),p?.stop(),p=void 0,P},destroy(){_||(_=!0,P.detach(),h?.remove?.(),r.clear())},...Lt(r,()=>P,y,i)};x?.addEventListener(`loadingdone`,S),b?.addEventListener(`beforeprint`,E),b?.addEventListener(`afterprint`,D);let F=b?.ResizeObserver??globalThis.ResizeObserver;return F!==void 0&&(g=new F(()=>{if(_||!m)return;if(p?.check()){M();return}let{width:e,height:t}=k();(e!==m.layout.width||t!==m.layout.height)&&A(`layout`)}),g.observe(n)),Ft(P,t.plugins,y,i),It(P,t.on),v?N():j(),A(`resolve`),P}let Vt={x:{pos:`x`,len:`width`,counterPos:`y`,counterLen:`height`,dir:`horizontal`},y:{pos:`y`,len:`height`,counterPos:`x`,counterLen:`width`,dir:`vertical`}};function Ht(e,t){let{area:n,padding:r,classNames:i}=t,a=Vt[e.dimension],o=t.options??(e.dimension===`x`?t.axisX:t.axisY),s=t.place,c=e.ticks.map((t,n)=>e.project(t,n)),l=e.ticks.map(o.labelInterpolationFnc),u=e.dimension===`x`?n.y2:n.x1,d=e.dimension===`x`?n.height:n.width,f=[],p=[];return c.forEach((m,h)=>{let g=l[h],_=h+1<c.length?c[h+1]-m:Math.max(e.length-m,e.length/e.ticks.length);if(g!==``&&S(g))return;let v,y={x:0,y:0};if(s)({position:v,labelOffset:y}=s(e,m,_,o,n));else if(e.dimension===`x`){let e=t.axisX;v=n.x1+m,y.x=e.labelOffset.x,y.y=e.position===`start`?r.top+e.labelOffset.y+5:n.y1+e.labelOffset.y+5}else{let e=t.axisY;v=n.y1-m,y.y=e.labelOffset.y-_,y.x=e.position===`start`?r.left+e.labelOffset.x:n.x2+e.labelOffset.x+10}if(o.showGrid){let t={[`${a.pos}1`]:v,[`${a.pos}2`]:v,[`${a.counterPos}1`]:u,[`${a.counterPos}2`]:u+d};f.push(U(`line`,t,`${i.grid} ${i[a.dir]}`,{role:`grid`,ctx:{axis:e,index:h,...t}}))}if(o.showLabel){let n={[a.pos]:v+y[a.pos],[a.counterPos]:y[a.counterPos],[a.len]:_,[a.counterLen]:Math.max(0,o.offset-10)},r=t.atStart??o.position===`start`,s=[i.label,i[a.dir],r?i.start:i.end].join(` `),c={kind:`axis`,axis:e,index:h,text:g,...n};if(t.svgLabel){let i=t.svgLabel(String(g),n,s,e.dimension,r);i&&p.push(H(i,{role:`label`,ctx:c}));return}let l=U(`span`,{style:`${a.len}: ${Math.round(n[a.len])}px; ${a.counterLen}: ${Math.round(n[a.counterLen])}px;`},s).text(String(g));p.push(U(`foreignObject`,{style:`overflow: visible;`,...n},``,{role:`label`,ctx:c}).append(l))}}),{grids:f,labels:p}}function Ut(e,t){return U(`rect`,{x:e.x1,y:e.y2,width:e.width,height:e.height},t,{role:`gridBackground`})}function Wt(e,t,n){return t===`x`?{vertical:n?`bottom`:`top`,horizontal:e===`bar`?`middle`:`start`}:{vertical:e===`horizontalBar`?`middle`:`bottom`,horizontal:n?`end`:`start`}}function Gt(e,t,n){let r=[],i=``;for(let a of e.split(/\s+/).filter(Boolean)){let e=i?`${i} ${a}`:a;i&&n(e)>t?(r.push(i),i=a):i=e}return i&&r.push(i),r}function Kt(e,t,n={}){return(r,i,a,o,s)=>{let c=a.split(` `),l=t=>e(t,{classes:c}),u=Gt(r,Math.round(i.width),e=>l(e).width);if(!u.length)return;let d=l(u[0]),f=d.fontSize??d.height/1.2,p={...Wt(t,o,s),...n},m=u.length*f,h=p.vertical===`top`?i.y:p.vertical===`middle`?i.y+(i.height-m)/2:i.y+i.height-m,g=p.horizontal===`start`?i.x:p.horizontal===`middle`?i.x+i.width/2:i.x+i.width,_=e=>Math.round(e*100)/100;return H(U(`text`,{x:_(g),y:_(h+gt*f),"text-anchor":p.horizontal},a),{children:u.map((e,t)=>U(`tspan`,{x:_(g),y:_(h+(t+gt)*f)}).text(e))})}}function qt(e){return Object.freeze({type:`container`,query:e})}function Jt(e){return typeof e==`object`&&!!e&&e.type===`container`}let Yt=!1;function Xt(){Yt||(Yt=!0,console.warn(`Chartist: container() needs Element.matchContainer(); load the match-container polyfill. Container entries are ignored.`))}let Zt=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]);function Qt(e,t,n,r=!1){let i=t?.ownerDocument.defaultView??(typeof window<`u`?window:void 0),a,o=e.map(([e])=>{if(!Jt(e))return i?.matchMedia?.(e);if(!t)return;let n=t.ownerDocument.createElement(`span`);if(typeof n.matchContainer!=`function`)Xt();else{a||(a=t.appendChild(n),a.className=`ct-probe`,a.setAttribute(`aria-hidden`,`true`),a.style.cssText=`position:absolute;width:0;height:0;overflow:hidden`);try{return a.matchContainer(e.query)}catch(t){throw a.remove(),Error(`Chartist: invalid container condition "${e.query}": ${t.message}`)}}}),s=()=>o.flatMap((e,t)=>e?.matches?[t]:[]),c={matching:s(),check(){let e=s();return!Zt(e,c.matching)&&(c.matching=e,!0)},stop(){o.forEach(e=>e?.removeEventListener?.(`change`,l)),d?.disconnect(),a?.remove()}};function l(){c.check()&&n()}o.forEach(e=>e?.addEventListener?.(`change`,l));let u=i?.ResizeObserver??globalThis.ResizeObserver,d=r&&a&&u!==void 0?new u(l):void 0;return d&&t&&d.observe(t),c}function $t(e){return{entries:e,watch:(t,n)=>Qt(e,t,n)}}function en(e,t,n,r){return n.reduce((e,n)=>r(e,t[n][1]),e)}function tn(e,t,n){return{svgLabel:n,area:t.area,padding:t.padding,axisX:e.axisX,axisY:e.axisY,classNames:e.classNames}}function nn(e,t){return H(U(`g`,{},e),{children:t})}function rn(e,t=[`x`,`y`]){return{type:`grid`,coordinates:[`cartesian`],compose(n){let r=t.flatMap(t=>{let r=n.axes[t];return r?Ht(r,tn(e,n)).grids:[]});return e.showGridBackground&&r.unshift(Ut(n.area,e.classNames.gridBackground)),[nn(e.classNames.gridGroup,r)]}}}function an(e,t=[`x`,`y`]){return{type:`labels`,coordinates:[`cartesian`],compose(n){let r=n.labels===`svg`?Kt(n.measureText,e.labelKind??`line`):void 0;return[nn(e.classNames.labelGroup,t.flatMap(t=>{let i=n.axes[t];return i?Ht(i,tn(e,n,r)).labels:[]}))]}}}function on(e){return{...e,compose:t=>[nn(``,[...e.compose(t)])]}}let sn=Symbol.for(`chartist.presetState`);function cn(e,t){return{name:`preset-root-style`,install(n){Object.defineProperty(n,sn,{value:t}),n.on(`scene`,({scene:t})=>{let{width:n=`100%`,height:r=`100%`}=e();return{scene:t.attr({style:`width: ${n}; height: ${r};`})}})}}}function ln(e,t,n){let r=h({},e.defaults,n),{plugins:i,on:a}=n??{};return{...e.config({...t,labels:t.labels||[],series:t.series||[]},r),plugins:i,on:a}}function un(e,t,n,r={},i,a=r.plugins){let o=n,s=h({},e.defaults,r),c=Qt(i??[],(typeof t==`string`?document.querySelector(t):t)??void 0,()=>v(),!0),l=e=>en(h({},e),i,c.matching,(e,t)=>h({},e,t)),u=l(s),d=e=>({...e,preset:p}),f={get handle(){return y},setData(e){e.labels=e.labels||[],e.series=e.series||[],o=e},setOptions(t,n=!1){s=h({},n?s:e.defaults,t),u=l(s)},render(){_.update(d(e.config(o,u)))},options:()=>u,data:()=>o},p={kind:e.kind,get options(){return u},get data(){return o},update(e,t,n){e&&f.setData(e),t&&f.setOptions(t,n),f.render()},detach:()=>{m?y.detach():g=!0}},m=!1,g=!1,_=Bt(t,{...d(e.config(o,u)),plugins:[cn(()=>u,p),...a??[]],on:r.on});function v(){let e=u;u=l(s),_.emit(`responsive`,{previousOptions:e,currentOptions:u}),f.render()}let y={container:_.container,update(e){return e.data&&(o=e.data),_.update(e),y},setOptions(e,t){return f.setOptions(e,!t?.replace),f.render(),y},detach(){return c.stop(),_.detach(),y},destroy(){y.detach(),_.destroy()},emit:(e,t)=>Q(_).emit(e,t),on:((e,t)=>(_.on(e,t),y)),off:((e,t)=>(_.off(e,t),y))};return m=!0,g&&y.detach(),f}function dn(e){let t=Ze();return{kind:`step`,create:n=>t.create({...n,options:{...n.options,ticks:n.labels,stretch:e}})}}function fn(e){let{axisX:t,axisY:n}=e;return{x:{...t,type:t.type??dn(e.fullWidth)},y:n.type===void 0?{...n,type:Qe(),high:x(e.high)?e.high:n.high,low:x(e.low)?e.low:n.low,referenceValue:n.referenceValue??e.referenceValue}:{...n,type:n.type},reverseData:e.reverseData}}let pn={kind:`line`,defaults:et,config(e,t){let n=t,r=n;return{data:e,axes:Je(fn(n)),padding:n.chartPadding,width:n.width,height:n.height,viewBox:n.viewBox,className:n.classNames.chart,labels:n.labels,layers:[rn(r),on(Le({lineSmooth:n.lineSmooth,showPoint:n.showPoint,showLine:n.showLine,showArea:n.showArea,areaBase:n.areaBase,overrides:n.series,reverseData:n.reverseData,classNames:n.classNames})),an(r)]}}};function mn(e,t={}){return ln(pn,e,t)}function hn(e,t,n={},r,i){return un(pn,e,t,n,r,i??n.plugins)}function gn(e,t,n={},r){return hn(e,t,n,r).handle}let _n=/* @__PURE__ */ new Set,vn=/* @__PURE__ */ new Set([`resolve`,`prepare`,`layout`,`compose`,`scene`,`render`,`mount`]);function yn(e,t){let n=e.find(e=>typeof e?.legacyPlugin==`function`);return e.flatMap(e=>{let[r,i]=Array.isArray(e)?e:[e];return typeof r==`function`?n?[n.legacyPlugin(r,i,t)]:(_n.has(r)||(_n.add(r),console.warn(`Chartist: the plugin "${r.name||`anonymous`}" looks like a 1.x plugin (a plain function) and was skipped. 1.x plugins run only with the compat plugin: add compat from chartist/compat to plugins.`)),[]):[e]})}var bn=class extends be{data;chartOptions;chartResponsiveOptions;controller;installing;queued=[];onWindowResize=()=>this.update();detached=!1;wildcards=/* @__PURE__ */ new Map;constructor(e,t,n,r,i){super(e,t,n,h({},n,r),i),this.data=t,this.chartOptions=r,this.chartResponsiveOptions=i,Object.defineProperty(this,"eventEmitter",{value:{on:(e,t)=>this.on(e,t),off:(e,t)=>this.off(e,t),emit:(e,t)=>this.controller&&Q(this.controller.handle).emit(e,t)}})}initialize(){this.initializeTimeoutId=null;let e=this.queued.splice(0),t={name:`chart-listeners`,install:t=>{this.installing=t,Pt(t,()=>e.forEach(([e,t])=>this.on(e,t)))}},n={name:`chart-fields`,install:e=>void e.on(`resolve`,({config:e})=>e.labels?{config:{...e,labels:void 0}}:void 0).on(`mount`,()=>{this.controller&&(this.data=this.controller.data(),this.options=this.controller.options())})};this.container.ownerDocument.defaultView?.addEventListener(`resize`,this.onWindowResize),this.controller=this.createController(this.container,this.data,this.chartOptions,this.chartResponsiveOptions?.filter(([e])=>typeof e==`string`),[t,n,...yn(this.chartOptions?.plugins??[],this)]),this.installing=void 0,this.detached&&this.controller.handle.detach()}createChart(){}update(e,t,n=!1){return e&&(this.data=e),t&&(this.chartOptions=h({},n?this.chartOptions:{},t)),this.controller&&(e&&this.controller.setData(e),t&&this.controller.setOptions(t,n),this.controller.render()),this}detach(){return super.detach(),this.detached=!0,this.container.ownerDocument.defaultView?.removeEventListener(`resize`,this.onWindowResize),this.controller?.handle.detach(),this}on(e,t){let n=this.controller?.handle??this.installing;if(!n)this.queued.push([e,t]);else if(e===`*`){let e=t,r=(t,n)=>{vn.has(t)||e(t,n)};this.wildcards.set(e,r),n.on(`*`,r)}else Q(n).on(e,t);return this}off(e,t){let n=this.controller?.handle??this.installing;if(n){let r=e===`*`&&t?this.wildcards.get(t):t;Q(n).off(e,r)}else{let n=this.queued.findIndex(([n,r])=>n===e&&(!t||r===t));t&&n>=0?this.queued.splice(n,1):t||this.queued.splice(0,this.queued.length,...this.queued.filter(([t])=>t!==e))}return this}};function xn(e,t,n){if(b(e,`name`)&&e.name&&t.series?.[e.name]){let r=(t?.series[e.name])[n];return r===void 0?t[n]:r}return t[n]}var Sn=class extends bn{constructor(e,t,n,r){super(e,t,et,n,r)}createController(e,t,n,r,i){return hn(e,t,n,r,i)}};function Cn(e,t){let n=typeof e==`object`&&e?e[t]:e;return x(n)?Number(n):0}function wn(e,t,n=!1){let r=[],i=[],a=1/0,o=-1/0;for(let s of e)s.forEach((e,s)=>{let c=Cn(e,t),l=n&&c<0?i:r;l[s]=(l[s]??0)+c,a=Math.min(a,l[s]),o=Math.max(o,l[s])});return a<=o?{low:a,high:o}:void 0}function Tn(e){return{name:e.name,className:e.className,meta:e.meta,data:e.values}}function $(e={}){let t={series:`ct-series`,bar:`ct-bar`,...e.classNames},n=!!e.horizontalBars,r=e.seriesBarDistance??15,i=e.stackMode??`accumulate`,a=e.stackBars&&i!==`overlap`&&i!==!0;return{type:`bar`,coordinates:[`cartesian`],axes:{x:e.x,y:e.y},series:e.series,extent({normalized:e,axes:t}){let r=n?t.x:t.y,o=a&&r!==void 0?wn(e.series,n?`x`:`y`,i===`accumulate-relative`):void 0;return r!==void 0&&o?{[r]:o}:{}},compose({data:a,area:o,axes:c,normalized:l,seriesIndexes:u}){let d=n?c.x:c.y,f=n?c.y:c.x;if(!d||!f||!l)throw Error(`Layer "bar" needs an x and a y axis`);let p=n?`y`:`x`,m=n?`x`:`y`,h=l.series,g=a.flat?[...a.series[0].values]:a.series.map(Tn),_=g.map((e,t)=>t);e.reverseData&&_.reverse();let v=n?o.x1+d.project(0):o.y1-d.project(0),y=i===`accumulate`,S=i===`accumulate-relative`,C=[],w=[],T=C;if(u&&e.reverseData)throw Error(`Layer "bar": a series selection can't be combined with reverseData`);return _.map((a,c)=>{let l=u?.[a]??c,_=g[a],D=c-(g.length-1)/2,O;O=e.distributeSeries&&!e.stackBars?f.length/h.length/2:e.distributeSeries&&e.stackBars?f.length/2:f.length/h[c].length/2;let k=b(_,`name`)&&_.name,A=b(_,`className`)&&_.className,j=b(_,`meta`)?_.meta:void 0,M=[];return h[c].forEach((a,s)=>{let u=b(a,`x`)&&a.x,g=b(a,`y`)&&a.y,k=e.distributeSeries&&!e.stackBars?c:e.distributeSeries&&e.stackBars?0:s,A=h[c],j=n?{x:o.x1+d.project(u||0,s,A),y:o.y1-f.project(g||0,k,A)}:{x:o.x1+f.project(u||0,k,A),y:o.y1-d.project(g||0,s,A)};f.kind===`step`&&(f.stretch||(j[p]+=O*(n?-1:1)),j[p]+=e.stackBars||e.distributeSeries?0:D*r*(n?-1:1)),S&&(T=Number(n?u:g)<0?w:C);let N=T[s]||v;if(T[s]=N-(v-j[m]),a===void 0)return;let P={[`${p}1`]:j[p],[`${p}2`]:j[p]};e.stackBars&&(y||S||!i)?(P[`${m}1`]=N,P[`${m}2`]=T[s]):(P[`${m}1`]=v,P[`${m}2`]=j[m]),P.x1=Math.min(Math.max(P.x1,o.x1),o.x2),P.x2=Math.min(Math.max(P.x2,o.x1),o.x2),P.y1=Math.min(Math.max(P.y1,o.y2),o.y1),P.y2=Math.min(Math.max(P.y2,o.y2),o.y1);let F=E(_,s);M.push(U(`line`,{...P,"ct:value":[u,g].filter(x).join(`,`),"ct:meta":I(F)},t.bar,{role:`bar`,ctx:{series:_,seriesIndex:l,valueIndex:s,value:a,meta:F,...P}}))}),H(U(`g`,{"ct:series-name":k||void 0,"ct:meta":j?I(j):void 0},`${t.series} ${A||`${t.series}-${s(l)}`}`,{role:`series`,ctx:{series:_,seriesIndex:l,meta:j}}),{children:M})})}}}let En={axisX:{offset:30,position:`end`,labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:g,scaleMinSpace:30,onlyInteger:!1},axisY:{offset:40,position:`start`,labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:g,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,high:void 0,low:void 0,referenceValue:0,chartPadding:{top:15,right:15,bottom:5,left:10},seriesBarDistance:15,stackBars:!1,stackMode:`accumulate`,horizontalBars:!1,distributeSeries:!1,reverseData:!1,showGridBackground:!1,classNames:{chart:`ct-chart-bar`,horizontalBars:`ct-horizontal-bars`,label:`ct-label`,labelGroup:`ct-labels`,series:`ct-series`,bar:`ct-bar`,grid:`ct-grid`,gridGroup:`ct-grids`,gridBackground:`ct-grid-background`,vertical:`ct-vertical`,horizontal:`ct-horizontal`,start:`ct-start`,end:`ct-end`}};function Dn(e,t){let n=e.horizontalBars?`x`:`y`,r=t?Ve(t)?He(t):t:Qe();return{kind:r.kind,create(t){let i=M(t.series,e,n,t.extent),a=j({high:typeof e.high==`number`?e.high:i.high,low:typeof e.low==`number`?e.low:i.low});return r.create({...t,options:{...t.options,highLow:a,referenceValue:0}})}}}function On(e){let t=Ze();return{kind:`step`,create:n=>t.create({...n,options:{ticks:e.distributeSeries&&e.stackBars?n.labels.slice(0,1):n.labels}})}}function kn(e){let t=e.horizontalBars,n=t?e.axisX:e.axisY,r=t?e.axisY:e.axisX,i={...n,type:Dn(e,n.type)},a={...r,type:r.type??On(e)};return{x:t?i:a,y:t?a:i,reverseData:e.reverseData,normalize:{multi:t?`x`:`y`,distributed:!0}}}let An={kind:`bar`,defaults:En,config(e,t){let n=t,r=n,i=n.horizontalBars?[`y`,`x`]:[`x`,`y`],a=$({horizontalBars:n.horizontalBars,stackBars:n.stackBars,stackMode:n.stackMode,seriesBarDistance:n.seriesBarDistance,distributeSeries:n.distributeSeries,reverseData:n.reverseData,classNames:n.classNames}),o=n.stackMode===`overlap`?$({horizontalBars:n.horizontalBars,stackBars:n.stackBars}):a,s={...on(a),extent:o.extent};return{data:e,axes:Je(kn(n)),padding:n.chartPadding,width:n.width,height:n.height,viewBox:n.viewBox,className:n.classNames.chart+(n.horizontalBars?` ${n.classNames.horizontalBars}`:``),labels:n.labels,layers:[rn(r,i),s,an({...r,labelKind:n.horizontalBars?`horizontalBar`:`bar`},i)]}}};function jn(e,t={}){return ln(An,e,t)}function Mn(e,t,n={},r,i){return un(An,e,t,n,r,i??n.plugins)}function Nn(e,t,n={},r){return Mn(e,t,n,r).handle}var Pn=class extends bn{constructor(e,t,n,r){super(e,t,En,n,r)}createController(e,t,n,r,i){return Mn(e,t,n,r,i)}};function Fn(e,t,n){let r=t.x>e.x;return r&&n===`explode`||!r&&n===`implode`?`start`:r&&n===`implode`||!r&&n===`explode`?`end`:`middle`}function In(e,t,n,r){e.y>t.y-n&&e.y<t.y+n&&e.x>t.x-r*n&&e.x<t.x+r*n&&(e.y-=n,e.x-=n,In(e,t,n,r))}function Ln(e,t){let n=e?.(`stroke-width`,{classes:t.split(` `)});return n&&/^[\d.]+px$/.test(n)?parseFloat(n):void 0}let Rn={series:`ct-series`,slicePie:`ct-slice-pie`,sliceDonut:`ct-slice-donut`,label:`ct-label`};function zn(e={}){let t={...Rn,...e.classNames},n=e.labelInterpolationFnc??(e=>e);return{type:`pie`,chartType:e.donut?`donut`:`pie`,coordinates:[`polar`],compose({data:r,area:i,measureStyle:a}){let c=r.flat?[...r.series[0].values]:r.series.map(e=>({name:e.name,className:e.className,meta:e.meta,value:e.values[0]})),l=N({labels:r.labels,series:c}),u=l.series,d=l.labels,f=[],m=e.startAngle??0,h=Math.min(i.width/2,i.height/2),g=e.total||u.reduce(v,0),_=o(e.donutWidth??(e.donut?Ln(a,t.sliceDonut):void 0)??60);_.unit===`%`&&(_.value*=h/100),h-=e.donut?_.value/2:0;let y;y=e.labelPosition===`center`?0:e.labelPosition===`outside`?e.donut?h+_.value/2:h:e.donut?h:h/2,e.labelOffset&&(y+=e.labelOffset);let x={x:i.x1+i.width/2,y:i.y2+i.height/2},C=c.filter(e=>b(e,`value`)?e.value!==0:e!==0).length===1,w=[],T=[];return c.forEach((r,i)=>{if(u[i]===0&&e.ignoreEmptyValues){w.push(U(`g`));return}let a=b(r,`name`)&&r.name,o=b(r,`className`)&&r.className,l=b(r,`meta`)?r.meta:void 0,v=g>0?m+u[i]/g*360:0,E=Math.max(0,m-(i===0||C?0:.2)),D=v-m>=359.99;v-E>=359.99&&(v=E+359.99);let O=p(x.x,x.y,h,E),k=new B(!e.donut);if(D){let e=p(x.x,x.y,h,E+180);k.move(O.x,O.y).arc(h,h,0,0,0,e.x,e.y)}else{let e=p(x.x,x.y,h,v);k.move(e.x,e.y)}k.arc(h,h,0,Number(!D&&v-m>180),0,O.x,O.y),e.donut||k.line(x.x,x.y);let A=U(`path`,{d:k.stringify(),"ct:value":u[i],"ct:meta":I(l),style:e.donut&&e.donutWidth!==void 0?`stroke-width: ${_.value}px`:void 0},e.donut?t.sliceDonut:t.slicePie,{role:`slice`,ctx:{value:u[i],totalDataSum:g,index:i,seriesIndex:i,valueIndex:0,meta:l,series:r,path:k.clone(),center:x,radius:h,startAngle:m,endAngle:v}});if(w.push(H(U(`g`,{"ct:series-name":a||void 0},`${t.series} ${o||`${t.series}-${s(i)}`}`,{role:`series`,ctx:{seriesIndex:i,series:r,meta:l}}),{children:[A]})),e.showLabel??!0){let a=c.length===1?{x:x.x,y:x.y}:p(x.x,x.y,y,m+(v-m)/2),o=d&&!S(d[i])?d[i]:u[i],s=n(o,i);if(s||s===0){let n=String(s);if(e.preventOverlappingLabelOffset){let t=n.length;f.forEach(n=>In(a,n,e.preventOverlappingLabelOffset,t)),f.push(a)}T.push(U(`text`,{dx:a.x,dy:a.y,"text-anchor":Fn(x,a,e.labelDirection??`neutral`)},t.label,{role:`label`,ctx:{kind:`pie`,index:i,seriesIndex:i,valueIndex:0,text:n,series:r,meta:l,x:a.x,y:a.y}}).text(n))}}m=v}),e.showLabel??!0?[...w,H(U(`g`),{children:T})]:w}}}let Bn={width:void 0,height:void 0,chartPadding:{top:5,right:5,bottom:5,left:5},classNames:{chartPie:`ct-chart-pie`,chartDonut:`ct-chart-donut`,series:`ct-series`,slicePie:`ct-slice-pie`,sliceDonut:`ct-slice-donut`,label:`ct-label`},startAngle:0,total:void 0,donut:!1,showLabel:!0,labelOffset:0,labelPosition:`inside`,labelInterpolationFnc:g,labelDirection:`neutral`,ignoreEmptyValues:!1,preventOverlappingLabelOffset:0},Vn={kind:`pie`,defaults:Bn,config(e,t){let n=t;return{data:e,coordinates:`polar`,padding:n.chartPadding,width:n.width,height:n.height,viewBox:n.viewBox,className:n.donut?n.classNames.chartDonut:n.classNames.chartPie,layers:[zn({startAngle:n.startAngle,total:n.total,donut:n.donut,donutWidth:n.donutWidth,showLabel:n.showLabel,labelOffset:n.labelOffset,labelPosition:n.labelPosition,labelInterpolationFnc:n.labelInterpolationFnc,labelDirection:n.labelDirection,ignoreEmptyValues:n.ignoreEmptyValues,preventOverlappingLabelOffset:n.preventOverlappingLabelOffset,classNames:n.classNames})]}}};function Hn(e,t={}){return ln(Vn,e,t)}function Un(e,t,n={},r,i){return un(Vn,e,t,n,r,i??n.plugins)}function Wn(e,t,n={},r){return Un(e,t,n,r).handle}var Gn=class extends bn{constructor(e,t,n,r){super(e,t,Bn,n,r)}moveLabel(e,t,n,r){In(e,t,n,r)}createController(e,t,n,r,i){return Un(e,t,n,r,i)}},Kn=class extends J{bounds;range;constructor(e,t,n,r){let i=r.highLow||M(t,r,e.pos),a=m(n[e.rectEnd]-n[e.rectStart],i,r.scaleMinSpace||20,r.onlyInteger),o={min:a.min,max:a.max};super(e,n,a.values),this.bounds=a,this.range=o}projectValue(e){let t=Number(A(e,this.units.pos));return this.axisLength*(t-this.bounds.min)/this.bounds.range}},qn=class extends J{range;constructor(e,t,n,r){let i=r.highLow||M(t,r,e.pos),a=r.divisor||1,o=(r.ticks||_(a+1,e=>i.low+(i.high-i.low)/a*e)).sort((e,t)=>Number(e)-Number(t)),s={min:i.low,max:i.high};super(e,n,o),this.range=s}projectValue(e){let t=Number(A(e,this.units.pos));return this.axisLength*(t-this.range.min)/(this.range.max-this.range.min)}},Jn=class extends J{stepLength;stretch;constructor(e,t,n,r){let i=r.ticks||[];super(e,n,i);let a=Math.max(1,i.length-+!!r.stretch);this.stepLength=this.axisLength/a,this.stretch=!!r.stretch}projectValue(e,t){return this.stepLength*t}};function Yn(e){let t={divisor:2,fillHoles:!1,...e},n=1/Math.max(1,t.divisor);return function(e,r){let i=new B,a=0,o=0,s;for(let c=0;c<e.length;c+=2){let l=e[c],u=e[c+1],d=(l-a)*n,f=r[c/2];A(f.value)===void 0?t.fillHoles||(a=o=0,s=void 0):(s===void 0?i.move(l,u,!1,f):i.curve(a+d,o,l-d,u,l,u,!1,f),a=l,o=u,s=f)}return i}}function Xn(e){let t={postpone:!0,fillHoles:!1,...e};return function(e,n){let r=new B,i=0,a=0,o;for(let s=0;s<e.length;s+=2){let c=e[s],l=e[s+1],u=n[s/2];A(u.value)===void 0?t.fillHoles||(i=a=0,o=void 0):(o===void 0?r.move(c,l,!1,u):(t.postpone?r.line(c,a,!1,o):r.line(i,l,!1,u),r.line(c,l,!1,u)),i=c,a=l,o=u)}return r}}function Zn(e){let t={tension:1,fillHoles:!1,...e},n=Math.min(1,Math.max(0,t.tension)),r=1-n;return function e(i,a){let o=re(i,a,{fillHoles:t.fillHoles});if(!o.length)return V()([],[]);if(o.length>1)return B.join(o.map(t=>e(t.pathCoordinates,t.valueData)));{if(i=o[0].pathCoordinates,a=o[0].valueData,i.length<=4)return V()(i,a);let e=new B().move(i[0],i[1],!1,a[0]);for(let t=0,o=i.length;o-2>t;t+=2){let s=[{x:+i[t-2],y:+i[t-1]},{x:+i[t],y:+i[t+1]},{x:+i[t+2],y:+i[t+3]},{x:+i[t+4],y:+i[t+5]}];o-4===t?s[3]=s[2]:t||(s[0]={x:+i[t],y:+i[t+1]}),e.curve(n*(-s[0].x+6*s[1].x+s[2].x)/6+r*s[2].x,n*(-s[0].y+6*s[1].y+s[2].y)/6+r*s[2].y,n*(s[1].x+6*s[2].x-s[3].x)/6+r*s[2].x,n*(s[1].y+6*s[2].y-s[3].y)/6+r*s[2].y,s[2].x,s[2].y,!1,a[(t+2)/2])}return e}}}var Qn=/* @__PURE__ */ n({cardinal:()=>Zn,monotoneCubic:()=>Ae,none:()=>V,simple:()=>Yn,step:()=>Xn});let $n=[`#d70206`,`#f05b4f`,`#f4c63d`,`#d17905`,`#453d3f`,`#59922b`,`#0544d3`,`#6b0392`,`#e6805e`,`#dda458`,`#eacf7d`,`#86797d`,`#b2c326`,`#6188e2`,`#a748ca`],er=e=>String(e).replace(/[&<>"']/g,e=>i[e]);function tr(e,t){let n=[];t===`root`?n.push(`xmlns="${r.svg}"`,`xmlns:ct="${r.ct}"`):t===`html-root`&&n.push(`xmlns="${r.xhtml}"`),e.classes.length&&n.push(`class="${er(e.classes.join(` `))}"`);for(let[t,r]of Object.entries(e.attrs))t!==`xmlns`&&n.push(`${t}="${er(r)}"`);return n.length?` ${n.join(` `)}`:``}function nr(e,t){let n=`<${e.name}${tr(e,t)}`,r=e.name===`foreignObject`?`html-root`:`other`,i=(e.content===void 0?``:er(e.content))+e.children.map(e=>nr(e,r)).join(``);return i?`${n}>${i}</${e.name}>`:`${n}/>`}function rr(e){return nr(e,`root`)}function ir(e){throw Error(`Chartist: ${e}() is not available in toScene()`)}function ar(e,t){let n=nt(),r=/* @__PURE__ */ new Set,i=Mt(),a={update:()=>ir(`update`),detach:()=>ir(`detach`),destroy:()=>ir(`destroy`),...Lt(n,()=>a,r,i)};return Ft(a,e.plugins,r,i),It(a,e.on),ht(n,wt(e),{width:t.width,height:t.height,measureText:t.measureText??Z,labels:t.labels??`svg`}).scene}let or={grid:`ct-grid`,label:`ct-label`,horizontal:`ct-horizontal`,vertical:`ct-vertical`,start:`ct-start`,end:`ct-end`,gridGroup:`ct-grids`,labelGroup:`ct-labels`,gridBackground:`ct-grid-background`};function sr(e){let t=e.options;return{...t,offset:t.offset??0,position:e.side===`top`||e.side===`left`?`start`:`end`,labelOffset:t.labelOffset??{x:0,y:0},showLabel:t.showLabel??!0,showGrid:t.showGrid??!0,labelInterpolationFnc:t.labelInterpolationFnc??(e=>e)}}function cr(e,t){let n=e.axes.all??[];return t?t.map(e=>{let t=n.find(t=>t.id===e);if(!t)throw Error(`Chartist: unknown axis "${e}" in an axis layer`);return t}):n}let lr=(e,t)=>(n,r,i,a,o)=>n.dimension===`x`?{position:o.x1+r,labelOffset:{x:a.labelOffset.x,y:e===`top`?o.y2-t-a.offset+a.labelOffset.y+5:o.y1+t+a.labelOffset.y+5}}:{position:o.y1-r,labelOffset:{x:e===`left`?o.x1-t-a.offset+a.labelOffset.x:o.x2+t+a.labelOffset.x+10,y:a.labelOffset.y-i}};function ur(e,t,n,r){return Ht(e,{svgLabel:r,area:t.area,padding:t.padding,classNames:n,options:sr(e),place:lr(e.side,e.inset),atStart:e.side===`top`||e.side===`left`})}function dr(e={}){let t={...or,...e.classNames};return{type:`axisGrid`,coordinates:[`cartesian`],series:[],compose(n){let r=cr(n,e.axes).flatMap(e=>ur(e,n,t).grids);return e.background&&r.unshift(Ut(n.area,t.gridBackground)),[H(U(`g`,{},t.gridGroup),{children:r})]}}}function fr(e={}){let t={...or,...e.classNames};return{type:`axisLabels`,coordinates:[`cartesian`],series:[],compose(n){let r=(e.labels??n.labels)===`svg`?Kt(n.measureText,`line`,e.align):void 0;return[H(U(`g`,{},t.labelGroup),{children:cr(n,e.axes).flatMap(e=>ur(e,n,t,r).labels)})]}}}e.AutoScaleAxis=Kn,e.Axis=J,e.BarChart=Pn,e.BaseChart=be,e.EPSILON=c,e.EventEmitter=ve,e.FixedScaleAxis=qn,Object.defineProperty(e,"Interpolation",{enumerable:!0,get:function(){return Qn}}),e.LineChart=Sn,e.PieChart=Gn,e.StepAxis=Jn,e.Svg=ue,e.SvgList=ae,e.SvgPath=B,e.alphaNumerate=s,e.autoScaleAxis=Qe,e.axisGrid=dr,e.axisLabels=fr,e.axisUnits=q,e.bar=$,e.barChart=Nn,e.barChartConfig=jn,e.cartesianAxes=Ye,e.chart=Bt,e.container=qt,e.createChartRect=pe,e.createGrid=me,e.createGridBackground=he,e.createLabel=ge,e.createSvg=de,e.deserialize=ie,e.determineAnchorPosition=Fn,e.domRenderer=St,e.each=T,e.easings=oe,e.ensureUnit=a,e.escapingMap=i,e.estimateText=Z,e.extend=h,e.findAll=it,e.fixedScaleAxis=$e,e.getBounds=m,e.getHighLow=M,e.getMetaData=E,e.getMultiValue=A,e.getNumberOrUndefined=C,e.getSeriesOption=xn,e.isArrayOfArrays=w,e.isArrayOfSeries=O,e.isDataHoleValue=D,e.isFalseyButZero=S,e.isMultiValue=k,e.isNumeric=x,e.line=Le,e.lineChart=gn,e.lineChartConfig=mn,e.mapNodes=Y,e.namespaces=r,e.node=U,e.noop=g,e.normalizeData=N,e.normalizePadding=fe,e.optionsProvider=_e,e.orderOfMagnitude=l,e.pie=zn,e.pieChart=Wn,e.pieChartConfig=Hn,e.polarToCartesian=p,e.precision=8,e.projectLength=u,e.quantity=o,e.renderToString=rr,e.responsive=$t,e.rho=f,e.roundWithPrecision=d,e.safeHasProperty=b,e.serialMap=y,e.serialize=I,e.seriesColors=$n,e.splitIntoSegments=re,e.stepAxis=Ze,e.sum=v,e.textAscent=gt,e.times=_,e.toScene=ar,e.withOptions=Tt});
|
|
2
2
|
//# sourceMappingURL=index.umd.js.map
|
package/dist/compat.cjs
CHANGED
|
@@ -36,6 +36,40 @@ src_index = __toESM(src_index, 1);
|
|
|
36
36
|
/** The same handle, seen without event typing. Internal. */
|
|
37
37
|
const untyped = (handle) => handle;
|
|
38
38
|
//#endregion
|
|
39
|
+
//#region src/core/data/range.ts
|
|
40
|
+
/**
|
|
41
|
+
* Repairs a value range that's empty because high is at or below low, from
|
|
42
|
+
* flat data or a misconfigured `high`/`low`: sets the bound on the other
|
|
43
|
+
* side of zero to 0, or gives `0` to `1` when there are no values. Chart
|
|
44
|
+
* code that overrides a bound after `getHighLow` calls it again.
|
|
45
|
+
*
|
|
46
|
+
* @param highLow The range to check.
|
|
47
|
+
* @returns The range, or the repaired one.
|
|
48
|
+
*/
|
|
49
|
+
function nonEmptyRange(highLow) {
|
|
50
|
+
const { high, low } = highLow;
|
|
51
|
+
if (high > low) return {
|
|
52
|
+
high,
|
|
53
|
+
low
|
|
54
|
+
};
|
|
55
|
+
if (low === 0) return {
|
|
56
|
+
high: 1,
|
|
57
|
+
low
|
|
58
|
+
};
|
|
59
|
+
if (low < 0) return {
|
|
60
|
+
high: 0,
|
|
61
|
+
low
|
|
62
|
+
};
|
|
63
|
+
if (high > 0) return {
|
|
64
|
+
high,
|
|
65
|
+
low: 0
|
|
66
|
+
};
|
|
67
|
+
return {
|
|
68
|
+
high: 1,
|
|
69
|
+
low: 0
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
39
73
|
//#region src/compat/index.ts
|
|
40
74
|
/**
|
|
41
75
|
* The compat plugin: 1.x events, `Svg` wrappers and 1.x plugins on v2
|
|
@@ -137,9 +171,11 @@ function barAxes(options, data, chartRect) {
|
|
|
137
171
|
const labelDimension = horizontal ? "y" : "x";
|
|
138
172
|
const normalized = (0, src_index.normalizeData)(data, options.reverseData, valueDimension, true);
|
|
139
173
|
const series = normalized.series;
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
174
|
+
const found = options.stackBars && options.stackMode !== true && series.length ? (0, src_index.getHighLow)([serialSums(series)], options, valueDimension) : (0, src_index.getHighLow)(series, options, valueDimension);
|
|
175
|
+
const highLow = nonEmptyRange({
|
|
176
|
+
high: typeof options.high === "number" ? options.high : found.high,
|
|
177
|
+
low: typeof options.low === "number" ? options.low : found.low
|
|
178
|
+
});
|
|
143
179
|
const valueOptions = horizontal ? options.axisX : options.axisY;
|
|
144
180
|
const labelOptions = horizontal ? options.axisY : options.axisX;
|
|
145
181
|
const valueAxis = new (isLegacyAxisClass(valueOptions.type) ? valueOptions.type : src_index.AutoScaleAxis)(src_index.axisUnits[valueDimension], series, chartRect, {
|