genus-ui 1.83.20 → 1.84.20
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/dist/index.es.js +1 -1
- package/dist/index.umd.js +20 -20
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(b,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("lit"),require("lit/decorators.js"),require("lit/directives/when.js"),require("lit/directives/unsafe-html.js")):typeof define=="function"&&define.amd?define(["exports","lit","lit/decorators.js","lit/directives/when.js","lit/directives/unsafe-html.js"],p):(b=typeof globalThis<"u"?globalThis:b||self,p(b.index={},b.lit,b.decorators_js,b.when_js,b.unsafeHtml_js))})(this,function(b,p,M,te,Gs){"use strict";var
|
|
1
|
+
(function(b,p){typeof exports=="object"&&typeof module<"u"?p(exports,require("lit"),require("lit/decorators.js"),require("lit/directives/when.js"),require("lit/directives/unsafe-html.js")):typeof define=="function"&&define.amd?define(["exports","lit","lit/decorators.js","lit/directives/when.js","lit/directives/unsafe-html.js"],p):(b=typeof globalThis<"u"?globalThis:b||self,p(b.index={},b.lit,b.decorators_js,b.when_js,b.unsafeHtml_js))})(this,function(b,p,M,te,Gs){"use strict";var vg=Object.defineProperty;var Eg=(b,p,M)=>p in b?vg(b,p,{enumerable:!0,configurable:!0,writable:!0,value:M}):b[p]=M;var x=(b,p,M)=>(Eg(b,typeof p!="symbol"?p+"":p,M),M);const ha=p.css`
|
|
2
2
|
* { box-sizing: border-box; }
|
|
3
3
|
`,da=p.css`
|
|
4
4
|
.form-field
|
|
@@ -368,7 +368,7 @@
|
|
|
368
368
|
place-items: center;
|
|
369
369
|
cursor: pointer;
|
|
370
370
|
}
|
|
371
|
-
`,Ys="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Profile%20{%20fill:%20%23203e70;%20}%20%3c/style%3e%3ctitle%3eIconly/Bold/Profile%3c/title%3e%3cg%20id='Iconly/Bold/Profile'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Profile'%20transform='translate(4.000000,%202.000000)'%20fill='%23000000'%20fill-rule='nonzero'%3e%3cpath%20d='M8,13.1739317%20C12.338627,13.1739317%2016,13.8789388%2016,16.598966%20C16,19.3199932%2012.314618,20%208,20%20C3.66237339,20%205.68434189e-14,19.2949929%205.68434189e-14,16.5749657%20C5.68434189e-14,13.8539385%203.68538202,13.1739317%208,13.1739317%20Z%20M8,-6.03961325e-14%20C10.9391022,-6.03961325e-14%2013.2939852,2.35402354%2013.2939852,5.29105291%20C13.2939852,8.22808228%2010.9391022,10.5831058%208,10.5831058%20C5.06189821,10.5831058%202.70601476,8.22808228%202.70601476,5.29105291%20C2.70601476,2.35402354%205.06189821,-6.03961325e-14%208,-6.03961325e-14%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e",xs="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Password%20{%20fill:%20%23203e70;%20}%20%3c/style%3e%3ctitle%3eIconly/Bold/Password%3c/title%3e%3cg%20id='Iconly/Bold/Password'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Password'%20transform='translate(1.999700,%201.999200)'%20fill='%23000000'%20fill-rule='nonzero'%3e%3cpath%20d='M14.335,0%20C17.723,0%2020,2.378%2020,5.917%20L20,5.917%20L20,14.084%20C20,17.623%2017.723,20%2014.334,20%20L14.334,20%20L5.666,20%20C2.277,20%200,17.623%200,14.084%20L0,14.084%20L0,5.917%20C0,2.378%202.277,0%205.666,0%20L5.666,0%20Z%20M6.841,7.399%20C5.407,7.399%204.24,8.566%204.24,10%20C4.24,11.435%205.407,12.602%206.841,12.602%20C8.013,12.602%208.995,11.818%209.319,10.75%20L9.319,10.75%20L11.431,10.75%20L11.431,11.852%20C11.431,12.266%2011.767,12.602%2012.181,12.602%20C12.595,12.602%2012.931,12.266%2012.931,11.852%20L12.931,11.852%20L12.931,10.75%20L14.261,10.75%20L14.261,11.852%20C14.261,12.266%2014.597,12.602%2015.011,12.602%20C15.425,12.602%2015.761,12.266%2015.761,11.852%20L15.761,11.852%20L15.761,10%20C15.761,9.586%2015.425,9.25%2015.011,9.25%20L15.011,9.25%20L9.319,9.25%20C8.995,8.183%208.013,7.399%206.841,7.399%20Z%20M6.8411,8.8989%20C7.4481,8.8989%207.9431,9.3929%207.9431,10.0009%20C7.9431,10.6079%207.4481,11.1019%206.8411,11.1019%20C6.2341,11.1019%205.7391,10.6079%205.7391,10.0009%20C5.7391,9.3929%206.2341,8.8989%206.8411,8.8989%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Cs="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Message%20{%20fill:%20%23203e70;%20}%20%3c/style%3e%3ctitle%3eIconly/Bold/Message%3c/title%3e%3cg%20id='Iconly/Bold/Message'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Message'%20transform='translate(2.000400,%203.000000)'%20fill='%23000000'%20fill-rule='nonzero'%3e%3cpath%20d='M14.939,0%20C16.28,0%2017.57,0.53%2018.519,1.481%20C19.469,2.43%2020,3.71%2020,5.05%20L20,5.05%20L20,12.95%20C20,15.74%2017.73,18%2014.939,18%20L14.939,18%20L5.06,18%20C2.269,18%200,15.74%200,12.95%20L0,12.95%20L0,5.05%20C0,2.26%202.259,0%205.06,0%20L5.06,0%20Z%20M16.07,5.2%20C15.86,5.189%2015.66,5.26%2015.509,5.4%20L15.509,5.4%20L11,9%20C10.42,9.481%209.589,9.481%209,9%20L9,9%20L4.5,5.4%20C4.189,5.17%203.759,5.2%203.5,5.47%20C3.23,5.74%203.2,6.17%203.429,6.47%20L3.429,6.47%20L3.56,6.6%20L8.11,10.15%20C8.67,10.59%209.349,10.83%2010.06,10.83%20C10.769,10.83%2011.46,10.59%2012.019,10.15%20L12.019,10.15%20L16.53,6.54%20L16.61,6.46%20C16.849,6.17%2016.849,5.75%2016.599,5.46%20C16.46,5.311%2016.269,5.22%2016.07,5.2%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ys="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Calendar%20{%20fill:%20%23203e70;%20}%20%3c/style%3e%3ctitle%3eIconly/Bold/Calendar%3c/title%3e%3cg%20id='Iconly/Bold/Calendar'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Calendar'%20transform='translate(3.000000,%202.000000)'%20fill='%23000000'%20fill-rule='nonzero'%3e%3cpath%20d='M12.6496583,2.25524422e-06%20C13.0742093,-0.000994978687%2013.4099008,0.32883983%2013.4108881,0.768619575%20L13.4108881,0.768619575%20L13.4118754,1.51824414%20C16.1665203,1.73413601%2017.9861656,3.61119592%2017.9891276,6.48975425%20L17.9891276,6.48975425%20L17.9999941,14.9155344%20C18.0039375,18.0539625%2016.0322437,19.9849954%2012.8718071,19.9899929%20L12.8718071,19.9899929%20L5.15189025,20.0000023%20C2.0112002,20.0039859%200.0148231956,18.0269761%200.010873884,14.8795524%20L0.010873884,14.8795524%20L6.62739655e-06,6.55272272%20C-0.00393603445,3.6551739%201.75153297,1.78311149%204.5061778,1.53023813%20L4.5061778,1.53023813%20L4.50519047,0.780613568%20C4.50420314,0.340833823%204.83002135,0.00999951493%205.26444563,0.00999951493%20C5.6988699,0.00900001551%206.02468811,0.338834824%206.02567543,0.778614569%20L6.02567543,0.778614569%20L6.02666276,1.47826416%20L11.8913905,1.47026817%20L11.8904031,0.770618574%20C11.8894158,0.330838829%2012.215234,0.00100402015%2012.6496583,2.25524422e-06%20Z%20M13.0524881,14.1918968%20L13.0426148,14.1918968%20C12.588444,14.2028913%2012.22412,14.5837006%2012.2339933,15.0434703%20C12.2349806,15.50324%2012.6012792,15.8820503%2013.0554501,15.8920453%20C13.5185068,15.8910458%2013.8936914,15.5102365%2013.8927061,15.0404718%20C13.8927061,14.5707071%2013.5165322,14.1918968%2013.0524881,14.1918968%20L13.0524881,14.1918968%20Z%20M4.91690621,14.1928941%20C4.46273537,14.2128863%204.10729733,14.5936956%204.10828261,15.0534653%20C4.12901854,15.513235%204.50420314,15.8730548%204.95837398,15.8520653%20C5.40365886,15.8320753%205.75810957,15.4512661%205.73737569,14.9914963%20C5.72750241,14.5417216%205.36120376,14.1918968%204.91690621,14.1928941%20Z%20M8.98469714,14.1878967%20C8.53052631,14.2088883%208.1760756,14.5886981%208.1760756,15.0484678%20C8.19680948,15.5082375%208.57199408,15.8670578%209.02616491,15.8470678%20C9.47046247,15.8260783%209.82590051,15.4462686%209.80516663,14.9854993%20C9.79529335,14.5367241%209.4289947,14.1868993%208.98469714,14.1878967%20Z%20M4.91196957,10.5946962%20C4.45779873,10.6146884%204.10334802,10.9954976%204.10433329,11.4552674%20C4.1240819,11.9150371%204.50025383,12.2748569%204.95442467,12.2538674%20C5.39872222,12.2338774%205.75317294,11.8530681%205.73243905,11.3932984%20C5.72256577,10.9435237%205.35725445,10.5936989%204.91196957,10.5946962%20Z%20M8.98074783,10.5597138%20C8.526577,10.5797059%208.17113896,10.9605152%208.17212423,11.4202849%20C8.19187284,11.8800546%208.56804477,12.2388749%209.0222156,12.2188849%20C9.46651316,12.1978954%209.82096387,11.8180857%209.80121731,11.3583159%20C9.79035671,10.9085412%209.42504539,10.5587164%208.98074783,10.5597138%20Z%20M13.0485388,10.5647113%20C12.5943679,10.5747084%2012.2389299,10.9445232%2012.2399152,11.4042929%20L12.2399152,11.4042929%20L12.2399152,11.4152874%20C12.2497905,11.8750571%2012.6249751,12.2238824%2013.0801333,12.2138874%20C13.5244308,12.2028929%2013.8788815,11.8220837%2013.8690083,11.3623139%20C13.8482744,10.9225342%2013.491849,10.5637139%2013.0485388,10.5647113%20Z%20M11.8933651,3.00949727%20L6.02863742,3.01749327%20L6.02962475,3.8260883%20C6.02962475,4.25687255%205.70479387,4.59670235%205.27036959,4.59670235%20C4.83594532,4.59770185%204.50913978,4.25887155%204.50913978,3.8280873%20L4.50913978,3.8280873%20L4.50815246,3.05847275%20C2.58286306,3.25137613%201.51753626,4.38280948%201.52049208,6.55072372%20L1.52049208,6.55072372%20L1.52148557,6.86156804%20L16.4696299,6.84157805%20L16.4696299,6.49175325%20C16.4271748,4.3428295%2015.3490128,3.21539415%2013.4138501,3.04747825%20L13.4138501,3.04747825%20L13.4148374,3.81709281%20C13.4148374,4.24687756%2013.0801333,4.58770686%2012.6555823,4.58770686%20C12.221158,4.58870636%2011.8943525,4.24887655%2011.8943525,3.8190918%20L11.8943525,3.8190918%20L11.8933651,3.00949727%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e",vs="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Search%20{%20stroke:%20%23203e70;%20}%20%3c/style%3e%3ctitle%3eIconly/Light/Search%3c/title%3e%3cg%20id='Iconly/Light/Search'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cg%20id='Search'%20transform='translate(2.000000,%202.000000)'%20stroke='%23000000'%20stroke-width='1.5'%3e%3ccircle%20id='Ellipse_739'%20cx='9.76659044'%20cy='9.76659044'%20r='8.9885584'%3e%3c/circle%3e%3cline%20x1='16.0183067'%20y1='16.4851259'%20x2='19.5423342'%20y2='20.0000001'%20id='Line_181'%3e%3c/line%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Is="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Arrow---Left-2%20{%20stroke:%20%231e9dfc;%20}%20%3c/style%3e%3ctitle%3eIconly/Light/Arrow%20-%20Left%202%3c/title%3e%3cg%20id='Iconly/Light/Arrow---Left-2'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cg%20id='Arrow---Left-2'%20transform='translate(12.000000,%2012.000000)%20rotate(-270.000000)%20translate(-12.000000,%20-12.000000)%20translate(5.000000,%208.500000)'%20stroke='%23000000'%20stroke-width='1.5'%3e%3cpolyline%20id='Stroke-1'%20points='14%200%207%207%200%200'%3e%3c/polyline%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Es="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Arrow---Right-2%20{%20stroke:%20%231e9dfc;%20}%20%3c/style%3e%3ctitle%3eIconly/Light/Arrow%20-%20Right%202%3c/title%3e%3cg%20id='Iconly/Light/Arrow---Right-2'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cg%20id='Arrow---Right-2'%20transform='translate(12.000000,%2012.000000)%20rotate(-90.000000)%20translate(-12.000000,%20-12.000000)%20translate(5.000000,%208.500000)'%20stroke='%23000000'%20stroke-width='1.5'%3e%3cpolyline%20id='Stroke-1'%20points='14%200%207%207%200%200'%3e%3c/polyline%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var xa=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,X=(i,t,e,s)=>{for(var n=s>1?void 0:s?Ca(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(n=(s?a(t,e,n):a(n))||n);return s&&n&&xa(t,e,n),n};b.GenusTextBox=class extends p.LitElement{constructor(){super(),this.labelText="",this.inputValue="",this.inputType="text",this.inputName="",this.inputIcon="",this.placeholderText="",this.withoutIcon=!1,this.withoutLabel=!1,this.withoutLabelIcon=!1,this.readOnly=!1,this.displayPosition="bottom",this.getInputValue=t=>{this._targetInput===null&&(this._targetInput=t.target),this.inputValue=this._targetInput.value,this._internals.setFormValue(this._targetInput.value),this.dispatchEvent(new CustomEvent("typed",{detail:t.target.value}))},this._monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],this._currentMonth=new Date().getMonth(),this._currentYear=new Date().getFullYear(),this._currentDate=new Date,this._targetInput=null,this._isLeapYear=t=>t%4===0&&t%100!==0&&t%400!==0||t%100===0&&t%400===0,this._getFebDays=t=>this._isLeapYear(t)?29:28,this._showMonthsCssClass="",this._showCalenderCssClass="",this._toggleCalendar=()=>{this._showCalenderCssClass=this._showCalenderCssClass?"":`calendar-${this.displayPosition}--show`},this._selectDate=t=>{let e=new Date(this._currentYear,this._currentMonth,Number(t));this.inputValue=`${e.toLocaleString("default",{weekday:"long"})}, ${t} ${this._monthNames[e.getMonth()]} ${this._currentYear}`,this._internals.setFormValue(e.toString()),this.dispatchEvent(new CustomEvent("selected",{detail:{chosenDate:e,formattedDate:this.inputValue}})),this._showCalenderCssClass=""},this._generateDays=(t,e)=>{const s=[31,this._getFebDays(e),31,30,31,30,31,31,30,31,30,31];let n=new Date(e,t,1),o=document.createElement("div");o.classList.add("dates");for(let a=0;a<=s[t]+n.getDay()-1;a++){let r=document.createElement("div");a>=n.getDay()&&(r.classList.add("date"),r.innerHTML=(a-n.getDay()+1).toString(),a-n.getDay()+1===this._currentDate.getDate()&&e===this._currentDate.getFullYear()&&t===this._currentDate.getMonth()&&r.classList.add("current-date")),r.addEventListener("click",A=>{this._selectDate(A.target.innerHTML),A.target.classList.add("date--selected")}),o.appendChild(r)}return o},this._setMonth=t=>{this._currentMonth=t,this._showMonthsCssClass="",this._generateDays(this._currentMonth,this._currentYear)},this._previousYear=()=>{--this._currentYear,this._generateDays(this._currentMonth,this._currentYear)},this._nextYear=()=>{++this._currentYear,this._generateDays(this._currentMonth,this._currentYear)},this.renderInputControl=t=>({text:()=>{let s;return this.withoutIcon?s=p.html`
|
|
371
|
+
`,Ys="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Profile%20{%20fill:%20%23203e70;%20}%20%3c/style%3e%3ctitle%3eIconly/Bold/Profile%3c/title%3e%3cg%20id='Iconly/Bold/Profile'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Profile'%20transform='translate(4.000000,%202.000000)'%20fill='%23000000'%20fill-rule='nonzero'%3e%3cpath%20d='M8,13.1739317%20C12.338627,13.1739317%2016,13.8789388%2016,16.598966%20C16,19.3199932%2012.314618,20%208,20%20C3.66237339,20%205.68434189e-14,19.2949929%205.68434189e-14,16.5749657%20C5.68434189e-14,13.8539385%203.68538202,13.1739317%208,13.1739317%20Z%20M8,-6.03961325e-14%20C10.9391022,-6.03961325e-14%2013.2939852,2.35402354%2013.2939852,5.29105291%20C13.2939852,8.22808228%2010.9391022,10.5831058%208,10.5831058%20C5.06189821,10.5831058%202.70601476,8.22808228%202.70601476,5.29105291%20C2.70601476,2.35402354%205.06189821,-6.03961325e-14%208,-6.03961325e-14%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e",xs="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Password%20{%20fill:%20%23203e70;%20}%20%3c/style%3e%3ctitle%3eIconly/Bold/Password%3c/title%3e%3cg%20id='Iconly/Bold/Password'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Password'%20transform='translate(1.999700,%201.999200)'%20fill='%23000000'%20fill-rule='nonzero'%3e%3cpath%20d='M14.335,0%20C17.723,0%2020,2.378%2020,5.917%20L20,5.917%20L20,14.084%20C20,17.623%2017.723,20%2014.334,20%20L14.334,20%20L5.666,20%20C2.277,20%200,17.623%200,14.084%20L0,14.084%20L0,5.917%20C0,2.378%202.277,0%205.666,0%20L5.666,0%20Z%20M6.841,7.399%20C5.407,7.399%204.24,8.566%204.24,10%20C4.24,11.435%205.407,12.602%206.841,12.602%20C8.013,12.602%208.995,11.818%209.319,10.75%20L9.319,10.75%20L11.431,10.75%20L11.431,11.852%20C11.431,12.266%2011.767,12.602%2012.181,12.602%20C12.595,12.602%2012.931,12.266%2012.931,11.852%20L12.931,11.852%20L12.931,10.75%20L14.261,10.75%20L14.261,11.852%20C14.261,12.266%2014.597,12.602%2015.011,12.602%20C15.425,12.602%2015.761,12.266%2015.761,11.852%20L15.761,11.852%20L15.761,10%20C15.761,9.586%2015.425,9.25%2015.011,9.25%20L15.011,9.25%20L9.319,9.25%20C8.995,8.183%208.013,7.399%206.841,7.399%20Z%20M6.8411,8.8989%20C7.4481,8.8989%207.9431,9.3929%207.9431,10.0009%20C7.9431,10.6079%207.4481,11.1019%206.8411,11.1019%20C6.2341,11.1019%205.7391,10.6079%205.7391,10.0009%20C5.7391,9.3929%206.2341,8.8989%206.8411,8.8989%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Cs="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Message%20{%20fill:%20%23203e70;%20}%20%3c/style%3e%3ctitle%3eIconly/Bold/Message%3c/title%3e%3cg%20id='Iconly/Bold/Message'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Message'%20transform='translate(2.000400,%203.000000)'%20fill='%23000000'%20fill-rule='nonzero'%3e%3cpath%20d='M14.939,0%20C16.28,0%2017.57,0.53%2018.519,1.481%20C19.469,2.43%2020,3.71%2020,5.05%20L20,5.05%20L20,12.95%20C20,15.74%2017.73,18%2014.939,18%20L14.939,18%20L5.06,18%20C2.269,18%200,15.74%200,12.95%20L0,12.95%20L0,5.05%20C0,2.26%202.259,0%205.06,0%20L5.06,0%20Z%20M16.07,5.2%20C15.86,5.189%2015.66,5.26%2015.509,5.4%20L15.509,5.4%20L11,9%20C10.42,9.481%209.589,9.481%209,9%20L9,9%20L4.5,5.4%20C4.189,5.17%203.759,5.2%203.5,5.47%20C3.23,5.74%203.2,6.17%203.429,6.47%20L3.429,6.47%20L3.56,6.6%20L8.11,10.15%20C8.67,10.59%209.349,10.83%2010.06,10.83%20C10.769,10.83%2011.46,10.59%2012.019,10.15%20L12.019,10.15%20L16.53,6.54%20L16.61,6.46%20C16.849,6.17%2016.849,5.75%2016.599,5.46%20C16.46,5.311%2016.269,5.22%2016.07,5.2%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e",ys="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Calendar%20{%20fill:%20%23203e70;%20}%20%3c/style%3e%3ctitle%3eIconly/Bold/Calendar%3c/title%3e%3cg%20id='Iconly/Bold/Calendar'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Calendar'%20transform='translate(3.000000,%202.000000)'%20fill='%23000000'%20fill-rule='nonzero'%3e%3cpath%20d='M12.6496583,2.25524422e-06%20C13.0742093,-0.000994978687%2013.4099008,0.32883983%2013.4108881,0.768619575%20L13.4108881,0.768619575%20L13.4118754,1.51824414%20C16.1665203,1.73413601%2017.9861656,3.61119592%2017.9891276,6.48975425%20L17.9891276,6.48975425%20L17.9999941,14.9155344%20C18.0039375,18.0539625%2016.0322437,19.9849954%2012.8718071,19.9899929%20L12.8718071,19.9899929%20L5.15189025,20.0000023%20C2.0112002,20.0039859%200.0148231956,18.0269761%200.010873884,14.8795524%20L0.010873884,14.8795524%20L6.62739655e-06,6.55272272%20C-0.00393603445,3.6551739%201.75153297,1.78311149%204.5061778,1.53023813%20L4.5061778,1.53023813%20L4.50519047,0.780613568%20C4.50420314,0.340833823%204.83002135,0.00999951493%205.26444563,0.00999951493%20C5.6988699,0.00900001551%206.02468811,0.338834824%206.02567543,0.778614569%20L6.02567543,0.778614569%20L6.02666276,1.47826416%20L11.8913905,1.47026817%20L11.8904031,0.770618574%20C11.8894158,0.330838829%2012.215234,0.00100402015%2012.6496583,2.25524422e-06%20Z%20M13.0524881,14.1918968%20L13.0426148,14.1918968%20C12.588444,14.2028913%2012.22412,14.5837006%2012.2339933,15.0434703%20C12.2349806,15.50324%2012.6012792,15.8820503%2013.0554501,15.8920453%20C13.5185068,15.8910458%2013.8936914,15.5102365%2013.8927061,15.0404718%20C13.8927061,14.5707071%2013.5165322,14.1918968%2013.0524881,14.1918968%20L13.0524881,14.1918968%20Z%20M4.91690621,14.1928941%20C4.46273537,14.2128863%204.10729733,14.5936956%204.10828261,15.0534653%20C4.12901854,15.513235%204.50420314,15.8730548%204.95837398,15.8520653%20C5.40365886,15.8320753%205.75810957,15.4512661%205.73737569,14.9914963%20C5.72750241,14.5417216%205.36120376,14.1918968%204.91690621,14.1928941%20Z%20M8.98469714,14.1878967%20C8.53052631,14.2088883%208.1760756,14.5886981%208.1760756,15.0484678%20C8.19680948,15.5082375%208.57199408,15.8670578%209.02616491,15.8470678%20C9.47046247,15.8260783%209.82590051,15.4462686%209.80516663,14.9854993%20C9.79529335,14.5367241%209.4289947,14.1868993%208.98469714,14.1878967%20Z%20M4.91196957,10.5946962%20C4.45779873,10.6146884%204.10334802,10.9954976%204.10433329,11.4552674%20C4.1240819,11.9150371%204.50025383,12.2748569%204.95442467,12.2538674%20C5.39872222,12.2338774%205.75317294,11.8530681%205.73243905,11.3932984%20C5.72256577,10.9435237%205.35725445,10.5936989%204.91196957,10.5946962%20Z%20M8.98074783,10.5597138%20C8.526577,10.5797059%208.17113896,10.9605152%208.17212423,11.4202849%20C8.19187284,11.8800546%208.56804477,12.2388749%209.0222156,12.2188849%20C9.46651316,12.1978954%209.82096387,11.8180857%209.80121731,11.3583159%20C9.79035671,10.9085412%209.42504539,10.5587164%208.98074783,10.5597138%20Z%20M13.0485388,10.5647113%20C12.5943679,10.5747084%2012.2389299,10.9445232%2012.2399152,11.4042929%20L12.2399152,11.4042929%20L12.2399152,11.4152874%20C12.2497905,11.8750571%2012.6249751,12.2238824%2013.0801333,12.2138874%20C13.5244308,12.2028929%2013.8788815,11.8220837%2013.8690083,11.3623139%20C13.8482744,10.9225342%2013.491849,10.5637139%2013.0485388,10.5647113%20Z%20M11.8933651,3.00949727%20L6.02863742,3.01749327%20L6.02962475,3.8260883%20C6.02962475,4.25687255%205.70479387,4.59670235%205.27036959,4.59670235%20C4.83594532,4.59770185%204.50913978,4.25887155%204.50913978,3.8280873%20L4.50913978,3.8280873%20L4.50815246,3.05847275%20C2.58286306,3.25137613%201.51753626,4.38280948%201.52049208,6.55072372%20L1.52049208,6.55072372%20L1.52148557,6.86156804%20L16.4696299,6.84157805%20L16.4696299,6.49175325%20C16.4271748,4.3428295%2015.3490128,3.21539415%2013.4138501,3.04747825%20L13.4138501,3.04747825%20L13.4148374,3.81709281%20C13.4148374,4.24687756%2013.0801333,4.58770686%2012.6555823,4.58770686%20C12.221158,4.58870636%2011.8943525,4.24887655%2011.8943525,3.8190918%20L11.8943525,3.8190918%20L11.8933651,3.00949727%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Is="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Search%20{%20stroke:%20%23203e70;%20}%20%3c/style%3e%3ctitle%3eIconly/Light/Search%3c/title%3e%3cg%20id='Iconly/Light/Search'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cg%20id='Search'%20transform='translate(2.000000,%202.000000)'%20stroke='%23000000'%20stroke-width='1.5'%3e%3ccircle%20id='Ellipse_739'%20cx='9.76659044'%20cy='9.76659044'%20r='8.9885584'%3e%3c/circle%3e%3cline%20x1='16.0183067'%20y1='16.4851259'%20x2='19.5423342'%20y2='20.0000001'%20id='Line_181'%3e%3c/line%3e%3c/g%3e%3c/g%3e%3c/svg%3e",vs="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Arrow---Left-2%20{%20stroke:%20%231e9dfc;%20}%20%3c/style%3e%3ctitle%3eIconly/Light/Arrow%20-%20Left%202%3c/title%3e%3cg%20id='Iconly/Light/Arrow---Left-2'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cg%20id='Arrow---Left-2'%20transform='translate(12.000000,%2012.000000)%20rotate(-270.000000)%20translate(-12.000000,%20-12.000000)%20translate(5.000000,%208.500000)'%20stroke='%23000000'%20stroke-width='1.5'%3e%3cpolyline%20id='Stroke-1'%20points='14%200%207%207%200%200'%3e%3c/polyline%3e%3c/g%3e%3c/g%3e%3c/svg%3e",Es="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cstyle%3e%20%23Arrow---Right-2%20{%20stroke:%20%231e9dfc;%20}%20%3c/style%3e%3ctitle%3eIconly/Light/Arrow%20-%20Right%202%3c/title%3e%3cg%20id='Iconly/Light/Arrow---Right-2'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cg%20id='Arrow---Right-2'%20transform='translate(12.000000,%2012.000000)%20rotate(-90.000000)%20translate(-12.000000,%20-12.000000)%20translate(5.000000,%208.500000)'%20stroke='%23000000'%20stroke-width='1.5'%3e%3cpolyline%20id='Stroke-1'%20points='14%200%207%207%200%200'%3e%3c/polyline%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var xa=Object.defineProperty,Ca=Object.getOwnPropertyDescriptor,X=(i,t,e,s)=>{for(var n=s>1?void 0:s?Ca(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(n=(s?a(t,e,n):a(n))||n);return s&&n&&xa(t,e,n),n};b.GenusTextBox=class extends p.LitElement{constructor(){super(),this.labelText="",this.inputValue="",this.inputType="text",this.inputName="",this.inputIcon="",this.placeholderText="",this.withoutIcon=!1,this.withoutLabel=!1,this.withoutLabelIcon=!1,this.readOnly=!1,this.displayPosition="bottom",this.getInputValue=t=>{this._targetInput===null&&(this._targetInput=t.target),this.inputValue=this._targetInput.value,this._internals.setFormValue(this._targetInput.value),this.dispatchEvent(new CustomEvent("typed",{detail:t.target.value}))},this._monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],this._currentMonth=new Date().getMonth(),this._currentYear=new Date().getFullYear(),this._currentDate=new Date,this._targetInput=null,this._isLeapYear=t=>t%4===0&&t%100!==0&&t%400!==0||t%100===0&&t%400===0,this._getFebDays=t=>this._isLeapYear(t)?29:28,this._showMonthsCssClass="",this._showCalenderCssClass="",this._toggleCalendar=()=>{this._showCalenderCssClass=this._showCalenderCssClass?"":`calendar-${this.displayPosition}--show`},this._selectDate=t=>{let e=new Date(this._currentYear,this._currentMonth,Number(t));this.inputValue=`${e.toLocaleString("default",{weekday:"long"})}, ${t} ${this._monthNames[e.getMonth()]} ${this._currentYear}`,this._internals.setFormValue(e.toString()),this.dispatchEvent(new CustomEvent("selected",{detail:{chosenDate:e,formattedDate:this.inputValue}})),this._showCalenderCssClass=""},this._generateDays=(t,e)=>{const s=[31,this._getFebDays(e),31,30,31,30,31,31,30,31,30,31];let n=new Date(e,t,1),o=document.createElement("div");o.classList.add("dates");for(let a=0;a<=s[t]+n.getDay()-1;a++){let r=document.createElement("div");a>=n.getDay()&&(r.classList.add("date"),r.innerHTML=(a-n.getDay()+1).toString(),a-n.getDay()+1===this._currentDate.getDate()&&e===this._currentDate.getFullYear()&&t===this._currentDate.getMonth()&&r.classList.add("current-date")),r.addEventListener("click",A=>{this._selectDate(A.target.innerHTML),A.target.classList.add("date--selected")}),o.appendChild(r)}return o},this._setMonth=t=>{this._currentMonth=t,this._showMonthsCssClass="",this._generateDays(this._currentMonth,this._currentYear)},this._previousYear=()=>{--this._currentYear,this._generateDays(this._currentMonth,this._currentYear)},this._nextYear=()=>{++this._currentYear,this._generateDays(this._currentMonth,this._currentYear)},this.renderInputControl=t=>({text:()=>{let s;return this.withoutIcon?s=p.html`
|
|
372
372
|
<div class='form-field form-field--without-icon'>
|
|
373
373
|
<label class='input-label'>${this.labelText}</label>
|
|
374
374
|
${this.readOnly?p.html`<input class='input-control input-control--without-icon' type='${t}' value=${this.inputValue} readonly />`:p.html`<input class='input-control input-control--without-icon' type='${t}' @input=${this.getInputValue} name='${this.inputName}' placeholder=${this.placeholderText} value=${this.inputValue} />`}
|
|
@@ -435,14 +435,14 @@
|
|
|
435
435
|
<div class='form-field form-field--without-label'>
|
|
436
436
|
<input class='input-control' type='text' @input=${this.getInputValue} name='${this.inputName}' value=${this.inputValue} placeholder=${this.placeholderText} />
|
|
437
437
|
<div class='icon-container'>
|
|
438
|
-
<img class="component-icon" src='${this.inputIcon||
|
|
438
|
+
<img class="component-icon" src='${this.inputIcon||Is}' />
|
|
439
439
|
</div>
|
|
440
440
|
</div>`:s=p.html`
|
|
441
441
|
<div class='form-field'>
|
|
442
442
|
<label class='input-label'>${this.labelText}</label>
|
|
443
443
|
<input class='input-control' type='text' @input=${this.getInputValue} name='${this.inputName}' value=${this.inputValue} placeholder=${this.placeholderText} />
|
|
444
444
|
<div class='icon-container'>
|
|
445
|
-
<img class="component-icon" src='${this.inputIcon||
|
|
445
|
+
<img class="component-icon" src='${this.inputIcon||Is}' />
|
|
446
446
|
</div>
|
|
447
447
|
</div>`,s},date:()=>{let s;return this.withoutLabel?s=p.html`
|
|
448
448
|
<div class='date-picker'>
|
|
@@ -457,7 +457,7 @@
|
|
|
457
457
|
<span class="month-picker" @click=${()=>{this._showMonthsCssClass="month-list--show"}}>${this._monthNames[this._currentMonth]}</span>
|
|
458
458
|
<div class="year-picker">
|
|
459
459
|
<span class='year-navigation-button' @click=${this._previousYear}>
|
|
460
|
-
<img class="component-icon year-change-icon prev-year-icon" src='${
|
|
460
|
+
<img class="component-icon year-change-icon prev-year-icon" src='${vs}' />
|
|
461
461
|
</span>
|
|
462
462
|
<span class="year">${this._currentYear}</span>
|
|
463
463
|
<span class='year-navigation-button' @click=${this._nextYear}>
|
|
@@ -496,7 +496,7 @@
|
|
|
496
496
|
<span class="month-picker" @click=${()=>{this._showMonthsCssClass="month-list--show"}}>${this._monthNames[this._currentMonth]}</span>
|
|
497
497
|
<div class="year-picker">
|
|
498
498
|
<span class='year-navigation-button' @click=${this._previousYear}>
|
|
499
|
-
<img class="component-icon year-change-icon prev-year-icon" src='${
|
|
499
|
+
<img class="component-icon year-change-icon prev-year-icon" src='${vs}' />
|
|
500
500
|
</span>
|
|
501
501
|
<span class="year">${this._currentYear}</span>
|
|
502
502
|
<span class='year-navigation-button' @click=${this._nextYear}>
|
|
@@ -527,7 +527,7 @@
|
|
|
527
527
|
display: none;
|
|
528
528
|
-webkit-appearance: none;
|
|
529
529
|
}
|
|
530
|
-
`,
|
|
530
|
+
`,Ia=p.css`
|
|
531
531
|
.tab-labels
|
|
532
532
|
{
|
|
533
533
|
padding: var(--tabs-container-padding);
|
|
@@ -554,7 +554,7 @@
|
|
|
554
554
|
transform: translate3d(0, 0, 0);
|
|
555
555
|
opacity: 1;
|
|
556
556
|
}
|
|
557
|
-
`,
|
|
557
|
+
`,va=p.css`
|
|
558
558
|
.tab
|
|
559
559
|
{
|
|
560
560
|
background: var(--tab-background-color, #f4f9f9);
|
|
@@ -615,7 +615,7 @@
|
|
|
615
615
|
</div>
|
|
616
616
|
<slot></slot>
|
|
617
617
|
</div>
|
|
618
|
-
`}};Dt.styles=[ya,Ia,
|
|
618
|
+
`}};Dt.styles=[ya,va,Ia,Ea,ka,Qa],ee([M.queryAssignedElements()],Dt.prototype,"_tabContents",2),ee([M.state()],Dt.prototype,"_numberOfTabs",2),ee([M.state()],Dt.prototype,"_tabsTemplate",2),ee([M.property({attribute:"tab-names",type:Array})],Dt.prototype,"tabNames",2),ee([M.property({attribute:"with-border-bottom",type:Boolean})],Dt.prototype,"withBorderBottom",2),Dt=ee([M.customElement("genus-tab-container")],Dt);var za=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,La=(i,t,e,s)=>{for(var n=s>1?void 0:s?Ta(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(n=(s?a(t,e,n):a(n))||n);return s&&n&&za(t,e,n),n};let ki=class extends p.LitElement{render(){return p.html`<slot></slot>`}};ki=La([M.customElement("genus-tab-content")],ki);const Sa=Object.freeze(Object.defineProperty({__proto__:null,get GenusTabContainer(){return Dt},get GenusTabContent(){return ki}},Symbol.toStringTag,{value:"Module"})),ks=p.css`
|
|
619
619
|
::slotted(.hide-content)
|
|
620
620
|
{
|
|
621
621
|
visibility: hidden;
|
|
@@ -924,7 +924,7 @@
|
|
|
924
924
|
-moz-column-gap: unset;
|
|
925
925
|
column-gap: unset;
|
|
926
926
|
}
|
|
927
|
-
`,Ps="data:image/svg+xml,%3csvg%20width='15'%20height='15'%20viewBox='0%200%2015%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='7.5'%20cy='7.5'%20r='7'%20fill='%23FDFDFD'%20stroke='%23B9BDBA'/%3e%3c/svg%3e",Os="data:image/svg+xml,%3csvg%20width='15'%20height='15'%20class='radio-icon-svg%20checked-svg'%20viewBox='0%200%2015%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cstyle%3e%20.radio-icon-svg%20circle%20{%20fill:%20%23fdc54a;%20}%20.checked-svg%20path%20{%20stroke:%20%233c499e;%20}%20%3c/style%3e%3ccircle%20cx='7.5'%20cy='7.5'%20r='7.5'/%3e%3cpath%20d='M5%208.005L6.892%209.898L10.79%206'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";var $a=Object.defineProperty,tr=Object.getOwnPropertyDescriptor,
|
|
927
|
+
`,Ps="data:image/svg+xml,%3csvg%20width='15'%20height='15'%20viewBox='0%200%2015%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='7.5'%20cy='7.5'%20r='7'%20fill='%23FDFDFD'%20stroke='%23B9BDBA'/%3e%3c/svg%3e",Os="data:image/svg+xml,%3csvg%20width='15'%20height='15'%20class='radio-icon-svg%20checked-svg'%20viewBox='0%200%2015%2015'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cstyle%3e%20.radio-icon-svg%20circle%20{%20fill:%20%23fdc54a;%20}%20.checked-svg%20path%20{%20stroke:%20%233c499e;%20}%20%3c/style%3e%3ccircle%20cx='7.5'%20cy='7.5'%20r='7.5'/%3e%3cpath%20d='M5%208.005L6.892%209.898L10.79%206'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e";var $a=Object.defineProperty,tr=Object.getOwnPropertyDescriptor,vt=(i,t,e,s)=>{for(var n=s>1?void 0:s?tr(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(n=(s?a(t,e,n):a(n))||n);return s&&n&&$a(t,e,n),n};b.GenusRadioBtnGroup=class extends p.LitElement{constructor(){super(),this.groupName="",this.labelText="",this.inputName="",this.selectedOption="",this.options=[],this.withoutLabel=!1,this.withoutIcon=!1,this._internals=this.attachInternals()}render(){let t=[],e=this.options;for(let s of e)s.inputValue===this.selectedOption?this.withoutIcon?t.push(p.html`
|
|
928
928
|
<input type='radio' id=${s.inputValue} class='genus-radiobtn' @change=${()=>{this.dispatchEvent(new CustomEvent("checked",{detail:s.inputValue})),this._internals.setFormValue(s.inputValue)}} value=${s.inputValue} name=${this.groupName} checked />
|
|
929
929
|
<label class='label genus-radiobtn-label genus-radiobtn-label--with-icon' for=${s.inputValue}>
|
|
930
930
|
<span class="label-text">${s.labelText}</span>
|
|
@@ -959,7 +959,7 @@
|
|
|
959
959
|
${t}
|
|
960
960
|
</div>
|
|
961
961
|
</div>
|
|
962
|
-
`}},b.GenusRadioBtnGroup.styles=[Ja,Xa,qa,Ka,_a,Ua],b.GenusRadioBtnGroup.formAssociated=!0,
|
|
962
|
+
`}},b.GenusRadioBtnGroup.styles=[Ja,Xa,qa,Ka,_a,Ua],b.GenusRadioBtnGroup.formAssociated=!0,vt([M.property({attribute:"group-name"})],b.GenusRadioBtnGroup.prototype,"groupName",2),vt([M.property({attribute:"label-text"})],b.GenusRadioBtnGroup.prototype,"labelText",2),vt([M.property({attribute:"name",reflect:!0})],b.GenusRadioBtnGroup.prototype,"inputName",2),vt([M.property({attribute:"selected-option"})],b.GenusRadioBtnGroup.prototype,"selectedOption",2),vt([M.property({attribute:"group-options",type:Array})],b.GenusRadioBtnGroup.prototype,"options",2),vt([M.property({attribute:"without-label",type:Boolean})],b.GenusRadioBtnGroup.prototype,"withoutLabel",2),vt([M.property({attribute:"without-icon",type:Boolean})],b.GenusRadioBtnGroup.prototype,"withoutIcon",2),b.GenusRadioBtnGroup=vt([M.customElement("genus-radiobtn-group")],b.GenusRadioBtnGroup);const er=p.css`
|
|
963
963
|
*
|
|
964
964
|
{
|
|
965
965
|
margin: 0;
|
|
@@ -1269,7 +1269,7 @@
|
|
|
1269
1269
|
justify-self: start;
|
|
1270
1270
|
grid-area: il;
|
|
1271
1271
|
}
|
|
1272
|
-
`,
|
|
1272
|
+
`,Ir=p.css`
|
|
1273
1273
|
img
|
|
1274
1274
|
{
|
|
1275
1275
|
max-width: 100%;
|
|
@@ -1314,7 +1314,7 @@
|
|
|
1314
1314
|
font-size: var(--option-item-font-size, 1rem);
|
|
1315
1315
|
color: var(--option-item-color, #2d2d2d);
|
|
1316
1316
|
}
|
|
1317
|
-
`,
|
|
1317
|
+
`,vr=p.css`
|
|
1318
1318
|
* { box-sizing: border-box; }
|
|
1319
1319
|
|
|
1320
1320
|
.icon-container
|
|
@@ -1448,7 +1448,7 @@
|
|
|
1448
1448
|
<ul class='options options-${this.displayPosition} ${this._showOptionsCSS}' @click=${this.selectOption}>
|
|
1449
1449
|
<slot></slot>
|
|
1450
1450
|
</ul>
|
|
1451
|
-
</div>`,i},this._showOptionsCSS="",this._toggleOptions=()=>{this._showOptionsCSS=this._showOptionsCSS?"":`options-${this.displayPosition}--show`},this._internals=this.attachInternals()}render(){return this.renderDropDownControl()}};st.styles=[Cr,yr,
|
|
1451
|
+
</div>`,i},this._showOptionsCSS="",this._toggleOptions=()=>{this._showOptionsCSS=this._showOptionsCSS?"":`options-${this.displayPosition}--show`},this._internals=this.attachInternals()}render(){return this.renderDropDownControl()}};st.styles=[Cr,yr,Ir,Ss,vr,Rs,Er,kr],st.formAssociated=!0,pt([M.property({attribute:"label-text"})],st.prototype,"labelText",2),pt([M.property({attribute:"input-value"})],st.prototype,"inputValue",2),pt([M.property({attribute:"name",reflect:!0})],st.prototype,"inputName",2),pt([M.property({attribute:"placeholder-text"})],st.prototype,"placeholderText",2),pt([M.property({attribute:"without-label",type:Boolean})],st.prototype,"withoutLabel",2),pt([M.property({attribute:"display-position"})],st.prototype,"displayPosition",2),pt([M.property({attribute:"svg-icon-src"})],st.prototype,"inputIconSrc",2),pt([M.property()],st.prototype,"options",2),pt([M.state()],st.prototype,"_showOptionsCSS",2),st=pt([M.customElement("genus-dropdown")],st);var Or=Object.defineProperty,zr=Object.getOwnPropertyDescriptor,Hs=(i,t,e,s)=>{for(var n=s>1?void 0:s?zr(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(n=(s?a(t,e,n):a(n))||n);return s&&n&&Or(t,e,n),n};let ge=class extends p.LitElement{constructor(){super(...arguments),this.optionValue=""}render(){return p.html`
|
|
1452
1452
|
<li class='options__list-item' option-value=${this.optionValue}>
|
|
1453
1453
|
<slot></slot>
|
|
1454
1454
|
</li>
|
|
@@ -1503,14 +1503,14 @@
|
|
|
1503
1503
|
* https://www.chartjs.org
|
|
1504
1504
|
* (c) 2023 Chart.js Contributors
|
|
1505
1505
|
* Released under the MIT License
|
|
1506
|
-
*/function Bt(){}const AA=(()=>{let i=0;return()=>i++})();function z(i){return i===null||typeof i>"u"}function F(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function P(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function W(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function rt(i,t){return W(i)?i:t}function E(i,t){return typeof i>"u"?t:i}const lA=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Xs=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function S(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function T(i,t,e,s){let n,o,a;if(F(i))if(o=i.length,s)for(n=o-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;n<o;n++)t.call(e,i[n],n);else if(P(i))for(a=Object.keys(i),o=a.length,n=0;n<o;n++)t.call(e,i[a[n]],a[n])}function Je(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function qe(i){if(F(i))return i.map(qe);if(P(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=qe(i[e[n]]);return t}return i}function Js(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function cA(i,t,e,s){if(!Js(i))return;const n=t[i],o=e[i];P(n)&&P(o)?we(n,o,s):t[i]=qe(o)}function we(i,t,e){const s=F(t)?t:[t],n=s.length;if(!P(i))return i;e=e||{};const o=e.merger||cA;let a;for(let r=0;r<n;++r){if(a=s[r],!P(a))continue;const A=Object.keys(a);for(let l=0,c=A.length;l<c;++l)o(A[l],i,a,e)}return i}function me(i,t){return we(i,t,{merger:hA})}function hA(i,t,e){if(!Js(i))return;const s=t[i],n=e[i];P(s)&&P(n)?me(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=qe(n))}const qs={"":i=>i,x:i=>i.x,y:i=>i.y};function dA(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function gA(i){const t=dA(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Qt(i,t){return(qs[t]||(qs[t]=gA(t)))(i)}function Si(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Me=i=>typeof i<"u",Pt=i=>typeof i=="function",_s=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function uA(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const H=Math.PI,V=2*H,fA=V+H,_e=Number.POSITIVE_INFINITY,pA=H/180,U=H/2,Ft=H/4,$s=H*2/3,Ot=Math.log10,wt=Math.sign;function De(i,t,e){return Math.abs(i-t)<e}function tn(i){const t=Math.round(i);i=De(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Ot(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function wA(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function oe(i){return!isNaN(parseFloat(i))&&isFinite(i)}function mA(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function en(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ht(i){return i*(H/180)}function Ri(i){return i*(180/H)}function sn(i){if(!W(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function nn(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*H&&(o+=V),{angle:o,distance:n}}function Fi(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function MA(i,t){return(i-t+fA)%V-H}function At(i){return(i%V+V)%V}function be(i,t,e,s){const n=At(i),o=At(t),a=At(e),r=At(o-n),A=At(a-n),l=At(n-o),c=At(n-a);return n===o||n===a||s&&o===a||r>A&&l<c}function q(i,t,e){return Math.max(t,Math.min(e,i))}function DA(i){return q(i,-32768,32767)}function Gt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Hi(i,t,e){e=e||(a=>i[a]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const Yt=(i,t,e,s)=>Hi(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),bA=(i,t,e)=>Hi(i,e,s=>i[s][t]>=e);function BA(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const on=["push","pop","shift","splice","unshift"];function GA(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),on.forEach(e=>{const s="_onData"+Si(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=n.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[s]=="function"&&r[s](...o)}),a}})})}function an(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(on.forEach(o=>{delete i[o]}),delete i._chartjs)}function rn(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const An=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function ln(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,An.call(window,()=>{s=!1,i.apply(t,e)}))}}function YA(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const Vi=i=>i==="start"?"left":i==="end"?"right":"center",$=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,xA=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function cn(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:a,_parsed:r}=i,A=a.axis,{min:l,max:c,minDefined:h,maxDefined:d}=a.getUserBounds();h&&(n=q(Math.min(Yt(r,A,l).lo,e?s:Yt(t,A,a.getPixelForValue(l)).lo),0,s-1)),d?o=q(Math.max(Yt(r,a.axis,c,!0).hi+1,e?0:Yt(t,A,a.getPixelForValue(c),!0).hi+1),n,s)-n:o=s-n}return{start:n,count:o}}function hn(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const $e=i=>i===0||i===1,dn=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*V/e)),gn=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*V/e)+1,Be={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*U)+1,easeOutSine:i=>Math.sin(i*U),easeInOutSine:i=>-.5*(Math.cos(H*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>$e(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>$e(i)?i:dn(i,.075,.3),easeOutElastic:i=>$e(i)?i:gn(i,.075,.3),easeInOutElastic(i){return $e(i)?i:i<.5?.5*dn(i*2,.1125,.45):.5+.5*gn(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Be.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Be.easeInBounce(i*2)*.5:Be.easeOutBounce(i*2-1)*.5+.5};function Ni(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function un(i){return Ni(i)?i:new pe(i)}function ji(i){return Ni(i)?i:new pe(i).saturate(.5).darken(.1).hexString()}const CA=["x","y","borderWidth","radius","tension"],yA=["color","borderColor","backgroundColor"];function vA(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:yA},numbers:{type:"number",properties:CA}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function IA(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const fn=new Map;function EA(i,t){t=t||{};const e=i+JSON.stringify(t);let s=fn.get(e);return s||(s=new Intl.NumberFormat(i,t),fn.set(e,s)),s}function Ge(i,t,e){return EA(t,e).format(i)}const pn={values(i){return F(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const l=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(l<1e-4||l>1e15)&&(n="scientific"),o=kA(i,e)}const a=Ot(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),A={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(A,this.options.ticks.format),Ge(i,s,A)},logarithmic(i,t,e){if(i===0)return"0";const s=e[t].significand||i/Math.pow(10,Math.floor(Ot(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?pn.numeric.call(this,i,t,e):""}};function kA(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var ti={formatters:pn};function QA(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ti.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ht=Object.create(null),Wi=Object.create(null);function Ye(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function Zi(i,t,e){return typeof t=="string"?we(Ye(i,t),e):we(Ye(i,""),t)}class PA{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>ji(n.backgroundColor),this.hoverBorderColor=(s,n)=>ji(n.borderColor),this.hoverColor=(s,n)=>ji(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Zi(this,t,e)}get(t){return Ye(this,t)}describe(t,e){return Zi(Wi,t,e)}override(t,e){return Zi(Ht,t,e)}route(t,e,s,n){const o=Ye(this,t),a=Ye(this,s),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const A=this[r],l=a[n];return P(A)?Object.assign({},l,A):E(A,l)},set(A){this[r]=A}}})}apply(t){t.forEach(e=>e(this))}}var Z=new PA({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[vA,IA,QA]);function OA(i){return!i||z(i.size)||z(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ei(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function zA(i,t,e,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},o=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let a=0;const r=e.length;let A,l,c,h,d;for(A=0;A<r;A++)if(h=e[A],h!=null&&!F(h))a=ei(i,n,o,a,h);else if(F(h))for(l=0,c=h.length;l<c;l++)d=h[l],d!=null&&!F(d)&&(a=ei(i,n,o,a,d));i.restore();const g=o.length/2;if(g>e.length){for(A=0;A<g;A++)delete n[o[A]];o.splice(0,g)}return a}function Vt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function wn(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function Ui(i,t,e,s){mn(i,t,e,s,null)}function mn(i,t,e,s,n){let o,a,r,A,l,c,h,d;const g=t.pointStyle,u=t.rotation,f=t.radius;let w=(u||0)*pA;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(w),i.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),i.restore();return}if(!(isNaN(f)||f<=0)){switch(i.beginPath(),g){default:n?i.ellipse(e,s,n/2,f,0,0,V):i.arc(e,s,f,0,V),i.closePath();break;case"triangle":c=n?n/2:f,i.moveTo(e+Math.sin(w)*c,s-Math.cos(w)*f),w+=$s,i.lineTo(e+Math.sin(w)*c,s-Math.cos(w)*f),w+=$s,i.lineTo(e+Math.sin(w)*c,s-Math.cos(w)*f),i.closePath();break;case"rectRounded":l=f*.516,A=f-l,a=Math.cos(w+Ft)*A,h=Math.cos(w+Ft)*(n?n/2-l:A),r=Math.sin(w+Ft)*A,d=Math.sin(w+Ft)*(n?n/2-l:A),i.arc(e-h,s-r,l,w-H,w-U),i.arc(e+d,s-a,l,w-U,w),i.arc(e+h,s+r,l,w,w+U),i.arc(e-d,s+a,l,w+U,w+H),i.closePath();break;case"rect":if(!u){A=Math.SQRT1_2*f,c=n?n/2:A,i.rect(e-c,s-A,2*c,2*A);break}w+=Ft;case"rectRot":h=Math.cos(w)*(n?n/2:f),a=Math.cos(w)*f,r=Math.sin(w)*f,d=Math.sin(w)*(n?n/2:f),i.moveTo(e-h,s-r),i.lineTo(e+d,s-a),i.lineTo(e+h,s+r),i.lineTo(e-d,s+a),i.closePath();break;case"crossRot":w+=Ft;case"cross":h=Math.cos(w)*(n?n/2:f),a=Math.cos(w)*f,r=Math.sin(w)*f,d=Math.sin(w)*(n?n/2:f),i.moveTo(e-h,s-r),i.lineTo(e+h,s+r),i.moveTo(e+d,s-a),i.lineTo(e-d,s+a);break;case"star":h=Math.cos(w)*(n?n/2:f),a=Math.cos(w)*f,r=Math.sin(w)*f,d=Math.sin(w)*(n?n/2:f),i.moveTo(e-h,s-r),i.lineTo(e+h,s+r),i.moveTo(e+d,s-a),i.lineTo(e-d,s+a),w+=Ft,h=Math.cos(w)*(n?n/2:f),a=Math.cos(w)*f,r=Math.sin(w)*f,d=Math.sin(w)*(n?n/2:f),i.moveTo(e-h,s-r),i.lineTo(e+h,s+r),i.moveTo(e+d,s-a),i.lineTo(e-d,s+a);break;case"line":a=n?n/2:Math.cos(w)*f,r=Math.sin(w)*f,i.moveTo(e-a,s-r),i.lineTo(e+a,s+r);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(w)*(n?n/2:f),s+Math.sin(w)*f);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function xt(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function ii(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function si(i){i.restore()}function TA(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else n==="after"!=!!s?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function LA(i,t,e,s){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function SA(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),z(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function RA(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,A=e-o.actualBoundingBoxAscent,l=e+o.actualBoundingBoxDescent,c=n.strikethrough?(A+l)/2:l;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(a,c),i.lineTo(r,c),i.stroke()}}function FA(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Nt(i,t,e,s,n,o={}){const a=F(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let A,l;for(i.save(),i.font=n.string,SA(i,o),A=0;A<a.length;++A)l=a[A],o.backdrop&&FA(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),z(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(l,e,s,o.maxWidth)),i.fillText(l,e,s,o.maxWidth),RA(i,e,s,l,o),s+=Number(n.lineHeight);i.restore()}function xe(i,t){const{x:e,y:s,w:n,h:o,radius:a}=t;i.arc(e+a.topLeft,s+a.topLeft,a.topLeft,1.5*H,H,!0),i.lineTo(e,s+o-a.bottomLeft),i.arc(e+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,H,U,!0),i.lineTo(e+n-a.bottomRight,s+o),i.arc(e+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,U,0,!0),i.lineTo(e+n,s+a.topRight),i.arc(e+n-a.topRight,s+a.topRight,a.topRight,0,-U,!0),i.lineTo(e+a.topLeft,s)}const HA=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,VA=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function NA(i,t){const e=(""+i).match(HA);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const jA=i=>+i||0;function Ki(i,t){const e={},s=P(t),n=s?Object.keys(t):t,o=P(i)?s?a=>E(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of n)e[a]=jA(o(a));return e}function Mn(i){return Ki(i,{top:"y",right:"x",bottom:"y",left:"x"})}function jt(i){return Ki(i,["topLeft","topRight","bottomLeft","bottomRight"])}function tt(i){const t=Mn(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function J(i,t){i=i||{},t=t||Z.font;let e=E(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=E(i.style,t.style);s&&!(""+s).match(VA)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:E(i.family,t.family),lineHeight:NA(E(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:E(i.weight,t.weight),string:""};return n.string=OA(n),n}function Ce(i,t,e,s){let n=!0,o,a,r;for(o=0,a=i.length;o<a;++o)if(r=i[o],r!==void 0&&(t!==void 0&&typeof r=="function"&&(r=r(t),n=!1),e!==void 0&&F(r)&&(r=r[e%r.length],n=!1),r!==void 0))return s&&!n&&(s.cacheable=!1),r}function WA(i,t,e){const{min:s,max:n}=i,o=Xs(t,(n-s)/2),a=(r,A)=>e&&r===0?0:r+A;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function zt(i,t){return Object.assign(Object.create(i),t)}function Xi(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=Yn("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:r=>Xi([r,...i],t,o,s)};return new Proxy(a,{deleteProperty(r,A){return delete r[A],delete r._keys,delete i[0][A],!0},get(r,A){return bn(r,A,()=>$A(A,t,i,r))},getOwnPropertyDescriptor(r,A){return Reflect.getOwnPropertyDescriptor(r._scopes[0],A)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,A){return xn(r).includes(A)},ownKeys(r){return xn(r)},set(r,A,l){const c=r._storage||(r._storage=n());return r[A]=c[A]=l,delete r._keys,!0}})}function ae(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Dn(i,s),setContext:o=>ae(i,o,e,s),override:o=>ae(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return bn(o,a,()=>UA(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function Dn(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:Pt(e)?e:()=>e,isIndexable:Pt(s)?s:()=>s}}const ZA=(i,t)=>i?i+Si(t):t,Ji=(i,t)=>P(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function bn(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const s=e();return i[t]=s,s}function UA(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=i;let r=s[t];return Pt(r)&&a.isScriptable(t)&&(r=KA(t,r,i,e)),F(r)&&r.length&&(r=XA(t,r,i,a.isIndexable)),Ji(t,r)&&(r=ae(r,n,o&&o[t],a)),r}function KA(i,t,e,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let A=t(o,a||s);return r.delete(i),Ji(i,A)&&(A=qi(n._scopes,n,i,A)),A}function XA(i,t,e,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(P(t[0])){const A=t,l=n._scopes.filter(c=>c!==A);t=[];for(const c of A){const h=qi(l,n,i,c);t.push(ae(h,o,a&&a[i],r))}}return t}function Bn(i,t,e){return Pt(i)?i(t,e):i}const JA=(i,t)=>i===!0?t:typeof i=="string"?Qt(t,i):void 0;function qA(i,t,e,s,n){for(const o of t){const a=JA(e,o);if(a){i.add(a);const r=Bn(a._fallback,e,n);if(typeof r<"u"&&r!==e&&r!==s)return r}else if(a===!1&&typeof s<"u"&&e!==s)return null}return!1}function qi(i,t,e,s){const n=t._rootScopes,o=Bn(t._fallback,e,s),a=[...i,...n],r=new Set;r.add(s);let A=Gn(r,a,e,o||e,s);return A===null||typeof o<"u"&&o!==e&&(A=Gn(r,a,o,A,s),A===null)?!1:Xi(Array.from(r),[""],n,o,()=>_A(t,e,s))}function Gn(i,t,e,s,n){for(;e;)e=qA(i,t,e,s,n);return e}function _A(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return F(n)&&P(e)?e:n||{}}function $A(i,t,e,s){let n;for(const o of t)if(n=Yn(ZA(o,i),e),typeof n<"u")return Ji(i,n)?qi(e,s,i,n):n}function Yn(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function xn(i){let t=i._keys;return t||(t=i._keys=tl(i._scopes)),t}function tl(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function Cn(i,t,e,s){const{iScale:n}=i,{key:o="r"}=this._parsing,a=new Array(s);let r,A,l,c;for(r=0,A=s;r<A;++r)l=r+e,c=t[l],a[r]={r:n.parse(Qt(c,o),l)};return a}const el=Number.EPSILON||1e-14,re=(i,t)=>t<i.length&&!i[t].skip&&i[t],yn=i=>i==="x"?"y":"x";function il(i,t,e,s){const n=i.skip?t:i,o=t,a=e.skip?t:e,r=Fi(o,n),A=Fi(a,o);let l=r/(r+A),c=A/(r+A);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const h=s*l,d=s*c;return{previous:{x:o.x-h*(a.x-n.x),y:o.y-h*(a.y-n.y)},next:{x:o.x+d*(a.x-n.x),y:o.y+d*(a.y-n.y)}}}function sl(i,t,e){const s=i.length;let n,o,a,r,A,l=re(i,0);for(let c=0;c<s-1;++c)if(A=l,l=re(i,c+1),!(!A||!l)){if(De(t[c],0,el)){e[c]=e[c+1]=0;continue}n=e[c]/t[c],o=e[c+1]/t[c],r=Math.pow(n,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[c]=n*a*t[c],e[c+1]=o*a*t[c])}}function nl(i,t,e="x"){const s=yn(e),n=i.length;let o,a,r,A=re(i,0);for(let l=0;l<n;++l){if(a=r,r=A,A=re(i,l+1),!r)continue;const c=r[e],h=r[s];a&&(o=(c-a[e])/3,r[`cp1${e}`]=c-o,r[`cp1${s}`]=h-o*t[l]),A&&(o=(A[e]-c)/3,r[`cp2${e}`]=c+o,r[`cp2${s}`]=h+o*t[l])}}function ol(i,t="x"){const e=yn(t),s=i.length,n=Array(s).fill(0),o=Array(s);let a,r,A,l=re(i,0);for(a=0;a<s;++a)if(r=A,A=l,l=re(i,a+1),!!A){if(l){const c=l[t]-A[t];n[a]=c!==0?(l[e]-A[e])/c:0}o[a]=r?l?wt(n[a-1])!==wt(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}sl(i,n,o),nl(i,o,t)}function ni(i,t,e){return Math.max(Math.min(i,e),t)}function al(i,t){let e,s,n,o,a,r=xt(i[0],t);for(e=0,s=i.length;e<s;++e)a=o,o=r,r=e<s-1&&xt(i[e+1],t),o&&(n=i[e],a&&(n.cp1x=ni(n.cp1x,t.left,t.right),n.cp1y=ni(n.cp1y,t.top,t.bottom)),r&&(n.cp2x=ni(n.cp2x,t.left,t.right),n.cp2y=ni(n.cp2y,t.top,t.bottom)))}function rl(i,t,e,s,n){let o,a,r,A;if(t.spanGaps&&(i=i.filter(l=>!l.skip)),t.cubicInterpolationMode==="monotone")ol(i,n);else{let l=s?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)r=i[o],A=il(l,r,i[Math.min(o+1,a-(s?0:1))%a],t.tension),r.cp1x=A.previous.x,r.cp1y=A.previous.y,r.cp2x=A.next.x,r.cp2y=A.next.y,l=r}t.capBezierPoints&&al(i,e)}function vn(){return typeof window<"u"&&typeof document<"u"}function _i(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function oi(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const ai=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Al(i,t){return ai(i).getPropertyValue(t)}const ll=["top","right","bottom","left"];function Wt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=ll[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const cl=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function hl(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let a=!1,r,A;if(cl(n,o,i.target))r=n,A=o;else{const l=t.getBoundingClientRect();r=s.clientX-l.left,A=s.clientY-l.top,a=!0}return{x:r,y:A,box:a}}function Zt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=ai(e),o=n.boxSizing==="border-box",a=Wt(n,"padding"),r=Wt(n,"border","width"),{x:A,y:l,box:c}=hl(i,e),h=a.left+(c&&r.left),d=a.top+(c&&r.top);let{width:g,height:u}=t;return o&&(g-=a.width+r.width,u-=a.height+r.height),{x:Math.round((A-h)/g*e.width/s),y:Math.round((l-d)/u*e.height/s)}}function dl(i,t,e){let s,n;if(t===void 0||e===void 0){const o=_i(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=ai(o),A=Wt(r,"border","width"),l=Wt(r,"padding");t=a.width-l.width-A.width,e=a.height-l.height-A.height,s=oi(r.maxWidth,o,"clientWidth"),n=oi(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||_e,maxHeight:n||_e}}const ri=i=>Math.round(i*10)/10;function gl(i,t,e,s){const n=ai(i),o=Wt(n,"margin"),a=oi(n.maxWidth,i,"clientWidth")||_e,r=oi(n.maxHeight,i,"clientHeight")||_e,A=dl(i,t,e);let{width:l,height:c}=A;if(n.boxSizing==="content-box"){const d=Wt(n,"border","width"),g=Wt(n,"padding");l-=g.width+d.width,c-=g.height+d.height}return l=Math.max(0,l-o.width),c=Math.max(0,s?l/s:c-o.height),l=ri(Math.min(l,a,A.maxWidth)),c=ri(Math.min(c,r,A.maxHeight)),l&&!c&&(c=ri(l/2)),(t!==void 0||e!==void 0)&&s&&A.height&&c>A.height&&(c=A.height,l=ri(Math.floor(c*s))),{width:l,height:c}}function In(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||a.height!==n||a.width!==o?(i.currentDevicePixelRatio=s,a.height=n,a.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const ul=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function En(i,t){const e=Al(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Ut(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function fl(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function pl(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=Ut(i,n,e),r=Ut(n,o,e),A=Ut(o,t,e),l=Ut(a,r,e),c=Ut(r,A,e);return Ut(l,c,e)}const wl=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},ml=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Ae(i,t,e){return i?wl(t,e):ml()}function kn(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Qn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Pn(i){return i==="angle"?{between:be,compare:MA,normalize:At}:{between:Gt,compare:(t,e)=>t-e,normalize:t=>t}}function On({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Ml(i,t,e){const{property:s,start:n,end:o}=e,{between:a,normalize:r}=Pn(s),A=t.length;let{start:l,end:c,loop:h}=i,d,g;if(h){for(l+=A,c+=A,d=0,g=A;d<g&&a(r(t[l%A][s]),n,o);++d)l--,c--;l%=A,c%=A}return c<l&&(c+=A),{start:l,end:c,loop:h,style:i.style}}function zn(i,t,e){if(!e)return[i];const{property:s,start:n,end:o}=e,a=t.length,{compare:r,between:A,normalize:l}=Pn(s),{start:c,end:h,loop:d,style:g}=Ml(i,t,e),u=[];let f=!1,w=null,m,D,Y;const G=()=>A(n,Y,m)&&r(n,Y)!==0,B=()=>r(o,m)===0||A(o,Y,m),C=()=>f||G(),y=()=>!f||B();for(let v=c,I=c;v<=h;++v)D=t[v%a],!D.skip&&(m=l(D[s]),m!==Y&&(f=A(m,n,o),w===null&&C()&&(w=r(m,n)===0?v:I),w!==null&&y()&&(u.push(On({start:w,end:v,loop:d,count:a,style:g})),w=null),I=v,Y=m));return w!==null&&u.push(On({start:w,end:h,loop:d,count:a,style:g})),u}function Tn(i,t){const e=[],s=i.segments;for(let n=0;n<s.length;n++){const o=zn(s[n],i.points,t);o.length&&e.push(...o)}return e}function Dl(i,t,e,s){let n=0,o=t-1;if(e&&!s)for(;n<t&&!i[n].skip;)n++;for(;n<t&&i[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function bl(i,t,e,s){const n=i.length,o=[];let a=t,r=i[t],A;for(A=t+1;A<=e;++A){const l=i[A%n];l.skip||l.stop?r.skip||(s=!1,o.push({start:t%n,end:(A-1)%n,loop:s}),t=a=l.stop?A:null):(a=A,r.skip&&(t=A)),r=l}return a!==null&&o.push({start:t%n,end:a%n,loop:s}),o}function Bl(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:a,end:r}=Dl(e,n,o,s);if(s===!0)return Ln(i,[{start:a,end:r,loop:o}],e,t);const A=r<a?r+n:r,l=!!i._fullLoop&&a===0&&r===n-1;return Ln(i,bl(e,a,A,l),e,t)}function Ln(i,t,e,s){return!s||!s.setContext||!e?t:Gl(i,t,e,s)}function Gl(i,t,e,s){const n=i._chart.getContext(),o=Sn(i.options),{_datasetIndex:a,options:{spanGaps:r}}=i,A=e.length,l=[];let c=o,h=t[0].start,d=h;function g(u,f,w,m){const D=r?-1:1;if(u!==f){for(u+=A;e[u%A].skip;)u-=D;for(;e[f%A].skip;)f+=D;u%A!==f%A&&(l.push({start:u%A,end:f%A,loop:w,style:m}),c=m,h=f%A)}}for(const u of t){h=r?h:u.start;let f=e[h%A],w;for(d=h+1;d<=u.end;d++){const m=e[d%A];w=Sn(s.setContext(zt(n,{type:"segment",p0:f,p1:m,p0DataIndex:(d-1)%A,p1DataIndex:d%A,datasetIndex:a}))),Yl(w,c)&&g(h,d-1,u.loop,c),f=m,c=w}h<d-1&&g(h,d-1,u.loop,c)}return l}function Sn(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Yl(i,t){if(!t)return!1;const e=[],s=function(n,o){return Ni(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,s)!==JSON.stringify(t,s)}/*!
|
|
1506
|
+
*/function Bt(){}const AA=(()=>{let i=0;return()=>i++})();function z(i){return i===null||typeof i>"u"}function F(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function P(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function W(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function rt(i,t){return W(i)?i:t}function E(i,t){return typeof i>"u"?t:i}const lA=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Xs=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function S(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function T(i,t,e,s){let n,o,a;if(F(i))if(o=i.length,s)for(n=o-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;n<o;n++)t.call(e,i[n],n);else if(P(i))for(a=Object.keys(i),o=a.length,n=0;n<o;n++)t.call(e,i[a[n]],a[n])}function Je(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function qe(i){if(F(i))return i.map(qe);if(P(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=qe(i[e[n]]);return t}return i}function Js(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function cA(i,t,e,s){if(!Js(i))return;const n=t[i],o=e[i];P(n)&&P(o)?we(n,o,s):t[i]=qe(o)}function we(i,t,e){const s=F(t)?t:[t],n=s.length;if(!P(i))return i;e=e||{};const o=e.merger||cA;let a;for(let r=0;r<n;++r){if(a=s[r],!P(a))continue;const A=Object.keys(a);for(let l=0,c=A.length;l<c;++l)o(A[l],i,a,e)}return i}function me(i,t){return we(i,t,{merger:hA})}function hA(i,t,e){if(!Js(i))return;const s=t[i],n=e[i];P(s)&&P(n)?me(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=qe(n))}const qs={"":i=>i,x:i=>i.x,y:i=>i.y};function dA(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function gA(i){const t=dA(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Qt(i,t){return(qs[t]||(qs[t]=gA(t)))(i)}function Si(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Me=i=>typeof i<"u",Pt=i=>typeof i=="function",_s=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function uA(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const H=Math.PI,V=2*H,fA=V+H,_e=Number.POSITIVE_INFINITY,pA=H/180,U=H/2,Ft=H/4,$s=H*2/3,Ot=Math.log10,wt=Math.sign;function De(i,t,e){return Math.abs(i-t)<e}function tn(i){const t=Math.round(i);i=De(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Ot(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function wA(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function oe(i){return!isNaN(parseFloat(i))&&isFinite(i)}function mA(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function en(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ht(i){return i*(H/180)}function Ri(i){return i*(180/H)}function sn(i){if(!W(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function nn(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*H&&(o+=V),{angle:o,distance:n}}function Fi(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function MA(i,t){return(i-t+fA)%V-H}function At(i){return(i%V+V)%V}function be(i,t,e,s){const n=At(i),o=At(t),a=At(e),r=At(o-n),A=At(a-n),l=At(n-o),c=At(n-a);return n===o||n===a||s&&o===a||r>A&&l<c}function q(i,t,e){return Math.max(t,Math.min(e,i))}function DA(i){return q(i,-32768,32767)}function Gt(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Hi(i,t,e){e=e||(a=>i[a]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const Yt=(i,t,e,s)=>Hi(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),bA=(i,t,e)=>Hi(i,e,s=>i[s][t]>=e);function BA(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const on=["push","pop","shift","splice","unshift"];function GA(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),on.forEach(e=>{const s="_onData"+Si(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=n.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[s]=="function"&&r[s](...o)}),a}})})}function an(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(on.forEach(o=>{delete i[o]}),delete i._chartjs)}function rn(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const An=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function ln(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,An.call(window,()=>{s=!1,i.apply(t,e)}))}}function YA(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const Vi=i=>i==="start"?"left":i==="end"?"right":"center",$=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,xA=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function cn(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:a,_parsed:r}=i,A=a.axis,{min:l,max:c,minDefined:h,maxDefined:d}=a.getUserBounds();h&&(n=q(Math.min(Yt(r,A,l).lo,e?s:Yt(t,A,a.getPixelForValue(l)).lo),0,s-1)),d?o=q(Math.max(Yt(r,a.axis,c,!0).hi+1,e?0:Yt(t,A,a.getPixelForValue(c),!0).hi+1),n,s)-n:o=s-n}return{start:n,count:o}}function hn(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const $e=i=>i===0||i===1,dn=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*V/e)),gn=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*V/e)+1,Be={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*U)+1,easeOutSine:i=>Math.sin(i*U),easeInOutSine:i=>-.5*(Math.cos(H*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>$e(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>$e(i)?i:dn(i,.075,.3),easeOutElastic:i=>$e(i)?i:gn(i,.075,.3),easeInOutElastic(i){return $e(i)?i:i<.5?.5*dn(i*2,.1125,.45):.5+.5*gn(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Be.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Be.easeInBounce(i*2)*.5:Be.easeOutBounce(i*2-1)*.5+.5};function Ni(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function un(i){return Ni(i)?i:new pe(i)}function ji(i){return Ni(i)?i:new pe(i).saturate(.5).darken(.1).hexString()}const CA=["x","y","borderWidth","radius","tension"],yA=["color","borderColor","backgroundColor"];function IA(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:yA},numbers:{type:"number",properties:CA}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function vA(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const fn=new Map;function EA(i,t){t=t||{};const e=i+JSON.stringify(t);let s=fn.get(e);return s||(s=new Intl.NumberFormat(i,t),fn.set(e,s)),s}function Ge(i,t,e){return EA(t,e).format(i)}const pn={values(i){return F(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const l=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(l<1e-4||l>1e15)&&(n="scientific"),o=kA(i,e)}const a=Ot(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),A={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(A,this.options.ticks.format),Ge(i,s,A)},logarithmic(i,t,e){if(i===0)return"0";const s=e[t].significand||i/Math.pow(10,Math.floor(Ot(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?pn.numeric.call(this,i,t,e):""}};function kA(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var ti={formatters:pn};function QA(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ti.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ht=Object.create(null),Wi=Object.create(null);function Ye(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function Zi(i,t,e){return typeof t=="string"?we(Ye(i,t),e):we(Ye(i,""),t)}class PA{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>ji(n.backgroundColor),this.hoverBorderColor=(s,n)=>ji(n.borderColor),this.hoverColor=(s,n)=>ji(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Zi(this,t,e)}get(t){return Ye(this,t)}describe(t,e){return Zi(Wi,t,e)}override(t,e){return Zi(Ht,t,e)}route(t,e,s,n){const o=Ye(this,t),a=Ye(this,s),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const A=this[r],l=a[n];return P(A)?Object.assign({},l,A):E(A,l)},set(A){this[r]=A}}})}apply(t){t.forEach(e=>e(this))}}var Z=new PA({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[IA,vA,QA]);function OA(i){return!i||z(i.size)||z(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function ei(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function zA(i,t,e,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},o=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let a=0;const r=e.length;let A,l,c,h,d;for(A=0;A<r;A++)if(h=e[A],h!=null&&!F(h))a=ei(i,n,o,a,h);else if(F(h))for(l=0,c=h.length;l<c;l++)d=h[l],d!=null&&!F(d)&&(a=ei(i,n,o,a,d));i.restore();const g=o.length/2;if(g>e.length){for(A=0;A<g;A++)delete n[o[A]];o.splice(0,g)}return a}function Vt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function wn(i,t){t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore()}function Ui(i,t,e,s){mn(i,t,e,s,null)}function mn(i,t,e,s,n){let o,a,r,A,l,c,h,d;const g=t.pointStyle,u=t.rotation,f=t.radius;let w=(u||0)*pA;if(g&&typeof g=="object"&&(o=g.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(w),i.drawImage(g,-g.width/2,-g.height/2,g.width,g.height),i.restore();return}if(!(isNaN(f)||f<=0)){switch(i.beginPath(),g){default:n?i.ellipse(e,s,n/2,f,0,0,V):i.arc(e,s,f,0,V),i.closePath();break;case"triangle":c=n?n/2:f,i.moveTo(e+Math.sin(w)*c,s-Math.cos(w)*f),w+=$s,i.lineTo(e+Math.sin(w)*c,s-Math.cos(w)*f),w+=$s,i.lineTo(e+Math.sin(w)*c,s-Math.cos(w)*f),i.closePath();break;case"rectRounded":l=f*.516,A=f-l,a=Math.cos(w+Ft)*A,h=Math.cos(w+Ft)*(n?n/2-l:A),r=Math.sin(w+Ft)*A,d=Math.sin(w+Ft)*(n?n/2-l:A),i.arc(e-h,s-r,l,w-H,w-U),i.arc(e+d,s-a,l,w-U,w),i.arc(e+h,s+r,l,w,w+U),i.arc(e-d,s+a,l,w+U,w+H),i.closePath();break;case"rect":if(!u){A=Math.SQRT1_2*f,c=n?n/2:A,i.rect(e-c,s-A,2*c,2*A);break}w+=Ft;case"rectRot":h=Math.cos(w)*(n?n/2:f),a=Math.cos(w)*f,r=Math.sin(w)*f,d=Math.sin(w)*(n?n/2:f),i.moveTo(e-h,s-r),i.lineTo(e+d,s-a),i.lineTo(e+h,s+r),i.lineTo(e-d,s+a),i.closePath();break;case"crossRot":w+=Ft;case"cross":h=Math.cos(w)*(n?n/2:f),a=Math.cos(w)*f,r=Math.sin(w)*f,d=Math.sin(w)*(n?n/2:f),i.moveTo(e-h,s-r),i.lineTo(e+h,s+r),i.moveTo(e+d,s-a),i.lineTo(e-d,s+a);break;case"star":h=Math.cos(w)*(n?n/2:f),a=Math.cos(w)*f,r=Math.sin(w)*f,d=Math.sin(w)*(n?n/2:f),i.moveTo(e-h,s-r),i.lineTo(e+h,s+r),i.moveTo(e+d,s-a),i.lineTo(e-d,s+a),w+=Ft,h=Math.cos(w)*(n?n/2:f),a=Math.cos(w)*f,r=Math.sin(w)*f,d=Math.sin(w)*(n?n/2:f),i.moveTo(e-h,s-r),i.lineTo(e+h,s+r),i.moveTo(e+d,s-a),i.lineTo(e-d,s+a);break;case"line":a=n?n/2:Math.cos(w)*f,r=Math.sin(w)*f,i.moveTo(e-a,s-r),i.lineTo(e+a,s+r);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(w)*(n?n/2:f),s+Math.sin(w)*f);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function xt(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function ii(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function si(i){i.restore()}function TA(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else n==="after"!=!!s?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function LA(i,t,e,s){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function SA(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),z(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function RA(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,A=e-o.actualBoundingBoxAscent,l=e+o.actualBoundingBoxDescent,c=n.strikethrough?(A+l)/2:l;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(a,c),i.lineTo(r,c),i.stroke()}}function FA(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Nt(i,t,e,s,n,o={}){const a=F(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let A,l;for(i.save(),i.font=n.string,SA(i,o),A=0;A<a.length;++A)l=a[A],o.backdrop&&FA(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),z(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(l,e,s,o.maxWidth)),i.fillText(l,e,s,o.maxWidth),RA(i,e,s,l,o),s+=Number(n.lineHeight);i.restore()}function xe(i,t){const{x:e,y:s,w:n,h:o,radius:a}=t;i.arc(e+a.topLeft,s+a.topLeft,a.topLeft,1.5*H,H,!0),i.lineTo(e,s+o-a.bottomLeft),i.arc(e+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,H,U,!0),i.lineTo(e+n-a.bottomRight,s+o),i.arc(e+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,U,0,!0),i.lineTo(e+n,s+a.topRight),i.arc(e+n-a.topRight,s+a.topRight,a.topRight,0,-U,!0),i.lineTo(e+a.topLeft,s)}const HA=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,VA=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function NA(i,t){const e=(""+i).match(HA);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const jA=i=>+i||0;function Ki(i,t){const e={},s=P(t),n=s?Object.keys(t):t,o=P(i)?s?a=>E(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of n)e[a]=jA(o(a));return e}function Mn(i){return Ki(i,{top:"y",right:"x",bottom:"y",left:"x"})}function jt(i){return Ki(i,["topLeft","topRight","bottomLeft","bottomRight"])}function tt(i){const t=Mn(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function J(i,t){i=i||{},t=t||Z.font;let e=E(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=E(i.style,t.style);s&&!(""+s).match(VA)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:E(i.family,t.family),lineHeight:NA(E(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:E(i.weight,t.weight),string:""};return n.string=OA(n),n}function Ce(i,t,e,s){let n=!0,o,a,r;for(o=0,a=i.length;o<a;++o)if(r=i[o],r!==void 0&&(t!==void 0&&typeof r=="function"&&(r=r(t),n=!1),e!==void 0&&F(r)&&(r=r[e%r.length],n=!1),r!==void 0))return s&&!n&&(s.cacheable=!1),r}function WA(i,t,e){const{min:s,max:n}=i,o=Xs(t,(n-s)/2),a=(r,A)=>e&&r===0?0:r+A;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function zt(i,t){return Object.assign(Object.create(i),t)}function Xi(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=Yn("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:r=>Xi([r,...i],t,o,s)};return new Proxy(a,{deleteProperty(r,A){return delete r[A],delete r._keys,delete i[0][A],!0},get(r,A){return bn(r,A,()=>$A(A,t,i,r))},getOwnPropertyDescriptor(r,A){return Reflect.getOwnPropertyDescriptor(r._scopes[0],A)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,A){return xn(r).includes(A)},ownKeys(r){return xn(r)},set(r,A,l){const c=r._storage||(r._storage=n());return r[A]=c[A]=l,delete r._keys,!0}})}function ae(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Dn(i,s),setContext:o=>ae(i,o,e,s),override:o=>ae(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return bn(o,a,()=>UA(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function Dn(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:Pt(e)?e:()=>e,isIndexable:Pt(s)?s:()=>s}}const ZA=(i,t)=>i?i+Si(t):t,Ji=(i,t)=>P(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function bn(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const s=e();return i[t]=s,s}function UA(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=i;let r=s[t];return Pt(r)&&a.isScriptable(t)&&(r=KA(t,r,i,e)),F(r)&&r.length&&(r=XA(t,r,i,a.isIndexable)),Ji(t,r)&&(r=ae(r,n,o&&o[t],a)),r}function KA(i,t,e,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let A=t(o,a||s);return r.delete(i),Ji(i,A)&&(A=qi(n._scopes,n,i,A)),A}function XA(i,t,e,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(P(t[0])){const A=t,l=n._scopes.filter(c=>c!==A);t=[];for(const c of A){const h=qi(l,n,i,c);t.push(ae(h,o,a&&a[i],r))}}return t}function Bn(i,t,e){return Pt(i)?i(t,e):i}const JA=(i,t)=>i===!0?t:typeof i=="string"?Qt(t,i):void 0;function qA(i,t,e,s,n){for(const o of t){const a=JA(e,o);if(a){i.add(a);const r=Bn(a._fallback,e,n);if(typeof r<"u"&&r!==e&&r!==s)return r}else if(a===!1&&typeof s<"u"&&e!==s)return null}return!1}function qi(i,t,e,s){const n=t._rootScopes,o=Bn(t._fallback,e,s),a=[...i,...n],r=new Set;r.add(s);let A=Gn(r,a,e,o||e,s);return A===null||typeof o<"u"&&o!==e&&(A=Gn(r,a,o,A,s),A===null)?!1:Xi(Array.from(r),[""],n,o,()=>_A(t,e,s))}function Gn(i,t,e,s,n){for(;e;)e=qA(i,t,e,s,n);return e}function _A(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return F(n)&&P(e)?e:n||{}}function $A(i,t,e,s){let n;for(const o of t)if(n=Yn(ZA(o,i),e),typeof n<"u")return Ji(i,n)?qi(e,s,i,n):n}function Yn(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function xn(i){let t=i._keys;return t||(t=i._keys=tl(i._scopes)),t}function tl(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function Cn(i,t,e,s){const{iScale:n}=i,{key:o="r"}=this._parsing,a=new Array(s);let r,A,l,c;for(r=0,A=s;r<A;++r)l=r+e,c=t[l],a[r]={r:n.parse(Qt(c,o),l)};return a}const el=Number.EPSILON||1e-14,re=(i,t)=>t<i.length&&!i[t].skip&&i[t],yn=i=>i==="x"?"y":"x";function il(i,t,e,s){const n=i.skip?t:i,o=t,a=e.skip?t:e,r=Fi(o,n),A=Fi(a,o);let l=r/(r+A),c=A/(r+A);l=isNaN(l)?0:l,c=isNaN(c)?0:c;const h=s*l,d=s*c;return{previous:{x:o.x-h*(a.x-n.x),y:o.y-h*(a.y-n.y)},next:{x:o.x+d*(a.x-n.x),y:o.y+d*(a.y-n.y)}}}function sl(i,t,e){const s=i.length;let n,o,a,r,A,l=re(i,0);for(let c=0;c<s-1;++c)if(A=l,l=re(i,c+1),!(!A||!l)){if(De(t[c],0,el)){e[c]=e[c+1]=0;continue}n=e[c]/t[c],o=e[c+1]/t[c],r=Math.pow(n,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[c]=n*a*t[c],e[c+1]=o*a*t[c])}}function nl(i,t,e="x"){const s=yn(e),n=i.length;let o,a,r,A=re(i,0);for(let l=0;l<n;++l){if(a=r,r=A,A=re(i,l+1),!r)continue;const c=r[e],h=r[s];a&&(o=(c-a[e])/3,r[`cp1${e}`]=c-o,r[`cp1${s}`]=h-o*t[l]),A&&(o=(A[e]-c)/3,r[`cp2${e}`]=c+o,r[`cp2${s}`]=h+o*t[l])}}function ol(i,t="x"){const e=yn(t),s=i.length,n=Array(s).fill(0),o=Array(s);let a,r,A,l=re(i,0);for(a=0;a<s;++a)if(r=A,A=l,l=re(i,a+1),!!A){if(l){const c=l[t]-A[t];n[a]=c!==0?(l[e]-A[e])/c:0}o[a]=r?l?wt(n[a-1])!==wt(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}sl(i,n,o),nl(i,o,t)}function ni(i,t,e){return Math.max(Math.min(i,e),t)}function al(i,t){let e,s,n,o,a,r=xt(i[0],t);for(e=0,s=i.length;e<s;++e)a=o,o=r,r=e<s-1&&xt(i[e+1],t),o&&(n=i[e],a&&(n.cp1x=ni(n.cp1x,t.left,t.right),n.cp1y=ni(n.cp1y,t.top,t.bottom)),r&&(n.cp2x=ni(n.cp2x,t.left,t.right),n.cp2y=ni(n.cp2y,t.top,t.bottom)))}function rl(i,t,e,s,n){let o,a,r,A;if(t.spanGaps&&(i=i.filter(l=>!l.skip)),t.cubicInterpolationMode==="monotone")ol(i,n);else{let l=s?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)r=i[o],A=il(l,r,i[Math.min(o+1,a-(s?0:1))%a],t.tension),r.cp1x=A.previous.x,r.cp1y=A.previous.y,r.cp2x=A.next.x,r.cp2y=A.next.y,l=r}t.capBezierPoints&&al(i,e)}function In(){return typeof window<"u"&&typeof document<"u"}function _i(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function oi(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const ai=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Al(i,t){return ai(i).getPropertyValue(t)}const ll=["top","right","bottom","left"];function Wt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=ll[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const cl=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function hl(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let a=!1,r,A;if(cl(n,o,i.target))r=n,A=o;else{const l=t.getBoundingClientRect();r=s.clientX-l.left,A=s.clientY-l.top,a=!0}return{x:r,y:A,box:a}}function Zt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=ai(e),o=n.boxSizing==="border-box",a=Wt(n,"padding"),r=Wt(n,"border","width"),{x:A,y:l,box:c}=hl(i,e),h=a.left+(c&&r.left),d=a.top+(c&&r.top);let{width:g,height:u}=t;return o&&(g-=a.width+r.width,u-=a.height+r.height),{x:Math.round((A-h)/g*e.width/s),y:Math.round((l-d)/u*e.height/s)}}function dl(i,t,e){let s,n;if(t===void 0||e===void 0){const o=_i(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=ai(o),A=Wt(r,"border","width"),l=Wt(r,"padding");t=a.width-l.width-A.width,e=a.height-l.height-A.height,s=oi(r.maxWidth,o,"clientWidth"),n=oi(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||_e,maxHeight:n||_e}}const ri=i=>Math.round(i*10)/10;function gl(i,t,e,s){const n=ai(i),o=Wt(n,"margin"),a=oi(n.maxWidth,i,"clientWidth")||_e,r=oi(n.maxHeight,i,"clientHeight")||_e,A=dl(i,t,e);let{width:l,height:c}=A;if(n.boxSizing==="content-box"){const d=Wt(n,"border","width"),g=Wt(n,"padding");l-=g.width+d.width,c-=g.height+d.height}return l=Math.max(0,l-o.width),c=Math.max(0,s?l/s:c-o.height),l=ri(Math.min(l,a,A.maxWidth)),c=ri(Math.min(c,r,A.maxHeight)),l&&!c&&(c=ri(l/2)),(t!==void 0||e!==void 0)&&s&&A.height&&c>A.height&&(c=A.height,l=ri(Math.floor(c*s))),{width:l,height:c}}function vn(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||a.height!==n||a.width!==o?(i.currentDevicePixelRatio=s,a.height=n,a.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const ul=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function En(i,t){const e=Al(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function Ut(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function fl(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function pl(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=Ut(i,n,e),r=Ut(n,o,e),A=Ut(o,t,e),l=Ut(a,r,e),c=Ut(r,A,e);return Ut(l,c,e)}const wl=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},ml=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Ae(i,t,e){return i?wl(t,e):ml()}function kn(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Qn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Pn(i){return i==="angle"?{between:be,compare:MA,normalize:At}:{between:Gt,compare:(t,e)=>t-e,normalize:t=>t}}function On({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Ml(i,t,e){const{property:s,start:n,end:o}=e,{between:a,normalize:r}=Pn(s),A=t.length;let{start:l,end:c,loop:h}=i,d,g;if(h){for(l+=A,c+=A,d=0,g=A;d<g&&a(r(t[l%A][s]),n,o);++d)l--,c--;l%=A,c%=A}return c<l&&(c+=A),{start:l,end:c,loop:h,style:i.style}}function zn(i,t,e){if(!e)return[i];const{property:s,start:n,end:o}=e,a=t.length,{compare:r,between:A,normalize:l}=Pn(s),{start:c,end:h,loop:d,style:g}=Ml(i,t,e),u=[];let f=!1,w=null,m,D,Y;const G=()=>A(n,Y,m)&&r(n,Y)!==0,B=()=>r(o,m)===0||A(o,Y,m),C=()=>f||G(),y=()=>!f||B();for(let I=c,v=c;I<=h;++I)D=t[I%a],!D.skip&&(m=l(D[s]),m!==Y&&(f=A(m,n,o),w===null&&C()&&(w=r(m,n)===0?I:v),w!==null&&y()&&(u.push(On({start:w,end:I,loop:d,count:a,style:g})),w=null),v=I,Y=m));return w!==null&&u.push(On({start:w,end:h,loop:d,count:a,style:g})),u}function Tn(i,t){const e=[],s=i.segments;for(let n=0;n<s.length;n++){const o=zn(s[n],i.points,t);o.length&&e.push(...o)}return e}function Dl(i,t,e,s){let n=0,o=t-1;if(e&&!s)for(;n<t&&!i[n].skip;)n++;for(;n<t&&i[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function bl(i,t,e,s){const n=i.length,o=[];let a=t,r=i[t],A;for(A=t+1;A<=e;++A){const l=i[A%n];l.skip||l.stop?r.skip||(s=!1,o.push({start:t%n,end:(A-1)%n,loop:s}),t=a=l.stop?A:null):(a=A,r.skip&&(t=A)),r=l}return a!==null&&o.push({start:t%n,end:a%n,loop:s}),o}function Bl(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:a,end:r}=Dl(e,n,o,s);if(s===!0)return Ln(i,[{start:a,end:r,loop:o}],e,t);const A=r<a?r+n:r,l=!!i._fullLoop&&a===0&&r===n-1;return Ln(i,bl(e,a,A,l),e,t)}function Ln(i,t,e,s){return!s||!s.setContext||!e?t:Gl(i,t,e,s)}function Gl(i,t,e,s){const n=i._chart.getContext(),o=Sn(i.options),{_datasetIndex:a,options:{spanGaps:r}}=i,A=e.length,l=[];let c=o,h=t[0].start,d=h;function g(u,f,w,m){const D=r?-1:1;if(u!==f){for(u+=A;e[u%A].skip;)u-=D;for(;e[f%A].skip;)f+=D;u%A!==f%A&&(l.push({start:u%A,end:f%A,loop:w,style:m}),c=m,h=f%A)}}for(const u of t){h=r?h:u.start;let f=e[h%A],w;for(d=h+1;d<=u.end;d++){const m=e[d%A];w=Sn(s.setContext(zt(n,{type:"segment",p0:f,p1:m,p0DataIndex:(d-1)%A,p1DataIndex:d%A,datasetIndex:a}))),Yl(w,c)&&g(h,d-1,u.loop,c),f=m,c=w}h<d-1&&g(h,d-1,u.loop,c)}return l}function Sn(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Yl(i,t){if(!t)return!1;const e=[],s=function(n,o){return Ni(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,s)!==JSON.stringify(t,s)}/*!
|
|
1507
1507
|
* Chart.js v4.4.0
|
|
1508
1508
|
* https://www.chartjs.org
|
|
1509
1509
|
* (c) 2023 Chart.js Contributors
|
|
1510
1510
|
* Released under the MIT License
|
|
1511
|
-
*/class xl{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=An.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let a=o.length-1,r=!1,A;for(;a>=0;--a)A=o[a],A._active?(A._total>s.duration&&(s.duration=A._total),A.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ct=new xl;const Rn="transparent",Cl={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=un(i||Rn),n=s.valid&&un(t||Rn);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class yl{constructor(t,e,s,n){const o=e[s];n=Ce([t.to,n,o,t.from]);const a=Ce([t.from,o,n]);this._active=!0,this._fn=t.fn||Cl[t.type||typeof a],this._easing=Be[t.easing]||Be.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ce([t.to,e,n,t.from]),this._from=Ce([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,a=this._loop,r=this._to;let A;if(this._active=o!==r&&(a||e<s),!this._active){this._target[n]=r,this._notify(!0);return}if(e<0){this._target[n]=o;return}A=e/s%2,A=a&&A>1?2-A:A,A=this._easing(Math.min(1,Math.max(0,A))),this._target[n]=this._fn(o,r,A)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class Fn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!P(t))return;const e=Object.keys(Z.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!P(o))return;const a={};for(const r of e)a[r]=o[r];(F(o.properties)&&o.properties||[n]).forEach(r=>{(r===n||!s.has(r))&&s.set(r,a)})})}_animateOptions(t,e){const s=e.options,n=Il(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&vl(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let A;for(A=a.length-1;A>=0;--A){const l=a[A];if(l.charAt(0)==="$")continue;if(l==="options"){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=o[l];const d=s.get(l);if(h)if(d&&h.active()){h.update(d,c,r);continue}else h.cancel();if(!d||!d.duration){t[l]=c;continue}o[l]=h=new yl(d,t,l,c),n.push(h)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return Ct.add(this._chart,s),!0}}function vl(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Il(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Hn(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function El(i,t,e){if(e===!1)return!1;const s=Hn(i,e),n=Hn(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function kl(i){let t,e,s,n;return P(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function Vn(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function Nn(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let a,r,A,l;if(t!==null){for(a=0,r=n.length;a<r;++a){if(A=+n[a],A===e){if(s.all)continue;break}l=i.values[A],W(l)&&(o||t===0||wt(t)===wt(l))&&(t+=l)}return t}}function Ql(i){const t=Object.keys(i),e=new Array(t.length);let s,n,o;for(s=0,n=t.length;s<n;++s)o=t[s],e[s]={x:o,y:i[o]};return e}function jn(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Pl(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Ol(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function zl(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function Wn(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function Zn(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=s,A=o.axis,l=a.axis,c=Pl(o,a,s),h=t.length;let d;for(let g=0;g<h;++g){const u=t[g],{[A]:f,[l]:w}=u,m=u._stacks||(u._stacks={});d=m[l]=zl(n,c,f),d[r]=w,d._top=Wn(d,a,!0,s.type),d._bottom=Wn(d,a,!1,s.type);const D=d._visualValues||(d._visualValues={});D[r]=w}}function $i(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function Tl(i,t){return zt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ll(i,t,e){return zt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ye(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const ts=i=>i==="reset"||i==="none",Un=(i,t)=>t?i:Object.assign({},i),Sl=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Vn(e,!0),values:null};class dt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=jn(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ye(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(h,d,g,u)=>h==="x"?d:h==="r"?u:g,o=e.xAxisID=E(s.xAxisID,$i(t,"x")),a=e.yAxisID=E(s.yAxisID,$i(t,"y")),r=e.rAxisID=E(s.rAxisID,$i(t,"r")),A=e.indexAxis,l=e.iAxisID=n(A,o,a,r),c=e.vAxisID=n(A,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&an(this._data,this),t._stacked&&ye(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(P(e))this._data=Ql(e);else if(s!==e){if(s){an(s,this);const n=this._cachedMeta;ye(n),n._parsed=[]}e&&Object.isExtensible(e)&&GA(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=jn(e.vScale,e),e.stack!==s.stack&&(n=!0,ye(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&Zn(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:a}=s,r=o.axis;let A=t===0&&e===n.length?!0:s._sorted,l=t>0&&s._parsed[t-1],c,h,d;if(this._parsing===!1)s._parsed=n,s._sorted=!0,d=n;else{F(n[t])?d=this.parseArrayData(s,n,t,e):P(n[t])?d=this.parseObjectData(s,n,t,e):d=this.parsePrimitiveData(s,n,t,e);const g=()=>h[r]===null||l&&h[r]<l[r];for(c=0;c<e;++c)s._parsed[c+t]=h=d[c],A&&(g()&&(A=!1),l=h);s._sorted=A}a&&Zn(this,d)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:a}=t,r=o.axis,A=a.axis,l=o.getLabels(),c=o===a,h=new Array(n);let d,g,u;for(d=0,g=n;d<g;++d)u=d+s,h[d]={[r]:c||o.parse(l[u],u),[A]:a.parse(e[u],u)};return h}parseArrayData(t,e,s,n){const{xScale:o,yScale:a}=t,r=new Array(n);let A,l,c,h;for(A=0,l=n;A<l;++A)c=A+s,h=e[c],r[A]={x:o.parse(h[0],c),y:a.parse(h[1],c)};return r}parseObjectData(t,e,s,n){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:A="y"}=this._parsing,l=new Array(n);let c,h,d,g;for(c=0,h=n;c<h;++c)d=c+s,g=e[d],l[c]={x:o.parse(Qt(g,r),d),y:a.parse(Qt(g,A),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:Vn(n,!0),values:e._stacks[t.axis]._visualValues};return Nn(r,a,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let a=o===null?NaN:o;const r=n&&s._stacks[e.axis];n&&r&&(n.values=r,a=Nn(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,a=n.length,r=this._getOtherScale(t),A=Sl(e,s,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=Ol(r);let d,g;function u(){g=n[d];const f=g[r.axis];return!W(g[t.axis])||c>f||h<f}for(d=0;d<a&&!(!u()&&(this.updateRangeFromParsed(l,t,g,A),o));++d);if(o){for(d=a-1;d>=0;--d)if(!u()){this.updateRangeFromParsed(l,t,g,A);break}}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n][t.axis],W(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=kl(E(this.options.clip,El(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,a=[],r=this._drawStart||0,A=this._drawCount||n.length-r,l=this.options.drawActiveElementsOnTop;let c;for(s.dataset&&s.dataset.draw(t,o,r,A),c=r;c<r+A;++c){const h=n[c];h.hidden||(h.active&&l?a.push(h):h.draw(t,o))}for(c=0;c<a.length;++c)a[c].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=Ll(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Tl(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],A=this.enableOptionSharing&&Me(s);if(r)return Un(r,A);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),h=n?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),c),g=Object.keys(Z.elements[t]),u=()=>this.getContext(s,n,e),f=l.resolveNamedOptions(d,g,u,h);return f.$shared&&(f.$shared=A,o[a]=Object.freeze(Un(f,A))),f}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let A;if(n.options.animation!==!1){const c=this.chart.config,h=c.datasetAnimationScopeKeys(this._type,e),d=c.getOptionScopes(this.getDataset(),h);A=c.createResolver(d,this.getContext(t,s,e))}const l=new Fn(n,A&&A.animations);return A&&A._cacheable&&(o[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ts(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),a=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:a}}updateElement(t,e,s,n){ts(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!ts(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[r,A,l]of this._syncList)this[r](A,l);this._syncList=[];const n=s.length,o=e.length,a=Math.min(o,n);a&&this.parse(0,a),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,a=t+e;let r;const A=l=>{for(l.length+=e,r=l.length-1;r>=a;r--)l[r]=l[r-e]};for(A(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&A(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&ye(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}x(dt,"defaults",{}),x(dt,"datasetElementType",null),x(dt,"dataElementType",null);function Rl(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let s=[];for(let n=0,o=e.length;n<o;n++)s=s.concat(e[n].controller.getAllParsedValues(i));i._cache.$bar=rn(s.sort((n,o)=>n-o))}return i._cache.$bar}function Fl(i){const t=i.iScale,e=Rl(t,i.type);let s=t._length,n,o,a,r;const A=()=>{a===32767||a===-32768||(Me(r)&&(s=Math.min(s,Math.abs(a-r)||s)),r=a)};for(n=0,o=e.length;n<o;++n)a=t.getPixelForValue(e[n]),A();for(r=void 0,n=0,o=t.ticks.length;n<o;++n)a=t.getPixelForTick(n),A();return s}function Hl(i,t,e,s){const n=e.barThickness;let o,a;return z(n)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=n*s,a=1),{chunk:o/s,ratio:a,start:t.pixels[i]-o/2}}function Vl(i,t,e,s){const n=t.pixels,o=n[i];let a=i>0?n[i-1]:null,r=i<n.length-1?n[i+1]:null;const A=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const l=o-(o-Math.min(a,r))/2*A;return{chunk:Math.abs(r-a)/2*A/s,ratio:e.barPercentage,start:l}}function Nl(i,t,e,s){const n=e.parse(i[0],s),o=e.parse(i[1],s),a=Math.min(n,o),r=Math.max(n,o);let A=a,l=r;Math.abs(a)>Math.abs(r)&&(A=r,l=a),t[e.axis]=l,t._custom={barStart:A,barEnd:l,start:n,end:o,min:a,max:r}}function Kn(i,t,e,s){return F(i)?Nl(i,t,e,s):t[e.axis]=e.parse(i,s),t}function Xn(i,t,e,s){const n=i.iScale,o=i.vScale,a=n.getLabels(),r=n===o,A=[];let l,c,h,d;for(l=e,c=e+s;l<c;++l)d=t[l],h={},h[n.axis]=r||n.parse(a[l],l),A.push(Kn(d,h,o,l));return A}function es(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function jl(i,t,e){return i!==0?wt(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Wl(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.base<i.y,e="bottom",s="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:s,reverse:t,top:n,bottom:o}}function Zl(i,t,e,s){let n=t.borderSkipped;const o={};if(!n){i.borderSkipped=o;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:A,top:l,bottom:c}=Wl(i);n==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===s?n=l:(e._bottom||0)===s?n=c:(o[Jn(c,a,r,A)]=!0,n=l)),o[Jn(n,a,r,A)]=!0,i.borderSkipped=o}function Jn(i,t,e,s){return s?(i=Ul(i,t,e),i=qn(i,e,t)):i=qn(i,t,e),i}function Ul(i,t,e){return i===t?e:i===e?t:i}function qn(i,t,e){return i==="start"?t:i==="end"?e:i}function Kl(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class Ai extends dt{parsePrimitiveData(t,e,s,n){return Xn(t,e,s,n)}parseArrayData(t,e,s,n){return Xn(t,e,s,n)}parseObjectData(t,e,s,n){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:A="y"}=this._parsing,l=o.axis==="x"?r:A,c=a.axis==="x"?r:A,h=[];let d,g,u,f;for(d=s,g=s+n;d<g;++d)f=e[d],u={},u[o.axis]=o.parse(Qt(f,l),d),h.push(Kn(Qt(f,c),u,a,d));return h}updateRangeFromParsed(t,e,s,n){super.updateRangeFromParsed(t,e,s,n);const o=s._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:s,vScale:n}=e,o=this.getParsed(t),a=o._custom,r=es(a)?"["+a.start+", "+a.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+s.getLabelForValue(o[s.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,n){const o=n==="reset",{index:a,_cachedMeta:{vScale:r}}=this,A=r.getBasePixel(),l=r.isHorizontal(),c=this._getRuler(),{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n);for(let g=e;g<e+s;g++){const u=this.getParsed(g),f=o||z(u[r.axis])?{base:A,head:A}:this._calculateBarValuePixels(g),w=this._calculateBarIndexPixels(g,c),m=(u._stacks||{})[r.axis],D={horizontal:l,base:f.base,enableBorderRadius:!m||es(u._custom)||a===m._top||a===m._bottom,x:l?f.head:w.center,y:l?w.center:f.head,height:l?w.size:Math.abs(f.size),width:l?Math.abs(f.size):w.size};d&&(D.options=h||this.resolveDataElementOptions(g,t[g].active?"active":n));const Y=D.options||t[g].options;Zl(D,Y,m,a),Kl(D,Y,c.ratio),this.updateElement(t[g],g,D,n)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,n=s.getMatchingVisibleMetas(this._type).filter(A=>A.controller.options.grouped),o=s.options.stacked,a=[],r=A=>{const l=A.controller.getParsed(e),c=l&&l[A.vScale.axis];if(z(c)||isNaN(c))return!0};for(const A of n)if(!(e!==void 0&&r(A))&&((o===!1||a.indexOf(A.stack)===-1||o===void 0&&A.stack===void 0)&&a.push(A.stack),A.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){const n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let o,a;for(o=0,a=e.data.length;o<a;++o)n.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));const r=t.barThickness;return{min:r||Fl(e),pixels:n,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:n},options:{base:o,minBarLength:a}}=this,r=o||0,A=this.getParsed(t),l=A._custom,c=es(l);let h=A[e.axis],d=0,g=s?this.applyStack(e,A,s):h,u,f;g!==h&&(d=g-h,g=h),c&&(h=l.barStart,g=l.barEnd-l.barStart,h!==0&&wt(h)!==wt(l.barEnd)&&(d=0),d+=h);const w=!z(o)&&!c?o:d;let m=e.getPixelForValue(w);if(this.chart.getDataVisibility(t)?u=e.getPixelForValue(d+g):u=m,f=u-m,Math.abs(f)<a){f=jl(f,e,r)*a,h===r&&(m-=f/2);const D=e.getPixelForDecimal(0),Y=e.getPixelForDecimal(1),G=Math.min(D,Y),B=Math.max(D,Y);m=Math.max(Math.min(m,B),G),u=m+f,s&&!c&&(A._stacks[e.axis]._visualValues[n]=e.getValueForPixel(u)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){const D=wt(f)*e.getLineWidthForValue(r)/2;m+=D,f-=D}return{size:f,base:m,head:u,center:u+f/2}}_calculateBarIndexPixels(t,e){const s=e.scale,n=this.options,o=n.skipNull,a=E(n.maxBarThickness,1/0);let r,A;if(e.grouped){const l=o?this._getStackCount(t):e.stackCount,c=n.barThickness==="flex"?Vl(t,e,n,l):Hl(t,e,n,l),h=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=c.start+c.chunk*h+c.chunk/2,A=Math.min(a,c.chunk*c.ratio)}else r=s.getPixelForValue(this.getParsed(t)[s.axis],t),A=Math.min(a,e.min*e.ratio);return{base:r-A/2,head:r+A/2,center:r,size:A}}draw(){const t=this._cachedMeta,e=t.vScale,s=t.data,n=s.length;let o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&s[o].draw(this._ctx)}}x(Ai,"id","bar"),x(Ai,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),x(Ai,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class li extends dt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,s,n){const o=super.parsePrimitiveData(t,e,s,n);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+s).radius;return o}parseArrayData(t,e,s,n){const o=super.parseArrayData(t,e,s,n);for(let a=0;a<o.length;a++){const r=e[s+a];o[a]._custom=E(r[2],this.resolveDataElementOptions(a+s).radius)}return o}parseObjectData(t,e,s,n){const o=super.parseObjectData(t,e,s,n);for(let a=0;a<o.length;a++){const r=e[s+a];o[a]._custom=E(r&&r.r&&+r.r,this.resolveDataElementOptions(a+s).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let s=t.length-1;s>=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:n,yScale:o}=e,a=this.getParsed(t),r=n.getLabelForValue(a.x),A=o.getLabelForValue(a.y),l=a._custom;return{label:s[t]||"",value:"("+r+", "+A+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:A,includeOptions:l}=this._getSharedOptions(e,n),c=a.axis,h=r.axis;for(let d=e;d<e+s;d++){const g=t[d],u=!o&&this.getParsed(d),f={},w=f[c]=o?a.getPixelForDecimal(.5):a.getPixelForValue(u[c]),m=f[h]=o?r.getBasePixel():r.getPixelForValue(u[h]);f.skip=isNaN(w)||isNaN(m),l&&(f.options=A||this.resolveDataElementOptions(d,g.active?"active":n),o&&(f.options.radius=0)),this.updateElement(g,d,f,n)}}resolveDataElementOptions(t,e){const s=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const o=n.radius;return e!=="active"&&(n.radius=0),n.radius+=E(s&&s._custom,o),n}}x(li,"id","bubble"),x(li,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),x(li,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Xl(i,t,e){let s=1,n=1,o=0,a=0;if(t<V){const r=i,A=r+t,l=Math.cos(r),c=Math.sin(r),h=Math.cos(A),d=Math.sin(A),g=(Y,G,B)=>be(Y,r,A,!0)?1:Math.max(G,G*e,B,B*e),u=(Y,G,B)=>be(Y,r,A,!0)?-1:Math.min(G,G*e,B,B*e),f=g(0,l,h),w=g(U,c,d),m=u(H,l,h),D=u(H+U,c,d);s=(f-m)/2,n=(w-D)/2,o=-(f+m)/2,a=-(w+D)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}class Kt extends dt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=A=>+s[A];if(P(s[t])){const{key:A="value"}=this._parsing;o=l=>+Qt(s[l],A)}let a,r;for(a=t,r=t+e;a<r;++a)n._parsed[a]=o(a)}}_getRotation(){return ht(this.options.rotation-90)}_getCircumference(){return ht(this.options.circumference)}_getRotationExtents(){let t=V,e=-V;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const n=this.chart.getDatasetMeta(s).controller,o=n._getRotation(),a=n._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:s}=e,n=this._cachedMeta,o=n.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(s.width,s.height)-a)/2,0),A=Math.min(lA(this.options.cutout,r),1),l=this._getRingWeight(this.index),{circumference:c,rotation:h}=this._getRotationExtents(),{ratioX:d,ratioY:g,offsetX:u,offsetY:f}=Xl(h,c,A),w=(s.width-a)/d,m=(s.height-a)/g,D=Math.max(Math.min(w,m)/2,0),Y=Xs(this.options.radius,D),G=Math.max(Y*A,0),B=(Y-G)/this._getVisibleDatasetWeightTotal();this.offsetX=u*Y,this.offsetY=f*Y,n.total=this.calculateTotal(),this.outerRadius=Y-B*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-B*l,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const s=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/V)}updateElements(t,e,s,n){const o=n==="reset",a=this.chart,r=a.chartArea,l=a.options.animation,c=(r.left+r.right)/2,h=(r.top+r.bottom)/2,d=o&&l.animateScale,g=d?0:this.innerRadius,u=d?0:this.outerRadius,{sharedOptions:f,includeOptions:w}=this._getSharedOptions(e,n);let m=this._getRotation(),D;for(D=0;D<e;++D)m+=this._circumference(D,o);for(D=e;D<e+s;++D){const Y=this._circumference(D,o),G=t[D],B={x:c+this.offsetX,y:h+this.offsetY,startAngle:m,endAngle:m+Y,circumference:Y,outerRadius:u,innerRadius:g};w&&(B.options=f||this.resolveDataElementOptions(D,G.active?"active":n)),m+=Y,this.updateElement(G,D,B,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,n;for(n=0;n<e.length;n++){const o=t._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?V*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=Ge(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,a,r,A;if(!t){for(n=0,o=s.data.datasets.length;n<o;++n)if(s.isDatasetVisible(n)){a=s.getDatasetMeta(n),t=a.data,r=a.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++n)A=r.resolveDataElementOptions(n),A.borderAlign!=="inner"&&(e=Math.max(e,A.borderWidth||0,A.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,n=t.length;s<n;++s){const o=this.resolveDataElementOptions(s);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(E(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}x(Kt,"id","doughnut"),x(Kt,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),x(Kt,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),x(Kt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((o,a)=>{const A=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:A.backgroundColor,strokeStyle:A.borderColor,fontColor:n,lineWidth:A.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}});class ci extends dt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:A}=cn(e,n,a);this._drawStart=r,this._drawCount=A,hn(e)&&(r=0,A=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:l},t),this.updateElements(n,r,A,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:a,vScale:r,_stacked:A,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(e,n),d=a.axis,g=r.axis,{spanGaps:u,segment:f}=this.options,w=oe(u)?u:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||o||n==="none",D=e+s,Y=t.length;let G=e>0&&this.getParsed(e-1);for(let B=0;B<Y;++B){const C=t[B],y=m?C:{};if(B<e||B>=D){y.skip=!0;continue}const v=this.getParsed(B),I=z(v[g]),k=y[d]=a.getPixelForValue(v[d],B),Q=y[g]=o||I?r.getBasePixel():r.getPixelForValue(A?this.applyStack(r,v,A):v[g],B);y.skip=isNaN(k)||isNaN(Q)||I,y.stop=B>0&&Math.abs(v[d]-G[d])>w,f&&(y.parsed=v,y.raw=l.data[B]),h&&(y.options=c||this.resolveDataElementOptions(B,C.active?"active":n)),m||this.updateElement(C,B,y,n),G=v}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}x(ci,"id","line"),x(ci,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),x(ci,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ve extends dt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=Ge(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return Cn.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{const o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),a=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,s,n){const o=n==="reset",a=this.chart,A=a.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*H;let g=d,u;const f=360/this.countVisibleElements();for(u=0;u<e;++u)g+=this._computeAngle(u,n,f);for(u=e;u<e+s;u++){const w=t[u];let m=g,D=g+this._computeAngle(u,n,f),Y=a.getDataVisibility(u)?l.getDistanceFromCenterForValue(this.getParsed(u).r):0;g=D,o&&(A.animateScale&&(Y=0),A.animateRotate&&(m=D=d));const G={x:c,y:h,innerRadius:0,outerRadius:Y,startAngle:m,endAngle:D,options:this.resolveDataElementOptions(u,w.active?"active":n)};this.updateElement(w,u,G,n)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((s,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?ht(this.resolveDataElementOptions(t,e).angle||s):0}}x(ve,"id","polarArea"),x(ve,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),x(ve,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((o,a)=>{const A=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:A.backgroundColor,strokeStyle:A.borderColor,fontColor:n,lineWidth:A.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class is extends Kt{}x(is,"id","pie"),x(is,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class hi extends dt{getLabelAndValue(t){const e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,n){return Cn.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta,s=e.dataset,n=e.data||[],o=e.iScale.getLabels();if(s.points=n,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===n.length,options:a};this.updateElement(s,void 0,r,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,s,n){const o=this._cachedMeta.rScale,a=n==="reset";for(let r=e;r<e+s;r++){const A=t[r],l=this.resolveDataElementOptions(r,A.active?"active":n),c=o.getPointPositionForValue(r,this.getParsed(r).r),h=a?o.xCenter:c.x,d=a?o.yCenter:c.y,g={x:h,y:d,angle:c.angle,skip:isNaN(h)||isNaN(d),options:l};this.updateElement(A,r,g,n)}}}x(hi,"id","radar"),x(hi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),x(hi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class di extends dt{getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:n,yScale:o}=e,a=this.getParsed(t),r=n.getLabelForValue(a.x),A=o.getLabelForValue(a.y);return{label:s[t]||"",value:"("+r+", "+A+")"}}update(t){const e=this._cachedMeta,{data:s=[]}=e,n=this.chart._animationsDisabled;let{start:o,count:a}=cn(e,s,n);if(this._drawStart=o,this._drawCount=a,hn(e)&&(o=0,a=s.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:A}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!A._decimated,r.points=s;const l=this.resolveDatasetElementOptions(t);l.segment=this.options.segment,this.updateElement(r,void 0,{animated:!n,options:l},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(s,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,s,n){const o=n==="reset",{iScale:a,vScale:r,_stacked:A,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),g=a.axis,u=r.axis,{spanGaps:f,segment:w}=this.options,m=oe(f)?f:Number.POSITIVE_INFINITY,D=this.chart._animationsDisabled||o||n==="none";let Y=e>0&&this.getParsed(e-1);for(let G=e;G<e+s;++G){const B=t[G],C=this.getParsed(G),y=D?B:{},v=z(C[u]),I=y[g]=a.getPixelForValue(C[g],G),k=y[u]=o||v?r.getBasePixel():r.getPixelForValue(A?this.applyStack(r,C,A):C[u],G);y.skip=isNaN(I)||isNaN(k)||v,y.stop=G>0&&Math.abs(C[g]-Y[g])>m,w&&(y.parsed=C,y.raw=l.data[G]),d&&(y.options=h||this.resolveDataElementOptions(G,B.active?"active":n)),D||this.updateElement(B,G,y,n),Y=C}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let A=e.length-1;A>=0;--A)r=Math.max(r,e[A].size(this.resolveDataElementOptions(A))/2);return r>0&&r}const s=t.dataset,n=s.options&&s.options.borderWidth||0;if(!e.length)return n;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,o,a)/2}}x(di,"id","scatter"),x(di,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),x(di,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Jl=Object.freeze({__proto__:null,BarController:Ai,BubbleController:li,DoughnutController:Kt,LineController:ci,PieController:is,PolarAreaController:ve,RadarController:hi,ScatterController:di});function Xt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ss{constructor(t){x(this,"options");this.options=t||{}}static override(t){Object.assign(ss.prototype,t)}init(){}formats(){return Xt()}parse(){return Xt()}format(){return Xt()}add(){return Xt()}diff(){return Xt()}startOf(){return Xt()}endOf(){return Xt()}}var ql={_date:ss};function _l(i,t,e,s){const{controller:n,data:o,_sorted:a}=i,r=n._cachedMeta.iScale;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const A=r._reversePixels?bA:Yt;if(s){if(n._sharedOptions){const l=o[0],c=typeof l.getRange=="function"&&l.getRange(t);if(c){const h=A(o,t,e-c),d=A(o,t,e+c);return{lo:h.lo,hi:d.hi}}}}else return A(o,t,e)}return{lo:0,hi:o.length-1}}function Ie(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,A=o.length;r<A;++r){const{index:l,data:c}=o[r],{lo:h,hi:d}=_l(o[r],t,a,n);for(let g=h;g<=d;++g){const u=c[g];u.skip||s(u,l,g)}}}function $l(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,a=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function ns(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||Ie(i,e,t,function(r,A,l){!n&&!xt(r,i.chartArea,0)||r.inRange(t.x,t.y,s)&&o.push({element:r,datasetIndex:A,index:l})},!0),o}function tc(i,t,e,s){let n=[];function o(a,r,A){const{startAngle:l,endAngle:c}=a.getProps(["startAngle","endAngle"],s),{angle:h}=nn(a,{x:t.x,y:t.y});be(h,l,c)&&n.push({element:a,datasetIndex:r,index:A})}return Ie(i,e,t,o),n}function ec(i,t,e,s,n,o){let a=[];const r=$l(e);let A=Number.POSITIVE_INFINITY;function l(c,h,d){const g=c.inRange(t.x,t.y,n);if(s&&!g)return;const u=c.getCenterPoint(n);if(!(!!o||i.isPointInArea(u))&&!g)return;const w=r(t,u);w<A?(a=[{element:c,datasetIndex:h,index:d}],A=w):w===A&&a.push({element:c,datasetIndex:h,index:d})}return Ie(i,e,t,l),a}function os(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?tc(i,t,e,n):ec(i,t,e,s,n,o)}function _n(i,t,e,s,n){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return Ie(i,e,t,(A,l,c)=>{A[a](t[e],n)&&(o.push({element:A,datasetIndex:l,index:c}),r=r||A.inRange(t.x,t.y,n))}),s&&!r?[]:o}var ic={evaluateInteractionItems:Ie,modes:{index(i,t,e,s){const n=Zt(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?ns(i,n,o,s,a):os(i,n,o,!1,s,a),A=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(l=>{const c=r[0].index,h=l.data[c];h&&!h.skip&&A.push({element:h,datasetIndex:l.index,index:c})}),A):[]},dataset(i,t,e,s){const n=Zt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?ns(i,n,o,s,a):os(i,n,o,!1,s,a);if(r.length>0){const A=r[0].datasetIndex,l=i.getDatasetMeta(A).data;r=[];for(let c=0;c<l.length;++c)r.push({element:l[c],datasetIndex:A,index:c})}return r},point(i,t,e,s){const n=Zt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return ns(i,n,o,s,a)},nearest(i,t,e,s){const n=Zt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return os(i,n,o,e.intersect,s,a)},x(i,t,e,s){const n=Zt(t,i);return _n(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=Zt(t,i);return _n(i,n,"y",e.intersect,s)}}};const $n=["left","top","right","bottom"];function Ee(i,t){return i.filter(e=>e.pos===t)}function to(i,t){return i.filter(e=>$n.indexOf(e.pos)===-1&&e.box.axis===t)}function ke(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function sc(i){const t=[];let e,s,n,o,a,r;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:a,stackWeight:r=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return t}function nc(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!$n.includes(n))continue;const a=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function oc(i,t){const e=nc(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];const{fullSize:A}=r.box,l=e[r.stack],c=l&&r.stackWeight/l.weight;r.horizontal?(r.width=c?c*s:A&&t.availableWidth,r.height=n):(r.width=s,r.height=c?c*n:A&&t.availableHeight)}return e}function ac(i){const t=sc(i),e=ke(t.filter(l=>l.box.fullSize),!0),s=ke(Ee(t,"left"),!0),n=ke(Ee(t,"right")),o=ke(Ee(t,"top"),!0),a=ke(Ee(t,"bottom")),r=to(t,"x"),A=to(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(A).concat(a).concat(r),chartArea:Ee(t,"chartArea"),vertical:s.concat(n).concat(A),horizontal:o.concat(a).concat(r)}}function eo(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function io(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function rc(i,t,e,s){const{pos:n,box:o}=e,a=i.maxPadding;if(!P(n)){e.size&&(i[n]-=e.size);const h=s[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?o.height:o.width),e.size=h.size/h.count,i[n]+=e.size}o.getPadding&&io(a,o.getPadding());const r=Math.max(0,t.outerWidth-eo(a,i,"left","right")),A=Math.max(0,t.outerHeight-eo(a,i,"top","bottom")),l=r!==i.w,c=A!==i.h;return i.w=r,i.h=A,e.horizontal?{same:l,other:c}:{same:c,other:l}}function Ac(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function lc(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return s(i?["left","right"]:["top","bottom"])}function Qe(i,t,e,s){const n=[];let o,a,r,A,l,c;for(o=0,a=i.length,l=0;o<a;++o){r=i[o],A=r.box,A.update(r.width||t.w,r.height||t.h,lc(r.horizontal,t));const{same:h,other:d}=rc(t,e,r,s);l|=h&&n.length,c=c||d,A.fullSize||n.push(r)}return l&&Qe(n,t,e,s)||c}function gi(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function so(i,t,e,s){const n=e.padding;let{x:o,y:a}=t;for(const r of i){const A=r.box,l=s[r.stack]||{count:1,placed:0,weight:1},c=r.stackWeight/l.weight||1;if(r.horizontal){const h=t.w*c,d=l.size||A.height;Me(l.start)&&(a=l.start),A.fullSize?gi(A,n.left,a,e.outerWidth-n.right-n.left,d):gi(A,t.left+l.placed,a,h,d),l.start=a,l.placed+=h,a=A.bottom}else{const h=t.h*c,d=l.size||A.width;Me(l.start)&&(o=l.start),A.fullSize?gi(A,o,n.top,d,e.outerHeight-n.bottom-n.top):gi(A,o,t.top+l.placed,d,h),l.start=o,l.placed+=h,o=A.right}}t.x=o,t.y=a}var et={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=tt(i.options.layout.padding),o=Math.max(t-n.width,0),a=Math.max(e-n.height,0),r=ac(i.boxes),A=r.vertical,l=r.horizontal;T(i.boxes,f=>{typeof f.beforeLayout=="function"&&f.beforeLayout()});const c=A.reduce((f,w)=>w.box.options&&w.box.options.display===!1?f:f+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),d=Object.assign({},n);io(d,tt(s));const g=Object.assign({maxPadding:d,w:o,h:a,x:n.left,y:n.top},n),u=oc(A.concat(l),h);Qe(r.fullSize,g,h,u),Qe(A,g,h,u),Qe(l,g,h,u)&&Qe(A,g,h,u),Ac(g),so(r.leftAndTop,g,h,u),g.x+=g.w,g.y+=g.h,so(r.rightAndBottom,g,h,u),i.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},T(r.chartArea,f=>{const w=f.box;Object.assign(w,i.chartArea),w.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class no{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class cc extends no{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ui="$chartjs",hc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},oo=i=>i===null||i==="";function dc(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[ui]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",oo(n)){const o=En(i,"width");o!==void 0&&(i.width=o)}if(oo(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=En(i,"height");o!==void 0&&(i.height=o)}return i}const ao=ul?{passive:!0}:!1;function gc(i,t,e){i.addEventListener(t,e,ao)}function uc(i,t,e){i.canvas.removeEventListener(t,e,ao)}function fc(i,t){const e=hc[i.type]||i.type,{x:s,y:n}=Zt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function fi(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function pc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||fi(r.addedNodes,s),a=a&&!fi(r.removedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function wc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||fi(r.removedNodes,s),a=a&&!fi(r.addedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Pe=new Map;let ro=0;function Ao(){const i=window.devicePixelRatio;i!==ro&&(ro=i,Pe.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function mc(i,t){Pe.size||window.addEventListener("resize",Ao),Pe.set(i,t)}function Mc(i){Pe.delete(i),Pe.size||window.removeEventListener("resize",Ao)}function Dc(i,t,e){const s=i.canvas,n=s&&_i(s);if(!n)return;const o=ln((r,A)=>{const l=n.clientWidth;e(r,A),l<n.clientWidth&&e()},window),a=new ResizeObserver(r=>{const A=r[0],l=A.contentRect.width,c=A.contentRect.height;l===0&&c===0||o(l,c)});return a.observe(n),mc(i,o),a}function as(i,t,e){e&&e.disconnect(),t==="resize"&&Mc(i)}function bc(i,t,e){const s=i.canvas,n=ln(o=>{i.ctx!==null&&e(fc(o,i))},i);return gc(s,t,n),n}class Bc extends no{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(dc(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[ui])return!1;const s=e[ui].initial;["height","width"].forEach(o=>{const a=s[o];z(a)?e.removeAttribute(o):e.setAttribute(o,a)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[ui],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:pc,detach:wc,resize:Dc}[e]||bc;n[e]=a(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:as,detach:as,resize:as}[e]||uc)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return gl(t,e,s,n)}isAttached(t){const e=_i(t);return!!(e&&e.isConnected)}}function Gc(i){return!vn()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?cc:Bc}class gt{constructor(){x(this,"x");x(this,"y");x(this,"active",!1);x(this,"options");x(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return oe(this.x)&&oe(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}x(gt,"defaults",{}),x(gt,"defaultRoutes");function Yc(i,t){const e=i.options.ticks,s=xc(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?yc(t):[],a=o.length,r=o[0],A=o[a-1],l=[];if(a>n)return vc(t,l,o,a/n),l;const c=Cc(o,t,n);if(a>0){let h,d;const g=a>1?Math.round((A-r)/(a-1)):null;for(pi(t,l,c,z(g)?0:r-g,r),h=0,d=a-1;h<d;h++)pi(t,l,c,o[h],o[h+1]);return pi(t,l,c,A,z(g)?t.length:A+g),l}return pi(t,l,c),l}function xc(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Cc(i,t,e){const s=Ic(i),n=t.length/e;if(!s)return Math.max(n,1);const o=wA(s);for(let a=0,r=o.length-1;a<r;a++){const A=o[a];if(A>n)return A}return Math.max(n,1)}function yc(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function vc(i,t,e,s){let n=0,o=e[0],a;for(s=Math.ceil(s),a=0;a<i.length;a++)a===o&&(t.push(i[a]),n++,o=e[n*s])}function pi(i,t,e,s,n){const o=E(s,0),a=Math.min(E(n,i.length),i.length);let r=0,A,l,c;for(e=Math.ceil(e),n&&(A=n-s,e=A/Math.floor(A/e)),c=o;c<0;)r++,c=Math.round(o+r*e);for(l=Math.max(o,0);l<a;l++)l===c&&(t.push(i[l]),r++,c=Math.round(o+r*e))}function Ic(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const Ec=i=>i==="left"?"right":i==="right"?"left":i,lo=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,co=(i,t)=>Math.min(t||i,i);function ho(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function kc(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,a=i._endPixel,r=1e-6;let A=i.getPixelForTick(n),l;if(!(e&&(s===1?l=Math.max(A-o,a-A):t===0?l=(i.getPixelForTick(1)-A)/2:l=(A-i.getPixelForTick(n-1))/2,A+=n<t?l:-l,A<o-r||A>a+r)))return A}function Qc(i,t){T(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function Oe(i){return i.drawTicks?i.tickLength:0}function go(i,t){if(!i.display)return 0;const e=J(i.font,t),s=tt(i.padding);return(F(i.text)?i.text.length:1)*e.lineHeight+s.height}function Pc(i,t){return zt(i,{scale:t,type:"scale"})}function Oc(i,t,e){return zt(i,{tick:e,index:t,type:"tick"})}function zc(i,t,e){let s=Vi(i);return(e&&t!=="right"||!e&&t==="right")&&(s=Ec(s)),s}function Tc(i,t,e,s){const{top:n,left:o,bottom:a,right:r,chart:A}=i,{chartArea:l,scales:c}=A;let h=0,d,g,u;const f=a-n,w=r-o;if(i.isHorizontal()){if(g=$(s,o,r),P(e)){const m=Object.keys(e)[0],D=e[m];u=c[m].getPixelForValue(D)+f-t}else e==="center"?u=(l.bottom+l.top)/2+f-t:u=lo(i,e,t);d=r-o}else{if(P(e)){const m=Object.keys(e)[0],D=e[m];g=c[m].getPixelForValue(D)-w+t}else e==="center"?g=(l.left+l.right)/2-w+t:g=lo(i,e,t);u=$(s,a,n),h=e==="left"?-U:U}return{titleX:g,titleY:u,maxWidth:d,rotation:h}}class Jt extends gt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=rt(t,Number.POSITIVE_INFINITY),e=rt(e,Number.NEGATIVE_INFINITY),s=rt(s,Number.POSITIVE_INFINITY),n=rt(n,Number.NEGATIVE_INFINITY),{min:rt(t,s),max:rt(e,n),minDefined:W(t),maxDefined:W(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),a;if(n&&o)return{min:e,max:s};const r=this.getMatchingVisibleMetas();for(let A=0,l=r.length;A<l;++A)a=r[A].controller.getMinMax(this,t),n||(e=Math.min(e,a.min)),o||(s=Math.max(s,a.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:rt(e,rt(s,e)),max:rt(s,rt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){S(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=WA(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const A=r<this.ticks.length;this._convertTicksToLabels(A?ho(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Yc(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),A&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){S(this.options.afterUpdate,[this])}beforeSetDimensions(){S(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){S(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),S(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){S(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=S(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){S(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){S(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=co(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let a=n,r,A,l;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,g=q(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/s:g/(s-1),h+6>r&&(r=g/(s-(t.offset?.5:1)),A=this.maxHeight-Oe(t.grid)-e.padding-go(t.title,this.chart.options.font),l=Math.sqrt(h*h+d*d),a=Ri(Math.min(Math.asin(q((c.highest.height+6)/r,-1,1)),Math.asin(q(A/l,-1,1))-Math.asin(q(d/l,-1,1)))),a=Math.max(n,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){S(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){S(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const A=go(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Oe(o)+A):(t.height=this.maxHeight,t.width=Oe(o)+A),s.display&&this.ticks.length){const{first:l,last:c,widest:h,highest:d}=this._getLabelSizes(),g=s.padding*2,u=ht(this.labelRotation),f=Math.cos(u),w=Math.sin(u);if(r){const m=s.mirror?0:w*h.width+f*d.height;t.height=Math.min(this.maxHeight,t.height+m+g)}else{const m=s.mirror?0:f*h.width+w*d.height;t.width=Math.min(this.maxWidth,t.width+m+g)}this._calculatePadding(l,c,w,f)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:a},position:r}=this.options,A=this.labelRotation!==0,l=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,g=0;A?l?(d=n*t.width,g=s*e.height):(d=s*t.height,g=n*e.width):o==="start"?g=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,g=e.width/2),this.paddingLeft=Math.max((d-c+a)*this.width/(this.width-c),0),this.paddingRight=Math.max((g-h+a)*this.width/(this.width-h),0)}else{let c=e.height/2,h=t.height/2;o==="start"?(c=0,h=t.height):o==="end"&&(c=e.height,h=0),this.paddingTop=c+a,this.paddingBottom=h+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){S(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)z(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=ho(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,a=[],r=[],A=Math.floor(e/co(e,s));let l=0,c=0,h,d,g,u,f,w,m,D,Y,G,B;for(h=0;h<e;h+=A){if(u=t[h].label,f=this._resolveTickFontOptions(h),n.font=w=f.string,m=o[w]=o[w]||{data:{},gc:[]},D=f.lineHeight,Y=G=0,!z(u)&&!F(u))Y=ei(n,m.data,m.gc,Y,u),G=D;else if(F(u))for(d=0,g=u.length;d<g;++d)B=u[d],!z(B)&&!F(B)&&(Y=ei(n,m.data,m.gc,Y,B),G+=D);a.push(Y),r.push(G),l=Math.max(Y,l),c=Math.max(G,c)}Qc(o,e);const C=a.indexOf(l),y=r.indexOf(c),v=I=>({width:a[I]||0,height:r[I]||0});return{first:v(0),last:v(e-1),widest:v(C),highest:v(y),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return DA(this._alignToPixels?Vt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=Oc(this.getContext(),t,s))}return this.$context||(this.$context=Pc(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ht(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,A=o?o.highest.height+a:0;return this.isHorizontal()?A*s>r*n?r/s:A/n:A*n<r*s?A/s:r/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:a,border:r}=n,A=o.offset,l=this.isHorizontal(),h=this.ticks.length+(A?1:0),d=Oe(o),g=[],u=r.setContext(this.getContext()),f=u.display?u.width:0,w=f/2,m=function(N){return Vt(s,N,f)};let D,Y,G,B,C,y,v,I,k,Q,O,_;if(a==="top")D=m(this.bottom),y=this.bottom-d,I=D-w,Q=m(t.top)+w,_=t.bottom;else if(a==="bottom")D=m(this.top),Q=t.top,_=m(t.bottom)-w,y=D+w,I=this.top+d;else if(a==="left")D=m(this.right),C=this.right-d,v=D-w,k=m(t.left)+w,O=t.right;else if(a==="right")D=m(this.left),k=t.left,O=m(t.right)-w,C=D+w,v=this.left+d;else if(e==="x"){if(a==="center")D=m((t.top+t.bottom)/2+.5);else if(P(a)){const N=Object.keys(a)[0],K=a[N];D=m(this.chart.scales[N].getPixelForValue(K))}Q=t.top,_=t.bottom,y=D+w,I=y+d}else if(e==="y"){if(a==="center")D=m((t.left+t.right)/2);else if(P(a)){const N=Object.keys(a)[0],K=a[N];D=m(this.chart.scales[N].getPixelForValue(K))}C=D-w,v=C-d,k=t.left,O=t.right}const lt=E(n.ticks.maxTicksLimit,h),L=Math.max(1,Math.ceil(h/lt));for(Y=0;Y<h;Y+=L){const N=this.getContext(Y),K=o.setContext(N),ut=r.setContext(N),it=K.lineWidth,ce=K.color,Ei=ut.dash||[],he=ut.dashOffset,He=K.tickWidth,Ve=K.tickColor,Ne=K.tickBorderDash||[],je=K.tickBorderDashOffset;G=kc(this,Y,A),G!==void 0&&(B=Vt(s,G,it),l?C=v=k=O=B:y=I=Q=_=B,g.push({tx1:C,ty1:y,tx2:v,ty2:I,x1:k,y1:Q,x2:O,y2:_,width:it,color:ce,borderDash:Ei,borderDashOffset:he,tickWidth:He,tickColor:Ve,tickBorderDash:Ne,tickBorderDashOffset:je}))}return this._ticksLength=h,this._borderValue=D,g}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,a=this.isHorizontal(),r=this.ticks,{align:A,crossAlign:l,padding:c,mirror:h}=o,d=Oe(s.grid),g=d+c,u=h?-c:g,f=-ht(this.labelRotation),w=[];let m,D,Y,G,B,C,y,v,I,k,Q,O,_="middle";if(n==="top")C=this.bottom-u,y=this._getXAxisLabelAlignment();else if(n==="bottom")C=this.top+u,y=this._getXAxisLabelAlignment();else if(n==="left"){const L=this._getYAxisLabelAlignment(d);y=L.textAlign,B=L.x}else if(n==="right"){const L=this._getYAxisLabelAlignment(d);y=L.textAlign,B=L.x}else if(e==="x"){if(n==="center")C=(t.top+t.bottom)/2+g;else if(P(n)){const L=Object.keys(n)[0],N=n[L];C=this.chart.scales[L].getPixelForValue(N)+g}y=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")B=(t.left+t.right)/2-g;else if(P(n)){const L=Object.keys(n)[0],N=n[L];B=this.chart.scales[L].getPixelForValue(N)}y=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(A==="start"?_="top":A==="end"&&(_="bottom"));const lt=this._getLabelSizes();for(m=0,D=r.length;m<D;++m){Y=r[m],G=Y.label;const L=o.setContext(this.getContext(m));v=this.getPixelForTick(m)+o.labelOffset,I=this._resolveTickFontOptions(m),k=I.lineHeight,Q=F(G)?G.length:1;const N=Q/2,K=L.color,ut=L.textStrokeColor,it=L.textStrokeWidth;let ce=y;a?(B=v,y==="inner"&&(m===D-1?ce=this.options.reverse?"left":"right":m===0?ce=this.options.reverse?"right":"left":ce="center"),n==="top"?l==="near"||f!==0?O=-Q*k+k/2:l==="center"?O=-lt.highest.height/2-N*k+k:O=-lt.highest.height+k/2:l==="near"||f!==0?O=k/2:l==="center"?O=lt.highest.height/2-N*k:O=lt.highest.height-Q*k,h&&(O*=-1),f!==0&&!L.showLabelBackdrop&&(B+=k/2*Math.sin(f))):(C=v,O=(1-Q)*k/2);let Ei;if(L.showLabelBackdrop){const he=tt(L.backdropPadding),He=lt.heights[m],Ve=lt.widths[m];let Ne=O-he.top,je=0-he.left;switch(_){case"middle":Ne-=He/2;break;case"bottom":Ne-=He;break}switch(y){case"center":je-=Ve/2;break;case"right":je-=Ve;break}Ei={left:je,top:Ne,width:Ve+he.width,height:He+he.height,color:L.backdropColor}}w.push({label:G,font:I,textOffset:O,options:{rotation:f,color:K,strokeColor:ut,strokeWidth:it,textAlign:ce,textBaseline:_,translation:[B,C],backdrop:Ei}})}return w}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ht(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,A=a.widest.width;let l,c;return e==="left"?n?(c=this.right+o,s==="near"?l="left":s==="center"?(l="center",c+=A/2):(l="right",c+=A)):(c=this.right-r,s==="near"?l="right":s==="center"?(l="center",c-=A/2):(l="left",c=this.left)):e==="right"?n?(c=this.left+o,s==="near"?l="right":s==="center"?(l="center",c-=A/2):(l="left",c-=A)):(c=this.left+r,s==="near"?l="left":s==="center"?(l="center",c+=A/2):(l="right",c=this.right)):l="right",{textAlign:l,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(A,l,c)=>{!c.width||!c.color||(s.save(),s.lineWidth=c.width,s.strokeStyle=c.color,s.setLineDash(c.borderDash||[]),s.lineDashOffset=c.borderDashOffset,s.beginPath(),s.moveTo(A.x,A.y),s.lineTo(l.x,l.y),s.stroke(),s.restore())};if(e.display)for(o=0,a=n.length;o<a;++o){const A=n[o];e.drawOnChartArea&&r({x:A.x1,y:A.y1},{x:A.x2,y:A.y2},A),e.drawTicks&&r({x:A.tx1,y:A.ty1},{x:A.tx2,y:A.ty2},{color:A.tickColor,width:A.tickWidth,borderDash:A.tickBorderDash,borderDashOffset:A.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;const r=n.setContext(this.getContext(0)).lineWidth,A=this._borderValue;let l,c,h,d;this.isHorizontal()?(l=Vt(t,this.left,a)-a/2,c=Vt(t,this.right,r)+r/2,h=d=A):(h=Vt(t,this.top,a)-a/2,d=Vt(t,this.bottom,r)+r/2,l=c=A),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(l,h),e.lineTo(c,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&ii(s,n);const o=this.getLabelItems(t);for(const a of o){const r=a.options,A=a.font,l=a.label,c=a.textOffset;Nt(s,l,0,c,A,r)}n&&si(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=J(s.font),a=tt(s.padding),r=s.align;let A=o.lineHeight/2;e==="bottom"||e==="center"||P(e)?(A+=a.bottom,F(s.text)&&(A+=o.lineHeight*(s.text.length-1))):A+=a.top;const{titleX:l,titleY:c,maxWidth:h,rotation:d}=Tc(this,A,e,r);Nt(t,s.text,0,0,o,{color:s.color,maxWidth:h,rotation:d,textAlign:zc(r,e,n),textBaseline:"middle",translation:[l,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=E(t.grid&&t.grid.z,-1),n=E(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Jt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[s]===this.id&&(!t||r.type===t)&&n.push(r)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return J(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class wi{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;Rc(e)&&(s=this.register(e));const n=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,Lc(t,a,s),this.override&&Z.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in Z[n]&&(delete Z[n][s],this.override&&delete Ht[s])}}function Lc(i,t,e){const s=we(Object.create(null),[e?Z.get(e):{},Z.get(t),i.defaults]);Z.set(t,s),i.defaultRoutes&&Sc(t,i.defaultRoutes),i.descriptors&&Z.describe(t,i.descriptors)}function Sc(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),a=t[e].split("."),r=a.pop(),A=a.join(".");Z.route(o,n,A,r)})}function Rc(i){return"id"in i&&"defaults"in i}class Fc{constructor(){this.controllers=new wi(dt,"datasets",!0),this.elements=new wi(gt,"elements"),this.plugins=new wi(Object,"plugins"),this.scales=new wi(Jt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):T(n,a=>{const r=s||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,s){const n=Si(t);S(s["before"+n],[],s),e[t](s),S(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var mt=new Fc;class Hc{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),a=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,s,n){n=n||{};for(const o of t){const a=o.plugin,r=a[s],A=[e,n,o.options];if(S(r,A,a)===!1&&n.cancelable)return!1}return!0}invalidate(){z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=E(s.options&&s.options.plugins,{}),o=Vc(s);return n===!1&&!e?[]:jc(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,a)=>o.filter(r=>!a.some(A=>r.plugin.id===A.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function Vc(i){const t={},e=[],s=Object.keys(mt.plugins.items);for(let o=0;o<s.length;o++)e.push(mt.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const a=n[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function Nc(i,t){return!t&&i===!1?null:i===!0?{}:i}function jc(i,{plugins:t,localIds:e},s,n){const o=[],a=i.getContext();for(const r of t){const A=r.id,l=Nc(s[A],n);l!==null&&o.push({plugin:r,options:Wc(i.config,{plugin:r,local:e[A]},l,a)})}return o}function Wc(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),a=i.getOptionScopes(s,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function rs(i,t){const e=Z.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Zc(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Uc(i,t){return i===t?"_index_":"_value_"}function uo(i){if(i==="x"||i==="y"||i==="r")return i}function Kc(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function As(i,...t){if(uo(i))return i;for(const e of t){const s=e.axis||Kc(e.position)||i.length>1&&uo(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function fo(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Xc(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return fo(i,"x",e[0])||fo(i,"y",e[0])}return{}}function Jc(i,t){const e=Ht[i.type]||{scales:{}},s=t.scales||{},n=rs(i.type,t),o=Object.create(null);return Object.keys(s).forEach(a=>{const r=s[a];if(!P(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const A=As(a,r,Xc(a,i),Z.scales[r.type]),l=Uc(A,n),c=e.scales||{};o[a]=me(Object.create(null),[{axis:A},r,c[A],c[l]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,A=a.indexAxis||rs(r,t),c=(Ht[r]||{}).scales||{};Object.keys(c).forEach(h=>{const d=Zc(h,A),g=a[d+"AxisID"]||d;o[g]=o[g]||Object.create(null),me(o[g],[{axis:d},s[g],c[h]])})}),Object.keys(o).forEach(a=>{const r=o[a];me(r,[Z.scales[r.type],Z.scale])}),o}function po(i){const t=i.options||(i.options={});t.plugins=E(t.plugins,{}),t.scales=Jc(i,t)}function wo(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function qc(i){return i=i||{},i.data=wo(i.data),po(i),i}const mo=new Map,Mo=new Set;function mi(i,t){let e=mo.get(i);return e||(e=t(),mo.set(i,e),Mo.add(e)),e}const ze=(i,t,e)=>{const s=Qt(t,e);s!==void 0&&i.add(s)};class _c{constructor(t){this._config=qc(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=wo(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),po(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return mi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return mi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return mi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return mi(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,a=this._cachedScopes(t,s),r=a.get(e);if(r)return r;const A=new Set;e.forEach(c=>{t&&(A.add(t),c.forEach(h=>ze(A,t,h))),c.forEach(h=>ze(A,n,h)),c.forEach(h=>ze(A,Ht[o]||{},h)),c.forEach(h=>ze(A,Z,h)),c.forEach(h=>ze(A,Wi,h))});const l=Array.from(A);return l.length===0&&l.push(Object.create(null)),Mo.has(e)&&a.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Z.datasets[e]||{},{type:e},Z,Wi]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Do(this._resolverCache,t,n);let A=a;if(th(a,e)){o.$shared=!1,s=Pt(s)?s():s;const l=this.createResolver(t,s,r);A=ae(a,s,l)}for(const l of e)o[l]=A[l];return o}createResolver(t,e,s=[""],n){const{resolver:o}=Do(this._resolverCache,t,s);return P(e)?ae(o,e,void 0,n):o}}function Do(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:Xi(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},s.set(n,o)),o}const $c=i=>P(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||Pt(i[e]),!1);function th(i,t){const{isScriptable:e,isIndexable:s}=Dn(i);for(const n of t){const o=e(n),a=s(n),r=(a||o)&&i[n];if(o&&(Pt(r)||$c(r))||a&&F(r))return!0}return!1}var eh="4.4.0";const ih=["top","bottom","left","right","chartArea"];function bo(i,t){return i==="top"||i==="bottom"||ih.indexOf(i)===-1&&t==="x"}function Bo(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Go(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),S(e&&e.onComplete,[i],t)}function sh(i){const t=i.chart,e=t.options.animation;S(e&&e.onProgress,[i],t)}function Yo(i){return vn()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Mi={},xo=i=>{const t=Yo(i);return Object.values(Mi).filter(e=>e.canvas===t).pop()};function nh(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const a=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=a)}}}function oh(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function Di(i,t,e){return i.options.clip?i[e]:t[e]}function ah(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:Di(e,t,"left"),right:Di(e,t,"right"),top:Di(s,t,"top"),bottom:Di(s,t,"bottom")}:t}class yt{static register(...t){mt.add(...t),Co()}static unregister(...t){mt.remove(...t),Co()}constructor(t,e){const s=this.config=new _c(e),n=Yo(t),o=xo(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Gc(n)),this.platform.updateConfig(s);const r=this.platform.acquireContext(n,a.aspectRatio),A=r&&r.canvas,l=A&&A.height,c=A&&A.width;if(this.id=AA(),this.ctx=r,this.canvas=A,this.width=c,this.height=l,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=YA(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Mi[this.id]=this,!r||!A){console.error("Failed to create chart: can't acquire context from the given item");return}Ct.listen(this,"complete",Go),Ct.listen(this,"progress",sh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return z(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return mt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():In(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return wn(this.canvas,this.ctx),this}stop(){return Ct.stop(this),this}resize(t,e){Ct.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=s.devicePixelRatio||this.platform.getDevicePixelRatio(),A=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,In(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),S(s.onResize,[this,a],this),this.attached&&this._doResize(A)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};T(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],A=As(a,r),l=A==="r",c=A==="x";return{options:r,dposition:l?"chartArea":c?"bottom":"left",dtype:l?"radialLinear":c?"category":"linear"}}))),T(o,a=>{const r=a.options,A=r.id,l=As(A,r),c=E(r.type,a.dtype);(r.position===void 0||bo(r.position,l)!==bo(a.dposition))&&(r.position=a.dposition),n[A]=!0;let h=null;if(A in s&&s[A].type===c)h=s[A];else{const d=mt.getScale(c);h=new d({id:A,type:c,ctx:this.ctx,chart:this}),s[h.id]=h}h.init(r,t)}),T(n,(a,r)=>{a||delete s[r]}),T(s,a=>{et.configure(this,a,a.options),et.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Bo("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let a=this.getDatasetMeta(s);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=r,a.indexAxis=o.indexAxis||rs(r,this.options),a.order=o.order||0,a.index=s,a.label=""+o.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{const A=mt.getController(r),{datasetElementType:l,dataElementType:c}=Z.datasets[r];Object.assign(A,{dataElementType:mt.getElement(c),datasetElementType:l&&mt.getElement(l)}),a.controller=new A(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){T(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let l=0,c=this.data.datasets.length;l<c;l++){const{controller:h}=this.getDatasetMeta(l),d=!n&&o.indexOf(h)===-1;h.buildOrUpdateElements(d),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),n||T(o,l=>{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Bo("z","_idx"));const{_active:r,_lastEvent:A}=this;A?this._eventHandler(A,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){T(this.scales,t=>{et.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!_s(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const a=s==="_removeElements"?-o:o;nh(t,n,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!_s(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;et.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],T(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,Pt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ct.has(this)?this.attached&&!Ct.running(this)&&Ct.start(this):(this.draw(),Go({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resize(s,n),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const a=e[n];(!t||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=ah(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(n&&ii(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&si(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return xt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=ic.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=zt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);Me(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(o,{visible:s}),this.update(r=>r.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ct.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),wn(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Mi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},n=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};T(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(A,l)=>{e.addEventListener(this,A,l),t[A]=l},n=(A,l)=>{t[A]&&(e.removeEventListener(this,A,l),delete t[A])},o=(A,l)=>{this.canvas&&this.resize(A,l)};let a;const r=()=>{n("attach",r),this.attached=!0,this.resize(),s("resize",o),s("detach",a)};a=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){T(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},T(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,a,r,A;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),r=0,A=t.length;r<A;++r){a=t[r];const l=a&&this.getDatasetMeta(a.datasetIndex).controller;l&&l[n+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!Je(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(A,l)=>A.filter(c=>!l.some(h=>c.datasetIndex===h.datasetIndex&&c.index===h.index)),a=o(e,t),r=s?t:o(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,s,a),A=uA(t),l=oh(t,this._lastEvent,s,A);s&&(this._lastEvent=null,S(o.onHover,[t,r,this],this),A&&S(o.onClick,[t,r,this],this));const c=!Je(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}x(yt,"defaults",Z),x(yt,"instances",Mi),x(yt,"overrides",Ht),x(yt,"registry",mt),x(yt,"version",eh),x(yt,"getChart",xo);function Co(){return T(yt.instances,i=>i._plugins.invalidate())}function rh(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:A}=t;let l=n/r;i.beginPath(),i.arc(o,a,r,s-l,e+l),A>n?(l=n/A,i.arc(o,a,A,e+l,s-l,!0)):i.arc(o,a,n,e+U,s-U),i.closePath(),i.clip()}function Ah(i){return Ki(i,["outerStart","outerEnd","innerStart","innerEnd"])}function lh(i,t,e,s){const n=Ah(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,s*t/2),r=A=>{const l=(e-Math.min(o,A))*s/2;return q(A,0,Math.min(o,l))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:q(n.innerStart,0,a),innerEnd:q(n.innerEnd,0,a)}}function le(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function bi(i,t,e,s,n,o){const{x:a,y:r,startAngle:A,pixelMargin:l,innerRadius:c}=t,h=Math.max(t.outerRadius+s+e-l,0),d=c>0?c+s+e+l:0;let g=0;const u=n-A;if(s){const L=c>0?c-s:0,N=h>0?h-s:0,K=(L+N)/2,ut=K!==0?u*K/(K+s):u;g=(u-ut)/2}const f=Math.max(.001,u*h-e/H)/h,w=(u-f)/2,m=A+w+g,D=n-w-g,{outerStart:Y,outerEnd:G,innerStart:B,innerEnd:C}=lh(t,d,h,D-m),y=h-Y,v=h-G,I=m+Y/y,k=D-G/v,Q=d+B,O=d+C,_=m+B/Q,lt=D-C/O;if(i.beginPath(),o){const L=(I+k)/2;if(i.arc(a,r,h,I,L),i.arc(a,r,h,L,k),G>0){const it=le(v,k,a,r);i.arc(it.x,it.y,G,k,D+U)}const N=le(O,D,a,r);if(i.lineTo(N.x,N.y),C>0){const it=le(O,lt,a,r);i.arc(it.x,it.y,C,D+U,lt+Math.PI)}const K=(D-C/d+(m+B/d))/2;if(i.arc(a,r,d,D-C/d,K,!0),i.arc(a,r,d,K,m+B/d,!0),B>0){const it=le(Q,_,a,r);i.arc(it.x,it.y,B,_+Math.PI,m-U)}const ut=le(y,m,a,r);if(i.lineTo(ut.x,ut.y),Y>0){const it=le(y,I,a,r);i.arc(it.x,it.y,Y,m-U,I)}}else{i.moveTo(a,r);const L=Math.cos(I)*h+a,N=Math.sin(I)*h+r;i.lineTo(L,N);const K=Math.cos(k)*h+a,ut=Math.sin(k)*h+r;i.lineTo(K,ut)}i.closePath()}function ch(i,t,e,s,n){const{fullCircles:o,startAngle:a,circumference:r}=t;let A=t.endAngle;if(o){bi(i,t,e,s,A,n);for(let l=0;l<o;++l)i.fill();isNaN(r)||(A=a+(r%V||V))}return bi(i,t,e,s,A,n),i.fill(),A}function hh(i,t,e,s,n){const{fullCircles:o,startAngle:a,circumference:r,options:A}=t,{borderWidth:l,borderJoinStyle:c,borderDash:h,borderDashOffset:d}=A,g=A.borderAlign==="inner";if(!l)return;i.setLineDash(h||[]),i.lineDashOffset=d,g?(i.lineWidth=l*2,i.lineJoin=c||"round"):(i.lineWidth=l,i.lineJoin=c||"bevel");let u=t.endAngle;if(o){bi(i,t,e,s,u,n);for(let f=0;f<o;++f)i.stroke();isNaN(r)||(u=a+(r%V||V))}g&&rh(i,t,u),o||(bi(i,t,e,s,u,n),i.stroke())}class Te extends gt{constructor(e){super();x(this,"circumference");x(this,"endAngle");x(this,"fullCircles");x(this,"innerRadius");x(this,"outerRadius");x(this,"pixelMargin");x(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,s,n){const o=this.getProps(["x","y"],n),{angle:a,distance:r}=nn(o,{x:e,y:s}),{startAngle:A,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),g=(this.options.spacing+this.options.borderWidth)/2,f=E(d,l-A)>=V||be(a,A,l),w=Gt(r,c+g,h+g);return f&&w}getCenterPoint(e){const{x:s,y:n,startAngle:o,endAngle:a,innerRadius:r,outerRadius:A}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:l,spacing:c}=this.options,h=(o+a)/2,d=(r+A+c+l)/2;return{x:s+Math.cos(h)*d,y:n+Math.sin(h)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:s,circumference:n}=this,o=(s.offset||0)/4,a=(s.spacing||0)/2,r=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=n>V?Math.floor(n/V):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const A=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(A)*o,Math.sin(A)*o);const l=1-Math.sin(Math.min(H,n||0)),c=o*l;e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,ch(e,this,c,a,r),hh(e,this,c,a,r),e.restore()}}x(Te,"id","arc"),x(Te,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),x(Te,"defaultRoutes",{backgroundColor:"backgroundColor"}),x(Te,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function yo(i,t,e=t){i.lineCap=E(e.borderCapStyle,t.borderCapStyle),i.setLineDash(E(e.borderDash,t.borderDash)),i.lineDashOffset=E(e.borderDashOffset,t.borderDashOffset),i.lineJoin=E(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=E(e.borderWidth,t.borderWidth),i.strokeStyle=E(e.borderColor,t.borderColor)}function dh(i,t,e){i.lineTo(e.x,e.y)}function gh(i){return i.stepped?TA:i.tension||i.cubicInterpolationMode==="monotone"?LA:dh}function vo(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:a,end:r}=t,A=Math.max(n,a),l=Math.min(o,r),c=n<a&&o<a||n>r&&o>r;return{count:s,start:A,loop:t.loop,ilen:l<A&&!c?s+l-A:l-A}}function uh(i,t,e,s){const{points:n,options:o}=t,{count:a,start:r,loop:A,ilen:l}=vo(n,e,s),c=gh(o);let{move:h=!0,reverse:d}=s||{},g,u,f;for(g=0;g<=l;++g)u=n[(r+(d?l-g:g))%a],!u.skip&&(h?(i.moveTo(u.x,u.y),h=!1):c(i,f,u,d,o.stepped),f=u);return A&&(u=n[(r+(d?l:0))%a],c(i,f,u,d,o.stepped)),!!A}function fh(i,t,e,s){const n=t.points,{count:o,start:a,ilen:r}=vo(n,e,s),{move:A=!0,reverse:l}=s||{};let c=0,h=0,d,g,u,f,w,m;const D=G=>(a+(l?r-G:G))%o,Y=()=>{f!==w&&(i.lineTo(c,w),i.lineTo(c,f),i.lineTo(c,m))};for(A&&(g=n[D(0)],i.moveTo(g.x,g.y)),d=0;d<=r;++d){if(g=n[D(d)],g.skip)continue;const G=g.x,B=g.y,C=G|0;C===u?(B<f?f=B:B>w&&(w=B),c=(h*c+G)/++h):(Y(),i.lineTo(G,B),u=C,h=0,f=w=B),m=B}Y()}function ls(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?fh:uh}function ph(i){return i.stepped?fl:i.tension||i.cubicInterpolationMode==="monotone"?pl:Ut}function wh(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),yo(i,t.options),i.stroke(n)}function mh(i,t,e,s){const{segments:n,options:o}=t,a=ls(t);for(const r of n)yo(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Mh=typeof Path2D=="function";function Dh(i,t,e,s){Mh&&!t.options.segment?wh(i,t,e,s):mh(i,t,e,s)}class Tt extends gt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;rl(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Bl(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,a=Tn(this,{property:e,start:n,end:n});if(!a.length)return;const r=[],A=ph(s);let l,c;for(l=0,c=a.length;l<c;++l){const{start:h,end:d}=a[l],g=o[h],u=o[d];if(g===u){r.push(g);continue}const f=Math.abs((n-g[e])/(u[e]-g[e])),w=A(g,u,f,s.stepped);w[e]=t[e],r.push(w)}return r.length===1?r[0]:r}pathSegment(t,e,s){return ls(this)(t,this,e,s)}path(t,e,s){const n=this.segments,o=ls(this);let a=this._loop;e=e||0,s=s||this.points.length-e;for(const r of n)a&=o(t,this,r,{start:e,end:e+s-1});return!!a}draw(t,e,s,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Dh(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}x(Tt,"id","line"),x(Tt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),x(Tt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),x(Tt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Io(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}class Bi extends gt{constructor(e){super();x(this,"parsed");x(this,"skip");x(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,s,n){const o=this.options,{x:a,y:r}=this.getProps(["x","y"],n);return Math.pow(e-a,2)+Math.pow(s-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,s){return Io(this,e,"x",s)}inYRange(e,s){return Io(this,e,"y",s)}getCenterPoint(e){const{x:s,y:n}=this.getProps(["x","y"],e);return{x:s,y:n}}size(e){e=e||this.options||{};let s=e.radius||0;s=Math.max(s,s&&e.hoverRadius||0);const n=s&&e.borderWidth||0;return(s+n)*2}draw(e,s){const n=this.options;this.skip||n.radius<.1||!xt(this,s,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Ui(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}x(Bi,"id","point"),x(Bi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),x(Bi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Eo(i,t){const{x:e,y:s,base:n,width:o,height:a}=i.getProps(["x","y","base","width","height"],t);let r,A,l,c,h;return i.horizontal?(h=a/2,r=Math.min(e,n),A=Math.max(e,n),l=s-h,c=s+h):(h=o/2,r=e-h,A=e+h,l=Math.min(s,n),c=Math.max(s,n)),{left:r,top:l,right:A,bottom:c}}function Lt(i,t,e,s){return i?0:q(t,e,s)}function bh(i,t,e){const s=i.options.borderWidth,n=i.borderSkipped,o=Mn(s);return{t:Lt(n.top,o.top,0,e),r:Lt(n.right,o.right,0,t),b:Lt(n.bottom,o.bottom,0,e),l:Lt(n.left,o.left,0,t)}}function Bh(i,t,e){const{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,o=jt(n),a=Math.min(t,e),r=i.borderSkipped,A=s||P(n);return{topLeft:Lt(!A||r.top||r.left,o.topLeft,0,a),topRight:Lt(!A||r.top||r.right,o.topRight,0,a),bottomLeft:Lt(!A||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Lt(!A||r.bottom||r.right,o.bottomRight,0,a)}}function Gh(i){const t=Eo(i),e=t.right-t.left,s=t.bottom-t.top,n=bh(i,e/2,s/2),o=Bh(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function cs(i,t,e,s){const n=t===null,o=e===null,r=i&&!(n&&o)&&Eo(i,s);return r&&(n||Gt(t,r.left,r.right))&&(o||Gt(e,r.top,r.bottom))}function Yh(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function xh(i,t){i.rect(t.x,t.y,t.w,t.h)}function hs(i,t,e={}){const s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-s,a=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+a,radius:i.radius}}class Gi extends gt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:s,backgroundColor:n}}=this,{inner:o,outer:a}=Gh(this),r=Yh(a.radius)?xe:xh;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,hs(a,e,o)),t.clip(),r(t,hs(o,-e,a)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),r(t,hs(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return cs(this,t,e,s)}inXRange(t,e){return cs(this,t,null,e)}inYRange(t,e){return cs(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}x(Gi,"id","bar"),x(Gi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),x(Gi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Ch=Object.freeze({__proto__:null,ArcElement:Te,BarElement:Gi,LineElement:Tt,PointElement:Bi});const ds=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ko=ds.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function Qo(i){return ds[i%ds.length]}function Po(i){return ko[i%ko.length]}function yh(i,t){return i.borderColor=Qo(t),i.backgroundColor=Po(t),++t}function vh(i,t){return i.backgroundColor=i.data.map(()=>Qo(t++)),t}function Ih(i,t){return i.backgroundColor=i.data.map(()=>Po(t++)),t}function Eh(i){let t=0;return(e,s)=>{const n=i.getDatasetMeta(s).controller;n instanceof Kt?t=vh(e,t):n instanceof ve?t=Ih(e,t):n&&(t=yh(e,t))}}function Oo(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function kh(i){return i&&(i.borderColor||i.backgroundColor)}var Qh={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;const{data:{datasets:s},options:n}=i.config,{elements:o}=n;if(!e.forceOverride&&(Oo(s)||kh(n)||o&&Oo(o)))return;const a=Eh(i);s.forEach(a)}};function Ph(i,t,e,s,n){const o=n.samples||s;if(o>=e)return i.slice(t,t+e);const a=[],r=(e-2)/(o-2);let A=0;const l=t+e-1;let c=t,h,d,g,u,f;for(a[A++]=i[c],h=0;h<o-2;h++){let w=0,m=0,D;const Y=Math.floor((h+1)*r)+1+t,G=Math.min(Math.floor((h+2)*r)+1,e)+t,B=G-Y;for(D=Y;D<G;D++)w+=i[D].x,m+=i[D].y;w/=B,m/=B;const C=Math.floor(h*r)+1+t,y=Math.min(Math.floor((h+1)*r)+1,e)+t,{x:v,y:I}=i[c];for(g=u=-1,D=C;D<y;D++)u=.5*Math.abs((v-w)*(i[D].y-I)-(v-i[D].x)*(m-I)),u>g&&(g=u,d=i[D],f=D);a[A++]=d,c=f}return a[A++]=i[l],a}function Oh(i,t,e,s){let n=0,o=0,a,r,A,l,c,h,d,g,u,f;const w=[],m=t+e-1,D=i[t].x,G=i[m].x-D;for(a=t;a<t+e;++a){r=i[a],A=(r.x-D)/G*s,l=r.y;const B=A|0;if(B===c)l<u?(u=l,h=a):l>f&&(f=l,d=a),n=(o*n+r.x)/++o;else{const C=a-1;if(!z(h)&&!z(d)){const y=Math.min(h,d),v=Math.max(h,d);y!==g&&y!==C&&w.push({...i[y],x:n}),v!==g&&v!==C&&w.push({...i[v],x:n})}a>0&&C!==g&&w.push(i[C]),w.push(r),c=B,o=0,u=f=l,h=d=g=a}}return w}function zo(i){if(i._decimated){const t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function To(i){i.data.datasets.forEach(t=>{zo(t)})}function zh(i,t){const e=t.length;let s=0,n;const{iScale:o}=i,{min:a,max:r,minDefined:A,maxDefined:l}=o.getUserBounds();return A&&(s=q(Yt(t,o.axis,a).lo,0,e-1)),l?n=q(Yt(t,o.axis,r).hi+1,s,e)-s:n=e-s,{start:s,count:n}}var Th={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){To(i);return}const s=i.width;i.data.datasets.forEach((n,o)=>{const{_data:a,indexAxis:r}=n,A=i.getDatasetMeta(o),l=a||n.data;if(Ce([r,i.options.indexAxis])==="y"||!A.controller.supportsDecimation)return;const c=i.scales[A.xAxisID];if(c.type!=="linear"&&c.type!=="time"||i.options.parsing)return;let{start:h,count:d}=zh(A,l);const g=e.threshold||4*s;if(d<=g){zo(n);return}z(a)&&(n._data=l,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(f){this._data=f}}));let u;switch(e.algorithm){case"lttb":u=Ph(l,h,d,s,e);break;case"min-max":u=Oh(l,h,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=u})},destroy(i){To(i)}};function Lh(i,t,e){const s=i.segments,n=i.points,o=t.points,a=[];for(const r of s){let{start:A,end:l}=r;l=us(A,l,n);const c=gs(e,n[A],n[l],r.loop);if(!t.segments){a.push({source:r,target:c,start:n[A],end:n[l]});continue}const h=Tn(t,c);for(const d of h){const g=gs(e,o[d.start],o[d.end],d.loop),u=zn(r,n,g);for(const f of u)a.push({source:f,target:d,start:{[e]:Lo(c,g,"start",Math.max)},end:{[e]:Lo(c,g,"end",Math.min)}})}}return a}function gs(i,t,e,s){if(s)return;let n=t[i],o=e[i];return i==="angle"&&(n=At(n),o=At(o)),{property:i,start:n,end:o}}function Sh(i,t){const{x:e=null,y:s=null}=i||{},n=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=us(a,r,n);const A=n[a],l=n[r];s!==null?(o.push({x:A.x,y:s}),o.push({x:l.x,y:s})):e!==null&&(o.push({x:e,y:A.y}),o.push({x:e,y:l.y}))}),o}function us(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function Lo(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function So(i,t){let e=[],s=!1;return F(i)?(s=!0,e=i):e=Sh(i,t),e.length?new Tt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Ro(i){return i&&i.fill!==!1}function Rh(i,t,e){let n=i[t].fill;const o=[t];let a;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!W(n))return n;if(a=i[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function Fh(i,t,e){const s=jh(i);if(P(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return W(n)&&Math.floor(n)===n?Hh(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Hh(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function Vh(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:P(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Nh(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:P(i)?s=i.value:s=t.getBaseValue(),s}function jh(i){const t=i.options,e=t.fill;let s=E(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function Wh(i){const{scale:t,index:e,line:s}=i,n=[],o=s.segments,a=s.points,r=Zh(t,e);r.push(So({x:null,y:t.bottom},s));for(let A=0;A<o.length;A++){const l=o[A];for(let c=l.start;c<=l.end;c++)Uh(n,a[c],r)}return new Tt({points:n,options:{}})}function Zh(i,t){const e=[],s=i.getMatchingVisibleMetas("line");for(let n=0;n<s.length;n++){const o=s[n];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Uh(i,t,e){const s=[];for(let n=0;n<e.length;n++){const o=e[n],{first:a,last:r,point:A}=Kh(o,t,"x");if(!(!A||a&&r)){if(a)s.unshift(A);else if(i.push(A),!r)break}}i.push(...s)}function Kh(i,t,e){const s=i.interpolate(t,e);if(!s)return{};const n=s[e],o=i.segments,a=i.points;let r=!1,A=!1;for(let l=0;l<o.length;l++){const c=o[l],h=a[c.start][e],d=a[c.end][e];if(Gt(n,h,d)){r=n===h,A=n===d;break}}return{first:r,last:A,point:s}}class Fo{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){const{x:n,y:o,radius:a}=this;return e=e||{start:0,end:V},t.arc(n,o,a,e.end,e.start,!0),!s.bounds}interpolate(t){const{x:e,y:s,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:s+Math.sin(o)*n,angle:o}}}function Xh(i){const{chart:t,fill:e,line:s}=i;if(W(e))return Jh(t,e);if(e==="stack")return Wh(i);if(e==="shape")return!0;const n=qh(i);return n instanceof Fo?n:So(n,s)}function Jh(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function qh(i){return(i.scale||{}).getPointPositionForValue?$h(i):_h(i)}function _h(i){const{scale:t={},fill:e}=i,s=Vh(e,t);if(W(s)){const n=t.isHorizontal();return{x:n?s:null,y:n?null:s}}return null}function $h(i){const{scale:t,fill:e}=i,s=t.options,n=t.getLabels().length,o=s.reverse?t.max:t.min,a=Nh(e,t,o),r=[];if(s.grid.circular){const A=t.getPointPositionForValue(0,o);return new Fo({x:A.x,y:A.y,radius:t.getDistanceFromCenterForValue(a)})}for(let A=0;A<n;++A)r.push(t.getPointPositionForValue(A,a));return r}function fs(i,t,e){const s=Xh(t),{line:n,scale:o,axis:a}=t,r=n.options,A=r.fill,l=r.backgroundColor,{above:c=l,below:h=l}=A||{};s&&n.points.length&&(ii(i,e),td(i,{line:n,target:s,above:c,below:h,area:e,scale:o,axis:a}),si(i))}function td(i,t){const{line:e,target:s,above:n,below:o,area:a,scale:r}=t,A=e._loop?"angle":t.axis;i.save(),A==="x"&&o!==n&&(Ho(i,s,a.top),Vo(i,{line:e,target:s,color:n,scale:r,property:A}),i.restore(),i.save(),Ho(i,s,a.bottom)),Vo(i,{line:e,target:s,color:o,scale:r,property:A}),i.restore()}function Ho(i,t,e){const{segments:s,points:n}=t;let o=!0,a=!1;i.beginPath();for(const r of s){const{start:A,end:l}=r,c=n[A],h=n[us(A,l,n)];o?(i.moveTo(c.x,c.y),o=!1):(i.lineTo(c.x,e),i.lineTo(c.x,c.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(h.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function Vo(i,t){const{line:e,target:s,property:n,color:o,scale:a}=t,r=Lh(e,s,n);for(const{source:A,target:l,start:c,end:h}of r){const{style:{backgroundColor:d=o}={}}=A,g=s!==!0;i.save(),i.fillStyle=d,ed(i,a,g&&gs(n,c,h)),i.beginPath();const u=!!e.pathSegment(i,A);let f;if(g){u?i.closePath():No(i,s,h,n);const w=!!s.pathSegment(i,l,{move:u,reverse:!0});f=u&&w,f||No(i,s,c,n)}i.closePath(),i.fill(f?"evenodd":"nonzero"),i.restore()}}function ed(i,t,e){const{top:s,bottom:n}=t.chart.chartArea,{property:o,start:a,end:r}=e||{};o==="x"&&(i.beginPath(),i.rect(a,s,r-a,n-s),i.clip())}function No(i,t,e,s){const n=t.interpolate(e,s);n&&i.lineTo(n.x,n.y)}var id={id:"filler",afterDatasetsUpdate(i,t,e){const s=(i.data.datasets||[]).length,n=[];let o,a,r,A;for(a=0;a<s;++a)o=i.getDatasetMeta(a),r=o.dataset,A=null,r&&r.options&&r instanceof Tt&&(A={visible:i.isDatasetVisible(a),index:a,fill:Fh(r,a,s),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=A,n.push(A);for(a=0;a<s;++a)A=n[a],!(!A||A.fill===!1)&&(A.fill=Rh(n,a,e.propagate))},beforeDraw(i,t,e){const s=e.drawTime==="beforeDraw",n=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let a=n.length-1;a>=0;--a){const r=n[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),s&&r.fill&&fs(i.ctx,r,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const o=s[n].$filler;Ro(o)&&fs(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!Ro(s)||e.drawTime!=="beforeDatasetDraw"||fs(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const jo=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},sd=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Wo extends gt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=S(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=J(s.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:A}=jo(s,o);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(a,o,r,A)+10):(c=this.maxHeight,l=this._fitCols(a,n,r,A)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,A=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+r;let h=t;o.textAlign="left",o.textBaseline="middle";let d=-1,g=-c;return this.legendItems.forEach((u,f)=>{const w=s+e/2+o.measureText(u.text).width;(f===0||l[l.length-1]+w+2*r>a)&&(h+=c,l[l.length-(f>0?0:1)]=0,g+=c,d++),A[f]={left:0,top:g,row:d,width:w,height:n},l[l.length-1]+=w+r}),h}_fitCols(t,e,s,n){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,A=this.legendHitBoxes=[],l=this.columnSizes=[],c=a-t;let h=r,d=0,g=0,u=0,f=0;return this.legendItems.forEach((w,m)=>{const{itemWidth:D,itemHeight:Y}=nd(s,e,o,w,n);m>0&&g+Y+2*r>c&&(h+=d+r,l.push({width:d,height:g}),u+=d+r,f++,d=g=0),A[m]={left:u,top:g,col:f,width:D,height:Y},d=Math.max(d,D),g+=Y+r}),h+=d,l.push({width:d,height:g}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,a=Ae(o,this.left,this.width);if(this.isHorizontal()){let r=0,A=$(s,this.left+n,this.right-this.lineWidths[r]);for(const l of e)r!==l.row&&(r=l.row,A=$(s,this.left+n,this.right-this.lineWidths[r])),l.top+=this.top+t+n,l.left=a.leftForLtr(a.x(A),l.width),A+=l.width+n}else{let r=0,A=$(s,this.top+t+n,this.bottom-this.columnSizes[r].height);for(const l of e)l.col!==r&&(r=l.col,A=$(s,this.top+t+n,this.bottom-this.columnSizes[r].height)),l.top=A,l.left+=this.left+n,l.left=a.leftForLtr(a.x(l.left),l.width),A+=l.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ii(t,this),this._draw(),si(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:a}=t,r=Z.color,A=Ae(t.rtl,this.left,this.width),l=J(a.font),{padding:c}=a,h=l.size,d=h/2;let g;this.drawTitle(),n.textAlign=A.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:u,boxHeight:f,itemHeight:w}=jo(a,h),m=function(C,y,v){if(isNaN(u)||u<=0||isNaN(f)||f<0)return;n.save();const I=E(v.lineWidth,1);if(n.fillStyle=E(v.fillStyle,r),n.lineCap=E(v.lineCap,"butt"),n.lineDashOffset=E(v.lineDashOffset,0),n.lineJoin=E(v.lineJoin,"miter"),n.lineWidth=I,n.strokeStyle=E(v.strokeStyle,r),n.setLineDash(E(v.lineDash,[])),a.usePointStyle){const k={radius:f*Math.SQRT2/2,pointStyle:v.pointStyle,rotation:v.rotation,borderWidth:I},Q=A.xPlus(C,u/2),O=y+d;mn(n,k,Q,O,a.pointStyleWidth&&u)}else{const k=y+Math.max((h-f)/2,0),Q=A.leftForLtr(C,u),O=jt(v.borderRadius);n.beginPath(),Object.values(O).some(_=>_!==0)?xe(n,{x:Q,y:k,w:u,h:f,radius:O}):n.rect(Q,k,u,f),n.fill(),I!==0&&n.stroke()}n.restore()},D=function(C,y,v){Nt(n,v.text,C,y+w/2,l,{strikethrough:v.hidden,textAlign:A.textAlign(v.textAlign)})},Y=this.isHorizontal(),G=this._computeTitleHeight();Y?g={x:$(o,this.left+c,this.right-s[0]),y:this.top+c+G,line:0}:g={x:this.left+c,y:$(o,this.top+G+c,this.bottom-e[0].height),line:0},kn(this.ctx,t.textDirection);const B=w+c;this.legendItems.forEach((C,y)=>{n.strokeStyle=C.fontColor,n.fillStyle=C.fontColor;const v=n.measureText(C.text).width,I=A.textAlign(C.textAlign||(C.textAlign=a.textAlign)),k=u+d+v;let Q=g.x,O=g.y;A.setWidth(this.width),Y?y>0&&Q+k+c>this.right&&(O=g.y+=B,g.line++,Q=g.x=$(o,this.left+c,this.right-s[g.line])):y>0&&O+B>this.bottom&&(Q=g.x=Q+e[g.line].width+c,g.line++,O=g.y=$(o,this.top+G+c,this.bottom-e[g.line].height));const _=A.x(Q);if(m(_,O,C),Q=xA(I,Q+u+d,Y?Q+k:this.right,t.rtl),D(A.x(Q),O,C),Y)g.x+=k+c;else if(typeof C.text!="string"){const lt=l.lineHeight;g.y+=Zo(C,lt)+c}else g.y+=B}),Qn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=J(e.font),n=tt(e.padding);if(!e.display)return;const o=Ae(t.rtl,this.left,this.width),a=this.ctx,r=e.position,A=s.size/2,l=n.top+A;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,h=$(t.align,h,this.right-d);else{const u=this.columnSizes.reduce((f,w)=>Math.max(f,w.height),0);c=l+$(t.align,this.top,this.bottom-u-t.labels.padding-this._computeTitleHeight())}const g=$(r,h,h+d);a.textAlign=o.textAlign(Vi(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,Nt(a,e.text,g,c,s)}_computeTitleHeight(){const t=this.options.title,e=J(t.font),s=tt(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Gt(t,this.left,this.right)&&Gt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],Gt(t,n.left,n.left+n.width)&&Gt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!rd(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=sd(n,s);n&&!o&&S(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&S(e.onHover,[t,s,this],this)}else s&&S(e.onClick,[t,s,this],this)}}function nd(i,t,e,s,n){const o=od(s,i,t,e),a=ad(n,s,t.lineHeight);return{itemWidth:o,itemHeight:a}}function od(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+s.measureText(n).width}function ad(i,t,e){let s=i;return typeof t.text!="string"&&(s=Zo(t,e)),s}function Zo(i,t){const e=i.text?i.text.length:0;return t*e}function rd(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Ad={id:"legend",_element:Wo,start(i,t,e){const s=i.legend=new Wo({ctx:i.ctx,options:e,chart:i});et.configure(i,s,e),et.addBox(i,s)},stop(i){et.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;et.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(A=>{const l=A.controller.getStyle(e?0:void 0),c=tt(l.borderWidth);return{text:t[A.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!A.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:a&&(r||l.borderRadius),datasetIndex:A.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class ps extends gt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=F(s.text)?s.text.length:1;this._padding=tt(s.padding);const o=n*J(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:a}=this,r=a.align;let A=0,l,c,h;return this.isHorizontal()?(c=$(r,s,o),h=e+t,l=o-s):(a.position==="left"?(c=s+t,h=$(r,n,e),A=H*-.5):(c=o-t,h=$(r,e,n),A=H*.5),l=n-e),{titleX:c,titleY:h,maxWidth:l,rotation:A}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=J(e.font),o=s.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:A,rotation:l}=this._drawArgs(o);Nt(t,e.text,0,0,s,{color:e.color,maxWidth:A,rotation:l,textAlign:Vi(e.align),textBaseline:"middle",translation:[a,r]})}}function ld(i,t){const e=new ps({ctx:i.ctx,options:t,chart:i});et.configure(i,e,t),et.addBox(i,e),i.titleBlock=e}var cd={id:"title",_element:ps,start(i,t,e){ld(i,e)},stop(i){const t=i.titleBlock;et.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;et.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Yi=new WeakMap;var hd={id:"subtitle",start(i,t,e){const s=new ps({ctx:i.ctx,options:e,chart:i});et.configure(i,s,e),et.addBox(i,s),Yi.set(i,s)},stop(i){et.removeBox(i,Yi.get(i)),Yi.delete(i)},beforeUpdate(i,t,e){const s=Yi.get(i);et.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Le={average(i){if(!i.length)return!1;let t,e,s=0,n=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const r=a.tooltipPosition();s+=r.x,n+=r.y,++o}}return{x:s/o,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=i.length;o<a;++o){const A=i[o].element;if(A&&A.hasValue()){const l=A.getCenterPoint(),c=Fi(t,l);c<n&&(n=c,r=A)}}if(r){const A=r.tooltipPosition();e=A.x,s=A.y}return{x:e,y:s}}};function Mt(i,t){return t&&(F(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function vt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
1511
|
+
*/class xl{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=An.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let a=o.length-1,r=!1,A;for(;a>=0;--a)A=o[a],A._active?(A._total>s.duration&&(s.duration=A._total),A.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Ct=new xl;const Rn="transparent",Cl={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=un(i||Rn),n=s.valid&&un(t||Rn);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class yl{constructor(t,e,s,n){const o=e[s];n=Ce([t.to,n,o,t.from]);const a=Ce([t.from,o,n]);this._active=!0,this._fn=t.fn||Cl[t.type||typeof a],this._easing=Be[t.easing]||Be.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ce([t.to,e,n,t.from]),this._from=Ce([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,a=this._loop,r=this._to;let A;if(this._active=o!==r&&(a||e<s),!this._active){this._target[n]=r,this._notify(!0);return}if(e<0){this._target[n]=o;return}A=e/s%2,A=a&&A>1?2-A:A,A=this._easing(Math.min(1,Math.max(0,A))),this._target[n]=this._fn(o,r,A)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class Fn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!P(t))return;const e=Object.keys(Z.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!P(o))return;const a={};for(const r of e)a[r]=o[r];(F(o.properties)&&o.properties||[n]).forEach(r=>{(r===n||!s.has(r))&&s.set(r,a)})})}_animateOptions(t,e){const s=e.options,n=vl(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Il(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let A;for(A=a.length-1;A>=0;--A){const l=a[A];if(l.charAt(0)==="$")continue;if(l==="options"){n.push(...this._animateOptions(t,e));continue}const c=e[l];let h=o[l];const d=s.get(l);if(h)if(d&&h.active()){h.update(d,c,r);continue}else h.cancel();if(!d||!d.duration){t[l]=c;continue}o[l]=h=new yl(d,t,l,c),n.push(h)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return Ct.add(this._chart,s),!0}}function Il(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function vl(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Hn(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function El(i,t,e){if(e===!1)return!1;const s=Hn(i,e),n=Hn(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function kl(i){let t,e,s,n;return P(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function Vn(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function Nn(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let a,r,A,l;if(t!==null){for(a=0,r=n.length;a<r;++a){if(A=+n[a],A===e){if(s.all)continue;break}l=i.values[A],W(l)&&(o||t===0||wt(t)===wt(l))&&(t+=l)}return t}}function Ql(i){const t=Object.keys(i),e=new Array(t.length);let s,n,o;for(s=0,n=t.length;s<n;++s)o=t[s],e[s]={x:o,y:i[o]};return e}function jn(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Pl(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Ol(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function zl(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function Wn(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function Zn(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=s,A=o.axis,l=a.axis,c=Pl(o,a,s),h=t.length;let d;for(let g=0;g<h;++g){const u=t[g],{[A]:f,[l]:w}=u,m=u._stacks||(u._stacks={});d=m[l]=zl(n,c,f),d[r]=w,d._top=Wn(d,a,!0,s.type),d._bottom=Wn(d,a,!1,s.type);const D=d._visualValues||(d._visualValues={});D[r]=w}}function $i(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function Tl(i,t){return zt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ll(i,t,e){return zt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ye(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const ts=i=>i==="reset"||i==="none",Un=(i,t)=>t?i:Object.assign({},i),Sl=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Vn(e,!0),values:null};class dt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=jn(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ye(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(h,d,g,u)=>h==="x"?d:h==="r"?u:g,o=e.xAxisID=E(s.xAxisID,$i(t,"x")),a=e.yAxisID=E(s.yAxisID,$i(t,"y")),r=e.rAxisID=E(s.rAxisID,$i(t,"r")),A=e.indexAxis,l=e.iAxisID=n(A,o,a,r),c=e.vAxisID=n(A,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&an(this._data,this),t._stacked&&ye(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(P(e))this._data=Ql(e);else if(s!==e){if(s){an(s,this);const n=this._cachedMeta;ye(n),n._parsed=[]}e&&Object.isExtensible(e)&&GA(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=jn(e.vScale,e),e.stack!==s.stack&&(n=!0,ye(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&Zn(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:a}=s,r=o.axis;let A=t===0&&e===n.length?!0:s._sorted,l=t>0&&s._parsed[t-1],c,h,d;if(this._parsing===!1)s._parsed=n,s._sorted=!0,d=n;else{F(n[t])?d=this.parseArrayData(s,n,t,e):P(n[t])?d=this.parseObjectData(s,n,t,e):d=this.parsePrimitiveData(s,n,t,e);const g=()=>h[r]===null||l&&h[r]<l[r];for(c=0;c<e;++c)s._parsed[c+t]=h=d[c],A&&(g()&&(A=!1),l=h);s._sorted=A}a&&Zn(this,d)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:a}=t,r=o.axis,A=a.axis,l=o.getLabels(),c=o===a,h=new Array(n);let d,g,u;for(d=0,g=n;d<g;++d)u=d+s,h[d]={[r]:c||o.parse(l[u],u),[A]:a.parse(e[u],u)};return h}parseArrayData(t,e,s,n){const{xScale:o,yScale:a}=t,r=new Array(n);let A,l,c,h;for(A=0,l=n;A<l;++A)c=A+s,h=e[c],r[A]={x:o.parse(h[0],c),y:a.parse(h[1],c)};return r}parseObjectData(t,e,s,n){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:A="y"}=this._parsing,l=new Array(n);let c,h,d,g;for(c=0,h=n;c<h;++c)d=c+s,g=e[d],l[c]={x:o.parse(Qt(g,r),d),y:a.parse(Qt(g,A),d)};return l}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:Vn(n,!0),values:e._stacks[t.axis]._visualValues};return Nn(r,a,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let a=o===null?NaN:o;const r=n&&s._stacks[e.axis];n&&r&&(n.values=r,a=Nn(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,a=n.length,r=this._getOtherScale(t),A=Sl(e,s,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:h}=Ol(r);let d,g;function u(){g=n[d];const f=g[r.axis];return!W(g[t.axis])||c>f||h<f}for(d=0;d<a&&!(!u()&&(this.updateRangeFromParsed(l,t,g,A),o));++d);if(o){for(d=a-1;d>=0;--d)if(!u()){this.updateRangeFromParsed(l,t,g,A);break}}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n][t.axis],W(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=kl(E(this.options.clip,El(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,a=[],r=this._drawStart||0,A=this._drawCount||n.length-r,l=this.options.drawActiveElementsOnTop;let c;for(s.dataset&&s.dataset.draw(t,o,r,A),c=r;c<r+A;++c){const h=n[c];h.hidden||(h.active&&l?a.push(h):h.draw(t,o))}for(c=0;c<a.length;++c)a[c].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=Ll(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Tl(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],A=this.enableOptionSharing&&Me(s);if(r)return Un(r,A);const l=this.chart.config,c=l.datasetElementScopeKeys(this._type,t),h=n?[`${t}Hover`,"hover",t,""]:[t,""],d=l.getOptionScopes(this.getDataset(),c),g=Object.keys(Z.elements[t]),u=()=>this.getContext(s,n,e),f=l.resolveNamedOptions(d,g,u,h);return f.$shared&&(f.$shared=A,o[a]=Object.freeze(Un(f,A))),f}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let A;if(n.options.animation!==!1){const c=this.chart.config,h=c.datasetAnimationScopeKeys(this._type,e),d=c.getOptionScopes(this.getDataset(),h);A=c.createResolver(d,this.getContext(t,s,e))}const l=new Fn(n,A&&A.animations);return A&&A._cacheable&&(o[a]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ts(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),a=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:a}}updateElement(t,e,s,n){ts(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!ts(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[r,A,l]of this._syncList)this[r](A,l);this._syncList=[];const n=s.length,o=e.length,a=Math.min(o,n);a&&this.parse(0,a),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,a=t+e;let r;const A=l=>{for(l.length+=e,r=l.length-1;r>=a;r--)l[r]=l[r-e]};for(A(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&A(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&ye(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}x(dt,"defaults",{}),x(dt,"datasetElementType",null),x(dt,"dataElementType",null);function Rl(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let s=[];for(let n=0,o=e.length;n<o;n++)s=s.concat(e[n].controller.getAllParsedValues(i));i._cache.$bar=rn(s.sort((n,o)=>n-o))}return i._cache.$bar}function Fl(i){const t=i.iScale,e=Rl(t,i.type);let s=t._length,n,o,a,r;const A=()=>{a===32767||a===-32768||(Me(r)&&(s=Math.min(s,Math.abs(a-r)||s)),r=a)};for(n=0,o=e.length;n<o;++n)a=t.getPixelForValue(e[n]),A();for(r=void 0,n=0,o=t.ticks.length;n<o;++n)a=t.getPixelForTick(n),A();return s}function Hl(i,t,e,s){const n=e.barThickness;let o,a;return z(n)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=n*s,a=1),{chunk:o/s,ratio:a,start:t.pixels[i]-o/2}}function Vl(i,t,e,s){const n=t.pixels,o=n[i];let a=i>0?n[i-1]:null,r=i<n.length-1?n[i+1]:null;const A=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const l=o-(o-Math.min(a,r))/2*A;return{chunk:Math.abs(r-a)/2*A/s,ratio:e.barPercentage,start:l}}function Nl(i,t,e,s){const n=e.parse(i[0],s),o=e.parse(i[1],s),a=Math.min(n,o),r=Math.max(n,o);let A=a,l=r;Math.abs(a)>Math.abs(r)&&(A=r,l=a),t[e.axis]=l,t._custom={barStart:A,barEnd:l,start:n,end:o,min:a,max:r}}function Kn(i,t,e,s){return F(i)?Nl(i,t,e,s):t[e.axis]=e.parse(i,s),t}function Xn(i,t,e,s){const n=i.iScale,o=i.vScale,a=n.getLabels(),r=n===o,A=[];let l,c,h,d;for(l=e,c=e+s;l<c;++l)d=t[l],h={},h[n.axis]=r||n.parse(a[l],l),A.push(Kn(d,h,o,l));return A}function es(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function jl(i,t,e){return i!==0?wt(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Wl(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.base<i.y,e="bottom",s="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:s,reverse:t,top:n,bottom:o}}function Zl(i,t,e,s){let n=t.borderSkipped;const o={};if(!n){i.borderSkipped=o;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:A,top:l,bottom:c}=Wl(i);n==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===s?n=l:(e._bottom||0)===s?n=c:(o[Jn(c,a,r,A)]=!0,n=l)),o[Jn(n,a,r,A)]=!0,i.borderSkipped=o}function Jn(i,t,e,s){return s?(i=Ul(i,t,e),i=qn(i,e,t)):i=qn(i,t,e),i}function Ul(i,t,e){return i===t?e:i===e?t:i}function qn(i,t,e){return i==="start"?t:i==="end"?e:i}function Kl(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class Ai extends dt{parsePrimitiveData(t,e,s,n){return Xn(t,e,s,n)}parseArrayData(t,e,s,n){return Xn(t,e,s,n)}parseObjectData(t,e,s,n){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:A="y"}=this._parsing,l=o.axis==="x"?r:A,c=a.axis==="x"?r:A,h=[];let d,g,u,f;for(d=s,g=s+n;d<g;++d)f=e[d],u={},u[o.axis]=o.parse(Qt(f,l),d),h.push(Kn(Qt(f,c),u,a,d));return h}updateRangeFromParsed(t,e,s,n){super.updateRangeFromParsed(t,e,s,n);const o=s._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:s,vScale:n}=e,o=this.getParsed(t),a=o._custom,r=es(a)?"["+a.start+", "+a.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+s.getLabelForValue(o[s.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,n){const o=n==="reset",{index:a,_cachedMeta:{vScale:r}}=this,A=r.getBasePixel(),l=r.isHorizontal(),c=this._getRuler(),{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n);for(let g=e;g<e+s;g++){const u=this.getParsed(g),f=o||z(u[r.axis])?{base:A,head:A}:this._calculateBarValuePixels(g),w=this._calculateBarIndexPixels(g,c),m=(u._stacks||{})[r.axis],D={horizontal:l,base:f.base,enableBorderRadius:!m||es(u._custom)||a===m._top||a===m._bottom,x:l?f.head:w.center,y:l?w.center:f.head,height:l?w.size:Math.abs(f.size),width:l?Math.abs(f.size):w.size};d&&(D.options=h||this.resolveDataElementOptions(g,t[g].active?"active":n));const Y=D.options||t[g].options;Zl(D,Y,m,a),Kl(D,Y,c.ratio),this.updateElement(t[g],g,D,n)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,n=s.getMatchingVisibleMetas(this._type).filter(A=>A.controller.options.grouped),o=s.options.stacked,a=[],r=A=>{const l=A.controller.getParsed(e),c=l&&l[A.vScale.axis];if(z(c)||isNaN(c))return!0};for(const A of n)if(!(e!==void 0&&r(A))&&((o===!1||a.indexOf(A.stack)===-1||o===void 0&&A.stack===void 0)&&a.push(A.stack),A.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){const n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let o,a;for(o=0,a=e.data.length;o<a;++o)n.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));const r=t.barThickness;return{min:r||Fl(e),pixels:n,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:n},options:{base:o,minBarLength:a}}=this,r=o||0,A=this.getParsed(t),l=A._custom,c=es(l);let h=A[e.axis],d=0,g=s?this.applyStack(e,A,s):h,u,f;g!==h&&(d=g-h,g=h),c&&(h=l.barStart,g=l.barEnd-l.barStart,h!==0&&wt(h)!==wt(l.barEnd)&&(d=0),d+=h);const w=!z(o)&&!c?o:d;let m=e.getPixelForValue(w);if(this.chart.getDataVisibility(t)?u=e.getPixelForValue(d+g):u=m,f=u-m,Math.abs(f)<a){f=jl(f,e,r)*a,h===r&&(m-=f/2);const D=e.getPixelForDecimal(0),Y=e.getPixelForDecimal(1),G=Math.min(D,Y),B=Math.max(D,Y);m=Math.max(Math.min(m,B),G),u=m+f,s&&!c&&(A._stacks[e.axis]._visualValues[n]=e.getValueForPixel(u)-e.getValueForPixel(m))}if(m===e.getPixelForValue(r)){const D=wt(f)*e.getLineWidthForValue(r)/2;m+=D,f-=D}return{size:f,base:m,head:u,center:u+f/2}}_calculateBarIndexPixels(t,e){const s=e.scale,n=this.options,o=n.skipNull,a=E(n.maxBarThickness,1/0);let r,A;if(e.grouped){const l=o?this._getStackCount(t):e.stackCount,c=n.barThickness==="flex"?Vl(t,e,n,l):Hl(t,e,n,l),h=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=c.start+c.chunk*h+c.chunk/2,A=Math.min(a,c.chunk*c.ratio)}else r=s.getPixelForValue(this.getParsed(t)[s.axis],t),A=Math.min(a,e.min*e.ratio);return{base:r-A/2,head:r+A/2,center:r,size:A}}draw(){const t=this._cachedMeta,e=t.vScale,s=t.data,n=s.length;let o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&s[o].draw(this._ctx)}}x(Ai,"id","bar"),x(Ai,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),x(Ai,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class li extends dt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,s,n){const o=super.parsePrimitiveData(t,e,s,n);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+s).radius;return o}parseArrayData(t,e,s,n){const o=super.parseArrayData(t,e,s,n);for(let a=0;a<o.length;a++){const r=e[s+a];o[a]._custom=E(r[2],this.resolveDataElementOptions(a+s).radius)}return o}parseObjectData(t,e,s,n){const o=super.parseObjectData(t,e,s,n);for(let a=0;a<o.length;a++){const r=e[s+a];o[a]._custom=E(r&&r.r&&+r.r,this.resolveDataElementOptions(a+s).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let s=t.length-1;s>=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:n,yScale:o}=e,a=this.getParsed(t),r=n.getLabelForValue(a.x),A=o.getLabelForValue(a.y),l=a._custom;return{label:s[t]||"",value:"("+r+", "+A+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:A,includeOptions:l}=this._getSharedOptions(e,n),c=a.axis,h=r.axis;for(let d=e;d<e+s;d++){const g=t[d],u=!o&&this.getParsed(d),f={},w=f[c]=o?a.getPixelForDecimal(.5):a.getPixelForValue(u[c]),m=f[h]=o?r.getBasePixel():r.getPixelForValue(u[h]);f.skip=isNaN(w)||isNaN(m),l&&(f.options=A||this.resolveDataElementOptions(d,g.active?"active":n),o&&(f.options.radius=0)),this.updateElement(g,d,f,n)}}resolveDataElementOptions(t,e){const s=this.getParsed(t);let n=super.resolveDataElementOptions(t,e);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const o=n.radius;return e!=="active"&&(n.radius=0),n.radius+=E(s&&s._custom,o),n}}x(li,"id","bubble"),x(li,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),x(li,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Xl(i,t,e){let s=1,n=1,o=0,a=0;if(t<V){const r=i,A=r+t,l=Math.cos(r),c=Math.sin(r),h=Math.cos(A),d=Math.sin(A),g=(Y,G,B)=>be(Y,r,A,!0)?1:Math.max(G,G*e,B,B*e),u=(Y,G,B)=>be(Y,r,A,!0)?-1:Math.min(G,G*e,B,B*e),f=g(0,l,h),w=g(U,c,d),m=u(H,l,h),D=u(H+U,c,d);s=(f-m)/2,n=(w-D)/2,o=-(f+m)/2,a=-(w+D)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}class Kt extends dt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=A=>+s[A];if(P(s[t])){const{key:A="value"}=this._parsing;o=l=>+Qt(s[l],A)}let a,r;for(a=t,r=t+e;a<r;++a)n._parsed[a]=o(a)}}_getRotation(){return ht(this.options.rotation-90)}_getCircumference(){return ht(this.options.circumference)}_getRotationExtents(){let t=V,e=-V;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const n=this.chart.getDatasetMeta(s).controller,o=n._getRotation(),a=n._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:s}=e,n=this._cachedMeta,o=n.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(s.width,s.height)-a)/2,0),A=Math.min(lA(this.options.cutout,r),1),l=this._getRingWeight(this.index),{circumference:c,rotation:h}=this._getRotationExtents(),{ratioX:d,ratioY:g,offsetX:u,offsetY:f}=Xl(h,c,A),w=(s.width-a)/d,m=(s.height-a)/g,D=Math.max(Math.min(w,m)/2,0),Y=Xs(this.options.radius,D),G=Math.max(Y*A,0),B=(Y-G)/this._getVisibleDatasetWeightTotal();this.offsetX=u*Y,this.offsetY=f*Y,n.total=this.calculateTotal(),this.outerRadius=Y-B*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-B*l,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const s=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/V)}updateElements(t,e,s,n){const o=n==="reset",a=this.chart,r=a.chartArea,l=a.options.animation,c=(r.left+r.right)/2,h=(r.top+r.bottom)/2,d=o&&l.animateScale,g=d?0:this.innerRadius,u=d?0:this.outerRadius,{sharedOptions:f,includeOptions:w}=this._getSharedOptions(e,n);let m=this._getRotation(),D;for(D=0;D<e;++D)m+=this._circumference(D,o);for(D=e;D<e+s;++D){const Y=this._circumference(D,o),G=t[D],B={x:c+this.offsetX,y:h+this.offsetY,startAngle:m,endAngle:m+Y,circumference:Y,outerRadius:u,innerRadius:g};w&&(B.options=f||this.resolveDataElementOptions(D,G.active?"active":n)),m+=Y,this.updateElement(G,D,B,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,n;for(n=0;n<e.length;n++){const o=t._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?V*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=Ge(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,a,r,A;if(!t){for(n=0,o=s.data.datasets.length;n<o;++n)if(s.isDatasetVisible(n)){a=s.getDatasetMeta(n),t=a.data,r=a.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++n)A=r.resolveDataElementOptions(n),A.borderAlign!=="inner"&&(e=Math.max(e,A.borderWidth||0,A.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,n=t.length;s<n;++s){const o=this.resolveDataElementOptions(s);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(E(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}x(Kt,"id","doughnut"),x(Kt,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),x(Kt,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),x(Kt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((o,a)=>{const A=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:A.backgroundColor,strokeStyle:A.borderColor,fontColor:n,lineWidth:A.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}});class ci extends dt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:A}=cn(e,n,a);this._drawStart=r,this._drawCount=A,hn(e)&&(r=0,A=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:l},t),this.updateElements(n,r,A,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:a,vScale:r,_stacked:A,_dataset:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(e,n),d=a.axis,g=r.axis,{spanGaps:u,segment:f}=this.options,w=oe(u)?u:Number.POSITIVE_INFINITY,m=this.chart._animationsDisabled||o||n==="none",D=e+s,Y=t.length;let G=e>0&&this.getParsed(e-1);for(let B=0;B<Y;++B){const C=t[B],y=m?C:{};if(B<e||B>=D){y.skip=!0;continue}const I=this.getParsed(B),v=z(I[g]),k=y[d]=a.getPixelForValue(I[d],B),Q=y[g]=o||v?r.getBasePixel():r.getPixelForValue(A?this.applyStack(r,I,A):I[g],B);y.skip=isNaN(k)||isNaN(Q)||v,y.stop=B>0&&Math.abs(I[d]-G[d])>w,f&&(y.parsed=I,y.raw=l.data[B]),h&&(y.options=c||this.resolveDataElementOptions(B,C.active?"active":n)),m||this.updateElement(C,B,y,n),G=I}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}x(ci,"id","line"),x(ci,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),x(ci,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ie extends dt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=Ge(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return Cn.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{const o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),a=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,s,n){const o=n==="reset",a=this.chart,A=a.options.animation,l=this._cachedMeta.rScale,c=l.xCenter,h=l.yCenter,d=l.getIndexAngle(0)-.5*H;let g=d,u;const f=360/this.countVisibleElements();for(u=0;u<e;++u)g+=this._computeAngle(u,n,f);for(u=e;u<e+s;u++){const w=t[u];let m=g,D=g+this._computeAngle(u,n,f),Y=a.getDataVisibility(u)?l.getDistanceFromCenterForValue(this.getParsed(u).r):0;g=D,o&&(A.animateScale&&(Y=0),A.animateRotate&&(m=D=d));const G={x:c,y:h,innerRadius:0,outerRadius:Y,startAngle:m,endAngle:D,options:this.resolveDataElementOptions(u,w.active?"active":n)};this.updateElement(w,u,G,n)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((s,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?ht(this.resolveDataElementOptions(t,e).angle||s):0}}x(Ie,"id","polarArea"),x(Ie,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),x(Ie,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((o,a)=>{const A=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:A.backgroundColor,strokeStyle:A.borderColor,fontColor:n,lineWidth:A.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class is extends Kt{}x(is,"id","pie"),x(is,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class hi extends dt{getLabelAndValue(t){const e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,n){return Cn.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta,s=e.dataset,n=e.data||[],o=e.iScale.getLabels();if(s.points=n,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===n.length,options:a};this.updateElement(s,void 0,r,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,s,n){const o=this._cachedMeta.rScale,a=n==="reset";for(let r=e;r<e+s;r++){const A=t[r],l=this.resolveDataElementOptions(r,A.active?"active":n),c=o.getPointPositionForValue(r,this.getParsed(r).r),h=a?o.xCenter:c.x,d=a?o.yCenter:c.y,g={x:h,y:d,angle:c.angle,skip:isNaN(h)||isNaN(d),options:l};this.updateElement(A,r,g,n)}}}x(hi,"id","radar"),x(hi,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),x(hi,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class di extends dt{getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:n,yScale:o}=e,a=this.getParsed(t),r=n.getLabelForValue(a.x),A=o.getLabelForValue(a.y);return{label:s[t]||"",value:"("+r+", "+A+")"}}update(t){const e=this._cachedMeta,{data:s=[]}=e,n=this.chart._animationsDisabled;let{start:o,count:a}=cn(e,s,n);if(this._drawStart=o,this._drawCount=a,hn(e)&&(o=0,a=s.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:A}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!A._decimated,r.points=s;const l=this.resolveDatasetElementOptions(t);l.segment=this.options.segment,this.updateElement(r,void 0,{animated:!n,options:l},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(s,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,s,n){const o=n==="reset",{iScale:a,vScale:r,_stacked:A,_dataset:l}=this._cachedMeta,c=this.resolveDataElementOptions(e,n),h=this.getSharedOptions(c),d=this.includeOptions(n,h),g=a.axis,u=r.axis,{spanGaps:f,segment:w}=this.options,m=oe(f)?f:Number.POSITIVE_INFINITY,D=this.chart._animationsDisabled||o||n==="none";let Y=e>0&&this.getParsed(e-1);for(let G=e;G<e+s;++G){const B=t[G],C=this.getParsed(G),y=D?B:{},I=z(C[u]),v=y[g]=a.getPixelForValue(C[g],G),k=y[u]=o||I?r.getBasePixel():r.getPixelForValue(A?this.applyStack(r,C,A):C[u],G);y.skip=isNaN(v)||isNaN(k)||I,y.stop=G>0&&Math.abs(C[g]-Y[g])>m,w&&(y.parsed=C,y.raw=l.data[G]),d&&(y.options=h||this.resolveDataElementOptions(G,B.active?"active":n)),D||this.updateElement(B,G,y,n),Y=C}this.updateSharedOptions(h,n,c)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let A=e.length-1;A>=0;--A)r=Math.max(r,e[A].size(this.resolveDataElementOptions(A))/2);return r>0&&r}const s=t.dataset,n=s.options&&s.options.borderWidth||0;if(!e.length)return n;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,o,a)/2}}x(di,"id","scatter"),x(di,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),x(di,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Jl=Object.freeze({__proto__:null,BarController:Ai,BubbleController:li,DoughnutController:Kt,LineController:ci,PieController:is,PolarAreaController:Ie,RadarController:hi,ScatterController:di});function Xt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ss{constructor(t){x(this,"options");this.options=t||{}}static override(t){Object.assign(ss.prototype,t)}init(){}formats(){return Xt()}parse(){return Xt()}format(){return Xt()}add(){return Xt()}diff(){return Xt()}startOf(){return Xt()}endOf(){return Xt()}}var ql={_date:ss};function _l(i,t,e,s){const{controller:n,data:o,_sorted:a}=i,r=n._cachedMeta.iScale;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const A=r._reversePixels?bA:Yt;if(s){if(n._sharedOptions){const l=o[0],c=typeof l.getRange=="function"&&l.getRange(t);if(c){const h=A(o,t,e-c),d=A(o,t,e+c);return{lo:h.lo,hi:d.hi}}}}else return A(o,t,e)}return{lo:0,hi:o.length-1}}function ve(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,A=o.length;r<A;++r){const{index:l,data:c}=o[r],{lo:h,hi:d}=_l(o[r],t,a,n);for(let g=h;g<=d;++g){const u=c[g];u.skip||s(u,l,g)}}}function $l(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,a=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function ns(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||ve(i,e,t,function(r,A,l){!n&&!xt(r,i.chartArea,0)||r.inRange(t.x,t.y,s)&&o.push({element:r,datasetIndex:A,index:l})},!0),o}function tc(i,t,e,s){let n=[];function o(a,r,A){const{startAngle:l,endAngle:c}=a.getProps(["startAngle","endAngle"],s),{angle:h}=nn(a,{x:t.x,y:t.y});be(h,l,c)&&n.push({element:a,datasetIndex:r,index:A})}return ve(i,e,t,o),n}function ec(i,t,e,s,n,o){let a=[];const r=$l(e);let A=Number.POSITIVE_INFINITY;function l(c,h,d){const g=c.inRange(t.x,t.y,n);if(s&&!g)return;const u=c.getCenterPoint(n);if(!(!!o||i.isPointInArea(u))&&!g)return;const w=r(t,u);w<A?(a=[{element:c,datasetIndex:h,index:d}],A=w):w===A&&a.push({element:c,datasetIndex:h,index:d})}return ve(i,e,t,l),a}function os(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?tc(i,t,e,n):ec(i,t,e,s,n,o)}function _n(i,t,e,s,n){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return ve(i,e,t,(A,l,c)=>{A[a](t[e],n)&&(o.push({element:A,datasetIndex:l,index:c}),r=r||A.inRange(t.x,t.y,n))}),s&&!r?[]:o}var ic={evaluateInteractionItems:ve,modes:{index(i,t,e,s){const n=Zt(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?ns(i,n,o,s,a):os(i,n,o,!1,s,a),A=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(l=>{const c=r[0].index,h=l.data[c];h&&!h.skip&&A.push({element:h,datasetIndex:l.index,index:c})}),A):[]},dataset(i,t,e,s){const n=Zt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?ns(i,n,o,s,a):os(i,n,o,!1,s,a);if(r.length>0){const A=r[0].datasetIndex,l=i.getDatasetMeta(A).data;r=[];for(let c=0;c<l.length;++c)r.push({element:l[c],datasetIndex:A,index:c})}return r},point(i,t,e,s){const n=Zt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return ns(i,n,o,s,a)},nearest(i,t,e,s){const n=Zt(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return os(i,n,o,e.intersect,s,a)},x(i,t,e,s){const n=Zt(t,i);return _n(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=Zt(t,i);return _n(i,n,"y",e.intersect,s)}}};const $n=["left","top","right","bottom"];function Ee(i,t){return i.filter(e=>e.pos===t)}function to(i,t){return i.filter(e=>$n.indexOf(e.pos)===-1&&e.box.axis===t)}function ke(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function sc(i){const t=[];let e,s,n,o,a,r;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:a,stackWeight:r=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return t}function nc(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!$n.includes(n))continue;const a=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function oc(i,t){const e=nc(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];const{fullSize:A}=r.box,l=e[r.stack],c=l&&r.stackWeight/l.weight;r.horizontal?(r.width=c?c*s:A&&t.availableWidth,r.height=n):(r.width=s,r.height=c?c*n:A&&t.availableHeight)}return e}function ac(i){const t=sc(i),e=ke(t.filter(l=>l.box.fullSize),!0),s=ke(Ee(t,"left"),!0),n=ke(Ee(t,"right")),o=ke(Ee(t,"top"),!0),a=ke(Ee(t,"bottom")),r=to(t,"x"),A=to(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(A).concat(a).concat(r),chartArea:Ee(t,"chartArea"),vertical:s.concat(n).concat(A),horizontal:o.concat(a).concat(r)}}function eo(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function io(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function rc(i,t,e,s){const{pos:n,box:o}=e,a=i.maxPadding;if(!P(n)){e.size&&(i[n]-=e.size);const h=s[e.stack]||{size:0,count:1};h.size=Math.max(h.size,e.horizontal?o.height:o.width),e.size=h.size/h.count,i[n]+=e.size}o.getPadding&&io(a,o.getPadding());const r=Math.max(0,t.outerWidth-eo(a,i,"left","right")),A=Math.max(0,t.outerHeight-eo(a,i,"top","bottom")),l=r!==i.w,c=A!==i.h;return i.w=r,i.h=A,e.horizontal?{same:l,other:c}:{same:c,other:l}}function Ac(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function lc(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return s(i?["left","right"]:["top","bottom"])}function Qe(i,t,e,s){const n=[];let o,a,r,A,l,c;for(o=0,a=i.length,l=0;o<a;++o){r=i[o],A=r.box,A.update(r.width||t.w,r.height||t.h,lc(r.horizontal,t));const{same:h,other:d}=rc(t,e,r,s);l|=h&&n.length,c=c||d,A.fullSize||n.push(r)}return l&&Qe(n,t,e,s)||c}function gi(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function so(i,t,e,s){const n=e.padding;let{x:o,y:a}=t;for(const r of i){const A=r.box,l=s[r.stack]||{count:1,placed:0,weight:1},c=r.stackWeight/l.weight||1;if(r.horizontal){const h=t.w*c,d=l.size||A.height;Me(l.start)&&(a=l.start),A.fullSize?gi(A,n.left,a,e.outerWidth-n.right-n.left,d):gi(A,t.left+l.placed,a,h,d),l.start=a,l.placed+=h,a=A.bottom}else{const h=t.h*c,d=l.size||A.width;Me(l.start)&&(o=l.start),A.fullSize?gi(A,o,n.top,d,e.outerHeight-n.bottom-n.top):gi(A,o,t.top+l.placed,d,h),l.start=o,l.placed+=h,o=A.right}}t.x=o,t.y=a}var et={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=tt(i.options.layout.padding),o=Math.max(t-n.width,0),a=Math.max(e-n.height,0),r=ac(i.boxes),A=r.vertical,l=r.horizontal;T(i.boxes,f=>{typeof f.beforeLayout=="function"&&f.beforeLayout()});const c=A.reduce((f,w)=>w.box.options&&w.box.options.display===!1?f:f+1,0)||1,h=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),d=Object.assign({},n);io(d,tt(s));const g=Object.assign({maxPadding:d,w:o,h:a,x:n.left,y:n.top},n),u=oc(A.concat(l),h);Qe(r.fullSize,g,h,u),Qe(A,g,h,u),Qe(l,g,h,u)&&Qe(A,g,h,u),Ac(g),so(r.leftAndTop,g,h,u),g.x+=g.w,g.y+=g.h,so(r.rightAndBottom,g,h,u),i.chartArea={left:g.left,top:g.top,right:g.left+g.w,bottom:g.top+g.h,height:g.h,width:g.w},T(r.chartArea,f=>{const w=f.box;Object.assign(w,i.chartArea),w.update(g.w,g.h,{left:0,top:0,right:0,bottom:0})})}};class no{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class cc extends no{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ui="$chartjs",hc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},oo=i=>i===null||i==="";function dc(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[ui]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",oo(n)){const o=En(i,"width");o!==void 0&&(i.width=o)}if(oo(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=En(i,"height");o!==void 0&&(i.height=o)}return i}const ao=ul?{passive:!0}:!1;function gc(i,t,e){i.addEventListener(t,e,ao)}function uc(i,t,e){i.canvas.removeEventListener(t,e,ao)}function fc(i,t){const e=hc[i.type]||i.type,{x:s,y:n}=Zt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function fi(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function pc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||fi(r.addedNodes,s),a=a&&!fi(r.removedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function wc(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||fi(r.removedNodes,s),a=a&&!fi(r.addedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Pe=new Map;let ro=0;function Ao(){const i=window.devicePixelRatio;i!==ro&&(ro=i,Pe.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function mc(i,t){Pe.size||window.addEventListener("resize",Ao),Pe.set(i,t)}function Mc(i){Pe.delete(i),Pe.size||window.removeEventListener("resize",Ao)}function Dc(i,t,e){const s=i.canvas,n=s&&_i(s);if(!n)return;const o=ln((r,A)=>{const l=n.clientWidth;e(r,A),l<n.clientWidth&&e()},window),a=new ResizeObserver(r=>{const A=r[0],l=A.contentRect.width,c=A.contentRect.height;l===0&&c===0||o(l,c)});return a.observe(n),mc(i,o),a}function as(i,t,e){e&&e.disconnect(),t==="resize"&&Mc(i)}function bc(i,t,e){const s=i.canvas,n=ln(o=>{i.ctx!==null&&e(fc(o,i))},i);return gc(s,t,n),n}class Bc extends no{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(dc(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[ui])return!1;const s=e[ui].initial;["height","width"].forEach(o=>{const a=s[o];z(a)?e.removeAttribute(o):e.setAttribute(o,a)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[ui],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:pc,detach:wc,resize:Dc}[e]||bc;n[e]=a(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:as,detach:as,resize:as}[e]||uc)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return gl(t,e,s,n)}isAttached(t){const e=_i(t);return!!(e&&e.isConnected)}}function Gc(i){return!In()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?cc:Bc}class gt{constructor(){x(this,"x");x(this,"y");x(this,"active",!1);x(this,"options");x(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return oe(this.x)&&oe(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}x(gt,"defaults",{}),x(gt,"defaultRoutes");function Yc(i,t){const e=i.options.ticks,s=xc(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?yc(t):[],a=o.length,r=o[0],A=o[a-1],l=[];if(a>n)return Ic(t,l,o,a/n),l;const c=Cc(o,t,n);if(a>0){let h,d;const g=a>1?Math.round((A-r)/(a-1)):null;for(pi(t,l,c,z(g)?0:r-g,r),h=0,d=a-1;h<d;h++)pi(t,l,c,o[h],o[h+1]);return pi(t,l,c,A,z(g)?t.length:A+g),l}return pi(t,l,c),l}function xc(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Cc(i,t,e){const s=vc(i),n=t.length/e;if(!s)return Math.max(n,1);const o=wA(s);for(let a=0,r=o.length-1;a<r;a++){const A=o[a];if(A>n)return A}return Math.max(n,1)}function yc(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function Ic(i,t,e,s){let n=0,o=e[0],a;for(s=Math.ceil(s),a=0;a<i.length;a++)a===o&&(t.push(i[a]),n++,o=e[n*s])}function pi(i,t,e,s,n){const o=E(s,0),a=Math.min(E(n,i.length),i.length);let r=0,A,l,c;for(e=Math.ceil(e),n&&(A=n-s,e=A/Math.floor(A/e)),c=o;c<0;)r++,c=Math.round(o+r*e);for(l=Math.max(o,0);l<a;l++)l===c&&(t.push(i[l]),r++,c=Math.round(o+r*e))}function vc(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const Ec=i=>i==="left"?"right":i==="right"?"left":i,lo=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,co=(i,t)=>Math.min(t||i,i);function ho(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function kc(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,a=i._endPixel,r=1e-6;let A=i.getPixelForTick(n),l;if(!(e&&(s===1?l=Math.max(A-o,a-A):t===0?l=(i.getPixelForTick(1)-A)/2:l=(A-i.getPixelForTick(n-1))/2,A+=n<t?l:-l,A<o-r||A>a+r)))return A}function Qc(i,t){T(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function Oe(i){return i.drawTicks?i.tickLength:0}function go(i,t){if(!i.display)return 0;const e=J(i.font,t),s=tt(i.padding);return(F(i.text)?i.text.length:1)*e.lineHeight+s.height}function Pc(i,t){return zt(i,{scale:t,type:"scale"})}function Oc(i,t,e){return zt(i,{tick:e,index:t,type:"tick"})}function zc(i,t,e){let s=Vi(i);return(e&&t!=="right"||!e&&t==="right")&&(s=Ec(s)),s}function Tc(i,t,e,s){const{top:n,left:o,bottom:a,right:r,chart:A}=i,{chartArea:l,scales:c}=A;let h=0,d,g,u;const f=a-n,w=r-o;if(i.isHorizontal()){if(g=$(s,o,r),P(e)){const m=Object.keys(e)[0],D=e[m];u=c[m].getPixelForValue(D)+f-t}else e==="center"?u=(l.bottom+l.top)/2+f-t:u=lo(i,e,t);d=r-o}else{if(P(e)){const m=Object.keys(e)[0],D=e[m];g=c[m].getPixelForValue(D)-w+t}else e==="center"?g=(l.left+l.right)/2-w+t:g=lo(i,e,t);u=$(s,a,n),h=e==="left"?-U:U}return{titleX:g,titleY:u,maxWidth:d,rotation:h}}class Jt extends gt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=rt(t,Number.POSITIVE_INFINITY),e=rt(e,Number.NEGATIVE_INFINITY),s=rt(s,Number.POSITIVE_INFINITY),n=rt(n,Number.NEGATIVE_INFINITY),{min:rt(t,s),max:rt(e,n),minDefined:W(t),maxDefined:W(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),a;if(n&&o)return{min:e,max:s};const r=this.getMatchingVisibleMetas();for(let A=0,l=r.length;A<l;++A)a=r[A].controller.getMinMax(this,t),n||(e=Math.min(e,a.min)),o||(s=Math.max(s,a.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:rt(e,rt(s,e)),max:rt(s,rt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){S(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=WA(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const A=r<this.ticks.length;this._convertTicksToLabels(A?ho(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Yc(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),A&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){S(this.options.afterUpdate,[this])}beforeSetDimensions(){S(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){S(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),S(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){S(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=S(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){S(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){S(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=co(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let a=n,r,A,l;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const c=this._getLabelSizes(),h=c.widest.width,d=c.highest.height,g=q(this.chart.width-h,0,this.maxWidth);r=t.offset?this.maxWidth/s:g/(s-1),h+6>r&&(r=g/(s-(t.offset?.5:1)),A=this.maxHeight-Oe(t.grid)-e.padding-go(t.title,this.chart.options.font),l=Math.sqrt(h*h+d*d),a=Ri(Math.min(Math.asin(q((c.highest.height+6)/r,-1,1)),Math.asin(q(A/l,-1,1))-Math.asin(q(d/l,-1,1)))),a=Math.max(n,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){S(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){S(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const A=go(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=Oe(o)+A):(t.height=this.maxHeight,t.width=Oe(o)+A),s.display&&this.ticks.length){const{first:l,last:c,widest:h,highest:d}=this._getLabelSizes(),g=s.padding*2,u=ht(this.labelRotation),f=Math.cos(u),w=Math.sin(u);if(r){const m=s.mirror?0:w*h.width+f*d.height;t.height=Math.min(this.maxHeight,t.height+m+g)}else{const m=s.mirror?0:f*h.width+w*d.height;t.width=Math.min(this.maxWidth,t.width+m+g)}this._calculatePadding(l,c,w,f)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:a},position:r}=this.options,A=this.labelRotation!==0,l=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,g=0;A?l?(d=n*t.width,g=s*e.height):(d=s*t.height,g=n*e.width):o==="start"?g=e.width:o==="end"?d=t.width:o!=="inner"&&(d=t.width/2,g=e.width/2),this.paddingLeft=Math.max((d-c+a)*this.width/(this.width-c),0),this.paddingRight=Math.max((g-h+a)*this.width/(this.width-h),0)}else{let c=e.height/2,h=t.height/2;o==="start"?(c=0,h=t.height):o==="end"&&(c=e.height,h=0),this.paddingTop=c+a,this.paddingBottom=h+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){S(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)z(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=ho(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,a=[],r=[],A=Math.floor(e/co(e,s));let l=0,c=0,h,d,g,u,f,w,m,D,Y,G,B;for(h=0;h<e;h+=A){if(u=t[h].label,f=this._resolveTickFontOptions(h),n.font=w=f.string,m=o[w]=o[w]||{data:{},gc:[]},D=f.lineHeight,Y=G=0,!z(u)&&!F(u))Y=ei(n,m.data,m.gc,Y,u),G=D;else if(F(u))for(d=0,g=u.length;d<g;++d)B=u[d],!z(B)&&!F(B)&&(Y=ei(n,m.data,m.gc,Y,B),G+=D);a.push(Y),r.push(G),l=Math.max(Y,l),c=Math.max(G,c)}Qc(o,e);const C=a.indexOf(l),y=r.indexOf(c),I=v=>({width:a[v]||0,height:r[v]||0});return{first:I(0),last:I(e-1),widest:I(C),highest:I(y),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return DA(this._alignToPixels?Vt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=Oc(this.getContext(),t,s))}return this.$context||(this.$context=Pc(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=ht(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,A=o?o.highest.height+a:0;return this.isHorizontal()?A*s>r*n?r/s:A/n:A*n<r*s?A/s:r/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:a,border:r}=n,A=o.offset,l=this.isHorizontal(),h=this.ticks.length+(A?1:0),d=Oe(o),g=[],u=r.setContext(this.getContext()),f=u.display?u.width:0,w=f/2,m=function(N){return Vt(s,N,f)};let D,Y,G,B,C,y,I,v,k,Q,O,_;if(a==="top")D=m(this.bottom),y=this.bottom-d,v=D-w,Q=m(t.top)+w,_=t.bottom;else if(a==="bottom")D=m(this.top),Q=t.top,_=m(t.bottom)-w,y=D+w,v=this.top+d;else if(a==="left")D=m(this.right),C=this.right-d,I=D-w,k=m(t.left)+w,O=t.right;else if(a==="right")D=m(this.left),k=t.left,O=m(t.right)-w,C=D+w,I=this.left+d;else if(e==="x"){if(a==="center")D=m((t.top+t.bottom)/2+.5);else if(P(a)){const N=Object.keys(a)[0],K=a[N];D=m(this.chart.scales[N].getPixelForValue(K))}Q=t.top,_=t.bottom,y=D+w,v=y+d}else if(e==="y"){if(a==="center")D=m((t.left+t.right)/2);else if(P(a)){const N=Object.keys(a)[0],K=a[N];D=m(this.chart.scales[N].getPixelForValue(K))}C=D-w,I=C-d,k=t.left,O=t.right}const lt=E(n.ticks.maxTicksLimit,h),L=Math.max(1,Math.ceil(h/lt));for(Y=0;Y<h;Y+=L){const N=this.getContext(Y),K=o.setContext(N),ut=r.setContext(N),it=K.lineWidth,ce=K.color,Ei=ut.dash||[],he=ut.dashOffset,He=K.tickWidth,Ve=K.tickColor,Ne=K.tickBorderDash||[],je=K.tickBorderDashOffset;G=kc(this,Y,A),G!==void 0&&(B=Vt(s,G,it),l?C=I=k=O=B:y=v=Q=_=B,g.push({tx1:C,ty1:y,tx2:I,ty2:v,x1:k,y1:Q,x2:O,y2:_,width:it,color:ce,borderDash:Ei,borderDashOffset:he,tickWidth:He,tickColor:Ve,tickBorderDash:Ne,tickBorderDashOffset:je}))}return this._ticksLength=h,this._borderValue=D,g}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,a=this.isHorizontal(),r=this.ticks,{align:A,crossAlign:l,padding:c,mirror:h}=o,d=Oe(s.grid),g=d+c,u=h?-c:g,f=-ht(this.labelRotation),w=[];let m,D,Y,G,B,C,y,I,v,k,Q,O,_="middle";if(n==="top")C=this.bottom-u,y=this._getXAxisLabelAlignment();else if(n==="bottom")C=this.top+u,y=this._getXAxisLabelAlignment();else if(n==="left"){const L=this._getYAxisLabelAlignment(d);y=L.textAlign,B=L.x}else if(n==="right"){const L=this._getYAxisLabelAlignment(d);y=L.textAlign,B=L.x}else if(e==="x"){if(n==="center")C=(t.top+t.bottom)/2+g;else if(P(n)){const L=Object.keys(n)[0],N=n[L];C=this.chart.scales[L].getPixelForValue(N)+g}y=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")B=(t.left+t.right)/2-g;else if(P(n)){const L=Object.keys(n)[0],N=n[L];B=this.chart.scales[L].getPixelForValue(N)}y=this._getYAxisLabelAlignment(d).textAlign}e==="y"&&(A==="start"?_="top":A==="end"&&(_="bottom"));const lt=this._getLabelSizes();for(m=0,D=r.length;m<D;++m){Y=r[m],G=Y.label;const L=o.setContext(this.getContext(m));I=this.getPixelForTick(m)+o.labelOffset,v=this._resolveTickFontOptions(m),k=v.lineHeight,Q=F(G)?G.length:1;const N=Q/2,K=L.color,ut=L.textStrokeColor,it=L.textStrokeWidth;let ce=y;a?(B=I,y==="inner"&&(m===D-1?ce=this.options.reverse?"left":"right":m===0?ce=this.options.reverse?"right":"left":ce="center"),n==="top"?l==="near"||f!==0?O=-Q*k+k/2:l==="center"?O=-lt.highest.height/2-N*k+k:O=-lt.highest.height+k/2:l==="near"||f!==0?O=k/2:l==="center"?O=lt.highest.height/2-N*k:O=lt.highest.height-Q*k,h&&(O*=-1),f!==0&&!L.showLabelBackdrop&&(B+=k/2*Math.sin(f))):(C=I,O=(1-Q)*k/2);let Ei;if(L.showLabelBackdrop){const he=tt(L.backdropPadding),He=lt.heights[m],Ve=lt.widths[m];let Ne=O-he.top,je=0-he.left;switch(_){case"middle":Ne-=He/2;break;case"bottom":Ne-=He;break}switch(y){case"center":je-=Ve/2;break;case"right":je-=Ve;break}Ei={left:je,top:Ne,width:Ve+he.width,height:He+he.height,color:L.backdropColor}}w.push({label:G,font:v,textOffset:O,options:{rotation:f,color:K,strokeColor:ut,strokeWidth:it,textAlign:ce,textBaseline:_,translation:[B,C],backdrop:Ei}})}return w}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ht(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,A=a.widest.width;let l,c;return e==="left"?n?(c=this.right+o,s==="near"?l="left":s==="center"?(l="center",c+=A/2):(l="right",c+=A)):(c=this.right-r,s==="near"?l="right":s==="center"?(l="center",c-=A/2):(l="left",c=this.left)):e==="right"?n?(c=this.left+o,s==="near"?l="right":s==="center"?(l="center",c-=A/2):(l="left",c-=A)):(c=this.left+r,s==="near"?l="left":s==="center"?(l="center",c+=A/2):(l="right",c=this.right)):l="right",{textAlign:l,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(A,l,c)=>{!c.width||!c.color||(s.save(),s.lineWidth=c.width,s.strokeStyle=c.color,s.setLineDash(c.borderDash||[]),s.lineDashOffset=c.borderDashOffset,s.beginPath(),s.moveTo(A.x,A.y),s.lineTo(l.x,l.y),s.stroke(),s.restore())};if(e.display)for(o=0,a=n.length;o<a;++o){const A=n[o];e.drawOnChartArea&&r({x:A.x1,y:A.y1},{x:A.x2,y:A.y2},A),e.drawTicks&&r({x:A.tx1,y:A.ty1},{x:A.tx2,y:A.ty2},{color:A.tickColor,width:A.tickWidth,borderDash:A.tickBorderDash,borderDashOffset:A.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;const r=n.setContext(this.getContext(0)).lineWidth,A=this._borderValue;let l,c,h,d;this.isHorizontal()?(l=Vt(t,this.left,a)-a/2,c=Vt(t,this.right,r)+r/2,h=d=A):(h=Vt(t,this.top,a)-a/2,d=Vt(t,this.bottom,r)+r/2,l=c=A),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(l,h),e.lineTo(c,d),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&ii(s,n);const o=this.getLabelItems(t);for(const a of o){const r=a.options,A=a.font,l=a.label,c=a.textOffset;Nt(s,l,0,c,A,r)}n&&si(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=J(s.font),a=tt(s.padding),r=s.align;let A=o.lineHeight/2;e==="bottom"||e==="center"||P(e)?(A+=a.bottom,F(s.text)&&(A+=o.lineHeight*(s.text.length-1))):A+=a.top;const{titleX:l,titleY:c,maxWidth:h,rotation:d}=Tc(this,A,e,r);Nt(t,s.text,0,0,o,{color:s.color,maxWidth:h,rotation:d,textAlign:zc(r,e,n),textBaseline:"middle",translation:[l,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=E(t.grid&&t.grid.z,-1),n=E(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Jt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[s]===this.id&&(!t||r.type===t)&&n.push(r)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return J(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class wi{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;Rc(e)&&(s=this.register(e));const n=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,Lc(t,a,s),this.override&&Z.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in Z[n]&&(delete Z[n][s],this.override&&delete Ht[s])}}function Lc(i,t,e){const s=we(Object.create(null),[e?Z.get(e):{},Z.get(t),i.defaults]);Z.set(t,s),i.defaultRoutes&&Sc(t,i.defaultRoutes),i.descriptors&&Z.describe(t,i.descriptors)}function Sc(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),a=t[e].split("."),r=a.pop(),A=a.join(".");Z.route(o,n,A,r)})}function Rc(i){return"id"in i&&"defaults"in i}class Fc{constructor(){this.controllers=new wi(dt,"datasets",!0),this.elements=new wi(gt,"elements"),this.plugins=new wi(Object,"plugins"),this.scales=new wi(Jt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):T(n,a=>{const r=s||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,s){const n=Si(t);S(s["before"+n],[],s),e[t](s),S(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var mt=new Fc;class Hc{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),a=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,s,n){n=n||{};for(const o of t){const a=o.plugin,r=a[s],A=[e,n,o.options];if(S(r,A,a)===!1&&n.cancelable)return!1}return!0}invalidate(){z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=E(s.options&&s.options.plugins,{}),o=Vc(s);return n===!1&&!e?[]:jc(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,a)=>o.filter(r=>!a.some(A=>r.plugin.id===A.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function Vc(i){const t={},e=[],s=Object.keys(mt.plugins.items);for(let o=0;o<s.length;o++)e.push(mt.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const a=n[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function Nc(i,t){return!t&&i===!1?null:i===!0?{}:i}function jc(i,{plugins:t,localIds:e},s,n){const o=[],a=i.getContext();for(const r of t){const A=r.id,l=Nc(s[A],n);l!==null&&o.push({plugin:r,options:Wc(i.config,{plugin:r,local:e[A]},l,a)})}return o}function Wc(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),a=i.getOptionScopes(s,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function rs(i,t){const e=Z.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Zc(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function Uc(i,t){return i===t?"_index_":"_value_"}function uo(i){if(i==="x"||i==="y"||i==="r")return i}function Kc(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function As(i,...t){if(uo(i))return i;for(const e of t){const s=e.axis||Kc(e.position)||i.length>1&&uo(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function fo(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Xc(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return fo(i,"x",e[0])||fo(i,"y",e[0])}return{}}function Jc(i,t){const e=Ht[i.type]||{scales:{}},s=t.scales||{},n=rs(i.type,t),o=Object.create(null);return Object.keys(s).forEach(a=>{const r=s[a];if(!P(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const A=As(a,r,Xc(a,i),Z.scales[r.type]),l=Uc(A,n),c=e.scales||{};o[a]=me(Object.create(null),[{axis:A},r,c[A],c[l]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,A=a.indexAxis||rs(r,t),c=(Ht[r]||{}).scales||{};Object.keys(c).forEach(h=>{const d=Zc(h,A),g=a[d+"AxisID"]||d;o[g]=o[g]||Object.create(null),me(o[g],[{axis:d},s[g],c[h]])})}),Object.keys(o).forEach(a=>{const r=o[a];me(r,[Z.scales[r.type],Z.scale])}),o}function po(i){const t=i.options||(i.options={});t.plugins=E(t.plugins,{}),t.scales=Jc(i,t)}function wo(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function qc(i){return i=i||{},i.data=wo(i.data),po(i),i}const mo=new Map,Mo=new Set;function mi(i,t){let e=mo.get(i);return e||(e=t(),mo.set(i,e),Mo.add(e)),e}const ze=(i,t,e)=>{const s=Qt(t,e);s!==void 0&&i.add(s)};class _c{constructor(t){this._config=qc(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=wo(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),po(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return mi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return mi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return mi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return mi(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,a=this._cachedScopes(t,s),r=a.get(e);if(r)return r;const A=new Set;e.forEach(c=>{t&&(A.add(t),c.forEach(h=>ze(A,t,h))),c.forEach(h=>ze(A,n,h)),c.forEach(h=>ze(A,Ht[o]||{},h)),c.forEach(h=>ze(A,Z,h)),c.forEach(h=>ze(A,Wi,h))});const l=Array.from(A);return l.length===0&&l.push(Object.create(null)),Mo.has(e)&&a.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ht[e]||{},Z.datasets[e]||{},{type:e},Z,Wi]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Do(this._resolverCache,t,n);let A=a;if(th(a,e)){o.$shared=!1,s=Pt(s)?s():s;const l=this.createResolver(t,s,r);A=ae(a,s,l)}for(const l of e)o[l]=A[l];return o}createResolver(t,e,s=[""],n){const{resolver:o}=Do(this._resolverCache,t,s);return P(e)?ae(o,e,void 0,n):o}}function Do(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:Xi(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},s.set(n,o)),o}const $c=i=>P(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||Pt(i[e]),!1);function th(i,t){const{isScriptable:e,isIndexable:s}=Dn(i);for(const n of t){const o=e(n),a=s(n),r=(a||o)&&i[n];if(o&&(Pt(r)||$c(r))||a&&F(r))return!0}return!1}var eh="4.4.0";const ih=["top","bottom","left","right","chartArea"];function bo(i,t){return i==="top"||i==="bottom"||ih.indexOf(i)===-1&&t==="x"}function Bo(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Go(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),S(e&&e.onComplete,[i],t)}function sh(i){const t=i.chart,e=t.options.animation;S(e&&e.onProgress,[i],t)}function Yo(i){return In()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Mi={},xo=i=>{const t=Yo(i);return Object.values(Mi).filter(e=>e.canvas===t).pop()};function nh(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const a=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=a)}}}function oh(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}function Di(i,t,e){return i.options.clip?i[e]:t[e]}function ah(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:Di(e,t,"left"),right:Di(e,t,"right"),top:Di(s,t,"top"),bottom:Di(s,t,"bottom")}:t}class yt{static register(...t){mt.add(...t),Co()}static unregister(...t){mt.remove(...t),Co()}constructor(t,e){const s=this.config=new _c(e),n=Yo(t),o=xo(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Gc(n)),this.platform.updateConfig(s);const r=this.platform.acquireContext(n,a.aspectRatio),A=r&&r.canvas,l=A&&A.height,c=A&&A.width;if(this.id=AA(),this.ctx=r,this.canvas=A,this.width=c,this.height=l,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Hc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=YA(h=>this.update(h),a.resizeDelay||0),this._dataChanges=[],Mi[this.id]=this,!r||!A){console.error("Failed to create chart: can't acquire context from the given item");return}Ct.listen(this,"complete",Go),Ct.listen(this,"progress",sh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return z(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return mt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():vn(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return wn(this.canvas,this.ctx),this}stop(){return Ct.stop(this),this}resize(t,e){Ct.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=s.devicePixelRatio||this.platform.getDevicePixelRatio(),A=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,vn(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),S(s.onResize,[this,a],this),this.attached&&this._doResize(A)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};T(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],A=As(a,r),l=A==="r",c=A==="x";return{options:r,dposition:l?"chartArea":c?"bottom":"left",dtype:l?"radialLinear":c?"category":"linear"}}))),T(o,a=>{const r=a.options,A=r.id,l=As(A,r),c=E(r.type,a.dtype);(r.position===void 0||bo(r.position,l)!==bo(a.dposition))&&(r.position=a.dposition),n[A]=!0;let h=null;if(A in s&&s[A].type===c)h=s[A];else{const d=mt.getScale(c);h=new d({id:A,type:c,ctx:this.ctx,chart:this}),s[h.id]=h}h.init(r,t)}),T(n,(a,r)=>{a||delete s[r]}),T(s,a=>{et.configure(this,a,a.options),et.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Bo("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let a=this.getDatasetMeta(s);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=r,a.indexAxis=o.indexAxis||rs(r,this.options),a.order=o.order||0,a.index=s,a.label=""+o.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{const A=mt.getController(r),{datasetElementType:l,dataElementType:c}=Z.datasets[r];Object.assign(A,{dataElementType:mt.getElement(c),datasetElementType:l&&mt.getElement(l)}),a.controller=new A(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){T(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let l=0,c=this.data.datasets.length;l<c;l++){const{controller:h}=this.getDatasetMeta(l),d=!n&&o.indexOf(h)===-1;h.buildOrUpdateElements(d),a=Math.max(+h.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),n||T(o,l=>{l.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Bo("z","_idx"));const{_active:r,_lastEvent:A}=this;A?this._eventHandler(A,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){T(this.scales,t=>{et.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!_s(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const a=s==="_removeElements"?-o:o;nh(t,n,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!_s(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;et.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],T(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,Pt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Ct.has(this)?this.attached&&!Ct.running(this)&&Ct.start(this):(this.draw(),Go({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resize(s,n),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const a=e[n];(!t||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=ah(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(n&&ii(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&si(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return xt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=ic.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=zt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);Me(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(o,{visible:s}),this.update(r=>r.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Ct.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),wn(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Mi[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},n=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};T(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(A,l)=>{e.addEventListener(this,A,l),t[A]=l},n=(A,l)=>{t[A]&&(e.removeEventListener(this,A,l),delete t[A])},o=(A,l)=>{this.canvas&&this.resize(A,l)};let a;const r=()=>{n("attach",r),this.attached=!0,this.resize(),s("resize",o),s("detach",a)};a=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){T(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},T(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,a,r,A;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),r=0,A=t.length;r<A;++r){a=t[r];const l=a&&this.getDatasetMeta(a.datasetIndex).controller;l&&l[n+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!Je(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(A,l)=>A.filter(c=>!l.some(h=>c.datasetIndex===h.datasetIndex&&c.index===h.index)),a=o(e,t),r=s?t:o(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,s,a),A=uA(t),l=oh(t,this._lastEvent,s,A);s&&(this._lastEvent=null,S(o.onHover,[t,r,this],this),A&&S(o.onClick,[t,r,this],this));const c=!Je(r,n);return(c||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=l,c}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}x(yt,"defaults",Z),x(yt,"instances",Mi),x(yt,"overrides",Ht),x(yt,"registry",mt),x(yt,"version",eh),x(yt,"getChart",xo);function Co(){return T(yt.instances,i=>i._plugins.invalidate())}function rh(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:A}=t;let l=n/r;i.beginPath(),i.arc(o,a,r,s-l,e+l),A>n?(l=n/A,i.arc(o,a,A,e+l,s-l,!0)):i.arc(o,a,n,e+U,s-U),i.closePath(),i.clip()}function Ah(i){return Ki(i,["outerStart","outerEnd","innerStart","innerEnd"])}function lh(i,t,e,s){const n=Ah(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,s*t/2),r=A=>{const l=(e-Math.min(o,A))*s/2;return q(A,0,Math.min(o,l))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:q(n.innerStart,0,a),innerEnd:q(n.innerEnd,0,a)}}function le(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function bi(i,t,e,s,n,o){const{x:a,y:r,startAngle:A,pixelMargin:l,innerRadius:c}=t,h=Math.max(t.outerRadius+s+e-l,0),d=c>0?c+s+e+l:0;let g=0;const u=n-A;if(s){const L=c>0?c-s:0,N=h>0?h-s:0,K=(L+N)/2,ut=K!==0?u*K/(K+s):u;g=(u-ut)/2}const f=Math.max(.001,u*h-e/H)/h,w=(u-f)/2,m=A+w+g,D=n-w-g,{outerStart:Y,outerEnd:G,innerStart:B,innerEnd:C}=lh(t,d,h,D-m),y=h-Y,I=h-G,v=m+Y/y,k=D-G/I,Q=d+B,O=d+C,_=m+B/Q,lt=D-C/O;if(i.beginPath(),o){const L=(v+k)/2;if(i.arc(a,r,h,v,L),i.arc(a,r,h,L,k),G>0){const it=le(I,k,a,r);i.arc(it.x,it.y,G,k,D+U)}const N=le(O,D,a,r);if(i.lineTo(N.x,N.y),C>0){const it=le(O,lt,a,r);i.arc(it.x,it.y,C,D+U,lt+Math.PI)}const K=(D-C/d+(m+B/d))/2;if(i.arc(a,r,d,D-C/d,K,!0),i.arc(a,r,d,K,m+B/d,!0),B>0){const it=le(Q,_,a,r);i.arc(it.x,it.y,B,_+Math.PI,m-U)}const ut=le(y,m,a,r);if(i.lineTo(ut.x,ut.y),Y>0){const it=le(y,v,a,r);i.arc(it.x,it.y,Y,m-U,v)}}else{i.moveTo(a,r);const L=Math.cos(v)*h+a,N=Math.sin(v)*h+r;i.lineTo(L,N);const K=Math.cos(k)*h+a,ut=Math.sin(k)*h+r;i.lineTo(K,ut)}i.closePath()}function ch(i,t,e,s,n){const{fullCircles:o,startAngle:a,circumference:r}=t;let A=t.endAngle;if(o){bi(i,t,e,s,A,n);for(let l=0;l<o;++l)i.fill();isNaN(r)||(A=a+(r%V||V))}return bi(i,t,e,s,A,n),i.fill(),A}function hh(i,t,e,s,n){const{fullCircles:o,startAngle:a,circumference:r,options:A}=t,{borderWidth:l,borderJoinStyle:c,borderDash:h,borderDashOffset:d}=A,g=A.borderAlign==="inner";if(!l)return;i.setLineDash(h||[]),i.lineDashOffset=d,g?(i.lineWidth=l*2,i.lineJoin=c||"round"):(i.lineWidth=l,i.lineJoin=c||"bevel");let u=t.endAngle;if(o){bi(i,t,e,s,u,n);for(let f=0;f<o;++f)i.stroke();isNaN(r)||(u=a+(r%V||V))}g&&rh(i,t,u),o||(bi(i,t,e,s,u,n),i.stroke())}class Te extends gt{constructor(e){super();x(this,"circumference");x(this,"endAngle");x(this,"fullCircles");x(this,"innerRadius");x(this,"outerRadius");x(this,"pixelMargin");x(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,s,n){const o=this.getProps(["x","y"],n),{angle:a,distance:r}=nn(o,{x:e,y:s}),{startAngle:A,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),g=(this.options.spacing+this.options.borderWidth)/2,f=E(d,l-A)>=V||be(a,A,l),w=Gt(r,c+g,h+g);return f&&w}getCenterPoint(e){const{x:s,y:n,startAngle:o,endAngle:a,innerRadius:r,outerRadius:A}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:l,spacing:c}=this.options,h=(o+a)/2,d=(r+A+c+l)/2;return{x:s+Math.cos(h)*d,y:n+Math.sin(h)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:s,circumference:n}=this,o=(s.offset||0)/4,a=(s.spacing||0)/2,r=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=n>V?Math.floor(n/V):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const A=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(A)*o,Math.sin(A)*o);const l=1-Math.sin(Math.min(H,n||0)),c=o*l;e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,ch(e,this,c,a,r),hh(e,this,c,a,r),e.restore()}}x(Te,"id","arc"),x(Te,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),x(Te,"defaultRoutes",{backgroundColor:"backgroundColor"}),x(Te,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function yo(i,t,e=t){i.lineCap=E(e.borderCapStyle,t.borderCapStyle),i.setLineDash(E(e.borderDash,t.borderDash)),i.lineDashOffset=E(e.borderDashOffset,t.borderDashOffset),i.lineJoin=E(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=E(e.borderWidth,t.borderWidth),i.strokeStyle=E(e.borderColor,t.borderColor)}function dh(i,t,e){i.lineTo(e.x,e.y)}function gh(i){return i.stepped?TA:i.tension||i.cubicInterpolationMode==="monotone"?LA:dh}function Io(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:a,end:r}=t,A=Math.max(n,a),l=Math.min(o,r),c=n<a&&o<a||n>r&&o>r;return{count:s,start:A,loop:t.loop,ilen:l<A&&!c?s+l-A:l-A}}function uh(i,t,e,s){const{points:n,options:o}=t,{count:a,start:r,loop:A,ilen:l}=Io(n,e,s),c=gh(o);let{move:h=!0,reverse:d}=s||{},g,u,f;for(g=0;g<=l;++g)u=n[(r+(d?l-g:g))%a],!u.skip&&(h?(i.moveTo(u.x,u.y),h=!1):c(i,f,u,d,o.stepped),f=u);return A&&(u=n[(r+(d?l:0))%a],c(i,f,u,d,o.stepped)),!!A}function fh(i,t,e,s){const n=t.points,{count:o,start:a,ilen:r}=Io(n,e,s),{move:A=!0,reverse:l}=s||{};let c=0,h=0,d,g,u,f,w,m;const D=G=>(a+(l?r-G:G))%o,Y=()=>{f!==w&&(i.lineTo(c,w),i.lineTo(c,f),i.lineTo(c,m))};for(A&&(g=n[D(0)],i.moveTo(g.x,g.y)),d=0;d<=r;++d){if(g=n[D(d)],g.skip)continue;const G=g.x,B=g.y,C=G|0;C===u?(B<f?f=B:B>w&&(w=B),c=(h*c+G)/++h):(Y(),i.lineTo(G,B),u=C,h=0,f=w=B),m=B}Y()}function ls(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?fh:uh}function ph(i){return i.stepped?fl:i.tension||i.cubicInterpolationMode==="monotone"?pl:Ut}function wh(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),yo(i,t.options),i.stroke(n)}function mh(i,t,e,s){const{segments:n,options:o}=t,a=ls(t);for(const r of n)yo(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Mh=typeof Path2D=="function";function Dh(i,t,e,s){Mh&&!t.options.segment?wh(i,t,e,s):mh(i,t,e,s)}class Tt extends gt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;rl(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Bl(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,a=Tn(this,{property:e,start:n,end:n});if(!a.length)return;const r=[],A=ph(s);let l,c;for(l=0,c=a.length;l<c;++l){const{start:h,end:d}=a[l],g=o[h],u=o[d];if(g===u){r.push(g);continue}const f=Math.abs((n-g[e])/(u[e]-g[e])),w=A(g,u,f,s.stepped);w[e]=t[e],r.push(w)}return r.length===1?r[0]:r}pathSegment(t,e,s){return ls(this)(t,this,e,s)}path(t,e,s){const n=this.segments,o=ls(this);let a=this._loop;e=e||0,s=s||this.points.length-e;for(const r of n)a&=o(t,this,r,{start:e,end:e+s-1});return!!a}draw(t,e,s,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Dh(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}x(Tt,"id","line"),x(Tt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),x(Tt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),x(Tt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function vo(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}class Bi extends gt{constructor(e){super();x(this,"parsed");x(this,"skip");x(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,s,n){const o=this.options,{x:a,y:r}=this.getProps(["x","y"],n);return Math.pow(e-a,2)+Math.pow(s-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,s){return vo(this,e,"x",s)}inYRange(e,s){return vo(this,e,"y",s)}getCenterPoint(e){const{x:s,y:n}=this.getProps(["x","y"],e);return{x:s,y:n}}size(e){e=e||this.options||{};let s=e.radius||0;s=Math.max(s,s&&e.hoverRadius||0);const n=s&&e.borderWidth||0;return(s+n)*2}draw(e,s){const n=this.options;this.skip||n.radius<.1||!xt(this,s,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,Ui(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}x(Bi,"id","point"),x(Bi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),x(Bi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Eo(i,t){const{x:e,y:s,base:n,width:o,height:a}=i.getProps(["x","y","base","width","height"],t);let r,A,l,c,h;return i.horizontal?(h=a/2,r=Math.min(e,n),A=Math.max(e,n),l=s-h,c=s+h):(h=o/2,r=e-h,A=e+h,l=Math.min(s,n),c=Math.max(s,n)),{left:r,top:l,right:A,bottom:c}}function Lt(i,t,e,s){return i?0:q(t,e,s)}function bh(i,t,e){const s=i.options.borderWidth,n=i.borderSkipped,o=Mn(s);return{t:Lt(n.top,o.top,0,e),r:Lt(n.right,o.right,0,t),b:Lt(n.bottom,o.bottom,0,e),l:Lt(n.left,o.left,0,t)}}function Bh(i,t,e){const{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,o=jt(n),a=Math.min(t,e),r=i.borderSkipped,A=s||P(n);return{topLeft:Lt(!A||r.top||r.left,o.topLeft,0,a),topRight:Lt(!A||r.top||r.right,o.topRight,0,a),bottomLeft:Lt(!A||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Lt(!A||r.bottom||r.right,o.bottomRight,0,a)}}function Gh(i){const t=Eo(i),e=t.right-t.left,s=t.bottom-t.top,n=bh(i,e/2,s/2),o=Bh(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function cs(i,t,e,s){const n=t===null,o=e===null,r=i&&!(n&&o)&&Eo(i,s);return r&&(n||Gt(t,r.left,r.right))&&(o||Gt(e,r.top,r.bottom))}function Yh(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function xh(i,t){i.rect(t.x,t.y,t.w,t.h)}function hs(i,t,e={}){const s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-s,a=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+a,radius:i.radius}}class Gi extends gt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:s,backgroundColor:n}}=this,{inner:o,outer:a}=Gh(this),r=Yh(a.radius)?xe:xh;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,hs(a,e,o)),t.clip(),r(t,hs(o,-e,a)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),r(t,hs(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return cs(this,t,e,s)}inXRange(t,e){return cs(this,t,null,e)}inYRange(t,e){return cs(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}x(Gi,"id","bar"),x(Gi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),x(Gi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Ch=Object.freeze({__proto__:null,ArcElement:Te,BarElement:Gi,LineElement:Tt,PointElement:Bi});const ds=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ko=ds.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function Qo(i){return ds[i%ds.length]}function Po(i){return ko[i%ko.length]}function yh(i,t){return i.borderColor=Qo(t),i.backgroundColor=Po(t),++t}function Ih(i,t){return i.backgroundColor=i.data.map(()=>Qo(t++)),t}function vh(i,t){return i.backgroundColor=i.data.map(()=>Po(t++)),t}function Eh(i){let t=0;return(e,s)=>{const n=i.getDatasetMeta(s).controller;n instanceof Kt?t=Ih(e,t):n instanceof Ie?t=vh(e,t):n&&(t=yh(e,t))}}function Oo(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function kh(i){return i&&(i.borderColor||i.backgroundColor)}var Qh={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;const{data:{datasets:s},options:n}=i.config,{elements:o}=n;if(!e.forceOverride&&(Oo(s)||kh(n)||o&&Oo(o)))return;const a=Eh(i);s.forEach(a)}};function Ph(i,t,e,s,n){const o=n.samples||s;if(o>=e)return i.slice(t,t+e);const a=[],r=(e-2)/(o-2);let A=0;const l=t+e-1;let c=t,h,d,g,u,f;for(a[A++]=i[c],h=0;h<o-2;h++){let w=0,m=0,D;const Y=Math.floor((h+1)*r)+1+t,G=Math.min(Math.floor((h+2)*r)+1,e)+t,B=G-Y;for(D=Y;D<G;D++)w+=i[D].x,m+=i[D].y;w/=B,m/=B;const C=Math.floor(h*r)+1+t,y=Math.min(Math.floor((h+1)*r)+1,e)+t,{x:I,y:v}=i[c];for(g=u=-1,D=C;D<y;D++)u=.5*Math.abs((I-w)*(i[D].y-v)-(I-i[D].x)*(m-v)),u>g&&(g=u,d=i[D],f=D);a[A++]=d,c=f}return a[A++]=i[l],a}function Oh(i,t,e,s){let n=0,o=0,a,r,A,l,c,h,d,g,u,f;const w=[],m=t+e-1,D=i[t].x,G=i[m].x-D;for(a=t;a<t+e;++a){r=i[a],A=(r.x-D)/G*s,l=r.y;const B=A|0;if(B===c)l<u?(u=l,h=a):l>f&&(f=l,d=a),n=(o*n+r.x)/++o;else{const C=a-1;if(!z(h)&&!z(d)){const y=Math.min(h,d),I=Math.max(h,d);y!==g&&y!==C&&w.push({...i[y],x:n}),I!==g&&I!==C&&w.push({...i[I],x:n})}a>0&&C!==g&&w.push(i[C]),w.push(r),c=B,o=0,u=f=l,h=d=g=a}}return w}function zo(i){if(i._decimated){const t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function To(i){i.data.datasets.forEach(t=>{zo(t)})}function zh(i,t){const e=t.length;let s=0,n;const{iScale:o}=i,{min:a,max:r,minDefined:A,maxDefined:l}=o.getUserBounds();return A&&(s=q(Yt(t,o.axis,a).lo,0,e-1)),l?n=q(Yt(t,o.axis,r).hi+1,s,e)-s:n=e-s,{start:s,count:n}}var Th={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){To(i);return}const s=i.width;i.data.datasets.forEach((n,o)=>{const{_data:a,indexAxis:r}=n,A=i.getDatasetMeta(o),l=a||n.data;if(Ce([r,i.options.indexAxis])==="y"||!A.controller.supportsDecimation)return;const c=i.scales[A.xAxisID];if(c.type!=="linear"&&c.type!=="time"||i.options.parsing)return;let{start:h,count:d}=zh(A,l);const g=e.threshold||4*s;if(d<=g){zo(n);return}z(a)&&(n._data=l,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(f){this._data=f}}));let u;switch(e.algorithm){case"lttb":u=Ph(l,h,d,s,e);break;case"min-max":u=Oh(l,h,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=u})},destroy(i){To(i)}};function Lh(i,t,e){const s=i.segments,n=i.points,o=t.points,a=[];for(const r of s){let{start:A,end:l}=r;l=us(A,l,n);const c=gs(e,n[A],n[l],r.loop);if(!t.segments){a.push({source:r,target:c,start:n[A],end:n[l]});continue}const h=Tn(t,c);for(const d of h){const g=gs(e,o[d.start],o[d.end],d.loop),u=zn(r,n,g);for(const f of u)a.push({source:f,target:d,start:{[e]:Lo(c,g,"start",Math.max)},end:{[e]:Lo(c,g,"end",Math.min)}})}}return a}function gs(i,t,e,s){if(s)return;let n=t[i],o=e[i];return i==="angle"&&(n=At(n),o=At(o)),{property:i,start:n,end:o}}function Sh(i,t){const{x:e=null,y:s=null}=i||{},n=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=us(a,r,n);const A=n[a],l=n[r];s!==null?(o.push({x:A.x,y:s}),o.push({x:l.x,y:s})):e!==null&&(o.push({x:e,y:A.y}),o.push({x:e,y:l.y}))}),o}function us(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function Lo(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function So(i,t){let e=[],s=!1;return F(i)?(s=!0,e=i):e=Sh(i,t),e.length?new Tt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Ro(i){return i&&i.fill!==!1}function Rh(i,t,e){let n=i[t].fill;const o=[t];let a;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!W(n))return n;if(a=i[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function Fh(i,t,e){const s=jh(i);if(P(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return W(n)&&Math.floor(n)===n?Hh(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Hh(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function Vh(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:P(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Nh(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:P(i)?s=i.value:s=t.getBaseValue(),s}function jh(i){const t=i.options,e=t.fill;let s=E(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function Wh(i){const{scale:t,index:e,line:s}=i,n=[],o=s.segments,a=s.points,r=Zh(t,e);r.push(So({x:null,y:t.bottom},s));for(let A=0;A<o.length;A++){const l=o[A];for(let c=l.start;c<=l.end;c++)Uh(n,a[c],r)}return new Tt({points:n,options:{}})}function Zh(i,t){const e=[],s=i.getMatchingVisibleMetas("line");for(let n=0;n<s.length;n++){const o=s[n];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Uh(i,t,e){const s=[];for(let n=0;n<e.length;n++){const o=e[n],{first:a,last:r,point:A}=Kh(o,t,"x");if(!(!A||a&&r)){if(a)s.unshift(A);else if(i.push(A),!r)break}}i.push(...s)}function Kh(i,t,e){const s=i.interpolate(t,e);if(!s)return{};const n=s[e],o=i.segments,a=i.points;let r=!1,A=!1;for(let l=0;l<o.length;l++){const c=o[l],h=a[c.start][e],d=a[c.end][e];if(Gt(n,h,d)){r=n===h,A=n===d;break}}return{first:r,last:A,point:s}}class Fo{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){const{x:n,y:o,radius:a}=this;return e=e||{start:0,end:V},t.arc(n,o,a,e.end,e.start,!0),!s.bounds}interpolate(t){const{x:e,y:s,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:s+Math.sin(o)*n,angle:o}}}function Xh(i){const{chart:t,fill:e,line:s}=i;if(W(e))return Jh(t,e);if(e==="stack")return Wh(i);if(e==="shape")return!0;const n=qh(i);return n instanceof Fo?n:So(n,s)}function Jh(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function qh(i){return(i.scale||{}).getPointPositionForValue?$h(i):_h(i)}function _h(i){const{scale:t={},fill:e}=i,s=Vh(e,t);if(W(s)){const n=t.isHorizontal();return{x:n?s:null,y:n?null:s}}return null}function $h(i){const{scale:t,fill:e}=i,s=t.options,n=t.getLabels().length,o=s.reverse?t.max:t.min,a=Nh(e,t,o),r=[];if(s.grid.circular){const A=t.getPointPositionForValue(0,o);return new Fo({x:A.x,y:A.y,radius:t.getDistanceFromCenterForValue(a)})}for(let A=0;A<n;++A)r.push(t.getPointPositionForValue(A,a));return r}function fs(i,t,e){const s=Xh(t),{line:n,scale:o,axis:a}=t,r=n.options,A=r.fill,l=r.backgroundColor,{above:c=l,below:h=l}=A||{};s&&n.points.length&&(ii(i,e),td(i,{line:n,target:s,above:c,below:h,area:e,scale:o,axis:a}),si(i))}function td(i,t){const{line:e,target:s,above:n,below:o,area:a,scale:r}=t,A=e._loop?"angle":t.axis;i.save(),A==="x"&&o!==n&&(Ho(i,s,a.top),Vo(i,{line:e,target:s,color:n,scale:r,property:A}),i.restore(),i.save(),Ho(i,s,a.bottom)),Vo(i,{line:e,target:s,color:o,scale:r,property:A}),i.restore()}function Ho(i,t,e){const{segments:s,points:n}=t;let o=!0,a=!1;i.beginPath();for(const r of s){const{start:A,end:l}=r,c=n[A],h=n[us(A,l,n)];o?(i.moveTo(c.x,c.y),o=!1):(i.lineTo(c.x,e),i.lineTo(c.x,c.y)),a=!!t.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(h.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function Vo(i,t){const{line:e,target:s,property:n,color:o,scale:a}=t,r=Lh(e,s,n);for(const{source:A,target:l,start:c,end:h}of r){const{style:{backgroundColor:d=o}={}}=A,g=s!==!0;i.save(),i.fillStyle=d,ed(i,a,g&&gs(n,c,h)),i.beginPath();const u=!!e.pathSegment(i,A);let f;if(g){u?i.closePath():No(i,s,h,n);const w=!!s.pathSegment(i,l,{move:u,reverse:!0});f=u&&w,f||No(i,s,c,n)}i.closePath(),i.fill(f?"evenodd":"nonzero"),i.restore()}}function ed(i,t,e){const{top:s,bottom:n}=t.chart.chartArea,{property:o,start:a,end:r}=e||{};o==="x"&&(i.beginPath(),i.rect(a,s,r-a,n-s),i.clip())}function No(i,t,e,s){const n=t.interpolate(e,s);n&&i.lineTo(n.x,n.y)}var id={id:"filler",afterDatasetsUpdate(i,t,e){const s=(i.data.datasets||[]).length,n=[];let o,a,r,A;for(a=0;a<s;++a)o=i.getDatasetMeta(a),r=o.dataset,A=null,r&&r.options&&r instanceof Tt&&(A={visible:i.isDatasetVisible(a),index:a,fill:Fh(r,a,s),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=A,n.push(A);for(a=0;a<s;++a)A=n[a],!(!A||A.fill===!1)&&(A.fill=Rh(n,a,e.propagate))},beforeDraw(i,t,e){const s=e.drawTime==="beforeDraw",n=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let a=n.length-1;a>=0;--a){const r=n[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),s&&r.fill&&fs(i.ctx,r,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const o=s[n].$filler;Ro(o)&&fs(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!Ro(s)||e.drawTime!=="beforeDatasetDraw"||fs(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const jo=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},sd=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Wo extends gt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=S(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=J(s.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:A}=jo(s,o);let l,c;e.font=n.string,this.isHorizontal()?(l=this.maxWidth,c=this._fitRows(a,o,r,A)+10):(c=this.maxHeight,l=this._fitCols(a,n,r,A)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,A=this.legendHitBoxes=[],l=this.lineWidths=[0],c=n+r;let h=t;o.textAlign="left",o.textBaseline="middle";let d=-1,g=-c;return this.legendItems.forEach((u,f)=>{const w=s+e/2+o.measureText(u.text).width;(f===0||l[l.length-1]+w+2*r>a)&&(h+=c,l[l.length-(f>0?0:1)]=0,g+=c,d++),A[f]={left:0,top:g,row:d,width:w,height:n},l[l.length-1]+=w+r}),h}_fitCols(t,e,s,n){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,A=this.legendHitBoxes=[],l=this.columnSizes=[],c=a-t;let h=r,d=0,g=0,u=0,f=0;return this.legendItems.forEach((w,m)=>{const{itemWidth:D,itemHeight:Y}=nd(s,e,o,w,n);m>0&&g+Y+2*r>c&&(h+=d+r,l.push({width:d,height:g}),u+=d+r,f++,d=g=0),A[m]={left:u,top:g,col:f,width:D,height:Y},d=Math.max(d,D),g+=Y+r}),h+=d,l.push({width:d,height:g}),h}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,a=Ae(o,this.left,this.width);if(this.isHorizontal()){let r=0,A=$(s,this.left+n,this.right-this.lineWidths[r]);for(const l of e)r!==l.row&&(r=l.row,A=$(s,this.left+n,this.right-this.lineWidths[r])),l.top+=this.top+t+n,l.left=a.leftForLtr(a.x(A),l.width),A+=l.width+n}else{let r=0,A=$(s,this.top+t+n,this.bottom-this.columnSizes[r].height);for(const l of e)l.col!==r&&(r=l.col,A=$(s,this.top+t+n,this.bottom-this.columnSizes[r].height)),l.top=A,l.left+=this.left+n,l.left=a.leftForLtr(a.x(l.left),l.width),A+=l.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ii(t,this),this._draw(),si(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:a}=t,r=Z.color,A=Ae(t.rtl,this.left,this.width),l=J(a.font),{padding:c}=a,h=l.size,d=h/2;let g;this.drawTitle(),n.textAlign=A.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=l.string;const{boxWidth:u,boxHeight:f,itemHeight:w}=jo(a,h),m=function(C,y,I){if(isNaN(u)||u<=0||isNaN(f)||f<0)return;n.save();const v=E(I.lineWidth,1);if(n.fillStyle=E(I.fillStyle,r),n.lineCap=E(I.lineCap,"butt"),n.lineDashOffset=E(I.lineDashOffset,0),n.lineJoin=E(I.lineJoin,"miter"),n.lineWidth=v,n.strokeStyle=E(I.strokeStyle,r),n.setLineDash(E(I.lineDash,[])),a.usePointStyle){const k={radius:f*Math.SQRT2/2,pointStyle:I.pointStyle,rotation:I.rotation,borderWidth:v},Q=A.xPlus(C,u/2),O=y+d;mn(n,k,Q,O,a.pointStyleWidth&&u)}else{const k=y+Math.max((h-f)/2,0),Q=A.leftForLtr(C,u),O=jt(I.borderRadius);n.beginPath(),Object.values(O).some(_=>_!==0)?xe(n,{x:Q,y:k,w:u,h:f,radius:O}):n.rect(Q,k,u,f),n.fill(),v!==0&&n.stroke()}n.restore()},D=function(C,y,I){Nt(n,I.text,C,y+w/2,l,{strikethrough:I.hidden,textAlign:A.textAlign(I.textAlign)})},Y=this.isHorizontal(),G=this._computeTitleHeight();Y?g={x:$(o,this.left+c,this.right-s[0]),y:this.top+c+G,line:0}:g={x:this.left+c,y:$(o,this.top+G+c,this.bottom-e[0].height),line:0},kn(this.ctx,t.textDirection);const B=w+c;this.legendItems.forEach((C,y)=>{n.strokeStyle=C.fontColor,n.fillStyle=C.fontColor;const I=n.measureText(C.text).width,v=A.textAlign(C.textAlign||(C.textAlign=a.textAlign)),k=u+d+I;let Q=g.x,O=g.y;A.setWidth(this.width),Y?y>0&&Q+k+c>this.right&&(O=g.y+=B,g.line++,Q=g.x=$(o,this.left+c,this.right-s[g.line])):y>0&&O+B>this.bottom&&(Q=g.x=Q+e[g.line].width+c,g.line++,O=g.y=$(o,this.top+G+c,this.bottom-e[g.line].height));const _=A.x(Q);if(m(_,O,C),Q=xA(v,Q+u+d,Y?Q+k:this.right,t.rtl),D(A.x(Q),O,C),Y)g.x+=k+c;else if(typeof C.text!="string"){const lt=l.lineHeight;g.y+=Zo(C,lt)+c}else g.y+=B}),Qn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=J(e.font),n=tt(e.padding);if(!e.display)return;const o=Ae(t.rtl,this.left,this.width),a=this.ctx,r=e.position,A=s.size/2,l=n.top+A;let c,h=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),c=this.top+l,h=$(t.align,h,this.right-d);else{const u=this.columnSizes.reduce((f,w)=>Math.max(f,w.height),0);c=l+$(t.align,this.top,this.bottom-u-t.labels.padding-this._computeTitleHeight())}const g=$(r,h,h+d);a.textAlign=o.textAlign(Vi(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,Nt(a,e.text,g,c,s)}_computeTitleHeight(){const t=this.options.title,e=J(t.font),s=tt(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Gt(t,this.left,this.right)&&Gt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],Gt(t,n.left,n.left+n.width)&&Gt(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!rd(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=sd(n,s);n&&!o&&S(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&S(e.onHover,[t,s,this],this)}else s&&S(e.onClick,[t,s,this],this)}}function nd(i,t,e,s,n){const o=od(s,i,t,e),a=ad(n,s,t.lineHeight);return{itemWidth:o,itemHeight:a}}function od(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+s.measureText(n).width}function ad(i,t,e){let s=i;return typeof t.text!="string"&&(s=Zo(t,e)),s}function Zo(i,t){const e=i.text?i.text.length:0;return t*e}function rd(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Ad={id:"legend",_element:Wo,start(i,t,e){const s=i.legend=new Wo({ctx:i.ctx,options:e,chart:i});et.configure(i,s,e),et.addBox(i,s)},stop(i){et.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;et.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(A=>{const l=A.controller.getStyle(e?0:void 0),c=tt(l.borderWidth);return{text:t[A.index].label,fillStyle:l.backgroundColor,fontColor:o,hidden:!A.visible,lineCap:l.borderCapStyle,lineDash:l.borderDash,lineDashOffset:l.borderDashOffset,lineJoin:l.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:l.borderColor,pointStyle:s||l.pointStyle,rotation:l.rotation,textAlign:n||l.textAlign,borderRadius:a&&(r||l.borderRadius),datasetIndex:A.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class ps extends gt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=F(s.text)?s.text.length:1;this._padding=tt(s.padding);const o=n*J(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:a}=this,r=a.align;let A=0,l,c,h;return this.isHorizontal()?(c=$(r,s,o),h=e+t,l=o-s):(a.position==="left"?(c=s+t,h=$(r,n,e),A=H*-.5):(c=o-t,h=$(r,e,n),A=H*.5),l=n-e),{titleX:c,titleY:h,maxWidth:l,rotation:A}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=J(e.font),o=s.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:A,rotation:l}=this._drawArgs(o);Nt(t,e.text,0,0,s,{color:e.color,maxWidth:A,rotation:l,textAlign:Vi(e.align),textBaseline:"middle",translation:[a,r]})}}function ld(i,t){const e=new ps({ctx:i.ctx,options:t,chart:i});et.configure(i,e,t),et.addBox(i,e),i.titleBlock=e}var cd={id:"title",_element:ps,start(i,t,e){ld(i,e)},stop(i){const t=i.titleBlock;et.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;et.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Yi=new WeakMap;var hd={id:"subtitle",start(i,t,e){const s=new ps({ctx:i.ctx,options:e,chart:i});et.configure(i,s,e),et.addBox(i,s),Yi.set(i,s)},stop(i){et.removeBox(i,Yi.get(i)),Yi.delete(i)},beforeUpdate(i,t,e){const s=Yi.get(i);et.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Le={average(i){if(!i.length)return!1;let t,e,s=0,n=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const r=a.tooltipPosition();s+=r.x,n+=r.y,++o}}return{x:s/o,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=i.length;o<a;++o){const A=i[o].element;if(A&&A.hasValue()){const l=A.getCenterPoint(),c=Fi(t,l);c<n&&(n=c,r=A)}}if(r){const A=r.tooltipPosition();e=A.x,s=A.y}return{x:e,y:s}}};function Mt(i,t){return t&&(F(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function It(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
|
|
1512
1512
|
`)>-1?i.split(`
|
|
1513
|
-
`):i}function dd(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:i,label:a,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Uo(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:a,boxHeight:r}=t,A=J(t.bodyFont),l=J(t.titleFont),c=J(t.footerFont),h=o.length,d=n.length,g=s.length,u=tt(t.padding);let f=u.height,w=0,m=s.reduce((G,B)=>G+B.before.length+B.lines.length+B.after.length,0);if(m+=i.beforeBody.length+i.afterBody.length,h&&(f+=h*l.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),m){const G=t.displayColors?Math.max(r,A.lineHeight):A.lineHeight;f+=g*G+(m-g)*A.lineHeight+(m-1)*t.bodySpacing}d&&(f+=t.footerMarginTop+d*c.lineHeight+(d-1)*t.footerSpacing);let D=0;const Y=function(G){w=Math.max(w,e.measureText(G).width+D)};return e.save(),e.font=l.string,T(i.title,Y),e.font=A.string,T(i.beforeBody.concat(i.afterBody),Y),D=t.displayColors?a+2+t.boxPadding:0,T(s,G=>{T(G.before,Y),T(G.lines,Y),T(G.after,Y)}),D=0,e.font=c.string,T(i.footer,Y),e.restore(),w+=u.width,{width:w,height:f}}function gd(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function ud(i,t,e,s){const{x:n,width:o}=s,a=e.caretSize+e.caretPadding;if(i==="left"&&n+o+a>t.width||i==="right"&&n-o-a<0)return!0}function fd(i,t,e,s){const{x:n,width:o}=e,{width:a,chartArea:{left:r,right:A}}=i;let l="center";return s==="center"?l=n<=(r+A)/2?"left":"right":n<=o/2?l="left":n>=a-o/2&&(l="right"),ud(l,i,t,e)&&(l="center"),l}function Ko(i,t,e){const s=e.yAlign||t.yAlign||gd(i,e);return{xAlign:e.xAlign||t.xAlign||fd(i,t,e,s),yAlign:s}}function pd(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function wd(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Xo(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:A}=e,l=n+o,{topLeft:c,topRight:h,bottomLeft:d,bottomRight:g}=jt(a);let u=pd(t,r);const f=wd(t,A,l);return A==="center"?r==="left"?u+=l:r==="right"&&(u-=l):r==="left"?u-=Math.max(c,d)+n:r==="right"&&(u+=Math.max(h,g)+n),{x:q(u,0,s.width-t.width),y:q(f,0,s.height-t.height)}}function xi(i,t,e){const s=tt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Jo(i){return Mt([],vt(i))}function md(i,t,e){return zt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function qo(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const _o={beforeTitle:Bt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:Bt,beforeBody:Bt,beforeLabel:Bt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return z(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Bt,afterBody:Bt,beforeFooter:Bt,footer:Bt,afterFooter:Bt};function nt(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?_o[t].call(e,s):n}class ws extends gt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new Fn(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=md(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=nt(s,"beforeTitle",this,t),o=nt(s,"title",this,t),a=nt(s,"afterTitle",this,t);let r=[];return r=Mt(r,vt(n)),r=Mt(r,vt(o)),r=Mt(r,vt(a)),r}getBeforeBody(t,e){return Jo(nt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return T(t,o=>{const a={before:[],lines:[],after:[]},r=qo(s,o);Mt(a.before,vt(nt(r,"beforeLabel",this,o))),Mt(a.lines,nt(r,"label",this,o)),Mt(a.after,vt(nt(r,"afterLabel",this,o))),n.push(a)}),n}getAfterBody(t,e){return Jo(nt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=nt(s,"beforeFooter",this,t),o=nt(s,"footer",this,t),a=nt(s,"afterFooter",this,t);let r=[];return r=Mt(r,vt(n)),r=Mt(r,vt(o)),r=Mt(r,vt(a)),r}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],a=[];let r=[],A,l;for(A=0,l=e.length;A<l;++A)r.push(dd(this.chart,e[A]));return t.filter&&(r=r.filter((c,h,d)=>t.filter(c,h,d,s))),t.itemSort&&(r=r.sort((c,h)=>t.itemSort(c,h,s))),T(r,c=>{const h=qo(t.callbacks,c);n.push(nt(h,"labelColor",this,c)),o.push(nt(h,"labelPointStyle",this,c)),a.push(nt(h,"labelTextColor",this,c))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,a=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const r=Le[s.position].call(this,n,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);const A=this._size=Uo(this,s),l=Object.assign({},r,A),c=Ko(this.chart,s,l),h=Xo(s,l,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,o={opacity:1,x:h.x,y:h.y,width:A.width,height:A.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=s,{topLeft:A,topRight:l,bottomLeft:c,bottomRight:h}=jt(r),{x:d,y:g}=t,{width:u,height:f}=e;let w,m,D,Y,G,B;return o==="center"?(G=g+f/2,n==="left"?(w=d,m=w-a,Y=G+a,B=G-a):(w=d+u,m=w+a,Y=G-a,B=G+a),D=w):(n==="left"?m=d+Math.max(A,c)+a:n==="right"?m=d+u-Math.max(l,h)-a:m=this.caretX,o==="top"?(Y=g,G=Y-a,w=m-a,D=m+a):(Y=g+f,G=Y+a,w=m+a,D=m-a),B=Y),{x1:w,x2:m,x3:D,y1:Y,y2:G,y3:B}}drawTitle(t,e,s){const n=this.title,o=n.length;let a,r,A;if(o){const l=Ae(s.rtl,this.x,this.width);for(t.x=xi(this,s.titleAlign,s),e.textAlign=l.textAlign(s.titleAlign),e.textBaseline="middle",a=J(s.titleFont),r=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,A=0;A<o;++A)e.fillText(n[A],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,A+1===o&&(t.y+=s.titleMarginBottom-r)}}_drawColorBox(t,e,s,n,o){const a=this.labelColors[s],r=this.labelPointStyles[s],{boxHeight:A,boxWidth:l}=o,c=J(o.bodyFont),h=xi(this,"left",o),d=n.x(h),g=A<c.lineHeight?(c.lineHeight-A)/2:0,u=e.y+g;if(o.usePointStyle){const f={radius:Math.min(l,A)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},w=n.leftForLtr(d,l)+l/2,m=u+A/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ui(t,f,w,m),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Ui(t,f,w,m)}else{t.lineWidth=P(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const f=n.leftForLtr(d,l),w=n.leftForLtr(n.xPlus(d,1),l-2),m=jt(a.borderRadius);Object.values(m).some(D=>D!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,xe(t,{x:f,y:u,w:l,h:A,radius:m}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),xe(t,{x:w,y:u+1,w:l-2,h:A-2,radius:m}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(f,u,l,A),t.strokeRect(f,u,l,A),t.fillStyle=a.backgroundColor,t.fillRect(w,u+1,l-2,A-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:A,boxWidth:l,boxPadding:c}=s,h=J(s.bodyFont);let d=h.lineHeight,g=0;const u=Ae(s.rtl,this.x,this.width),f=function(v){e.fillText(v,u.x(t.x+g),t.y+d/2),t.y+=d+o},w=u.textAlign(a);let m,D,Y,G,B,C,y;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=xi(this,w,s),e.fillStyle=s.bodyColor,T(this.beforeBody,f),g=r&&w!=="right"?a==="center"?l/2+c:l+2+c:0,G=0,C=n.length;G<C;++G){for(m=n[G],D=this.labelTextColors[G],e.fillStyle=D,T(m.before,f),Y=m.lines,r&&Y.length&&(this._drawColorBox(e,t,G,u,s),d=Math.max(h.lineHeight,A)),B=0,y=Y.length;B<y;++B)f(Y[B]),d=h.lineHeight;T(m.after,f)}g=0,d=h.lineHeight,T(this.afterBody,f),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let a,r;if(o){const A=Ae(s.rtl,this.x,this.width);for(t.x=xi(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=A.textAlign(s.footerAlign),e.textBaseline="middle",a=J(s.footerFont),e.fillStyle=s.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(n[r],A.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:a}=this,{x:r,y:A}=t,{width:l,height:c}=s,{topLeft:h,topRight:d,bottomLeft:g,bottomRight:u}=jt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+h,A),a==="top"&&this.drawCaret(t,e,s,n),e.lineTo(r+l-d,A),e.quadraticCurveTo(r+l,A,r+l,A+d),a==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(r+l,A+c-u),e.quadraticCurveTo(r+l,A+c,r+l-u,A+c),a==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(r+g,A+c),e.quadraticCurveTo(r,A+c,r,A+c-g),a==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(r,A+h),e.quadraticCurveTo(r,A,r+h,A),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const a=Le[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=Uo(this,t),A=Object.assign({},a,this._size),l=Ko(e,t,A),c=Xo(t,A,l,e);(n._to!==c.x||o._to!==c.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const a=tt(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),kn(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Qn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:r,index:A})=>{const l=this.chart.getDatasetMeta(r);if(!l)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:l.data[A],index:A}}),o=!Je(s,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,s),r=this._positionChanged(a,t),A=e||!Je(a,o)||r;return A&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),A}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e;const a=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,a=Le[o.position].call(this,t,e);return a!==!1&&(s!==a.x||n!==a.y)}}x(ws,"positioners",Le);var Md={id:"tooltip",_element:ws,positioners:Le,afterInit(i,t,e){e&&(i.tooltip=new ws({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:_o},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Dd=Object.freeze({__proto__:null,Colors:Qh,Decimation:Th,Filler:id,Legend:Ad,SubTitle:hd,Title:cd,Tooltip:Md});const bd=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Bd(i,t,e,s){const n=i.indexOf(t);if(n===-1)return bd(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Gd=(i,t)=>i===null?null:q(Math.round(i),0,t);function $o(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class ms extends Jt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(z(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Bd(s,t,E(e,t),this._addedLabels),Gd(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=e;a++)n.push({value:a});return n}getLabelForValue(t){return $o.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}x(ms,"id","category"),x(ms,"defaults",{ticks:{callback:$o}});function Yd(i,t){const e=[],{bounds:n,step:o,min:a,max:r,precision:A,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=i,g=o||1,u=c-1,{min:f,max:w}=t,m=!z(a),D=!z(r),Y=!z(l),G=(w-f)/(h+1);let B=tn((w-f)/u/g)*g,C,y,v,I;if(B<1e-14&&!m&&!D)return[{value:f},{value:w}];I=Math.ceil(w/B)-Math.floor(f/B),I>u&&(B=tn(I*B/u/g)*g),z(A)||(C=Math.pow(10,A),B=Math.ceil(B*C)/C),n==="ticks"?(y=Math.floor(f/B)*B,v=Math.ceil(w/B)*B):(y=f,v=w),m&&D&&o&&mA((r-a)/o,B/1e3)?(I=Math.round(Math.min((r-a)/B,c)),B=(r-a)/I,y=a,v=r):Y?(y=m?a:y,v=D?r:v,I=l-1,B=(v-y)/I):(I=(v-y)/B,De(I,Math.round(I),B/1e3)?I=Math.round(I):I=Math.ceil(I));const k=Math.max(sn(B),sn(y));C=Math.pow(10,z(A)?k:A),y=Math.round(y*C)/C,v=Math.round(v*C)/C;let Q=0;for(m&&(d&&y!==a?(e.push({value:a}),y<a&&Q++,De(Math.round((y+Q*B)*C)/C,a,ta(a,G,i))&&Q++):y<a&&Q++);Q<I;++Q){const O=Math.round((y+Q*B)*C)/C;if(D&&O>r)break;e.push({value:O})}return D&&d&&v!==r?e.length&&De(e[e.length-1].value,r,ta(r,G,i))?e[e.length-1].value=r:e.push({value:r}):(!D||v===r)&&e.push({value:v}),e}function ta(i,t,{horizontal:e,minRotation:s}){const n=ht(s),o=(e?Math.sin(n):Math.cos(n))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class Ci extends Jt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const a=A=>n=e?n:A,r=A=>o=s?o:A;if(t){const A=wt(n),l=wt(o);A<0&&l<0?r(0):A>0&&l>0&&a(0)}if(n===o){let A=o===0?1:Math.abs(o*.05);r(o+A),t||a(n-A)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=Yd(n,o);return t.bounds==="ticks"&&en(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return Ge(t,this.chart.options.locale,this.options.ticks.format)}}class Ms extends Ci{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?t:0,this.max=W(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=ht(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}x(Ms,"id","linear"),x(Ms,"defaults",{ticks:{callback:ti.formatters.numeric}});const Se=i=>Math.floor(Ot(i)),qt=(i,t)=>Math.pow(10,Se(i)+t);function ea(i){return i/Math.pow(10,Se(i))===1}function ia(i,t,e){const s=Math.pow(10,e),n=Math.floor(i/s);return Math.ceil(t/s)-n}function xd(i,t){const e=t-i;let s=Se(e);for(;ia(i,t,s)>10;)s++;for(;ia(i,t,s)<10;)s--;return Math.min(s,Se(i))}function Cd(i,{min:t,max:e}){t=rt(i.min,t);const s=[],n=Se(t);let o=xd(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),A=n>o?Math.pow(10,n):0,l=Math.round((t-A)*a)/a,c=Math.floor((t-A)/r/10)*r*10;let h=Math.floor((l-c)/Math.pow(10,o)),d=rt(i.min,Math.round((A+c+h*Math.pow(10,o))*a)/a);for(;d<e;)s.push({value:d,major:ea(d),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,a=o>=0?1:a),d=Math.round((A+c+h*Math.pow(10,o))*a)/a;const g=rt(i.max,d);return s.push({value:g,major:ea(g),significand:h}),s}class Ds extends Jt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const s=Ci.prototype.parse.apply(this,[t,e]);if(s===0){this._zero=!0;return}return W(s)&&s>0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?Math.max(0,t):null,this.max=W(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!W(this._userMin)&&(this.min=t===qt(this.min,0)?qt(this.min,-1):qt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,n=this.max;const o=r=>s=t?s:r,a=r=>n=e?n:r;s===n&&(s<=0?(o(1),a(10)):(o(qt(s,-1)),a(qt(n,1)))),s<=0&&o(qt(n,-1)),n<=0&&a(qt(s,1)),this.min=s,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=Cd(e,this);return t.bounds==="ticks"&&en(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":Ge(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ot(t),this._valueRange=Ot(this.max)-Ot(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ot(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}x(Ds,"id","logarithmic"),x(Ds,"defaults",{ticks:{callback:ti.formatters.logarithmic,major:{enabled:!0}}});function bs(i){const t=i.ticks;if(t.display&&i.display){const e=tt(t.backdropPadding);return E(t.font&&t.font.size,Z.font.size)+e.height}return 0}function yd(i,t,e){return e=F(e)?e:[e],{w:zA(i,t.string,e),h:e.length*t.lineHeight}}function sa(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:i<s||i>n?{start:t-e,end:t}:{start:t,end:t+e}}function vd(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],o=i._pointLabels.length,a=i.options.pointLabels,r=a.centerPointLabels?H/o:0;for(let A=0;A<o;A++){const l=a.setContext(i.getPointLabelContext(A));n[A]=l.padding;const c=i.getPointPosition(A,i.drawingArea+n[A],r),h=J(l.font),d=yd(i.ctx,h,i._pointLabels[A]);s[A]=d;const g=At(i.getIndexAngle(A)+r),u=Math.round(Ri(g)),f=sa(u,c.x,d.w,0,180),w=sa(u,c.y,d.h,90,270);Id(e,t,g,f,w)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Qd(i,s,n)}function Id(i,t,e,s,n){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let r=0,A=0;s.start<t.l?(r=(t.l-s.start)/o,i.l=Math.min(i.l,t.l-r)):s.end>t.r&&(r=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+r)),n.start<t.t?(A=(t.t-n.start)/a,i.t=Math.min(i.t,t.t-A)):n.end>t.b&&(A=(n.end-t.b)/a,i.b=Math.max(i.b,t.b+A))}function Ed(i,t,e){const s=i.drawingArea,{extra:n,additionalAngle:o,padding:a,size:r}=e,A=i.getPointPosition(t,s+n+a,o),l=Math.round(Ri(At(A.angle+U))),c=zd(A.y,r.h,l),h=Pd(l),d=Od(A.x,r.w,h);return{visible:!0,x:A.x,y:c,textAlign:h,left:d,top:c,right:d+r.w,bottom:c+r.h}}function kd(i,t){if(!t)return!0;const{left:e,top:s,right:n,bottom:o}=i;return!(xt({x:e,y:s},t)||xt({x:e,y:o},t)||xt({x:n,y:s},t)||xt({x:n,y:o},t))}function Qd(i,t,e){const s=[],n=i._pointLabels.length,o=i.options,{centerPointLabels:a,display:r}=o.pointLabels,A={extra:bs(o)/2,additionalAngle:a?H/n:0};let l;for(let c=0;c<n;c++){A.padding=e[c],A.size=t[c];const h=Ed(i,c,A);s.push(h),r==="auto"&&(h.visible=kd(h,l),h.visible&&(l=h))}return s}function Pd(i){return i===0||i===180?"center":i<180?"left":"right"}function Od(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function zd(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function Td(i,t,e){const{left:s,top:n,right:o,bottom:a}=e,{backdropColor:r}=t;if(!z(r)){const A=jt(t.borderRadius),l=tt(t.backdropPadding);i.fillStyle=r;const c=s-l.left,h=n-l.top,d=o-s+l.width,g=a-n+l.height;Object.values(A).some(u=>u!==0)?(i.beginPath(),xe(i,{x:c,y:h,w:d,h:g,radius:A}),i.fill()):i.fillRect(c,h,d,g)}}function Ld(i,t){const{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){const o=i._pointLabelItems[n];if(!o.visible)continue;const a=s.setContext(i.getPointLabelContext(n));Td(e,a,o);const r=J(a.font),{x:A,y:l,textAlign:c}=o;Nt(e,i._pointLabels[n],A,l+r.lineHeight/2,r,{color:a.color,textAlign:c,textBaseline:"middle"})}}function na(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,V);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let a=1;a<s;a++)o=i.getPointPosition(a,t),n.lineTo(o.x,o.y)}}function Sd(i,t,e,s,n){const o=i.ctx,a=t.circular,{color:r,lineWidth:A}=t;!a&&!s||!r||!A||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=A,o.setLineDash(n.dash),o.lineDashOffset=n.dashOffset,o.beginPath(),na(i,e,a,s),o.closePath(),o.stroke(),o.restore())}function Rd(i,t,e){return zt(i,{label:e,index:t,type:"pointLabel"})}class Re extends Ci{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=tt(bs(this.options)/2),e=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(e,s)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=W(t)&&!isNaN(t)?t:0,this.max=W(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/bs(this.options))}generateTickLabels(t){Ci.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{const n=S(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?vd(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){const e=V/(this._pointLabels.length||1),s=this.options.startAngle||0;return At(t*e+ht(s))}getDistanceFromCenterForValue(t){if(z(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(z(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const s=e[t];return Rd(this.getContext(),t,s)}}getPointPosition(t,e,s=0){const n=this.getIndexAngle(t)-U+s;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:s,right:n,bottom:o}=this._pointLabelItems[t];return{left:e,top:s,right:n,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const s=this.ctx;s.save(),s.beginPath(),na(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:s,grid:n,border:o}=e,a=this._pointLabels.length;let r,A,l;if(e.pointLabels.display&&Ld(this,a),n.display&&this.ticks.forEach((c,h)=>{if(h!==0){A=this.getDistanceFromCenterForValue(c.value);const d=this.getContext(h),g=n.setContext(d),u=o.setContext(d);Sd(this,g,A,a,u)}}),s.display){for(t.save(),r=a-1;r>=0;r--){const c=s.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:d}=c;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,A=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(r,A),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;const n=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,A)=>{if(A===0&&!e.reverse)return;const l=s.setContext(this.getContext(A)),c=J(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[A].value),l.showLabelBackdrop){t.font=c.string,a=t.measureText(r.label).width,t.fillStyle=l.backdropColor;const h=tt(l.backdropPadding);t.fillRect(-a/2-h.left,-o-c.size/2-h.top,a+h.width,c.size+h.height)}Nt(t,r.label,0,-o,c,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),t.restore()}drawTitle(){}}x(Re,"id","radialLinear"),x(Re,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ti.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),x(Re,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),x(Re,"descriptors",{angleLines:{_fallback:"grid"}});const yi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ot=Object.keys(yi);function oa(i,t){return i-t}function aa(i,t){if(z(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let a=t;return typeof s=="function"&&(a=s(a)),W(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(n&&(a=n==="week"&&(oe(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,n)),+a)}function ra(i,t,e,s){const n=ot.length;for(let o=ot.indexOf(i);o<n-1;++o){const a=yi[ot[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=s)return ot[o]}return ot[n-1]}function Fd(i,t,e,s,n){for(let o=ot.length-1;o>=ot.indexOf(e);o--){const a=ot[o];if(yi[a].common&&i._adapter.diff(n,s,a)>=t-1)return a}return ot[e?ot.indexOf(e):0]}function Hd(i){for(let t=ot.indexOf(i)+1,e=ot.length;t<e;++t)if(yi[ot[t]].common)return ot[t]}function Aa(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=Hi(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function Vd(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),a=t[t.length-1].value;let r,A;for(r=o;r<=a;r=+n.add(r,1,s))A=e[r],A>=0&&(t[A].major=!0);return t}function la(i,t,e){const s=[],n={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],n[r]=a,s.push({value:r,major:!1});return o===0||!e?s:Vd(i,s,n,e)}class Fe extends Jt{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),n=this._adapter=new ql._date(t.adapters.date);n.init(e),me(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:aa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function A(l){!a&&!isNaN(l.min)&&(n=Math.min(n,l.min)),!r&&!isNaN(l.max)&&(o=Math.max(o,l.max))}(!a||!r)&&(A(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&A(this.getMinMax(!1))),n=W(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=W(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,a=this.max,r=BA(n,o,a);return this._unit=e.unit||(s.autoSkip?ra(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Fd(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Hd(this._unit),this.initOffsets(n),t.reverse&&r.reverse(),la(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=q(e,0,a),s=q(s,0,a),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,a=o.unit||ra(o.minUnit,e,s,this._getLabelCapacity(e)),r=E(n.ticks.stepSize,1),A=a==="week"?o.isoWeekday:!1,l=oe(A)||A===!0,c={};let h=e,d,g;if(l&&(h=+t.startOf(h,"isoWeek",A)),h=+t.startOf(h,l?"day":a),t.diff(s,e,a)>1e5*r)throw new Error(e+" and "+s+" are too far apart with stepSize of "+r+" "+a);const u=n.ticks.source==="data"&&this.getDataTimestamps();for(d=h,g=0;d<s;d=+t.add(d,r,a),g++)Aa(c,d,u);return(d===s||n.bounds==="ticks"||g===1)&&Aa(c,d,u),Object.keys(c).sort(oa).map(f=>+f)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,a=e||n[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,s,n){const o=this.options,a=o.ticks.callback;if(a)return S(a,[t,e,s],this);const r=o.time.displayFormats,A=this._unit,l=this._majorUnit,c=A&&r[A],h=l&&r[l],d=s[e],g=l&&h&&d&&d.major;return this._adapter.format(t,n||(g?h:c))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=ht(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),a=Math.sin(n),r=this._resolveTickFontOptions(0).size;return{w:s*o+r*a,h:s*a+r*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,la(this,[t],this._majorUnit),n),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(aa(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return rn(t.sort(oa))}}x(Fe,"id","time"),x(Fe,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function vi(i,t,e){let s=0,n=i.length-1,o,a,r,A;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=Yt(i,"pos",t)),{pos:o,time:r}=i[s],{pos:a,time:A}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=Yt(i,"time",t)),{time:o,pos:r}=i[s],{time:a,pos:A}=i[n]);const l=a-o;return l?r+(A-r)*(t-o)/l:r}class Bs extends Fe{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=vi(e,this.min),this._tableRange=vi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let a,r,A,l,c;for(a=0,r=t.length;a<r;++a)l=t[a],l>=e&&l<=s&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(a=0,r=n.length;a<r;++a)c=n[a+1],A=n[a-1],l=n[a],Math.round((c+A)/2)!==l&&o.push({time:l,pos:a/(r-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(vi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return vi(this._table,s*this._tableRange+this._minPos,!0)}}x(Bs,"id","timeseries"),x(Bs,"defaults",Fe.defaults);var Nd=Object.freeze({__proto__:null,CategoryScale:ms,LinearScale:Ms,LogarithmicScale:Ds,RadialLinearScale:Re,TimeScale:Fe,TimeSeriesScale:Bs});const jd=[Jl,Ch,Dd,Nd];yt.register(...jd);var Wd=Object.defineProperty,Zd=Object.getOwnPropertyDescriptor,St=(i,t,e,s)=>{for(var n=s>1?void 0:s?Zd(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(n=(s?a(t,e,n):a(n))||n);return s&&n&&Wd(t,e,n),n};b.GenusChart=class extends p.LitElement{constructor(){super(...arguments),this.chartTitle="",this.chartType="",this.chartLabels=[],this.chartDataSets=[],this.chartOptions={},this._createChart=()=>{this._chart=new yt(this._chartCanvas,{type:this.chartType,data:{labels:[...this.chartLabels],datasets:[...this.chartDataSets]},options:{...this.chartOptions}})}}firstUpdated(){this._createChart()}updated(){this._chart.data.labels=[...this.chartLabels],this._chart.data.datasets=[...this.chartDataSets],this._chart.update()}render(){return p.html`
|
|
1513
|
+
`):i}function dd(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:i,label:a,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Uo(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:a,boxHeight:r}=t,A=J(t.bodyFont),l=J(t.titleFont),c=J(t.footerFont),h=o.length,d=n.length,g=s.length,u=tt(t.padding);let f=u.height,w=0,m=s.reduce((G,B)=>G+B.before.length+B.lines.length+B.after.length,0);if(m+=i.beforeBody.length+i.afterBody.length,h&&(f+=h*l.lineHeight+(h-1)*t.titleSpacing+t.titleMarginBottom),m){const G=t.displayColors?Math.max(r,A.lineHeight):A.lineHeight;f+=g*G+(m-g)*A.lineHeight+(m-1)*t.bodySpacing}d&&(f+=t.footerMarginTop+d*c.lineHeight+(d-1)*t.footerSpacing);let D=0;const Y=function(G){w=Math.max(w,e.measureText(G).width+D)};return e.save(),e.font=l.string,T(i.title,Y),e.font=A.string,T(i.beforeBody.concat(i.afterBody),Y),D=t.displayColors?a+2+t.boxPadding:0,T(s,G=>{T(G.before,Y),T(G.lines,Y),T(G.after,Y)}),D=0,e.font=c.string,T(i.footer,Y),e.restore(),w+=u.width,{width:w,height:f}}function gd(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function ud(i,t,e,s){const{x:n,width:o}=s,a=e.caretSize+e.caretPadding;if(i==="left"&&n+o+a>t.width||i==="right"&&n-o-a<0)return!0}function fd(i,t,e,s){const{x:n,width:o}=e,{width:a,chartArea:{left:r,right:A}}=i;let l="center";return s==="center"?l=n<=(r+A)/2?"left":"right":n<=o/2?l="left":n>=a-o/2&&(l="right"),ud(l,i,t,e)&&(l="center"),l}function Ko(i,t,e){const s=e.yAlign||t.yAlign||gd(i,e);return{xAlign:e.xAlign||t.xAlign||fd(i,t,e,s),yAlign:s}}function pd(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function wd(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Xo(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:A}=e,l=n+o,{topLeft:c,topRight:h,bottomLeft:d,bottomRight:g}=jt(a);let u=pd(t,r);const f=wd(t,A,l);return A==="center"?r==="left"?u+=l:r==="right"&&(u-=l):r==="left"?u-=Math.max(c,d)+n:r==="right"&&(u+=Math.max(h,g)+n),{x:q(u,0,s.width-t.width),y:q(f,0,s.height-t.height)}}function xi(i,t,e){const s=tt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Jo(i){return Mt([],It(i))}function md(i,t,e){return zt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function qo(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const _o={beforeTitle:Bt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:Bt,beforeBody:Bt,beforeLabel:Bt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return z(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Bt,afterBody:Bt,beforeFooter:Bt,footer:Bt,afterFooter:Bt};function nt(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?_o[t].call(e,s):n}class ws extends gt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new Fn(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=md(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=nt(s,"beforeTitle",this,t),o=nt(s,"title",this,t),a=nt(s,"afterTitle",this,t);let r=[];return r=Mt(r,It(n)),r=Mt(r,It(o)),r=Mt(r,It(a)),r}getBeforeBody(t,e){return Jo(nt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return T(t,o=>{const a={before:[],lines:[],after:[]},r=qo(s,o);Mt(a.before,It(nt(r,"beforeLabel",this,o))),Mt(a.lines,nt(r,"label",this,o)),Mt(a.after,It(nt(r,"afterLabel",this,o))),n.push(a)}),n}getAfterBody(t,e){return Jo(nt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=nt(s,"beforeFooter",this,t),o=nt(s,"footer",this,t),a=nt(s,"afterFooter",this,t);let r=[];return r=Mt(r,It(n)),r=Mt(r,It(o)),r=Mt(r,It(a)),r}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],a=[];let r=[],A,l;for(A=0,l=e.length;A<l;++A)r.push(dd(this.chart,e[A]));return t.filter&&(r=r.filter((c,h,d)=>t.filter(c,h,d,s))),t.itemSort&&(r=r.sort((c,h)=>t.itemSort(c,h,s))),T(r,c=>{const h=qo(t.callbacks,c);n.push(nt(h,"labelColor",this,c)),o.push(nt(h,"labelPointStyle",this,c)),a.push(nt(h,"labelTextColor",this,c))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,a=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const r=Le[s.position].call(this,n,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);const A=this._size=Uo(this,s),l=Object.assign({},r,A),c=Ko(this.chart,s,l),h=Xo(s,l,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,o={opacity:1,x:h.x,y:h.y,width:A.width,height:A.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=s,{topLeft:A,topRight:l,bottomLeft:c,bottomRight:h}=jt(r),{x:d,y:g}=t,{width:u,height:f}=e;let w,m,D,Y,G,B;return o==="center"?(G=g+f/2,n==="left"?(w=d,m=w-a,Y=G+a,B=G-a):(w=d+u,m=w+a,Y=G-a,B=G+a),D=w):(n==="left"?m=d+Math.max(A,c)+a:n==="right"?m=d+u-Math.max(l,h)-a:m=this.caretX,o==="top"?(Y=g,G=Y-a,w=m-a,D=m+a):(Y=g+f,G=Y+a,w=m+a,D=m-a),B=Y),{x1:w,x2:m,x3:D,y1:Y,y2:G,y3:B}}drawTitle(t,e,s){const n=this.title,o=n.length;let a,r,A;if(o){const l=Ae(s.rtl,this.x,this.width);for(t.x=xi(this,s.titleAlign,s),e.textAlign=l.textAlign(s.titleAlign),e.textBaseline="middle",a=J(s.titleFont),r=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,A=0;A<o;++A)e.fillText(n[A],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,A+1===o&&(t.y+=s.titleMarginBottom-r)}}_drawColorBox(t,e,s,n,o){const a=this.labelColors[s],r=this.labelPointStyles[s],{boxHeight:A,boxWidth:l}=o,c=J(o.bodyFont),h=xi(this,"left",o),d=n.x(h),g=A<c.lineHeight?(c.lineHeight-A)/2:0,u=e.y+g;if(o.usePointStyle){const f={radius:Math.min(l,A)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},w=n.leftForLtr(d,l)+l/2,m=u+A/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ui(t,f,w,m),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,Ui(t,f,w,m)}else{t.lineWidth=P(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const f=n.leftForLtr(d,l),w=n.leftForLtr(n.xPlus(d,1),l-2),m=jt(a.borderRadius);Object.values(m).some(D=>D!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,xe(t,{x:f,y:u,w:l,h:A,radius:m}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),xe(t,{x:w,y:u+1,w:l-2,h:A-2,radius:m}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(f,u,l,A),t.strokeRect(f,u,l,A),t.fillStyle=a.backgroundColor,t.fillRect(w,u+1,l-2,A-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:A,boxWidth:l,boxPadding:c}=s,h=J(s.bodyFont);let d=h.lineHeight,g=0;const u=Ae(s.rtl,this.x,this.width),f=function(I){e.fillText(I,u.x(t.x+g),t.y+d/2),t.y+=d+o},w=u.textAlign(a);let m,D,Y,G,B,C,y;for(e.textAlign=a,e.textBaseline="middle",e.font=h.string,t.x=xi(this,w,s),e.fillStyle=s.bodyColor,T(this.beforeBody,f),g=r&&w!=="right"?a==="center"?l/2+c:l+2+c:0,G=0,C=n.length;G<C;++G){for(m=n[G],D=this.labelTextColors[G],e.fillStyle=D,T(m.before,f),Y=m.lines,r&&Y.length&&(this._drawColorBox(e,t,G,u,s),d=Math.max(h.lineHeight,A)),B=0,y=Y.length;B<y;++B)f(Y[B]),d=h.lineHeight;T(m.after,f)}g=0,d=h.lineHeight,T(this.afterBody,f),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let a,r;if(o){const A=Ae(s.rtl,this.x,this.width);for(t.x=xi(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=A.textAlign(s.footerAlign),e.textBaseline="middle",a=J(s.footerFont),e.fillStyle=s.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(n[r],A.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:a}=this,{x:r,y:A}=t,{width:l,height:c}=s,{topLeft:h,topRight:d,bottomLeft:g,bottomRight:u}=jt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+h,A),a==="top"&&this.drawCaret(t,e,s,n),e.lineTo(r+l-d,A),e.quadraticCurveTo(r+l,A,r+l,A+d),a==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(r+l,A+c-u),e.quadraticCurveTo(r+l,A+c,r+l-u,A+c),a==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(r+g,A+c),e.quadraticCurveTo(r,A+c,r,A+c-g),a==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(r,A+h),e.quadraticCurveTo(r,A,r+h,A),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const a=Le[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=Uo(this,t),A=Object.assign({},a,this._size),l=Ko(e,t,A),c=Xo(t,A,l,e);(n._to!==c.x||o._to!==c.y)&&(this.xAlign=l.xAlign,this.yAlign=l.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const a=tt(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),kn(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Qn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:r,index:A})=>{const l=this.chart.getDatasetMeta(r);if(!l)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:l.data[A],index:A}}),o=!Je(s,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,s),r=this._positionChanged(a,t),A=e||!Je(a,o)||r;return A&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),A}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e;const a=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,a=Le[o.position].call(this,t,e);return a!==!1&&(s!==a.x||n!==a.y)}}x(ws,"positioners",Le);var Md={id:"tooltip",_element:ws,positioners:Le,afterInit(i,t,e){e&&(i.tooltip=new ws({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:_o},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Dd=Object.freeze({__proto__:null,Colors:Qh,Decimation:Th,Filler:id,Legend:Ad,SubTitle:hd,Title:cd,Tooltip:Md});const bd=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Bd(i,t,e,s){const n=i.indexOf(t);if(n===-1)return bd(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Gd=(i,t)=>i===null?null:q(Math.round(i),0,t);function $o(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class ms extends Jt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(z(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Bd(s,t,E(e,t),this._addedLabels),Gd(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=e;a++)n.push({value:a});return n}getLabelForValue(t){return $o.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}x(ms,"id","category"),x(ms,"defaults",{ticks:{callback:$o}});function Yd(i,t){const e=[],{bounds:n,step:o,min:a,max:r,precision:A,count:l,maxTicks:c,maxDigits:h,includeBounds:d}=i,g=o||1,u=c-1,{min:f,max:w}=t,m=!z(a),D=!z(r),Y=!z(l),G=(w-f)/(h+1);let B=tn((w-f)/u/g)*g,C,y,I,v;if(B<1e-14&&!m&&!D)return[{value:f},{value:w}];v=Math.ceil(w/B)-Math.floor(f/B),v>u&&(B=tn(v*B/u/g)*g),z(A)||(C=Math.pow(10,A),B=Math.ceil(B*C)/C),n==="ticks"?(y=Math.floor(f/B)*B,I=Math.ceil(w/B)*B):(y=f,I=w),m&&D&&o&&mA((r-a)/o,B/1e3)?(v=Math.round(Math.min((r-a)/B,c)),B=(r-a)/v,y=a,I=r):Y?(y=m?a:y,I=D?r:I,v=l-1,B=(I-y)/v):(v=(I-y)/B,De(v,Math.round(v),B/1e3)?v=Math.round(v):v=Math.ceil(v));const k=Math.max(sn(B),sn(y));C=Math.pow(10,z(A)?k:A),y=Math.round(y*C)/C,I=Math.round(I*C)/C;let Q=0;for(m&&(d&&y!==a?(e.push({value:a}),y<a&&Q++,De(Math.round((y+Q*B)*C)/C,a,ta(a,G,i))&&Q++):y<a&&Q++);Q<v;++Q){const O=Math.round((y+Q*B)*C)/C;if(D&&O>r)break;e.push({value:O})}return D&&d&&I!==r?e.length&&De(e[e.length-1].value,r,ta(r,G,i))?e[e.length-1].value=r:e.push({value:r}):(!D||I===r)&&e.push({value:I}),e}function ta(i,t,{horizontal:e,minRotation:s}){const n=ht(s),o=(e?Math.sin(n):Math.cos(n))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class Ci extends Jt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const a=A=>n=e?n:A,r=A=>o=s?o:A;if(t){const A=wt(n),l=wt(o);A<0&&l<0?r(0):A>0&&l>0&&a(0)}if(n===o){let A=o===0?1:Math.abs(o*.05);r(o+A),t||a(n-A)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=Yd(n,o);return t.bounds==="ticks"&&en(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return Ge(t,this.chart.options.locale,this.options.ticks.format)}}class Ms extends Ci{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?t:0,this.max=W(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=ht(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}x(Ms,"id","linear"),x(Ms,"defaults",{ticks:{callback:ti.formatters.numeric}});const Se=i=>Math.floor(Ot(i)),qt=(i,t)=>Math.pow(10,Se(i)+t);function ea(i){return i/Math.pow(10,Se(i))===1}function ia(i,t,e){const s=Math.pow(10,e),n=Math.floor(i/s);return Math.ceil(t/s)-n}function xd(i,t){const e=t-i;let s=Se(e);for(;ia(i,t,s)>10;)s++;for(;ia(i,t,s)<10;)s--;return Math.min(s,Se(i))}function Cd(i,{min:t,max:e}){t=rt(i.min,t);const s=[],n=Se(t);let o=xd(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),A=n>o?Math.pow(10,n):0,l=Math.round((t-A)*a)/a,c=Math.floor((t-A)/r/10)*r*10;let h=Math.floor((l-c)/Math.pow(10,o)),d=rt(i.min,Math.round((A+c+h*Math.pow(10,o))*a)/a);for(;d<e;)s.push({value:d,major:ea(d),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(o++,h=2,a=o>=0?1:a),d=Math.round((A+c+h*Math.pow(10,o))*a)/a;const g=rt(i.max,d);return s.push({value:g,major:ea(g),significand:h}),s}class Ds extends Jt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const s=Ci.prototype.parse.apply(this,[t,e]);if(s===0){this._zero=!0;return}return W(s)&&s>0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?Math.max(0,t):null,this.max=W(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!W(this._userMin)&&(this.min=t===qt(this.min,0)?qt(this.min,-1):qt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,n=this.max;const o=r=>s=t?s:r,a=r=>n=e?n:r;s===n&&(s<=0?(o(1),a(10)):(o(qt(s,-1)),a(qt(n,1)))),s<=0&&o(qt(n,-1)),n<=0&&a(qt(s,1)),this.min=s,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=Cd(e,this);return t.bounds==="ticks"&&en(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":Ge(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ot(t),this._valueRange=Ot(this.max)-Ot(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ot(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}x(Ds,"id","logarithmic"),x(Ds,"defaults",{ticks:{callback:ti.formatters.logarithmic,major:{enabled:!0}}});function bs(i){const t=i.ticks;if(t.display&&i.display){const e=tt(t.backdropPadding);return E(t.font&&t.font.size,Z.font.size)+e.height}return 0}function yd(i,t,e){return e=F(e)?e:[e],{w:zA(i,t.string,e),h:e.length*t.lineHeight}}function sa(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:i<s||i>n?{start:t-e,end:t}:{start:t,end:t+e}}function Id(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],o=i._pointLabels.length,a=i.options.pointLabels,r=a.centerPointLabels?H/o:0;for(let A=0;A<o;A++){const l=a.setContext(i.getPointLabelContext(A));n[A]=l.padding;const c=i.getPointPosition(A,i.drawingArea+n[A],r),h=J(l.font),d=yd(i.ctx,h,i._pointLabels[A]);s[A]=d;const g=At(i.getIndexAngle(A)+r),u=Math.round(Ri(g)),f=sa(u,c.x,d.w,0,180),w=sa(u,c.y,d.h,90,270);vd(e,t,g,f,w)}i.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),i._pointLabelItems=Qd(i,s,n)}function vd(i,t,e,s,n){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let r=0,A=0;s.start<t.l?(r=(t.l-s.start)/o,i.l=Math.min(i.l,t.l-r)):s.end>t.r&&(r=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+r)),n.start<t.t?(A=(t.t-n.start)/a,i.t=Math.min(i.t,t.t-A)):n.end>t.b&&(A=(n.end-t.b)/a,i.b=Math.max(i.b,t.b+A))}function Ed(i,t,e){const s=i.drawingArea,{extra:n,additionalAngle:o,padding:a,size:r}=e,A=i.getPointPosition(t,s+n+a,o),l=Math.round(Ri(At(A.angle+U))),c=zd(A.y,r.h,l),h=Pd(l),d=Od(A.x,r.w,h);return{visible:!0,x:A.x,y:c,textAlign:h,left:d,top:c,right:d+r.w,bottom:c+r.h}}function kd(i,t){if(!t)return!0;const{left:e,top:s,right:n,bottom:o}=i;return!(xt({x:e,y:s},t)||xt({x:e,y:o},t)||xt({x:n,y:s},t)||xt({x:n,y:o},t))}function Qd(i,t,e){const s=[],n=i._pointLabels.length,o=i.options,{centerPointLabels:a,display:r}=o.pointLabels,A={extra:bs(o)/2,additionalAngle:a?H/n:0};let l;for(let c=0;c<n;c++){A.padding=e[c],A.size=t[c];const h=Ed(i,c,A);s.push(h),r==="auto"&&(h.visible=kd(h,l),h.visible&&(l=h))}return s}function Pd(i){return i===0||i===180?"center":i<180?"left":"right"}function Od(i,t,e){return e==="right"?i-=t:e==="center"&&(i-=t/2),i}function zd(i,t,e){return e===90||e===270?i-=t/2:(e>270||e<90)&&(i-=t),i}function Td(i,t,e){const{left:s,top:n,right:o,bottom:a}=e,{backdropColor:r}=t;if(!z(r)){const A=jt(t.borderRadius),l=tt(t.backdropPadding);i.fillStyle=r;const c=s-l.left,h=n-l.top,d=o-s+l.width,g=a-n+l.height;Object.values(A).some(u=>u!==0)?(i.beginPath(),xe(i,{x:c,y:h,w:d,h:g,radius:A}),i.fill()):i.fillRect(c,h,d,g)}}function Ld(i,t){const{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){const o=i._pointLabelItems[n];if(!o.visible)continue;const a=s.setContext(i.getPointLabelContext(n));Td(e,a,o);const r=J(a.font),{x:A,y:l,textAlign:c}=o;Nt(e,i._pointLabels[n],A,l+r.lineHeight/2,r,{color:a.color,textAlign:c,textBaseline:"middle"})}}function na(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,V);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let a=1;a<s;a++)o=i.getPointPosition(a,t),n.lineTo(o.x,o.y)}}function Sd(i,t,e,s,n){const o=i.ctx,a=t.circular,{color:r,lineWidth:A}=t;!a&&!s||!r||!A||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=A,o.setLineDash(n.dash),o.lineDashOffset=n.dashOffset,o.beginPath(),na(i,e,a,s),o.closePath(),o.stroke(),o.restore())}function Rd(i,t,e){return zt(i,{label:e,index:t,type:"pointLabel"})}class Re extends Ci{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=tt(bs(this.options)/2),e=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(e,s)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=W(t)&&!isNaN(t)?t:0,this.max=W(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/bs(this.options))}generateTickLabels(t){Ci.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{const n=S(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?Id(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){const e=V/(this._pointLabels.length||1),s=this.options.startAngle||0;return At(t*e+ht(s))}getDistanceFromCenterForValue(t){if(z(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(z(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const s=e[t];return Rd(this.getContext(),t,s)}}getPointPosition(t,e,s=0){const n=this.getIndexAngle(t)-U+s;return{x:Math.cos(n)*e+this.xCenter,y:Math.sin(n)*e+this.yCenter,angle:n}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:s,right:n,bottom:o}=this._pointLabelItems[t];return{left:e,top:s,right:n,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const s=this.ctx;s.save(),s.beginPath(),na(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:s,grid:n,border:o}=e,a=this._pointLabels.length;let r,A,l;if(e.pointLabels.display&&Ld(this,a),n.display&&this.ticks.forEach((c,h)=>{if(h!==0){A=this.getDistanceFromCenterForValue(c.value);const d=this.getContext(h),g=n.setContext(d),u=o.setContext(d);Sd(this,g,A,a,u)}}),s.display){for(t.save(),r=a-1;r>=0;r--){const c=s.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:d}=c;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,A=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(r,A),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;const n=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,A)=>{if(A===0&&!e.reverse)return;const l=s.setContext(this.getContext(A)),c=J(l.font);if(o=this.getDistanceFromCenterForValue(this.ticks[A].value),l.showLabelBackdrop){t.font=c.string,a=t.measureText(r.label).width,t.fillStyle=l.backdropColor;const h=tt(l.backdropPadding);t.fillRect(-a/2-h.left,-o-c.size/2-h.top,a+h.width,c.size+h.height)}Nt(t,r.label,0,-o,c,{color:l.color,strokeColor:l.textStrokeColor,strokeWidth:l.textStrokeWidth})}),t.restore()}drawTitle(){}}x(Re,"id","radialLinear"),x(Re,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ti.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),x(Re,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),x(Re,"descriptors",{angleLines:{_fallback:"grid"}});const yi={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ot=Object.keys(yi);function oa(i,t){return i-t}function aa(i,t){if(z(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let a=t;return typeof s=="function"&&(a=s(a)),W(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(n&&(a=n==="week"&&(oe(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,n)),+a)}function ra(i,t,e,s){const n=ot.length;for(let o=ot.indexOf(i);o<n-1;++o){const a=yi[ot[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=s)return ot[o]}return ot[n-1]}function Fd(i,t,e,s,n){for(let o=ot.length-1;o>=ot.indexOf(e);o--){const a=ot[o];if(yi[a].common&&i._adapter.diff(n,s,a)>=t-1)return a}return ot[e?ot.indexOf(e):0]}function Hd(i){for(let t=ot.indexOf(i)+1,e=ot.length;t<e;++t)if(yi[ot[t]].common)return ot[t]}function Aa(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=Hi(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function Vd(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),a=t[t.length-1].value;let r,A;for(r=o;r<=a;r=+n.add(r,1,s))A=e[r],A>=0&&(t[A].major=!0);return t}function la(i,t,e){const s=[],n={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],n[r]=a,s.push({value:r,major:!1});return o===0||!e?s:Vd(i,s,n,e)}class Fe extends Jt{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),n=this._adapter=new ql._date(t.adapters.date);n.init(e),me(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:aa(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function A(l){!a&&!isNaN(l.min)&&(n=Math.min(n,l.min)),!r&&!isNaN(l.max)&&(o=Math.max(o,l.max))}(!a||!r)&&(A(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&A(this.getMinMax(!1))),n=W(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=W(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,a=this.max,r=BA(n,o,a);return this._unit=e.unit||(s.autoSkip?ra(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Fd(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Hd(this._unit),this.initOffsets(n),t.reverse&&r.reverse(),la(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=q(e,0,a),s=q(s,0,a),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,a=o.unit||ra(o.minUnit,e,s,this._getLabelCapacity(e)),r=E(n.ticks.stepSize,1),A=a==="week"?o.isoWeekday:!1,l=oe(A)||A===!0,c={};let h=e,d,g;if(l&&(h=+t.startOf(h,"isoWeek",A)),h=+t.startOf(h,l?"day":a),t.diff(s,e,a)>1e5*r)throw new Error(e+" and "+s+" are too far apart with stepSize of "+r+" "+a);const u=n.ticks.source==="data"&&this.getDataTimestamps();for(d=h,g=0;d<s;d=+t.add(d,r,a),g++)Aa(c,d,u);return(d===s||n.bounds==="ticks"||g===1)&&Aa(c,d,u),Object.keys(c).sort(oa).map(f=>+f)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,a=e||n[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,s,n){const o=this.options,a=o.ticks.callback;if(a)return S(a,[t,e,s],this);const r=o.time.displayFormats,A=this._unit,l=this._majorUnit,c=A&&r[A],h=l&&r[l],d=s[e],g=l&&h&&d&&d.major;return this._adapter.format(t,n||(g?h:c))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=ht(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),a=Math.sin(n),r=this._resolveTickFontOptions(0).size;return{w:s*o+r*a,h:s*a+r*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,la(this,[t],this._majorUnit),n),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(aa(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return rn(t.sort(oa))}}x(Fe,"id","time"),x(Fe,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ii(i,t,e){let s=0,n=i.length-1,o,a,r,A;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=Yt(i,"pos",t)),{pos:o,time:r}=i[s],{pos:a,time:A}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=Yt(i,"time",t)),{time:o,pos:r}=i[s],{time:a,pos:A}=i[n]);const l=a-o;return l?r+(A-r)*(t-o)/l:r}class Bs extends Fe{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ii(e,this.min),this._tableRange=Ii(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let a,r,A,l,c;for(a=0,r=t.length;a<r;++a)l=t[a],l>=e&&l<=s&&n.push(l);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(a=0,r=n.length;a<r;++a)c=n[a+1],A=n[a-1],l=n[a],Math.round((c+A)/2)!==l&&o.push({time:l,pos:a/(r-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Ii(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Ii(this._table,s*this._tableRange+this._minPos,!0)}}x(Bs,"id","timeseries"),x(Bs,"defaults",Fe.defaults);var Nd=Object.freeze({__proto__:null,CategoryScale:ms,LinearScale:Ms,LogarithmicScale:Ds,RadialLinearScale:Re,TimeScale:Fe,TimeSeriesScale:Bs});const jd=[Jl,Ch,Dd,Nd];yt.register(...jd);var Wd=Object.defineProperty,Zd=Object.getOwnPropertyDescriptor,St=(i,t,e,s)=>{for(var n=s>1?void 0:s?Zd(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(n=(s?a(t,e,n):a(n))||n);return s&&n&&Wd(t,e,n),n};b.GenusChart=class extends p.LitElement{constructor(){super(...arguments),this.chartTitle="",this.chartType="",this.chartLabels=[],this.chartDataSets=[],this.chartOptions={},this._createChart=()=>{this._chart=new yt(this._chartCanvas,{type:this.chartType,data:{labels:[...this.chartLabels],datasets:[...this.chartDataSets]},options:{...this.chartOptions}})}}firstUpdated(){this._createChart()}updated(){this._chart.data.labels=[...this.chartLabels],this._chart.data.datasets=[...this.chartDataSets],this._chart.update()}render(){return p.html`
|
|
1514
1514
|
<div class='chart'>
|
|
1515
1515
|
<div class='chart__head'>
|
|
1516
1516
|
<h4 class='chart__title'>${this.chartTitle}</h4>
|
|
@@ -1974,12 +1974,12 @@
|
|
|
1974
1974
|
}
|
|
1975
1975
|
|
|
1976
1976
|
.close-btn:hover { cursor: pointer; }
|
|
1977
|
-
`,hg="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIconly/Bold/Close%20Square%3c/title%3e%3cg%20id='Iconly/Bold/Close-Square'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Close-Square'%20transform='translate(1.999800,%201.999200)'%20fill='%23fe331a'%20fill-rule='nonzero'%3e%3cpath%20d='M14.34,2.84217094e-14%20C17.73,2.84217094e-14%2020,2.38%2020,5.92%20L20,5.92%20L20,14.091%20C20,17.621%2017.73,20%2014.34,20%20L14.34,20%20L5.67,20%20C2.28,20%200,17.621%200,14.091%20L0,14.091%20L0,5.92%20C0,2.38%202.28,2.84217094e-14%205.67,2.84217094e-14%20L5.67,2.84217094e-14%20Z%20M13.01,6.971%20C12.67,6.63%2012.12,6.63%2011.77,6.971%20L11.77,6.971%20L10,8.75%20L8.22,6.971%20C7.87,6.63%207.32,6.63%206.98,6.971%20C6.64,7.311%206.64,7.871%206.98,8.21%20L6.98,8.21%20L8.76,9.991%20L6.98,11.761%20C6.64,12.111%206.64,12.661%206.98,13%20C7.15,13.17%207.38,13.261%207.6,13.261%20C7.83,13.261%208.05,13.17%208.22,13%20L8.22,13%20L10,11.231%20L11.78,13%20C11.95,13.181%2012.17,13.261%2012.39,13.261%20C12.62,13.261%2012.84,13.17%2013.01,13%20C13.35,12.661%2013.35,12.111%2013.01,11.771%20L13.01,11.771%20L11.23,9.991%20L13.01,8.21%20C13.35,7.871%2013.35,7.311%2013.01,6.971%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e",dg="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIconly/Bold/Close%20Square%3c/title%3e%3cg%20id='Iconly/Bold/Close-Square'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Close-Square'%20transform='translate(1.999800,%201.999200)'%20fill='%2319c368'%20fill-rule='nonzero'%3e%3cpath%20d='M14.34,2.84217094e-14%20C17.73,2.84217094e-14%2020,2.38%2020,5.92%20L20,5.92%20L20,14.091%20C20,17.621%2017.73,20%2014.34,20%20L14.34,20%20L5.67,20%20C2.28,20%200,17.621%200,14.091%20L0,14.091%20L0,5.92%20C0,2.38%202.28,2.84217094e-14%205.67,2.84217094e-14%20L5.67,2.84217094e-14%20Z%20M13.01,6.971%20C12.67,6.63%2012.12,6.63%2011.77,6.971%20L11.77,6.971%20L10,8.75%20L8.22,6.971%20C7.87,6.63%207.32,6.63%206.98,6.971%20C6.64,7.311%206.64,7.871%206.98,8.21%20L6.98,8.21%20L8.76,9.991%20L6.98,11.761%20C6.64,12.111%206.64,12.661%206.98,13%20C7.15,13.17%207.38,13.261%207.6,13.261%20C7.83,13.261%208.05,13.17%208.22,13%20L8.22,13%20L10,11.231%20L11.78,13%20C11.95,13.181%2012.17,13.261%2012.39,13.261%20C12.62,13.261%2012.84,13.17%2013.01,13%20C13.35,12.661%2013.35,12.111%2013.01,11.771%20L13.01,11.771%20L11.23,9.991%20L13.01,8.21%20C13.35,7.871%2013.35,7.311%2013.01,6.971%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var gg=Object.defineProperty,ug=Object.getOwnPropertyDescriptor,
|
|
1977
|
+
`,hg="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIconly/Bold/Close%20Square%3c/title%3e%3cg%20id='Iconly/Bold/Close-Square'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Close-Square'%20transform='translate(1.999800,%201.999200)'%20fill='%23fe331a'%20fill-rule='nonzero'%3e%3cpath%20d='M14.34,2.84217094e-14%20C17.73,2.84217094e-14%2020,2.38%2020,5.92%20L20,5.92%20L20,14.091%20C20,17.621%2017.73,20%2014.34,20%20L14.34,20%20L5.67,20%20C2.28,20%200,17.621%200,14.091%20L0,14.091%20L0,5.92%20C0,2.38%202.28,2.84217094e-14%205.67,2.84217094e-14%20L5.67,2.84217094e-14%20Z%20M13.01,6.971%20C12.67,6.63%2012.12,6.63%2011.77,6.971%20L11.77,6.971%20L10,8.75%20L8.22,6.971%20C7.87,6.63%207.32,6.63%206.98,6.971%20C6.64,7.311%206.64,7.871%206.98,8.21%20L6.98,8.21%20L8.76,9.991%20L6.98,11.761%20C6.64,12.111%206.64,12.661%206.98,13%20C7.15,13.17%207.38,13.261%207.6,13.261%20C7.83,13.261%208.05,13.17%208.22,13%20L8.22,13%20L10,11.231%20L11.78,13%20C11.95,13.181%2012.17,13.261%2012.39,13.261%20C12.62,13.261%2012.84,13.17%2013.01,13%20C13.35,12.661%2013.35,12.111%2013.01,11.771%20L13.01,11.771%20L11.23,9.991%20L13.01,8.21%20C13.35,7.871%2013.35,7.311%2013.01,6.971%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e",dg="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIconly/Bold/Close%20Square%3c/title%3e%3cg%20id='Iconly/Bold/Close-Square'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Close-Square'%20transform='translate(1.999800,%201.999200)'%20fill='%2319c368'%20fill-rule='nonzero'%3e%3cpath%20d='M14.34,2.84217094e-14%20C17.73,2.84217094e-14%2020,2.38%2020,5.92%20L20,5.92%20L20,14.091%20C20,17.621%2017.73,20%2014.34,20%20L14.34,20%20L5.67,20%20C2.28,20%200,17.621%200,14.091%20L0,14.091%20L0,5.92%20C0,2.38%202.28,2.84217094e-14%205.67,2.84217094e-14%20L5.67,2.84217094e-14%20Z%20M13.01,6.971%20C12.67,6.63%2012.12,6.63%2011.77,6.971%20L11.77,6.971%20L10,8.75%20L8.22,6.971%20C7.87,6.63%207.32,6.63%206.98,6.971%20C6.64,7.311%206.64,7.871%206.98,8.21%20L6.98,8.21%20L8.76,9.991%20L6.98,11.761%20C6.64,12.111%206.64,12.661%206.98,13%20C7.15,13.17%207.38,13.261%207.6,13.261%20C7.83,13.261%208.05,13.17%208.22,13%20L8.22,13%20L10,11.231%20L11.78,13%20C11.95,13.181%2012.17,13.261%2012.39,13.261%20C12.62,13.261%2012.84,13.17%2013.01,13%20C13.35,12.661%2013.35,12.111%2013.01,11.771%20L13.01,11.771%20L11.23,9.991%20L13.01,8.21%20C13.35,7.871%2013.35,7.311%2013.01,6.971%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var gg=Object.defineProperty,ug=Object.getOwnPropertyDescriptor,vi=(i,t,e,s)=>{for(var n=s>1?void 0:s?ug(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(n=(s?a(t,e,n):a(n))||n);return s&&n&&gg(t,e,n),n};b.GenusToastMessage=class extends p.LitElement{constructor(){super(...arguments),this.toastMessage="",this.toastType="info",this.showToast=!1,this.setToastVisibility=()=>{this.showToast&&(this.showToast=!this.showToast)},this.renderCloseBtn=t=>{let e=p.html``;return t==="success"&&(e=p.html`<span class='close-btn' @click=${this.setToastVisibility}><object class="genus-icon" data='${dg}' width='20' height='20'></object></span>`),t==="error"&&(e=p.html`<span class='close-btn' @click=${this.setToastVisibility}><object class="genus-icon" data='${hg}' width='20' height='20'></object></span>`),e}}render(){return p.html`
|
|
1978
1978
|
<div class='toast toast--${this.toastType} ${this.showToast&&"toast--show-toast"}'>
|
|
1979
1979
|
<p class='toast__message'>${this.toastMessage}</p>
|
|
1980
1980
|
${this.renderCloseBtn(this.toastType)}
|
|
1981
1981
|
</div>
|
|
1982
|
-
`}},b.GenusToastMessage.styles=[ag,rg,lg,Ag,cg],
|
|
1982
|
+
`}},b.GenusToastMessage.styles=[ag,rg,lg,Ag,cg],vi([M.property({attribute:"toast-message"})],b.GenusToastMessage.prototype,"toastMessage",2),vi([M.property({attribute:"toast-type"})],b.GenusToastMessage.prototype,"toastType",2),vi([M.property({type:Boolean,attribute:"show-toast"})],b.GenusToastMessage.prototype,"showToast",2),b.GenusToastMessage=vi([M.customElement("genus-toast-message")],b.GenusToastMessage);const fg=p.css`
|
|
1983
1983
|
*
|
|
1984
1984
|
{
|
|
1985
1985
|
margin: 0;
|
|
@@ -2161,7 +2161,7 @@
|
|
|
2161
2161
|
.upload-label:hover { cursor: pointer; }
|
|
2162
2162
|
`,Cg=p.css`
|
|
2163
2163
|
input[type='file'] { display: none; }
|
|
2164
|
-
`,ca="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIconly/Bold/Upload%3c/title%3e%3cg%20id='Iconly/Bold/Upload'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Upload'%20transform='translate(2.000000,%202.000000)'%20fill='%23213e70'%20fill-rule='nonzero'%3e%3cpath%20d='M1.77635684e-15,11.2874674%20C1.77635684e-15,8.87583953%201.8779102,6.89627143%204.23116222,6.78512193%20L4.44,6.7802%20L9.23,6.7802%20L9.23,12.8848512%20C9.23,13.3223512%209.57,13.6682814%2010,13.6682814%20C10.385,13.6682814%2010.7111806,13.3776039%2010.7628704,12.9921713%20L10.77,12.8848512%20L10.77,6.7802%20L15.55,6.7802%20C17.93,6.7802%2019.8853469,8.69086445%2019.9951382,11.0944886%20L20,11.3078163%20L20,16.2627581%20C20,18.6842698%2018.1220898,20.6641203%2015.7688378,20.7752778%20L15.56,20.7802%20L4.45,20.7802%20C2.06028571,20.7802%200.114097959,18.8599342%200.00483801749,16.4650885%20L1.77635684e-15,16.2525837%20L1.77635684e-15,11.2874674%20Z%20M6.5502,4.24%20C6.26838182,3.96727273%206.24276198,3.53752066%206.46582735,3.23624343%20L6.5402,3.15%20L9.4502,0.23%20C9.6002,0.08%209.7902,-1.42108547e-14%2010.0002,-1.42108547e-14%20C10.1602,-1.42108547e-14%2010.3202,0.0512%2010.44948,0.14848%20L10.5402,0.23%20L13.4502,3.15%20C13.6002,3.3%2013.6802,3.5%2013.6802,3.69%20C13.6802,3.89%2013.6002,4.09%2013.4502,4.24%20C13.1774727,4.51272727%2012.7477207,4.53752066%2012.4464434,4.31438017%20L12.3602,4.24%20L10.7702,2.64%20L10.7702,6.78%20L9.2302,6.78%20L9.2302,2.64%20L7.6402,4.24%20C7.3402,4.54%206.8502,4.54%206.5502,4.24%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var yg=Object.defineProperty,
|
|
2164
|
+
`,ca="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='24px'%20height='24px'%20viewBox='0%200%2024%2024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIconly/Bold/Upload%3c/title%3e%3cg%20id='Iconly/Bold/Upload'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Upload'%20transform='translate(2.000000,%202.000000)'%20fill='%23213e70'%20fill-rule='nonzero'%3e%3cpath%20d='M1.77635684e-15,11.2874674%20C1.77635684e-15,8.87583953%201.8779102,6.89627143%204.23116222,6.78512193%20L4.44,6.7802%20L9.23,6.7802%20L9.23,12.8848512%20C9.23,13.3223512%209.57,13.6682814%2010,13.6682814%20C10.385,13.6682814%2010.7111806,13.3776039%2010.7628704,12.9921713%20L10.77,12.8848512%20L10.77,6.7802%20L15.55,6.7802%20C17.93,6.7802%2019.8853469,8.69086445%2019.9951382,11.0944886%20L20,11.3078163%20L20,16.2627581%20C20,18.6842698%2018.1220898,20.6641203%2015.7688378,20.7752778%20L15.56,20.7802%20L4.45,20.7802%20C2.06028571,20.7802%200.114097959,18.8599342%200.00483801749,16.4650885%20L1.77635684e-15,16.2525837%20L1.77635684e-15,11.2874674%20Z%20M6.5502,4.24%20C6.26838182,3.96727273%206.24276198,3.53752066%206.46582735,3.23624343%20L6.5402,3.15%20L9.4502,0.23%20C9.6002,0.08%209.7902,-1.42108547e-14%2010.0002,-1.42108547e-14%20C10.1602,-1.42108547e-14%2010.3202,0.0512%2010.44948,0.14848%20L10.5402,0.23%20L13.4502,3.15%20C13.6002,3.3%2013.6802,3.5%2013.6802,3.69%20C13.6802,3.89%2013.6002,4.09%2013.4502,4.24%20C13.1774727,4.51272727%2012.7477207,4.53752066%2012.4464434,4.31438017%20L12.3602,4.24%20L10.7702,2.64%20L10.7702,6.78%20L9.2302,6.78%20L9.2302,2.64%20L7.6402,4.24%20C7.3402,4.54%206.8502,4.54%206.5502,4.24%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e";var yg=Object.defineProperty,Ig=Object.getOwnPropertyDescriptor,$t=(i,t,e,s)=>{for(var n=s>1?void 0:s?Ig(t,e):t,o=i.length-1,a;o>=0;o--)(a=i[o])&&(n=(s?a(t,e,n):a(n))||n);return s&&n&&yg(t,e,n),n};b.GenusFileUpload=class extends p.LitElement{constructor(){super(...arguments),this.buttonText="",this.uploadIcon="",this.specificFileTypes="",this.withoutIcon=!1,this.withoutButtonText=!1,this.getInputValue=()=>{let t=[];if(this._fileInput.files){let e=Array.from(this._fileInput.files);for(let s of e)t.push({fileName:s==null?void 0:s.name,fileSize:(s==null?void 0:s.size)/1024>=1024?`${((s==null?void 0:s.size)/1024/1024).toFixed(1)} MB`:`${((s==null?void 0:s.size)/1024).toFixed(1)} KB`,fileData:s})}this.dispatchEvent(new CustomEvent("selected",{detail:t}))},this.renderInputControl=()=>{let t;return this.withoutIcon?t=p.html`
|
|
2165
2165
|
<input type='file' id='file-input' accept='${this.specificFileTypes}' @change='${this.getInputValue}' multiple />
|
|
2166
2166
|
<label class='upload-label upload-label--without-icon' for='file-input'>
|
|
2167
2167
|
<span class='button-text'>${this.buttonText}</span>
|