@feedmepos/ui-library 0.0.1-alpha.13 → 0.0.1-alpha.15

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.
@@ -0,0 +1,29 @@
1
+ (function(z,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],d):(z=typeof globalThis<"u"?globalThis:z||self,d(z["feedmepos-ui-library"]={},z.Vue))})(this,function(z,d){"use strict";var Nf=Object.defineProperty;var If=(z,d,Qt)=>d in z?Nf(z,d,{enumerable:!0,configurable:!0,writable:!0,value:Qt}):z[d]=Qt;var D=(z,d,Qt)=>(If(z,typeof d!="symbol"?d+"":d,Qt),Qt);const Qt="";/*!
2
+ * vue-router v4.2.5
3
+ * (c) 2023 Eduardo San Martin Morote
4
+ * @license MIT
5
+ */var _i;(function(n){n.pop="pop",n.push="push"})(_i||(_i={}));var yi;(function(n){n.back="back",n.forward="forward",n.unknown=""})(yi||(yi={})),Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var xi;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(xi||(xi={})),Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),Symbol(process.env.NODE_ENV!=="production"?"router view depth":"");const oa=Symbol(process.env.NODE_ENV!=="production"?"router":""),aa=Symbol(process.env.NODE_ENV!=="production"?"route location":"");Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function ra(){return d.inject(oa)}function la(){return d.inject(aa)}const ca={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},da=["onMouseenter"],ha={key:0},ua=d.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(n){const t=n,e=la(),i=ra();d.onMounted(async()=>{await i.isReady();const g=t.items.findIndex(m=>m.route==e.path);g!=-1&&!t.items[g].disabled&&(s.value=g)});const s=d.ref(-1),o=d.ref(-1),a=d.ref(" / "),r=d.ref("... /"),l=d.ref(!1),c=g=>s.value===g?"selected":o.value===g?"hovered":t.items[g].disabled?"disabled":"default",h=g=>{t.items[g].disabled||(s.value=g)},u=g=>g!=t.items.length-1,f=g=>!l.value&&t.items.length>5&&g>=2&&g<t.items.length-2,p=()=>{l.value=!l.value};return(g,m)=>{const b=d.resolveComponent("RouterLink");return d.openBlock(),d.createElementBlock("nav",null,[d.createElementVNode("ul",ca,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(g.items,(_,y)=>(d.openBlock(),d.createElementBlock("li",{key:y,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:k=>o.value=y,onMouseleave:m[0]||(m[0]=k=>o.value=-1)},[f(y)?y===3&&!l.value?(d.openBlock(),d.createElementBlock("a",{key:1,onClick:p},d.toDisplayString(r.value),1)):d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(b,{key:0,class:d.normalizeClass(c(y)),to:_.disabled?"":_.route,onClick:k=>h(y)},{default:d.withCtx(()=>[d.createElementVNode("span",null,d.toDisplayString(_.label),1),u(y)?(d.openBlock(),d.createElementBlock("span",ha,d.toDisplayString(a.value),1)):d.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,da))),128))])])}}}),$f="",fa=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,pa=/^rgb[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*(?:,(?![)])|(?=[)]))){3}[)]$/,ga=/^^rgba[(](?:\s*0*(?:\d\d?(?:\.\d+)?(?:\s*%)?|\.\d+\s*%|100(?:\.0*)?\s*%|(?:1\d\d|2[0-4]\d|25[0-5])(?:\.\d+)?)\s*,){3}\s*0*(?:\.\d+|1(?:\.0*)?)\s*[)]$/,ma=/^hsl[(]\s*0*(?:[12]?\d{1,2}|3(?:[0-5]\d|60))\s*(?:\s*,\s*0*(?:\d\d?(?:\.\d+)?\s*%|\.\d+\s*%|100(?:\.0*)?\s*%)){2}\s*[)]$/,ba=/^hsla[(]\s*0*(?:[12]?\d{1,2}|3(?:[0-5]\d|60))\s*(?:\s*,\s*0*(?:\d\d?(?:\.\d+)?\s*%|\.\d+\s*%|100(?:\.0*)?\s*%)){2}\s*,\s*0*(?:\.\d+|1(?:\.0*)?)\s*[)]$/;function Sn(n){return[fa,pa,ga,ma,ba].some(t=>t.test(n))}const _a=d.defineComponent({__name:"FmIcon",props:{name:{type:String,required:!0},color:{type:String,default:"black"},outline:{type:Boolean,default:!1},size:{type:String,default:"md"}},setup(n){const t=n,e=d.computed(()=>{const o=[],a={};return o.push(i()),o.push(s()),Sn(t.color)?a.color=t.color:o.push(`text-fm-color-${t.color}`),{class:o.join(" "),style:a}});function i(){return`fm-icon--${t.outline?"outlined":"rounded"}`}function s(){return`fm-icon--${t.size}`}return(o,a)=>(d.openBlock(),d.createElementBlock("span",d.mergeProps(e.value,{class:"fm-icon"}),d.toDisplayString(t.name),17))}}),zf="",ft=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},st=ft(_a,[["__scopeId","data-v-88e86ba4"]]),ya=["disabled"],xa={key:1,class:"fm-typo-body-lg-700"},ka=d.defineComponent({__name:"FmButton",props:{variant:{type:String,default:"primary"},label:{type:String,default:void 0},icon:{type:String,default:void 0},size:{type:String,default:"lg"},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1}},setup(n){const t=n,e=d.ref(!1),i=d.computed(()=>`${s[t.variant]} ${t.disabled?"cursor-not-allowed":"cursor-pointer"}`),s={primary:"bg-fm-color-primary text-fm-color-typo-white",secondary:"bg-transparent",destructive:"bg-fm-color-system-error-300 text-fm-color-white text-fm-color-typo-white",tertiary:"bg-transparent text-fm-color-black",fab:"bg-fm-color-primary text-fm-color-white rounded-full text-fm-color-typo-white"};function o(a){e.value=a}return(a,r)=>{const l=d.resolveDirective("wave");return d.withDirectives((d.openBlock(),d.createElementBlock("button",{ref:"buttonEl",class:d.normalizeClass(`
6
+ fm-btn rounded-lg
7
+ ${i.value}
8
+ fm-btn--${n.size}
9
+ ${n.label?"":`fm-btn--${n.size}--just-icon`}
10
+ fm-btn--${n.variant}
11
+ ${n.disabled?"fm-btn--disabled":""}
12
+ `),disabled:n.disabled,onMousedown:r[0]||(r[0]=()=>o(!0)),onMouseup:r[1]||(r[1]=()=>o(!1)),onMouseleave:r[2]||(r[2]=()=>o(!1))},[n.icon?(d.openBlock(),d.createBlock(st,{key:0,name:n.icon,outline:!e.value,color:n.disabled?"neutral-gray-200":"",size:"md"},null,8,["name","outline","color"])):d.createCommentVNode("",!0),n.label?(d.openBlock(),d.createElementBlock("span",xa,d.toDisplayString(n.label),1)):d.createCommentVNode("",!0)],42,ya)),[[l,!n.disabled]])}}}),Wf="",Ne=ft(ka,[["__scopeId","data-v-ffd3b0af"]]);/*!
13
+ * @kurkle/color v0.3.2
14
+ * https://github.com/kurkle/color#readme
15
+ * (c) 2023 Jukka Kurkela
16
+ * Released under the MIT License
17
+ */function le(n){return n+.5|0}const Ot=(n,t,e)=>Math.max(Math.min(n,e),t);function ce(n){return Ot(le(n*2.55),0,255)}function Bt(n){return Ot(le(n*255),0,255)}function wt(n){return Ot(le(n/2.55)/100,0,1)}function ki(n){return Ot(le(n*100),0,100)}const pt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},vn=[..."0123456789ABCDEF"],wa=n=>vn[n&15],Ma=n=>vn[(n&240)>>4]+vn[n&15],Ie=n=>(n&240)>>4===(n&15),Sa=n=>Ie(n.r)&&Ie(n.g)&&Ie(n.b)&&Ie(n.a);function va(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&pt[n[1]]*17,g:255&pt[n[2]]*17,b:255&pt[n[3]]*17,a:t===5?pt[n[4]]*17:255}:(t===7||t===9)&&(e={r:pt[n[1]]<<4|pt[n[2]],g:pt[n[3]]<<4|pt[n[4]],b:pt[n[5]]<<4|pt[n[6]],a:t===9?pt[n[7]]<<4|pt[n[8]]:255})),e}const Ca=(n,t)=>n<255?t(n):"";function Da(n){var t=Sa(n)?wa:Ma;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Ca(n.a,t):void 0}const Ea=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function wi(n,t,e){const i=t*Math.min(e,1-e),s=(o,a=(o+n/30)%12)=>e-i*Math.max(Math.min(a-3,9-a,1),-1);return[s(0),s(8),s(4)]}function Pa(n,t,e){const i=(s,o=(s+n/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[i(5),i(3),i(1)]}function Oa(n,t,e){const i=wi(n,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)i[s]*=1-t-e,i[s]+=t;return i}function Ba(n,t,e,i,s){return n===s?(t-e)/i+(t<e?6:0):t===s?(e-n)/i+2:(n-t)/i+4}function Cn(n){const e=n.r/255,i=n.g/255,s=n.b/255,o=Math.max(e,i,s),a=Math.min(e,i,s),r=(o+a)/2;let l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=Ba(e,i,s,h,o),l=l*60+.5),[l|0,c||0,r]}function Dn(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(Bt)}function En(n,t,e){return Dn(wi,n,t,e)}function Aa(n,t,e){return Dn(Oa,n,t,e)}function La(n,t,e){return Dn(Pa,n,t,e)}function Mi(n){return(n%360+360)%360}function Ta(n){const t=Ea.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?ce(+t[5]):Bt(+t[5]));const s=Mi(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=Aa(s,o,a):t[1]==="hsv"?i=La(s,o,a):i=En(s,o,a),{r:i[0],g:i[1],b:i[2],a:e}}function Fa(n,t){var e=Cn(n);e[0]=Mi(e[0]+t),e=En(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Va(n){if(!n)return;const t=Cn(n),e=t[0],i=ki(t[1]),s=ki(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${wt(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const Si={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},vi={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Ra(){const n={},t=Object.keys(vi),e=Object.keys(Si);let i,s,o,a,r;for(i=0;i<t.length;i++){for(a=r=t[i],s=0;s<e.length;s++)o=e[s],r=r.replace(o,Si[o]);o=parseInt(vi[a],16),n[r]=[o>>16&255,o>>8&255,o&255]}return n}let $e;function Na(n){$e||($e=Ra(),$e.transparent=[0,0,0,0]);const t=$e[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Ia=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function $a(n){const t=Ia.exec(n);let e=255,i,s,o;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?ce(a):Ot(a*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?ce(i):Ot(i,0,255)),s=255&(t[4]?ce(s):Ot(s,0,255)),o=255&(t[6]?ce(o):Ot(o,0,255)),{r:i,g:s,b:o,a:e}}}function za(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${wt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Pn=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,te=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Wa(n,t,e){const i=te(wt(n.r)),s=te(wt(n.g)),o=te(wt(n.b));return{r:Bt(Pn(i+e*(te(wt(t.r))-i))),g:Bt(Pn(s+e*(te(wt(t.g))-s))),b:Bt(Pn(o+e*(te(wt(t.b))-o))),a:n.a+e*(t.a-n.a)}}function ze(n,t,e){if(n){let i=Cn(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=En(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Ci(n,t){return n&&Object.assign(t||{},n)}function Di(n){var t={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(t={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(t.a=Bt(n[3]))):(t=Ci(n,{r:0,g:0,b:0,a:1}),t.a=Bt(t.a)),t}function ja(n){return n.charAt(0)==="r"?$a(n):Ta(n)}class de{constructor(t){if(t instanceof de)return t;const e=typeof t;let i;e==="object"?i=Di(t):e==="string"&&(i=va(t)||Na(t)||ja(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=Ci(this._rgb);return t&&(t.a=wt(t.a)),t}set rgb(t){this._rgb=Di(t)}rgbString(){return this._valid?za(this._rgb):void 0}hexString(){return this._valid?Da(this._rgb):void 0}hslString(){return this._valid?Va(this._rgb):void 0}mix(t,e){if(t){const i=this.rgb,s=t.rgb;let o;const a=e===o?.5:e,r=2*a-1,l=i.a-s.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,i.r=255&c*i.r+o*s.r+.5,i.g=255&c*i.g+o*s.g+.5,i.b=255&c*i.b+o*s.b+.5,i.a=a*i.a+(1-a)*s.a,this.rgb=i}return this}interpolate(t,e){return t&&(this._rgb=Wa(this._rgb,t._rgb,e)),this}clone(){return new de(this.rgb)}alpha(t){return this._rgb.a=Bt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=le(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ze(this._rgb,2,t),this}darken(t){return ze(this._rgb,2,-t),this}saturate(t){return ze(this._rgb,1,t),this}desaturate(t){return ze(this._rgb,1,-t),this}rotate(t){return Fa(this._rgb,t),this}}/*!
18
+ * Chart.js v4.4.0
19
+ * https://www.chartjs.org
20
+ * (c) 2023 Chart.js Contributors
21
+ * Released under the MIT License
22
+ */function Mt(){}const Ha=(()=>{let n=0;return()=>n++})();function $(n){return n===null||typeof n>"u"}function U(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function I(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function G(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function ht(n,t){return G(n)?n:t}function R(n,t){return typeof n>"u"?t:n}const Ya=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Ei=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function Y(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function j(n,t,e,i){let s,o,a;if(U(n))if(o=n.length,i)for(s=o-1;s>=0;s--)t.call(e,n[s],s);else for(s=0;s<o;s++)t.call(e,n[s],s);else if(I(n))for(a=Object.keys(n),o=a.length,s=0;s<o;s++)t.call(e,n[a[s]],a[s])}function We(n,t){let e,i,s,o;if(!n||!t||n.length!==t.length)return!1;for(e=0,i=n.length;e<i;++e)if(s=n[e],o=t[e],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function je(n){if(U(n))return n.map(je);if(I(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=je(n[e[s]]);return t}return n}function Pi(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Ua(n,t,e,i){if(!Pi(n))return;const s=t[n],o=e[n];I(s)&&I(o)?he(s,o,i):t[n]=je(o)}function he(n,t,e){const i=U(t)?t:[t],s=i.length;if(!I(n))return n;e=e||{};const o=e.merger||Ua;let a;for(let r=0;r<s;++r){if(a=i[r],!I(a))continue;const l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],n,a,e)}return n}function ue(n,t){return he(n,t,{merger:Xa})}function Xa(n,t,e){if(!Pi(n))return;const i=t[n],s=e[n];I(i)&&I(s)?ue(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=je(s))}const Oi={"":n=>n,x:n=>n.x,y:n=>n.y};function qa(n){const t=n.split("."),e=[];let i="";for(const s of t)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(e.push(i),i="");return e}function Ka(n){const t=qa(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function At(n,t){return(Oi[t]||(Oi[t]=Ka(t)))(n)}function On(n){return n.charAt(0).toUpperCase()+n.slice(1)}const fe=n=>typeof n<"u",Lt=n=>typeof n=="function",Bi=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Ga(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const X=Math.PI,q=2*X,Za=q+X,He=Number.POSITIVE_INFINITY,Ja=X/180,Q=X/2,It=X/4,Ai=X*2/3,Tt=Math.log10,yt=Math.sign;function pe(n,t,e){return Math.abs(n-t)<e}function Li(n){const t=Math.round(n);n=pe(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Tt(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Qa(n){const t=[],e=Math.sqrt(n);let i;for(i=1;i<e;i++)n%i===0&&(t.push(i),t.push(n/i));return e===(e|0)&&t.push(e),t.sort((s,o)=>s-o).pop(),t}function ee(n){return!isNaN(parseFloat(n))&&isFinite(n)}function tr(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Ti(n,t,e){let i,s,o;for(i=0,s=n.length;i<s;i++)o=n[i][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function mt(n){return n*(X/180)}function Bn(n){return n*(180/X)}function Fi(n){if(!G(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Vi(n,t){const e=t.x-n.x,i=t.y-n.y,s=Math.sqrt(e*e+i*i);let o=Math.atan2(i,e);return o<-.5*X&&(o+=q),{angle:o,distance:s}}function An(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function er(n,t){return(n-t+Za)%q-X}function ut(n){return(n%q+q)%q}function ge(n,t,e,i){const s=ut(n),o=ut(t),a=ut(e),r=ut(o-s),l=ut(a-s),c=ut(s-o),h=ut(s-a);return s===o||s===a||i&&o===a||r>l&&c<h}function nt(n,t,e){return Math.max(t,Math.min(e,n))}function nr(n){return nt(n,-32768,32767)}function St(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function Ln(n,t,e){e=e||(a=>n[a]<t);let i=n.length-1,s=0,o;for(;i-s>1;)o=s+i>>1,e(o)?s=o:i=o;return{lo:s,hi:i}}const vt=(n,t,e,i)=>Ln(n,e,i?s=>{const o=n[s][t];return o<e||o===e&&n[s+1][t]===e}:s=>n[s][t]<e),ir=(n,t,e)=>Ln(n,e,i=>n[i][t]>=e);function sr(n,t,e){let i=0,s=n.length;for(;i<s&&n[i]<t;)i++;for(;s>i&&n[s-1]>e;)s--;return i>0||s<n.length?n.slice(i,s):n}const Ri=["push","pop","shift","splice","unshift"];function or(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Ri.forEach(e=>{const i="_onData"+On(e),s=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...o){const a=s.apply(this,o);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...o)}),a}})})}function Ni(n,t){const e=n._chartjs;if(!e)return;const i=e.listeners,s=i.indexOf(t);s!==-1&&i.splice(s,1),!(i.length>0)&&(Ri.forEach(o=>{delete n[o]}),delete n._chartjs)}function Ii(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const $i=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function zi(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,$i.call(window,()=>{i=!1,n.apply(t,e)}))}}function ar(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const Tn=n=>n==="start"?"left":n==="end"?"right":"center",ot=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,rr=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function Wi(n,t,e){const i=t.length;let s=0,o=i;if(n._sorted){const{iScale:a,_parsed:r}=n,l=a.axis,{min:c,max:h,minDefined:u,maxDefined:f}=a.getUserBounds();u&&(s=nt(Math.min(vt(r,l,c).lo,e?i:vt(t,l,a.getPixelForValue(c)).lo),0,i-1)),f?o=nt(Math.max(vt(r,a.axis,h,!0).hi+1,e?0:vt(t,l,a.getPixelForValue(h),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function ji(n){const{xScale:t,yScale:e,_scaleRanges:i}=n,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!i)return n._scaleRanges=s,!0;const o=i.xmin!==t.min||i.xmax!==t.max||i.ymin!==e.min||i.ymax!==e.max;return Object.assign(i,s),o}const Ye=n=>n===0||n===1,Hi=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*q/e)),Yi=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*q/e)+1,me={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Q)+1,easeOutSine:n=>Math.sin(n*Q),easeInOutSine:n=>-.5*(Math.cos(X*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Ye(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Ye(n)?n:Hi(n,.075,.3),easeOutElastic:n=>Ye(n)?n:Yi(n,.075,.3),easeInOutElastic(n){return Ye(n)?n:n<.5?.5*Hi(n*2,.1125,.45):.5+.5*Yi(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let t=1.70158;return(n/=.5)<1?.5*(n*n*(((t*=1.525)+1)*n-t)):.5*((n-=2)*n*(((t*=1.525)+1)*n+t)+2)},easeInBounce:n=>1-me.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?me.easeInBounce(n*2)*.5:me.easeOutBounce(n*2-1)*.5+.5};function Fn(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ui(n){return Fn(n)?n:new de(n)}function Vn(n){return Fn(n)?n:new de(n).saturate(.5).darken(.1).hexString()}const lr=["x","y","borderWidth","radius","tension"],cr=["color","borderColor","backgroundColor"];function dr(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),n.set("animations",{colors:{type:"color",properties:cr},numbers:{type:"number",properties:lr}}),n.describe("animations",{_fallback:"animation"}),n.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 hr(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Xi=new Map;function ur(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Xi.get(e);return i||(i=new Intl.NumberFormat(n,t),Xi.set(e,i)),i}function be(n,t,e){return ur(t,e).format(n)}const qi={values(n){return U(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const i=this.chart.options.locale;let s,o=n;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=fr(n,e)}const a=Tt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:s,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),be(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Tt(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?qi.numeric.call(this,n,t,e):""}};function fr(n,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&n!==Math.floor(n)&&(e=n-Math.floor(n)),e}var Ue={formatters:qi};function pr(n){n.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:Ue.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const $t=Object.create(null),Rn=Object.create(null);function _e(n,t){if(!t)return n;const e=t.split(".");for(let i=0,s=e.length;i<s;++i){const o=e[i];n=n[o]||(n[o]=Object.create(null))}return n}function Nn(n,t,e){return typeof t=="string"?he(_e(n,t),e):he(_e(n,""),t)}class gr{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=i=>i.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=(i,s)=>Vn(s.backgroundColor),this.hoverBorderColor=(i,s)=>Vn(s.borderColor),this.hoverColor=(i,s)=>Vn(s.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 Nn(this,t,e)}get(t){return _e(this,t)}describe(t,e){return Nn(Rn,t,e)}override(t,e){return Nn($t,t,e)}route(t,e,i,s){const o=_e(this,t),a=_e(this,i),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],c=a[s];return I(l)?Object.assign({},c,l):R(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var Z=new gr({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[dr,hr,pr]);function mr(n){return!n||$(n.size)||$(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Xe(n,t,e,i,s){let o=t[s];return o||(o=t[s]=n.measureText(s).width,e.push(s)),o>i&&(i=o),i}function br(n,t,e,i){i=i||{};let s=i.data=i.data||{},o=i.garbageCollect=i.garbageCollect||[];i.font!==t&&(s=i.data={},o=i.garbageCollect=[],i.font=t),n.save(),n.font=t;let a=0;const r=e.length;let l,c,h,u,f;for(l=0;l<r;l++)if(u=e[l],u!=null&&!U(u))a=Xe(n,s,o,a,u);else if(U(u))for(c=0,h=u.length;c<h;c++)f=u[c],f!=null&&!U(f)&&(a=Xe(n,s,o,a,f));n.restore();const p=o.length/2;if(p>e.length){for(l=0;l<p;l++)delete s[o[l]];o.splice(0,p)}return a}function zt(n,t,e){const i=n.currentDevicePixelRatio,s=e!==0?Math.max(e/2,.5):0;return Math.round((t-s)*i)/i+s}function Ki(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function In(n,t,e,i){Gi(n,t,e,i,null)}function Gi(n,t,e,i,s){let o,a,r,l,c,h,u,f;const p=t.pointStyle,g=t.rotation,m=t.radius;let b=(g||0)*Ja;if(p&&typeof p=="object"&&(o=p.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){n.save(),n.translate(e,i),n.rotate(b),n.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),n.restore();return}if(!(isNaN(m)||m<=0)){switch(n.beginPath(),p){default:s?n.ellipse(e,i,s/2,m,0,0,q):n.arc(e,i,m,0,q),n.closePath();break;case"triangle":h=s?s/2:m,n.moveTo(e+Math.sin(b)*h,i-Math.cos(b)*m),b+=Ai,n.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*m),b+=Ai,n.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*m),n.closePath();break;case"rectRounded":c=m*.516,l=m-c,a=Math.cos(b+It)*l,u=Math.cos(b+It)*(s?s/2-c:l),r=Math.sin(b+It)*l,f=Math.sin(b+It)*(s?s/2-c:l),n.arc(e-u,i-r,c,b-X,b-Q),n.arc(e+f,i-a,c,b-Q,b),n.arc(e+u,i+r,c,b,b+Q),n.arc(e-f,i+a,c,b+Q,b+X),n.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*m,h=s?s/2:l,n.rect(e-h,i-l,2*h,2*l);break}b+=It;case"rectRot":u=Math.cos(b)*(s?s/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,f=Math.sin(b)*(s?s/2:m),n.moveTo(e-u,i-r),n.lineTo(e+f,i-a),n.lineTo(e+u,i+r),n.lineTo(e-f,i+a),n.closePath();break;case"crossRot":b+=It;case"cross":u=Math.cos(b)*(s?s/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,f=Math.sin(b)*(s?s/2:m),n.moveTo(e-u,i-r),n.lineTo(e+u,i+r),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"star":u=Math.cos(b)*(s?s/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,f=Math.sin(b)*(s?s/2:m),n.moveTo(e-u,i-r),n.lineTo(e+u,i+r),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a),b+=It,u=Math.cos(b)*(s?s/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,f=Math.sin(b)*(s?s/2:m),n.moveTo(e-u,i-r),n.lineTo(e+u,i+r),n.moveTo(e+f,i-a),n.lineTo(e-f,i+a);break;case"line":a=s?s/2:Math.cos(b)*m,r=Math.sin(b)*m,n.moveTo(e-a,i-r),n.lineTo(e+a,i+r);break;case"dash":n.moveTo(e,i),n.lineTo(e+Math.cos(b)*(s?s/2:m),i+Math.sin(b)*m);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Ct(n,t,e){return e=e||.5,!t||n&&n.x>t.left-e&&n.x<t.right+e&&n.y>t.top-e&&n.y<t.bottom+e}function qe(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function Ke(n){n.restore()}function _r(n,t,e,i,s){if(!t)return n.lineTo(e.x,e.y);if(s==="middle"){const o=(t.x+e.x)/2;n.lineTo(o,t.y),n.lineTo(o,e.y)}else s==="after"!=!!i?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function yr(n,t,e,i){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(i?t.cp1x:t.cp2x,i?t.cp1y:t.cp2y,i?e.cp2x:e.cp1x,i?e.cp2y:e.cp1y,e.x,e.y)}function xr(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),$(t.rotation)||n.rotate(t.rotation),t.color&&(n.fillStyle=t.color),t.textAlign&&(n.textAlign=t.textAlign),t.textBaseline&&(n.textBaseline=t.textBaseline)}function kr(n,t,e,i,s){if(s.strikethrough||s.underline){const o=n.measureText(i),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+c)/2:c;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,h),n.lineTo(r,h),n.stroke()}}function wr(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function Wt(n,t,e,i,s,o={}){const a=U(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(n.save(),n.font=s.string,xr(n,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&wr(n,o.backdrop),r&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),$(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(c,e,i,o.maxWidth)),n.fillText(c,e,i,o.maxWidth),kr(n,e,i,c,o),i+=Number(s.lineHeight);n.restore()}function ye(n,t){const{x:e,y:i,w:s,h:o,radius:a}=t;n.arc(e+a.topLeft,i+a.topLeft,a.topLeft,1.5*X,X,!0),n.lineTo(e,i+o-a.bottomLeft),n.arc(e+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,X,Q,!0),n.lineTo(e+s-a.bottomRight,i+o),n.arc(e+s-a.bottomRight,i+o-a.bottomRight,a.bottomRight,Q,0,!0),n.lineTo(e+s,i+a.topRight),n.arc(e+s-a.topRight,i+a.topRight,a.topRight,0,-Q,!0),n.lineTo(e+a.topLeft,i)}const Mr=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Sr=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function vr(n,t){const e=(""+n).match(Mr);if(!e||e[1]==="normal")return t*1.2;switch(n=+e[2],e[3]){case"px":return n;case"%":n/=100;break}return t*n}const Cr=n=>+n||0;function $n(n,t){const e={},i=I(t),s=i?Object.keys(t):t,o=I(n)?i?a=>R(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of s)e[a]=Cr(o(a));return e}function Zi(n){return $n(n,{top:"y",right:"x",bottom:"y",left:"x"})}function jt(n){return $n(n,["topLeft","topRight","bottomLeft","bottomRight"])}function at(n){const t=Zi(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function et(n,t){n=n||{},t=t||Z.font;let e=R(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=R(n.style,t.style);i&&!(""+i).match(Sr)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:R(n.family,t.family),lineHeight:vr(R(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:R(n.weight,t.weight),string:""};return s.string=mr(s),s}function xe(n,t,e,i){let s=!0,o,a,r;for(o=0,a=n.length;o<a;++o)if(r=n[o],r!==void 0&&(t!==void 0&&typeof r=="function"&&(r=r(t),s=!1),e!==void 0&&U(r)&&(r=r[e%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function Dr(n,t,e){const{min:i,max:s}=n,o=Ei(t,(s-i)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(i,-Math.abs(o)),max:a(s,o)}}function Ft(n,t){return Object.assign(Object.create(n),t)}function zn(n,t=[""],e,i,s=()=>n[0]){const o=e||n;typeof i>"u"&&(i=ns("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:r=>zn([r,...n],t,o,i)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete n[0][l],!0},get(r,l){return Qi(r,l,()=>Fr(l,t,n,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,l){return is(r).includes(l)},ownKeys(r){return is(r)},set(r,l,c){const h=r._storage||(r._storage=s());return r[l]=h[l]=c,delete r._keys,!0}})}function ne(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ji(n,i),setContext:o=>ne(n,o,e,i),override:o=>ne(n.override(o),t,e,i)};return new Proxy(s,{deleteProperty(o,a){return delete o[a],delete n[a],!0},get(o,a,r){return Qi(o,a,()=>Pr(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(o,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(o,a,r){return n[a]=r,delete o[a],!0}})}function Ji(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:i=t.indexable,_allKeys:s=t.allKeys}=n;return{allKeys:s,scriptable:e,indexable:i,isScriptable:Lt(e)?e:()=>e,isIndexable:Lt(i)?i:()=>i}}const Er=(n,t)=>n?n+On(t):t,Wn=(n,t)=>I(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Qi(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function Pr(n,t,e){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;let r=i[t];return Lt(r)&&a.isScriptable(t)&&(r=Or(t,r,n,e)),U(r)&&r.length&&(r=Br(t,r,n,a.isIndexable)),Wn(t,r)&&(r=ne(r,s,o&&o[t],a)),r}function Or(n,t,e,i){const{_proxy:s,_context:o,_subProxy:a,_stack:r}=e;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let l=t(o,a||i);return r.delete(n),Wn(n,l)&&(l=jn(s._scopes,s,n,l)),l}function Br(n,t,e,i){const{_proxy:s,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&i(n))return t[o.index%t.length];if(I(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const u=jn(c,s,n,h);t.push(ne(u,o,a&&a[n],r))}}return t}function ts(n,t,e){return Lt(n)?n(t,e):n}const Ar=(n,t)=>n===!0?t:typeof n=="string"?At(t,n):void 0;function Lr(n,t,e,i,s){for(const o of t){const a=Ar(e,o);if(a){n.add(a);const r=ts(a._fallback,e,s);if(typeof r<"u"&&r!==e&&r!==i)return r}else if(a===!1&&typeof i<"u"&&e!==i)return null}return!1}function jn(n,t,e,i){const s=t._rootScopes,o=ts(t._fallback,e,i),a=[...n,...s],r=new Set;r.add(i);let l=es(r,a,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=es(r,a,o,l,i),l===null)?!1:zn(Array.from(r),[""],s,o,()=>Tr(t,e,i))}function es(n,t,e,i,s){for(;e;)e=Lr(n,t,e,i,s);return e}function Tr(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return U(s)&&I(e)?e:s||{}}function Fr(n,t,e,i){let s;for(const o of t)if(s=ns(Er(o,n),e),typeof s<"u")return Wn(n,s)?jn(e,i,n,s):s}function ns(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function is(n){let t=n._keys;return t||(t=n._keys=Vr(n._scopes)),t}function Vr(n){const t=new Set;for(const e of n)for(const i of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(i);return Array.from(t)}function ss(n,t,e,i){const{iScale:s}=n,{key:o="r"}=this._parsing,a=new Array(i);let r,l,c,h;for(r=0,l=i;r<l;++r)c=r+e,h=t[c],a[r]={r:s.parse(At(h,o),c)};return a}const Rr=Number.EPSILON||1e-14,ie=(n,t)=>t<n.length&&!n[t].skip&&n[t],os=n=>n==="x"?"y":"x";function Nr(n,t,e,i){const s=n.skip?t:n,o=t,a=e.skip?t:e,r=An(o,s),l=An(a,o);let c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const u=i*c,f=i*h;return{previous:{x:o.x-u*(a.x-s.x),y:o.y-u*(a.y-s.y)},next:{x:o.x+f*(a.x-s.x),y:o.y+f*(a.y-s.y)}}}function Ir(n,t,e){const i=n.length;let s,o,a,r,l,c=ie(n,0);for(let h=0;h<i-1;++h)if(l=c,c=ie(n,h+1),!(!l||!c)){if(pe(t[h],0,Rr)){e[h]=e[h+1]=0;continue}s=e[h]/t[h],o=e[h+1]/t[h],r=Math.pow(s,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[h]=s*a*t[h],e[h+1]=o*a*t[h])}}function $r(n,t,e="x"){const i=os(e),s=n.length;let o,a,r,l=ie(n,0);for(let c=0;c<s;++c){if(a=r,r=l,l=ie(n,c+1),!r)continue;const h=r[e],u=r[i];a&&(o=(h-a[e])/3,r[`cp1${e}`]=h-o,r[`cp1${i}`]=u-o*t[c]),l&&(o=(l[e]-h)/3,r[`cp2${e}`]=h+o,r[`cp2${i}`]=u+o*t[c])}}function zr(n,t="x"){const e=os(t),i=n.length,s=Array(i).fill(0),o=Array(i);let a,r,l,c=ie(n,0);for(a=0;a<i;++a)if(r=l,l=c,c=ie(n,a+1),!!l){if(c){const h=c[t]-l[t];s[a]=h!==0?(c[e]-l[e])/h:0}o[a]=r?c?yt(s[a-1])!==yt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}Ir(n,s,o),$r(n,o,t)}function Ge(n,t,e){return Math.max(Math.min(n,e),t)}function Wr(n,t){let e,i,s,o,a,r=Ct(n[0],t);for(e=0,i=n.length;e<i;++e)a=o,o=r,r=e<i-1&&Ct(n[e+1],t),o&&(s=n[e],a&&(s.cp1x=Ge(s.cp1x,t.left,t.right),s.cp1y=Ge(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=Ge(s.cp2x,t.left,t.right),s.cp2y=Ge(s.cp2y,t.top,t.bottom)))}function jr(n,t,e,i,s){let o,a,r,l;if(t.spanGaps&&(n=n.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")zr(n,s);else{let c=i?n[n.length-1]:n[0];for(o=0,a=n.length;o<a;++o)r=n[o],l=Nr(c,r,n[Math.min(o+1,a-(i?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&Wr(n,e)}function as(){return typeof window<"u"&&typeof document<"u"}function Hn(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ze(n,t,e){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*t.parentNode[e])):i=n,i}const Je=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Hr(n,t){return Je(n).getPropertyValue(t)}const Yr=["top","right","bottom","left"];function Ht(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Yr[s];i[o]=parseFloat(n[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Ur=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Xr(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i;let a=!1,r,l;if(Ur(s,o,n.target))r=s,l=o;else{const c=t.getBoundingClientRect();r=i.clientX-c.left,l=i.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function Yt(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=Je(e),o=s.boxSizing==="border-box",a=Ht(s,"padding"),r=Ht(s,"border","width"),{x:l,y:c,box:h}=Xr(n,e),u=a.left+(h&&r.left),f=a.top+(h&&r.top);let{width:p,height:g}=t;return o&&(p-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-u)/p*e.width/i),y:Math.round((c-f)/g*e.height/i)}}function qr(n,t,e){let i,s;if(t===void 0||e===void 0){const o=Hn(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{const a=o.getBoundingClientRect(),r=Je(o),l=Ht(r,"border","width"),c=Ht(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,i=Ze(r.maxWidth,o,"clientWidth"),s=Ze(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||He,maxHeight:s||He}}const Qe=n=>Math.round(n*10)/10;function Kr(n,t,e,i){const s=Je(n),o=Ht(s,"margin"),a=Ze(s.maxWidth,n,"clientWidth")||He,r=Ze(s.maxHeight,n,"clientHeight")||He,l=qr(n,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const f=Ht(s,"border","width"),p=Ht(s,"padding");c-=p.width+f.width,h-=p.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,i?c/i:h-o.height),c=Qe(Math.min(c,a,l.maxWidth)),h=Qe(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Qe(c/2)),(t!==void 0||e!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,c=Qe(Math.floor(h*i))),{width:c,height:h}}function rs(n,t,e){const i=t||1,s=Math.floor(n.height*i),o=Math.floor(n.width*i);n.height=Math.floor(n.height),n.width=Math.floor(n.width);const a=n.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${n.height}px`,a.style.width=`${n.width}px`),n.currentDevicePixelRatio!==i||a.height!==s||a.width!==o?(n.currentDevicePixelRatio=i,a.height=s,a.width=o,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Gr=function(){let n=!1;try{const t={get passive(){return n=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return n}();function ls(n,t){const e=Hr(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ut(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Zr(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:i==="middle"?e<.5?n.y:t.y:i==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Jr(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},a=Ut(n,s,e),r=Ut(s,o,e),l=Ut(o,t,e),c=Ut(a,r,e),h=Ut(r,l,e);return Ut(c,h,e)}const Qr=function(n,t){return{x(e){return n+n+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,i){return e-i},leftForLtr(e,i){return e-i}}},tl=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function se(n,t,e){return n?Qr(t,e):tl()}function cs(n,t){let e,i;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,i=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=i)}function ds(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function hs(n){return n==="angle"?{between:ge,compare:er,normalize:ut}:{between:St,compare:(t,e)=>t-e,normalize:t=>t}}function us({start:n,end:t,count:e,loop:i,style:s}){return{start:n%e,end:t%e,loop:i&&(t-n+1)%e===0,style:s}}function el(n,t,e){const{property:i,start:s,end:o}=e,{between:a,normalize:r}=hs(i),l=t.length;let{start:c,end:h,loop:u}=n,f,p;if(u){for(c+=l,h+=l,f=0,p=l;f<p&&a(r(t[c%l][i]),s,o);++f)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:u,style:n.style}}function fs(n,t,e){if(!e)return[n];const{property:i,start:s,end:o}=e,a=t.length,{compare:r,between:l,normalize:c}=hs(i),{start:h,end:u,loop:f,style:p}=el(n,t,e),g=[];let m=!1,b=null,_,y,k;const w=()=>l(s,k,_)&&r(s,k)!==0,x=()=>r(o,_)===0||l(o,k,_),v=()=>m||w(),C=()=>!m||x();for(let E=h,F=h;E<=u;++E)y=t[E%a],!y.skip&&(_=c(y[i]),_!==k&&(m=l(_,s,o),b===null&&v()&&(b=r(_,s)===0?E:F),b!==null&&C()&&(g.push(us({start:b,end:E,loop:f,count:a,style:p})),b=null),F=E,k=_));return b!==null&&g.push(us({start:b,end:u,loop:f,count:a,style:p})),g}function ps(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const o=fs(i[s],n.points,t);o.length&&e.push(...o)}return e}function nl(n,t,e,i){let s=0,o=t-1;if(e&&!i)for(;s<t&&!n[s].skip;)s++;for(;s<t&&n[s].skip;)s++;for(s%=t,e&&(o+=s);o>s&&n[o%t].skip;)o--;return o%=t,{start:s,end:o}}function il(n,t,e,i){const s=n.length,o=[];let a=t,r=n[t],l;for(l=t+1;l<=e;++l){const c=n[l%s];c.skip||c.stop?r.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%s,end:a%s,loop:i}),o}function sl(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const o=!!n._loop,{start:a,end:r}=nl(e,s,o,i);if(i===!0)return gs(n,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+s:r,c=!!n._fullLoop&&a===0&&r===s-1;return gs(n,il(e,a,l,c),e,t)}function gs(n,t,e,i){return!i||!i.setContext||!e?t:ol(n,t,e,i)}function ol(n,t,e,i){const s=n._chart.getContext(),o=ms(n.options),{_datasetIndex:a,options:{spanGaps:r}}=n,l=e.length,c=[];let h=o,u=t[0].start,f=u;function p(g,m,b,_){const y=r?-1:1;if(g!==m){for(g+=l;e[g%l].skip;)g-=y;for(;e[m%l].skip;)m+=y;g%l!==m%l&&(c.push({start:g%l,end:m%l,loop:b,style:_}),h=_,u=m%l)}}for(const g of t){u=r?u:g.start;let m=e[u%l],b;for(f=u+1;f<=g.end;f++){const _=e[f%l];b=ms(i.setContext(Ft(s,{type:"segment",p0:m,p1:_,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:a}))),al(b,h)&&p(u,f-1,g.loop,h),m=_,h=b}u<f-1&&p(u,f-1,g.loop,h)}return c}function ms(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function al(n,t){if(!t)return!1;const e=[],i=function(s,o){return Fn(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
23
+ * Chart.js v4.4.0
24
+ * https://www.chartjs.org
25
+ * (c) 2023 Chart.js Contributors
26
+ * Released under the MIT License
27
+ */class rl{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const o=e.listeners[s],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(i-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=$i.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const o=i.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),o.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}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((i,s)=>Math.max(i,s._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 i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Dt=new rl;const bs="transparent",ll={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Ui(n||bs),s=i.valid&&Ui(t||bs);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class cl{constructor(t,e,i,s){const o=e[i];s=xe([t.to,s,o,t.from]);const a=xe([t.from,o,s]);this._active=!0,this._fn=t.fn||ll[t.type||typeof a],this._easing=me[t.easing]||me.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=i,this._from=a,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],o=i-this._start,a=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=xe([t.to,e,s,t.from]),this._from=xe([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<i),!this._active){this._target[s]=r,this._notify(!0);return}if(e<0){this._target[s]=o;return}l=e/i%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][e]()}}class _s{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!I(t))return;const e=Object.keys(Z.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!I(o))return;const a={};for(const r of e)a[r]=o[r];(U(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,a)})})}_animateOptions(t,e){const i=e.options,s=hl(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&dl(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,s=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let u=o[c];const f=i.get(c);if(u)if(f&&u.active()){u.update(f,h,r);continue}else u.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=u=new cl(f,t,c,h),s.push(u)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return Dt.add(this._chart,i),!0}}function dl(n,t){const e=[],i=Object.keys(t);for(let s=0;s<i.length;s++){const o=n[i[s]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function hl(n,t){if(!t)return;let e=n.options;if(!e){n.options=t;return}return e.$shared&&(n.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function ys(n,t){const e=n&&n.options||{},i=e.reverse,s=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:i?o:s,end:i?s:o}}function ul(n,t,e){if(e===!1)return!1;const i=ys(n,e),s=ys(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function fl(n){let t,e,i,s;return I(n)?(t=n.top,e=n.right,i=n.bottom,s=n.left):t=e=i=s=n,{top:t,right:e,bottom:i,left:s,disabled:n===!1}}function xs(n,t){const e=[],i=n._getSortedDatasetMetas(t);let s,o;for(s=0,o=i.length;s<o;++s)e.push(i[s].index);return e}function ks(n,t,e,i={}){const s=n.keys,o=i.mode==="single";let a,r,l,c;if(t!==null){for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===e){if(i.all)continue;break}c=n.values[l],G(c)&&(o||t===0||yt(t)===yt(c))&&(t+=c)}return t}}function pl(n){const t=Object.keys(n),e=new Array(t.length);let i,s,o;for(i=0,s=t.length;i<s;++i)o=t[i],e[i]={x:o,y:n[o]};return e}function ws(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function gl(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function ml(n){const{min:t,max:e,minDefined:i,maxDefined:s}=n.getUserBounds();return{min:i?t:Number.NEGATIVE_INFINITY,max:s?e:Number.POSITIVE_INFINITY}}function bl(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Ms(n,t,e,i){for(const s of t.getMatchingVisibleMetas(i).reverse()){const o=n[s.index];if(e&&o>0||!e&&o<0)return s.index}return null}function Ss(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=i,l=o.axis,c=a.axis,h=gl(o,a,i),u=t.length;let f;for(let p=0;p<u;++p){const g=t[p],{[l]:m,[c]:b}=g,_=g._stacks||(g._stacks={});f=_[c]=bl(s,h,m),f[r]=b,f._top=Ms(f,a,!0,i.type),f._bottom=Ms(f,a,!1,i.type);const y=f._visualValues||(f._visualValues={});y[r]=b}}function Yn(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function _l(n,t){return Ft(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function yl(n,t,e){return Ft(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ke(n,t){const e=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){t=t||n._parsed;for(const s of t){const o=s._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const Un=n=>n==="reset"||n==="none",vs=(n,t)=>t?n:Object.assign({},n),xl=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:xs(e,!0),values:null};class bt{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=ws(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&&ke(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(u,f,p,g)=>u==="x"?f:u==="r"?g:p,o=e.xAxisID=R(i.xAxisID,Yn(t,"x")),a=e.yAxisID=R(i.yAxisID,Yn(t,"y")),r=e.rAxisID=R(i.rAxisID,Yn(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,a,r),h=e.vAxisID=s(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}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&&Ni(this._data,this),t._stacked&&ke(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(I(e))this._data=pl(e);else if(i!==e){if(i){Ni(i,this);const s=this._cachedMeta;ke(s),s._parsed=[]}e&&Object.isExtensible(e)&&or(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,i=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=ws(e.vScale,e),e.stack!==i.stack&&(s=!0,ke(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&Ss(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:s}=this,{iScale:o,_stacked:a}=i,r=o.axis;let l=t===0&&e===s.length?!0:i._sorted,c=t>0&&i._parsed[t-1],h,u,f;if(this._parsing===!1)i._parsed=s,i._sorted=!0,f=s;else{U(s[t])?f=this.parseArrayData(i,s,t,e):I(s[t])?f=this.parseObjectData(i,s,t,e):f=this.parsePrimitiveData(i,s,t,e);const p=()=>u[r]===null||c&&u[r]<c[r];for(h=0;h<e;++h)i._parsed[h+t]=u=f[h],l&&(p()&&(l=!1),c=u);i._sorted=l}a&&Ss(this,f)}parsePrimitiveData(t,e,i,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),h=o===a,u=new Array(s);let f,p,g;for(f=0,p=s;f<p;++f)g=f+i,u[f]={[r]:h||o.parse(c[g],g),[l]:a.parse(e[g],g)};return u}parseArrayData(t,e,i,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,c,h,u;for(l=0,c=s;l<c;++l)h=l+i,u=e[h],r[l]={x:o.parse(u[0],h),y:a.parse(u[1],h)};return r}parseObjectData(t,e,i,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let h,u,f,p;for(h=0,u=s;h<u;++h)f=h+i,p=e[f],c[h]={x:o.parse(At(p,r),f),y:a.parse(At(p,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,i){const s=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:xs(s,!0),values:e._stacks[t.axis]._visualValues};return ks(r,a,o.index,{mode:i})}updateRangeFromParsed(t,e,i,s){const o=i[e.axis];let a=o===null?NaN:o;const r=s&&i._stacks[e.axis];s&&r&&(s.values=r,a=ks(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const i=this._cachedMeta,s=i._parsed,o=i._sorted&&t===i.iScale,a=s.length,r=this._getOtherScale(t),l=xl(e,i,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:u}=ml(r);let f,p;function g(){p=s[f];const m=p[r.axis];return!G(p[t.axis])||h>m||u<m}for(f=0;f<a&&!(!g()&&(this.updateRangeFromParsed(c,t,p,l),o));++f);if(o){for(f=a-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,o,a;for(s=0,o=e.length;s<o;++s)a=e[s][t.axis],G(a)&&i.push(a);return i}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,i=e.iScale,s=e.vScale,o=this.getParsed(t);return{label:i?""+i.getLabelForValue(o[i.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=fl(R(this.options.clip,ul(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,i=this._cachedMeta,s=i.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||s.length-r,c=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,o,r,l),h=r;h<r+l;++h){const u=s[h];u.hidden||(u.active&&c?a.push(u):u.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){const i=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(i):this.resolveDataElementOptions(t||0,i)}getContext(t,e,i){const s=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=yl(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=_l(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=i,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",i){const s=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&fe(i);if(r)return vs(r,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),p=Object.keys(Z.elements[t]),g=()=>this.getContext(i,s,e),m=c.resolveNamedOptions(f,p,g,u);return m.$shared&&(m.$shared=l,o[a]=Object.freeze(vs(m,l))),m}_resolveAnimations(t,e,i){const s=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(s.options.animation!==!1){const h=this.chart.config,u=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),u);l=h.createResolver(f,this.getContext(t,i,e))}const c=new _s(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Un(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(i),a=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:a}}updateElement(t,e,i,s){Un(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!Un(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"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,i=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const s=i.length,o=e.length,a=Math.min(o,s);a&&this.parse(0,a),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,e,i=!0){const s=this._cachedMeta,o=s.data,a=t+e;let r;const l=c=>{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,e),i&&this.updateElements(o,t,e,"reset")}updateElements(t,e,i,s){}_removeElements(t,e){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(t,e);i._stacked&&ke(i,s)}i.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,i,s]=t;this[e](i,s)}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 i=arguments.length-2;i&&this._sync(["_insertElements",t,i])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}D(bt,"defaults",{}),D(bt,"datasetElementType",null),D(bt,"dataElementType",null);function kl(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let i=[];for(let s=0,o=e.length;s<o;s++)i=i.concat(e[s].controller.getAllParsedValues(n));n._cache.$bar=Ii(i.sort((s,o)=>s-o))}return n._cache.$bar}function wl(n){const t=n.iScale,e=kl(t,n.type);let i=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(fe(r)&&(i=Math.min(i,Math.abs(a-r)||i)),r=a)};for(s=0,o=e.length;s<o;++s)a=t.getPixelForValue(e[s]),l();for(r=void 0,s=0,o=t.ticks.length;s<o;++s)a=t.getPixelForTick(s),l();return i}function Ml(n,t,e,i){const s=e.barThickness;let o,a;return $(s)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=s*i,a=1),{chunk:o/i,ratio:a,start:t.pixels[n]-o/2}}function Sl(n,t,e,i){const s=t.pixels,o=s[n];let a=n>0?s[n-1]:null,r=n<s.length-1?s[n+1]:null;const l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/i,ratio:e.barPercentage,start:c}}function vl(n,t,e,i){const s=e.parse(n[0],i),o=e.parse(n[1],i),a=Math.min(s,o),r=Math.max(s,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:a,max:r}}function Cs(n,t,e,i){return U(n)?vl(n,t,e,i):t[e.axis]=e.parse(n,i),t}function Ds(n,t,e,i){const s=n.iScale,o=n.vScale,a=s.getLabels(),r=s===o,l=[];let c,h,u,f;for(c=e,h=e+i;c<h;++c)f=t[c],u={},u[s.axis]=r||s.parse(a[c],c),l.push(Cs(f,u,o,c));return l}function Xn(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Cl(n,t,e){return n!==0?yt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Dl(n){let t,e,i,s,o;return n.horizontal?(t=n.base>n.x,e="left",i="right"):(t=n.base<n.y,e="bottom",i="top"),t?(s="end",o="start"):(s="start",o="end"),{start:e,end:i,reverse:t,top:s,bottom:o}}function El(n,t,e,i){let s=t.borderSkipped;const o={};if(!s){n.borderSkipped=o;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:h}=Dl(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=c:(e._bottom||0)===i?s=h:(o[Es(h,a,r,l)]=!0,s=c)),o[Es(s,a,r,l)]=!0,n.borderSkipped=o}function Es(n,t,e,i){return i?(n=Pl(n,t,e),n=Ps(n,e,t)):n=Ps(n,t,e),n}function Pl(n,t,e){return n===t?e:n===e?t:n}function Ps(n,t,e){return n==="start"?t:n==="end"?e:n}function Ol(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class tn extends bt{parsePrimitiveData(t,e,i,s){return Ds(t,e,i,s)}parseArrayData(t,e,i,s){return Ds(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,h=a.axis==="x"?r:l,u=[];let f,p,g,m;for(f=i,p=i+s;f<p;++f)m=e[f],g={},g[o.axis]=o.parse(At(m,c),f),u.push(Cs(At(m,h),g,a,f));return u}updateRangeFromParsed(t,e,i,s){super.updateRangeFromParsed(t,e,i,s);const o=i._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:i,vScale:s}=e,o=this.getParsed(t),a=o._custom,r=Xn(a)?"["+a.start+", "+a.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+i.getLabelForValue(o[i.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,i,s){const o=s==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),h=this._getRuler(),{sharedOptions:u,includeOptions:f}=this._getSharedOptions(e,s);for(let p=e;p<e+i;p++){const g=this.getParsed(p),m=o||$(g[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,h),_=(g._stacks||{})[r.axis],y={horizontal:c,base:m.base,enableBorderRadius:!_||Xn(g._custom)||a===_._top||a===_._bottom,x:c?m.head:b.center,y:c?b.center:m.head,height:c?b.size:Math.abs(m.size),width:c?Math.abs(m.size):b.size};f&&(y.options=u||this.resolveDataElementOptions(p,t[p].active?"active":s));const k=y.options||t[p].options;El(y,k,_,a),Ol(y,k,h.ratio),this.updateElement(t[p],p,y,s)}}_getStacks(t,e){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(l=>l.controller.options.grouped),o=i.options.stacked,a=[],r=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if($(h)||isNaN(h))return!0};for(const l of s)if(!(e!==void 0&&r(l))&&((o===!1||a.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&a.push(l.stack),l.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const s=this._getStacks(t,i),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,s=[];let o,a;for(o=0,a=e.data.length;o<a;++o)s.push(i.getPixelForValue(this.getParsed(o)[i.axis],o));const r=t.barThickness;return{min:r||wl(e),pixels:s,start:i._startPixel,end:i._endPixel,stackCount:this._getStackCount(),scale:i,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:i,index:s},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,h=Xn(c);let u=l[e.axis],f=0,p=i?this.applyStack(e,l,i):u,g,m;p!==u&&(f=p-u,p=u),h&&(u=c.barStart,p=c.barEnd-c.barStart,u!==0&&yt(u)!==yt(c.barEnd)&&(f=0),f+=u);const b=!$(o)&&!h?o:f;let _=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?g=e.getPixelForValue(f+p):g=_,m=g-_,Math.abs(m)<a){m=Cl(m,e,r)*a,u===r&&(_-=m/2);const y=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),w=Math.min(y,k),x=Math.max(y,k);_=Math.max(Math.min(_,x),w),g=_+m,i&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(g)-e.getValueForPixel(_))}if(_===e.getPixelForValue(r)){const y=yt(m)*e.getLineWidthForValue(r)/2;_+=y,m-=y}return{size:m,base:_,head:g,center:g+m/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,a=R(s.maxBarThickness,1/0);let r,l;if(e.grouped){const c=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?Sl(t,e,s,c):Ml(t,e,s,c),u=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=h.start+h.chunk*u+h.chunk/2,l=Math.min(a,h.chunk*h.ratio)}else r=i.getPixelForValue(this.getParsed(t)[i.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,i=t.data,s=i.length;let o=0;for(;o<s;++o)this.getParsed(o)[e.axis]!==null&&i[o].draw(this._ctx)}}D(tn,"id","bar"),D(tn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),D(tn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class en extends bt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,i,s){const o=super.parsePrimitiveData(t,e,i,s);for(let a=0;a<o.length;a++)o[a]._custom=this.resolveDataElementOptions(a+i).radius;return o}parseArrayData(t,e,i,s){const o=super.parseArrayData(t,e,i,s);for(let a=0;a<o.length;a++){const r=e[i+a];o[a]._custom=R(r[2],this.resolveDataElementOptions(a+i).radius)}return o}parseObjectData(t,e,i,s){const o=super.parseObjectData(t,e,i,s);for(let a=0;a<o.length;a++){const r=e[i+a];o[a]._custom=R(r&&r.r&&+r.r,this.resolveDataElementOptions(a+i).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let i=t.length-1;i>=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y),c=a._custom;return{label:i[t]||"",value:"("+r+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:a,vScale:r}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=a.axis,u=r.axis;for(let f=e;f<e+i;f++){const p=t[f],g=!o&&this.getParsed(f),m={},b=m[h]=o?a.getPixelForDecimal(.5):a.getPixelForValue(g[h]),_=m[u]=o?r.getBasePixel():r.getPixelForValue(g[u]);m.skip=isNaN(b)||isNaN(_),c&&(m.options=l||this.resolveDataElementOptions(f,p.active?"active":s),o&&(m.options.radius=0)),this.updateElement(p,f,m,s)}}resolveDataElementOptions(t,e){const i=this.getParsed(t);let s=super.resolveDataElementOptions(t,e);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const o=s.radius;return e!=="active"&&(s.radius=0),s.radius+=R(i&&i._custom,o),s}}D(en,"id","bubble"),D(en,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),D(en,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Bl(n,t,e){let i=1,s=1,o=0,a=0;if(t<q){const r=n,l=r+t,c=Math.cos(r),h=Math.sin(r),u=Math.cos(l),f=Math.sin(l),p=(k,w,x)=>ge(k,r,l,!0)?1:Math.max(w,w*e,x,x*e),g=(k,w,x)=>ge(k,r,l,!0)?-1:Math.min(w,w*e,x,x*e),m=p(0,c,u),b=p(Q,h,f),_=g(X,c,u),y=g(X+Q,h,f);i=(m-_)/2,s=(b-y)/2,o=-(m+_)/2,a=-(b+y)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class Xt extends bt{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 i=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=i;else{let o=l=>+i[l];if(I(i[t])){const{key:l="value"}=this._parsing;o=c=>+At(i[c],l)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return mt(this.options.rotation-90)}_getCircumference(){return mt(this.options.circumference)}_getRotationExtents(){let t=q,e=-q;for(let i=0;i<this.chart.data.datasets.length;++i)if(this.chart.isDatasetVisible(i)&&this.chart.getDatasetMeta(i).type===this._type){const s=this.chart.getDatasetMeta(i).controller,o=s._getRotation(),a=s._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:i}=e,s=this._cachedMeta,o=s.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(i.width,i.height)-a)/2,0),l=Math.min(Ya(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:h,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=Bl(u,h,l),b=(i.width-a)/f,_=(i.height-a)/p,y=Math.max(Math.min(b,_)/2,0),k=Ei(this.options.radius,y),w=Math.max(k*l,0),x=(k-w)/this._getVisibleDatasetWeightTotal();this.offsetX=g*k,this.offsetY=m*k,s.total=this.calculateTotal(),this.outerRadius=k-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,o=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/q)}updateElements(t,e,i,s){const o=s==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,h=(r.left+r.right)/2,u=(r.top+r.bottom)/2,f=o&&c.animateScale,p=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(e,s);let _=this._getRotation(),y;for(y=0;y<e;++y)_+=this._circumference(y,o);for(y=e;y<e+i;++y){const k=this._circumference(y,o),w=t[y],x={x:h+this.offsetX,y:u+this.offsetY,startAngle:_,endAngle:_+k,circumference:k,outerRadius:g,innerRadius:p};b&&(x.options=m||this.resolveDataElementOptions(y,w.active?"active":s)),_+=k,this.updateElement(w,y,x,s)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let i=0,s;for(s=0;s<e.length;s++){const o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!e[s].hidden&&(i+=Math.abs(o))}return i}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?q*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=be(e._parsed[t],i.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,o,a,r,l;if(!t){for(s=0,o=i.data.datasets.length;s<o;++s)if(i.isDatasetVisible(s)){a=i.getDatasetMeta(s),t=a.data,r=a.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=r.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let i=0,s=t.length;i<s;++i){const o=this.resolveDataElementOptions(i);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e}_getRingWeight(t){return Math.max(R(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}D(Xt,"id","doughnut"),D(Xt,"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"}),D(Xt,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),D(Xt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}}});class nn extends bt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=Wi(e,s,a);this._drawStart=r,this._drawCount=l,ji(e)&&(r=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:c},t),this.updateElements(s,r,l,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:u}=this._getSharedOptions(e,s),f=a.axis,p=r.axis,{spanGaps:g,segment:m}=this.options,b=ee(g)?g:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||s==="none",y=e+i,k=t.length;let w=e>0&&this.getParsed(e-1);for(let x=0;x<k;++x){const v=t[x],C=_?v:{};if(x<e||x>=y){C.skip=!0;continue}const E=this.getParsed(x),F=$(E[p]),A=C[f]=a.getPixelForValue(E[f],x),B=C[p]=o||F?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,E,l):E[p],x);C.skip=isNaN(A)||isNaN(B)||F,C.stop=x>0&&Math.abs(E[f]-w[f])>b,m&&(C.parsed=E,C.raw=c.data[x]),u&&(C.options=h||this.resolveDataElementOptions(x,v.active?"active":s)),_||this.updateElement(v,x,C,s),w=E}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const o=s[0].size(this.resolveDataElementOptions(0)),a=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}D(nn,"id","line"),D(nn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),D(nn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class we extends bt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=be(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return ss.bind(this)(t,e,i,s)}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((i,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<e.min&&(e.min=o),o>e.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),a=Math.max(i.cutoutPercentage?o/100*i.cutoutPercentage:1,0),r=(o-a)/t.getVisibleDatasetCount();this.outerRadius=o-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(t,e,i,s){const o=s==="reset",a=this.chart,l=a.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,u=c.yCenter,f=c.getIndexAngle(0)-.5*X;let p=f,g;const m=360/this.countVisibleElements();for(g=0;g<e;++g)p+=this._computeAngle(g,s,m);for(g=e;g<e+i;g++){const b=t[g];let _=p,y=p+this._computeAngle(g,s,m),k=a.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;p=y,o&&(l.animateScale&&(k=0),l.animateRotate&&(_=y=f));const w={x:h,y:u,innerRadius:0,outerRadius:k,startAngle:_,endAngle:y,options:this.resolveDataElementOptions(g,b.active?"active":s)};this.updateElement(b,g,w,s)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?mt(this.resolveDataElementOptions(t,e).angle||i):0}}D(we,"id","polarArea"),D(we,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),D(we,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i,color:s}}=t.legend.options;return e.labels.map((o,a)=>{const l=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class qn extends Xt{}D(qn,"id","pie"),D(qn,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class sn extends bt{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}parseObjectData(t,e,i,s){return ss.bind(this)(t,e,i,s)}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(i.points=s,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const r={_loop:!0,_fullLoop:o.length===s.length,options:a};this.updateElement(i,void 0,r,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const o=this._cachedMeta.rScale,a=s==="reset";for(let r=e;r<e+i;r++){const l=t[r],c=this.resolveDataElementOptions(r,l.active?"active":s),h=o.getPointPositionForValue(r,this.getParsed(r).r),u=a?o.xCenter:h.x,f=a?o.yCenter:h.y,p={x:u,y:f,angle:h.angle,skip:isNaN(u)||isNaN(f),options:c};this.updateElement(l,r,p,s)}}}D(sn,"id","radar"),D(sn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),D(sn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class on extends bt{getLabelAndValue(t){const e=this._cachedMeta,i=this.chart.data.labels||[],{xScale:s,yScale:o}=e,a=this.getParsed(t),r=s.getLabelForValue(a.x),l=o.getLabelForValue(a.y);return{label:i[t]||"",value:"("+r+", "+l+")"}}update(t){const e=this._cachedMeta,{data:i=[]}=e,s=this.chart._animationsDisabled;let{start:o,count:a}=Wi(e,i,s);if(this._drawStart=o,this._drawCount=a,ji(e)&&(o=0,a=i.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:l}=e;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!l._decimated,r.points=i;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(i,o,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),u=this.getSharedOptions(h),f=this.includeOptions(s,u),p=a.axis,g=r.axis,{spanGaps:m,segment:b}=this.options,_=ee(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||s==="none";let k=e>0&&this.getParsed(e-1);for(let w=e;w<e+i;++w){const x=t[w],v=this.getParsed(w),C=y?x:{},E=$(v[g]),F=C[p]=a.getPixelForValue(v[p],w),A=C[g]=o||E?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,v,l):v[g],w);C.skip=isNaN(F)||isNaN(A)||E,C.stop=w>0&&Math.abs(v[p]-k[p])>_,b&&(C.parsed=v,C.raw=c.data[w]),f&&(C.options=u||this.resolveDataElementOptions(w,x.active?"active":s)),y||this.updateElement(x,w,C,s),k=v}this.updateSharedOptions(u,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let r=0;for(let l=e.length-1;l>=0;--l)r=Math.max(r,e[l].size(this.resolveDataElementOptions(l))/2);return r>0&&r}const i=t.dataset,s=i.options&&i.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,a)/2}}D(on,"id","scatter"),D(on,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),D(on,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Al=Object.freeze({__proto__:null,BarController:tn,BubbleController:en,DoughnutController:Xt,LineController:nn,PieController:qn,PolarAreaController:we,RadarController:sn,ScatterController:on});function qt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Kn{constructor(t){D(this,"options");this.options=t||{}}static override(t){Object.assign(Kn.prototype,t)}init(){}formats(){return qt()}parse(){return qt()}format(){return qt()}add(){return qt()}diff(){return qt()}startOf(){return qt()}endOf(){return qt()}}var Ll={_date:Kn};function Tl(n,t,e,i){const{controller:s,data:o,_sorted:a}=n,r=s._cachedMeta.iScale;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const l=r._reversePixels?ir:vt;if(i){if(s._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const u=l(o,t,e-h),f=l(o,t,e+h);return{lo:u.lo,hi:f.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function Me(n,t,e,i,s){const o=n.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:h}=o[r],{lo:u,hi:f}=Tl(o[r],t,a,s);for(let p=u;p<=f;++p){const g=h[p];g.skip||i(g,c,p)}}}function Fl(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(i,s){const o=t?Math.abs(i.x-s.x):0,a=e?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function Gn(n,t,e,i,s){const o=[];return!s&&!n.isPointInArea(t)||Me(n,e,t,function(r,l,c){!s&&!Ct(r,n.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function Vl(n,t,e,i){let s=[];function o(a,r,l){const{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:u}=Vi(a,{x:t.x,y:t.y});ge(u,c,h)&&s.push({element:a,datasetIndex:r,index:l})}return Me(n,e,t,o),s}function Rl(n,t,e,i,s,o){let a=[];const r=Fl(e);let l=Number.POSITIVE_INFINITY;function c(h,u,f){const p=h.inRange(t.x,t.y,s);if(i&&!p)return;const g=h.getCenterPoint(s);if(!(!!o||n.isPointInArea(g))&&!p)return;const b=r(t,g);b<l?(a=[{element:h,datasetIndex:u,index:f}],l=b):b===l&&a.push({element:h,datasetIndex:u,index:f})}return Me(n,e,t,c),a}function Zn(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?Vl(n,t,e,s):Rl(n,t,e,i,s,o)}function Os(n,t,e,i,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return Me(n,e,t,(l,c,h)=>{l[a](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(t.x,t.y,s))}),i&&!r?[]:o}var Nl={evaluateInteractionItems:Me,modes:{index(n,t,e,i){const s=Yt(t,n),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?Gn(n,s,o,i,a):Zn(n,s,o,!1,i,a),l=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(c=>{const h=r[0].index,u=c.data[h];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:h})}),l):[]},dataset(n,t,e,i){const s=Yt(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?Gn(n,s,o,i,a):Zn(n,s,o,!1,i,a);if(r.length>0){const l=r[0].datasetIndex,c=n.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h})}return r},point(n,t,e,i){const s=Yt(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Gn(n,s,o,i,a)},nearest(n,t,e,i){const s=Yt(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Zn(n,s,o,e.intersect,i,a)},x(n,t,e,i){const s=Yt(t,n);return Os(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=Yt(t,n);return Os(n,s,"y",e.intersect,i)}}};const Bs=["left","top","right","bottom"];function Se(n,t){return n.filter(e=>e.pos===t)}function As(n,t){return n.filter(e=>Bs.indexOf(e.pos)===-1&&e.box.axis===t)}function ve(n,t){return n.sort((e,i)=>{const s=t?i:e,o=t?e:i;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Il(n){const t=[];let e,i,s,o,a,r;for(e=0,i=(n||[]).length;e<i;++e)s=n[e],{position:o,options:{stack:a,stackWeight:r=1}}=s,t.push({index:e,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:a&&o+a,stackWeight:r});return t}function $l(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:o}=e;if(!i||!Bs.includes(s))continue;const a=t[i]||(t[i]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function zl(n,t){const e=$l(n),{vBoxMaxWidth:i,hBoxMaxHeight:s}=t;let o,a,r;for(o=0,a=n.length;o<a;++o){r=n[o];const{fullSize:l}=r.box,c=e[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*i:l&&t.availableWidth,r.height=s):(r.width=i,r.height=h?h*s:l&&t.availableHeight)}return e}function Wl(n){const t=Il(n),e=ve(t.filter(c=>c.box.fullSize),!0),i=ve(Se(t,"left"),!0),s=ve(Se(t,"right")),o=ve(Se(t,"top"),!0),a=ve(Se(t,"bottom")),r=As(t,"x"),l=As(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Se(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function Ls(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function Ts(n,t){n.top=Math.max(n.top,t.top),n.left=Math.max(n.left,t.left),n.bottom=Math.max(n.bottom,t.bottom),n.right=Math.max(n.right,t.right)}function jl(n,t,e,i){const{pos:s,box:o}=e,a=n.maxPadding;if(!I(s)){e.size&&(n[s]-=e.size);const u=i[e.stack]||{size:0,count:1};u.size=Math.max(u.size,e.horizontal?o.height:o.width),e.size=u.size/u.count,n[s]+=e.size}o.getPadding&&Ts(a,o.getPadding());const r=Math.max(0,t.outerWidth-Ls(a,n,"left","right")),l=Math.max(0,t.outerHeight-Ls(a,n,"top","bottom")),c=r!==n.w,h=l!==n.h;return n.w=r,n.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Hl(n){const t=n.maxPadding;function e(i){const s=Math.max(t[i]-n[i],0);return n[i]+=s,s}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Yl(n,t){const e=t.maxPadding;function i(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return i(n?["left","right"]:["top","bottom"])}function Ce(n,t,e,i){const s=[];let o,a,r,l,c,h;for(o=0,a=n.length,c=0;o<a;++o){r=n[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Yl(r.horizontal,t));const{same:u,other:f}=jl(t,e,r,i);c|=u&&s.length,h=h||f,l.fullSize||s.push(r)}return c&&Ce(s,t,e,i)||h}function an(n,t,e,i,s){n.top=e,n.left=t,n.right=t+i,n.bottom=e+s,n.width=i,n.height=s}function Fs(n,t,e,i){const s=e.padding;let{x:o,y:a}=t;for(const r of n){const l=r.box,c=i[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){const u=t.w*h,f=c.size||l.height;fe(c.start)&&(a=c.start),l.fullSize?an(l,s.left,a,e.outerWidth-s.right-s.left,f):an(l,t.left+c.placed,a,u,f),c.start=a,c.placed+=u,a=l.bottom}else{const u=t.h*h,f=c.size||l.width;fe(c.start)&&(o=c.start),l.fullSize?an(l,o,s.top,f,e.outerHeight-s.bottom-s.top):an(l,o,t.top+c.placed,f,u),c.start=o,c.placed+=u,o=l.right}}t.x=o,t.y=a}var rt={addBox(n,t){n.boxes||(n.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)}}]},n.boxes.push(t)},removeBox(n,t){const e=n.boxes?n.boxes.indexOf(t):-1;e!==-1&&n.boxes.splice(e,1)},configure(n,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(n,t,e,i){if(!n)return;const s=at(n.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=Wl(n.boxes),l=r.vertical,c=r.horizontal;j(n.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=l.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),f=Object.assign({},s);Ts(f,at(i));const p=Object.assign({maxPadding:f,w:o,h:a,x:s.left,y:s.top},s),g=zl(l.concat(c),u);Ce(r.fullSize,p,u,g),Ce(l,p,u,g),Ce(c,p,u,g)&&Ce(l,p,u,g),Hl(p),Fs(r.leftAndTop,p,u,g),p.x+=p.w,p.y+=p.h,Fs(r.rightAndBottom,p,u,g),n.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},j(r.chartArea,m=>{const b=m.box;Object.assign(b,n.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Vs{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,s){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):i)}}isAttached(t){return!0}updateConfig(t){}}class Ul extends Vs{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const rn="$chartjs",Xl={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Rs=n=>n===null||n==="";function ql(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[rn]={initial:{height:i,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Rs(s)){const o=ls(n,"width");o!==void 0&&(n.width=o)}if(Rs(i))if(n.style.height==="")n.height=n.width/(t||2);else{const o=ls(n,"height");o!==void 0&&(n.height=o)}return n}const Ns=Gr?{passive:!0}:!1;function Kl(n,t,e){n.addEventListener(t,e,Ns)}function Gl(n,t,e){n.canvas.removeEventListener(t,e,Ns)}function Zl(n,t){const e=Xl[n.type]||n.type,{x:i,y:s}=Yt(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function ln(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Jl(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||ln(r.addedNodes,i),a=a&&!ln(r.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Ql(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||ln(r.removedNodes,i),a=a&&!ln(r.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const De=new Map;let Is=0;function $s(){const n=window.devicePixelRatio;n!==Is&&(Is=n,De.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function tc(n,t){De.size||window.addEventListener("resize",$s),De.set(n,t)}function ec(n){De.delete(n),De.size||window.removeEventListener("resize",$s)}function nc(n,t,e){const i=n.canvas,s=i&&Hn(i);if(!s)return;const o=zi((r,l)=>{const c=s.clientWidth;e(r,l),c<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return a.observe(s),tc(n,o),a}function Jn(n,t,e){e&&e.disconnect(),t==="resize"&&ec(n)}function ic(n,t,e){const i=n.canvas,s=zi(o=>{n.ctx!==null&&e(Zl(o,n))},n);return Kl(i,t,s),s}class sc extends Vs{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(ql(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[rn])return!1;const i=e[rn].initial;["height","width"].forEach(o=>{const a=i[o];$(a)?e.removeAttribute(o):e.setAttribute(o,a)});const s=i.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[rn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Jl,detach:Ql,resize:nc}[e]||ic;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Jn,detach:Jn,resize:Jn}[e]||Gl)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Kr(t,e,i,s)}isAttached(t){const e=Hn(t);return!!(e&&e.isConnected)}}function oc(n){return!as()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Ul:sc}class _t{constructor(){D(this,"x");D(this,"y");D(this,"active",!1);D(this,"options");D(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ee(this.x)&&ee(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const s={};return t.forEach(o=>{s[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),s}}D(_t,"defaults",{}),D(_t,"defaultRoutes");function ac(n,t){const e=n.options.ticks,i=rc(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?cc(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>s)return dc(t,c,o,a/s),c;const h=lc(o,t,s);if(a>0){let u,f;const p=a>1?Math.round((l-r)/(a-1)):null;for(cn(t,c,h,$(p)?0:r-p,r),u=0,f=a-1;u<f;u++)cn(t,c,h,o[u],o[u+1]);return cn(t,c,h,l,$(p)?t.length:l+p),c}return cn(t,c,h),c}function rc(n){const t=n.options.offset,e=n._tickSize(),i=n._length/e+(t?0:1),s=n._maxLength/e;return Math.floor(Math.min(i,s))}function lc(n,t,e){const i=hc(n),s=t.length/e;if(!i)return Math.max(s,1);const o=Qa(i);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>s)return l}return Math.max(s,1)}function cc(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function dc(n,t,e,i){let s=0,o=e[0],a;for(i=Math.ceil(i),a=0;a<n.length;a++)a===o&&(t.push(n[a]),s++,o=e[s*i])}function cn(n,t,e,i,s){const o=R(i,0),a=Math.min(R(s,n.length),n.length);let r=0,l,c,h;for(e=Math.ceil(e),s&&(l=s-i,e=l/Math.floor(l/e)),h=o;h<0;)r++,h=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===h&&(t.push(n[c]),r++,h=Math.round(o+r*e))}function hc(n){const t=n.length;let e,i;if(t<2)return!1;for(i=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==i)return!1;return i}const uc=n=>n==="left"?"right":n==="right"?"left":n,zs=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Ws=(n,t)=>Math.min(t||n,n);function js(n,t){const e=[],i=n.length/t,s=n.length;let o=0;for(;o<s;o+=i)e.push(n[Math.floor(o)]);return e}function fc(n,t,e){const i=n.ticks.length,s=Math.min(t,i-1),o=n._startPixel,a=n._endPixel,r=1e-6;let l=n.getPixelForTick(s),c;if(!(e&&(i===1?c=Math.max(l-o,a-l):t===0?c=(n.getPixelForTick(1)-l)/2:c=(l-n.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-r||l>a+r)))return l}function pc(n,t){j(n,e=>{const i=e.gc,s=i.length/2;let o;if(s>t){for(o=0;o<s;++o)delete e.data[i[o]];i.splice(0,s)}})}function Ee(n){return n.drawTicks?n.tickLength:0}function Hs(n,t){if(!n.display)return 0;const e=et(n.font,t),i=at(n.padding);return(U(n.text)?n.text.length:1)*e.lineHeight+i.height}function gc(n,t){return Ft(n,{scale:t,type:"scale"})}function mc(n,t,e){return Ft(n,{tick:e,index:t,type:"tick"})}function bc(n,t,e){let i=Tn(n);return(e&&t!=="right"||!e&&t==="right")&&(i=uc(i)),i}function _c(n,t,e,i){const{top:s,left:o,bottom:a,right:r,chart:l}=n,{chartArea:c,scales:h}=l;let u=0,f,p,g;const m=a-s,b=r-o;if(n.isHorizontal()){if(p=ot(i,o,r),I(e)){const _=Object.keys(e)[0],y=e[_];g=h[_].getPixelForValue(y)+m-t}else e==="center"?g=(c.bottom+c.top)/2+m-t:g=zs(n,e,t);f=r-o}else{if(I(e)){const _=Object.keys(e)[0],y=e[_];p=h[_].getPixelForValue(y)-b+t}else e==="center"?p=(c.left+c.right)/2-b+t:p=zs(n,e,t);g=ot(i,a,s),u=e==="left"?-Q:Q}return{titleX:p,titleY:g,maxWidth:f,rotation:u}}class Kt extends _t{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:i,_suggestedMax:s}=this;return t=ht(t,Number.POSITIVE_INFINITY),e=ht(e,Number.NEGATIVE_INFINITY),i=ht(i,Number.POSITIVE_INFINITY),s=ht(s,Number.NEGATIVE_INFINITY),{min:ht(t,i),max:ht(e,s),minDefined:G(t),maxDefined:G(e)}}getMinMax(t){let{min:e,max:i,minDefined:s,maxDefined:o}=this.getUserBounds(),a;if(s&&o)return{min:e,max:i};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),s||(e=Math.min(e,a.min)),o||(i=Math.max(i,a.max));return e=o&&e>i?i:e,i=s&&e>i?e:i,{min:ht(e,ht(i,e)),max:ht(i,ht(e,i))}}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(){Y(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Dr(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?js(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=ac(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,i;this.isHorizontal()?(e=this.left,i=this.right):(e=this.top,i=this.bottom,t=!t),this._startPixel=e,this._endPixel=i,this._reversePixels=t,this._length=i-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){Y(this.options.afterUpdate,[this])}beforeSetDimensions(){Y(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(){Y(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),Y(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Y(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let i,s,o;for(i=0,s=t.length;i<s;i++)o=t[i],o.label=Y(e.callback,[o.value,i,t],this)}afterTickToLabelConversion(){Y(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Y(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,i=Ws(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a=s,r,l,c;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),u=h.widest.width,f=h.highest.height,p=nt(this.chart.width-u,0,this.maxWidth);r=t.offset?this.maxWidth/i:p/(i-1),u+6>r&&(r=p/(i-(t.offset?.5:1)),l=this.maxHeight-Ee(t.grid)-e.padding-Hs(t.title,this.chart.options.font),c=Math.sqrt(u*u+f*f),a=Bn(Math.min(Math.asin(nt((h.highest.height+6)/r,-1,1)),Math.asin(nt(l/c,-1,1))-Math.asin(nt(f/c,-1,1)))),a=Math.max(s,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){Y(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Y(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Hs(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=Ee(o)+l):(t.height=this.maxHeight,t.width=Ee(o)+l),i.display&&this.ticks.length){const{first:c,last:h,widest:u,highest:f}=this._getLabelSizes(),p=i.padding*2,g=mt(this.labelRotation),m=Math.cos(g),b=Math.sin(g);if(r){const _=i.mirror?0:b*u.width+m*f.height;t.height=Math.min(this.maxHeight,t.height+_+p)}else{const _=i.mirror?0:m*u.width+b*f.height;t.width=Math.min(this.maxWidth,t.width+_+p)}this._calculatePadding(c,h,b,m)}}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,i,s){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,p=0;l?c?(f=s*t.width,p=i*e.height):(f=i*t.height,p=s*e.width):o==="start"?p=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,p=e.width/2),this.paddingLeft=Math.max((f-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((p-u+a)*this.width/(this.width-u),0)}else{let h=e.height/2,u=t.height/2;o==="start"?(h=0,u=t.height):o==="end"&&(h=e.height,u=0),this.paddingTop=h+a,this.paddingBottom=u+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(){Y(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,i;for(e=0,i=t.length;e<i;e++)$(t[e].label)&&(t.splice(e,1),i--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let i=this.ticks;e<i.length&&(i=js(i,e)),this._labelSizes=t=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,i){const{ctx:s,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/Ws(e,i));let c=0,h=0,u,f,p,g,m,b,_,y,k,w,x;for(u=0;u<e;u+=l){if(g=t[u].label,m=this._resolveTickFontOptions(u),s.font=b=m.string,_=o[b]=o[b]||{data:{},gc:[]},y=m.lineHeight,k=w=0,!$(g)&&!U(g))k=Xe(s,_.data,_.gc,k,g),w=y;else if(U(g))for(f=0,p=g.length;f<p;++f)x=g[f],!$(x)&&!U(x)&&(k=Xe(s,_.data,_.gc,k,x),w+=y);a.push(k),r.push(w),c=Math.max(k,c),h=Math.max(w,h)}pc(o,e);const v=a.indexOf(c),C=r.indexOf(h),E=F=>({width:a[F]||0,height:r[F]||0});return{first:E(0),last:E(e-1),widest:E(v),highest:E(C),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 nr(this._alignToPixels?zt(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 i=e[t];return i.$context||(i.$context=mc(this.getContext(),t,i))}return this.$context||(this.$context=gc(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=mt(this.labelRotation),i=Math.abs(Math.cos(e)),s=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*i>r*s?r/i:l/s:l*s<r*i?l/i:r/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:o,position:a,border:r}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),f=Ee(o),p=[],g=r.setContext(this.getContext()),m=g.display?g.width:0,b=m/2,_=function(M){return zt(i,M,m)};let y,k,w,x,v,C,E,F,A,B,N,tt;if(a==="top")y=_(this.bottom),C=this.bottom-f,F=y-b,B=_(t.top)+b,tt=t.bottom;else if(a==="bottom")y=_(this.top),B=t.top,tt=_(t.bottom)-b,C=y+b,F=this.top+f;else if(a==="left")y=_(this.right),v=this.right-f,E=y-b,A=_(t.left)+b,N=t.right;else if(a==="right")y=_(this.left),A=t.left,N=_(t.right)-b,v=y+b,E=this.left+f;else if(e==="x"){if(a==="center")y=_((t.top+t.bottom)/2+.5);else if(I(a)){const M=Object.keys(a)[0],O=a[M];y=_(this.chart.scales[M].getPixelForValue(O))}B=t.top,tt=t.bottom,C=y+b,F=C+f}else if(e==="y"){if(a==="center")y=_((t.left+t.right)/2);else if(I(a)){const M=Object.keys(a)[0],O=a[M];y=_(this.chart.scales[M].getPixelForValue(O))}v=y-b,E=v-f,A=t.left,N=t.right}const L=R(s.ticks.maxTicksLimit,u),S=Math.max(1,Math.ceil(u/L));for(k=0;k<u;k+=S){const M=this.getContext(k),O=o.setContext(M),P=r.setContext(M),T=O.lineWidth,V=O.color,W=P.dash||[],H=P.dashOffset,K=O.tickWidth,J=O.tickColor,it=O.tickBorderDash||[],gt=O.tickBorderDashOffset;w=fc(this,k,l),w!==void 0&&(x=zt(i,w,T),c?v=E=A=N=x:C=F=B=tt=x,p.push({tx1:v,ty1:C,tx2:E,ty2:F,x1:A,y1:B,x2:N,y2:tt,width:T,color:V,borderDash:W,borderDashOffset:H,tickWidth:K,tickColor:J,tickBorderDash:it,tickBorderDashOffset:gt}))}return this._ticksLength=u,this._borderValue=y,p}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:u}=o,f=Ee(i.grid),p=f+h,g=u?-h:p,m=-mt(this.labelRotation),b=[];let _,y,k,w,x,v,C,E,F,A,B,N,tt="middle";if(s==="top")v=this.bottom-g,C=this._getXAxisLabelAlignment();else if(s==="bottom")v=this.top+g,C=this._getXAxisLabelAlignment();else if(s==="left"){const S=this._getYAxisLabelAlignment(f);C=S.textAlign,x=S.x}else if(s==="right"){const S=this._getYAxisLabelAlignment(f);C=S.textAlign,x=S.x}else if(e==="x"){if(s==="center")v=(t.top+t.bottom)/2+p;else if(I(s)){const S=Object.keys(s)[0],M=s[S];v=this.chart.scales[S].getPixelForValue(M)+p}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")x=(t.left+t.right)/2-p;else if(I(s)){const S=Object.keys(s)[0],M=s[S];x=this.chart.scales[S].getPixelForValue(M)}C=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?tt="top":l==="end"&&(tt="bottom"));const L=this._getLabelSizes();for(_=0,y=r.length;_<y;++_){k=r[_],w=k.label;const S=o.setContext(this.getContext(_));E=this.getPixelForTick(_)+o.labelOffset,F=this._resolveTickFontOptions(_),A=F.lineHeight,B=U(w)?w.length:1;const M=B/2,O=S.color,P=S.textStrokeColor,T=S.textStrokeWidth;let V=C;a?(x=E,C==="inner"&&(_===y-1?V=this.options.reverse?"left":"right":_===0?V=this.options.reverse?"right":"left":V="center"),s==="top"?c==="near"||m!==0?N=-B*A+A/2:c==="center"?N=-L.highest.height/2-M*A+A:N=-L.highest.height+A/2:c==="near"||m!==0?N=A/2:c==="center"?N=L.highest.height/2-M*A:N=L.highest.height-B*A,u&&(N*=-1),m!==0&&!S.showLabelBackdrop&&(x+=A/2*Math.sin(m))):(v=E,N=(1-B)*A/2);let W;if(S.showLabelBackdrop){const H=at(S.backdropPadding),K=L.heights[_],J=L.widths[_];let it=N-H.top,gt=0-H.left;switch(tt){case"middle":it-=K/2;break;case"bottom":it-=K;break}switch(C){case"center":gt-=J/2;break;case"right":gt-=J;break}W={left:gt,top:it,width:J+H.width,height:K+H.height,color:S.backdropColor}}b.push({label:w,font:F,textOffset:N,options:{rotation:m,color:O,strokeColor:P,strokeWidth:T,textAlign:V,textBaseline:tt,translation:[x,v],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-mt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:s,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,h;return e==="left"?s?(h=this.right+o,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_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:i,top:s,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,s,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(o=0,a=s.length;o<a;++o){const l=s[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:i,grid:s}}=this,o=i.setContext(this.getContext()),a=i.display?o.width:0;if(!a)return;const r=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,u,f;this.isHorizontal()?(c=zt(t,this.left,a)-a/2,h=zt(t,this.right,r)+r/2,u=f=l):(u=zt(t,this.top,a)-a/2,f=zt(t,this.bottom,r)+r/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,u),e.lineTo(h,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&qe(i,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,h=a.textOffset;Wt(i,c,0,h,l,r)}s&&Ke(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=et(i.font),a=at(i.padding),r=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||I(e)?(l+=a.bottom,U(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:u,rotation:f}=_c(this,l,e,r);Wt(t,i.text,0,0,o,{color:i.color,maxWidth:u,rotation:f,textAlign:bc(r,e,s),textBaseline:"middle",translation:[c,h]})}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,i=R(t.grid&&t.grid.z,-1),s=R(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Kt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[i]===this.id&&(!t||r.type===t)&&s.push(r)}return s}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return et(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class dn{constructor(t,e,i){this.type=t,this.scope=e,this.override=i,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 i;kc(e)&&(i=this.register(e));const s=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,yc(t,a,i),this.override&&Z.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in Z[s]&&(delete Z[s][i],this.override&&delete $t[i])}}function yc(n,t,e){const i=he(Object.create(null),[e?Z.get(e):{},Z.get(t),n.defaults]);Z.set(t,i),n.defaultRoutes&&xc(t,n.defaultRoutes),n.descriptors&&Z.describe(t,n.descriptors)}function xc(n,t){Object.keys(t).forEach(e=>{const i=e.split("."),s=i.pop(),o=[n].concat(i).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");Z.route(o,s,l,r)})}function kc(n){return"id"in n&&"defaults"in n}class wc{constructor(){this.controllers=new dn(bt,"datasets",!0),this.elements=new dn(_t,"elements"),this.plugins=new dn(Object,"plugins"),this.scales=new dn(Kt,"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,i){[...e].forEach(s=>{const o=i||this._getRegistryForType(s);i||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):j(s,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,i){const s=On(t);Y(i["before"+s],[],i),e[t](i),Y(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const i=this._typedRegistries[e];if(i.isForType(t))return i}return this.plugins}_get(t,e,i){const s=e.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+i+".");return s}}var xt=new wc;class Mc{constructor(){this._init=[]}notify(t,e,i,s){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=s?this._descriptors(t).filter(s):this._descriptors(t),a=this._notify(o,t,e,i);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,i,s){s=s||{};for(const o of t){const a=o.plugin,r=a[i],l=[e,s,o.options];if(Y(r,l,a)===!1&&s.cancelable)return!1}return!0}invalidate(){$(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 i=t&&t.config,s=R(i.options&&i.options.plugins,{}),o=Sc(i);return s===!1&&!e?[]:Cc(t,o,s,e)}_notifyStateChanges(t){const e=this._oldCache||[],i=this._cache,s=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Sc(n){const t={},e=[],i=Object.keys(xt.plugins.items);for(let o=0;o<i.length;o++)e.push(xt.getPlugin(i[o]));const s=n.plugins||[];for(let o=0;o<s.length;o++){const a=s[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function vc(n,t){return!t&&n===!1?null:n===!0?{}:n}function Cc(n,{plugins:t,localIds:e},i,s){const o=[],a=n.getContext();for(const r of t){const l=r.id,c=vc(i[l],s);c!==null&&o.push({plugin:r,options:Dc(n.config,{plugin:r,local:e[l]},c,a)})}return o}function Dc(n,{plugin:t,local:e},i,s){const o=n.pluginScopeKeys(t),a=n.getOptionScopes(i,o);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Qn(n,t){const e=Z.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Ec(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Pc(n,t){return n===t?"_index_":"_value_"}function Ys(n){if(n==="x"||n==="y"||n==="r")return n}function Oc(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function ti(n,...t){if(Ys(n))return n;for(const e of t){const i=e.axis||Oc(e.position)||n.length>1&&Ys(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Us(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Bc(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(e.length)return Us(n,"x",e[0])||Us(n,"y",e[0])}return{}}function Ac(n,t){const e=$t[n.type]||{scales:{}},i=t.scales||{},s=Qn(n.type,t),o=Object.create(null);return Object.keys(i).forEach(a=>{const r=i[a];if(!I(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 l=ti(a,r,Bc(a,n),Z.scales[r.type]),c=Pc(l,s),h=e.scales||{};o[a]=ue(Object.create(null),[{axis:l},r,h[l],h[c]])}),n.data.datasets.forEach(a=>{const r=a.type||n.type,l=a.indexAxis||Qn(r,t),h=($t[r]||{}).scales||{};Object.keys(h).forEach(u=>{const f=Ec(u,l),p=a[f+"AxisID"]||f;o[p]=o[p]||Object.create(null),ue(o[p],[{axis:f},i[p],h[u]])})}),Object.keys(o).forEach(a=>{const r=o[a];ue(r,[Z.scales[r.type],Z.scale])}),o}function Xs(n){const t=n.options||(n.options={});t.plugins=R(t.plugins,{}),t.scales=Ac(n,t)}function qs(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Lc(n){return n=n||{},n.data=qs(n.data),Xs(n),n}const Ks=new Map,Gs=new Set;function hn(n,t){let e=Ks.get(n);return e||(e=t(),Ks.set(n,e),Gs.add(e)),e}const Pe=(n,t,e)=>{const i=At(t,e);i!==void 0&&n.add(i)};class Tc{constructor(t){this._config=Lc(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=qs(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(),Xs(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return hn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return hn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return hn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return hn(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return(!s||e)&&(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:o}=this,a=this._cachedScopes(t,i),r=a.get(e);if(r)return r;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(u=>Pe(l,t,u))),h.forEach(u=>Pe(l,s,u)),h.forEach(u=>Pe(l,$t[o]||{},u)),h.forEach(u=>Pe(l,Z,u)),h.forEach(u=>Pe(l,Rn,u))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Gs.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,$t[e]||{},Z.datasets[e]||{},{type:e},Z,Rn]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Zs(this._resolverCache,t,s);let l=a;if(Vc(a,e)){o.$shared=!1,i=Lt(i)?i():i;const c=this.createResolver(t,i,r);l=ne(a,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],s){const{resolver:o}=Zs(this._resolverCache,t,i);return I(e)?ne(o,e,void 0,s):o}}function Zs(n,t,e){let i=n.get(t);i||(i=new Map,n.set(t,i));const s=e.join();let o=i.get(s);return o||(o={resolver:zn(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,o)),o}const Fc=n=>I(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||Lt(n[e]),!1);function Vc(n,t){const{isScriptable:e,isIndexable:i}=Ji(n);for(const s of t){const o=e(s),a=i(s),r=(a||o)&&n[s];if(o&&(Lt(r)||Fc(r))||a&&U(r))return!0}return!1}var Rc="4.4.0";const Nc=["top","bottom","left","right","chartArea"];function Js(n,t){return n==="top"||n==="bottom"||Nc.indexOf(n)===-1&&t==="x"}function Qs(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function to(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Y(e&&e.onComplete,[n],t)}function Ic(n){const t=n.chart,e=t.options.animation;Y(e&&e.onProgress,[n],t)}function eo(n){return as()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const un={},no=n=>{const t=eo(n);return Object.values(un).filter(e=>e.canvas===t).pop()};function $c(n,t,e){const i=Object.keys(n);for(const s of i){const o=+s;if(o>=t){const a=n[s];delete n[s],(e>0||o>t)&&(n[o+e]=a)}}}function zc(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function fn(n,t,e){return n.options.clip?n[e]:t[e]}function Wc(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:fn(e,t,"left"),right:fn(e,t,"right"),top:fn(i,t,"top"),bottom:fn(i,t,"bottom")}:t}class Et{static register(...t){xt.add(...t),io()}static unregister(...t){xt.remove(...t),io()}constructor(t,e){const i=this.config=new Tc(e),s=eo(t),o=no(s);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=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||oc(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Ha(),this.ctx=r,this.canvas=l,this.width=h,this.height=c,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 Mc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ar(u=>this.update(u),a.resizeDelay||0),this._dataChanges=[],un[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Dt.listen(this,"complete",to),Dt.listen(this,"progress",Ic),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return $(t)?e&&o?o:s?i/s: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 xt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():rs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ki(this.canvas,this.ctx),this}stop(){return Dt.stop(this),this}resize(t,e){Dt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(s,t,e,o),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,rs(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),Y(i.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};j(e,(i,s)=>{i.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=ti(a,r),c=l==="r",h=l==="x";return{options:r,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),j(o,a=>{const r=a.options,l=r.id,c=ti(l,r),h=R(r.type,a.dtype);(r.position===void 0||Js(r.position,c)!==Js(a.dposition))&&(r.position=a.dposition),s[l]=!0;let u=null;if(l in i&&i[l].type===h)u=i[l];else{const f=xt.getScale(h);u=new f({id:l,type:h,ctx:this.ctx,chart:this}),i[u.id]=u}u.init(r,t)}),j(s,(a,r)=>{a||delete i[r]}),j(i,a=>{rt.configure(this,a,a.options),rt.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((s,o)=>s.index-o.index),i>e){for(let s=e;s<i;++s)this._destroyDatasetMeta(s);t.splice(e,i-e)}this._sortedMetasets=t.slice(0).sort(Qs("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((i,s)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i<s;i++){const o=e[i];let a=this.getDatasetMeta(i);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(i),a=this.getDatasetMeta(i)),a.type=r,a.indexAxis=o.indexAxis||Qn(r,this.options),a.order=o.order||0,a.index=i,a.label=""+o.label,a.visible=this.isDatasetVisible(i),a.controller)a.controller.updateIndex(i),a.controller.linkScales();else{const l=xt.getController(r),{datasetElementType:c,dataElementType:h}=Z.datasets[r];Object.assign(l,{dataElementType:xt.getElement(h),datasetElementType:c&&xt.getElement(c)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){j(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 i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.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 c=0,h=this.data.datasets.length;c<h;c++){const{controller:u}=this.getDatasetMeta(c),f=!s&&o.indexOf(u)===-1;u.buildOrUpdateElements(f),a=Math.max(+u.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||j(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Qs("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){j(this.scales,t=>{rt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!Bi(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:o}of e){const a=i==="_removeElements"?-o:o;$c(t,s,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),s=i(0);for(let o=1;o<e;o++)if(!Bi(s,i(o)))return;return Array.from(s).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;rt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],j(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e<i;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,i=this.data.datasets.length;e<i;++e)this._updateDataset(e,Lt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const i=this.getDatasetMeta(t),s={meta:i,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(e),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Dt.has(this)?this.attached&&!Dt.running(this)&&Dt.start(this):(this.draw(),to({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),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,i=[];let s,o;for(s=0,o=e.length;s<o;++s){const a=e[s];(!t||a.visible)&&i.push(a)}return i}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,i=t._clip,s=!i.disabled,o=Wc(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&qe(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),s&&Ke(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Ct(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const o=Nl.modes[e];return typeof o=="function"?o(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter(o=>o&&o._dataset===e).pop();return s||(s={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},i.push(s)),s}getContext(){return this.$context||(this.$context=Ft(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,s);fe(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),a.update(o,{visible:i}),this.update(r=>r.datasetIndex===t?s: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(),Dt.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(),Ki(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete un[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,i=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},s=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};j(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{s("attach",r),this.attached=!0,this.resize(),i("resize",o),i("detach",a)};a=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),i("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){j(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},j(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[s+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],i=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}});!We(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(u=>h.datasetIndex===u.datasetIndex&&h.index===u.index)),a=o(e,t),r=i?t:o(t,e);a.length&&this.updateHoverStyle(a,s.mode,!1),r.length&&s.mode&&this.updateHoverStyle(r,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,s)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:o}=this,a=e,r=this._getActiveElements(t,s,i,a),l=Ga(t),c=zc(t,this._lastEvent,i,l);i&&(this._lastEvent=null,Y(o.onHover,[t,r,this],this),l&&Y(o.onClick,[t,r,this],this));const h=!We(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,s){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}D(Et,"defaults",Z),D(Et,"instances",un),D(Et,"overrides",$t),D(Et,"registry",xt),D(Et,"version",Rc),D(Et,"getChart",no);function io(){return j(Et.instances,n=>n._plugins.invalidate())}function jc(n,t,e){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=s/r;n.beginPath(),n.arc(o,a,r,i-c,e+c),l>s?(c=s/l,n.arc(o,a,l,e+c,i-c,!0)):n.arc(o,a,s,e+Q,i-Q),n.closePath(),n.clip()}function Hc(n){return $n(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Yc(n,t,e,i){const s=Hc(n.options.borderRadius),o=(e-t)/2,a=Math.min(o,i*t/2),r=l=>{const c=(e-Math.min(o,l))*i/2;return nt(l,0,Math.min(o,c))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:nt(s.innerStart,0,a),innerEnd:nt(s.innerEnd,0,a)}}function oe(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function pn(n,t,e,i,s,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=t,u=Math.max(t.outerRadius+i+e-c,0),f=h>0?h+i+e+c:0;let p=0;const g=s-l;if(i){const S=h>0?h-i:0,M=u>0?u-i:0,O=(S+M)/2,P=O!==0?g*O/(O+i):g;p=(g-P)/2}const m=Math.max(.001,g*u-e/X)/u,b=(g-m)/2,_=l+b+p,y=s-b-p,{outerStart:k,outerEnd:w,innerStart:x,innerEnd:v}=Yc(t,f,u,y-_),C=u-k,E=u-w,F=_+k/C,A=y-w/E,B=f+x,N=f+v,tt=_+x/B,L=y-v/N;if(n.beginPath(),o){const S=(F+A)/2;if(n.arc(a,r,u,F,S),n.arc(a,r,u,S,A),w>0){const T=oe(E,A,a,r);n.arc(T.x,T.y,w,A,y+Q)}const M=oe(N,y,a,r);if(n.lineTo(M.x,M.y),v>0){const T=oe(N,L,a,r);n.arc(T.x,T.y,v,y+Q,L+Math.PI)}const O=(y-v/f+(_+x/f))/2;if(n.arc(a,r,f,y-v/f,O,!0),n.arc(a,r,f,O,_+x/f,!0),x>0){const T=oe(B,tt,a,r);n.arc(T.x,T.y,x,tt+Math.PI,_-Q)}const P=oe(C,_,a,r);if(n.lineTo(P.x,P.y),k>0){const T=oe(C,F,a,r);n.arc(T.x,T.y,k,_-Q,F)}}else{n.moveTo(a,r);const S=Math.cos(F)*u+a,M=Math.sin(F)*u+r;n.lineTo(S,M);const O=Math.cos(A)*u+a,P=Math.sin(A)*u+r;n.lineTo(O,P)}n.closePath()}function Uc(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){pn(n,t,e,i,l,s);for(let c=0;c<o;++c)n.fill();isNaN(r)||(l=a+(r%q||q))}return pn(n,t,e,i,l,s),n.fill(),l}function Xc(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:u,borderDashOffset:f}=l,p=l.borderAlign==="inner";if(!c)return;n.setLineDash(u||[]),n.lineDashOffset=f,p?(n.lineWidth=c*2,n.lineJoin=h||"round"):(n.lineWidth=c,n.lineJoin=h||"bevel");let g=t.endAngle;if(o){pn(n,t,e,i,g,s);for(let m=0;m<o;++m)n.stroke();isNaN(r)||(g=a+(r%q||q))}p&&jc(n,t,g),o||(pn(n,t,e,i,g,s),n.stroke())}class Oe extends _t{constructor(e){super();D(this,"circumference");D(this,"endAngle");D(this,"fullCircles");D(this,"innerRadius");D(this,"outerRadius");D(this,"pixelMargin");D(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,i,s){const o=this.getProps(["x","y"],s),{angle:a,distance:r}=Vi(o,{x:e,y:i}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:u,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),p=(this.options.spacing+this.options.borderWidth)/2,m=R(f,c-l)>=q||ge(a,l,c),b=St(r,h+p,u+p);return m&&b}getCenterPoint(e){const{x:i,y:s,startAngle:o,endAngle:a,innerRadius:r,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,u=(o+a)/2,f=(r+l+h+c)/2;return{x:i+Math.cos(u)*f,y:s+Math.sin(u)*f}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:i,circumference:s}=this,o=(i.offset||0)/4,a=(i.spacing||0)/2,r=i.circular;if(this.pixelMargin=i.borderAlign==="inner"?.33:0,this.fullCircles=s>q?Math.floor(s/q):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(X,s||0)),h=o*c;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Uc(e,this,h,a,r),Xc(e,this,h,a,r),e.restore()}}D(Oe,"id","arc"),D(Oe,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),D(Oe,"defaultRoutes",{backgroundColor:"backgroundColor"}),D(Oe,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function so(n,t,e=t){n.lineCap=R(e.borderCapStyle,t.borderCapStyle),n.setLineDash(R(e.borderDash,t.borderDash)),n.lineDashOffset=R(e.borderDashOffset,t.borderDashOffset),n.lineJoin=R(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=R(e.borderWidth,t.borderWidth),n.strokeStyle=R(e.borderColor,t.borderColor)}function qc(n,t,e){n.lineTo(e.x,e.y)}function Kc(n){return n.stepped?_r:n.tension||n.cubicInterpolationMode==="monotone"?yr:qc}function oo(n,t,e={}){const i=n.length,{start:s=0,end:o=i-1}=e,{start:a,end:r}=t,l=Math.max(s,a),c=Math.min(o,r),h=s<a&&o<a||s>r&&o>r;return{count:i,start:l,loop:t.loop,ilen:c<l&&!h?i+c-l:c-l}}function Gc(n,t,e,i){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:c}=oo(s,e,i),h=Kc(o);let{move:u=!0,reverse:f}=i||{},p,g,m;for(p=0;p<=c;++p)g=s[(r+(f?c-p:p))%a],!g.skip&&(u?(n.moveTo(g.x,g.y),u=!1):h(n,m,g,f,o.stepped),m=g);return l&&(g=s[(r+(f?c:0))%a],h(n,m,g,f,o.stepped)),!!l}function Zc(n,t,e,i){const s=t.points,{count:o,start:a,ilen:r}=oo(s,e,i),{move:l=!0,reverse:c}=i||{};let h=0,u=0,f,p,g,m,b,_;const y=w=>(a+(c?r-w:w))%o,k=()=>{m!==b&&(n.lineTo(h,b),n.lineTo(h,m),n.lineTo(h,_))};for(l&&(p=s[y(0)],n.moveTo(p.x,p.y)),f=0;f<=r;++f){if(p=s[y(f)],p.skip)continue;const w=p.x,x=p.y,v=w|0;v===g?(x<m?m=x:x>b&&(b=x),h=(u*h+w)/++u):(k(),n.lineTo(w,x),g=v,u=0,m=b=x),_=x}k()}function ei(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Zc:Gc}function Jc(n){return n.stepped?Zr:n.tension||n.cubicInterpolationMode==="monotone"?Jr:Ut}function Qc(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),so(n,t.options),n.stroke(s)}function td(n,t,e,i){const{segments:s,options:o}=t,a=ei(t);for(const r of s)so(n,o,r.style),n.beginPath(),a(n,t,r,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const ed=typeof Path2D=="function";function nd(n,t,e,i){ed&&!t.options.segment?Qc(n,t,e,i):td(n,t,e,i)}class Vt extends _t{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 i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;jr(this._points,i,t,s,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=sl(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,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],o=this.points,a=ps(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=Jc(i);let c,h;for(c=0,h=a.length;c<h;++c){const{start:u,end:f}=a[c],p=o[u],g=o[f];if(p===g){r.push(p);continue}const m=Math.abs((s-p[e])/(g[e]-p[e])),b=l(p,g,m,i.stepped);b[e]=t[e],r.push(b)}return r.length===1?r[0]:r}pathSegment(t,e,i){return ei(this)(t,this,e,i)}path(t,e,i){const s=this.segments,o=ei(this);let a=this._loop;e=e||0,i=i||this.points.length-e;for(const r of s)a&=o(t,this,r,{start:e,end:e+i-1});return!!a}draw(t,e,i,s){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),nd(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}D(Vt,"id","line"),D(Vt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),D(Vt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),D(Vt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function ao(n,t,e,i){const s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}class gn extends _t{constructor(e){super();D(this,"parsed");D(this,"skip");D(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,i,s){const o=this.options,{x:a,y:r}=this.getProps(["x","y"],s);return Math.pow(e-a,2)+Math.pow(i-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,i){return ao(this,e,"x",i)}inYRange(e,i){return ao(this,e,"y",i)}getCenterPoint(e){const{x:i,y:s}=this.getProps(["x","y"],e);return{x:i,y:s}}size(e){e=e||this.options||{};let i=e.radius||0;i=Math.max(i,i&&e.hoverRadius||0);const s=i&&e.borderWidth||0;return(i+s)*2}draw(e,i){const s=this.options;this.skip||s.radius<.1||!Ct(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,In(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}D(gn,"id","point"),D(gn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),D(gn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function ro(n,t){const{x:e,y:i,base:s,width:o,height:a}=n.getProps(["x","y","base","width","height"],t);let r,l,c,h,u;return n.horizontal?(u=a/2,r=Math.min(e,s),l=Math.max(e,s),c=i-u,h=i+u):(u=o/2,r=e-u,l=e+u,c=Math.min(i,s),h=Math.max(i,s)),{left:r,top:c,right:l,bottom:h}}function Rt(n,t,e,i){return n?0:nt(t,e,i)}function id(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,o=Zi(i);return{t:Rt(s.top,o.top,0,e),r:Rt(s.right,o.right,0,t),b:Rt(s.bottom,o.bottom,0,e),l:Rt(s.left,o.left,0,t)}}function sd(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=jt(s),a=Math.min(t,e),r=n.borderSkipped,l=i||I(s);return{topLeft:Rt(!l||r.top||r.left,o.topLeft,0,a),topRight:Rt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Rt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Rt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function od(n){const t=ro(n),e=t.right-t.left,i=t.bottom-t.top,s=id(n,e/2,i/2),o=sd(n,e/2,i/2);return{outer:{x:t.left,y:t.top,w:e,h:i,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:e-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function ni(n,t,e,i){const s=t===null,o=e===null,r=n&&!(s&&o)&&ro(n,i);return r&&(s||St(t,r.left,r.right))&&(o||St(e,r.top,r.bottom))}function ad(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function rd(n,t){n.rect(t.x,t.y,t.w,t.h)}function ii(n,t,e={}){const i=n.x!==e.x?-t:0,s=n.y!==e.y?-t:0,o=(n.x+n.w!==e.x+e.w?t:0)-i,a=(n.y+n.h!==e.y+e.h?t:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+o,h:n.h+a,radius:n.radius}}class mn extends _t{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:i,backgroundColor:s}}=this,{inner:o,outer:a}=od(this),r=ad(a.radius)?ye:rd;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,ii(a,e,o)),t.clip(),r(t,ii(o,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,ii(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return ni(this,t,e,i)}inXRange(t,e){return ni(this,t,null,e)}inYRange(t,e){return ni(this,null,t,e)}getCenterPoint(t){const{x:e,y:i,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+s)/2:e,y:o?i:(i+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}D(mn,"id","bar"),D(mn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),D(mn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var ld=Object.freeze({__proto__:null,ArcElement:Oe,BarElement:mn,LineElement:Vt,PointElement:gn});const si=["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)"],lo=si.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function co(n){return si[n%si.length]}function ho(n){return lo[n%lo.length]}function cd(n,t){return n.borderColor=co(t),n.backgroundColor=ho(t),++t}function dd(n,t){return n.backgroundColor=n.data.map(()=>co(t++)),t}function hd(n,t){return n.backgroundColor=n.data.map(()=>ho(t++)),t}function ud(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof Xt?t=dd(e,t):s instanceof we?t=hd(e,t):s&&(t=cd(e,t))}}function uo(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function fd(n){return n&&(n.borderColor||n.backgroundColor)}var pd={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:i},options:s}=n.config,{elements:o}=s;if(!e.forceOverride&&(uo(i)||fd(s)||o&&uo(o)))return;const a=ud(n);i.forEach(a)}};function gd(n,t,e,i,s){const o=s.samples||i;if(o>=e)return n.slice(t,t+e);const a=[],r=(e-2)/(o-2);let l=0;const c=t+e-1;let h=t,u,f,p,g,m;for(a[l++]=n[h],u=0;u<o-2;u++){let b=0,_=0,y;const k=Math.floor((u+1)*r)+1+t,w=Math.min(Math.floor((u+2)*r)+1,e)+t,x=w-k;for(y=k;y<w;y++)b+=n[y].x,_+=n[y].y;b/=x,_/=x;const v=Math.floor(u*r)+1+t,C=Math.min(Math.floor((u+1)*r)+1,e)+t,{x:E,y:F}=n[h];for(p=g=-1,y=v;y<C;y++)g=.5*Math.abs((E-b)*(n[y].y-F)-(E-n[y].x)*(_-F)),g>p&&(p=g,f=n[y],m=y);a[l++]=f,h=m}return a[l++]=n[c],a}function md(n,t,e,i){let s=0,o=0,a,r,l,c,h,u,f,p,g,m;const b=[],_=t+e-1,y=n[t].x,w=n[_].x-y;for(a=t;a<t+e;++a){r=n[a],l=(r.x-y)/w*i,c=r.y;const x=l|0;if(x===h)c<g?(g=c,u=a):c>m&&(m=c,f=a),s=(o*s+r.x)/++o;else{const v=a-1;if(!$(u)&&!$(f)){const C=Math.min(u,f),E=Math.max(u,f);C!==p&&C!==v&&b.push({...n[C],x:s}),E!==p&&E!==v&&b.push({...n[E],x:s})}a>0&&v!==p&&b.push(n[v]),b.push(r),h=x,o=0,g=m=c,u=f=p=a}}return b}function fo(n){if(n._decimated){const t=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function po(n){n.data.datasets.forEach(t=>{fo(t)})}function bd(n,t){const e=t.length;let i=0,s;const{iScale:o}=n,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(i=nt(vt(t,o.axis,a).lo,0,e-1)),c?s=nt(vt(t,o.axis,r).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var _d={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){po(n);return}const i=n.width;n.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=n.getDatasetMeta(o),c=a||s.data;if(xe([r,n.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const h=n.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:u,count:f}=bd(l,c);const p=e.threshold||4*i;if(f<=p){fo(s);return}$(a)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let g;switch(e.algorithm){case"lttb":g=gd(c,u,f,i,e);break;case"min-max":g=md(c,u,f,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(n){po(n)}};function yd(n,t,e){const i=n.segments,s=n.points,o=t.points,a=[];for(const r of i){let{start:l,end:c}=r;c=ai(l,c,s);const h=oi(e,s[l],s[c],r.loop);if(!t.segments){a.push({source:r,target:h,start:s[l],end:s[c]});continue}const u=ps(t,h);for(const f of u){const p=oi(e,o[f.start],o[f.end],f.loop),g=fs(r,s,p);for(const m of g)a.push({source:m,target:f,start:{[e]:go(h,p,"start",Math.max)},end:{[e]:go(h,p,"end",Math.min)}})}}return a}function oi(n,t,e,i){if(i)return;let s=t[n],o=e[n];return n==="angle"&&(s=ut(s),o=ut(o)),{property:n,start:s,end:o}}function xd(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=ai(a,r,s);const l=s[a],c=s[r];i!==null?(o.push({x:l.x,y:i}),o.push({x:c.x,y:i})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function ai(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function go(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function mo(n,t){let e=[],i=!1;return U(n)?(i=!0,e=n):e=xd(n,t),e.length?new Vt({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function bo(n){return n&&n.fill!==!1}function kd(n,t,e){let s=n[t].fill;const o=[t];let a;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!G(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function wd(n,t,e){const i=Cd(n);if(I(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return G(s)&&Math.floor(s)===s?Md(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Md(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Sd(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:I(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function vd(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:I(n)?i=n.value:i=t.getBaseValue(),i}function Cd(n){const t=n.options,e=t.fill;let i=R(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Dd(n){const{scale:t,index:e,line:i}=n,s=[],o=i.segments,a=i.points,r=Ed(t,e);r.push(mo({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)Pd(s,a[h],r)}return new Vt({points:s,options:{}})}function Ed(n,t){const e=[],i=n.getMatchingVisibleMetas("line");for(let s=0;s<i.length;s++){const o=i[s];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function Pd(n,t,e){const i=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=Od(o,t,"x");if(!(!l||a&&r)){if(a)i.unshift(l);else if(n.push(l),!r)break}}n.push(...i)}function Od(n,t,e){const i=n.interpolate(t,e);if(!i)return{};const s=i[e],o=n.segments,a=n.points;let r=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],u=a[h.start][e],f=a[h.end][e];if(St(s,u,f)){r=s===u,l=s===f;break}}return{first:r,last:l,point:i}}class _o{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:o,radius:a}=this;return e=e||{start:0,end:q},t.arc(s,o,a,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,o=t.angle;return{x:e+Math.cos(o)*s,y:i+Math.sin(o)*s,angle:o}}}function Bd(n){const{chart:t,fill:e,line:i}=n;if(G(e))return Ad(t,e);if(e==="stack")return Dd(n);if(e==="shape")return!0;const s=Ld(n);return s instanceof _o?s:mo(s,i)}function Ad(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Ld(n){return(n.scale||{}).getPointPositionForValue?Fd(n):Td(n)}function Td(n){const{scale:t={},fill:e}=n,i=Sd(e,t);if(G(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Fd(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,a=vd(e,t,o),r=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new _o({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(a)})}for(let l=0;l<s;++l)r.push(t.getPointPositionForValue(l,a));return r}function ri(n,t,e){const i=Bd(t),{line:s,scale:o,axis:a}=t,r=s.options,l=r.fill,c=r.backgroundColor,{above:h=c,below:u=c}=l||{};i&&s.points.length&&(qe(n,e),Vd(n,{line:s,target:i,above:h,below:u,area:e,scale:o,axis:a}),Ke(n))}function Vd(n,t){const{line:e,target:i,above:s,below:o,area:a,scale:r}=t,l=e._loop?"angle":t.axis;n.save(),l==="x"&&o!==s&&(yo(n,i,a.top),xo(n,{line:e,target:i,color:s,scale:r,property:l}),n.restore(),n.save(),yo(n,i,a.bottom)),xo(n,{line:e,target:i,color:o,scale:r,property:l}),n.restore()}function yo(n,t,e){const{segments:i,points:s}=t;let o=!0,a=!1;n.beginPath();for(const r of i){const{start:l,end:c}=r,h=s[l],u=s[ai(l,c,s)];o?(n.moveTo(h.x,h.y),o=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,r,{move:a}),a?n.closePath():n.lineTo(u.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function xo(n,t){const{line:e,target:i,property:s,color:o,scale:a}=t,r=yd(e,i,s);for(const{source:l,target:c,start:h,end:u}of r){const{style:{backgroundColor:f=o}={}}=l,p=i!==!0;n.save(),n.fillStyle=f,Rd(n,a,p&&oi(s,h,u)),n.beginPath();const g=!!e.pathSegment(n,l);let m;if(p){g?n.closePath():ko(n,i,u,s);const b=!!i.pathSegment(n,c,{move:g,reverse:!0});m=g&&b,m||ko(n,i,h,s)}n.closePath(),n.fill(m?"evenodd":"nonzero"),n.restore()}}function Rd(n,t,e){const{top:i,bottom:s}=t.chart.chartArea,{property:o,start:a,end:r}=e||{};o==="x"&&(n.beginPath(),n.rect(a,i,r-a,s-i),n.clip())}function ko(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Nd={id:"filler",afterDatasetsUpdate(n,t,e){const i=(n.data.datasets||[]).length,s=[];let o,a,r,l;for(a=0;a<i;++a)o=n.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof Vt&&(l={visible:n.isDatasetVisible(a),index:a,fill:wd(r,a,i),chart:n,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,s.push(l);for(a=0;a<i;++a)l=s[a],!(!l||l.fill===!1)&&(l.fill=kd(s,a,e.propagate))},beforeDraw(n,t,e){const i=e.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),o=n.chartArea;for(let a=s.length-1;a>=0;--a){const r=s[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),i&&r.fill&&ri(n.ctx,r,o))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const o=i[s].$filler;bo(o)&&ri(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!bo(i)||e.drawTime!=="beforeDatasetDraw"||ri(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const wo=(n,t)=>{let{boxHeight:e=t,boxWidth:i=t}=n;return n.usePointStyle&&(e=Math.min(e,t),i=n.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},Id=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Mo extends _t{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,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,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=Y(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,s)=>t.sort(i,s,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 i=t.labels,s=et(i.font),o=s.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=wo(i,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,s,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+r;let u=t;o.textAlign="left",o.textBaseline="middle";let f=-1,p=-h;return this.legendItems.forEach((g,m)=>{const b=i+e/2+o.measureText(g.text).width;(m===0||c[c.length-1]+b+2*r>a)&&(u+=h,c[c.length-(m>0?0:1)]=0,p+=h,f++),l[m]={left:0,top:p,row:f,width:b,height:s},c[c.length-1]+=b+r}),u}_fitCols(t,e,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-t;let u=r,f=0,p=0,g=0,m=0;return this.legendItems.forEach((b,_)=>{const{itemWidth:y,itemHeight:k}=$d(i,e,o,b,s);_>0&&p+k+2*r>h&&(u+=f+r,c.push({width:f,height:p}),g+=f+r,m++,f=p=0),l[_]={left:g,top:p,col:m,width:y,height:k},f=Math.max(f,y),p+=k+r}),u+=f,c.push({width:f,height:p}),u}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,a=se(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=ot(i,this.left+s,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=ot(i,this.left+s,this.right-this.lineWidths[r])),c.top+=this.top+t+s,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+s}else{let r=0,l=ot(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=ot(i,this.top+t+s,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+s,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;qe(t,this),this._draw(),Ke(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:a}=t,r=Z.color,l=se(t.rtl,this.left,this.width),c=et(a.font),{padding:h}=a,u=c.size,f=u/2;let p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:b}=wo(a,u),_=function(v,C,E){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;s.save();const F=R(E.lineWidth,1);if(s.fillStyle=R(E.fillStyle,r),s.lineCap=R(E.lineCap,"butt"),s.lineDashOffset=R(E.lineDashOffset,0),s.lineJoin=R(E.lineJoin,"miter"),s.lineWidth=F,s.strokeStyle=R(E.strokeStyle,r),s.setLineDash(R(E.lineDash,[])),a.usePointStyle){const A={radius:m*Math.SQRT2/2,pointStyle:E.pointStyle,rotation:E.rotation,borderWidth:F},B=l.xPlus(v,g/2),N=C+f;Gi(s,A,B,N,a.pointStyleWidth&&g)}else{const A=C+Math.max((u-m)/2,0),B=l.leftForLtr(v,g),N=jt(E.borderRadius);s.beginPath(),Object.values(N).some(tt=>tt!==0)?ye(s,{x:B,y:A,w:g,h:m,radius:N}):s.rect(B,A,g,m),s.fill(),F!==0&&s.stroke()}s.restore()},y=function(v,C,E){Wt(s,E.text,v,C+b/2,c,{strikethrough:E.hidden,textAlign:l.textAlign(E.textAlign)})},k=this.isHorizontal(),w=this._computeTitleHeight();k?p={x:ot(o,this.left+h,this.right-i[0]),y:this.top+h+w,line:0}:p={x:this.left+h,y:ot(o,this.top+w+h,this.bottom-e[0].height),line:0},cs(this.ctx,t.textDirection);const x=b+h;this.legendItems.forEach((v,C)=>{s.strokeStyle=v.fontColor,s.fillStyle=v.fontColor;const E=s.measureText(v.text).width,F=l.textAlign(v.textAlign||(v.textAlign=a.textAlign)),A=g+f+E;let B=p.x,N=p.y;l.setWidth(this.width),k?C>0&&B+A+h>this.right&&(N=p.y+=x,p.line++,B=p.x=ot(o,this.left+h,this.right-i[p.line])):C>0&&N+x>this.bottom&&(B=p.x=B+e[p.line].width+h,p.line++,N=p.y=ot(o,this.top+w+h,this.bottom-e[p.line].height));const tt=l.x(B);if(_(tt,N,v),B=rr(F,B+g+f,k?B+A:this.right,t.rtl),y(l.x(B),N,v),k)p.x+=A+h;else if(typeof v.text!="string"){const L=c.lineHeight;p.y+=So(v,L)+h}else p.y+=x}),ds(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=et(e.font),s=at(e.padding);if(!e.display)return;const o=se(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=i.size/2,c=s.top+l;let h,u=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,u=ot(t.align,u,this.right-f);else{const g=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);h=c+ot(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const p=ot(r,u,u+f);a.textAlign=o.textAlign(Tn(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,Wt(a,e.text,p,h,i)}_computeTitleHeight(){const t=this.options.title,e=et(t.font),i=at(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(St(t,this.left,this.right)&&St(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],St(t,s.left,s.left+s.width)&&St(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!jd(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Id(s,i);s&&!o&&Y(e.onLeave,[t,s,this],this),this._hoveredItem=i,i&&!o&&Y(e.onHover,[t,i,this],this)}else i&&Y(e.onClick,[t,i,this],this)}}function $d(n,t,e,i,s){const o=zd(i,n,t,e),a=Wd(s,i,t.lineHeight);return{itemWidth:o,itemHeight:a}}function zd(n,t,e,i){let s=n.text;return s&&typeof s!="string"&&(s=s.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+i.measureText(s).width}function Wd(n,t,e){let i=n;return typeof t.text!="string"&&(i=So(t,e)),i}function So(n,t){const e=n.text?n.text.length:0;return t*e}function jd(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Hd={id:"legend",_element:Mo,start(n,t,e){const i=n.legend=new Mo({ctx:n.ctx,options:e,chart:n});rt.configure(n,i,e),rt.addBox(n,i)},stop(n){rt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;rt.configure(n,i,e),i.options=e},afterUpdate(n){const t=n.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(n,t){t.replay||n.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,t,e){const i=t.datasetIndex,s=e.chart;s.isDatasetVisible(i)?(s.hide(i),t.hidden=!0):(s.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const t=n.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:s,color:o,useBorderRadius:a,borderRadius:r}}=n.legend.options;return n._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=at(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class li extends _t{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 i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=U(i.text)?i.text.length:1;this._padding=at(i.padding);const o=s*et(i.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:i,bottom:s,right:o,options:a}=this,r=a.align;let l=0,c,h,u;return this.isHorizontal()?(h=ot(r,i,o),u=e+t,c=o-i):(a.position==="left"?(h=i+t,u=ot(r,s,e),l=X*-.5):(h=o-t,u=ot(r,e,s),l=X*.5),c=s-e),{titleX:h,titleY:u,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=et(e.font),o=i.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);Wt(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Tn(e.align),textBaseline:"middle",translation:[a,r]})}}function Yd(n,t){const e=new li({ctx:n.ctx,options:t,chart:n});rt.configure(n,e,t),rt.addBox(n,e),n.titleBlock=e}var Ud={id:"title",_element:li,start(n,t,e){Yd(n,e)},stop(n){const t=n.titleBlock;rt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;rt.configure(n,i,e),i.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 bn=new WeakMap;var Xd={id:"subtitle",start(n,t,e){const i=new li({ctx:n.ctx,options:e,chart:n});rt.configure(n,i,e),rt.addBox(n,i),bn.set(n,i)},stop(n){rt.removeBox(n,bn.get(n)),bn.delete(n)},beforeUpdate(n,t,e){const i=bn.get(n);rt.configure(n,i,e),i.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 Be={average(n){if(!n.length)return!1;let t,e,i=0,s=0,o=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const r=a.tooltipPosition();i+=r.x,s+=r.y,++o}}return{x:i/o,y:s/o}},nearest(n,t){if(!n.length)return!1;let e=t.x,i=t.y,s=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=n.length;o<a;++o){const l=n[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=An(t,c);h<s&&(s=h,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function kt(n,t){return t&&(U(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Pt(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
28
+ `)>-1?n.split(`
29
+ `):n}function qd(n,t){const{element:e,datasetIndex:i,index:s}=t,o=n.getDatasetMeta(i).controller,{label:a,value:r}=o.getLabelAndValue(s);return{chart:n,label:a,parsed:o.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:o.getDataset(),dataIndex:s,datasetIndex:i,element:e}}function vo(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:a,boxHeight:r}=t,l=et(t.bodyFont),c=et(t.titleFont),h=et(t.footerFont),u=o.length,f=s.length,p=i.length,g=at(t.padding);let m=g.height,b=0,_=i.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(_+=n.beforeBody.length+n.afterBody.length,u&&(m+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),_){const w=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;m+=p*w+(_-p)*l.lineHeight+(_-1)*t.bodySpacing}f&&(m+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let y=0;const k=function(w){b=Math.max(b,e.measureText(w).width+y)};return e.save(),e.font=c.string,j(n.title,k),e.font=l.string,j(n.beforeBody.concat(n.afterBody),k),y=t.displayColors?a+2+t.boxPadding:0,j(i,w=>{j(w.before,k),j(w.lines,k),j(w.after,k)}),y=0,e.font=h.string,j(n.footer,k),e.restore(),b+=g.width,{width:b,height:m}}function Kd(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Gd(n,t,e,i){const{x:s,width:o}=i,a=e.caretSize+e.caretPadding;if(n==="left"&&s+o+a>t.width||n==="right"&&s-o-a<0)return!0}function Zd(n,t,e,i){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=n;let c="center";return i==="center"?c=s<=(r+l)/2?"left":"right":s<=o/2?c="left":s>=a-o/2&&(c="right"),Gd(c,n,t,e)&&(c="center"),c}function Co(n,t,e){const i=e.yAlign||t.yAlign||Kd(n,e);return{xAlign:e.xAlign||t.xAlign||Zd(n,t,e,i),yAlign:i}}function Jd(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Qd(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function Do(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=n,{xAlign:r,yAlign:l}=e,c=s+o,{topLeft:h,topRight:u,bottomLeft:f,bottomRight:p}=jt(a);let g=Jd(t,r);const m=Qd(t,l,c);return l==="center"?r==="left"?g+=c:r==="right"&&(g-=c):r==="left"?g-=Math.max(h,f)+s:r==="right"&&(g+=Math.max(u,p)+s),{x:nt(g,0,i.width-t.width),y:nt(m,0,i.height-t.height)}}function _n(n,t,e){const i=at(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function Eo(n){return kt([],Pt(n))}function th(n,t,e){return Ft(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Po(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Oo={beforeTitle:Mt,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex<i)return e[t.dataIndex]}return""},afterTitle:Mt,beforeBody:Mt,beforeLabel:Mt,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let t=n.dataset.label||"";t&&(t+=": ");const e=n.formattedValue;return $(e)||(t+=e),t},labelColor(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.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(n){const e=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:Mt,afterBody:Mt,beforeFooter:Mt,footer:Mt,afterFooter:Mt};function lt(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?Oo[t].call(e,i):s}class ci extends _t{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,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,o=new _s(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=th(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=lt(i,"beforeTitle",this,t),o=lt(i,"title",this,t),a=lt(i,"afterTitle",this,t);let r=[];return r=kt(r,Pt(s)),r=kt(r,Pt(o)),r=kt(r,Pt(a)),r}getBeforeBody(t,e){return Eo(lt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return j(t,o=>{const a={before:[],lines:[],after:[]},r=Po(i,o);kt(a.before,Pt(lt(r,"beforeLabel",this,o))),kt(a.lines,lt(r,"label",this,o)),kt(a.after,Pt(lt(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return Eo(lt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=lt(i,"beforeFooter",this,t),o=lt(i,"footer",this,t),a=lt(i,"afterFooter",this,t);let r=[];return r=kt(r,Pt(s)),r=kt(r,Pt(o)),r=kt(r,Pt(a)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],a=[];let r=[],l,c;for(l=0,c=e.length;l<c;++l)r.push(qd(this.chart,e[l]));return t.filter&&(r=r.filter((h,u,f)=>t.filter(h,u,f,i))),t.itemSort&&(r=r.sort((h,u)=>t.itemSort(h,u,i))),j(r,h=>{const u=Po(t.callbacks,h);s.push(lt(u,"labelColor",this,h)),o.push(lt(u,"labelPointStyle",this,h)),a.push(lt(u,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let o,a=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const r=Be[i.position].call(this,s,this._eventPosition);a=this._createItems(i),this.title=this.getTitle(a,i),this.beforeBody=this.getBeforeBody(a,i),this.body=this.getBody(a,i),this.afterBody=this.getAfterBody(a,i),this.footer=this.getFooter(a,i);const l=this._size=vo(this,i),c=Object.assign({},r,l),h=Co(this.chart,i,c),u=Do(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:u.x,y:u.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const o=this.getCaretPosition(t,i,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:o}=this,{caretSize:a,cornerRadius:r}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:u}=jt(r),{x:f,y:p}=t,{width:g,height:m}=e;let b,_,y,k,w,x;return o==="center"?(w=p+m/2,s==="left"?(b=f,_=b-a,k=w+a,x=w-a):(b=f+g,_=b+a,k=w-a,x=w+a),y=b):(s==="left"?_=f+Math.max(l,h)+a:s==="right"?_=f+g-Math.max(c,u)-a:_=this.caretX,o==="top"?(k=p,w=k-a,b=_-a,y=_+a):(k=p+m,w=k+a,b=_+a,y=_-a),x=k),{x1:b,x2:_,x3:y,y1:k,y2:w,y3:x}}drawTitle(t,e,i){const s=this.title,o=s.length;let a,r,l;if(o){const c=se(i.rtl,this.x,this.width);for(t.x=_n(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",a=et(i.titleFont),r=i.titleSpacing,e.fillStyle=i.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(s[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=i.titleMarginBottom-r)}}_drawColorBox(t,e,i,s,o){const a=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:l,boxWidth:c}=o,h=et(o.bodyFont),u=_n(this,"left",o),f=s.x(u),p=l<h.lineHeight?(h.lineHeight-l)/2:0,g=e.y+p;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},b=s.leftForLtr(f,c)+c/2,_=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,In(t,m,b,_),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,In(t,m,b,_)}else{t.lineWidth=I(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 m=s.leftForLtr(f,c),b=s.leftForLtr(s.xPlus(f,1),c-2),_=jt(a.borderRadius);Object.values(_).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ye(t,{x:m,y:g,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ye(t,{x:b,y:g+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=a.backgroundColor,t.fillRect(b,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:h}=i,u=et(i.bodyFont);let f=u.lineHeight,p=0;const g=se(i.rtl,this.x,this.width),m=function(E){e.fillText(E,g.x(t.x+p),t.y+f/2),t.y+=f+o},b=g.textAlign(a);let _,y,k,w,x,v,C;for(e.textAlign=a,e.textBaseline="middle",e.font=u.string,t.x=_n(this,b,i),e.fillStyle=i.bodyColor,j(this.beforeBody,m),p=r&&b!=="right"?a==="center"?c/2+h:c+2+h:0,w=0,v=s.length;w<v;++w){for(_=s[w],y=this.labelTextColors[w],e.fillStyle=y,j(_.before,m),k=_.lines,r&&k.length&&(this._drawColorBox(e,t,w,g,i),f=Math.max(u.lineHeight,l)),x=0,C=k.length;x<C;++x)m(k[x]),f=u.lineHeight;j(_.after,m)}p=0,f=u.lineHeight,j(this.afterBody,m),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let a,r;if(o){const l=se(i.rtl,this.x,this.width);for(t.x=_n(this,i.footerAlign,i),t.y+=i.footerMarginTop,e.textAlign=l.textAlign(i.footerAlign),e.textBaseline="middle",a=et(i.footerFont),e.fillStyle=i.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(s[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+i.footerSpacing}}drawBackground(t,e,i,s){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:h}=i,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:g}=jt(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+u,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(r+c-f,l),e.quadraticCurveTo(r+c,l,r+c,l+f),a==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(r+c,l+h-g),e.quadraticCurveTo(r+c,l+h,r+c-g,l+h),a==="bottom"&&this.drawCaret(t,e,i,s),e.lineTo(r+p,l+h),e.quadraticCurveTo(r,l+h,r,l+h-p),a==="center"&&o==="left"&&this.drawCaret(t,e,i,s),e.lineTo(r,l+u),e.quadraticCurveTo(r,l,r+u,l),e.closePath(),e.fill(),s.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,o=i&&i.y;if(s||o){const a=Be[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=vo(this,t),l=Object.assign({},a,this._size),c=Co(e,t,l),h=Do(t,l,c,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const a=at(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=i,this.drawBackground(o,t,s,e),cs(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),ds(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!We(i,s),a=this._positionChanged(s,e);(o||a)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,i),r=this._positionChanged(a,t),l=e||!We(a,o)||r;return l&&(this._active=a,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e;const a=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:i,caretY:s,options:o}=this,a=Be[o.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}D(ci,"positioners",Be);var eh={id:"tooltip",_element:ci,positioners:Be,afterInit(n,t,e){e&&(n.tooltip=new ci({chart:n,options:e}))},beforeUpdate(n,t,e){n.tooltip&&n.tooltip.initialize(e)},reset(n,t,e){n.tooltip&&n.tooltip.initialize(e)},afterDraw(n){const t=n.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(n.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",e)}},afterEvent(n,t){if(n.tooltip){const e=t.replay;n.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:(n,t)=>t.bodyFont.size,boxWidth:(n,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:Oo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},nh=Object.freeze({__proto__:null,Colors:pd,Decimation:_d,Filler:Nd,Legend:Hd,SubTitle:Xd,Title:Ud,Tooltip:eh});const ih=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function sh(n,t,e,i){const s=n.indexOf(t);if(s===-1)return ih(n,t,e,i);const o=n.lastIndexOf(t);return s!==o?e:s}const oh=(n,t)=>n===null?null:nt(Math.round(n),0,t);function Bo(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class di extends Kt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const i=this.getLabels();for(const{index:s,label:o}of e)i[s]===o&&i.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,e){if($(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:sh(i,t,R(e,t),this._addedLabels),oh(e,i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let a=t;a<=e;a++)s.push({value:a});return s}getLabelForValue(t){return Bo.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}}D(di,"id","category"),D(di,"defaults",{ticks:{callback:Bo}});function ah(n,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:u,includeBounds:f}=n,p=o||1,g=h-1,{min:m,max:b}=t,_=!$(a),y=!$(r),k=!$(c),w=(b-m)/(u+1);let x=Li((b-m)/g/p)*p,v,C,E,F;if(x<1e-14&&!_&&!y)return[{value:m},{value:b}];F=Math.ceil(b/x)-Math.floor(m/x),F>g&&(x=Li(F*x/g/p)*p),$(l)||(v=Math.pow(10,l),x=Math.ceil(x*v)/v),s==="ticks"?(C=Math.floor(m/x)*x,E=Math.ceil(b/x)*x):(C=m,E=b),_&&y&&o&&tr((r-a)/o,x/1e3)?(F=Math.round(Math.min((r-a)/x,h)),x=(r-a)/F,C=a,E=r):k?(C=_?a:C,E=y?r:E,F=c-1,x=(E-C)/F):(F=(E-C)/x,pe(F,Math.round(F),x/1e3)?F=Math.round(F):F=Math.ceil(F));const A=Math.max(Fi(x),Fi(C));v=Math.pow(10,$(l)?A:l),C=Math.round(C*v)/v,E=Math.round(E*v)/v;let B=0;for(_&&(f&&C!==a?(e.push({value:a}),C<a&&B++,pe(Math.round((C+B*x)*v)/v,a,Ao(a,w,n))&&B++):C<a&&B++);B<F;++B){const N=Math.round((C+B*x)*v)/v;if(y&&N>r)break;e.push({value:N})}return y&&f&&E!==r?e.length&&pe(e[e.length-1].value,r,Ao(r,w,n))?e[e.length-1].value=r:e.push({value:r}):(!y||E===r)&&e.push({value:E}),e}function Ao(n,t,{horizontal:e,minRotation:i}){const s=mt(i),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/o,a)}class yn extends Kt{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 $(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:o}=this;const a=l=>s=e?s:l,r=l=>o=i?o:l;if(t){const l=yt(s),c=yt(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,s;return i?(s=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s={maxTicks:i,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=ah(s,o);return t.bounds==="ticks"&&Ti(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,i=this.max;if(super.configure(),this.options.offset&&t.length){const s=(i-e)/Math.max(t.length-1,1)/2;e-=s,i+=s}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return be(t,this.chart.options.locale,this.options.ticks.format)}}class hi extends yn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=G(t)?t:0,this.max=G(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=mt(this.options.ticks.minRotation),s=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}D(hi,"id","linear"),D(hi,"defaults",{ticks:{callback:Ue.formatters.numeric}});const Ae=n=>Math.floor(Tt(n)),Gt=(n,t)=>Math.pow(10,Ae(n)+t);function Lo(n){return n/Math.pow(10,Ae(n))===1}function To(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function rh(n,t){const e=t-n;let i=Ae(e);for(;To(n,t,i)>10;)i++;for(;To(n,t,i)<10;)i--;return Math.min(i,Ae(n))}function lh(n,{min:t,max:e}){t=ht(n.min,t);const i=[],s=Ae(t);let o=rh(t,e),a=o<0?Math.pow(10,Math.abs(o)):1;const r=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*a)/a,h=Math.floor((t-l)/r/10)*r*10;let u=Math.floor((c-h)/Math.pow(10,o)),f=ht(n.min,Math.round((l+h+u*Math.pow(10,o))*a)/a);for(;f<e;)i.push({value:f,major:Lo(f),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,a=o>=0?1:a),f=Math.round((l+h+u*Math.pow(10,o))*a)/a;const p=ht(n.max,f);return i.push({value:p,major:Lo(p),significand:u}),i}class ui extends Kt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=yn.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return G(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=G(t)?Math.max(0,t):null,this.max=G(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!G(this._userMin)&&(this.min=t===Gt(this.min,0)?Gt(this.min,-1):Gt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const o=r=>i=t?i:r,a=r=>s=e?s:r;i===s&&(i<=0?(o(1),a(10)):(o(Gt(i,-1)),a(Gt(s,1)))),i<=0&&o(Gt(s,-1)),s<=0&&a(Gt(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=lh(e,this);return t.bounds==="ticks"&&Ti(i,this,"value"),t.reverse?(i.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),i}getLabelForValue(t){return t===void 0?"0":be(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Tt(t),this._valueRange=Tt(this.max)-Tt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Tt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}D(ui,"id","logarithmic"),D(ui,"defaults",{ticks:{callback:Ue.formatters.logarithmic,major:{enabled:!0}}});function fi(n){const t=n.ticks;if(t.display&&n.display){const e=at(t.backdropPadding);return R(t.font&&t.font.size,Z.font.size)+e.height}return 0}function ch(n,t,e){return e=U(e)?e:[e],{w:br(n,t.string,e),h:e.length*t.lineHeight}}function Fo(n,t,e,i,s){return n===i||n===s?{start:t-e/2,end:t+e/2}:n<i||n>s?{start:t-e,end:t}:{start:t,end:t+e}}function dh(n){const t={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},e=Object.assign({},t),i=[],s=[],o=n._pointLabels.length,a=n.options.pointLabels,r=a.centerPointLabels?X/o:0;for(let l=0;l<o;l++){const c=a.setContext(n.getPointLabelContext(l));s[l]=c.padding;const h=n.getPointPosition(l,n.drawingArea+s[l],r),u=et(c.font),f=ch(n.ctx,u,n._pointLabels[l]);i[l]=f;const p=ut(n.getIndexAngle(l)+r),g=Math.round(Bn(p)),m=Fo(g,h.x,f.w,0,180),b=Fo(g,h.y,f.h,90,270);hh(e,t,p,m,b)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=ph(n,i,s)}function hh(n,t,e,i,s){const o=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let r=0,l=0;i.start<t.l?(r=(t.l-i.start)/o,n.l=Math.min(n.l,t.l-r)):i.end>t.r&&(r=(i.end-t.r)/o,n.r=Math.max(n.r,t.r+r)),s.start<t.t?(l=(t.t-s.start)/a,n.t=Math.min(n.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/a,n.b=Math.max(n.b,t.b+l))}function uh(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=e,l=n.getPointPosition(t,i+s+a,o),c=Math.round(Bn(ut(l.angle+Q))),h=bh(l.y,r.h,c),u=gh(c),f=mh(l.x,r.w,u);return{visible:!0,x:l.x,y:h,textAlign:u,left:f,top:h,right:f+r.w,bottom:h+r.h}}function fh(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:o}=n;return!(Ct({x:e,y:i},t)||Ct({x:e,y:o},t)||Ct({x:s,y:i},t)||Ct({x:s,y:o},t))}function ph(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:fi(o)/2,additionalAngle:a?X/s:0};let c;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const u=uh(n,h,l);i.push(u),r==="auto"&&(u.visible=fh(u,c),u.visible&&(c=u))}return i}function gh(n){return n===0||n===180?"center":n<180?"left":"right"}function mh(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function bh(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function _h(n,t,e){const{left:i,top:s,right:o,bottom:a}=e,{backdropColor:r}=t;if(!$(r)){const l=jt(t.borderRadius),c=at(t.backdropPadding);n.fillStyle=r;const h=i-c.left,u=s-c.top,f=o-i+c.width,p=a-s+c.height;Object.values(l).some(g=>g!==0)?(n.beginPath(),ye(n,{x:h,y:u,w:f,h:p,radius:l}),n.fill()):n.fillRect(h,u,f,p)}}function yh(n,t){const{ctx:e,options:{pointLabels:i}}=n;for(let s=t-1;s>=0;s--){const o=n._pointLabelItems[s];if(!o.visible)continue;const a=i.setContext(n.getPointLabelContext(s));_h(e,a,o);const r=et(a.font),{x:l,y:c,textAlign:h}=o;Wt(e,n._pointLabels[s],l,c+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"})}}function Vo(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,q);else{let o=n.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let a=1;a<i;a++)o=n.getPointPosition(a,t),s.lineTo(o.x,o.y)}}function xh(n,t,e,i,s){const o=n.ctx,a=t.circular,{color:r,lineWidth:l}=t;!a&&!i||!r||!l||e<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(s.dash),o.lineDashOffset=s.dashOffset,o.beginPath(),Vo(n,e,a,i),o.closePath(),o.stroke(),o.restore())}function kh(n,t,e){return Ft(n,{label:e,index:t,type:"pointLabel"})}class Le extends yn{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=at(fi(this.options)/2),e=this.width=this.maxWidth-t.width,i=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+i/2+t.top),this.drawingArea=Math.floor(Math.min(e,i)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=G(t)&&!isNaN(t)?t:0,this.max=G(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/fi(this.options))}generateTickLabels(t){yn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,i)=>{const s=Y(this.options.pointLabels.callback,[e,i],this);return s||s===0?s:""}).filter((e,i)=>this.chart.getDataVisibility(i))}fit(){const t=this.options;t.display&&t.pointLabels.display?dh(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){const e=q/(this._pointLabels.length||1),i=this.options.startAngle||0;return ut(t*e+mt(i))}getDistanceFromCenterForValue(t){if($(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($(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 i=e[t];return kh(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-Q+i;return{x:Math.cos(s)*e+this.xCenter,y:Math.sin(s)*e+this.yCenter,angle:s}}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:i,right:s,bottom:o}=this._pointLabelItems[t];return{left:e,top:i,right:s,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const i=this.ctx;i.save(),i.beginPath(),Vo(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),i.closePath(),i.fillStyle=t,i.fill(),i.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:i,grid:s,border:o}=e,a=this._pointLabels.length;let r,l,c;if(e.pointLabels.display&&yh(this,a),s.display&&this.ticks.forEach((h,u)=>{if(u!==0){l=this.getDistanceFromCenterForValue(h.value);const f=this.getContext(u),p=s.setContext(f),g=o.setContext(f);xh(this,p,l,a,g)}}),i.display){for(t.save(),r=a-1;r>=0;r--){const h=i.setContext(this.getPointLabelContext(r)),{color:u,lineWidth:f}=h;!f||!u||(t.lineWidth=f,t.strokeStyle=u,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),c=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&!e.reverse)return;const c=i.setContext(this.getContext(l)),h=et(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,a=t.measureText(r.label).width,t.fillStyle=c.backdropColor;const u=at(c.backdropPadding);t.fillRect(-a/2-u.left,-o-h.size/2-u.top,a+u.width,h.size+u.height)}Wt(t,r.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}D(Le,"id","radialLinear"),D(Le,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ue.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),D(Le,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),D(Le,"descriptors",{angleLines:{_fallback:"grid"}});const xn={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}},ct=Object.keys(xn);function Ro(n,t){return n-t}function No(n,t){if($(t))return null;const e=n._adapter,{parser:i,round:s,isoWeekday:o}=n._parseOpts;let a=t;return typeof i=="function"&&(a=i(a)),G(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(ee(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function Io(n,t,e,i){const s=ct.length;for(let o=ct.indexOf(n);o<s-1;++o){const a=xn[ct[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=i)return ct[o]}return ct[s-1]}function wh(n,t,e,i,s){for(let o=ct.length-1;o>=ct.indexOf(e);o--){const a=ct[o];if(xn[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return ct[e?ct.indexOf(e):0]}function Mh(n){for(let t=ct.indexOf(n)+1,e=ct.length;t<e;++t)if(xn[ct[t]].common)return ct[t]}function $o(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=Ln(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function Sh(n,t,e,i){const s=n._adapter,o=+s.startOf(t[0].value,i),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+s.add(r,1,i))l=e[r],l>=0&&(t[l].major=!0);return t}function zo(n,t,e){const i=[],s={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],s[r]=a,i.push({value:r,major:!1});return o===0||!e?i:Sh(n,i,s,e)}class Te extends Kt{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 i=t.time||(t.time={}),s=this._adapter=new Ll._date(t.adapters.date);s.init(e),ue(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:No(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=G(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=G(o)&&!isNaN(o)?o:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s=i.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const o=this.min,a=this.max,r=sr(s,o,a);return this._unit=e.unit||(i.autoSkip?Io(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):wh(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Mh(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),zo(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,i=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=nt(e,0,a),i=nt(i,0,a),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,s=this.options,o=s.time,a=o.unit||Io(o.minUnit,e,i,this._getLabelCapacity(e)),r=R(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=ee(l)||l===!0,h={};let u=e,f,p;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":a),t.diff(i,e,a)>1e5*r)throw new Error(e+" and "+i+" are too far apart with stepSize of "+r+" "+a);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(f=u,p=0;f<i;f=+t.add(f,r,a),p++)$o(h,f,g);return(f===i||s.bounds==="ticks"||p===1)&&$o(h,f,g),Object.keys(h).sort(Ro).map(m=>+m)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,a=e||s[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,i,s){const o=this.options,a=o.ticks.callback;if(a)return Y(a,[t,e,i],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&r[l],u=c&&r[c],f=i[e],p=c&&u&&f&&f.major;return this._adapter.format(t,s||(p?u:h))}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e<i;++e)s=t[e],s.label=this._tickFormatFunction(s.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,i=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+i)*e.factor)}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+i*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,i=this.ctx.measureText(t).width,s=mt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(s),a=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*o+r*a,h:i*a+r*o}}_getLabelCapacity(t){const e=this.options.time,i=e.displayFormats,s=i[e.unit]||i.millisecond,o=this._tickFormatFunction(t,0,zo(this,[t],this._majorUnit),s),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,i;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,i=s.length;e<i;++e)t=t.concat(s[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,i;if(t.length)return t;const s=this.getLabels();for(e=0,i=s.length;e<i;++e)t.push(No(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ii(t.sort(Ro))}}D(Te,"id","time"),D(Te,"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 kn(n,t,e){let i=0,s=n.length-1,o,a,r,l;e?(t>=n[i].pos&&t<=n[s].pos&&({lo:i,hi:s}=vt(n,"pos",t)),{pos:o,time:r}=n[i],{pos:a,time:l}=n[s]):(t>=n[i].time&&t<=n[s].time&&({lo:i,hi:s}=vt(n,"time",t)),{time:o,pos:r}=n[i],{time:a,pos:l}=n[s]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class pi extends Te{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=kn(e,this.min),this._tableRange=kn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let a,r,l,c,h;for(a=0,r=t.length;a<r;++a)c=t[a],c>=e&&c<=i&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(a=0,r=s.length;a<r;++a)h=s[a+1],l=s[a-1],c=s[a],Math.round((h+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){const t=this.min,e=this.max;let i=super.getDataTimestamps();return(!i.includes(t)||!i.length)&&i.splice(0,0,t),(!i.includes(e)||i.length===1)&&i.push(e),i.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(kn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return kn(this._table,i*this._tableRange+this._minPos,!0)}}D(pi,"id","timeseries"),D(pi,"defaults",Te.defaults);var vh=Object.freeze({__proto__:null,CategoryScale:di,LinearScale:hi,LogarithmicScale:ui,RadialLinearScale:Le,TimeScale:Te,TimeSeriesScale:pi});const Ch=[Al,ld,nh,vh];Et.register(...Ch);const Dh={class:"px-24 py-16"},Eh={class:"flex flex-col gap-8"},Ph={class:"fm-color-typo-primary fm-typo-body-lg-400"},Oh={class:"fm-color-typo-secondary fm-typo-body-md-400"},Bh={class:"px-6"},Ah=d.defineComponent({__name:"FmLine",props:{name:{},paragraph:{},datasets:{},xAxis:{}},setup(n){const t=n,e=d.ref(null);let i=null;d.watch([()=>t.xAxis,()=>t.datasets],()=>{i&&(i.data.datasets=t.datasets,i.data.labels=t.xAxis.categories,i.update())});function s(c,h){const u=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(c);if(u)return`rgba(${parseInt(u[1],16)},${parseInt(u[2],16)},${parseInt(u[3],16)},${h})`;if(c.startsWith("rgb")){const f=c.split(",");if(f.length===3)return[...f.slice(0,2),f[2].replace(")",`,${h})`)].join(",");if(f.length===4)return[...f.slice(0,3),`${h})`].join(",")}return""}function o(c){const h=getComputedStyle(document.documentElement).getPropertyValue(`--${c}`)||c;return h.startsWith("rgb")||h.startsWith("#")?h:null}function a({context:c,color:h}){const{ctx:u,chartArea:f}=c.chart;if(!f)return;const p=u==null?void 0:u.createLinearGradient(0,0,0,f.height);return p.addColorStop(0,s(h,.5)),p.addColorStop(1,s(h,0)),p}const r=d.computed(()=>({labels:t.xAxis.categories,datasets:t.datasets.map(c=>{const h=o(c.color)??"";return{...c,backgroundColor:h?u=>a({context:u,color:h}):"",borderColor:h,borderDash:c.dash?[5,5]:void 0,tension:.1}})}));function l(){e.value&&(i=new Et(e.value,{type:"line",data:r.value,options:{plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},beginAtZero:!0},y:{grid:{display:!0},beginAtZero:!0}},elements:{line:{borderWidth:1.5},point:{radius:0,hitRadius:30,hoverRadius:6,hoverBackgroundColor:"#FFFFFF",hoverBorderWidth:3}}}}))}return d.onMounted(()=>{l()}),(c,h)=>(d.openBlock(),d.createElementBlock("div",Dh,[d.createElementVNode("div",Eh,[d.createElementVNode("div",Ph,d.toDisplayString(c.name),1),d.createElementVNode("div",Oh,d.toDisplayString(c.paragraph),1)]),d.createElementVNode("div",Bh,[d.createElementVNode("canvas",{ref_key:"canvas",ref:e},null,512)])]))}});var Lh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Th(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Wo={exports:{}};(function(n,t){(function(e,i){n.exports=i()})(Lh,function(){var e=1e3,i=6e4,s=36e5,o="millisecond",a="second",r="minute",l="hour",c="day",h="week",u="month",f="quarter",p="year",g="date",m="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,_=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(L){var S=["th","st","nd","rd"],M=L%100;return"["+L+(S[(M-20)%10]||S[M]||S[0])+"]"}},k=function(L,S,M){var O=String(L);return!O||O.length>=S?L:""+Array(S+1-O.length).join(M)+L},w={s:k,z:function(L){var S=-L.utcOffset(),M=Math.abs(S),O=Math.floor(M/60),P=M%60;return(S<=0?"+":"-")+k(O,2,"0")+":"+k(P,2,"0")},m:function L(S,M){if(S.date()<M.date())return-L(M,S);var O=12*(M.year()-S.year())+(M.month()-S.month()),P=S.clone().add(O,u),T=M-P<0,V=S.clone().add(O+(T?-1:1),u);return+(-(O+(M-P)/(T?P-V:V-P))||0)},a:function(L){return L<0?Math.ceil(L)||0:Math.floor(L)},p:function(L){return{M:u,y:p,w:h,d:c,D:g,h:l,m:r,s:a,ms:o,Q:f}[L]||String(L||"").toLowerCase().replace(/s$/,"")},u:function(L){return L===void 0}},x="en",v={};v[x]=y;var C="$isDayjsObject",E=function(L){return L instanceof N||!(!L||!L[C])},F=function L(S,M,O){var P;if(!S)return x;if(typeof S=="string"){var T=S.toLowerCase();v[T]&&(P=T),M&&(v[T]=M,P=T);var V=S.split("-");if(!P&&V.length>1)return L(V[0])}else{var W=S.name;v[W]=S,P=W}return!O&&P&&(x=P),P||!O&&x},A=function(L,S){if(E(L))return L.clone();var M=typeof S=="object"?S:{};return M.date=L,M.args=arguments,new N(M)},B=w;B.l=F,B.i=E,B.w=function(L,S){return A(L,{locale:S.$L,utc:S.$u,x:S.$x,$offset:S.$offset})};var N=function(){function L(M){this.$L=F(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[C]=!0}var S=L.prototype;return S.parse=function(M){this.$d=function(O){var P=O.date,T=O.utc;if(P===null)return new Date(NaN);if(B.u(P))return new Date;if(P instanceof Date)return new Date(P);if(typeof P=="string"&&!/Z$/i.test(P)){var V=P.match(b);if(V){var W=V[2]-1||0,H=(V[7]||"0").substring(0,3);return T?new Date(Date.UTC(V[1],W,V[3]||1,V[4]||0,V[5]||0,V[6]||0,H)):new Date(V[1],W,V[3]||1,V[4]||0,V[5]||0,V[6]||0,H)}}return new Date(P)}(M),this.init()},S.init=function(){var M=this.$d;this.$y=M.getFullYear(),this.$M=M.getMonth(),this.$D=M.getDate(),this.$W=M.getDay(),this.$H=M.getHours(),this.$m=M.getMinutes(),this.$s=M.getSeconds(),this.$ms=M.getMilliseconds()},S.$utils=function(){return B},S.isValid=function(){return this.$d.toString()!==m},S.isSame=function(M,O){var P=A(M);return this.startOf(O)<=P&&P<=this.endOf(O)},S.isAfter=function(M,O){return A(M)<this.startOf(O)},S.isBefore=function(M,O){return this.endOf(O)<A(M)},S.$g=function(M,O,P){return B.u(M)?this[O]:this.set(P,M)},S.unix=function(){return Math.floor(this.valueOf()/1e3)},S.valueOf=function(){return this.$d.getTime()},S.startOf=function(M,O){var P=this,T=!!B.u(O)||O,V=B.p(M),W=function(Jt,dt){var Nt=B.w(P.$u?Date.UTC(P.$y,dt,Jt):new Date(P.$y,dt,Jt),P);return T?Nt:Nt.endOf(c)},H=function(Jt,dt){return B.w(P.toDate()[Jt].apply(P.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(dt)),P)},K=this.$W,J=this.$M,it=this.$D,gt="set"+(this.$u?"UTC":"");switch(V){case p:return T?W(1,0):W(31,11);case u:return T?W(1,J):W(0,J+1);case h:var Zt=this.$locale().weekStart||0,Ve=(K<Zt?K+7:K)-Zt;return W(T?it-Ve:it+(6-Ve),J);case c:case g:return H(gt+"Hours",0);case l:return H(gt+"Minutes",1);case r:return H(gt+"Seconds",2);case a:return H(gt+"Milliseconds",3);default:return this.clone()}},S.endOf=function(M){return this.startOf(M,!1)},S.$set=function(M,O){var P,T=B.p(M),V="set"+(this.$u?"UTC":""),W=(P={},P[c]=V+"Date",P[g]=V+"Date",P[u]=V+"Month",P[p]=V+"FullYear",P[l]=V+"Hours",P[r]=V+"Minutes",P[a]=V+"Seconds",P[o]=V+"Milliseconds",P)[T],H=T===c?this.$D+(O-this.$W):O;if(T===u||T===p){var K=this.clone().set(g,1);K.$d[W](H),K.init(),this.$d=K.set(g,Math.min(this.$D,K.daysInMonth())).$d}else W&&this.$d[W](H);return this.init(),this},S.set=function(M,O){return this.clone().$set(M,O)},S.get=function(M){return this[B.p(M)]()},S.add=function(M,O){var P,T=this;M=Number(M);var V=B.p(O),W=function(J){var it=A(T);return B.w(it.date(it.date()+Math.round(J*M)),T)};if(V===u)return this.set(u,this.$M+M);if(V===p)return this.set(p,this.$y+M);if(V===c)return W(1);if(V===h)return W(7);var H=(P={},P[r]=i,P[l]=s,P[a]=e,P)[V]||1,K=this.$d.getTime()+M*H;return B.w(K,this)},S.subtract=function(M,O){return this.add(-1*M,O)},S.format=function(M){var O=this,P=this.$locale();if(!this.isValid())return P.invalidDate||m;var T=M||"YYYY-MM-DDTHH:mm:ssZ",V=B.z(this),W=this.$H,H=this.$m,K=this.$M,J=P.weekdays,it=P.months,gt=P.meridiem,Zt=function(dt,Nt,Re,Mn){return dt&&(dt[Nt]||dt(O,T))||Re[Nt].slice(0,Mn)},Ve=function(dt){return B.s(W%12||12,dt,"0")},Jt=gt||function(dt,Nt,Re){var Mn=dt<12?"AM":"PM";return Re?Mn.toLowerCase():Mn};return T.replace(_,function(dt,Nt){return Nt||function(Re){switch(Re){case"YY":return String(O.$y).slice(-2);case"YYYY":return B.s(O.$y,4,"0");case"M":return K+1;case"MM":return B.s(K+1,2,"0");case"MMM":return Zt(P.monthsShort,K,it,3);case"MMMM":return Zt(it,K);case"D":return O.$D;case"DD":return B.s(O.$D,2,"0");case"d":return String(O.$W);case"dd":return Zt(P.weekdaysMin,O.$W,J,2);case"ddd":return Zt(P.weekdaysShort,O.$W,J,3);case"dddd":return J[O.$W];case"H":return String(W);case"HH":return B.s(W,2,"0");case"h":return Ve(1);case"hh":return Ve(2);case"a":return Jt(W,H,!0);case"A":return Jt(W,H,!1);case"m":return String(H);case"mm":return B.s(H,2,"0");case"s":return String(O.$s);case"ss":return B.s(O.$s,2,"0");case"SSS":return B.s(O.$ms,3,"0");case"Z":return V}return null}(dt)||V.replace(":","")})},S.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},S.diff=function(M,O,P){var T,V=this,W=B.p(O),H=A(M),K=(H.utcOffset()-this.utcOffset())*i,J=this-H,it=function(){return B.m(V,H)};switch(W){case p:T=it()/12;break;case u:T=it();break;case f:T=it()/3;break;case h:T=(J-K)/6048e5;break;case c:T=(J-K)/864e5;break;case l:T=J/s;break;case r:T=J/i;break;case a:T=J/e;break;default:T=J}return P?T:B.a(T)},S.daysInMonth=function(){return this.endOf(u).$D},S.$locale=function(){return v[this.$L]},S.locale=function(M,O){if(!M)return this.$L;var P=this.clone(),T=F(M,O,!0);return T&&(P.$L=T),P},S.clone=function(){return B.w(this.$d,this)},S.toDate=function(){return new Date(this.valueOf())},S.toJSON=function(){return this.isValid()?this.toISOString():null},S.toISOString=function(){return this.$d.toISOString()},S.toString=function(){return this.$d.toUTCString()},L}(),tt=N.prototype;return A.prototype=tt,[["$ms",o],["$s",a],["$m",r],["$H",l],["$W",c],["$M",u],["$y",p],["$D",g]].forEach(function(L){tt[L[1]]=function(S){return this.$g(S,L[0],L[1])}}),A.extend=function(L,S){return L.$i||(L(S,N,A),L.$i=!0),A},A.locale=F,A.isDayjs=E,A.unix=function(L){return A(1e3*L)},A.en=v[x],A.Ls=v,A.p={},A})})(Wo);var Fh=Wo.exports;const ae=Th(Fh),Vh={class:"relative"},Rh={class:"w-full"},Nh={class:"flex h-10 justify-between p-2"},Ih={class:"fm-typo-body-lg-400"},$h={class:"flex gap-1 items-center justify-center"},zh={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Wh=["onClick"],jh=d.defineComponent({__name:"FmDatePicker",props:{label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=d.ref([]),s=d.ref(null),o=d.ref(!1),a=d.ref(ae()),r=d.ref(null),l=d.ref(null),c=m=>{s.value=m,t("update:modelValue",m.format("YYYY-MM-DD")),o.value=!1},h=()=>{i.value=[];const m=ae(a.value).startOf("month"),b=m.endOf("month"),_=m.month();let y=m.startOf("week"),k=[];for(;y.isBefore(b.endOf("week"));)y.day()===0&&k.length>0&&(i.value.push(k),k=[]),k.push({date:y,isCurrentMonth:y.month()===_}),y=y.add(1,"day");k.length>0&&i.value.push(k)},u=()=>{e.disabled||(o.value=!o.value,requestAnimationFrame(()=>{var b;const m=(b=r.value)==null?void 0:b.getBoundingClientRect();l.value.style.top=`${m.height+4}px`,l.value.style.left="0px"}))},f=m=>{const b=m.path||m.composedPath();for(const _ of b)if(_==r.value||_==l.value)return;o.value=!1},p=m=>{a.value=m?a.value.add(1,"month"):a.value.subtract(1,"month"),h()},g=d.computed(()=>Array.from(Array(7),(m,b)=>ae().day(b).format("ddd")));return d.onMounted(()=>{window.addEventListener("click",f),h()}),d.onUnmounted(()=>{window.removeEventListener("click",f)}),(m,b)=>{var _;return d.openBlock(),d.createElementBlock("div",Vh,[d.createElementVNode("label",{ref_key:"buttonEl",ref:r,onClick:u},[d.createElementVNode("div",{class:d.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},d.toDisplayString(e.label),3),d.createElementVNode("div",{class:d.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[d.createElementVNode("div",{class:d.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":s.value?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},d.toDisplayString(((_=s.value)==null?void 0:_.format("D MMM YYYY"))??"DD MM YYYY"),3)],2)],512),d.createElementVNode("div",{ref_key:"dropdownEl",ref:l,class:d.normalizeClass(["absolute bg-fm-color-white fm-calendar gap-6 p-3 rounded-lg shadow-light-neutral-300 w-[360px]",[o.value?"block":"hidden"]])},[d.createElementVNode("div",Rh,[d.createElementVNode("div",Nh,[d.createElementVNode("div",Ih,d.toDisplayString(a.value.format("MMMM YYYY")),1),d.createElementVNode("div",$h,[d.createVNode(st,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[0]||(b[0]=()=>p(!1))}),d.createVNode(st,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:b[1]||(b[1]=()=>p(!0))})])]),d.createElementVNode("div",null,[d.createElementVNode("div",zh,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(g.value,y=>(d.openBlock(),d.createElementBlock("div",{key:y,class:"fm-calendar__cell"},d.toDisplayString(y),1))),128))]),d.createElementVNode("div",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(y,k)=>(d.openBlock(),d.createElementBlock("div",{key:k,class:"fm-calendar__row fm-typo-body-lg-400"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(y,w=>(d.openBlock(),d.createElementBlock("div",{key:w.date.date(),class:"fm-calendar__cell"},[w.isCurrentMonth?(d.openBlock(),d.createElementBlock("button",{key:0,class:d.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":s.value===w.date}]),onClick:()=>c(w.date)},d.toDisplayString(w.date.date()),11,Wh)):d.createCommentVNode("",!0)]))),128))]))),128))])])])],2)])}}}),jf="",Hh=ft(jh,[["__scopeId","data-v-2698ae54"]]),Yh=n=>(d.pushScopeId("data-v-02a11da6"),n=n(),d.popScopeId(),n),Uh={class:"flex gap-1 items-center relative w-full"},Xh=Yh(()=>d.createElementVNode("div",{class:"fm-typo-body-lg-400 h-6 mt-7 shrink-0 text-center text-fm-color-typo-primary w-6"}," to ",-1)),qh={class:"w-full"},Kh={class:"flex h-10 justify-between p-2"},Gh={class:"fm-typo-body-lg-400"},Zh={class:"flex gap-1 items-center justify-center"},Jh={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Qh=["onClick"],tu=d.defineComponent({__name:"FmDateRangePicker",props:{label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=d.ref([]),s=d.ref({startDate:null,endDate:null}),o=d.ref(!1),a=d.ref(ae()),r=d.ref(null),l=d.ref(null),c=d.ref(null),h=_=>{var y,k;if(s.value.startDate&&s.value.endDate){s.value={startDate:null,endDate:null},t("update:modelValue",{startDate:null,endDate:null});return}if(!s.value.startDate&&!s.value.endDate)s.value.startDate=_;else if(_.isBefore(s.value.startDate)){const w=s.value.startDate;s.value={startDate:_,endDate:w}}else s.value.endDate=_;t("update:modelValue",{startDate:(y=s.value.startDate)==null?void 0:y.format("YYYY-MM-DD"),endDate:(k=s.value.endDate)==null?void 0:k.format("YYYY-MM-DD")}),s.value.startDate&&s.value.endDate&&(o.value=!1)},u=()=>{i.value=[];const _=ae(a.value).startOf("month"),y=_.endOf("month"),k=_.month();let w=_.startOf("week"),x=[];for(;w.isBefore(y.endOf("week"));)w.day()===0&&x.length>0&&(i.value.push(x),x=[]),x.push({date:w,isCurrentMonth:w.month()===k}),w=w.add(1,"day");x.length>0&&i.value.push(x)},f=()=>{e.disabled||(o.value=!o.value,requestAnimationFrame(()=>{var y;const _=(y=r.value)==null?void 0:y.getBoundingClientRect();c.value.style.top=`${_.height+4}px`,c.value.style.left="0px"}))},p=_=>{const y=_.path||_.composedPath();for(const k of y)if(k==r.value||k==l.value||k==c.value)return;o.value=!1},g=_=>{a.value=_?a.value.add(1,"month"):a.value.subtract(1,"month"),u()},m=d.computed(()=>Array.from(Array(7),(_,y)=>ae().day(y).format("ddd"))),b=_=>{var y,k,w,x;return{"fm-calendar__cell__button--selected":((y=s.value.startDate)==null?void 0:y.isSame(_))&&!s.value.endDate||((k=s.value.endDate)==null?void 0:k.isSame(_))&&!s.value.startDate,"fm-calendar__cell__button--selected-start":((w=s.value.startDate)==null?void 0:w.isSame(_))&&s.value.endDate,"fm-calendar__cell__button--selected-end":((x=s.value.endDate)==null?void 0:x.isSame(_))&&s.value.startDate,"fm-calendar__cell__button--selected-between":s.value.startDate&&s.value.endDate&&_.isAfter(s.value.startDate)&&_.isBefore(s.value.endDate)}};return d.onMounted(()=>{window.addEventListener("click",p),u()}),d.onUnmounted(()=>{window.removeEventListener("click",p)}),(_,y)=>{var k,w;return d.openBlock(),d.createElementBlock("div",Uh,[d.createElementVNode("label",{ref_key:"startButtonEl",ref:r,class:"w-full",onClick:f},[d.createElementVNode("div",{class:d.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},d.toDisplayString(e.label),3),d.createElementVNode("div",{class:d.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[d.createElementVNode("div",{class:d.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":s.value.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},d.toDisplayString(((k=s.value.startDate)==null?void 0:k.format("D MMM YYYY"))??"DD MM YYYY"),3)],2)],512),Xh,d.createElementVNode("label",{ref_key:"endButtonEl",ref:l,class:"w-full",onClick:f},[d.createElementVNode("div",{class:d.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},d.toDisplayString(e.label),3),d.createElementVNode("div",{class:d.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[d.createElementVNode("div",{class:d.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled":s.value.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},d.toDisplayString(((w=s.value.endDate)==null?void 0:w.format("D MMM YYYY"))??"DD MM YYYY"),3)],2)],512),d.createElementVNode("div",{ref_key:"dropdownEl",ref:c,class:d.normalizeClass(["absolute bg-fm-color-white fm-calendar gap-6 p-3 rounded-lg shadow-light-300 w-[360px]",[o.value?"block":"hidden"]])},[d.createElementVNode("div",qh,[d.createElementVNode("div",Kh,[d.createElementVNode("div",Gh,d.toDisplayString(a.value.format("MMMM YYYY")),1),d.createElementVNode("div",Zh,[d.createVNode(st,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:y[0]||(y[0]=()=>g(!1))}),d.createVNode(st,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:y[1]||(y[1]=()=>g(!0))})])]),d.createElementVNode("div",null,[d.createElementVNode("div",Jh,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(m.value,x=>(d.openBlock(),d.createElementBlock("div",{key:x,class:"fm-calendar__cell"},d.toDisplayString(x),1))),128))]),d.createElementVNode("div",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(i.value,(x,v)=>(d.openBlock(),d.createElementBlock("div",{key:v,class:"fm-calendar__row fm-typo-body-lg-400"},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(x,C=>(d.openBlock(),d.createElementBlock("div",{key:C.date.date(),class:"fm-calendar__cell"},[C.isCurrentMonth?(d.openBlock(),d.createElementBlock("button",{key:0,class:d.normalizeClass(["fm-calendar__cell__button",b(C.date)]),onClick:()=>h(C.date)},d.toDisplayString(C.date.date()),11,Qh)):d.createCommentVNode("",!0)]))),128))]))),128))])])])],2)])}}}),Hf="",eu=ft(tu,[["__scopeId","data-v-02a11da6"]]),nu={class:"fm-checkbox"},iu={class:"fm-checkbox--wrapper"},su={class:"fm-checkbox__input--container"},ou=["checked","disabled","indeterminate"],au={key:0,class:"fm-checkbox__label-container"},ru={class:"fm-typo-body-lg-400"},lu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},jo=d.defineComponent({__name:"FmCheckbox",props:{modelValue:{type:Boolean},label:{},sublabel:{default:""},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=d.computed(()=>e.indeterminate?"remove":e.modelValue?"check_small":"");function s(){e.disabled||t("update:modelValue",!e.modelValue)}return(o,a)=>(d.openBlock(),d.createElementBlock("div",nu,[d.createElementVNode("label",iu,[d.createElementVNode("div",su,[d.createElementVNode("input",{class:d.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":o.modelValue}),type:"checkbox",checked:e.modelValue,disabled:e.disabled,indeterminate:e.indeterminate,onClick:s},null,10,ou),e.indeterminate||e.modelValue?(d.openBlock(),d.createBlock(st,{key:0,class:"fm-checkbox__input--checkmark",name:i.value,size:"md",color:"#FFFFFF"},null,8,["name"])):d.createCommentVNode("",!0)]),e.label?(d.openBlock(),d.createElementBlock("div",au,[d.renderSlot(o.$slots,"label"),d.createElementVNode("div",ru,d.toDisplayString(e.label),1),e.sublabel?(d.openBlock(),d.createElementBlock("div",lu,d.toDisplayString(e.sublabel),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)])]))}}),Yf="",cu={class:"fm-radio-btn"},du={class:"fm-radio-btn__input--container"},hu=["value","disabled","checked"],uu={class:"py-8"},fu={class:"fm-typo-body-lg-400"},pu={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},gu=d.defineComponent({__name:"FmRadio",props:{modelValue:{},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n){return(t,e)=>{const i=d.resolveDirective("wave");return d.openBlock(),d.createElementBlock("div",cu,[d.createElementVNode("label",{class:"cursor-pointer fm-radio-btn--wrapper",onClick:e[0]||(e[0]=s=>t.$emit("update:modelValue",t.value))},[d.withDirectives((d.openBlock(),d.createElementBlock("div",du,[d.createElementVNode("input",{class:"fm-radio-btn__input--btn",type:"radio",value:t.value,disabled:t.disabled,checked:t.value===t.modelValue},null,8,hu)])),[[i,!t.disabled]]),d.createElementVNode("div",uu,[d.renderSlot(t.$slots,"label",{},void 0,!0),d.createElementVNode("div",fu,d.toDisplayString(t.label),1),t.sublabel?(d.openBlock(),d.createElementBlock("div",pu,d.toDisplayString(t.sublabel),1)):d.createCommentVNode("",!0)])])])}}}),Uf="",mu=ft(gu,[["__scopeId","data-v-f55cf769"]]),bu={class:"relative"},_u=d.defineComponent({__name:"FmDropdown",props:{isOpen:{type:Boolean,default:!1},placement:{default:"bottom-left"},disabled:{type:Boolean,default:!1}},emits:["dropdown-changed"],setup(n,{emit:t}){const e=n,i=d.ref(!1),s=d.ref(null),o=d.ref(null),a=()=>{e.disabled||(i.value=!i.value,requestAnimationFrame(()=>{var h,u;const l=(h=o.value)==null?void 0:h.getBoundingClientRect(),c=(u=s.value)==null?void 0:u.getBoundingClientRect();e.placement.includes("bottom")?o.value.style.top=`${c.height+4}px`:e.placement.includes("top")&&(o.value.style.top=`${-l.height-4}px`),e.placement.includes("left")?o.value.style.left="0px":e.placement.includes("center")?o.value.style.left=`${c.width/2-l.width/2}px`:e.placement.includes("right")&&(o.value.style.right="0px")}),t("dropdown-changed",i.value))},r=l=>{if(!i.value)return;const c=l.path||l.composedPath();for(const h of c)if(h==s.value||h==o.value)return;i.value=!1,t("dropdown-changed",i.value)};return d.watch(()=>e.isOpen,l=>i.value=l),d.onMounted(()=>{i.value=e.isOpen,window.addEventListener("click",r)}),d.onUnmounted(()=>{window.removeEventListener("click",r)}),(l,c)=>(d.openBlock(),d.createElementBlock("div",bu,[d.createElementVNode("div",{ref_key:"buttonEl",ref:s,class:"fm-dropdown",onClick:a},[d.renderSlot(l.$slots,"dropdown-button",{},void 0,!0)],512),d.createElementVNode("div",{ref_key:"dropdownEl",ref:o,class:d.normalizeClass({"fm-dropdown__content":!0,"fm-dropdown__content--opened":i.value})},[d.renderSlot(l.$slots,"dropdown-content",{},void 0,!0)],2)]))}}),Xf="",Ho=ft(_u,[["__scopeId","data-v-11da7be1"]]),qf="",yu={},xu={class:"fm-menu"};function ku(n,t){return d.openBlock(),d.createElementBlock("div",xu,[d.renderSlot(n.$slots,"default",{},void 0,!0)])}const Yo=ft(yu,[["render",ku],["__scopeId","data-v-46812801"]]),wu={class:"fm-menu-item--left"},Mu={key:0,class:"fm-menu-item--right"},Su=d.defineComponent({__name:"FmMenuItem",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},icon:{default:""},expandable:{type:Boolean,default:!1},hasCheckbox:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},dividerPlacement:{default:null}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=o=>{o.preventDefault(),!e.disabled&&t("update:modelValue",!e.modelValue)},s=()=>{t("update:modelValue",e.modelValue)};return(o,a)=>(d.openBlock(),d.createElementBlock("div",null,[d.createElementVNode("div",{class:d.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":o.modelValue&&!o.hasCheckbox,"fm-menu-item--disabled":o.disabled}),onClick:i},[d.createElementVNode("div",wu,[!o.hasCheckbox&&o.icon?(d.openBlock(),d.createBlock(st,{key:0,name:o.icon,size:"md",color:o.disabled?"#C7C7CC":o.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","color"])):d.createCommentVNode("",!0),o.hasCheckbox?(d.openBlock(),d.createBlock(jo,{key:1,"model-value":o.modelValue,name:"something",label:"",sublabel:"",value:"",indeterminate:!1,disabled:o.disabled,"onUpdate:modelValue":s,onClick:a[0]||(a[0]=r=>r.preventDefault())},null,8,["model-value","disabled"])):d.createCommentVNode("",!0),d.createElementVNode("div",null,[d.renderSlot(o.$slots,"label",{},void 0,!0),d.createElementVNode("div",{class:d.normalizeClass(`fm-typo-body-lg-400 ${o.disabled?"fm-color-typo-disabled":"fm-color-typo-primary"}`)},d.toDisplayString(o.label),3),o.sublabel?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(`fm-typo-body-md-400 ${o.disabled?"fm-color-typo-disabled":"fm-color-typo-secondary"}`)},d.toDisplayString(o.sublabel),3)):d.createCommentVNode("",!0)])]),o.expandable?(d.openBlock(),d.createElementBlock("div",Mu,[d.createVNode(st,{name:"chevron_right",size:"md",color:o.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):d.createCommentVNode("",!0)],2)]))}}),Kf="",Uo=ft(Su,[["__scopeId","data-v-2c63be46"]]),vu={class:"fm-select"},Cu=d.defineComponent({__name:"FmSelect",props:{modelValue:{},label:{},items:{},disabled:{type:Boolean,default:!1},multiselect:{type:Boolean,default:!1},placement:{default:"bottom-left"},placeholder:{default:""}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=d.ref(!1),s=d.ref([]),o=(r,l)=>{if(e.multiselect){let c=[];r?(c=[...d.toRaw(e.modelValue),l.value],s.value=[...s.value,l]):(c=[...e.modelValue],c=c.filter(h=>JSON.stringify(d.toRaw(h))!==JSON.stringify(l.value)),s.value=s.value.filter(h=>h.label!==l.label)),t("update:modelValue",c)}else i.value=!1,s.value=[l],t("update:modelValue",l.value)},a=d.computed(()=>{const r=s.value.map(l=>l.label).join(", ");return r===""?e.placeholder:r});return(r,l)=>(d.openBlock(),d.createBlock(Ho,{disabled:r.disabled,"is-open":i.value,placement:r.placement,onDropdownChanged:l[0]||(l[0]=c=>i.value=c)},{"dropdown-button":d.withCtx(()=>[d.createElementVNode("div",vu,[d.createElementVNode("label",{class:d.normalizeClass({"cursor-not-allowed":r.disabled})},[d.renderSlot(r.$slots,"label",{},void 0,!0),d.createElementVNode("div",{class:d.normalizeClass({"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!r.disabled,"text-fm-color-typo-disabled":r.disabled})},d.toDisplayString(r.label),3),d.createElementVNode("div",{class:d.normalizeClass({"fm-select__container":!0,"fm-select__container--expanded":i.value,"fm-select__container--disabled":r.disabled})},[d.createElementVNode("div",{class:d.normalizeClass({"fm-typo-body-lg-400 w-full h-full overflow-hidden text-ellipsis whitespace-nowrap":!0,"text-fm-color-typo-tertiary":!r.modelValue,"text-fm-color-typo-primary":!!r.modelValue})},d.toDisplayString(a.value),3),d.createVNode(st,{name:i.value?"expand_less":"expand_more",size:"md",color:r.disabled?"#C7C7CC":"black"},null,8,["name","color"])],2)],2)])]),"dropdown-content":d.withCtx(()=>[d.createVNode(Yo,{class:"w-[280px]"},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.items,c=>(d.openBlock(),d.createBlock(Uo,{key:c.value,"has-checkbox":r.multiselect,label:c.label,value:c.value,"model-value":s.value.map(h=>h.label).includes(c.label),"onUpdate:modelValue":h=>o(h,c)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))]),_:1})]),_:3},8,["disabled","is-open","placement"]))}}),Gf="",Du=ft(Cu,[["__scopeId","data-v-fbd57494"]]),Eu={class:"cursor-pointer fm-switch__container"},Pu={key:0},Ou={class:"fm-typo-body-lg-400"},Bu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Au={class:"fm-switch__input--container"},Lu=["checked","value","disabled"],Tu={key:1},Fu={class:"fm-typo-body-lg-400"},Vu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Ru=d.defineComponent({__name:"FmSwitch",props:{modelValue:{type:Boolean},label:{default:""},sublabel:{default:""},labelPlacement:{default:"left"},value:{},disabled:{type:Boolean,default:!1},showIcon:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=()=>{e.disabled||t("update:modelValue",!e.modelValue)};return(s,o)=>(d.openBlock(),d.createElementBlock("label",Eu,[s.labelPlacement==="left"?(d.openBlock(),d.createElementBlock("div",Pu,[d.renderSlot(s.$slots,"label",{},void 0,!0),d.createElementVNode("div",Ou,d.toDisplayString(s.label),1),s.sublabel?(d.openBlock(),d.createElementBlock("div",Bu,d.toDisplayString(s.sublabel),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0),d.createElementVNode("div",Au,[d.createElementVNode("input",{checked:s.modelValue,class:"fm-switch__input--btn",type:"checkbox",value:s.value,disabled:s.disabled,onClick:i},null,8,Lu),d.createElementVNode("div",{class:d.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":s.showIcon})},[s.showIcon?(d.openBlock(),d.createBlock(st,{key:0,name:s.modelValue?"check":"close",size:"sm",color:s.disabled?"#C7C7CC":s.modelValue?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):d.createCommentVNode("",!0)],2)]),s.labelPlacement==="right"?(d.openBlock(),d.createElementBlock("div",Tu,[d.createElementVNode("div",Fu,d.toDisplayString(s.label),1),s.sublabel?(d.openBlock(),d.createElementBlock("div",Vu,d.toDisplayString(s.sublabel),1)):d.createCommentVNode("",!0)])):d.createCommentVNode("",!0)]))}}),Zf="",Nu=ft(Ru,[["__scopeId","data-v-77ad1e00"]]);function Iu(){const n=d.ref([]);function t(i,s){const o=[];if(s&&s.length>0)for(const a of s){const l=(typeof a=="function"?a:()=>a)(i);l!==!0&&o.push(l)}return n.value=o,n.value}return{validate:t,getErrorMessages:()=>n.value}}const $u={class:"fm-text-field"},zu={class:"fm-text-field--label"},Wu=["value","inputMode","type","placeholder","required","minlength","maxlength","disabled","readOnly"],ju={class:"fm-color-typo-secondary fm-text-field__helper-container fm-typo-body-sm-400"},Hu={class:"fm-text-field__helper__icon"};var Xo=(n=>(n.required="*",n.optional="(optional)",n))(Xo||{}),qo=(n=>(n.success="check_circle",n.warning="warning",n.error="error",n))(qo||{}),Ko=(n=>(n.success="#34C759",n.warning="#FF9500",n.error="#FF3B30",n))(Ko||{});const Yu=d.defineComponent({__name:"FmTextField",props:{label:{default:""},modelValue:{default:""},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{default:""},helperText:{default:""},minLength:{default:0},maxLength:{default:NaN},inputmode:{default:"text"},readonly:{type:Boolean,default:!1},inputState:{default:"default"},labelMark:{default:"none"},leadingIcon:{default:()=>({name:"",color:""})},trailingIcon:{default:()=>({name:"",color:""})},rules:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=d.ref(!1),s=d.ref([]),{validate:o}=Iu(),a=r=>{const l=o(r.target.value,e.rules);s.value=l,t("update:modelValue",r.target.value)};return(r,l)=>(d.openBlock(),d.createElementBlock("label",$u,[d.createElementVNode("div",null,[d.createElementVNode("div",zu,[d.renderSlot(r.$slots,"label"),d.createElementVNode("span",{class:d.normalizeClass({"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!r.disabled,"text-fm-color-typo-disabled":r.disabled})},d.toDisplayString(r.label),3),r.labelMark!=="none"?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass({"fm-color-typo-tertiary fm-typo-body-md-400":r.labelMark==="optional","fm-color-typo-error fm-typo-body-lg-700":r.labelMark==="required"})},d.toDisplayString(Xo[r.labelMark]),3)):d.createCommentVNode("",!0)])]),d.createElementVNode("div",{class:d.normalizeClass({"fm-text-field__container":!0,"fm-text-field__container--focused":i.value,"fm-text-field__container--invalid":r.inputState==="error"&&!!r.modelValue,"fm-text-field__container--valid":r.inputState==="success"&&!!r.modelValue,"fm-text-field__container--warning":r.inputState==="warning","fm-text-field__container--disabled":r.disabled})},[d.renderSlot(r.$slots,"prepend"),r.leadingIcon.name?(d.openBlock(),d.createBlock(st,{key:0,name:r.leadingIcon.name,size:"md",color:r.leadingIcon.color??(r.disabled?"#C7C7CC":"#1C1C1E")},null,8,["name","color"])):d.createCommentVNode("",!0),d.createElementVNode("input",{class:d.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!r.disabled,"fm-color-typo-disabled":r.disabled}),value:r.modelValue,inputMode:r.inputmode,type:r.inputmode,placeholder:r.placeholder,required:r.required,minlength:r.minLength,maxlength:r.maxLength,disabled:r.disabled,readOnly:r.readonly,onInput:a,onFocus:l[0]||(l[0]=()=>i.value=!0),onBlur:l[1]||(l[1]=()=>i.value=!1)},null,42,Wu),d.renderSlot(r.$slots,"append"),r.trailingIcon.name?(d.openBlock(),d.createBlock(st,{key:1,name:r.trailingIcon.name,size:"md",color:r.trailingIcon.color??(r.disabled?"#C7C7CC":"#1C1C1E")},null,8,["name","color"])):d.createCommentVNode("",!0)],2),d.createElementVNode("div",ju,[d.renderSlot(r.$slots,"helper-text"),d.createElementVNode("div",Hu,[r.inputState!=="default"&&r.modelValue?(d.openBlock(),d.createBlock(st,{key:0,name:qo[r.inputState],size:"sm",color:Ko[r.inputState]},null,8,["name","color"])):d.createCommentVNode("",!0),d.createElementVNode("span",{class:d.normalizeClass({"fm-color-typo-success":r.inputState==="success"&&!!r.modelValue,"fm-color-typo-warning":r.inputState==="warning"&&!!r.modelValue,"fm-color-typo-error":r.inputState==="error"&&!!r.modelValue,"fm-color-typo-disabled":r.disabled})},[s.value.length>0?(d.openBlock(!0),d.createElementBlock(d.Fragment,{key:0},d.renderList(s.value,c=>(d.openBlock(),d.createElementBlock("div",{key:c},d.toDisplayString(c),1))),128)):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.createTextVNode(d.toDisplayString(r.helperText),1)],64))],2)]),d.createElementVNode("div",{class:d.normalizeClass({"fm-color-typo-disabled":r.disabled})},d.toDisplayString(r.maxLength?`${r.modelValue.length} / ${r.maxLength}`:""),3)])]))}}),Jf="",Uu={class:"fm-textarea"},Xu={htmlFor:"{this.name}"},qu={class:"fm-textarea--label"},Ku=["value","placeholder","required","minlength","maxlength","readOnly","disabled"],Gu={class:"fm-color-typo-secondary fm-textarea__helper-container fm-typo-body-sm-400"},Zu={class:"fm-textarea__helper__icon"};var Go=(n=>(n.required="*",n.optional="(optional)",n))(Go||{}),Zo=(n=>(n.success="check_circle",n.warning="warning",n.error="error",n))(Zo||{}),Jo=(n=>(n.success="#34C759",n.warning="#FF9500",n.error="#FF3B30",n))(Jo||{});const Ju=d.defineComponent({__name:"FmTextarea",props:{label:{default:""},modelValue:{default:""},required:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{default:""},helperText:{default:""},minLength:{default:0},maxLength:{default:NaN},readonly:{type:Boolean,default:!1},inputState:{default:"default"},labelMark:{default:"none"}},emits:["update:modelValue"],setup(n,{emit:t}){const e=d.ref(!1),i=s=>{t("update:modelValue",s.target.value)};return(s,o)=>(d.openBlock(),d.createElementBlock("div",Uu,[d.createElementVNode("label",Xu,[d.createElementVNode("div",qu,[d.renderSlot(s.$slots,"label"),d.createElementVNode("span",{class:d.normalizeClass({"fm-typo-body-lg-400":!0,"fm-color-typo-primary":!s.disabled,"fm-color-typo-disabled":s.disabled})},d.toDisplayString(s.label),3),s.labelMark!=="none"?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass({"fm-color-typo-tertiary fm-typo-body-md-400":s.labelMark==="optional","fm-color-typo-error fm-typo-body-lg-700":s.labelMark==="required"})},d.toDisplayString(Go[s.labelMark]),3)):d.createCommentVNode("",!0)])]),d.createElementVNode("div",{class:d.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":e.value,"fm-textarea__container--invalid":s.inputState==="error"&&!!s.modelValue,"fm-textarea__container--valid":s.inputState==="success"&&!!s.modelValue,"fm-textarea__container--warning":s.inputState==="warning","fm-textarea__container--disabled":s.disabled})},[d.createElementVNode("textarea",{class:d.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!s.disabled,"fm-color-typo-disabled":s.disabled}),value:s.modelValue,placeholder:s.placeholder,required:s.required,minlength:s.minLength,maxlength:s.maxLength,readOnly:s.readonly,disabled:s.disabled,onInput:i,onFocus:o[0]||(o[0]=()=>e.value=!0),onBlur:o[1]||(o[1]=()=>e.value=!1)},null,42,Ku)],2),d.createElementVNode("div",Gu,[d.renderSlot(s.$slots,"helper-text"),d.createElementVNode("div",Zu,[s.inputState!=="default"&&s.modelValue?(d.openBlock(),d.createBlock(st,{key:0,name:Zo[s.inputState],size:"sm",color:Jo[s.inputState]},null,8,["name","color"])):d.createCommentVNode("",!0),d.createElementVNode("span",{class:d.normalizeClass({"fm-color-typo-success":s.inputState==="success"&&!!s.modelValue,"fm-color-typo-warning":s.inputState==="warning"&&!!s.modelValue,"fm-color-typo-error":s.inputState==="error"&&!!s.modelValue,"fm-color-typo-disabled":s.disabled})},d.toDisplayString(s.helperText),3)]),d.createElementVNode("div",{class:d.normalizeClass({"fm-color-typo-disabled":s.disabled})},d.toDisplayString(s.maxLength?`${s.modelValue.length} / ${s.maxLength}`:""),3)])]))}}),Qf="",re=n=>(d.pushScopeId("data-v-a720221d"),n=n(),d.popScopeId(),n),Qu={class:"items-start self-stretch"},tf={class:"flex gap-3 hover:cursor-pointer items-start pl-1 pr-5 py-0 self-stretch"},ef={key:0,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},nf=[re(()=>d.createElementVNode("circle",{cx:"12",cy:"12",r:"11",stroke:"#AEAEB2","stroke-width":"2"},null,-1))],sf={key:1,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},of=[re(()=>d.createElementVNode("circle",{cx:"12",cy:"12",r:"10",fill:"#FF7823",stroke:"#FF7823","stroke-width":"4"},null,-1))],af={key:2,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},rf=[re(()=>d.createElementVNode("path",{d:"M9.9998 13.6L15.8998 7.70005C16.0831 7.51672 16.3165 7.42505 16.5998 7.42505C16.8831 7.42505 17.1165 7.51672 17.2998 7.70005C17.4831 7.88338 17.5748 8.11672 17.5748 8.40005C17.5748 8.68338 17.4831 8.91672 17.2998 9.10005L10.6998 15.7C10.4998 15.9 10.2665 16 9.9998 16C9.73314 16 9.4998 15.9 9.2998 15.7L6.6998 13.1C6.51647 12.9167 6.4248 12.6834 6.4248 12.4C6.4248 12.1167 6.51647 11.8834 6.6998 11.7C6.88314 11.5167 7.11647 11.425 7.3998 11.425C7.68314 11.425 7.91647 11.5167 8.0998 11.7L9.9998 13.6Z",fill:"#FF7823"},null,-1)),re(()=>d.createElementVNode("path",{d:"M1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12Z",stroke:"#FF7823","stroke-width":"2"},null,-1))],lf={key:3,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},cf=[re(()=>d.createElementVNode("path",{d:"M2.72479 21C2.54146 21 2.37479 20.9542 2.22479 20.8625C2.07479 20.7708 1.95812 20.65 1.87479 20.5C1.79146 20.35 1.74562 20.1875 1.73729 20.0125C1.72896 19.8375 1.77479 19.6667 1.87479 19.5L11.1248 3.5C11.2248 3.33333 11.354 3.20833 11.5123 3.125C11.6706 3.04167 11.8331 3 11.9998 3C12.1665 3 12.329 3.04167 12.4873 3.125C12.6456 3.20833 12.7748 3.33333 12.8748 3.5L22.1248 19.5C22.2248 19.6667 22.2706 19.8375 22.2623 20.0125C22.254 20.1875 22.2081 20.35 22.1248 20.5C22.0415 20.65 21.9248 20.7708 21.7748 20.8625C21.6248 20.9542 21.4581 21 21.2748 21H2.72479ZM4.44979 19H19.5498L11.9998 6L4.44979 19ZM11.9998 18C12.2831 18 12.5206 17.9042 12.7123 17.7125C12.904 17.5208 12.9998 17.2833 12.9998 17C12.9998 16.7167 12.904 16.4792 12.7123 16.2875C12.5206 16.0958 12.2831 16 11.9998 16C11.7165 16 11.479 16.0958 11.2873 16.2875C11.0956 16.4792 10.9998 16.7167 10.9998 17C10.9998 17.2833 11.0956 17.5208 11.2873 17.7125C11.479 17.9042 11.7165 18 11.9998 18ZM11.9998 15C12.2831 15 12.5206 14.9042 12.7123 14.7125C12.904 14.5208 12.9998 14.2833 12.9998 14V11C12.9998 10.7167 12.904 10.4792 12.7123 10.2875C12.5206 10.0958 12.2831 10 11.9998 10C11.7165 10 11.479 10.0958 11.2873 10.2875C11.0956 10.4792 10.9998 10.7167 10.9998 11V14C10.9998 14.2833 11.0956 14.5208 11.2873 14.7125C11.479 14.9042 11.7165 15 11.9998 15Z",fill:"#FF3B30"},null,-1))],df={key:4,xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},hf=[re(()=>d.createElementVNode("circle",{cx:"12",cy:"12",r:"11",stroke:"#C7C7CC","stroke-width":"2"},null,-1))],uf={class:"flex flex-1 flex-col fm-pi-content-container gap-1 items-start justify-center p-0"},ff=d.defineComponent({__name:"FmProgressIndicator",props:{titleText:{type:String,required:!0},supportingText:{type:String,default:void 0},status:{type:String,default:"default"},orientation:{type:String,default:"horizontal"}},emits:["validate-step"],setup(n,{emit:t}){const e=n,i=d.computed(()=>o[e.status]),s=d.computed(()=>a[e.status]),o={active:"text-fm-color-typo-primary",default:"text-fm-color-typo-secondary",error:"text-fm-color-typo-primary",completed:"text-fm-color-typo-primary",disabled:"text-fm-color-typo-disabled"},a={active:"bg-fm-color-primary",default:"bg-fm-color-neutral-gray-300",error:"bg-fm-color-neutral-gray-300",completed:"bg-fm-color-primary",disabled:"bg-fm-color-neutral-gray-300"};return(r,l)=>{const c=d.resolveDirective("wave");return d.withDirectives((d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(`flex gap-1 fm-pi-item-container fm-pi-item-container--${n.orientation}`),onClick:l[0]||(l[0]=d.withModifiers(h=>t("validate-step"),["stop"]))},[d.createElementVNode("div",Qu,[d.createElementVNode("div",{class:d.normalizeClass(`self-stretch fm-pi-item-line fm-pi-item-line--${n.orientation} ${s.value} `)},null,2)]),d.createElementVNode("div",tf,[d.createElementVNode("div",null,[n.status==="default"?(d.openBlock(),d.createElementBlock("svg",ef,nf)):d.createCommentVNode("",!0),n.status==="active"?(d.openBlock(),d.createElementBlock("svg",sf,of)):d.createCommentVNode("",!0),n.status==="completed"?(d.openBlock(),d.createElementBlock("svg",af,rf)):d.createCommentVNode("",!0),n.status==="error"?(d.openBlock(),d.createElementBlock("svg",lf,cf)):d.createCommentVNode("",!0),n.status==="disabled"?(d.openBlock(),d.createElementBlock("svg",df,hf)):d.createCommentVNode("",!0)]),d.createElementVNode("div",uf,[d.createElementVNode("span",{class:d.normalizeClass(["fm-typo-body-lg-400",i.value])},d.toDisplayString(n.titleText),3),d.createElementVNode("span",{class:d.normalizeClass(["fm-typo-body-sm-400 overflow-hidden text-ellipsis",n.status!=="disabled"?"text-fm-color-typo-secondary":"text-fm-color-typo-disabled"])},d.toDisplayString(n.supportingText),3)])])],2)),[[c]])}}}),ap="",Qo=ft(ff,[["__scopeId","data-v-a720221d"]]),pf={class:"flex gap-2 items-start justify-end p-0 self-stretch"},gf={key:0,class:"bg-white flex flex-col gap-5 p-6 w-1/3"},mf=d.defineComponent({__name:"FmProgressIndicatorGroup",props:{orientation:{type:String,default:"horizontal"},steps:{type:Array,required:!0},nextButtonLabel:{type:String,default:"Next"},previousButtonLabel:{type:String,default:"Back"},submitButtonLabel:{type:String,default:"Submit"}},setup(n){const t=n,e=d.ref([...t.steps]),i=d.computed(()=>e.value.length),s=d.ref(0),o=d.computed(()=>e.value[s.value]);d.onMounted(()=>{for(let u=0;u<i.value;u++)e.value[u].status=u===0?"active":"default"}),d.watch(s,async(u,f)=>{if(f!=i.value)if(u<i.value)e.value[u].status="active";else{const p=e.value[f].submitForm;p&&e.value.filter(m=>m.status==="error").length===0&&(s.value=0,p())}});const a=d.computed(()=>o.value.validateStep),r=d.computed(()=>{const u=o.value.validateStep;return u?u():!0}),l=u=>{a.value?r.value?(o.value.status="completed",s.value=u):o.value.status="error":c(u)},c=u=>{o.value.status="completed",s.value=u},h=d.computed(()=>{const u=o.value.validateStep;return u?!u():!1});return(u,f)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(`container--${n.orientation}`)},[d.createElementVNode("div",{class:d.normalizeClass(`flex justify-start fm-pi-container--${n.orientation}`)},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.value,(p,g)=>(d.openBlock(),d.createBlock(Qo,{key:g,orientation:n.orientation,"title-text":p.titleText,"supporting-text":p.supportingText,status:p.status,onValidateStep:m=>l(g)},null,8,["orientation","title-text","supporting-text","status","onValidateStep"]))),128))],2),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(Object.keys(u.$slots),p=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:p},[`step${s.value+1}`===p?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(`flex fm-pi-form--${n.orientation}`)},[d.createElementVNode("div",{class:d.normalizeClass(`bg-white flex flex-col gap-10 p-6 ${u.$slots.card?"w-2/3":"w-full"}`)},[d.createElementVNode("form",{class:"flex flex-col gap-2 p-0 self-stretch",onSubmit:f[1]||(f[1]=d.withModifiers(g=>l(s.value+1),["prevent"]))},[d.renderSlot(u.$slots,p,{class:"gap-0 items-start p-0 self-stretch"}),d.createElementVNode("div",pf,[p!="step1"?(d.openBlock(),d.createBlock(Ne,{key:0,type:"button",label:n.previousButtonLabel,variant:"tertiary",onClick:f[0]||(f[0]=d.withModifiers(g=>l(s.value-1),["stop"]))},null,8,["label"])):d.createCommentVNode("",!0),d.createVNode(Ne,{variant:"primary",disabled:h.value,label:s.value!=e.value.length-1?n.nextButtonLabel:n.submitButtonLabel,type:"submit"},null,8,["disabled","label"])])],32)],2),u.$slots.card?(d.openBlock(),d.createElementBlock("div",gf,[d.renderSlot(u.$slots,"card")])):d.createCommentVNode("",!0)],2)):d.createCommentVNode("",!0)],64))),128))],2))}}),rp="",bf={class:"flex"},_f={key:0,class:"mt-8"},yf=d.defineComponent({__name:"FmSnackbar",props:{title:{type:String,default:void 0},description:{type:String,default:void 0},variant:{type:String,default:"info"},dismissable:{type:Boolean,default:!1},action:{type:String,default:void 0},color:{type:String,default:void 0},bgColor:{type:String,default:void 0}},emits:["onDismiss","onAction"],setup(n,{emit:t}){const e=n,i=d.computed(()=>{switch(e.variant){case"info":return{icon:{name:"info",color:"system-info-300"},actionColor:"typo-info",bgColor:"system-info-100"};case"success":return{icon:{name:"check_circle",color:"system-success-300"},actionColor:"typo-success",bgColor:"system-success-100"};case"warning":return{icon:{name:"warning",color:"system-warning-300"},actionColor:"typo-warning",bgColor:"system-warning-100"};case"error":return{icon:{name:"error",color:"system-error-300"},actionColor:"typo-error",bgColor:"system-error-100"};case"neutral":return{actionColor:"primary",bgColor:"neutral-gray-100"};default:throw Error(`Unimplement snackbar variant ${e.variant}`)}}),s=d.computed(()=>e.title?{text:e.title,classes:"fm-typo-body-lg-700"}:{text:e.description,classes:""}),o=d.computed(()=>e.bgColor?Sn(e.bgColor)?{style:{backgroundColor:e.bgColor}}:{class:`bg-fm-color-${e.bgColor}`}:{class:`bg-fm-color-${i.value.bgColor}`}),a=d.computed(()=>e.color?Sn(e.color)?{style:{color:e.color}}:{class:`text-fm-color-${e.color}`}:{class:`text-fm-color-${i.value.actionColor}`});return(r,l)=>(d.openBlock(),d.createElementBlock("div",d.mergeProps(o.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[d.createElementVNode("div",bf,[i.value.icon?(d.openBlock(),d.createBlock(st,{key:0,name:i.value.icon.name,color:e.color??i.value.icon.color,class:"mr-12"},null,8,["name","color"])):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(`${s.value.classes} grow ellipsis`)},d.toDisplayString(s.value.text),3),e.dismissable?(d.openBlock(),d.createBlock(st,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:l[0]||(l[0]=()=>t("onDismiss"))})):d.createCommentVNode("",!0)]),e.title&&e.description?(d.openBlock(),d.createElementBlock("div",_f,d.toDisplayString(e.description),1)):d.createCommentVNode("",!0),d.renderSlot(r.$slots,"actions",{},()=>[e.action?(d.openBlock(),d.createElementBlock("div",d.mergeProps({key:0},a.value,{class:"mt-16 fm-typo-body-lg-700"}),[d.createElementVNode("span",{class:"cursor-pointer",onClick:l[1]||(l[1]=()=>t("onAction"))},d.toDisplayString(e.action),1)],16)):d.createCommentVNode("",!0)],!0)],16))}}),lp="",xf=ft(yf,[["__scopeId","data-v-b6db34bb"]]),kf={class:"inline-block relative"},wf={key:0},Mf={class:"px-2 py-0"},Sf={key:0,class:"fm-typo-body-xl-700"},vf={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},Cf=d.defineComponent({__name:"FmTooltip",props:{variant:{default:"plain"},beak:{default:"none"},titleText:{default:"Title"},contentText:{},actionButtons:{}},setup(n){const t=n,e=d.ref(!1),i=d.computed(()=>{const h={plain:{color:"#FFF",background:"#1C1C1E",boxShadow:"0 2px 4px rgba(0, 0, 0, 0)"},rich:{background:"#FFF",boxShadow:"0px 8px 16px 0px rgba(199, 199, 204, 0.24)"}},u={none:{top:"110%",left:"50%",transform:"translateX(-50%)"},top:{top:"110%",left:"50%",transform:"translateX(-50%)"},bottom:{bottom:"110%",left:"50%",transform:"translateX(-50%)"},left:{top:"50%",left:"104%",transform:"translateY(-50%)"},right:{top:"-95%",right:"104%"}};return{...h[t.variant],...u[t.beak],display:e.value?"block":"none"}}),s=d.computed(()=>{const h={none:{},top:{top:"110%",left:"45%",width:"23px",height:"23px"},bottom:{bottom:"110%",left:"45%",width:"23px",height:"23px"},left:{top:"40%",left:"102%",width:"8px",height:"8px"},right:{top:"30%",right:"102%",width:"8px",height:"8px"}},u={plain:{background:"#1C1C1E"},rich:{background:"#FFF"}};return{...h[t.beak],...u[t.variant]}}),o=d.ref(0),a=d.ref(0),r=()=>{clearTimeout(a.value),o.value=window.setTimeout(()=>e.value=!0,500)},l=()=>{clearTimeout(o.value),a.value=window.setTimeout(()=>e.value=!1,1500)},c=()=>{clearTimeout(a.value),e.value=!0};return(h,u)=>(d.openBlock(),d.createElementBlock("div",kf,[d.createElementVNode("span",{onMouseenter:r,onMouseleave:l},[d.renderSlot(h.$slots,"default")],32),e.value?(d.openBlock(),d.createElementBlock("div",wf,[d.createElementVNode("div",{class:"absolute rotate-45",style:d.normalizeStyle(s.value)},null,4),d.createElementVNode("div",{class:"absolute break-words max-w-xs overflow-hidden px-4 py-3 rounded-2xl w-max whitespace-normal z-50",style:d.normalizeStyle(i.value),onMouseenter:c,onMouseleave:l},[d.createElementVNode("div",Mf,[h.variant=="rich"?(d.openBlock(),d.createElementBlock("div",Sf,d.toDisplayString(h.titleText),1)):d.createCommentVNode("",!0),d.createElementVNode("div",{class:d.normalizeClass(h.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},d.toDisplayString(h.contentText),3)]),h.variant=="rich"?(d.openBlock(),d.createElementBlock("div",vf,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(h.actionButtons,(f,p)=>(d.openBlock(),d.createElementBlock("div",{key:p},[d.createVNode(Ne,{label:f.label,onClick:f.handler},null,8,["label","onClick"])]))),128))])):d.createCommentVNode("",!0)],36)])):d.createCommentVNode("",!0)]))}}),ta={directive:"wave",color:"currentColor",initialOpacity:.2,finalOpacity:.1,duration:.4,dissolveDuration:.15,easing:"ease-out",cancellationPeriod:75,trigger:"auto",tagName:"div"},Df=n=>"config"in n&&"globalProperties"in n.config,Ef=n=>{let t;return n==="vue2"?t=!1:n==="vue3"?t=!0:t=Df(n),t?{mounted:"mounted",updated:"updated"}:{mounted:"inserted",updated:"componentUpdated"}},ea=n=>typeof n=="string"&&n!=="auto",na=(n,t)=>{n.dataset.vWaveBoundary=ea(t)?t:"true"},Pf=({borderTopLeftRadius:n,borderTopRightRadius:t,borderBottomLeftRadius:e,borderBottomRightRadius:i},s)=>{const o=document.createElement(s);return o.style.top="0",o.style.left="0",o.style.width="100%",o.style.height="100%",o.style.display="block",o.style.position="absolute",o.style.borderRadius=`${n} ${t} ${i} ${e}`,o.style.overflow="hidden",o.style.pointerEvents="none",o.style.webkitMaskImage="-webkit-radial-gradient(white, black)",o},Of=(n,t,e,i)=>{const s=document.createElement("div");return s.style.position="absolute",s.style.width=`${e}px`,s.style.height=`${e}px`,s.style.top=`${t}px`,s.style.left=`${n}px`,s.style.background=i.color,s.style.borderRadius="50%",s.style.opacity=`${i.initialOpacity}`,s.style.transform="translate(-50%,-50%) scale(0)",s.style.transition=`transform ${i.duration}s ${i.easing}, opacity ${i.duration}s ${i.easing}`,s};function wn(n,t,e,i){const s=n-e,o=t-i;return Math.sqrt(s*s+o*o)}function Bf(n,t,{width:e,height:i}){const s=wn(n,t,0,0),o=wn(n,t,e,0),a=wn(n,t,0,i),r=wn(n,t,e,i);return Math.max(s,o,a,r)}const Af=({x:n,y:t},{top:e,left:i})=>({x:n-i,y:t-e}),gi="vWaveCountInternal";function Lf(n){const t=mi(n);ia(n,t+1)}function Tf(n){const t=mi(n);ia(n,t-1)}function ia(n,t){n.dataset[gi]=t.toString()}function mi(n){var t;return parseInt((t=n.dataset[gi])!==null&&t!==void 0?t:"0",10)}function Ff(n){delete n.dataset[gi]}const bi=(n,t,e)=>{const i=t.getBoundingClientRect(),s=window.getComputedStyle(t),{x:o,y:a}=Af(n,i),r=2.05*Bf(o,a,i),l=Pf(s,e.tagName),c=Of(o,a,r,e);Lf(t);let h="";s.position==="static"&&(t.style.position&&(h=t.style.position),t.style.position="relative"),l.appendChild(c),t.appendChild(l);let u=!1;const f=b=>{typeof b<"u"&&(document.removeEventListener("pointerup",f),document.removeEventListener("pointercancel",f)),u?p():u=!0},p=()=>{c.style.transition=`opacity ${e.dissolveDuration}s linear`,c.style.opacity="0",setTimeout(()=>{l.remove(),Tf(t),mi(t)===0&&(Ff(t),t.style.position=h)},e.dissolveDuration*1e3)};document.addEventListener("pointerup",f),document.addEventListener("pointercancel",f);const g=setTimeout(()=>{document.removeEventListener("pointercancel",m),requestAnimationFrame(()=>{c.style.transform="translate(-50%,-50%) scale(1)",c.style.opacity=`${e.finalOpacity}`,setTimeout(()=>f(),e.duration*1e3)})},e.cancellationPeriod),m=()=>{clearTimeout(g),l.remove(),document.removeEventListener("pointerup",f),document.removeEventListener("pointercancel",f),document.removeEventListener("pointercancel",m)};document.addEventListener("pointercancel",m)},Fe=new WeakMap,sa=(n={},t="vue3")=>{const e=Object.assign(Object.assign({},ta),n),i=Ef(t),s=r=>{const l=r.currentTarget.dataset.vWaveTrigger;document.querySelectorAll(`[data-v-wave-boundary="${l}"]`).forEach(h=>bi(r,h,Object.assign(Object.assign({},e),Fe.get(h))))},o={[i.mounted](r,{value:l={}}){var c;Fe.set(r,l),na(r,(c=l&&l.trigger)!==null&&c!==void 0?c:e.trigger),r.addEventListener("pointerdown",h=>{if(Fe.get(r)===!1)return;const u=Object.assign(Object.assign({},e),Fe.get(r));if(u.trigger===!1)return bi(h,r,u);if(ea(u.trigger))return;const f=r.querySelector('[data-v-wave-trigger="true"]');!f&&u.trigger===!0||f&&!h.composedPath().includes(f)||bi(h,r,u)})},[i.updated](r,{value:l={}}){var c;Fe.set(r,l),na(r,(c=l&&l.trigger)!==null&&c!==void 0?c:e.trigger)}},a={[i.mounted](r,{arg:l="true"}){r.dataset.vWaveTrigger=l,l!=="true"&&r.addEventListener("pointerdown",s)},[i.updated](r,{arg:l="true"}){r.dataset.vWaveTrigger=l,l==="true"?r.removeEventListener("pointerdown",s):r.addEventListener("pointerdown",s)}};return{wave:o,vWave:o,waveTrigger:a,vWaveTrigger:a}},Vf={install(n,t={}){if(this.installed)return;this.installed=!0;const e=Object.assign(Object.assign({},ta),t),{vWave:i,vWaveTrigger:s}=sa(e,n);n.directive(e.directive,i),n.directive(`${e.directive}-trigger`,s)},installed:!1,createLocalWaveDirective:sa},Rf=n=>{n.use(Vf,{})};z.FmBreadcrumb=ua,z.FmButton=Ne,z.FmCheckbox=jo,z.FmDatePicker=Hh,z.FmDateRangePicker=eu,z.FmDropdown=Ho,z.FmIcon=st,z.FmLineChart=Ah,z.FmMenu=Yo,z.FmMenuItem=Uo,z.FmProgressIndicator=Qo,z.FmProgressIndicatorGroup=mf,z.FmRadio=mu,z.FmSelect=Du,z.FmSnackbar=xf,z.FmSwitch=Nu,z.FmTextField=Yu,z.FmTextarea=Ju,z.FmTooltip=Cf,z.uiPlugin=Rf,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});