@feedmepos/ui-library 0.0.11 → 0.0.13

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.
Files changed (50) hide show
  1. package/dist/components/dynamic-dialog/FmDynamicDialog.vue.d.ts +21 -1
  2. package/dist/components/form/form/FmForm.vue.d.ts +6 -1
  3. package/dist/components/form/select/FmSelect.vue.d.ts +11 -10
  4. package/dist/components/menu/menu-container/FmMenu.vue.d.ts +10 -8
  5. package/dist/components/tooltip/FmTooltip.vue.d.ts +3 -3
  6. package/dist/components.d.ts +580 -127
  7. package/dist/federation/FmDateRangePicker-6a251133.css +1 -0
  8. package/dist/federation/FmDropField-b51924c1.css +1 -0
  9. package/dist/federation/FmForm.vue_vue_type_script_setup_true_lang-67f87de0.js +1 -0
  10. package/dist/federation/FmMenu-1bf41c36.css +1 -0
  11. package/dist/federation/FmProgressIndicator.vue_vue_type_style_index_0_lang-4936958a.js +1 -0
  12. package/dist/federation/FmSelect-0d4033b1.css +1 -0
  13. package/dist/federation/FmStepper.vue_vue_type_script_setup_true_lang-ebb560f4.js +1 -0
  14. package/dist/federation/FmTextField.vue_vue_type_style_index_0_lang-37891b48.js +1 -0
  15. package/dist/federation/{FmTimePicker.vue_vue_type_style_index_0_lang-cd3ff46f.js → FmTimePicker.vue_vue_type_style_index_0_lang-adf67efb.js} +1 -1
  16. package/dist/federation/FmTooltip.vue_vue_type_script_setup_true_lang-4afc1a0b.js +1 -0
  17. package/dist/federation/__federation_expose_FmDateRangePicker-96bfdeee.js +1 -0
  18. package/dist/federation/__federation_expose_FmDropField-acc0feb2.js +1 -0
  19. package/dist/federation/__federation_expose_FmDynamicDialog-f6d013b7.js +1 -0
  20. package/dist/federation/{__federation_expose_FmForm-95a4221b.js → __federation_expose_FmForm-81601667.js} +1 -1
  21. package/dist/federation/__federation_expose_FmMenu-da3eca46.js +1 -0
  22. package/dist/federation/__federation_expose_FmProgressIndicator-cb1c88dd.js +1 -0
  23. package/dist/federation/__federation_expose_FmSelect-c850d1a0.js +1 -0
  24. package/dist/federation/{__federation_expose_FmStepper-39811b61.js → __federation_expose_FmStepper-fc3f64a1.js} +1 -1
  25. package/dist/federation/{__federation_expose_FmTextField-ee99cd30.js → __federation_expose_FmTextField-09b9d527.js} +1 -1
  26. package/dist/federation/{__federation_expose_FmTimePicker-149aa26d.js → __federation_expose_FmTimePicker-2f0c4dd1.js} +1 -1
  27. package/dist/federation/{__federation_expose_FmTooltip-fa2c64c7.js → __federation_expose_FmTooltip-adedf618.js} +1 -1
  28. package/dist/federation/dialog-plugin-a69976d4.js +1 -0
  29. package/dist/federation/feedmepos-ui-components.js +1 -1
  30. package/dist/federation/floating-ui.vue.esm-6ee3a4dc.js +1 -0
  31. package/dist/federation/index-81fbf747.css +1 -0
  32. package/dist/federation/index-d2981ce7.js +11 -0
  33. package/dist/feedmepos-ui-library.js +5128 -4848
  34. package/dist/feedmepos-ui-library.umd.cjs +6 -6
  35. package/dist/global-components.d.ts +6 -3
  36. package/dist/style.css +1 -1
  37. package/package.json +1 -1
  38. package/dist/federation/FmDateRangePicker-2b4b8a36.css +0 -1
  39. package/dist/federation/FmForm.vue_vue_type_script_setup_true_lang-be0b8ff2.js +0 -1
  40. package/dist/federation/FmMenu-008b4edf.css +0 -1
  41. package/dist/federation/FmSelect-5383ab5c.css +0 -1
  42. package/dist/federation/FmStepper.vue_vue_type_script_setup_true_lang-620c5c99.js +0 -1
  43. package/dist/federation/FmTextField.vue_vue_type_style_index_0_lang-31424202.js +0 -1
  44. package/dist/federation/FmTooltip.vue_vue_type_script_setup_true_lang-ec99af74.js +0 -1
  45. package/dist/federation/__federation_expose_FmDateRangePicker-6e0116bd.js +0 -1
  46. package/dist/federation/__federation_expose_FmMenu-c78ae222.js +0 -1
  47. package/dist/federation/__federation_expose_FmSelect-dd3e5756.js +0 -1
  48. package/dist/federation/index-1375029c.css +0 -1
  49. package/dist/federation/index-cb166ff0.js +0 -11
  50. /package/dist/federation/{FmStepper-f275f227.css → FmProgressIndicator-f275f227.css} +0 -0
@@ -1,25 +1,25 @@
1
- var Hm=Object.defineProperty;var jm=(nt,ft,c)=>ft in nt?Hm(nt,ft,{enumerable:!0,configurable:!0,writable:!0,value:c}):nt[ft]=c;var B=(nt,ft,c)=>(jm(nt,typeof ft!="symbol"?ft+"":ft,c),c);(function(nt,ft){typeof exports=="object"&&typeof module<"u"?ft(exports,require("v-wave"),require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","v-wave","vue","vue-router"],ft):(nt=typeof globalThis<"u"?globalThis:nt||self,ft(nt["feedmepos-ui-library"]={},nt.VWave,nt.Vue,nt.VueRouter))})(this,function(nt,ft,c,Xi){var Un;"use strict";const Ym="",Ya={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},Ua=["onMouseenter"],Xa={key:0},qa=c.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(n){const t=n,e=Xi.useRoute(),i=Xi.useRouter();c.onMounted(async()=>{await i.isReady();const m=t.items.findIndex(g=>g.route==e.path);m!=-1&&!t.items[m].disabled&&(s.value=m)});const s=c.ref(-1),o=c.ref(-1),a=c.ref(" / "),r=c.ref("... /"),l=c.ref(!1),d=m=>s.value===m?"selected":o.value===m?"hovered":t.items[m].disabled?"disabled":"default",h=m=>{t.items[m].disabled||(s.value=m)},f=m=>m!=t.items.length-1,u=m=>!l.value&&t.items.length>5&&m>=2&&m<t.items.length-2,p=()=>{l.value=!l.value};return(m,g)=>{const b=c.resolveComponent("RouterLink");return c.openBlock(),c.createElementBlock("nav",null,[c.createElementVNode("ul",Ya,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.items,(y,x)=>(c.openBlock(),c.createElementBlock("li",{key:x,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:k=>o.value=x,onMouseleave:g[0]||(g[0]=k=>o.value=-1)},[u(x)?x===3&&!l.value?(c.openBlock(),c.createElementBlock("a",{key:1,onClick:p},c.toDisplayString(r.value),1)):c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(b,{key:0,class:c.normalizeClass(d(x)),to:y.disabled?"":y.route,onClick:k=>h(x)},{default:c.withCtx(()=>[c.createElementVNode("span",null,c.toDisplayString(y.label),1),f(x)?(c.openBlock(),c.createElementBlock("span",Xa,c.toDisplayString(a.value),1)):c.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,Ua))),128))])])}}}),Um="",Ka=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,Ga=/^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}[)]$/,Ja=/^^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*[)]$/,Za=/^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*[)]$/,Qa=/^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 qn(n){return[Ka,Ga,Ja,Za,Qa].some(t=>t.test(n))}const tr=c.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=c.computed(()=>{const o=[],a={};return o.push(i()),o.push(s()),qn(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)=>(c.openBlock(),c.createElementBlock("span",c.mergeProps(e.value,{class:"fm-icon"}),c.toDisplayString(t.name),17))}}),Xm="",ot=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},z=ot(tr,[["__scopeId","data-v-88e86ba4"]]),er=["disabled","type"],nr={key:1,class:"fm-typo-body-lg-700"},ir=c.defineComponent({__name:"FmButton",props:{variant:{default:"primary"},label:{default:""},icon:{default:""},size:{default:"lg"},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},iconColor:{default:""},type:{default:"button"}},setup(n){const t=n,e=c.ref(!1),i=c.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-primary",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=c.resolveDirective("wave");return c.withDirectives((c.openBlock(),c.createElementBlock("button",{ref:"buttonEl",class:c.normalizeClass(`
1
+ var ng=Object.defineProperty;var ig=(nt,ft,c)=>ft in nt?ng(nt,ft,{enumerable:!0,configurable:!0,writable:!0,value:c}):nt[ft]=c;var B=(nt,ft,c)=>(ig(nt,typeof ft!="symbol"?ft+"":ft,c),c);(function(nt,ft){typeof exports=="object"&&typeof module<"u"?ft(exports,require("v-wave"),require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","v-wave","vue","vue-router"],ft):(nt=typeof globalThis<"u"?globalThis:nt||self,ft(nt["feedmepos-ui-library"]={},nt.VWave,nt.Vue,nt.VueRouter))})(this,function(nt,ft,c,Gi){var Kn;"use strict";const sg="",tr={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},er=["onMouseenter"],nr={key:0},ir=c.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(n){const t=n,e=Gi.useRoute(),i=Gi.useRouter();c.onMounted(async()=>{await i.isReady();const m=t.items.findIndex(g=>g.route==e.path);m!=-1&&!t.items[m].disabled&&(s.value=m)});const s=c.ref(-1),o=c.ref(-1),a=c.ref(" / "),r=c.ref("... /"),l=c.ref(!1),d=m=>s.value===m?"selected":o.value===m?"hovered":t.items[m].disabled?"disabled":"default",h=m=>{t.items[m].disabled||(s.value=m)},f=m=>m!=t.items.length-1,u=m=>!l.value&&t.items.length>5&&m>=2&&m<t.items.length-2,p=()=>{l.value=!l.value};return(m,g)=>{const b=c.resolveComponent("RouterLink");return c.openBlock(),c.createElementBlock("nav",null,[c.createElementVNode("ul",tr,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.items,(y,x)=>(c.openBlock(),c.createElementBlock("li",{key:x,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:w=>o.value=x,onMouseleave:g[0]||(g[0]=w=>o.value=-1)},[u(x)?x===3&&!l.value?(c.openBlock(),c.createElementBlock("a",{key:1,onClick:p},c.toDisplayString(r.value),1)):c.createCommentVNode("",!0):(c.openBlock(),c.createBlock(b,{key:0,class:c.normalizeClass(d(x)),to:y.disabled?"":y.route,onClick:w=>h(x)},{default:c.withCtx(()=>[c.createElementVNode("span",null,c.toDisplayString(y.label),1),f(x)?(c.openBlock(),c.createElementBlock("span",nr,c.toDisplayString(a.value),1)):c.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,er))),128))])])}}}),og="",sr=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,or=/^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}[)]$/,ar=/^^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*[)]$/,rr=/^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*[)]$/,lr=/^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 Jn(n){return[sr,or,ar,rr,lr].some(t=>t.test(n))}const cr=c.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=c.computed(()=>{const o=[],a={};return o.push(i()),o.push(s()),Jn(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)=>(c.openBlock(),c.createElementBlock("span",c.mergeProps(e.value,{class:"fm-icon"}),c.toDisplayString(t.name),17))}}),ag="",it=(n,t)=>{const e=n.__vccOpts||n;for(const[i,s]of t)e[i]=s;return e},I=it(cr,[["__scopeId","data-v-88e86ba4"]]),dr=["disabled","type"],hr={key:1,class:"fm-typo-body-lg-700"},fr=c.defineComponent({__name:"FmButton",props:{variant:{default:"primary"},label:{default:""},icon:{default:""},size:{default:"lg"},disabled:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},iconColor:{default:""},type:{default:"button"}},setup(n){const t=n,e=c.ref(!1),i=c.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-primary",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=c.resolveDirective("wave");return c.withDirectives((c.openBlock(),c.createElementBlock("button",{ref:"buttonEl",class:c.normalizeClass(`
2
2
  fm-btn rounded-lg
3
3
  ${i.value}
4
4
  fm-btn--${a.size}
5
5
  ${a.label?"":`fm-btn--${a.size}--just-icon`}
6
6
  fm-btn--${a.variant}
7
7
  ${a.disabled?"fm-btn--disabled":""}
8
- `),disabled:a.disabled,type:a.type,onMousedown:r[0]||(r[0]=()=>o(!0)),onMouseup:r[1]||(r[1]=()=>o(!1)),onMouseleave:r[2]||(r[2]=()=>o(!1))},[a.icon?(c.openBlock(),c.createBlock(z,{key:0,name:a.icon,outline:!e.value,color:a.disabled?"neutral-gray-200":a.iconColor??"",size:"md"},null,8,["name","outline","color"])):c.createCommentVNode("",!0),a.label?(c.openBlock(),c.createElementBlock("span",nr,c.toDisplayString(a.label),1)):c.createCommentVNode("",!0)],42,er)),[[l,!a.disabled]])}}}),qm="",Gt=ot(ir,[["__scopeId","data-v-e62833de"]]),sr={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},or=["v-wave","disabled","onClick","onMousedown"],ar=c.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=l=>{t("update:modelValue",l)},s=c.ref(null),o=l=>{s.value=l},a=l=>l.disabled||e.disabled,r=l=>JSON.stringify(l)===JSON.stringify(e.modelValue);return(l,d)=>(c.openBlock(),c.createElementBlock("div",sr,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(l.items,(h,f)=>(c.openBlock(),c.createElementBlock("button",{key:f,"v-wave":a(h),class:c.normalizeClass(["border-r flex gap-8 grow hover:bg-fm-color-neutral-gray-200 items-center justify-center last:border-r-0 px-[11px] py-[7px]",{"bg-fm-color-system-warning-100 hover:bg-fm-color-system-warning-100":r(h),"hover:bg-fm-color-neutral-white cursor-not-allowed":a(h)}]),disabled:a(h),onClick:u=>i(h),onMousedown:u=>o(h),onMouseup:d[0]||(d[0]=u=>o(null)),onMouseleave:d[1]||(d[1]=u=>o(null))},[h.icon?(c.openBlock(),c.createBlock(z,{key:0,name:h.icon,size:"md",color:a(h)?"neutral-gray-200":r(h)?"primary":"",outline:JSON.stringify(s.value)!==JSON.stringify(h)&&!r(h)},null,8,["name","color","outline"])):c.createCommentVNode("",!0),h.label?(c.openBlock(),c.createElementBlock("span",{key:1,class:c.normalizeClass(["fm-typo-body-lg-700",[a(h)?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},c.toDisplayString(h.label),3)):c.createCommentVNode("",!0)],42,or))),128))]))}}),rr={class:"grow"},qi=c.defineComponent({__name:"FmCardTitle",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["fm-card-title",n.padding])},[c.createElementVNode("div",rr,[c.renderSlot(t.$slots,"default")]),c.renderSlot(t.$slots,"actions")],2))}}),lr={class:"fm-typo-title-md-700 grow"},cr=c.defineComponent({__name:"FmCard",props:{title:{type:String,default:void 0},variant:{type:String,default:"elevated"},horizontal:{type:Boolean,default:!1}},setup(n){const t=n,e=c.useSlots();return(i,s)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["fm-card",`${n.variant==="elevated"?"fm-shadow-light-400":"border-1"} ${n.horizontal?"fm-card--horizontal":""}`])},[c.renderSlot(i.$slots,"header",{title:t.title},()=>[n.title||c.unref(e)["header-title"]||c.unref(e)["header-actions"]?(c.openBlock(),c.createBlock(qi,{key:0},{actions:c.withCtx(()=>[c.renderSlot(i.$slots,"header-actions")]),default:c.withCtx(()=>[c.createElementVNode("div",null,[c.renderSlot(i.$slots,"header-title",{title:t.title},()=>[c.createElementVNode("div",lr,c.toDisplayString(t.title),1)])])]),_:3})):c.createCommentVNode("",!0)]),c.renderSlot(i.$slots,"default"),c.renderSlot(i.$slots,"actions")],2))}}),Km="",dr=c.defineComponent({__name:"FmCardActions",props:{alignment:{type:String,default:"right"},padding:{type:String,default:"p-16"}},setup(n){const t=n,e=c.computed(()=>{switch(t.alignment){case"left":return"justify-start";case"right":return"justify-end";case"center":return"justify-center";default:return""}});return(i,s)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["fm-card-actions",`${e.value} ${n.padding}`])},[c.renderSlot(i.$slots,"default")],2))}}),hr=c.defineComponent({__name:"FmCardSection",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["fm-card-section",n.padding])},[c.renderSlot(t.$slots,"default")],2))}});/*!
8
+ `),disabled:a.disabled,type:a.type,onMousedown:r[0]||(r[0]=()=>o(!0)),onMouseup:r[1]||(r[1]=()=>o(!1)),onMouseleave:r[2]||(r[2]=()=>o(!1))},[a.icon?(c.openBlock(),c.createBlock(I,{key:0,name:a.icon,outline:!e.value,color:a.disabled?"neutral-gray-200":a.iconColor??"",size:"md"},null,8,["name","outline","color"])):c.createCommentVNode("",!0),a.label?(c.openBlock(),c.createElementBlock("span",hr,c.toDisplayString(a.label),1)):c.createCommentVNode("",!0)],42,dr)),[[l,!a.disabled]])}}}),rg="",Rt=it(fr,[["__scopeId","data-v-e62833de"]]),ur={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},pr=["v-wave","disabled","onClick","onMousedown"],mr=c.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=l=>{t("update:modelValue",l)},s=c.ref(null),o=l=>{s.value=l},a=l=>l.disabled||e.disabled,r=l=>JSON.stringify(l)===JSON.stringify(e.modelValue);return(l,d)=>(c.openBlock(),c.createElementBlock("div",ur,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(l.items,(h,f)=>(c.openBlock(),c.createElementBlock("button",{key:f,"v-wave":a(h),class:c.normalizeClass(["border-r flex gap-8 grow hover:bg-fm-color-neutral-gray-200 items-center justify-center last:border-r-0 px-[11px] py-[7px]",{"bg-fm-color-system-warning-100 hover:bg-fm-color-system-warning-100":r(h),"hover:bg-fm-color-neutral-white cursor-not-allowed":a(h)}]),disabled:a(h),onClick:u=>i(h),onMousedown:u=>o(h),onMouseup:d[0]||(d[0]=u=>o(null)),onMouseleave:d[1]||(d[1]=u=>o(null))},[h.icon?(c.openBlock(),c.createBlock(I,{key:0,name:h.icon,size:"md",color:a(h)?"neutral-gray-200":r(h)?"primary":"",outline:JSON.stringify(s.value)!==JSON.stringify(h)&&!r(h)},null,8,["name","color","outline"])):c.createCommentVNode("",!0),h.label?(c.openBlock(),c.createElementBlock("span",{key:1,class:c.normalizeClass(["fm-typo-body-lg-700",[a(h)?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},c.toDisplayString(h.label),3)):c.createCommentVNode("",!0)],42,pr))),128))]))}}),gr={class:"grow"},Ji=c.defineComponent({__name:"FmCardTitle",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["fm-card-title",n.padding])},[c.createElementVNode("div",gr,[c.renderSlot(t.$slots,"default")]),c.renderSlot(t.$slots,"actions")],2))}}),br={class:"fm-typo-title-md-700 grow"},yr=c.defineComponent({__name:"FmCard",props:{title:{type:String,default:void 0},variant:{type:String,default:"elevated"},horizontal:{type:Boolean,default:!1}},setup(n){const t=n,e=c.useSlots();return(i,s)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["fm-card",`${n.variant==="elevated"?"fm-shadow-light-400":"border-1"} ${n.horizontal?"fm-card--horizontal":""}`])},[c.renderSlot(i.$slots,"header",{title:t.title},()=>[n.title||c.unref(e)["header-title"]||c.unref(e)["header-actions"]?(c.openBlock(),c.createBlock(Ji,{key:0},{actions:c.withCtx(()=>[c.renderSlot(i.$slots,"header-actions")]),default:c.withCtx(()=>[c.createElementVNode("div",null,[c.renderSlot(i.$slots,"header-title",{title:t.title},()=>[c.createElementVNode("div",br,c.toDisplayString(t.title),1)])])]),_:3})):c.createCommentVNode("",!0)]),c.renderSlot(i.$slots,"default"),c.renderSlot(i.$slots,"actions")],2))}}),lg="",_r=c.defineComponent({__name:"FmCardActions",props:{alignment:{type:String,default:"right"},padding:{type:String,default:"p-16"}},setup(n){const t=n,e=c.computed(()=>{switch(t.alignment){case"left":return"justify-start";case"right":return"justify-end";case"center":return"justify-center";default:return""}});return(i,s)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["fm-card-actions",`${e.value} ${n.padding}`])},[c.renderSlot(i.$slots,"default")],2))}}),xr=c.defineComponent({__name:"FmCardSection",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["fm-card-section",n.padding])},[c.renderSlot(t.$slots,"default")],2))}});/*!
9
9
  * @kurkle/color v0.3.2
10
10
  * https://github.com/kurkle/color#readme
11
11
  * (c) 2023 Jukka Kurkela
12
12
  * Released under the MIT License
13
- */function ke(n){return n+.5|0}const Nt=(n,t,e)=>Math.max(Math.min(n,e),t);function we(n){return Nt(ke(n*2.55),0,255)}function $t(n){return Nt(ke(n*255),0,255)}function Mt(n){return Nt(ke(n/2.55)/100,0,1)}function Ki(n){return Nt(ke(n*100),0,100)}const gt={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},Kn=[..."0123456789ABCDEF"],fr=n=>Kn[n&15],ur=n=>Kn[(n&240)>>4]+Kn[n&15],sn=n=>(n&240)>>4===(n&15),pr=n=>sn(n.r)&&sn(n.g)&&sn(n.b)&&sn(n.a);function mr(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&gt[n[1]]*17,g:255&gt[n[2]]*17,b:255&gt[n[3]]*17,a:t===5?gt[n[4]]*17:255}:(t===7||t===9)&&(e={r:gt[n[1]]<<4|gt[n[2]],g:gt[n[3]]<<4|gt[n[4]],b:gt[n[5]]<<4|gt[n[6]],a:t===9?gt[n[7]]<<4|gt[n[8]]:255})),e}const gr=(n,t)=>n<255?t(n):"";function br(n){var t=pr(n)?fr:ur;return n?"#"+t(n.r)+t(n.g)+t(n.b)+gr(n.a,t):void 0}const yr=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Gi(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 _r(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 xr(n,t,e){const i=Gi(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 kr(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 Gn(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,d,h;return o!==a&&(h=o-a,d=r>.5?h/(2-o-a):h/(o+a),l=kr(e,i,s,h,o),l=l*60+.5),[l|0,d||0,r]}function Jn(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map($t)}function Zn(n,t,e){return Jn(Gi,n,t,e)}function wr(n,t,e){return Jn(xr,n,t,e)}function Cr(n,t,e){return Jn(_r,n,t,e)}function Ji(n){return(n%360+360)%360}function Sr(n){const t=yr.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?we(+t[5]):$t(+t[5]));const s=Ji(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=wr(s,o,a):t[1]==="hsv"?i=Cr(s,o,a):i=Zn(s,o,a),{r:i[0],g:i[1],b:i[2],a:e}}function Mr(n,t){var e=Gn(n);e[0]=Ji(e[0]+t),e=Zn(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Dr(n){if(!n)return;const t=Gn(n),e=t[0],i=Ki(t[1]),s=Ki(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Mt(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const Zi={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"},Qi={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 vr(){const n={},t=Object.keys(Qi),e=Object.keys(Zi);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,Zi[o]);o=parseInt(Qi[a],16),n[r]=[o>>16&255,o>>8&255,o&255]}return n}let on;function Er(n){on||(on=vr(),on.transparent=[0,0,0,0]);const t=on[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Br=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Vr(n){const t=Br.exec(n);let e=255,i,s,o;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?we(a):Nt(a*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?we(i):Nt(i,0,255)),s=255&(t[4]?we(s):Nt(s,0,255)),o=255&(t[6]?we(o):Nt(o,0,255)),{r:i,g:s,b:o,a:e}}}function Pr(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Mt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Qn=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,fe=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Or(n,t,e){const i=fe(Mt(n.r)),s=fe(Mt(n.g)),o=fe(Mt(n.b));return{r:$t(Qn(i+e*(fe(Mt(t.r))-i))),g:$t(Qn(s+e*(fe(Mt(t.g))-s))),b:$t(Qn(o+e*(fe(Mt(t.b))-o))),a:n.a+e*(t.a-n.a)}}function an(n,t,e){if(n){let i=Gn(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=Zn(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function ts(n,t){return n&&Object.assign(t||{},n)}function es(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=$t(n[3]))):(t=ts(n,{r:0,g:0,b:0,a:1}),t.a=$t(t.a)),t}function Ar(n){return n.charAt(0)==="r"?Vr(n):Sr(n)}class Ce{constructor(t){if(t instanceof Ce)return t;const e=typeof t;let i;e==="object"?i=es(t):e==="string"&&(i=mr(t)||Er(t)||Ar(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=ts(this._rgb);return t&&(t.a=Mt(t.a)),t}set rgb(t){this._rgb=es(t)}rgbString(){return this._valid?Pr(this._rgb):void 0}hexString(){return this._valid?br(this._rgb):void 0}hslString(){return this._valid?Dr(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,d=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-d,i.r=255&d*i.r+o*s.r+.5,i.g=255&d*i.g+o*s.g+.5,i.b=255&d*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=Or(this._rgb,t._rgb,e)),this}clone(){return new Ce(this.rgb)}alpha(t){return this._rgb.a=$t(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ke(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 an(this._rgb,2,t),this}darken(t){return an(this._rgb,2,-t),this}saturate(t){return an(this._rgb,1,t),this}desaturate(t){return an(this._rgb,1,-t),this}rotate(t){return Mr(this._rgb,t),this}}/*!
13
+ */function Se(n){return n+.5|0}const $t=(n,t,e)=>Math.max(Math.min(n,e),t);function Ce(n){return $t(Se(n*2.55),0,255)}function zt(n){return $t(Se(n*255),0,255)}function Mt(n){return $t(Se(n/2.55)/100,0,1)}function Zi(n){return $t(Se(n*100),0,100)}const gt={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},Zn=[..."0123456789ABCDEF"],kr=n=>Zn[n&15],wr=n=>Zn[(n&240)>>4]+Zn[n&15],on=n=>(n&240)>>4===(n&15),Sr=n=>on(n.r)&&on(n.g)&&on(n.b)&&on(n.a);function Cr(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&gt[n[1]]*17,g:255&gt[n[2]]*17,b:255&gt[n[3]]*17,a:t===5?gt[n[4]]*17:255}:(t===7||t===9)&&(e={r:gt[n[1]]<<4|gt[n[2]],g:gt[n[3]]<<4|gt[n[4]],b:gt[n[5]]<<4|gt[n[6]],a:t===9?gt[n[7]]<<4|gt[n[8]]:255})),e}const Mr=(n,t)=>n<255?t(n):"";function Dr(n){var t=Sr(n)?kr:wr;return n?"#"+t(n.r)+t(n.g)+t(n.b)+Mr(n.a,t):void 0}const vr=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Qi(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 Er(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 Br(n,t,e){const i=Qi(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 Vr(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 Qn(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,d,h;return o!==a&&(h=o-a,d=r>.5?h/(2-o-a):h/(o+a),l=Vr(e,i,s,h,o),l=l*60+.5),[l|0,d||0,r]}function ti(n,t,e,i){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,i)).map(zt)}function ei(n,t,e){return ti(Qi,n,t,e)}function Pr(n,t,e){return ti(Br,n,t,e)}function Or(n,t,e){return ti(Er,n,t,e)}function ts(n){return(n%360+360)%360}function Ar(n){const t=vr.exec(n);let e=255,i;if(!t)return;t[5]!==i&&(e=t[6]?Ce(+t[5]):zt(+t[5]));const s=ts(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?i=Pr(s,o,a):t[1]==="hsv"?i=Or(s,o,a):i=ei(s,o,a),{r:i[0],g:i[1],b:i[2],a:e}}function Fr(n,t){var e=Qn(n);e[0]=ts(e[0]+t),e=ei(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Tr(n){if(!n)return;const t=Qn(n),e=t[0],i=Zi(t[1]),s=Zi(t[2]);return n.a<255?`hsla(${e}, ${i}%, ${s}%, ${Mt(n.a)})`:`hsl(${e}, ${i}%, ${s}%)`}const es={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"},ns={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 Lr(){const n={},t=Object.keys(ns),e=Object.keys(es);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,es[o]);o=parseInt(ns[a],16),n[r]=[o>>16&255,o>>8&255,o&255]}return n}let an;function Nr(n){an||(an=Lr(),an.transparent=[0,0,0,0]);const t=an[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Rr=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function $r(n){const t=Rr.exec(n);let e=255,i,s,o;if(t){if(t[7]!==i){const a=+t[7];e=t[8]?Ce(a):$t(a*255,0,255)}return i=+t[1],s=+t[3],o=+t[5],i=255&(t[2]?Ce(i):$t(i,0,255)),s=255&(t[4]?Ce(s):$t(s,0,255)),o=255&(t[6]?Ce(o):$t(o,0,255)),{r:i,g:s,b:o,a:e}}}function zr(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Mt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ni=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,pe=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Ir(n,t,e){const i=pe(Mt(n.r)),s=pe(Mt(n.g)),o=pe(Mt(n.b));return{r:zt(ni(i+e*(pe(Mt(t.r))-i))),g:zt(ni(s+e*(pe(Mt(t.g))-s))),b:zt(ni(o+e*(pe(Mt(t.b))-o))),a:n.a+e*(t.a-n.a)}}function rn(n,t,e){if(n){let i=Qn(n);i[t]=Math.max(0,Math.min(i[t]+i[t]*e,t===0?360:1)),i=ei(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function is(n,t){return n&&Object.assign(t||{},n)}function ss(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=zt(n[3]))):(t=is(n,{r:0,g:0,b:0,a:1}),t.a=zt(t.a)),t}function Wr(n){return n.charAt(0)==="r"?$r(n):Ar(n)}class Me{constructor(t){if(t instanceof Me)return t;const e=typeof t;let i;e==="object"?i=ss(t):e==="string"&&(i=Cr(t)||Nr(t)||Wr(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=is(this._rgb);return t&&(t.a=Mt(t.a)),t}set rgb(t){this._rgb=ss(t)}rgbString(){return this._valid?zr(this._rgb):void 0}hexString(){return this._valid?Dr(this._rgb):void 0}hslString(){return this._valid?Tr(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,d=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-d,i.r=255&d*i.r+o*s.r+.5,i.g=255&d*i.g+o*s.g+.5,i.b=255&d*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=Ir(this._rgb,t._rgb,e)),this}clone(){return new Me(this.rgb)}alpha(t){return this._rgb.a=zt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Se(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 rn(this._rgb,2,t),this}darken(t){return rn(this._rgb,2,-t),this}saturate(t){return rn(this._rgb,1,t),this}desaturate(t){return rn(this._rgb,1,-t),this}rotate(t){return Fr(this._rgb,t),this}}/*!
14
14
  * Chart.js v4.4.0
15
15
  * https://www.chartjs.org
16
16
  * (c) 2023 Chart.js Contributors
17
17
  * Released under the MIT License
18
- */function Dt(){}const Tr=(()=>{let n=0;return()=>n++})();function I(n){return n===null||typeof n>"u"}function X(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 R(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function J(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function ut(n,t){return J(n)?n:t}function $(n,t){return typeof n>"u"?t:n}const Fr=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,ns=(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 H(n,t,e,i){let s,o,a;if(X(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(R(n))for(a=Object.keys(n),o=a.length,s=0;s<o;s++)t.call(e,n[a[s]],a[s])}function rn(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 ln(n){if(X(n))return n.map(ln);if(R(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=ln(n[e[s]]);return t}return n}function is(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Lr(n,t,e,i){if(!is(n))return;const s=t[n],o=e[n];R(s)&&R(o)?Se(s,o,i):t[n]=ln(o)}function Se(n,t,e){const i=X(t)?t:[t],s=i.length;if(!R(n))return n;e=e||{};const o=e.merger||Lr;let a;for(let r=0;r<s;++r){if(a=i[r],!R(a))continue;const l=Object.keys(a);for(let d=0,h=l.length;d<h;++d)o(l[d],n,a,e)}return n}function Me(n,t){return Se(n,t,{merger:Nr})}function Nr(n,t,e){if(!is(n))return;const i=t[n],s=e[n];R(i)&&R(s)?Me(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=ln(s))}const ss={"":n=>n,x:n=>n.x,y:n=>n.y};function $r(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 Rr(n){const t=$r(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function Rt(n,t){return(ss[t]||(ss[t]=Rr(t)))(n)}function ti(n){return n.charAt(0).toUpperCase()+n.slice(1)}const De=n=>typeof n<"u",It=n=>typeof n=="function",os=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Ir(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const q=Math.PI,K=2*q,zr=K+q,cn=Number.POSITIVE_INFINITY,Wr=q/180,tt=q/2,Jt=q/4,as=q*2/3,zt=Math.log10,kt=Math.sign;function ve(n,t,e){return Math.abs(n-t)<e}function rs(n){const t=Math.round(n);n=ve(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(zt(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Hr(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 ue(n){return!isNaN(parseFloat(n))&&isFinite(n)}function jr(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function ls(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 _t(n){return n*(q/180)}function ei(n){return n*(180/q)}function cs(n){if(!J(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function ds(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*q&&(o+=K),{angle:o,distance:s}}function ni(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Yr(n,t){return(n-t+zr)%K-q}function pt(n){return(n%K+K)%K}function Ee(n,t,e,i){const s=pt(n),o=pt(t),a=pt(e),r=pt(o-s),l=pt(a-s),d=pt(s-o),h=pt(s-a);return s===o||s===a||i&&o===a||r>l&&d<h}function it(n,t,e){return Math.max(t,Math.min(e,n))}function Ur(n){return it(n,-32768,32767)}function vt(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function ii(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 Et=(n,t,e,i)=>ii(n,e,i?s=>{const o=n[s][t];return o<e||o===e&&n[s+1][t]===e}:s=>n[s][t]<e),Xr=(n,t,e)=>ii(n,e,i=>n[i][t]>=e);function qr(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 hs=["push","pop","shift","splice","unshift"];function Kr(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),hs.forEach(e=>{const i="_onData"+ti(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 fs(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)&&(hs.forEach(o=>{delete n[o]}),delete n._chartjs)}function us(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const ps=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function ms(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,ps.call(window,()=>{i=!1,n.apply(t,e)}))}}function Gr(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const si=n=>n==="start"?"left":n==="end"?"right":"center",at=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Jr=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function gs(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:d,max:h,minDefined:f,maxDefined:u}=a.getUserBounds();f&&(s=it(Math.min(Et(r,l,d).lo,e?i:Et(t,l,a.getPixelForValue(d)).lo),0,i-1)),u?o=it(Math.max(Et(r,a.axis,h,!0).hi+1,e?0:Et(t,l,a.getPixelForValue(h),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function bs(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 dn=n=>n===0||n===1,ys=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*K/e)),_s=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*K/e)+1,Be={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*tt)+1,easeOutSine:n=>Math.sin(n*tt),easeInOutSine:n=>-.5*(Math.cos(q*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=>dn(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=>dn(n)?n:ys(n,.075,.3),easeOutElastic:n=>dn(n)?n:_s(n,.075,.3),easeInOutElastic(n){return dn(n)?n:n<.5?.5*ys(n*2,.1125,.45):.5+.5*_s(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-Be.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?Be.easeInBounce(n*2)*.5:Be.easeOutBounce(n*2-1)*.5+.5};function oi(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function xs(n){return oi(n)?n:new Ce(n)}function ai(n){return oi(n)?n:new Ce(n).saturate(.5).darken(.1).hexString()}const Zr=["x","y","borderWidth","radius","tension"],Qr=["color","borderColor","backgroundColor"];function tl(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:Qr},numbers:{type:"number",properties:Zr}}),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 el(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const ks=new Map;function nl(n,t){t=t||{};const e=n+JSON.stringify(t);let i=ks.get(e);return i||(i=new Intl.NumberFormat(n,t),ks.set(e,i)),i}function Ve(n,t,e){return nl(t,e).format(n)}const ws={values(n){return X(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 d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),o=il(n,e)}const a=zt(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),Ve(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(zt(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?ws.numeric.call(this,n,t,e):""}};function il(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 hn={formatters:ws};function sl(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:hn.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 Zt=Object.create(null),ri=Object.create(null);function Pe(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 li(n,t,e){return typeof t=="string"?Se(Pe(n,t),e):Se(Pe(n,""),t)}class ol{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)=>ai(s.backgroundColor),this.hoverBorderColor=(i,s)=>ai(s.borderColor),this.hoverColor=(i,s)=>ai(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 li(this,t,e)}get(t){return Pe(this,t)}describe(t,e){return li(ri,t,e)}override(t,e){return li(Zt,t,e)}route(t,e,i,s){const o=Pe(this,t),a=Pe(this,i),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],d=a[s];return R(l)?Object.assign({},d,l):$(l,d)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var Z=new ol({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[tl,el,sl]);function al(n){return!n||I(n.size)||I(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function fn(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 rl(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,d,h,f,u;for(l=0;l<r;l++)if(f=e[l],f!=null&&!X(f))a=fn(n,s,o,a,f);else if(X(f))for(d=0,h=f.length;d<h;d++)u=f[d],u!=null&&!X(u)&&(a=fn(n,s,o,a,u));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 Qt(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 Cs(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function ci(n,t,e,i){Ss(n,t,e,i,null)}function Ss(n,t,e,i,s){let o,a,r,l,d,h,f,u;const p=t.pointStyle,m=t.rotation,g=t.radius;let b=(m||0)*Wr;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(g)||g<=0)){switch(n.beginPath(),p){default:s?n.ellipse(e,i,s/2,g,0,0,K):n.arc(e,i,g,0,K),n.closePath();break;case"triangle":h=s?s/2:g,n.moveTo(e+Math.sin(b)*h,i-Math.cos(b)*g),b+=as,n.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*g),b+=as,n.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*g),n.closePath();break;case"rectRounded":d=g*.516,l=g-d,a=Math.cos(b+Jt)*l,f=Math.cos(b+Jt)*(s?s/2-d:l),r=Math.sin(b+Jt)*l,u=Math.sin(b+Jt)*(s?s/2-d:l),n.arc(e-f,i-r,d,b-q,b-tt),n.arc(e+u,i-a,d,b-tt,b),n.arc(e+f,i+r,d,b,b+tt),n.arc(e-u,i+a,d,b+tt,b+q),n.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,h=s?s/2:l,n.rect(e-h,i-l,2*h,2*l);break}b+=Jt;case"rectRot":f=Math.cos(b)*(s?s/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(s?s/2:g),n.moveTo(e-f,i-r),n.lineTo(e+u,i-a),n.lineTo(e+f,i+r),n.lineTo(e-u,i+a),n.closePath();break;case"crossRot":b+=Jt;case"cross":f=Math.cos(b)*(s?s/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(s?s/2:g),n.moveTo(e-f,i-r),n.lineTo(e+f,i+r),n.moveTo(e+u,i-a),n.lineTo(e-u,i+a);break;case"star":f=Math.cos(b)*(s?s/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(s?s/2:g),n.moveTo(e-f,i-r),n.lineTo(e+f,i+r),n.moveTo(e+u,i-a),n.lineTo(e-u,i+a),b+=Jt,f=Math.cos(b)*(s?s/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(s?s/2:g),n.moveTo(e-f,i-r),n.lineTo(e+f,i+r),n.moveTo(e+u,i-a),n.lineTo(e-u,i+a);break;case"line":a=s?s/2:Math.cos(b)*g,r=Math.sin(b)*g,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:g),i+Math.sin(b)*g);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Bt(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 un(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function pn(n){n.restore()}function ll(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 cl(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 dl(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),I(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 hl(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,d=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,h),n.lineTo(r,h),n.stroke()}}function fl(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function te(n,t,e,i,s,o={}){const a=X(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,d;for(n.save(),n.font=s.string,dl(n,o),l=0;l<a.length;++l)d=a[l],o.backdrop&&fl(n,o.backdrop),r&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),I(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(d,e,i,o.maxWidth)),n.fillText(d,e,i,o.maxWidth),hl(n,e,i,d,o),i+=Number(s.lineHeight);n.restore()}function Oe(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*q,q,!0),n.lineTo(e,i+o-a.bottomLeft),n.arc(e+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,q,tt,!0),n.lineTo(e+s-a.bottomRight,i+o),n.arc(e+s-a.bottomRight,i+o-a.bottomRight,a.bottomRight,tt,0,!0),n.lineTo(e+s,i+a.topRight),n.arc(e+s-a.topRight,i+a.topRight,a.topRight,0,-tt,!0),n.lineTo(e+a.topLeft,i)}const ul=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,pl=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ml(n,t){const e=(""+n).match(ul);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 gl=n=>+n||0;function di(n,t){const e={},i=R(t),s=i?Object.keys(t):t,o=R(n)?i?a=>$(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of s)e[a]=gl(o(a));return e}function Ms(n){return di(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ee(n){return di(n,["topLeft","topRight","bottomLeft","bottomRight"])}function rt(n){const t=Ms(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=$(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let i=$(n.style,t.style);i&&!(""+i).match(pl)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:$(n.family,t.family),lineHeight:ml($(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:$(n.weight,t.weight),string:""};return s.string=al(s),s}function Ae(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&&X(r)&&(r=r[e%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function bl(n,t,e){const{min:i,max:s}=n,o=ns(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 Wt(n,t){return Object.assign(Object.create(n),t)}function hi(n,t=[""],e,i,s=()=>n[0]){const o=e||n;typeof i>"u"&&(i=Vs("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:r=>hi([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 vs(r,l,()=>Ml(l,t,n,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,l){return Ps(r).includes(l)},ownKeys(r){return Ps(r)},set(r,l,d){const h=r._storage||(r._storage=s());return r[l]=h[l]=d,delete r._keys,!0}})}function pe(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ds(n,i),setContext:o=>pe(n,o,e,i),override:o=>pe(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 vs(o,a,()=>_l(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 Ds(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:It(e)?e:()=>e,isIndexable:It(i)?i:()=>i}}const yl=(n,t)=>n?n+ti(t):t,fi=(n,t)=>R(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function vs(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function _l(n,t,e){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;let r=i[t];return It(r)&&a.isScriptable(t)&&(r=xl(t,r,n,e)),X(r)&&r.length&&(r=kl(t,r,n,a.isIndexable)),fi(t,r)&&(r=pe(r,s,o&&o[t],a)),r}function xl(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),fi(n,l)&&(l=ui(s._scopes,s,n,l)),l}function kl(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(R(t[0])){const l=t,d=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const f=ui(d,s,n,h);t.push(pe(f,o,a&&a[n],r))}}return t}function Es(n,t,e){return It(n)?n(t,e):n}const wl=(n,t)=>n===!0?t:typeof n=="string"?Rt(t,n):void 0;function Cl(n,t,e,i,s){for(const o of t){const a=wl(e,o);if(a){n.add(a);const r=Es(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 ui(n,t,e,i){const s=t._rootScopes,o=Es(t._fallback,e,i),a=[...n,...s],r=new Set;r.add(i);let l=Bs(r,a,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=Bs(r,a,o,l,i),l===null)?!1:hi(Array.from(r),[""],s,o,()=>Sl(t,e,i))}function Bs(n,t,e,i,s){for(;e;)e=Cl(n,t,e,i,s);return e}function Sl(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return X(s)&&R(e)?e:s||{}}function Ml(n,t,e,i){let s;for(const o of t)if(s=Vs(yl(o,n),e),typeof s<"u")return fi(n,s)?ui(e,i,n,s):s}function Vs(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Ps(n){let t=n._keys;return t||(t=n._keys=Dl(n._scopes)),t}function Dl(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 Os(n,t,e,i){const{iScale:s}=n,{key:o="r"}=this._parsing,a=new Array(i);let r,l,d,h;for(r=0,l=i;r<l;++r)d=r+e,h=t[d],a[r]={r:s.parse(Rt(h,o),d)};return a}const vl=Number.EPSILON||1e-14,me=(n,t)=>t<n.length&&!n[t].skip&&n[t],As=n=>n==="x"?"y":"x";function El(n,t,e,i){const s=n.skip?t:n,o=t,a=e.skip?t:e,r=ni(o,s),l=ni(a,o);let d=r/(r+l),h=l/(r+l);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const f=i*d,u=i*h;return{previous:{x:o.x-f*(a.x-s.x),y:o.y-f*(a.y-s.y)},next:{x:o.x+u*(a.x-s.x),y:o.y+u*(a.y-s.y)}}}function Bl(n,t,e){const i=n.length;let s,o,a,r,l,d=me(n,0);for(let h=0;h<i-1;++h)if(l=d,d=me(n,h+1),!(!l||!d)){if(ve(t[h],0,vl)){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 Vl(n,t,e="x"){const i=As(e),s=n.length;let o,a,r,l=me(n,0);for(let d=0;d<s;++d){if(a=r,r=l,l=me(n,d+1),!r)continue;const h=r[e],f=r[i];a&&(o=(h-a[e])/3,r[`cp1${e}`]=h-o,r[`cp1${i}`]=f-o*t[d]),l&&(o=(l[e]-h)/3,r[`cp2${e}`]=h+o,r[`cp2${i}`]=f+o*t[d])}}function Pl(n,t="x"){const e=As(t),i=n.length,s=Array(i).fill(0),o=Array(i);let a,r,l,d=me(n,0);for(a=0;a<i;++a)if(r=l,l=d,d=me(n,a+1),!!l){if(d){const h=d[t]-l[t];s[a]=h!==0?(d[e]-l[e])/h:0}o[a]=r?d?kt(s[a-1])!==kt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}Bl(n,s,o),Vl(n,o,t)}function mn(n,t,e){return Math.max(Math.min(n,e),t)}function Ol(n,t){let e,i,s,o,a,r=Bt(n[0],t);for(e=0,i=n.length;e<i;++e)a=o,o=r,r=e<i-1&&Bt(n[e+1],t),o&&(s=n[e],a&&(s.cp1x=mn(s.cp1x,t.left,t.right),s.cp1y=mn(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=mn(s.cp2x,t.left,t.right),s.cp2y=mn(s.cp2y,t.top,t.bottom)))}function Al(n,t,e,i,s){let o,a,r,l;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")Pl(n,s);else{let d=i?n[n.length-1]:n[0];for(o=0,a=n.length;o<a;++o)r=n[o],l=El(d,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,d=r}t.capBezierPoints&&Ol(n,e)}function Ts(){return typeof window<"u"&&typeof document<"u"}function pi(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function gn(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 bn=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Tl(n,t){return bn(n).getPropertyValue(t)}const Fl=["top","right","bottom","left"];function ne(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Fl[s];i[o]=parseFloat(n[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Ll=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Nl(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i;let a=!1,r,l;if(Ll(s,o,n.target))r=s,l=o;else{const d=t.getBoundingClientRect();r=i.clientX-d.left,l=i.clientY-d.top,a=!0}return{x:r,y:l,box:a}}function ie(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=bn(e),o=s.boxSizing==="border-box",a=ne(s,"padding"),r=ne(s,"border","width"),{x:l,y:d,box:h}=Nl(n,e),f=a.left+(h&&r.left),u=a.top+(h&&r.top);let{width:p,height:m}=t;return o&&(p-=a.width+r.width,m-=a.height+r.height),{x:Math.round((l-f)/p*e.width/i),y:Math.round((d-u)/m*e.height/i)}}function $l(n,t,e){let i,s;if(t===void 0||e===void 0){const o=pi(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{const a=o.getBoundingClientRect(),r=bn(o),l=ne(r,"border","width"),d=ne(r,"padding");t=a.width-d.width-l.width,e=a.height-d.height-l.height,i=gn(r.maxWidth,o,"clientWidth"),s=gn(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||cn,maxHeight:s||cn}}const yn=n=>Math.round(n*10)/10;function Rl(n,t,e,i){const s=bn(n),o=ne(s,"margin"),a=gn(s.maxWidth,n,"clientWidth")||cn,r=gn(s.maxHeight,n,"clientHeight")||cn,l=$l(n,t,e);let{width:d,height:h}=l;if(s.boxSizing==="content-box"){const u=ne(s,"border","width"),p=ne(s,"padding");d-=p.width+u.width,h-=p.height+u.height}return d=Math.max(0,d-o.width),h=Math.max(0,i?d/i:h-o.height),d=yn(Math.min(d,a,l.maxWidth)),h=yn(Math.min(h,r,l.maxHeight)),d&&!h&&(h=yn(d/2)),(t!==void 0||e!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,d=yn(Math.floor(h*i))),{width:d,height:h}}function Fs(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 Il=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=Tl(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function se(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function zl(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 Wl(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},a=se(n,s,e),r=se(s,o,e),l=se(o,t,e),d=se(a,r,e),h=se(r,l,e);return se(d,h,e)}const Hl=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}}},jl=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function ge(n,t,e){return n?Hl(t,e):jl()}function Ns(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 $s(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Rs(n){return n==="angle"?{between:Ee,compare:Yr,normalize:pt}:{between:vt,compare:(t,e)=>t-e,normalize:t=>t}}function Is({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 Yl(n,t,e){const{property:i,start:s,end:o}=e,{between:a,normalize:r}=Rs(i),l=t.length;let{start:d,end:h,loop:f}=n,u,p;if(f){for(d+=l,h+=l,u=0,p=l;u<p&&a(r(t[d%l][i]),s,o);++u)d--,h--;d%=l,h%=l}return h<d&&(h+=l),{start:d,end:h,loop:f,style:n.style}}function zs(n,t,e){if(!e)return[n];const{property:i,start:s,end:o}=e,a=t.length,{compare:r,between:l,normalize:d}=Rs(i),{start:h,end:f,loop:u,style:p}=Yl(n,t,e),m=[];let g=!1,b=null,y,x,k;const w=()=>l(s,k,y)&&r(s,k)!==0,_=()=>r(o,y)===0||l(o,k,y),C=()=>g||w(),M=()=>!g||_();for(let v=h,T=h;v<=f;++v)x=t[v%a],!x.skip&&(y=d(x[i]),y!==k&&(g=l(y,s,o),b===null&&C()&&(b=r(y,s)===0?v:T),b!==null&&M()&&(m.push(Is({start:b,end:v,loop:u,count:a,style:p})),b=null),T=v,k=y));return b!==null&&m.push(Is({start:b,end:f,loop:u,count:a,style:p})),m}function Ws(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const o=zs(i[s],n.points,t);o.length&&e.push(...o)}return e}function Ul(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 Xl(n,t,e,i){const s=n.length,o=[];let a=t,r=n[t],l;for(l=t+1;l<=e;++l){const d=n[l%s];d.skip||d.stop?r.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=a=d.stop?l:null):(a=l,r.skip&&(t=l)),r=d}return a!==null&&o.push({start:t%s,end:a%s,loop:i}),o}function ql(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const o=!!n._loop,{start:a,end:r}=Ul(e,s,o,i);if(i===!0)return Hs(n,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+s:r,d=!!n._fullLoop&&a===0&&r===s-1;return Hs(n,Xl(e,a,l,d),e,t)}function Hs(n,t,e,i){return!i||!i.setContext||!e?t:Kl(n,t,e,i)}function Kl(n,t,e,i){const s=n._chart.getContext(),o=js(n.options),{_datasetIndex:a,options:{spanGaps:r}}=n,l=e.length,d=[];let h=o,f=t[0].start,u=f;function p(m,g,b,y){const x=r?-1:1;if(m!==g){for(m+=l;e[m%l].skip;)m-=x;for(;e[g%l].skip;)g+=x;m%l!==g%l&&(d.push({start:m%l,end:g%l,loop:b,style:y}),h=y,f=g%l)}}for(const m of t){f=r?f:m.start;let g=e[f%l],b;for(u=f+1;u<=m.end;u++){const y=e[u%l];b=js(i.setContext(Wt(s,{type:"segment",p0:g,p1:y,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),Gl(b,h)&&p(f,u-1,m.loop,h),g=y,h=b}f<u-1&&p(f,u-1,m.loop,h)}return d}function js(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Gl(n,t){if(!t)return!1;const e=[],i=function(s,o){return oi(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
18
+ */function Dt(){}const Hr=(()=>{let n=0;return()=>n++})();function z(n){return n===null||typeof n>"u"}function X(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 $(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function J(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function ut(n,t){return J(n)?n:t}function R(n,t){return typeof n>"u"?t:n}const jr=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,os=(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 H(n,t,e,i){let s,o,a;if(X(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($(n))for(a=Object.keys(n),o=a.length,s=0;s<o;s++)t.call(e,n[a[s]],a[s])}function ln(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 cn(n){if(X(n))return n.map(cn);if($(n)){const t=Object.create(null),e=Object.keys(n),i=e.length;let s=0;for(;s<i;++s)t[e[s]]=cn(n[e[s]]);return t}return n}function as(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Yr(n,t,e,i){if(!as(n))return;const s=t[n],o=e[n];$(s)&&$(o)?De(s,o,i):t[n]=cn(o)}function De(n,t,e){const i=X(t)?t:[t],s=i.length;if(!$(n))return n;e=e||{};const o=e.merger||Yr;let a;for(let r=0;r<s;++r){if(a=i[r],!$(a))continue;const l=Object.keys(a);for(let d=0,h=l.length;d<h;++d)o(l[d],n,a,e)}return n}function ve(n,t){return De(n,t,{merger:Ur})}function Ur(n,t,e){if(!as(n))return;const i=t[n],s=e[n];$(i)&&$(s)?ve(i,s):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=cn(s))}const rs={"":n=>n,x:n=>n.x,y:n=>n.y};function Xr(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 qr(n){const t=Xr(n);return e=>{for(const i of t){if(i==="")break;e=e&&e[i]}return e}}function It(n,t){return(rs[t]||(rs[t]=qr(t)))(n)}function ii(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Ee=n=>typeof n<"u",Wt=n=>typeof n=="function",ls=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Kr(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const q=Math.PI,K=2*q,Gr=K+q,dn=Number.POSITIVE_INFINITY,Jr=q/180,tt=q/2,Jt=q/4,cs=q*2/3,Ht=Math.log10,kt=Math.sign;function Be(n,t,e){return Math.abs(n-t)<e}function ds(n){const t=Math.round(n);n=Be(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Ht(n))),i=n/e;return(i<=1?1:i<=2?2:i<=5?5:10)*e}function Zr(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 me(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Qr(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function hs(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 _t(n){return n*(q/180)}function si(n){return n*(180/q)}function fs(n){if(!J(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function us(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*q&&(o+=K),{angle:o,distance:s}}function oi(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function tl(n,t){return(n-t+Gr)%K-q}function pt(n){return(n%K+K)%K}function Ve(n,t,e,i){const s=pt(n),o=pt(t),a=pt(e),r=pt(o-s),l=pt(a-s),d=pt(s-o),h=pt(s-a);return s===o||s===a||i&&o===a||r>l&&d<h}function st(n,t,e){return Math.max(t,Math.min(e,n))}function el(n){return st(n,-32768,32767)}function vt(n,t,e,i=1e-6){return n>=Math.min(t,e)-i&&n<=Math.max(t,e)+i}function ai(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 Et=(n,t,e,i)=>ai(n,e,i?s=>{const o=n[s][t];return o<e||o===e&&n[s+1][t]===e}:s=>n[s][t]<e),nl=(n,t,e)=>ai(n,e,i=>n[i][t]>=e);function il(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 ps=["push","pop","shift","splice","unshift"];function sl(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),ps.forEach(e=>{const i="_onData"+ii(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 ms(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)&&(ps.forEach(o=>{delete n[o]}),delete n._chartjs)}function gs(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const bs=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function ys(n,t){let e=[],i=!1;return function(...s){e=s,i||(i=!0,bs.call(window,()=>{i=!1,n.apply(t,e)}))}}function ol(n,t){let e;return function(...i){return t?(clearTimeout(e),e=setTimeout(n,t,i)):n.apply(this,i),t}}const ri=n=>n==="start"?"left":n==="end"?"right":"center",at=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,al=(n,t,e,i)=>n===(i?"left":"right")?e:n==="center"?(t+e)/2:t;function _s(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:d,max:h,minDefined:f,maxDefined:u}=a.getUserBounds();f&&(s=st(Math.min(Et(r,l,d).lo,e?i:Et(t,l,a.getPixelForValue(d)).lo),0,i-1)),u?o=st(Math.max(Et(r,a.axis,h,!0).hi+1,e?0:Et(t,l,a.getPixelForValue(h),!0).hi+1),s,i)-s:o=i-s}return{start:s,count:o}}function xs(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 hn=n=>n===0||n===1,ks=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*K/e)),ws=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*K/e)+1,Pe={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*tt)+1,easeOutSine:n=>Math.sin(n*tt),easeInOutSine:n=>-.5*(Math.cos(q*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=>hn(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=>hn(n)?n:ks(n,.075,.3),easeOutElastic:n=>hn(n)?n:ws(n,.075,.3),easeInOutElastic(n){return hn(n)?n:n<.5?.5*ks(n*2,.1125,.45):.5+.5*ws(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-Pe.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?Pe.easeInBounce(n*2)*.5:Pe.easeOutBounce(n*2-1)*.5+.5};function li(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ss(n){return li(n)?n:new Me(n)}function ci(n){return li(n)?n:new Me(n).saturate(.5).darken(.1).hexString()}const rl=["x","y","borderWidth","radius","tension"],ll=["color","borderColor","backgroundColor"];function cl(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:ll},numbers:{type:"number",properties:rl}}),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 dl(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Cs=new Map;function hl(n,t){t=t||{};const e=n+JSON.stringify(t);let i=Cs.get(e);return i||(i=new Intl.NumberFormat(n,t),Cs.set(e,i)),i}function Oe(n,t,e){return hl(t,e).format(n)}const Ms={values(n){return X(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 d=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(d<1e-4||d>1e15)&&(s="scientific"),o=fl(n,e)}const a=Ht(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),Oe(n,i,l)},logarithmic(n,t,e){if(n===0)return"0";const i=e[t].significand||n/Math.pow(10,Math.floor(Ht(n)));return[1,2,3,5,10,15].includes(i)||t>.8*e.length?Ms.numeric.call(this,n,t,e):""}};function fl(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 fn={formatters:Ms};function ul(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:fn.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 Zt=Object.create(null),di=Object.create(null);function Ae(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 hi(n,t,e){return typeof t=="string"?De(Ae(n,t),e):De(Ae(n,""),t)}class pl{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)=>ci(s.backgroundColor),this.hoverBorderColor=(i,s)=>ci(s.borderColor),this.hoverColor=(i,s)=>ci(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 hi(this,t,e)}get(t){return Ae(this,t)}describe(t,e){return hi(di,t,e)}override(t,e){return hi(Zt,t,e)}route(t,e,i,s){const o=Ae(this,t),a=Ae(this,i),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],d=a[s];return $(l)?Object.assign({},d,l):R(l,d)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var Z=new pl({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[cl,dl,ul]);function ml(n){return!n||z(n.size)||z(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function un(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 gl(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,d,h,f,u;for(l=0;l<r;l++)if(f=e[l],f!=null&&!X(f))a=un(n,s,o,a,f);else if(X(f))for(d=0,h=f.length;d<h;d++)u=f[d],u!=null&&!X(u)&&(a=un(n,s,o,a,u));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 Qt(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 Ds(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function fi(n,t,e,i){vs(n,t,e,i,null)}function vs(n,t,e,i,s){let o,a,r,l,d,h,f,u;const p=t.pointStyle,m=t.rotation,g=t.radius;let b=(m||0)*Jr;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(g)||g<=0)){switch(n.beginPath(),p){default:s?n.ellipse(e,i,s/2,g,0,0,K):n.arc(e,i,g,0,K),n.closePath();break;case"triangle":h=s?s/2:g,n.moveTo(e+Math.sin(b)*h,i-Math.cos(b)*g),b+=cs,n.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*g),b+=cs,n.lineTo(e+Math.sin(b)*h,i-Math.cos(b)*g),n.closePath();break;case"rectRounded":d=g*.516,l=g-d,a=Math.cos(b+Jt)*l,f=Math.cos(b+Jt)*(s?s/2-d:l),r=Math.sin(b+Jt)*l,u=Math.sin(b+Jt)*(s?s/2-d:l),n.arc(e-f,i-r,d,b-q,b-tt),n.arc(e+u,i-a,d,b-tt,b),n.arc(e+f,i+r,d,b,b+tt),n.arc(e-u,i+a,d,b+tt,b+q),n.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*g,h=s?s/2:l,n.rect(e-h,i-l,2*h,2*l);break}b+=Jt;case"rectRot":f=Math.cos(b)*(s?s/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(s?s/2:g),n.moveTo(e-f,i-r),n.lineTo(e+u,i-a),n.lineTo(e+f,i+r),n.lineTo(e-u,i+a),n.closePath();break;case"crossRot":b+=Jt;case"cross":f=Math.cos(b)*(s?s/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(s?s/2:g),n.moveTo(e-f,i-r),n.lineTo(e+f,i+r),n.moveTo(e+u,i-a),n.lineTo(e-u,i+a);break;case"star":f=Math.cos(b)*(s?s/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(s?s/2:g),n.moveTo(e-f,i-r),n.lineTo(e+f,i+r),n.moveTo(e+u,i-a),n.lineTo(e-u,i+a),b+=Jt,f=Math.cos(b)*(s?s/2:g),a=Math.cos(b)*g,r=Math.sin(b)*g,u=Math.sin(b)*(s?s/2:g),n.moveTo(e-f,i-r),n.lineTo(e+f,i+r),n.moveTo(e+u,i-a),n.lineTo(e-u,i+a);break;case"line":a=s?s/2:Math.cos(b)*g,r=Math.sin(b)*g,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:g),i+Math.sin(b)*g);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Bt(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 pn(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function mn(n){n.restore()}function bl(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 yl(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 _l(n,t){t.translation&&n.translate(t.translation[0],t.translation[1]),z(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 xl(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,d=e+o.actualBoundingBoxDescent,h=s.strikethrough?(l+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(a,h),n.lineTo(r,h),n.stroke()}}function kl(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function te(n,t,e,i,s,o={}){const a=X(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,d;for(n.save(),n.font=s.string,_l(n,o),l=0;l<a.length;++l)d=a[l],o.backdrop&&kl(n,o.backdrop),r&&(o.strokeColor&&(n.strokeStyle=o.strokeColor),z(o.strokeWidth)||(n.lineWidth=o.strokeWidth),n.strokeText(d,e,i,o.maxWidth)),n.fillText(d,e,i,o.maxWidth),xl(n,e,i,d,o),i+=Number(s.lineHeight);n.restore()}function Fe(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*q,q,!0),n.lineTo(e,i+o-a.bottomLeft),n.arc(e+a.bottomLeft,i+o-a.bottomLeft,a.bottomLeft,q,tt,!0),n.lineTo(e+s-a.bottomRight,i+o),n.arc(e+s-a.bottomRight,i+o-a.bottomRight,a.bottomRight,tt,0,!0),n.lineTo(e+s,i+a.topRight),n.arc(e+s-a.topRight,i+a.topRight,a.topRight,0,-tt,!0),n.lineTo(e+a.topLeft,i)}const wl=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Sl=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Cl(n,t){const e=(""+n).match(wl);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 Ml=n=>+n||0;function ui(n,t){const e={},i=$(t),s=i?Object.keys(t):t,o=$(n)?i?a=>R(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of s)e[a]=Ml(o(a));return e}function Es(n){return ui(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ee(n){return ui(n,["topLeft","topRight","bottomLeft","bottomRight"])}function rt(n){const t=Es(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(Sl)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const s={family:R(n.family,t.family),lineHeight:Cl(R(n.lineHeight,t.lineHeight),e),size:e,style:i,weight:R(n.weight,t.weight),string:""};return s.string=ml(s),s}function Te(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&&X(r)&&(r=r[e%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function Dl(n,t,e){const{min:i,max:s}=n,o=os(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 jt(n,t){return Object.assign(Object.create(n),t)}function pi(n,t=[""],e,i,s=()=>n[0]){const o=e||n;typeof i>"u"&&(i=As("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:o,_fallback:i,_getTarget:s,override:r=>pi([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 Vs(r,l,()=>Fl(l,t,n,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,l){return Fs(r).includes(l)},ownKeys(r){return Fs(r)},set(r,l,d){const h=r._storage||(r._storage=s());return r[l]=h[l]=d,delete r._keys,!0}})}function ge(n,t,e,i){const s={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Bs(n,i),setContext:o=>ge(n,o,e,i),override:o=>ge(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 Vs(o,a,()=>El(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 Bs(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:Wt(e)?e:()=>e,isIndexable:Wt(i)?i:()=>i}}const vl=(n,t)=>n?n+ii(t):t,mi=(n,t)=>$(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Vs(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const i=e();return n[t]=i,i}function El(n,t,e){const{_proxy:i,_context:s,_subProxy:o,_descriptors:a}=n;let r=i[t];return Wt(r)&&a.isScriptable(t)&&(r=Bl(t,r,n,e)),X(r)&&r.length&&(r=Vl(t,r,n,a.isIndexable)),mi(t,r)&&(r=ge(r,s,o&&o[t],a)),r}function Bl(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),mi(n,l)&&(l=gi(s._scopes,s,n,l)),l}function Vl(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($(t[0])){const l=t,d=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const f=gi(d,s,n,h);t.push(ge(f,o,a&&a[n],r))}}return t}function Ps(n,t,e){return Wt(n)?n(t,e):n}const Pl=(n,t)=>n===!0?t:typeof n=="string"?It(t,n):void 0;function Ol(n,t,e,i,s){for(const o of t){const a=Pl(e,o);if(a){n.add(a);const r=Ps(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 gi(n,t,e,i){const s=t._rootScopes,o=Ps(t._fallback,e,i),a=[...n,...s],r=new Set;r.add(i);let l=Os(r,a,e,o||e,i);return l===null||typeof o<"u"&&o!==e&&(l=Os(r,a,o,l,i),l===null)?!1:pi(Array.from(r),[""],s,o,()=>Al(t,e,i))}function Os(n,t,e,i,s){for(;e;)e=Ol(n,t,e,i,s);return e}function Al(n,t,e){const i=n._getTarget();t in i||(i[t]={});const s=i[t];return X(s)&&$(e)?e:s||{}}function Fl(n,t,e,i){let s;for(const o of t)if(s=As(vl(o,n),e),typeof s<"u")return mi(n,s)?gi(e,i,n,s):s}function As(n,t){for(const e of t){if(!e)continue;const i=e[n];if(typeof i<"u")return i}}function Fs(n){let t=n._keys;return t||(t=n._keys=Tl(n._scopes)),t}function Tl(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 Ts(n,t,e,i){const{iScale:s}=n,{key:o="r"}=this._parsing,a=new Array(i);let r,l,d,h;for(r=0,l=i;r<l;++r)d=r+e,h=t[d],a[r]={r:s.parse(It(h,o),d)};return a}const Ll=Number.EPSILON||1e-14,be=(n,t)=>t<n.length&&!n[t].skip&&n[t],Ls=n=>n==="x"?"y":"x";function Nl(n,t,e,i){const s=n.skip?t:n,o=t,a=e.skip?t:e,r=oi(o,s),l=oi(a,o);let d=r/(r+l),h=l/(r+l);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const f=i*d,u=i*h;return{previous:{x:o.x-f*(a.x-s.x),y:o.y-f*(a.y-s.y)},next:{x:o.x+u*(a.x-s.x),y:o.y+u*(a.y-s.y)}}}function Rl(n,t,e){const i=n.length;let s,o,a,r,l,d=be(n,0);for(let h=0;h<i-1;++h)if(l=d,d=be(n,h+1),!(!l||!d)){if(Be(t[h],0,Ll)){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 $l(n,t,e="x"){const i=Ls(e),s=n.length;let o,a,r,l=be(n,0);for(let d=0;d<s;++d){if(a=r,r=l,l=be(n,d+1),!r)continue;const h=r[e],f=r[i];a&&(o=(h-a[e])/3,r[`cp1${e}`]=h-o,r[`cp1${i}`]=f-o*t[d]),l&&(o=(l[e]-h)/3,r[`cp2${e}`]=h+o,r[`cp2${i}`]=f+o*t[d])}}function zl(n,t="x"){const e=Ls(t),i=n.length,s=Array(i).fill(0),o=Array(i);let a,r,l,d=be(n,0);for(a=0;a<i;++a)if(r=l,l=d,d=be(n,a+1),!!l){if(d){const h=d[t]-l[t];s[a]=h!==0?(d[e]-l[e])/h:0}o[a]=r?d?kt(s[a-1])!==kt(s[a])?0:(s[a-1]+s[a])/2:s[a-1]:s[a]}Rl(n,s,o),$l(n,o,t)}function gn(n,t,e){return Math.max(Math.min(n,e),t)}function Il(n,t){let e,i,s,o,a,r=Bt(n[0],t);for(e=0,i=n.length;e<i;++e)a=o,o=r,r=e<i-1&&Bt(n[e+1],t),o&&(s=n[e],a&&(s.cp1x=gn(s.cp1x,t.left,t.right),s.cp1y=gn(s.cp1y,t.top,t.bottom)),r&&(s.cp2x=gn(s.cp2x,t.left,t.right),s.cp2y=gn(s.cp2y,t.top,t.bottom)))}function Wl(n,t,e,i,s){let o,a,r,l;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")zl(n,s);else{let d=i?n[n.length-1]:n[0];for(o=0,a=n.length;o<a;++o)r=n[o],l=Nl(d,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,d=r}t.capBezierPoints&&Il(n,e)}function Ns(){return typeof window<"u"&&typeof document<"u"}function bi(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function bn(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 yn=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Hl(n,t){return yn(n).getPropertyValue(t)}const jl=["top","right","bottom","left"];function ne(n,t,e){const i={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=jl[s];i[o]=parseFloat(n[t+"-"+o+e])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Yl=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function Ul(n,t){const e=n.touches,i=e&&e.length?e[0]:n,{offsetX:s,offsetY:o}=i;let a=!1,r,l;if(Yl(s,o,n.target))r=s,l=o;else{const d=t.getBoundingClientRect();r=i.clientX-d.left,l=i.clientY-d.top,a=!0}return{x:r,y:l,box:a}}function ie(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:i}=t,s=yn(e),o=s.boxSizing==="border-box",a=ne(s,"padding"),r=ne(s,"border","width"),{x:l,y:d,box:h}=Ul(n,e),f=a.left+(h&&r.left),u=a.top+(h&&r.top);let{width:p,height:m}=t;return o&&(p-=a.width+r.width,m-=a.height+r.height),{x:Math.round((l-f)/p*e.width/i),y:Math.round((d-u)/m*e.height/i)}}function Xl(n,t,e){let i,s;if(t===void 0||e===void 0){const o=bi(n);if(!o)t=n.clientWidth,e=n.clientHeight;else{const a=o.getBoundingClientRect(),r=yn(o),l=ne(r,"border","width"),d=ne(r,"padding");t=a.width-d.width-l.width,e=a.height-d.height-l.height,i=bn(r.maxWidth,o,"clientWidth"),s=bn(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:i||dn,maxHeight:s||dn}}const _n=n=>Math.round(n*10)/10;function ql(n,t,e,i){const s=yn(n),o=ne(s,"margin"),a=bn(s.maxWidth,n,"clientWidth")||dn,r=bn(s.maxHeight,n,"clientHeight")||dn,l=Xl(n,t,e);let{width:d,height:h}=l;if(s.boxSizing==="content-box"){const u=ne(s,"border","width"),p=ne(s,"padding");d-=p.width+u.width,h-=p.height+u.height}return d=Math.max(0,d-o.width),h=Math.max(0,i?d/i:h-o.height),d=_n(Math.min(d,a,l.maxWidth)),h=_n(Math.min(h,r,l.maxHeight)),d&&!h&&(h=_n(d/2)),(t!==void 0||e!==void 0)&&i&&l.height&&h>l.height&&(h=l.height,d=_n(Math.floor(h*i))),{width:d,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 Kl=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 $s(n,t){const e=Hl(n,t),i=e&&e.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function se(n,t,e,i){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Gl(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 Jl(n,t,e,i){const s={x:n.cp2x,y:n.cp2y},o={x:t.cp1x,y:t.cp1y},a=se(n,s,e),r=se(s,o,e),l=se(o,t,e),d=se(a,r,e),h=se(r,l,e);return se(d,h,e)}const Zl=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}}},Ql=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function ye(n,t,e){return n?Zl(t,e):Ql()}function zs(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 Is(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function Ws(n){return n==="angle"?{between:Ve,compare:tl,normalize:pt}:{between:vt,compare:(t,e)=>t-e,normalize:t=>t}}function Hs({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 tc(n,t,e){const{property:i,start:s,end:o}=e,{between:a,normalize:r}=Ws(i),l=t.length;let{start:d,end:h,loop:f}=n,u,p;if(f){for(d+=l,h+=l,u=0,p=l;u<p&&a(r(t[d%l][i]),s,o);++u)d--,h--;d%=l,h%=l}return h<d&&(h+=l),{start:d,end:h,loop:f,style:n.style}}function js(n,t,e){if(!e)return[n];const{property:i,start:s,end:o}=e,a=t.length,{compare:r,between:l,normalize:d}=Ws(i),{start:h,end:f,loop:u,style:p}=tc(n,t,e),m=[];let g=!1,b=null,y,x,w;const k=()=>l(s,w,y)&&r(s,w)!==0,_=()=>r(o,y)===0||l(o,w,y),S=()=>g||k(),C=()=>!g||_();for(let v=h,A=h;v<=f;++v)x=t[v%a],!x.skip&&(y=d(x[i]),y!==w&&(g=l(y,s,o),b===null&&S()&&(b=r(y,s)===0?v:A),b!==null&&C()&&(m.push(Hs({start:b,end:v,loop:u,count:a,style:p})),b=null),A=v,w=y));return b!==null&&m.push(Hs({start:b,end:f,loop:u,count:a,style:p})),m}function Ys(n,t){const e=[],i=n.segments;for(let s=0;s<i.length;s++){const o=js(i[s],n.points,t);o.length&&e.push(...o)}return e}function ec(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 nc(n,t,e,i){const s=n.length,o=[];let a=t,r=n[t],l;for(l=t+1;l<=e;++l){const d=n[l%s];d.skip||d.stop?r.skip||(i=!1,o.push({start:t%s,end:(l-1)%s,loop:i}),t=a=d.stop?l:null):(a=l,r.skip&&(t=l)),r=d}return a!==null&&o.push({start:t%s,end:a%s,loop:i}),o}function ic(n,t){const e=n.points,i=n.options.spanGaps,s=e.length;if(!s)return[];const o=!!n._loop,{start:a,end:r}=ec(e,s,o,i);if(i===!0)return Us(n,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+s:r,d=!!n._fullLoop&&a===0&&r===s-1;return Us(n,nc(e,a,l,d),e,t)}function Us(n,t,e,i){return!i||!i.setContext||!e?t:sc(n,t,e,i)}function sc(n,t,e,i){const s=n._chart.getContext(),o=Xs(n.options),{_datasetIndex:a,options:{spanGaps:r}}=n,l=e.length,d=[];let h=o,f=t[0].start,u=f;function p(m,g,b,y){const x=r?-1:1;if(m!==g){for(m+=l;e[m%l].skip;)m-=x;for(;e[g%l].skip;)g+=x;m%l!==g%l&&(d.push({start:m%l,end:g%l,loop:b,style:y}),h=y,f=g%l)}}for(const m of t){f=r?f:m.start;let g=e[f%l],b;for(u=f+1;u<=m.end;u++){const y=e[u%l];b=Xs(i.setContext(jt(s,{type:"segment",p0:g,p1:y,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),oc(b,h)&&p(f,u-1,m.loop,h),g=y,h=b}f<u-1&&p(f,u-1,m.loop,h)}return d}function Xs(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function oc(n,t){if(!t)return!1;const e=[],i=function(s,o){return li(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(n,i)!==JSON.stringify(t,i)}/*!
19
19
  * Chart.js v4.4.0
20
20
  * https://www.chartjs.org
21
21
  * (c) 2023 Chart.js Contributors
22
22
  * Released under the MIT License
23
- */class Jl{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=ps.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 Vt=new Jl;const Ys="transparent",Zl={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=xs(n||Ys),s=i.valid&&xs(t||Ys);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Ql{constructor(t,e,i,s){const o=e[i];s=Ae([t.to,s,o,t.from]);const a=Ae([t.from,o,s]);this._active=!0,this._fn=t.fn||Zl[t.type||typeof a],this._easing=Be[t.easing]||Be.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=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=Ae([t.to,e,s,t.from]),this._from=Ae([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 Us{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!R(t))return;const e=Object.keys(Z.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!R(o))return;const a={};for(const r of e)a[r]=o[r];(X(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,a)})})}_animateOptions(t,e){const i=e.options,s=ec(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&tc(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 d=a[l];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[d];let f=o[d];const u=i.get(d);if(f)if(u&&f.active()){f.update(u,h,r);continue}else f.cancel();if(!u||!u.duration){t[d]=h;continue}o[d]=f=new Ql(u,t,d,h),s.push(f)}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 Vt.add(this._chart,i),!0}}function tc(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 ec(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 Xs(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 nc(n,t,e){if(e===!1)return!1;const i=Xs(n,e),s=Xs(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function ic(n){let t,e,i,s;return R(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 qs(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,d;if(t!==null){for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===e){if(i.all)continue;break}d=n.values[l],J(d)&&(o||t===0||kt(t)===kt(d))&&(t+=d)}return t}}function sc(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 Gs(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function oc(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function ac(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 rc(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function Js(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 Zs(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=i,l=o.axis,d=a.axis,h=oc(o,a,i),f=t.length;let u;for(let p=0;p<f;++p){const m=t[p],{[l]:g,[d]:b}=m,y=m._stacks||(m._stacks={});u=y[d]=rc(s,h,g),u[r]=b,u._top=Js(u,a,!0,i.type),u._bottom=Js(u,a,!1,i.type);const x=u._visualValues||(u._visualValues={});x[r]=b}}function mi(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function lc(n,t){return Wt(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function cc(n,t,e){return Wt(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Te(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 gi=n=>n==="reset"||n==="none",Qs=(n,t)=>t?n:Object.assign({},n),dc=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:qs(e,!0),values:null};class xt{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=Gs(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&&Te(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(f,u,p,m)=>f==="x"?u:f==="r"?m:p,o=e.xAxisID=$(i.xAxisID,mi(t,"x")),a=e.yAxisID=$(i.yAxisID,mi(t,"y")),r=e.rAxisID=$(i.rAxisID,mi(t,"r")),l=e.indexAxis,d=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(d),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&&fs(this._data,this),t._stacked&&Te(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(R(e))this._data=sc(e);else if(i!==e){if(i){fs(i,this);const s=this._cachedMeta;Te(s),s._parsed=[]}e&&Object.isExtensible(e)&&Kr(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=Gs(e.vScale,e),e.stack!==i.stack&&(s=!0,Te(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&Zs(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,d=t>0&&i._parsed[t-1],h,f,u;if(this._parsing===!1)i._parsed=s,i._sorted=!0,u=s;else{X(s[t])?u=this.parseArrayData(i,s,t,e):R(s[t])?u=this.parseObjectData(i,s,t,e):u=this.parsePrimitiveData(i,s,t,e);const p=()=>f[r]===null||d&&f[r]<d[r];for(h=0;h<e;++h)i._parsed[h+t]=f=u[h],l&&(p()&&(l=!1),d=f);i._sorted=l}a&&Zs(this,u)}parsePrimitiveData(t,e,i,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,d=o.getLabels(),h=o===a,f=new Array(s);let u,p,m;for(u=0,p=s;u<p;++u)m=u+i,f[u]={[r]:h||o.parse(d[m],m),[l]:a.parse(e[m],m)};return f}parseArrayData(t,e,i,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,d,h,f;for(l=0,d=s;l<d;++l)h=l+i,f=e[h],r[l]={x:o.parse(f[0],h),y:a.parse(f[1],h)};return r}parseObjectData(t,e,i,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,d=new Array(s);let h,f,u,p;for(h=0,f=s;h<f;++h)u=h+i,p=e[u],d[h]={x:o.parse(Rt(p,r),u),y:a.parse(Rt(p,l),u)};return d}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:qs(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=dc(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:f}=ac(r);let u,p;function m(){p=s[u];const g=p[r.axis];return!J(p[t.axis])||h>g||f<g}for(u=0;u<a&&!(!m()&&(this.updateRangeFromParsed(d,t,p,l),o));++u);if(o){for(u=a-1;u>=0;--u)if(!m()){this.updateRangeFromParsed(d,t,p,l);break}}return d}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],J(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=ic($(this.options.clip,nc(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,d=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,o,r,l),h=r;h<r+l;++h){const f=s[h];f.hidden||(f.active&&d?a.push(f):f.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=cc(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=lc(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&&De(i);if(r)return Qs(r,l);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),f=s?[`${t}Hover`,"hover",t,""]:[t,""],u=d.getOptionScopes(this.getDataset(),h),p=Object.keys(Z.elements[t]),m=()=>this.getContext(i,s,e),g=d.resolveNamedOptions(u,p,m,f);return g.$shared&&(g.$shared=l,o[a]=Object.freeze(Qs(g,l))),g}_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,f=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),f);l=h.createResolver(u,this.getContext(t,i,e))}const d=new Us(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||gi(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){gi(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!gi(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,d]of this._syncList)this[r](l,d);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=d=>{for(d.length+=e,r=d.length-1;r>=a;r--)d[r]=d[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&&Te(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])}}B(xt,"defaults",{}),B(xt,"datasetElementType",null),B(xt,"dataElementType",null);function hc(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=us(i.sort((s,o)=>s-o))}return n._cache.$bar}function fc(n){const t=n.iScale,e=hc(t,n.type);let i=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(De(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 uc(n,t,e,i){const s=e.barThickness;let o,a;return I(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 pc(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 d=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/i,ratio:e.barPercentage,start:d}}function mc(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,d=r;Math.abs(a)>Math.abs(r)&&(l=r,d=a),t[e.axis]=d,t._custom={barStart:l,barEnd:d,start:s,end:o,min:a,max:r}}function to(n,t,e,i){return X(n)?mc(n,t,e,i):t[e.axis]=e.parse(n,i),t}function eo(n,t,e,i){const s=n.iScale,o=n.vScale,a=s.getLabels(),r=s===o,l=[];let d,h,f,u;for(d=e,h=e+i;d<h;++d)u=t[d],f={},f[s.axis]=r||s.parse(a[d],d),l.push(to(u,f,o,d));return l}function bi(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function gc(n,t,e){return n!==0?kt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function bc(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 yc(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:d,bottom:h}=bc(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=d:(e._bottom||0)===i?s=h:(o[no(h,a,r,l)]=!0,s=d)),o[no(s,a,r,l)]=!0,n.borderSkipped=o}function no(n,t,e,i){return i?(n=_c(n,t,e),n=io(n,e,t)):n=io(n,t,e),n}function _c(n,t,e){return n===t?e:n===e?t:n}function io(n,t,e){return n==="start"?t:n==="end"?e:n}function xc(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class _n extends xt{parsePrimitiveData(t,e,i,s){return eo(t,e,i,s)}parseArrayData(t,e,i,s){return eo(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,d=o.axis==="x"?r:l,h=a.axis==="x"?r:l,f=[];let u,p,m,g;for(u=i,p=i+s;u<p;++u)g=e[u],m={},m[o.axis]=o.parse(Rt(g,d),u),f.push(to(Rt(g,h),m,a,u));return f}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=bi(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(),d=r.isHorizontal(),h=this._getRuler(),{sharedOptions:f,includeOptions:u}=this._getSharedOptions(e,s);for(let p=e;p<e+i;p++){const m=this.getParsed(p),g=o||I(m[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,h),y=(m._stacks||{})[r.axis],x={horizontal:d,base:g.base,enableBorderRadius:!y||bi(m._custom)||a===y._top||a===y._bottom,x:d?g.head:b.center,y:d?b.center:g.head,height:d?b.size:Math.abs(g.size),width:d?Math.abs(g.size):b.size};u&&(x.options=f||this.resolveDataElementOptions(p,t[p].active?"active":s));const k=x.options||t[p].options;yc(x,k,y,a),xc(x,k,h.ratio),this.updateElement(t[p],p,x,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 d=l.controller.getParsed(e),h=d&&d[l.vScale.axis];if(I(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||fc(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),d=l._custom,h=bi(d);let f=l[e.axis],u=0,p=i?this.applyStack(e,l,i):f,m,g;p!==f&&(u=p-f,p=f),h&&(f=d.barStart,p=d.barEnd-d.barStart,f!==0&&kt(f)!==kt(d.barEnd)&&(u=0),u+=f);const b=!I(o)&&!h?o:u;let y=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(u+p):m=y,g=m-y,Math.abs(g)<a){g=gc(g,e,r)*a,f===r&&(y-=g/2);const x=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),w=Math.min(x,k),_=Math.max(x,k);y=Math.max(Math.min(y,_),w),m=y+g,i&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(m)-e.getValueForPixel(y))}if(y===e.getPixelForValue(r)){const x=kt(g)*e.getLineWidthForValue(r)/2;y+=x,g-=x}return{size:g,base:y,head:m,center:m+g/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,o=s.skipNull,a=$(s.maxBarThickness,1/0);let r,l;if(e.grouped){const d=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?pc(t,e,s,d):uc(t,e,s,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=h.start+h.chunk*f+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)}}B(_n,"id","bar"),B(_n,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),B(_n,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class xn extends xt{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[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,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),d=a._custom;return{label:i[t]||"",value:"("+r+", "+l+(d?", "+d:"")+")"}}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:d}=this._getSharedOptions(e,s),h=a.axis,f=r.axis;for(let u=e;u<e+i;u++){const p=t[u],m=!o&&this.getParsed(u),g={},b=g[h]=o?a.getPixelForDecimal(.5):a.getPixelForValue(m[h]),y=g[f]=o?r.getBasePixel():r.getPixelForValue(m[f]);g.skip=isNaN(b)||isNaN(y),d&&(g.options=l||this.resolveDataElementOptions(u,p.active?"active":s),o&&(g.options.radius=0)),this.updateElement(p,u,g,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+=$(i&&i._custom,o),s}}B(xn,"id","bubble"),B(xn,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),B(xn,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function kc(n,t,e){let i=1,s=1,o=0,a=0;if(t<K){const r=n,l=r+t,d=Math.cos(r),h=Math.sin(r),f=Math.cos(l),u=Math.sin(l),p=(k,w,_)=>Ee(k,r,l,!0)?1:Math.max(w,w*e,_,_*e),m=(k,w,_)=>Ee(k,r,l,!0)?-1:Math.min(w,w*e,_,_*e),g=p(0,d,f),b=p(tt,h,u),y=m(q,d,f),x=m(q+tt,h,u);i=(g-y)/2,s=(b-x)/2,o=-(g+y)/2,a=-(b+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class oe extends xt{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(R(i[t])){const{key:l="value"}=this._parsing;o=d=>+Rt(i[d],l)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return _t(this.options.rotation-90)}_getCircumference(){return _t(this.options.circumference)}_getRotationExtents(){let t=K,e=-K;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(Fr(this.options.cutout,r),1),d=this._getRingWeight(this.index),{circumference:h,rotation:f}=this._getRotationExtents(),{ratioX:u,ratioY:p,offsetX:m,offsetY:g}=kc(f,h,l),b=(i.width-a)/u,y=(i.height-a)/p,x=Math.max(Math.min(b,y)/2,0),k=ns(this.options.radius,x),w=Math.max(k*l,0),_=(k-w)/this._getVisibleDatasetWeightTotal();this.offsetX=m*k,this.offsetY=g*k,s.total=this.calculateTotal(),this.outerRadius=k-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*d,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/K)}updateElements(t,e,i,s){const o=s==="reset",a=this.chart,r=a.chartArea,d=a.options.animation,h=(r.left+r.right)/2,f=(r.top+r.bottom)/2,u=o&&d.animateScale,p=u?0:this.innerRadius,m=u?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(e,s);let y=this._getRotation(),x;for(x=0;x<e;++x)y+=this._circumference(x,o);for(x=e;x<e+i;++x){const k=this._circumference(x,o),w=t[x],_={x:h+this.offsetX,y:f+this.offsetY,startAngle:y,endAngle:y+k,circumference:k,outerRadius:m,innerRadius:p};b&&(_.options=g||this.resolveDataElementOptions(x,w.active?"active":s)),y+=k,this.updateElement(w,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)?K*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Ve(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($(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}B(oe,"id","doughnut"),B(oe,"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"}),B(oe,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),B(oe,"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 kn extends xt{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}=gs(e,s,a);this._drawStart=r,this._drawCount=l,bs(e)&&(r=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},t),this.updateElements(s,r,l,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s),u=a.axis,p=r.axis,{spanGaps:m,segment:g}=this.options,b=ue(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||s==="none",x=e+i,k=t.length;let w=e>0&&this.getParsed(e-1);for(let _=0;_<k;++_){const C=t[_],M=y?C:{};if(_<e||_>=x){M.skip=!0;continue}const v=this.getParsed(_),T=I(v[p]),A=M[u]=a.getPixelForValue(v[u],_),P=M[p]=o||T?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,v,l):v[p],_);M.skip=isNaN(A)||isNaN(P)||T,M.stop=_>0&&Math.abs(v[u]-w[u])>b,g&&(M.parsed=v,M.raw=d.data[_]),f&&(M.options=h||this.resolveDataElementOptions(_,C.active?"active":s)),y||this.updateElement(C,_,M,s),w=v}}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()}}B(kn,"id","line"),B(kn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),B(kn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Fe extends xt{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=Ve(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return Os.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,d=this._cachedMeta.rScale,h=d.xCenter,f=d.yCenter,u=d.getIndexAngle(0)-.5*q;let p=u,m;const g=360/this.countVisibleElements();for(m=0;m<e;++m)p+=this._computeAngle(m,s,g);for(m=e;m<e+i;m++){const b=t[m];let y=p,x=p+this._computeAngle(m,s,g),k=a.getDataVisibility(m)?d.getDistanceFromCenterForValue(this.getParsed(m).r):0;p=x,o&&(l.animateScale&&(k=0),l.animateRotate&&(y=x=u));const w={x:h,y:f,innerRadius:0,outerRadius:k,startAngle:y,endAngle:x,options:this.resolveDataElementOptions(m,b.active?"active":s)};this.updateElement(b,m,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)?_t(this.resolveDataElementOptions(t,e).angle||i):0}}B(Fe,"id","polarArea"),B(Fe,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),B(Fe,"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 yi extends oe{}B(yi,"id","pie"),B(yi,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class wn extends xt{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 Os.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],d=this.resolveDataElementOptions(r,l.active?"active":s),h=o.getPointPositionForValue(r,this.getParsed(r).r),f=a?o.xCenter:h.x,u=a?o.yCenter:h.y,p={x:f,y:u,angle:h.angle,skip:isNaN(f)||isNaN(u),options:d};this.updateElement(l,r,p,s)}}}B(wn,"id","radar"),B(wn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),B(wn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Cn extends xt{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}=gs(e,i,s);if(this._drawStart=o,this._drawCount=a,bs(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 d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:d},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:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),f=this.getSharedOptions(h),u=this.includeOptions(s,f),p=a.axis,m=r.axis,{spanGaps:g,segment:b}=this.options,y=ue(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let k=e>0&&this.getParsed(e-1);for(let w=e;w<e+i;++w){const _=t[w],C=this.getParsed(w),M=x?_:{},v=I(C[m]),T=M[p]=a.getPixelForValue(C[p],w),A=M[m]=o||v?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,C,l):C[m],w);M.skip=isNaN(T)||isNaN(A)||v,M.stop=w>0&&Math.abs(C[p]-k[p])>y,b&&(M.parsed=C,M.raw=d.data[w]),u&&(M.options=f||this.resolveDataElementOptions(w,_.active?"active":s)),x||this.updateElement(_,w,M,s),k=C}this.updateSharedOptions(f,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}}B(Cn,"id","scatter"),B(Cn,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),B(Cn,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var wc=Object.freeze({__proto__:null,BarController:_n,BubbleController:xn,DoughnutController:oe,LineController:kn,PieController:yi,PolarAreaController:Fe,RadarController:wn,ScatterController:Cn});function ae(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class _i{constructor(t){B(this,"options");this.options=t||{}}static override(t){Object.assign(_i.prototype,t)}init(){}formats(){return ae()}parse(){return ae()}format(){return ae()}add(){return ae()}diff(){return ae()}startOf(){return ae()}endOf(){return ae()}}var Cc={_date:_i};function Sc(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?Xr:Et;if(i){if(s._sharedOptions){const d=o[0],h=typeof d.getRange=="function"&&d.getRange(t);if(h){const f=l(o,t,e-h),u=l(o,t,e+h);return{lo:f.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function Le(n,t,e,i,s){const o=n.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:d,data:h}=o[r],{lo:f,hi:u}=Sc(o[r],t,a,s);for(let p=f;p<=u;++p){const m=h[p];m.skip||i(m,d,p)}}}function Mc(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 xi(n,t,e,i,s){const o=[];return!s&&!n.isPointInArea(t)||Le(n,e,t,function(r,l,d){!s&&!Bt(r,n.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:l,index:d})},!0),o}function Dc(n,t,e,i){let s=[];function o(a,r,l){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:f}=ds(a,{x:t.x,y:t.y});Ee(f,d,h)&&s.push({element:a,datasetIndex:r,index:l})}return Le(n,e,t,o),s}function vc(n,t,e,i,s,o){let a=[];const r=Mc(e);let l=Number.POSITIVE_INFINITY;function d(h,f,u){const p=h.inRange(t.x,t.y,s);if(i&&!p)return;const m=h.getCenterPoint(s);if(!(!!o||n.isPointInArea(m))&&!p)return;const b=r(t,m);b<l?(a=[{element:h,datasetIndex:f,index:u}],l=b):b===l&&a.push({element:h,datasetIndex:f,index:u})}return Le(n,e,t,d),a}function ki(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?Dc(n,t,e,s):vc(n,t,e,i,s,o)}function so(n,t,e,i,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return Le(n,e,t,(l,d,h)=>{l[a](t[e],s)&&(o.push({element:l,datasetIndex:d,index:h}),r=r||l.inRange(t.x,t.y,s))}),i&&!r?[]:o}var Ec={evaluateInteractionItems:Le,modes:{index(n,t,e,i){const s=ie(t,n),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?xi(n,s,o,i,a):ki(n,s,o,!1,i,a),l=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=r[0].index,f=d.data[h];f&&!f.skip&&l.push({element:f,datasetIndex:d.index,index:h})}),l):[]},dataset(n,t,e,i){const s=ie(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?xi(n,s,o,i,a):ki(n,s,o,!1,i,a);if(r.length>0){const l=r[0].datasetIndex,d=n.getDatasetMeta(l).data;r=[];for(let h=0;h<d.length;++h)r.push({element:d[h],datasetIndex:l,index:h})}return r},point(n,t,e,i){const s=ie(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return xi(n,s,o,i,a)},nearest(n,t,e,i){const s=ie(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return ki(n,s,o,e.intersect,i,a)},x(n,t,e,i){const s=ie(t,n);return so(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=ie(t,n);return so(n,s,"y",e.intersect,i)}}};const oo=["left","top","right","bottom"];function Ne(n,t){return n.filter(e=>e.pos===t)}function ao(n,t){return n.filter(e=>oo.indexOf(e.pos)===-1&&e.box.axis===t)}function $e(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 Bc(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 Vc(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:o}=e;if(!i||!oo.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 Pc(n,t){const e=Vc(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,d=e[r.stack],h=d&&r.stackWeight/d.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 Oc(n){const t=Bc(n),e=$e(t.filter(d=>d.box.fullSize),!0),i=$e(Ne(t,"left"),!0),s=$e(Ne(t,"right")),o=$e(Ne(t,"top"),!0),a=$e(Ne(t,"bottom")),r=ao(t,"x"),l=ao(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:Ne(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function ro(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function lo(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 Ac(n,t,e,i){const{pos:s,box:o}=e,a=n.maxPadding;if(!R(s)){e.size&&(n[s]-=e.size);const f=i[e.stack]||{size:0,count:1};f.size=Math.max(f.size,e.horizontal?o.height:o.width),e.size=f.size/f.count,n[s]+=e.size}o.getPadding&&lo(a,o.getPadding());const r=Math.max(0,t.outerWidth-ro(a,n,"left","right")),l=Math.max(0,t.outerHeight-ro(a,n,"top","bottom")),d=r!==n.w,h=l!==n.h;return n.w=r,n.h=l,e.horizontal?{same:d,other:h}:{same:h,other:d}}function Tc(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 Fc(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 Re(n,t,e,i){const s=[];let o,a,r,l,d,h;for(o=0,a=n.length,d=0;o<a;++o){r=n[o],l=r.box,l.update(r.width||t.w,r.height||t.h,Fc(r.horizontal,t));const{same:f,other:u}=Ac(t,e,r,i);d|=f&&s.length,h=h||u,l.fullSize||s.push(r)}return d&&Re(s,t,e,i)||h}function Sn(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 co(n,t,e,i){const s=e.padding;let{x:o,y:a}=t;for(const r of n){const l=r.box,d=i[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/d.weight||1;if(r.horizontal){const f=t.w*h,u=d.size||l.height;De(d.start)&&(a=d.start),l.fullSize?Sn(l,s.left,a,e.outerWidth-s.right-s.left,u):Sn(l,t.left+d.placed,a,f,u),d.start=a,d.placed+=f,a=l.bottom}else{const f=t.h*h,u=d.size||l.width;De(d.start)&&(o=d.start),l.fullSize?Sn(l,o,s.top,u,e.outerHeight-s.bottom-s.top):Sn(l,o,t.top+d.placed,u,f),d.start=o,d.placed+=f,o=l.right}}t.x=o,t.y=a}var lt={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=rt(n.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=Oc(n.boxes),l=r.vertical,d=r.horizontal;H(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},s);lo(u,rt(i));const p=Object.assign({maxPadding:u,w:o,h:a,x:s.left,y:s.top},s),m=Pc(l.concat(d),f);Re(r.fullSize,p,f,m),Re(l,p,f,m),Re(d,p,f,m)&&Re(l,p,f,m),Tc(p),co(r.leftAndTop,p,f,m),p.x+=p.w,p.y+=p.h,co(r.rightAndBottom,p,f,m),n.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},H(r.chartArea,g=>{const b=g.box;Object.assign(b,n.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class ho{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 Lc extends ho{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Mn="$chartjs",Nc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},fo=n=>n===null||n==="";function $c(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[Mn]={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",fo(s)){const o=Ls(n,"width");o!==void 0&&(n.width=o)}if(fo(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 uo=Il?{passive:!0}:!1;function Rc(n,t,e){n.addEventListener(t,e,uo)}function Ic(n,t,e){n.canvas.removeEventListener(t,e,uo)}function zc(n,t){const e=Nc[n.type]||n.type,{x:i,y:s}=ie(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Dn(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Wc(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Dn(r.addedNodes,i),a=a&&!Dn(r.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Hc(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Dn(r.removedNodes,i),a=a&&!Dn(r.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ie=new Map;let po=0;function mo(){const n=window.devicePixelRatio;n!==po&&(po=n,Ie.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function jc(n,t){Ie.size||window.addEventListener("resize",mo),Ie.set(n,t)}function Yc(n){Ie.delete(n),Ie.size||window.removeEventListener("resize",mo)}function Uc(n,t,e){const i=n.canvas,s=i&&pi(i);if(!s)return;const o=ms((r,l)=>{const d=s.clientWidth;e(r,l),d<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],d=l.contentRect.width,h=l.contentRect.height;d===0&&h===0||o(d,h)});return a.observe(s),jc(n,o),a}function wi(n,t,e){e&&e.disconnect(),t==="resize"&&Yc(n)}function Xc(n,t,e){const i=n.canvas,s=ms(o=>{n.ctx!==null&&e(zc(o,n))},n);return Rc(i,t,s),s}class qc extends ho{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?($c(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Mn])return!1;const i=e[Mn].initial;["height","width"].forEach(o=>{const a=i[o];I(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[Mn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Wc,detach:Hc,resize:Uc}[e]||Xc;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:wi,detach:wi,resize:wi}[e]||Ic)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Rl(t,e,i,s)}isAttached(t){const e=pi(t);return!!(e&&e.isConnected)}}function Kc(n){return!Ts()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Lc:qc}let Pt=(Un=class{constructor(){B(this,"x");B(this,"y");B(this,"active",!1);B(this,"options");B(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return ue(this.x)&&ue(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}},B(Un,"defaults",{}),B(Un,"defaultRoutes"),Un);function Gc(n,t){const e=n.options.ticks,i=Jc(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?Qc(t):[],a=o.length,r=o[0],l=o[a-1],d=[];if(a>s)return td(t,d,o,a/s),d;const h=Zc(o,t,s);if(a>0){let f,u;const p=a>1?Math.round((l-r)/(a-1)):null;for(vn(t,d,h,I(p)?0:r-p,r),f=0,u=a-1;f<u;f++)vn(t,d,h,o[f],o[f+1]);return vn(t,d,h,l,I(p)?t.length:l+p),d}return vn(t,d,h),d}function Jc(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 Zc(n,t,e){const i=ed(n),s=t.length/e;if(!i)return Math.max(s,1);const o=Hr(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 Qc(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function td(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 vn(n,t,e,i,s){const o=$(i,0),a=Math.min($(s,n.length),n.length);let r=0,l,d,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(d=Math.max(o,0);d<a;d++)d===h&&(t.push(n[d]),r++,h=Math.round(o+r*e))}function ed(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 nd=n=>n==="left"?"right":n==="right"?"left":n,go=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,bo=(n,t)=>Math.min(t||n,n);function yo(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 id(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),d;if(!(e&&(i===1?d=Math.max(l-o,a-l):t===0?d=(n.getPixelForTick(1)-l)/2:d=(l-n.getPixelForTick(s-1))/2,l+=s<t?d:-d,l<o-r||l>a+r)))return l}function sd(n,t){H(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 ze(n){return n.drawTicks?n.tickLength:0}function _o(n,t){if(!n.display)return 0;const e=et(n.font,t),i=rt(n.padding);return(X(n.text)?n.text.length:1)*e.lineHeight+i.height}function od(n,t){return Wt(n,{scale:t,type:"scale"})}function ad(n,t,e){return Wt(n,{tick:e,index:t,type:"tick"})}function rd(n,t,e){let i=si(n);return(e&&t!=="right"||!e&&t==="right")&&(i=nd(i)),i}function ld(n,t,e,i){const{top:s,left:o,bottom:a,right:r,chart:l}=n,{chartArea:d,scales:h}=l;let f=0,u,p,m;const g=a-s,b=r-o;if(n.isHorizontal()){if(p=at(i,o,r),R(e)){const y=Object.keys(e)[0],x=e[y];m=h[y].getPixelForValue(x)+g-t}else e==="center"?m=(d.bottom+d.top)/2+g-t:m=go(n,e,t);u=r-o}else{if(R(e)){const y=Object.keys(e)[0],x=e[y];p=h[y].getPixelForValue(x)-b+t}else e==="center"?p=(d.left+d.right)/2-b+t:p=go(n,e,t);m=at(i,a,s),f=e==="left"?-tt:tt}return{titleX:p,titleY:m,maxWidth:u,rotation:f}}class re extends Pt{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=ut(t,Number.POSITIVE_INFINITY),e=ut(e,Number.NEGATIVE_INFINITY),i=ut(i,Number.POSITIVE_INFINITY),s=ut(s,Number.NEGATIVE_INFINITY),{min:ut(t,i),max:ut(e,s),minDefined:J(t),maxDefined:J(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,d=r.length;l<d;++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:ut(e,ut(i,e)),max:ut(i,ut(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=bl(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?yo(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Gc(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=bo(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a=s,r,l,d;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),f=h.widest.width,u=h.highest.height,p=it(this.chart.width-f,0,this.maxWidth);r=t.offset?this.maxWidth/i:p/(i-1),f+6>r&&(r=p/(i-(t.offset?.5:1)),l=this.maxHeight-ze(t.grid)-e.padding-_o(t.title,this.chart.options.font),d=Math.sqrt(f*f+u*u),a=ei(Math.min(Math.asin(it((h.highest.height+6)/r,-1,1)),Math.asin(it(l/d,-1,1))-Math.asin(it(u/d,-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=_o(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=ze(o)+l):(t.height=this.maxHeight,t.width=ze(o)+l),i.display&&this.ticks.length){const{first:d,last:h,widest:f,highest:u}=this._getLabelSizes(),p=i.padding*2,m=_t(this.labelRotation),g=Math.cos(m),b=Math.sin(m);if(r){const y=i.mirror?0:b*f.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+y+p)}else{const y=i.mirror?0:g*f.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+y+p)}this._calculatePadding(d,h,b,g)}}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,d=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,p=0;l?d?(u=s*t.width,p=i*e.height):(u=i*t.height,p=s*e.width):o==="start"?p=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,p=e.width/2),this.paddingLeft=Math.max((u-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((p-f+a)*this.width/(this.width-f),0)}else{let h=e.height/2,f=t.height/2;o==="start"?(h=0,f=t.height):o==="end"&&(h=e.height,f=0),this.paddingTop=h+a,this.paddingBottom=f+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++)I(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=yo(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/bo(e,i));let d=0,h=0,f,u,p,m,g,b,y,x,k,w,_;for(f=0;f<e;f+=l){if(m=t[f].label,g=this._resolveTickFontOptions(f),s.font=b=g.string,y=o[b]=o[b]||{data:{},gc:[]},x=g.lineHeight,k=w=0,!I(m)&&!X(m))k=fn(s,y.data,y.gc,k,m),w=x;else if(X(m))for(u=0,p=m.length;u<p;++u)_=m[u],!I(_)&&!X(_)&&(k=fn(s,y.data,y.gc,k,_),w+=x);a.push(k),r.push(w),d=Math.max(k,d),h=Math.max(w,h)}sd(o,e);const C=a.indexOf(d),M=r.indexOf(h),v=T=>({width:a[T]||0,height:r[T]||0});return{first:v(0),last:v(e-1),widest:v(C),highest:v(M),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 Ur(this._alignToPixels?Qt(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=ad(this.getContext(),t,i))}return this.$context||(this.$context=od(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=_t(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,d=this.isHorizontal(),f=this.ticks.length+(l?1:0),u=ze(o),p=[],m=r.setContext(this.getContext()),g=m.display?m.width:0,b=g/2,y=function(S){return Qt(i,S,g)};let x,k,w,_,C,M,v,T,A,P,L,U;if(a==="top")x=y(this.bottom),M=this.bottom-u,T=x-b,P=y(t.top)+b,U=t.bottom;else if(a==="bottom")x=y(this.top),P=t.top,U=y(t.bottom)-b,M=x+b,T=this.top+u;else if(a==="left")x=y(this.right),C=this.right-u,v=x-b,A=y(t.left)+b,L=t.right;else if(a==="right")x=y(this.left),A=t.left,L=y(t.right)-b,C=x+b,v=this.left+u;else if(e==="x"){if(a==="center")x=y((t.top+t.bottom)/2+.5);else if(R(a)){const S=Object.keys(a)[0],E=a[S];x=y(this.chart.scales[S].getPixelForValue(E))}P=t.top,U=t.bottom,M=x+b,T=M+u}else if(e==="y"){if(a==="center")x=y((t.left+t.right)/2);else if(R(a)){const S=Object.keys(a)[0],E=a[S];x=y(this.chart.scales[S].getPixelForValue(E))}C=x-b,v=C-u,A=t.left,L=t.right}const O=$(s.ticks.maxTicksLimit,f),D=Math.max(1,Math.ceil(f/O));for(k=0;k<f;k+=D){const S=this.getContext(k),E=o.setContext(S),V=r.setContext(S),F=E.lineWidth,N=E.color,W=V.dash||[],j=V.dashOffset,G=E.tickWidth,Q=E.tickColor,st=E.tickBorderDash||[],yt=E.tickBorderDashOffset;w=id(this,k,l),w!==void 0&&(_=Qt(i,w,F),d?C=v=A=L=_:M=T=P=U=_,p.push({tx1:C,ty1:M,tx2:v,ty2:T,x1:A,y1:P,x2:L,y2:U,width:F,color:N,borderDash:W,borderDashOffset:j,tickWidth:G,tickColor:Q,tickBorderDash:st,tickBorderDashOffset:yt}))}return this._ticksLength=f,this._borderValue=x,p}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:d,padding:h,mirror:f}=o,u=ze(i.grid),p=u+h,m=f?-h:p,g=-_t(this.labelRotation),b=[];let y,x,k,w,_,C,M,v,T,A,P,L,U="middle";if(s==="top")C=this.bottom-m,M=this._getXAxisLabelAlignment();else if(s==="bottom")C=this.top+m,M=this._getXAxisLabelAlignment();else if(s==="left"){const D=this._getYAxisLabelAlignment(u);M=D.textAlign,_=D.x}else if(s==="right"){const D=this._getYAxisLabelAlignment(u);M=D.textAlign,_=D.x}else if(e==="x"){if(s==="center")C=(t.top+t.bottom)/2+p;else if(R(s)){const D=Object.keys(s)[0],S=s[D];C=this.chart.scales[D].getPixelForValue(S)+p}M=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")_=(t.left+t.right)/2-p;else if(R(s)){const D=Object.keys(s)[0],S=s[D];_=this.chart.scales[D].getPixelForValue(S)}M=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?U="top":l==="end"&&(U="bottom"));const O=this._getLabelSizes();for(y=0,x=r.length;y<x;++y){k=r[y],w=k.label;const D=o.setContext(this.getContext(y));v=this.getPixelForTick(y)+o.labelOffset,T=this._resolveTickFontOptions(y),A=T.lineHeight,P=X(w)?w.length:1;const S=P/2,E=D.color,V=D.textStrokeColor,F=D.textStrokeWidth;let N=M;a?(_=v,M==="inner"&&(y===x-1?N=this.options.reverse?"left":"right":y===0?N=this.options.reverse?"right":"left":N="center"),s==="top"?d==="near"||g!==0?L=-P*A+A/2:d==="center"?L=-O.highest.height/2-S*A+A:L=-O.highest.height+A/2:d==="near"||g!==0?L=A/2:d==="center"?L=O.highest.height/2-S*A:L=O.highest.height-P*A,f&&(L*=-1),g!==0&&!D.showLabelBackdrop&&(_+=A/2*Math.sin(g))):(C=v,L=(1-P)*A/2);let W;if(D.showLabelBackdrop){const j=rt(D.backdropPadding),G=O.heights[y],Q=O.widths[y];let st=L-j.top,yt=0-j.left;switch(U){case"middle":st-=G/2;break;case"bottom":st-=G;break}switch(M){case"center":yt-=Q/2;break;case"right":yt-=Q;break}W={left:yt,top:st,width:Q+j.width,height:G+j.height,color:D.backdropColor}}b.push({label:w,font:T,textOffset:L,options:{rotation:g,color:E,strokeColor:V,strokeWidth:F,textAlign:N,textBaseline:U,translation:[_,C],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-_t(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 d,h;return e==="left"?s?(h=this.right+o,i==="near"?d="left":i==="center"?(d="center",h+=l/2):(d="right",h+=l)):(h=this.right-r,i==="near"?d="right":i==="center"?(d="center",h-=l/2):(d="left",h=this.left)):e==="right"?s?(h=this.left+o,i==="near"?d="right":i==="center"?(d="center",h-=l/2):(d="left",h-=l)):(h=this.left+r,i==="near"?d="left":i==="center"?(d="center",h+=l/2):(d="right",h=this.right)):d="right",{textAlign:d,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,d,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(d.x,d.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 d,h,f,u;this.isHorizontal()?(d=Qt(t,this.left,a)-a/2,h=Qt(t,this.right,r)+r/2,f=u=l):(f=Qt(t,this.top,a)-a/2,u=Qt(t,this.bottom,r)+r/2,d=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(d,f),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&un(i,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,d=a.label,h=a.textOffset;te(i,d,0,h,l,r)}s&&pn(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=et(i.font),a=rt(i.padding),r=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||R(e)?(l+=a.bottom,X(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:d,titleY:h,maxWidth:f,rotation:u}=ld(this,l,e,r);te(t,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:u,textAlign:rd(r,e,s),textBaseline:"middle",translation:[d,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=$(t.grid&&t.grid.z,-1),s=$(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==re.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 En{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;hd(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,cd(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 Zt[i])}}function cd(n,t,e){const i=Se(Object.create(null),[e?Z.get(e):{},Z.get(t),n.defaults]);Z.set(t,i),n.defaultRoutes&&dd(t,n.defaultRoutes),n.descriptors&&Z.describe(t,n.descriptors)}function dd(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 hd(n){return"id"in n&&"defaults"in n}class fd{constructor(){this.controllers=new En(xt,"datasets",!0),this.elements=new En(Pt,"elements"),this.plugins=new En(Object,"plugins"),this.scales=new En(re,"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):H(s,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,i){const s=ti(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 wt=new fd;class ud{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(){I(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=$(i.options&&i.options.plugins,{}),o=pd(i);return s===!1&&!e?[]:gd(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 pd(n){const t={},e=[],i=Object.keys(wt.plugins.items);for(let o=0;o<i.length;o++)e.push(wt.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 md(n,t){return!t&&n===!1?null:n===!0?{}:n}function gd(n,{plugins:t,localIds:e},i,s){const o=[],a=n.getContext();for(const r of t){const l=r.id,d=md(i[l],s);d!==null&&o.push({plugin:r,options:bd(n.config,{plugin:r,local:e[l]},d,a)})}return o}function bd(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 Ci(n,t){const e=Z.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function yd(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function _d(n,t){return n===t?"_index_":"_value_"}function xo(n){if(n==="x"||n==="y"||n==="r")return n}function xd(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Si(n,...t){if(xo(n))return n;for(const e of t){const i=e.axis||xd(e.position)||n.length>1&&xo(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function ko(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function kd(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 ko(n,"x",e[0])||ko(n,"y",e[0])}return{}}function wd(n,t){const e=Zt[n.type]||{scales:{}},i=t.scales||{},s=Ci(n.type,t),o=Object.create(null);return Object.keys(i).forEach(a=>{const r=i[a];if(!R(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=Si(a,r,kd(a,n),Z.scales[r.type]),d=_d(l,s),h=e.scales||{};o[a]=Me(Object.create(null),[{axis:l},r,h[l],h[d]])}),n.data.datasets.forEach(a=>{const r=a.type||n.type,l=a.indexAxis||Ci(r,t),h=(Zt[r]||{}).scales||{};Object.keys(h).forEach(f=>{const u=yd(f,l),p=a[u+"AxisID"]||u;o[p]=o[p]||Object.create(null),Me(o[p],[{axis:u},i[p],h[f]])})}),Object.keys(o).forEach(a=>{const r=o[a];Me(r,[Z.scales[r.type],Z.scale])}),o}function wo(n){const t=n.options||(n.options={});t.plugins=$(t.plugins,{}),t.scales=wd(n,t)}function Co(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Cd(n){return n=n||{},n.data=Co(n.data),wo(n),n}const So=new Map,Mo=new Set;function Bn(n,t){let e=So.get(n);return e||(e=t(),So.set(n,e),Mo.add(e)),e}const We=(n,t,e)=>{const i=Rt(t,e);i!==void 0&&n.add(i)};class Sd{constructor(t){this._config=Cd(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=Co(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(),wo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Bn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Bn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Bn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Bn(`${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(f=>We(l,t,f))),h.forEach(f=>We(l,s,f)),h.forEach(f=>We(l,Zt[o]||{},f)),h.forEach(f=>We(l,Z,f)),h.forEach(f=>We(l,ri,f))});const d=Array.from(l);return d.length===0&&d.push(Object.create(null)),Mo.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,Zt[e]||{},Z.datasets[e]||{},{type:e},Z,ri]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Do(this._resolverCache,t,s);let l=a;if(Dd(a,e)){o.$shared=!1,i=It(i)?i():i;const d=this.createResolver(t,i,r);l=pe(a,i,d)}for(const d of e)o[d]=l[d];return o}createResolver(t,e,i=[""],s){const{resolver:o}=Do(this._resolverCache,t,i);return R(e)?pe(o,e,void 0,s):o}}function Do(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:hi(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,o)),o}const Md=n=>R(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||It(n[e]),!1);function Dd(n,t){const{isScriptable:e,isIndexable:i}=Ds(n);for(const s of t){const o=e(s),a=i(s),r=(a||o)&&n[s];if(o&&(It(r)||Md(r))||a&&X(r))return!0}return!1}var vd="4.4.0";const Ed=["top","bottom","left","right","chartArea"];function vo(n,t){return n==="top"||n==="bottom"||Ed.indexOf(n)===-1&&t==="x"}function Eo(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Bo(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Y(e&&e.onComplete,[n],t)}function Bd(n){const t=n.chart,e=t.options.animation;Y(e&&e.onProgress,[n],t)}function Vo(n){return Ts()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Vn={},Po=n=>{const t=Vo(n);return Object.values(Vn).filter(e=>e.canvas===t).pop()};function Vd(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 Pd(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function Pn(n,t,e){return n.options.clip?n[e]:t[e]}function Od(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:Pn(e,t,"left"),right:Pn(e,t,"right"),top:Pn(i,t,"top"),bottom:Pn(i,t,"bottom")}:t}class Ot{static register(...t){wt.add(...t),Oo()}static unregister(...t){wt.remove(...t),Oo()}constructor(t,e){const i=this.config=new Sd(e),s=Vo(t),o=Po(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||Kc(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,d=l&&l.height,h=l&&l.width;if(this.id=Tr(),this.ctx=r,this.canvas=l,this.width=h,this.height=d,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 ud,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Gr(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],Vn[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Vt.listen(this,"complete",Bo),Vt.listen(this,"progress",Bd),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return I(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 wt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Fs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Cs(this.canvas,this.ctx),this}stop(){return Vt.stop(this),this}resize(t,e){Vt.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,Fs(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||{};H(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=Si(a,r),d=l==="r",h=l==="x";return{options:r,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),H(o,a=>{const r=a.options,l=r.id,d=Si(l,r),h=$(r.type,a.dtype);(r.position===void 0||vo(r.position,d)!==vo(a.dposition))&&(r.position=a.dposition),s[l]=!0;let f=null;if(l in i&&i[l].type===h)f=i[l];else{const u=wt.getScale(h);f=new u({id:l,type:h,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(r,t)}),H(s,(a,r)=>{a||delete i[r]}),H(i,a=>{lt.configure(this,a,a.options),lt.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(Eo("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||Ci(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=wt.getController(r),{datasetElementType:d,dataElementType:h}=Z.datasets[r];Object.assign(l,{dataElementType:wt.getElement(h),datasetElementType:d&&wt.getElement(d)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){H(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 d=0,h=this.data.datasets.length;d<h;d++){const{controller:f}=this.getDatasetMeta(d),u=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(u),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||H(o,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Eo("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){H(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!os(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;Vd(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(!os(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;lt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],H(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,It(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&&(Vt.has(this)?this.attached&&!Vt.running(this)&&Vt.start(this):(this.draw(),Bo({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=Od(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&un(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&&pn(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Bt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const o=Ec.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=Wt(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);De(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(),Vt.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(),Cs(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Vn[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)};H(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,d)=>{e.addEventListener(this,l,d),t[l]=d},s=(l,d)=>{t[l]&&(e.removeEventListener(this,l,d),delete t[l])},o=(l,d)=>{this.canvas&&this.resize(l,d)};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(){H(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},H(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 d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[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}});!rn(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,d)=>l.filter(h=>!d.some(f=>h.datasetIndex===f.datasetIndex&&h.index===f.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=Ir(t),d=Pd(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=!rn(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=d,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)}}B(Ot,"defaults",Z),B(Ot,"instances",Vn),B(Ot,"overrides",Zt),B(Ot,"registry",wt),B(Ot,"version",vd),B(Ot,"getChart",Po);function Oo(){return H(Ot.instances,n=>n._plugins.invalidate())}function Ad(n,t,e){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let d=s/r;n.beginPath(),n.arc(o,a,r,i-d,e+d),l>s?(d=s/l,n.arc(o,a,l,e+d,i-d,!0)):n.arc(o,a,s,e+tt,i-tt),n.closePath(),n.clip()}function Td(n){return di(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Fd(n,t,e,i){const s=Td(n.options.borderRadius),o=(e-t)/2,a=Math.min(o,i*t/2),r=l=>{const d=(e-Math.min(o,l))*i/2;return it(l,0,Math.min(o,d))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:it(s.innerStart,0,a),innerEnd:it(s.innerEnd,0,a)}}function be(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function On(n,t,e,i,s,o){const{x:a,y:r,startAngle:l,pixelMargin:d,innerRadius:h}=t,f=Math.max(t.outerRadius+i+e-d,0),u=h>0?h+i+e+d:0;let p=0;const m=s-l;if(i){const D=h>0?h-i:0,S=f>0?f-i:0,E=(D+S)/2,V=E!==0?m*E/(E+i):m;p=(m-V)/2}const g=Math.max(.001,m*f-e/q)/f,b=(m-g)/2,y=l+b+p,x=s-b-p,{outerStart:k,outerEnd:w,innerStart:_,innerEnd:C}=Fd(t,u,f,x-y),M=f-k,v=f-w,T=y+k/M,A=x-w/v,P=u+_,L=u+C,U=y+_/P,O=x-C/L;if(n.beginPath(),o){const D=(T+A)/2;if(n.arc(a,r,f,T,D),n.arc(a,r,f,D,A),w>0){const F=be(v,A,a,r);n.arc(F.x,F.y,w,A,x+tt)}const S=be(L,x,a,r);if(n.lineTo(S.x,S.y),C>0){const F=be(L,O,a,r);n.arc(F.x,F.y,C,x+tt,O+Math.PI)}const E=(x-C/u+(y+_/u))/2;if(n.arc(a,r,u,x-C/u,E,!0),n.arc(a,r,u,E,y+_/u,!0),_>0){const F=be(P,U,a,r);n.arc(F.x,F.y,_,U+Math.PI,y-tt)}const V=be(M,y,a,r);if(n.lineTo(V.x,V.y),k>0){const F=be(M,T,a,r);n.arc(F.x,F.y,k,y-tt,T)}}else{n.moveTo(a,r);const D=Math.cos(T)*f+a,S=Math.sin(T)*f+r;n.lineTo(D,S);const E=Math.cos(A)*f+a,V=Math.sin(A)*f+r;n.lineTo(E,V)}n.closePath()}function Ld(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){On(n,t,e,i,l,s);for(let d=0;d<o;++d)n.fill();isNaN(r)||(l=a+(r%K||K))}return On(n,t,e,i,l,s),n.fill(),l}function Nd(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:d,borderJoinStyle:h,borderDash:f,borderDashOffset:u}=l,p=l.borderAlign==="inner";if(!d)return;n.setLineDash(f||[]),n.lineDashOffset=u,p?(n.lineWidth=d*2,n.lineJoin=h||"round"):(n.lineWidth=d,n.lineJoin=h||"bevel");let m=t.endAngle;if(o){On(n,t,e,i,m,s);for(let g=0;g<o;++g)n.stroke();isNaN(r)||(m=a+(r%K||K))}p&&Ad(n,t,m),o||(On(n,t,e,i,m,s),n.stroke())}class He extends Pt{constructor(e){super();B(this,"circumference");B(this,"endAngle");B(this,"fullCircles");B(this,"innerRadius");B(this,"outerRadius");B(this,"pixelMargin");B(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}=ds(o,{x:e,y:i}),{startAngle:l,endAngle:d,innerRadius:h,outerRadius:f,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),p=(this.options.spacing+this.options.borderWidth)/2,g=$(u,d-l)>=K||Ee(a,l,d),b=vt(r,h+p,f+p);return g&&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:d,spacing:h}=this.options,f=(o+a)/2,u=(r+l+h+d)/2;return{x:i+Math.cos(f)*u,y:s+Math.sin(f)*u}}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>K?Math.floor(s/K):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 d=1-Math.sin(Math.min(q,s||0)),h=o*d;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Ld(e,this,h,a,r),Nd(e,this,h,a,r),e.restore()}}B(He,"id","arc"),B(He,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),B(He,"defaultRoutes",{backgroundColor:"backgroundColor"}),B(He,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Ao(n,t,e=t){n.lineCap=$(e.borderCapStyle,t.borderCapStyle),n.setLineDash($(e.borderDash,t.borderDash)),n.lineDashOffset=$(e.borderDashOffset,t.borderDashOffset),n.lineJoin=$(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=$(e.borderWidth,t.borderWidth),n.strokeStyle=$(e.borderColor,t.borderColor)}function $d(n,t,e){n.lineTo(e.x,e.y)}function Rd(n){return n.stepped?ll:n.tension||n.cubicInterpolationMode==="monotone"?cl:$d}function To(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),d=Math.min(o,r),h=s<a&&o<a||s>r&&o>r;return{count:i,start:l,loop:t.loop,ilen:d<l&&!h?i+d-l:d-l}}function Id(n,t,e,i){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:d}=To(s,e,i),h=Rd(o);let{move:f=!0,reverse:u}=i||{},p,m,g;for(p=0;p<=d;++p)m=s[(r+(u?d-p:p))%a],!m.skip&&(f?(n.moveTo(m.x,m.y),f=!1):h(n,g,m,u,o.stepped),g=m);return l&&(m=s[(r+(u?d:0))%a],h(n,g,m,u,o.stepped)),!!l}function zd(n,t,e,i){const s=t.points,{count:o,start:a,ilen:r}=To(s,e,i),{move:l=!0,reverse:d}=i||{};let h=0,f=0,u,p,m,g,b,y;const x=w=>(a+(d?r-w:w))%o,k=()=>{g!==b&&(n.lineTo(h,b),n.lineTo(h,g),n.lineTo(h,y))};for(l&&(p=s[x(0)],n.moveTo(p.x,p.y)),u=0;u<=r;++u){if(p=s[x(u)],p.skip)continue;const w=p.x,_=p.y,C=w|0;C===m?(_<g?g=_:_>b&&(b=_),h=(f*h+w)/++f):(k(),n.lineTo(w,_),m=C,f=0,g=b=_),y=_}k()}function Mi(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?zd:Id}function Wd(n){return n.stepped?zl:n.tension||n.cubicInterpolationMode==="monotone"?Wl:se}function Hd(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Ao(n,t.options),n.stroke(s)}function jd(n,t,e,i){const{segments:s,options:o}=t,a=Mi(t);for(const r of s)Ao(n,o,r.style),n.beginPath(),a(n,t,r,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const Yd=typeof Path2D=="function";function Ud(n,t,e,i){Yd&&!t.options.segment?Hd(n,t,e,i):jd(n,t,e,i)}class Ht extends Pt{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;Al(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=ql(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=Ws(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=Wd(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:f,end:u}=a[d],p=o[f],m=o[u];if(p===m){r.push(p);continue}const g=Math.abs((s-p[e])/(m[e]-p[e])),b=l(p,m,g,i.stepped);b[e]=t[e],r.push(b)}return r.length===1?r[0]:r}pathSegment(t,e,i){return Mi(this)(t,this,e,i)}path(t,e,i){const s=this.segments,o=Mi(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(),Ud(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}B(Ht,"id","line"),B(Ht,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),B(Ht,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),B(Ht,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Fo(n,t,e,i){const s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}class An extends Pt{constructor(e){super();B(this,"parsed");B(this,"skip");B(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 Fo(this,e,"x",i)}inYRange(e,i){return Fo(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||!Bt(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,ci(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}B(An,"id","point"),B(An,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),B(An,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Lo(n,t){const{x:e,y:i,base:s,width:o,height:a}=n.getProps(["x","y","base","width","height"],t);let r,l,d,h,f;return n.horizontal?(f=a/2,r=Math.min(e,s),l=Math.max(e,s),d=i-f,h=i+f):(f=o/2,r=e-f,l=e+f,d=Math.min(i,s),h=Math.max(i,s)),{left:r,top:d,right:l,bottom:h}}function jt(n,t,e,i){return n?0:it(t,e,i)}function Xd(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,o=Ms(i);return{t:jt(s.top,o.top,0,e),r:jt(s.right,o.right,0,t),b:jt(s.bottom,o.bottom,0,e),l:jt(s.left,o.left,0,t)}}function qd(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=ee(s),a=Math.min(t,e),r=n.borderSkipped,l=i||R(s);return{topLeft:jt(!l||r.top||r.left,o.topLeft,0,a),topRight:jt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:jt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:jt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Kd(n){const t=Lo(n),e=t.right-t.left,i=t.bottom-t.top,s=Xd(n,e/2,i/2),o=qd(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 Di(n,t,e,i){const s=t===null,o=e===null,r=n&&!(s&&o)&&Lo(n,i);return r&&(s||vt(t,r.left,r.right))&&(o||vt(e,r.top,r.bottom))}function Gd(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Jd(n,t){n.rect(t.x,t.y,t.w,t.h)}function vi(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 Tn extends Pt{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}=Kd(this),r=Gd(a.radius)?Oe:Jd;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,vi(a,e,o)),t.clip(),r(t,vi(o,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,vi(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Di(this,t,e,i)}inXRange(t,e){return Di(this,t,null,e)}inYRange(t,e){return Di(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}}B(Tn,"id","bar"),B(Tn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),B(Tn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var Zd=Object.freeze({__proto__:null,ArcElement:He,BarElement:Tn,LineElement:Ht,PointElement:An});const Ei=["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)"],No=Ei.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function $o(n){return Ei[n%Ei.length]}function Ro(n){return No[n%No.length]}function Qd(n,t){return n.borderColor=$o(t),n.backgroundColor=Ro(t),++t}function th(n,t){return n.backgroundColor=n.data.map(()=>$o(t++)),t}function eh(n,t){return n.backgroundColor=n.data.map(()=>Ro(t++)),t}function nh(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof oe?t=th(e,t):s instanceof Fe?t=eh(e,t):s&&(t=Qd(e,t))}}function Io(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function ih(n){return n&&(n.borderColor||n.backgroundColor)}var sh={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&&(Io(i)||ih(s)||o&&Io(o)))return;const a=nh(n);i.forEach(a)}};function oh(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 d=t+e-1;let h=t,f,u,p,m,g;for(a[l++]=n[h],f=0;f<o-2;f++){let b=0,y=0,x;const k=Math.floor((f+1)*r)+1+t,w=Math.min(Math.floor((f+2)*r)+1,e)+t,_=w-k;for(x=k;x<w;x++)b+=n[x].x,y+=n[x].y;b/=_,y/=_;const C=Math.floor(f*r)+1+t,M=Math.min(Math.floor((f+1)*r)+1,e)+t,{x:v,y:T}=n[h];for(p=m=-1,x=C;x<M;x++)m=.5*Math.abs((v-b)*(n[x].y-T)-(v-n[x].x)*(y-T)),m>p&&(p=m,u=n[x],g=x);a[l++]=u,h=g}return a[l++]=n[d],a}function ah(n,t,e,i){let s=0,o=0,a,r,l,d,h,f,u,p,m,g;const b=[],y=t+e-1,x=n[t].x,w=n[y].x-x;for(a=t;a<t+e;++a){r=n[a],l=(r.x-x)/w*i,d=r.y;const _=l|0;if(_===h)d<m?(m=d,f=a):d>g&&(g=d,u=a),s=(o*s+r.x)/++o;else{const C=a-1;if(!I(f)&&!I(u)){const M=Math.min(f,u),v=Math.max(f,u);M!==p&&M!==C&&b.push({...n[M],x:s}),v!==p&&v!==C&&b.push({...n[v],x:s})}a>0&&C!==p&&b.push(n[C]),b.push(r),h=_,o=0,m=g=d,f=u=p=a}}return b}function zo(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 Wo(n){n.data.datasets.forEach(t=>{zo(t)})}function rh(n,t){const e=t.length;let i=0,s;const{iScale:o}=n,{min:a,max:r,minDefined:l,maxDefined:d}=o.getUserBounds();return l&&(i=it(Et(t,o.axis,a).lo,0,e-1)),d?s=it(Et(t,o.axis,r).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var lh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Wo(n);return}const i=n.width;n.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=n.getDatasetMeta(o),d=a||s.data;if(Ae([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:f,count:u}=rh(l,d);const p=e.threshold||4*i;if(u<=p){zo(s);return}I(a)&&(s._data=d,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(e.algorithm){case"lttb":m=oh(d,f,u,i,e);break;case"min-max":m=ah(d,f,u,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=m})},destroy(n){Wo(n)}};function ch(n,t,e){const i=n.segments,s=n.points,o=t.points,a=[];for(const r of i){let{start:l,end:d}=r;d=Vi(l,d,s);const h=Bi(e,s[l],s[d],r.loop);if(!t.segments){a.push({source:r,target:h,start:s[l],end:s[d]});continue}const f=Ws(t,h);for(const u of f){const p=Bi(e,o[u.start],o[u.end],u.loop),m=zs(r,s,p);for(const g of m)a.push({source:g,target:u,start:{[e]:Ho(h,p,"start",Math.max)},end:{[e]:Ho(h,p,"end",Math.min)}})}}return a}function Bi(n,t,e,i){if(i)return;let s=t[n],o=e[n];return n==="angle"&&(s=pt(s),o=pt(o)),{property:n,start:s,end:o}}function dh(n,t){const{x:e=null,y:i=null}=n||{},s=t.points,o=[];return t.segments.forEach(({start:a,end:r})=>{r=Vi(a,r,s);const l=s[a],d=s[r];i!==null?(o.push({x:l.x,y:i}),o.push({x:d.x,y:i})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:d.y}))}),o}function Vi(n,t,e){for(;t>n;t--){const i=e[t];if(!isNaN(i.x)&&!isNaN(i.y))break}return t}function Ho(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function jo(n,t){let e=[],i=!1;return X(n)?(i=!0,e=n):e=dh(n,t),e.length?new Ht({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function Yo(n){return n&&n.fill!==!1}function hh(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(!J(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function fh(n,t,e){const i=gh(n);if(R(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return J(s)&&Math.floor(s)===s?uh(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function uh(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function ph(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:R(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function mh(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:R(n)?i=n.value:i=t.getBaseValue(),i}function gh(n){const t=n.options,e=t.fill;let i=$(e&&e.target,e);return i===void 0&&(i=!!t.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function bh(n){const{scale:t,index:e,line:i}=n,s=[],o=i.segments,a=i.points,r=yh(t,e);r.push(jo({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const d=o[l];for(let h=d.start;h<=d.end;h++)_h(s,a[h],r)}return new Ht({points:s,options:{}})}function yh(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 _h(n,t,e){const i=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=xh(o,t,"x");if(!(!l||a&&r)){if(a)i.unshift(l);else if(n.push(l),!r)break}}n.push(...i)}function xh(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 d=0;d<o.length;d++){const h=o[d],f=a[h.start][e],u=a[h.end][e];if(vt(s,f,u)){r=s===f,l=s===u;break}}return{first:r,last:l,point:i}}class Uo{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:K},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 kh(n){const{chart:t,fill:e,line:i}=n;if(J(e))return wh(t,e);if(e==="stack")return bh(n);if(e==="shape")return!0;const s=Ch(n);return s instanceof Uo?s:jo(s,i)}function wh(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Ch(n){return(n.scale||{}).getPointPositionForValue?Mh(n):Sh(n)}function Sh(n){const{scale:t={},fill:e}=n,i=ph(e,t);if(J(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Mh(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,a=mh(e,t,o),r=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new Uo({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 Pi(n,t,e){const i=kh(t),{line:s,scale:o,axis:a}=t,r=s.options,l=r.fill,d=r.backgroundColor,{above:h=d,below:f=d}=l||{};i&&s.points.length&&(un(n,e),Dh(n,{line:s,target:i,above:h,below:f,area:e,scale:o,axis:a}),pn(n))}function Dh(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&&(Xo(n,i,a.top),qo(n,{line:e,target:i,color:s,scale:r,property:l}),n.restore(),n.save(),Xo(n,i,a.bottom)),qo(n,{line:e,target:i,color:o,scale:r,property:l}),n.restore()}function Xo(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:d}=r,h=s[l],f=s[Vi(l,d,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(f.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function qo(n,t){const{line:e,target:i,property:s,color:o,scale:a}=t,r=ch(e,i,s);for(const{source:l,target:d,start:h,end:f}of r){const{style:{backgroundColor:u=o}={}}=l,p=i!==!0;n.save(),n.fillStyle=u,vh(n,a,p&&Bi(s,h,f)),n.beginPath();const m=!!e.pathSegment(n,l);let g;if(p){m?n.closePath():Ko(n,i,f,s);const b=!!i.pathSegment(n,d,{move:m,reverse:!0});g=m&&b,g||Ko(n,i,h,s)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function vh(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 Eh={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 Ht&&(l={visible:n.isDatasetVisible(a),index:a,fill:fh(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=hh(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&&Pi(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;Yo(o)&&Pi(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!Yo(i)||e.drawTime!=="beforeDatasetDraw"||Pi(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Go=(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)}},Bh=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class Jo extends Pt{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}=Go(i,o);let d,h;e.font=s.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,d=this._fitCols(a,s,r,l)+10),this.width=Math.min(d,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=[],d=this.lineWidths=[0],h=s+r;let f=t;o.textAlign="left",o.textBaseline="middle";let u=-1,p=-h;return this.legendItems.forEach((m,g)=>{const b=i+e/2+o.measureText(m.text).width;(g===0||d[d.length-1]+b+2*r>a)&&(f+=h,d[d.length-(g>0?0:1)]=0,p+=h,u++),l[g]={left:0,top:p,row:u,width:b,height:s},d[d.length-1]+=b+r}),f}_fitCols(t,e,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let f=r,u=0,p=0,m=0,g=0;return this.legendItems.forEach((b,y)=>{const{itemWidth:x,itemHeight:k}=Vh(i,e,o,b,s);y>0&&p+k+2*r>h&&(f+=u+r,d.push({width:u,height:p}),m+=u+r,g++,u=p=0),l[y]={left:m,top:p,col:g,width:x,height:k},u=Math.max(u,x),p+=k+r}),f+=u,d.push({width:u,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,a=ge(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=at(i,this.left+s,this.right-this.lineWidths[r]);for(const d of e)r!==d.row&&(r=d.row,l=at(i,this.left+s,this.right-this.lineWidths[r])),d.top+=this.top+t+s,d.left=a.leftForLtr(a.x(l),d.width),l+=d.width+s}else{let r=0,l=at(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const d of e)d.col!==r&&(r=d.col,l=at(i,this.top+t+s,this.bottom-this.columnSizes[r].height)),d.top=l,d.left+=this.left+s,d.left=a.leftForLtr(a.x(d.left),d.width),l+=d.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;un(t,this),this._draw(),pn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:a}=t,r=Z.color,l=ge(t.rtl,this.left,this.width),d=et(a.font),{padding:h}=a,f=d.size,u=f/2;let p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;const{boxWidth:m,boxHeight:g,itemHeight:b}=Go(a,f),y=function(C,M,v){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;s.save();const T=$(v.lineWidth,1);if(s.fillStyle=$(v.fillStyle,r),s.lineCap=$(v.lineCap,"butt"),s.lineDashOffset=$(v.lineDashOffset,0),s.lineJoin=$(v.lineJoin,"miter"),s.lineWidth=T,s.strokeStyle=$(v.strokeStyle,r),s.setLineDash($(v.lineDash,[])),a.usePointStyle){const A={radius:g*Math.SQRT2/2,pointStyle:v.pointStyle,rotation:v.rotation,borderWidth:T},P=l.xPlus(C,m/2),L=M+u;Ss(s,A,P,L,a.pointStyleWidth&&m)}else{const A=M+Math.max((f-g)/2,0),P=l.leftForLtr(C,m),L=ee(v.borderRadius);s.beginPath(),Object.values(L).some(U=>U!==0)?Oe(s,{x:P,y:A,w:m,h:g,radius:L}):s.rect(P,A,m,g),s.fill(),T!==0&&s.stroke()}s.restore()},x=function(C,M,v){te(s,v.text,C,M+b/2,d,{strikethrough:v.hidden,textAlign:l.textAlign(v.textAlign)})},k=this.isHorizontal(),w=this._computeTitleHeight();k?p={x:at(o,this.left+h,this.right-i[0]),y:this.top+h+w,line:0}:p={x:this.left+h,y:at(o,this.top+w+h,this.bottom-e[0].height),line:0},Ns(this.ctx,t.textDirection);const _=b+h;this.legendItems.forEach((C,M)=>{s.strokeStyle=C.fontColor,s.fillStyle=C.fontColor;const v=s.measureText(C.text).width,T=l.textAlign(C.textAlign||(C.textAlign=a.textAlign)),A=m+u+v;let P=p.x,L=p.y;l.setWidth(this.width),k?M>0&&P+A+h>this.right&&(L=p.y+=_,p.line++,P=p.x=at(o,this.left+h,this.right-i[p.line])):M>0&&L+_>this.bottom&&(P=p.x=P+e[p.line].width+h,p.line++,L=p.y=at(o,this.top+w+h,this.bottom-e[p.line].height));const U=l.x(P);if(y(U,L,C),P=Jr(T,P+m+u,k?P+A:this.right,t.rtl),x(l.x(P),L,C),k)p.x+=A+h;else if(typeof C.text!="string"){const O=d.lineHeight;p.y+=Zo(C,O)+h}else p.y+=_}),$s(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=et(e.font),s=rt(e.padding);if(!e.display)return;const o=ge(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=i.size/2,d=s.top+l;let h,f=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+d,f=at(t.align,f,this.right-u);else{const m=this.columnSizes.reduce((g,b)=>Math.max(g,b.height),0);h=d+at(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const p=at(r,f,f+u);a.textAlign=o.textAlign(si(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,te(a,e.text,p,h,i)}_computeTitleHeight(){const t=this.options.title,e=et(t.font),i=rt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(vt(t,this.left,this.right)&&vt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],vt(t,s.left,s.left+s.width)&&vt(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Ah(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Bh(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 Vh(n,t,e,i,s){const o=Ph(i,n,t,e),a=Oh(s,i,t.lineHeight);return{itemWidth:o,itemHeight:a}}function Ph(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 Oh(n,t,e){let i=n;return typeof t.text!="string"&&(i=Zo(t,e)),i}function Zo(n,t){const e=n.text?n.text.length:0;return t*e}function Ah(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Th={id:"legend",_element:Jo,start(n,t,e){const i=n.legend=new Jo({ctx:n.ctx,options:e,chart:n});lt.configure(n,i,e),lt.addBox(n,i)},stop(n){lt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;lt.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 d=l.controller.getStyle(e?0:void 0),h=rt(d.borderWidth);return{text:t[l.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:s||d.textAlign,borderRadius:a&&(r||d.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 Oi extends Pt{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=X(i.text)?i.text.length:1;this._padding=rt(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,d,h,f;return this.isHorizontal()?(h=at(r,i,o),f=e+t,d=o-i):(a.position==="left"?(h=i+t,f=at(r,s,e),l=q*-.5):(h=o-t,f=at(r,e,s),l=q*.5),d=s-e),{titleX:h,titleY:f,maxWidth:d,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:d}=this._drawArgs(o);te(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:d,textAlign:si(e.align),textBaseline:"middle",translation:[a,r]})}}function Fh(n,t){const e=new Oi({ctx:n.ctx,options:t,chart:n});lt.configure(n,e,t),lt.addBox(n,e),n.titleBlock=e}var Lh={id:"title",_element:Oi,start(n,t,e){Fh(n,e)},stop(n){const t=n.titleBlock;lt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;lt.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 Fn=new WeakMap;var Nh={id:"subtitle",start(n,t,e){const i=new Oi({ctx:n.ctx,options:e,chart:n});lt.configure(n,i,e),lt.addBox(n,i),Fn.set(n,i)},stop(n){lt.removeBox(n,Fn.get(n)),Fn.delete(n)},beforeUpdate(n,t,e){const i=Fn.get(n);lt.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 je={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 d=l.getCenterPoint(),h=ni(t,d);h<s&&(s=h,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function Ct(n,t){return t&&(X(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function At(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
23
+ */class ac{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=bs.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 Vt=new ac;const qs="transparent",rc={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const i=Ss(n||qs),s=i.valid&&Ss(t||qs);return s&&s.valid?s.mix(i,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class lc{constructor(t,e,i,s){const o=e[i];s=Te([t.to,s,o,t.from]);const a=Te([t.from,o,s]);this._active=!0,this._fn=t.fn||rc[t.type||typeof a],this._easing=Pe[t.easing]||Pe.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=Te([t.to,e,s,t.from]),this._from=Te([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 Ks{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!$(t))return;const e=Object.keys(Z.animation),i=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const o=t[s];if(!$(o))return;const a={};for(const r of e)a[r]=o[r];(X(o.properties)&&o.properties||[s]).forEach(r=>{(r===s||!i.has(r))&&i.set(r,a)})})}_animateOptions(t,e){const i=e.options,s=dc(t,i);if(!s)return[];const o=this._createAnimations(s,i);return i.$shared&&cc(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 d=a[l];if(d.charAt(0)==="$")continue;if(d==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[d];let f=o[d];const u=i.get(d);if(f)if(u&&f.active()){f.update(u,h,r);continue}else f.cancel();if(!u||!u.duration){t[d]=h;continue}o[d]=f=new lc(u,t,d,h),s.push(f)}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 Vt.add(this._chart,i),!0}}function cc(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 dc(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 Gs(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 hc(n,t,e){if(e===!1)return!1;const i=Gs(n,e),s=Gs(t,e);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function fc(n){let t,e,i,s;return $(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 Js(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 Zs(n,t,e,i={}){const s=n.keys,o=i.mode==="single";let a,r,l,d;if(t!==null){for(a=0,r=s.length;a<r;++a){if(l=+s[a],l===e){if(i.all)continue;break}d=n.values[l],J(d)&&(o||t===0||kt(t)===kt(d))&&(t+=d)}return t}}function uc(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 Qs(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function pc(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function mc(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 gc(n,t,e){const i=n[t]||(n[t]={});return i[e]||(i[e]={})}function to(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 eo(n,t){const{chart:e,_cachedMeta:i}=n,s=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=i,l=o.axis,d=a.axis,h=pc(o,a,i),f=t.length;let u;for(let p=0;p<f;++p){const m=t[p],{[l]:g,[d]:b}=m,y=m._stacks||(m._stacks={});u=y[d]=gc(s,h,g),u[r]=b,u._top=to(u,a,!0,i.type),u._bottom=to(u,a,!1,i.type);const x=u._visualValues||(u._visualValues={});x[r]=b}}function yi(n,t){const e=n.scales;return Object.keys(e).filter(i=>e[i].axis===t).shift()}function bc(n,t){return jt(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function yc(n,t,e){return jt(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Le(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 _i=n=>n==="reset"||n==="none",no=(n,t)=>t?n:Object.assign({},n),_c=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:Js(e,!0),values:null};class xt{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=Qs(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&&Le(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(f,u,p,m)=>f==="x"?u:f==="r"?m:p,o=e.xAxisID=R(i.xAxisID,yi(t,"x")),a=e.yAxisID=R(i.yAxisID,yi(t,"y")),r=e.rAxisID=R(i.rAxisID,yi(t,"r")),l=e.indexAxis,d=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(d),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&&ms(this._data,this),t._stacked&&Le(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if($(e))this._data=uc(e);else if(i!==e){if(i){ms(i,this);const s=this._cachedMeta;Le(s),s._parsed=[]}e&&Object.isExtensible(e)&&sl(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=Qs(e.vScale,e),e.stack!==i.stack&&(s=!0,Le(e),e.stack=i.stack),this._resyncElements(t),(s||o!==e._stacked)&&eo(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,d=t>0&&i._parsed[t-1],h,f,u;if(this._parsing===!1)i._parsed=s,i._sorted=!0,u=s;else{X(s[t])?u=this.parseArrayData(i,s,t,e):$(s[t])?u=this.parseObjectData(i,s,t,e):u=this.parsePrimitiveData(i,s,t,e);const p=()=>f[r]===null||d&&f[r]<d[r];for(h=0;h<e;++h)i._parsed[h+t]=f=u[h],l&&(p()&&(l=!1),d=f);i._sorted=l}a&&eo(this,u)}parsePrimitiveData(t,e,i,s){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,d=o.getLabels(),h=o===a,f=new Array(s);let u,p,m;for(u=0,p=s;u<p;++u)m=u+i,f[u]={[r]:h||o.parse(d[m],m),[l]:a.parse(e[m],m)};return f}parseArrayData(t,e,i,s){const{xScale:o,yScale:a}=t,r=new Array(s);let l,d,h,f;for(l=0,d=s;l<d;++l)h=l+i,f=e[h],r[l]={x:o.parse(f[0],h),y:a.parse(f[1],h)};return r}parseObjectData(t,e,i,s){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,d=new Array(s);let h,f,u,p;for(h=0,f=s;h<f;++h)u=h+i,p=e[u],d[h]={x:o.parse(It(p,r),u),y:a.parse(It(p,l),u)};return d}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:Js(s,!0),values:e._stacks[t.axis]._visualValues};return Zs(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=Zs(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=_c(e,i,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:f}=mc(r);let u,p;function m(){p=s[u];const g=p[r.axis];return!J(p[t.axis])||h>g||f<g}for(u=0;u<a&&!(!m()&&(this.updateRangeFromParsed(d,t,p,l),o));++u);if(o){for(u=a-1;u>=0;--u)if(!m()){this.updateRangeFromParsed(d,t,p,l);break}}return d}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],J(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=fc(R(this.options.clip,hc(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,d=this.options.drawActiveElementsOnTop;let h;for(i.dataset&&i.dataset.draw(t,o,r,l),h=r;h<r+l;++h){const f=s[h];f.hidden||(f.active&&d?a.push(f):f.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=yc(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=bc(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&&Ee(i);if(r)return no(r,l);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),f=s?[`${t}Hover`,"hover",t,""]:[t,""],u=d.getOptionScopes(this.getDataset(),h),p=Object.keys(Z.elements[t]),m=()=>this.getContext(i,s,e),g=d.resolveNamedOptions(u,p,m,f);return g.$shared&&(g.$shared=l,o[a]=Object.freeze(no(g,l))),g}_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,f=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),f);l=h.createResolver(u,this.getContext(t,i,e))}const d=new Ks(s,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||_i(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){_i(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!_i(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,d]of this._syncList)this[r](l,d);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=d=>{for(d.length+=e,r=d.length-1;r>=a;r--)d[r]=d[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&&Le(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])}}B(xt,"defaults",{}),B(xt,"datasetElementType",null),B(xt,"dataElementType",null);function xc(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=gs(i.sort((s,o)=>s-o))}return n._cache.$bar}function kc(n){const t=n.iScale,e=xc(t,n.type);let i=t._length,s,o,a,r;const l=()=>{a===32767||a===-32768||(Ee(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 wc(n,t,e,i){const s=e.barThickness;let o,a;return z(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 Sc(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 d=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/i,ratio:e.barPercentage,start:d}}function Cc(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,d=r;Math.abs(a)>Math.abs(r)&&(l=r,d=a),t[e.axis]=d,t._custom={barStart:l,barEnd:d,start:s,end:o,min:a,max:r}}function io(n,t,e,i){return X(n)?Cc(n,t,e,i):t[e.axis]=e.parse(n,i),t}function so(n,t,e,i){const s=n.iScale,o=n.vScale,a=s.getLabels(),r=s===o,l=[];let d,h,f,u;for(d=e,h=e+i;d<h;++d)u=t[d],f={},f[s.axis]=r||s.parse(a[d],d),l.push(io(u,f,o,d));return l}function xi(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Mc(n,t,e){return n!==0?kt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function Dc(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 vc(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:d,bottom:h}=Dc(n);s==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===i?s=d:(e._bottom||0)===i?s=h:(o[oo(h,a,r,l)]=!0,s=d)),o[oo(s,a,r,l)]=!0,n.borderSkipped=o}function oo(n,t,e,i){return i?(n=Ec(n,t,e),n=ao(n,e,t)):n=ao(n,t,e),n}function Ec(n,t,e){return n===t?e:n===e?t:n}function ao(n,t,e){return n==="start"?t:n==="end"?e:n}function Bc(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class xn extends xt{parsePrimitiveData(t,e,i,s){return so(t,e,i,s)}parseArrayData(t,e,i,s){return so(t,e,i,s)}parseObjectData(t,e,i,s){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,d=o.axis==="x"?r:l,h=a.axis==="x"?r:l,f=[];let u,p,m,g;for(u=i,p=i+s;u<p;++u)g=e[u],m={},m[o.axis]=o.parse(It(g,d),u),f.push(io(It(g,h),m,a,u));return f}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=xi(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(),d=r.isHorizontal(),h=this._getRuler(),{sharedOptions:f,includeOptions:u}=this._getSharedOptions(e,s);for(let p=e;p<e+i;p++){const m=this.getParsed(p),g=o||z(m[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,h),y=(m._stacks||{})[r.axis],x={horizontal:d,base:g.base,enableBorderRadius:!y||xi(m._custom)||a===y._top||a===y._bottom,x:d?g.head:b.center,y:d?b.center:g.head,height:d?b.size:Math.abs(g.size),width:d?Math.abs(g.size):b.size};u&&(x.options=f||this.resolveDataElementOptions(p,t[p].active?"active":s));const w=x.options||t[p].options;vc(x,w,y,a),Bc(x,w,h.ratio),this.updateElement(t[p],p,x,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 d=l.controller.getParsed(e),h=d&&d[l.vScale.axis];if(z(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||kc(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),d=l._custom,h=xi(d);let f=l[e.axis],u=0,p=i?this.applyStack(e,l,i):f,m,g;p!==f&&(u=p-f,p=f),h&&(f=d.barStart,p=d.barEnd-d.barStart,f!==0&&kt(f)!==kt(d.barEnd)&&(u=0),u+=f);const b=!z(o)&&!h?o:u;let y=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(u+p):m=y,g=m-y,Math.abs(g)<a){g=Mc(g,e,r)*a,f===r&&(y-=g/2);const x=e.getPixelForDecimal(0),w=e.getPixelForDecimal(1),k=Math.min(x,w),_=Math.max(x,w);y=Math.max(Math.min(y,_),k),m=y+g,i&&!h&&(l._stacks[e.axis]._visualValues[s]=e.getValueForPixel(m)-e.getValueForPixel(y))}if(y===e.getPixelForValue(r)){const x=kt(g)*e.getLineWidthForValue(r)/2;y+=x,g-=x}return{size:g,base:y,head:m,center:m+g/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 d=o?this._getStackCount(t):e.stackCount,h=s.barThickness==="flex"?Sc(t,e,s,d):wc(t,e,s,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0);r=h.start+h.chunk*f+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)}}B(xn,"id","bar"),B(xn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),B(xn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class kn extends xt{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),d=a._custom;return{label:i[t]||"",value:"("+r+", "+l+(d?", "+d:"")+")"}}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:d}=this._getSharedOptions(e,s),h=a.axis,f=r.axis;for(let u=e;u<e+i;u++){const p=t[u],m=!o&&this.getParsed(u),g={},b=g[h]=o?a.getPixelForDecimal(.5):a.getPixelForValue(m[h]),y=g[f]=o?r.getBasePixel():r.getPixelForValue(m[f]);g.skip=isNaN(b)||isNaN(y),d&&(g.options=l||this.resolveDataElementOptions(u,p.active?"active":s),o&&(g.options.radius=0)),this.updateElement(p,u,g,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}}B(kn,"id","bubble"),B(kn,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),B(kn,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Vc(n,t,e){let i=1,s=1,o=0,a=0;if(t<K){const r=n,l=r+t,d=Math.cos(r),h=Math.sin(r),f=Math.cos(l),u=Math.sin(l),p=(w,k,_)=>Ve(w,r,l,!0)?1:Math.max(k,k*e,_,_*e),m=(w,k,_)=>Ve(w,r,l,!0)?-1:Math.min(k,k*e,_,_*e),g=p(0,d,f),b=p(tt,h,u),y=m(q,d,f),x=m(q+tt,h,u);i=(g-y)/2,s=(b-x)/2,o=-(g+y)/2,a=-(b+x)/2}return{ratioX:i,ratioY:s,offsetX:o,offsetY:a}}class oe extends xt{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[t])){const{key:l="value"}=this._parsing;o=d=>+It(i[d],l)}let a,r;for(a=t,r=t+e;a<r;++a)s._parsed[a]=o(a)}}_getRotation(){return _t(this.options.rotation-90)}_getCircumference(){return _t(this.options.circumference)}_getRotationExtents(){let t=K,e=-K;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(jr(this.options.cutout,r),1),d=this._getRingWeight(this.index),{circumference:h,rotation:f}=this._getRotationExtents(),{ratioX:u,ratioY:p,offsetX:m,offsetY:g}=Vc(f,h,l),b=(i.width-a)/u,y=(i.height-a)/p,x=Math.max(Math.min(b,y)/2,0),w=os(this.options.radius,x),k=Math.max(w*l,0),_=(w-k)/this._getVisibleDatasetWeightTotal();this.offsetX=m*w,this.offsetY=g*w,s.total=this.calculateTotal(),this.outerRadius=w-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*d,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/K)}updateElements(t,e,i,s){const o=s==="reset",a=this.chart,r=a.chartArea,d=a.options.animation,h=(r.left+r.right)/2,f=(r.top+r.bottom)/2,u=o&&d.animateScale,p=u?0:this.innerRadius,m=u?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(e,s);let y=this._getRotation(),x;for(x=0;x<e;++x)y+=this._circumference(x,o);for(x=e;x<e+i;++x){const w=this._circumference(x,o),k=t[x],_={x:h+this.offsetX,y:f+this.offsetY,startAngle:y,endAngle:y+w,circumference:w,outerRadius:m,innerRadius:p};b&&(_.options=g||this.resolveDataElementOptions(x,k.active?"active":s)),y+=w,this.updateElement(k,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)?K*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],o=Oe(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}}B(oe,"id","doughnut"),B(oe,"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"}),B(oe,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),B(oe,"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 wn extends xt{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}=_s(e,s,a);this._drawStart=r,this._drawCount=l,xs(e)&&(r=0,l=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!o._decimated,i.points=s;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(i,void 0,{animated:!a,options:d},t),this.updateElements(s,r,l,t)}updateElements(t,e,i,s){const o=s==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,s),u=a.axis,p=r.axis,{spanGaps:m,segment:g}=this.options,b=me(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||s==="none",x=e+i,w=t.length;let k=e>0&&this.getParsed(e-1);for(let _=0;_<w;++_){const S=t[_],C=y?S:{};if(_<e||_>=x){C.skip=!0;continue}const v=this.getParsed(_),A=z(v[p]),F=C[u]=a.getPixelForValue(v[u],_),P=C[p]=o||A?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,v,l):v[p],_);C.skip=isNaN(F)||isNaN(P)||A,C.stop=_>0&&Math.abs(v[u]-k[u])>b,g&&(C.parsed=v,C.raw=d.data[_]),f&&(C.options=h||this.resolveDataElementOptions(_,S.active?"active":s)),y||this.updateElement(S,_,C,s),k=v}}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()}}B(wn,"id","line"),B(wn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),B(wn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ne extends xt{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=Oe(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,i,s){return Ts.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,d=this._cachedMeta.rScale,h=d.xCenter,f=d.yCenter,u=d.getIndexAngle(0)-.5*q;let p=u,m;const g=360/this.countVisibleElements();for(m=0;m<e;++m)p+=this._computeAngle(m,s,g);for(m=e;m<e+i;m++){const b=t[m];let y=p,x=p+this._computeAngle(m,s,g),w=a.getDataVisibility(m)?d.getDistanceFromCenterForValue(this.getParsed(m).r):0;p=x,o&&(l.animateScale&&(w=0),l.animateRotate&&(y=x=u));const k={x:h,y:f,innerRadius:0,outerRadius:w,startAngle:y,endAngle:x,options:this.resolveDataElementOptions(m,b.active?"active":s)};this.updateElement(b,m,k,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)?_t(this.resolveDataElementOptions(t,e).angle||i):0}}B(Ne,"id","polarArea"),B(Ne,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),B(Ne,"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 ki extends oe{}B(ki,"id","pie"),B(ki,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Sn extends xt{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 Ts.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],d=this.resolveDataElementOptions(r,l.active?"active":s),h=o.getPointPositionForValue(r,this.getParsed(r).r),f=a?o.xCenter:h.x,u=a?o.yCenter:h.y,p={x:f,y:u,angle:h.angle,skip:isNaN(f)||isNaN(u),options:d};this.updateElement(l,r,p,s)}}}B(Sn,"id","radar"),B(Sn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),B(Sn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Cn extends xt{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}=_s(e,i,s);if(this._drawStart=o,this._drawCount=a,xs(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 d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:d},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:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),f=this.getSharedOptions(h),u=this.includeOptions(s,f),p=a.axis,m=r.axis,{spanGaps:g,segment:b}=this.options,y=me(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none";let w=e>0&&this.getParsed(e-1);for(let k=e;k<e+i;++k){const _=t[k],S=this.getParsed(k),C=x?_:{},v=z(S[m]),A=C[p]=a.getPixelForValue(S[p],k),F=C[m]=o||v?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,S,l):S[m],k);C.skip=isNaN(A)||isNaN(F)||v,C.stop=k>0&&Math.abs(S[p]-w[p])>y,b&&(C.parsed=S,C.raw=d.data[k]),u&&(C.options=f||this.resolveDataElementOptions(k,_.active?"active":s)),x||this.updateElement(_,k,C,s),w=S}this.updateSharedOptions(f,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}}B(Cn,"id","scatter"),B(Cn,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),B(Cn,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Pc=Object.freeze({__proto__:null,BarController:xn,BubbleController:kn,DoughnutController:oe,LineController:wn,PieController:ki,PolarAreaController:Ne,RadarController:Sn,ScatterController:Cn});function ae(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class wi{constructor(t){B(this,"options");this.options=t||{}}static override(t){Object.assign(wi.prototype,t)}init(){}formats(){return ae()}parse(){return ae()}format(){return ae()}add(){return ae()}diff(){return ae()}startOf(){return ae()}endOf(){return ae()}}var Oc={_date:wi};function Ac(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?nl:Et;if(i){if(s._sharedOptions){const d=o[0],h=typeof d.getRange=="function"&&d.getRange(t);if(h){const f=l(o,t,e-h),u=l(o,t,e+h);return{lo:f.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function Re(n,t,e,i,s){const o=n.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:d,data:h}=o[r],{lo:f,hi:u}=Ac(o[r],t,a,s);for(let p=f;p<=u;++p){const m=h[p];m.skip||i(m,d,p)}}}function Fc(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 Si(n,t,e,i,s){const o=[];return!s&&!n.isPointInArea(t)||Re(n,e,t,function(r,l,d){!s&&!Bt(r,n.chartArea,0)||r.inRange(t.x,t.y,i)&&o.push({element:r,datasetIndex:l,index:d})},!0),o}function Tc(n,t,e,i){let s=[];function o(a,r,l){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],i),{angle:f}=us(a,{x:t.x,y:t.y});Ve(f,d,h)&&s.push({element:a,datasetIndex:r,index:l})}return Re(n,e,t,o),s}function Lc(n,t,e,i,s,o){let a=[];const r=Fc(e);let l=Number.POSITIVE_INFINITY;function d(h,f,u){const p=h.inRange(t.x,t.y,s);if(i&&!p)return;const m=h.getCenterPoint(s);if(!(!!o||n.isPointInArea(m))&&!p)return;const b=r(t,m);b<l?(a=[{element:h,datasetIndex:f,index:u}],l=b):b===l&&a.push({element:h,datasetIndex:f,index:u})}return Re(n,e,t,d),a}function Ci(n,t,e,i,s,o){return!o&&!n.isPointInArea(t)?[]:e==="r"&&!i?Tc(n,t,e,s):Lc(n,t,e,i,s,o)}function ro(n,t,e,i,s){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return Re(n,e,t,(l,d,h)=>{l[a](t[e],s)&&(o.push({element:l,datasetIndex:d,index:h}),r=r||l.inRange(t.x,t.y,s))}),i&&!r?[]:o}var Nc={evaluateInteractionItems:Re,modes:{index(n,t,e,i){const s=ie(t,n),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?Si(n,s,o,i,a):Ci(n,s,o,!1,i,a),l=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=r[0].index,f=d.data[h];f&&!f.skip&&l.push({element:f,datasetIndex:d.index,index:h})}),l):[]},dataset(n,t,e,i){const s=ie(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?Si(n,s,o,i,a):Ci(n,s,o,!1,i,a);if(r.length>0){const l=r[0].datasetIndex,d=n.getDatasetMeta(l).data;r=[];for(let h=0;h<d.length;++h)r.push({element:d[h],datasetIndex:l,index:h})}return r},point(n,t,e,i){const s=ie(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Si(n,s,o,i,a)},nearest(n,t,e,i){const s=ie(t,n),o=e.axis||"xy",a=e.includeInvisible||!1;return Ci(n,s,o,e.intersect,i,a)},x(n,t,e,i){const s=ie(t,n);return ro(n,s,"x",e.intersect,i)},y(n,t,e,i){const s=ie(t,n);return ro(n,s,"y",e.intersect,i)}}};const lo=["left","top","right","bottom"];function $e(n,t){return n.filter(e=>e.pos===t)}function co(n,t){return n.filter(e=>lo.indexOf(e.pos)===-1&&e.box.axis===t)}function ze(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 Rc(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 $c(n){const t={};for(const e of n){const{stack:i,pos:s,stackWeight:o}=e;if(!i||!lo.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 zc(n,t){const e=$c(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,d=e[r.stack],h=d&&r.stackWeight/d.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 Ic(n){const t=Rc(n),e=ze(t.filter(d=>d.box.fullSize),!0),i=ze($e(t,"left"),!0),s=ze($e(t,"right")),o=ze($e(t,"top"),!0),a=ze($e(t,"bottom")),r=co(t,"x"),l=co(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:s.concat(l).concat(a).concat(r),chartArea:$e(t,"chartArea"),vertical:i.concat(s).concat(l),horizontal:o.concat(a).concat(r)}}function ho(n,t,e,i){return Math.max(n[e],t[e])+Math.max(n[i],t[i])}function fo(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 Wc(n,t,e,i){const{pos:s,box:o}=e,a=n.maxPadding;if(!$(s)){e.size&&(n[s]-=e.size);const f=i[e.stack]||{size:0,count:1};f.size=Math.max(f.size,e.horizontal?o.height:o.width),e.size=f.size/f.count,n[s]+=e.size}o.getPadding&&fo(a,o.getPadding());const r=Math.max(0,t.outerWidth-ho(a,n,"left","right")),l=Math.max(0,t.outerHeight-ho(a,n,"top","bottom")),d=r!==n.w,h=l!==n.h;return n.w=r,n.h=l,e.horizontal?{same:d,other:h}:{same:h,other:d}}function Hc(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 jc(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 Ie(n,t,e,i){const s=[];let o,a,r,l,d,h;for(o=0,a=n.length,d=0;o<a;++o){r=n[o],l=r.box,l.update(r.width||t.w,r.height||t.h,jc(r.horizontal,t));const{same:f,other:u}=Wc(t,e,r,i);d|=f&&s.length,h=h||u,l.fullSize||s.push(r)}return d&&Ie(s,t,e,i)||h}function Mn(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 uo(n,t,e,i){const s=e.padding;let{x:o,y:a}=t;for(const r of n){const l=r.box,d=i[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/d.weight||1;if(r.horizontal){const f=t.w*h,u=d.size||l.height;Ee(d.start)&&(a=d.start),l.fullSize?Mn(l,s.left,a,e.outerWidth-s.right-s.left,u):Mn(l,t.left+d.placed,a,f,u),d.start=a,d.placed+=f,a=l.bottom}else{const f=t.h*h,u=d.size||l.width;Ee(d.start)&&(o=d.start),l.fullSize?Mn(l,o,s.top,u,e.outerHeight-s.bottom-s.top):Mn(l,o,t.top+d.placed,u,f),d.start=o,d.placed+=f,o=l.right}}t.x=o,t.y=a}var lt={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=rt(n.options.layout.padding),o=Math.max(t-s.width,0),a=Math.max(e-s.height,0),r=Ic(n.boxes),l=r.vertical,d=r.horizontal;H(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},s);fo(u,rt(i));const p=Object.assign({maxPadding:u,w:o,h:a,x:s.left,y:s.top},s),m=zc(l.concat(d),f);Ie(r.fullSize,p,f,m),Ie(l,p,f,m),Ie(d,p,f,m)&&Ie(l,p,f,m),Hc(p),uo(r.leftAndTop,p,f,m),p.x+=p.w,p.y+=p.h,uo(r.rightAndBottom,p,f,m),n.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},H(r.chartArea,g=>{const b=g.box;Object.assign(b,n.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class po{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 Yc extends po{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Dn="$chartjs",Uc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},mo=n=>n===null||n==="";function Xc(n,t){const e=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[Dn]={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",mo(s)){const o=$s(n,"width");o!==void 0&&(n.width=o)}if(mo(i))if(n.style.height==="")n.height=n.width/(t||2);else{const o=$s(n,"height");o!==void 0&&(n.height=o)}return n}const go=Kl?{passive:!0}:!1;function qc(n,t,e){n.addEventListener(t,e,go)}function Kc(n,t,e){n.canvas.removeEventListener(t,e,go)}function Gc(n,t){const e=Uc[n.type]||n.type,{x:i,y:s}=ie(n,t);return{type:e,chart:t,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function vn(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Jc(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||vn(r.addedNodes,i),a=a&&!vn(r.removedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Zc(n,t,e){const i=n.canvas,s=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||vn(r.removedNodes,i),a=a&&!vn(r.addedNodes,i);a&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const We=new Map;let bo=0;function yo(){const n=window.devicePixelRatio;n!==bo&&(bo=n,We.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Qc(n,t){We.size||window.addEventListener("resize",yo),We.set(n,t)}function td(n){We.delete(n),We.size||window.removeEventListener("resize",yo)}function ed(n,t,e){const i=n.canvas,s=i&&bi(i);if(!s)return;const o=ys((r,l)=>{const d=s.clientWidth;e(r,l),d<s.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],d=l.contentRect.width,h=l.contentRect.height;d===0&&h===0||o(d,h)});return a.observe(s),Qc(n,o),a}function Mi(n,t,e){e&&e.disconnect(),t==="resize"&&td(n)}function nd(n,t,e){const i=n.canvas,s=ys(o=>{n.ctx!==null&&e(Gc(o,n))},n);return qc(i,t,s),s}class id extends po{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Xc(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Dn])return!1;const i=e[Dn].initial;["height","width"].forEach(o=>{const a=i[o];z(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[Dn],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),a={attach:Jc,detach:Zc,resize:ed}[e]||nd;s[e]=a(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:Mi,detach:Mi,resize:Mi}[e]||Kc)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return ql(t,e,i,s)}isAttached(t){const e=bi(t);return!!(e&&e.isConnected)}}function sd(n){return!Ns()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Yc:id}let Pt=(Kn=class{constructor(){B(this,"x");B(this,"y");B(this,"active",!1);B(this,"options");B(this,"$animations")}tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return me(this.x)&&me(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}},B(Kn,"defaults",{}),B(Kn,"defaultRoutes"),Kn);function od(n,t){const e=n.options.ticks,i=ad(n),s=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?ld(t):[],a=o.length,r=o[0],l=o[a-1],d=[];if(a>s)return cd(t,d,o,a/s),d;const h=rd(o,t,s);if(a>0){let f,u;const p=a>1?Math.round((l-r)/(a-1)):null;for(En(t,d,h,z(p)?0:r-p,r),f=0,u=a-1;f<u;f++)En(t,d,h,o[f],o[f+1]);return En(t,d,h,l,z(p)?t.length:l+p),d}return En(t,d,h),d}function ad(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 rd(n,t,e){const i=dd(n),s=t.length/e;if(!i)return Math.max(s,1);const o=Zr(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 ld(n){const t=[];let e,i;for(e=0,i=n.length;e<i;e++)n[e].major&&t.push(e);return t}function cd(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 En(n,t,e,i,s){const o=R(i,0),a=Math.min(R(s,n.length),n.length);let r=0,l,d,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(d=Math.max(o,0);d<a;d++)d===h&&(t.push(n[d]),r++,h=Math.round(o+r*e))}function dd(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 hd=n=>n==="left"?"right":n==="right"?"left":n,_o=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,xo=(n,t)=>Math.min(t||n,n);function ko(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 fd(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),d;if(!(e&&(i===1?d=Math.max(l-o,a-l):t===0?d=(n.getPixelForTick(1)-l)/2:d=(l-n.getPixelForTick(s-1))/2,l+=s<t?d:-d,l<o-r||l>a+r)))return l}function ud(n,t){H(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 He(n){return n.drawTicks?n.tickLength:0}function wo(n,t){if(!n.display)return 0;const e=et(n.font,t),i=rt(n.padding);return(X(n.text)?n.text.length:1)*e.lineHeight+i.height}function pd(n,t){return jt(n,{scale:t,type:"scale"})}function md(n,t,e){return jt(n,{tick:e,index:t,type:"tick"})}function gd(n,t,e){let i=ri(n);return(e&&t!=="right"||!e&&t==="right")&&(i=hd(i)),i}function bd(n,t,e,i){const{top:s,left:o,bottom:a,right:r,chart:l}=n,{chartArea:d,scales:h}=l;let f=0,u,p,m;const g=a-s,b=r-o;if(n.isHorizontal()){if(p=at(i,o,r),$(e)){const y=Object.keys(e)[0],x=e[y];m=h[y].getPixelForValue(x)+g-t}else e==="center"?m=(d.bottom+d.top)/2+g-t:m=_o(n,e,t);u=r-o}else{if($(e)){const y=Object.keys(e)[0],x=e[y];p=h[y].getPixelForValue(x)-b+t}else e==="center"?p=(d.left+d.right)/2-b+t:p=_o(n,e,t);m=at(i,a,s),f=e==="left"?-tt:tt}return{titleX:p,titleY:m,maxWidth:u,rotation:f}}class re extends Pt{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=ut(t,Number.POSITIVE_INFINITY),e=ut(e,Number.NEGATIVE_INFINITY),i=ut(i,Number.POSITIVE_INFINITY),s=ut(s,Number.NEGATIVE_INFINITY),{min:ut(t,i),max:ut(e,s),minDefined:J(t),maxDefined:J(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,d=r.length;l<d;++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:ut(e,ut(i,e)),max:ut(i,ut(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=Dl(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?ko(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=od(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=xo(this.ticks.length,t.ticks.maxTicksLimit),s=e.minRotation||0,o=e.maxRotation;let a=s,r,l,d;if(!this._isVisible()||!e.display||s>=o||i<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),f=h.widest.width,u=h.highest.height,p=st(this.chart.width-f,0,this.maxWidth);r=t.offset?this.maxWidth/i:p/(i-1),f+6>r&&(r=p/(i-(t.offset?.5:1)),l=this.maxHeight-He(t.grid)-e.padding-wo(t.title,this.chart.options.font),d=Math.sqrt(f*f+u*u),a=si(Math.min(Math.asin(st((h.highest.height+6)/r,-1,1)),Math.asin(st(l/d,-1,1))-Math.asin(st(u/d,-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=wo(s,e.options.font);if(r?(t.width=this.maxWidth,t.height=He(o)+l):(t.height=this.maxHeight,t.width=He(o)+l),i.display&&this.ticks.length){const{first:d,last:h,widest:f,highest:u}=this._getLabelSizes(),p=i.padding*2,m=_t(this.labelRotation),g=Math.cos(m),b=Math.sin(m);if(r){const y=i.mirror?0:b*f.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+y+p)}else{const y=i.mirror?0:g*f.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+y+p)}this._calculatePadding(d,h,b,g)}}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,d=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,p=0;l?d?(u=s*t.width,p=i*e.height):(u=i*t.height,p=s*e.width):o==="start"?p=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,p=e.width/2),this.paddingLeft=Math.max((u-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((p-f+a)*this.width/(this.width-f),0)}else{let h=e.height/2,f=t.height/2;o==="start"?(h=0,f=t.height):o==="end"&&(h=e.height,f=0),this.paddingTop=h+a,this.paddingBottom=f+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++)z(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=ko(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/xo(e,i));let d=0,h=0,f,u,p,m,g,b,y,x,w,k,_;for(f=0;f<e;f+=l){if(m=t[f].label,g=this._resolveTickFontOptions(f),s.font=b=g.string,y=o[b]=o[b]||{data:{},gc:[]},x=g.lineHeight,w=k=0,!z(m)&&!X(m))w=un(s,y.data,y.gc,w,m),k=x;else if(X(m))for(u=0,p=m.length;u<p;++u)_=m[u],!z(_)&&!X(_)&&(w=un(s,y.data,y.gc,w,_),k+=x);a.push(w),r.push(k),d=Math.max(w,d),h=Math.max(k,h)}ud(o,e);const S=a.indexOf(d),C=r.indexOf(h),v=A=>({width:a[A]||0,height:r[A]||0});return{first:v(0),last:v(e-1),widest:v(S),highest:v(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 el(this._alignToPixels?Qt(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=md(this.getContext(),t,i))}return this.$context||(this.$context=pd(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=_t(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,d=this.isHorizontal(),f=this.ticks.length+(l?1:0),u=He(o),p=[],m=r.setContext(this.getContext()),g=m.display?m.width:0,b=g/2,y=function(M){return Qt(i,M,g)};let x,w,k,_,S,C,v,A,F,P,L,U;if(a==="top")x=y(this.bottom),C=this.bottom-u,A=x-b,P=y(t.top)+b,U=t.bottom;else if(a==="bottom")x=y(this.top),P=t.top,U=y(t.bottom)-b,C=x+b,A=this.top+u;else if(a==="left")x=y(this.right),S=this.right-u,v=x-b,F=y(t.left)+b,L=t.right;else if(a==="right")x=y(this.left),F=t.left,L=y(t.right)-b,S=x+b,v=this.left+u;else if(e==="x"){if(a==="center")x=y((t.top+t.bottom)/2+.5);else if($(a)){const M=Object.keys(a)[0],E=a[M];x=y(this.chart.scales[M].getPixelForValue(E))}P=t.top,U=t.bottom,C=x+b,A=C+u}else if(e==="y"){if(a==="center")x=y((t.left+t.right)/2);else if($(a)){const M=Object.keys(a)[0],E=a[M];x=y(this.chart.scales[M].getPixelForValue(E))}S=x-b,v=S-u,F=t.left,L=t.right}const O=R(s.ticks.maxTicksLimit,f),D=Math.max(1,Math.ceil(f/O));for(w=0;w<f;w+=D){const M=this.getContext(w),E=o.setContext(M),V=r.setContext(M),T=E.lineWidth,N=E.color,W=V.dash||[],j=V.dashOffset,G=E.tickWidth,Q=E.tickColor,ot=E.tickBorderDash||[],yt=E.tickBorderDashOffset;k=fd(this,w,l),k!==void 0&&(_=Qt(i,k,T),d?S=v=F=L=_:C=A=P=U=_,p.push({tx1:S,ty1:C,tx2:v,ty2:A,x1:F,y1:P,x2:L,y2:U,width:T,color:N,borderDash:W,borderDashOffset:j,tickWidth:G,tickColor:Q,tickBorderDash:ot,tickBorderDashOffset:yt}))}return this._ticksLength=f,this._borderValue=x,p}_computeLabelItems(t){const e=this.axis,i=this.options,{position:s,ticks:o}=i,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:d,padding:h,mirror:f}=o,u=He(i.grid),p=u+h,m=f?-h:p,g=-_t(this.labelRotation),b=[];let y,x,w,k,_,S,C,v,A,F,P,L,U="middle";if(s==="top")S=this.bottom-m,C=this._getXAxisLabelAlignment();else if(s==="bottom")S=this.top+m,C=this._getXAxisLabelAlignment();else if(s==="left"){const D=this._getYAxisLabelAlignment(u);C=D.textAlign,_=D.x}else if(s==="right"){const D=this._getYAxisLabelAlignment(u);C=D.textAlign,_=D.x}else if(e==="x"){if(s==="center")S=(t.top+t.bottom)/2+p;else if($(s)){const D=Object.keys(s)[0],M=s[D];S=this.chart.scales[D].getPixelForValue(M)+p}C=this._getXAxisLabelAlignment()}else if(e==="y"){if(s==="center")_=(t.left+t.right)/2-p;else if($(s)){const D=Object.keys(s)[0],M=s[D];_=this.chart.scales[D].getPixelForValue(M)}C=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?U="top":l==="end"&&(U="bottom"));const O=this._getLabelSizes();for(y=0,x=r.length;y<x;++y){w=r[y],k=w.label;const D=o.setContext(this.getContext(y));v=this.getPixelForTick(y)+o.labelOffset,A=this._resolveTickFontOptions(y),F=A.lineHeight,P=X(k)?k.length:1;const M=P/2,E=D.color,V=D.textStrokeColor,T=D.textStrokeWidth;let N=C;a?(_=v,C==="inner"&&(y===x-1?N=this.options.reverse?"left":"right":y===0?N=this.options.reverse?"right":"left":N="center"),s==="top"?d==="near"||g!==0?L=-P*F+F/2:d==="center"?L=-O.highest.height/2-M*F+F:L=-O.highest.height+F/2:d==="near"||g!==0?L=F/2:d==="center"?L=O.highest.height/2-M*F:L=O.highest.height-P*F,f&&(L*=-1),g!==0&&!D.showLabelBackdrop&&(_+=F/2*Math.sin(g))):(S=v,L=(1-P)*F/2);let W;if(D.showLabelBackdrop){const j=rt(D.backdropPadding),G=O.heights[y],Q=O.widths[y];let ot=L-j.top,yt=0-j.left;switch(U){case"middle":ot-=G/2;break;case"bottom":ot-=G;break}switch(C){case"center":yt-=Q/2;break;case"right":yt-=Q;break}W={left:yt,top:ot,width:Q+j.width,height:G+j.height,color:D.backdropColor}}b.push({label:k,font:A,textOffset:L,options:{rotation:g,color:E,strokeColor:V,strokeWidth:T,textAlign:N,textBaseline:U,translation:[_,S],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-_t(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 d,h;return e==="left"?s?(h=this.right+o,i==="near"?d="left":i==="center"?(d="center",h+=l/2):(d="right",h+=l)):(h=this.right-r,i==="near"?d="right":i==="center"?(d="center",h-=l/2):(d="left",h=this.left)):e==="right"?s?(h=this.left+o,i==="near"?d="right":i==="center"?(d="center",h-=l/2):(d="left",h-=l)):(h=this.left+r,i==="near"?d="left":i==="center"?(d="center",h+=l/2):(d="right",h=this.right)):d="right",{textAlign:d,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,d,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(d.x,d.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 d,h,f,u;this.isHorizontal()?(d=Qt(t,this.left,a)-a/2,h=Qt(t,this.right,r)+r/2,f=u=l):(f=Qt(t,this.top,a)-a/2,u=Qt(t,this.bottom,r)+r/2,d=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(d,f),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const i=this.ctx,s=this._computeLabelArea();s&&pn(i,s);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,d=a.label,h=a.textOffset;te(i,d,0,h,l,r)}s&&mn(i)}drawTitle(){const{ctx:t,options:{position:e,title:i,reverse:s}}=this;if(!i.display)return;const o=et(i.font),a=rt(i.padding),r=i.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||$(e)?(l+=a.bottom,X(i.text)&&(l+=o.lineHeight*(i.text.length-1))):l+=a.top;const{titleX:d,titleY:h,maxWidth:f,rotation:u}=bd(this,l,e,r);te(t,i.text,0,0,o,{color:i.color,maxWidth:f,rotation:u,textAlign:gd(r,e,s),textBaseline:"middle",translation:[d,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!==re.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 Bn{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;xd(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,yd(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 Zt[i])}}function yd(n,t,e){const i=De(Object.create(null),[e?Z.get(e):{},Z.get(t),n.defaults]);Z.set(t,i),n.defaultRoutes&&_d(t,n.defaultRoutes),n.descriptors&&Z.describe(t,n.descriptors)}function _d(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 xd(n){return"id"in n&&"defaults"in n}class kd{constructor(){this.controllers=new Bn(xt,"datasets",!0),this.elements=new Bn(Pt,"elements"),this.plugins=new Bn(Object,"plugins"),this.scales=new Bn(re,"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):H(s,a=>{const r=i||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,i){const s=ii(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 wt=new kd;class wd{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(){z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const i=t&&t.config,s=R(i.options&&i.options.plugins,{}),o=Sd(i);return s===!1&&!e?[]:Md(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 Sd(n){const t={},e=[],i=Object.keys(wt.plugins.items);for(let o=0;o<i.length;o++)e.push(wt.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 Cd(n,t){return!t&&n===!1?null:n===!0?{}:n}function Md(n,{plugins:t,localIds:e},i,s){const o=[],a=n.getContext();for(const r of t){const l=r.id,d=Cd(i[l],s);d!==null&&o.push({plugin:r,options:Dd(n.config,{plugin:r,local:e[l]},d,a)})}return o}function Dd(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 Di(n,t){const e=Z.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function vd(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Ed(n,t){return n===t?"_index_":"_value_"}function So(n){if(n==="x"||n==="y"||n==="r")return n}function Bd(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function vi(n,...t){if(So(n))return n;for(const e of t){const i=e.axis||Bd(e.position)||n.length>1&&So(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Co(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Vd(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 Co(n,"x",e[0])||Co(n,"y",e[0])}return{}}function Pd(n,t){const e=Zt[n.type]||{scales:{}},i=t.scales||{},s=Di(n.type,t),o=Object.create(null);return Object.keys(i).forEach(a=>{const r=i[a];if(!$(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=vi(a,r,Vd(a,n),Z.scales[r.type]),d=Ed(l,s),h=e.scales||{};o[a]=ve(Object.create(null),[{axis:l},r,h[l],h[d]])}),n.data.datasets.forEach(a=>{const r=a.type||n.type,l=a.indexAxis||Di(r,t),h=(Zt[r]||{}).scales||{};Object.keys(h).forEach(f=>{const u=vd(f,l),p=a[u+"AxisID"]||u;o[p]=o[p]||Object.create(null),ve(o[p],[{axis:u},i[p],h[f]])})}),Object.keys(o).forEach(a=>{const r=o[a];ve(r,[Z.scales[r.type],Z.scale])}),o}function Mo(n){const t=n.options||(n.options={});t.plugins=R(t.plugins,{}),t.scales=Pd(n,t)}function Do(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Od(n){return n=n||{},n.data=Do(n.data),Mo(n),n}const vo=new Map,Eo=new Set;function Vn(n,t){let e=vo.get(n);return e||(e=t(),vo.set(n,e),Eo.add(e)),e}const je=(n,t,e)=>{const i=It(t,e);i!==void 0&&n.add(i)};class Ad{constructor(t){this._config=Od(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=Do(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(),Mo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Vn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Vn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Vn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return Vn(`${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(f=>je(l,t,f))),h.forEach(f=>je(l,s,f)),h.forEach(f=>je(l,Zt[o]||{},f)),h.forEach(f=>je(l,Z,f)),h.forEach(f=>je(l,di,f))});const d=Array.from(l);return d.length===0&&d.push(Object.create(null)),Eo.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,Zt[e]||{},Z.datasets[e]||{},{type:e},Z,di]}resolveNamedOptions(t,e,i,s=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Bo(this._resolverCache,t,s);let l=a;if(Td(a,e)){o.$shared=!1,i=Wt(i)?i():i;const d=this.createResolver(t,i,r);l=ge(a,i,d)}for(const d of e)o[d]=l[d];return o}createResolver(t,e,i=[""],s){const{resolver:o}=Bo(this._resolverCache,t,i);return $(e)?ge(o,e,void 0,s):o}}function Bo(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:pi(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,o)),o}const Fd=n=>$(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||Wt(n[e]),!1);function Td(n,t){const{isScriptable:e,isIndexable:i}=Bs(n);for(const s of t){const o=e(s),a=i(s),r=(a||o)&&n[s];if(o&&(Wt(r)||Fd(r))||a&&X(r))return!0}return!1}var Ld="4.4.0";const Nd=["top","bottom","left","right","chartArea"];function Vo(n,t){return n==="top"||n==="bottom"||Nd.indexOf(n)===-1&&t==="x"}function Po(n,t){return function(e,i){return e[n]===i[n]?e[t]-i[t]:e[n]-i[n]}}function Oo(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),Y(e&&e.onComplete,[n],t)}function Rd(n){const t=n.chart,e=t.options.animation;Y(e&&e.onProgress,[n],t)}function Ao(n){return Ns()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Pn={},Fo=n=>{const t=Ao(n);return Object.values(Pn).filter(e=>e.canvas===t).pop()};function $d(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 zd(n,t,e,i){return!e||n.type==="mouseout"?null:i?t:n}function On(n,t,e){return n.options.clip?n[e]:t[e]}function Id(n,t){const{xScale:e,yScale:i}=n;return e&&i?{left:On(e,t,"left"),right:On(e,t,"right"),top:On(i,t,"top"),bottom:On(i,t,"bottom")}:t}class Ot{static register(...t){wt.add(...t),To()}static unregister(...t){wt.remove(...t),To()}constructor(t,e){const i=this.config=new Ad(e),s=Ao(t),o=Fo(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||sd(s)),this.platform.updateConfig(i);const r=this.platform.acquireContext(s,a.aspectRatio),l=r&&r.canvas,d=l&&l.height,h=l&&l.width;if(this.id=Hr(),this.ctx=r,this.canvas=l,this.width=h,this.height=d,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 wd,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=ol(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],Pn[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Vt.listen(this,"complete",Oo),Vt.listen(this,"progress",Rd),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:o}=this;return z(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 wt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Rs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ds(this.canvas,this.ctx),this}stop(){return Vt.stop(this),this}resize(t,e){Vt.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||{};H(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=vi(a,r),d=l==="r",h=l==="x";return{options:r,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),H(o,a=>{const r=a.options,l=r.id,d=vi(l,r),h=R(r.type,a.dtype);(r.position===void 0||Vo(r.position,d)!==Vo(a.dposition))&&(r.position=a.dposition),s[l]=!0;let f=null;if(l in i&&i[l].type===h)f=i[l];else{const u=wt.getScale(h);f=new u({id:l,type:h,ctx:this.ctx,chart:this}),i[f.id]=f}f.init(r,t)}),H(s,(a,r)=>{a||delete i[r]}),H(i,a=>{lt.configure(this,a,a.options),lt.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(Po("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||Di(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=wt.getController(r),{datasetElementType:d,dataElementType:h}=Z.datasets[r];Object.assign(l,{dataElementType:wt.getElement(h),datasetElementType:d&&wt.getElement(d)}),a.controller=new l(this,i),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){H(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 d=0,h=this.data.datasets.length;d<h;d++){const{controller:f}=this.getDatasetMeta(d),u=!s&&o.indexOf(f)===-1;f.buildOrUpdateElements(u),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=i.layout.autoPadding?a:0,this._updateLayout(a),s||H(o,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Po("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){H(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!ls(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;$d(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(!ls(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;lt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],H(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,Wt(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&&(Vt.has(this)?this.attached&&!Vt.running(this)&&Vt.start(this):(this.draw(),Oo({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=Id(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(s&&pn(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&&mn(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Bt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,s){const o=Nc.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=jt(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);Ee(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(),Vt.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(),Ds(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Pn[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)};H(this.options.events,o=>i(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,d)=>{e.addEventListener(this,l,d),t[l]=d},s=(l,d)=>{t[l]&&(e.removeEventListener(this,l,d),delete t[l])},o=(l,d)=>{this.canvas&&this.resize(l,d)};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(){H(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},H(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 d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[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}});!ln(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,d)=>l.filter(h=>!d.some(f=>h.datasetIndex===f.datasetIndex&&h.index===f.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=Kr(t),d=zd(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=!ln(r,s);return(h||e)&&(this._active=r,this._updateHoverStyles(r,s,e)),this._lastEvent=d,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)}}B(Ot,"defaults",Z),B(Ot,"instances",Pn),B(Ot,"overrides",Zt),B(Ot,"registry",wt),B(Ot,"version",Ld),B(Ot,"getChart",Fo);function To(){return H(Ot.instances,n=>n._plugins.invalidate())}function Wd(n,t,e){const{startAngle:i,pixelMargin:s,x:o,y:a,outerRadius:r,innerRadius:l}=t;let d=s/r;n.beginPath(),n.arc(o,a,r,i-d,e+d),l>s?(d=s/l,n.arc(o,a,l,e+d,i-d,!0)):n.arc(o,a,s,e+tt,i-tt),n.closePath(),n.clip()}function Hd(n){return ui(n,["outerStart","outerEnd","innerStart","innerEnd"])}function jd(n,t,e,i){const s=Hd(n.options.borderRadius),o=(e-t)/2,a=Math.min(o,i*t/2),r=l=>{const d=(e-Math.min(o,l))*i/2;return st(l,0,Math.min(o,d))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:st(s.innerStart,0,a),innerEnd:st(s.innerEnd,0,a)}}function _e(n,t,e,i){return{x:e+n*Math.cos(t),y:i+n*Math.sin(t)}}function An(n,t,e,i,s,o){const{x:a,y:r,startAngle:l,pixelMargin:d,innerRadius:h}=t,f=Math.max(t.outerRadius+i+e-d,0),u=h>0?h+i+e+d:0;let p=0;const m=s-l;if(i){const D=h>0?h-i:0,M=f>0?f-i:0,E=(D+M)/2,V=E!==0?m*E/(E+i):m;p=(m-V)/2}const g=Math.max(.001,m*f-e/q)/f,b=(m-g)/2,y=l+b+p,x=s-b-p,{outerStart:w,outerEnd:k,innerStart:_,innerEnd:S}=jd(t,u,f,x-y),C=f-w,v=f-k,A=y+w/C,F=x-k/v,P=u+_,L=u+S,U=y+_/P,O=x-S/L;if(n.beginPath(),o){const D=(A+F)/2;if(n.arc(a,r,f,A,D),n.arc(a,r,f,D,F),k>0){const T=_e(v,F,a,r);n.arc(T.x,T.y,k,F,x+tt)}const M=_e(L,x,a,r);if(n.lineTo(M.x,M.y),S>0){const T=_e(L,O,a,r);n.arc(T.x,T.y,S,x+tt,O+Math.PI)}const E=(x-S/u+(y+_/u))/2;if(n.arc(a,r,u,x-S/u,E,!0),n.arc(a,r,u,E,y+_/u,!0),_>0){const T=_e(P,U,a,r);n.arc(T.x,T.y,_,U+Math.PI,y-tt)}const V=_e(C,y,a,r);if(n.lineTo(V.x,V.y),w>0){const T=_e(C,A,a,r);n.arc(T.x,T.y,w,y-tt,A)}}else{n.moveTo(a,r);const D=Math.cos(A)*f+a,M=Math.sin(A)*f+r;n.lineTo(D,M);const E=Math.cos(F)*f+a,V=Math.sin(F)*f+r;n.lineTo(E,V)}n.closePath()}function Yd(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){An(n,t,e,i,l,s);for(let d=0;d<o;++d)n.fill();isNaN(r)||(l=a+(r%K||K))}return An(n,t,e,i,l,s),n.fill(),l}function Ud(n,t,e,i,s){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:d,borderJoinStyle:h,borderDash:f,borderDashOffset:u}=l,p=l.borderAlign==="inner";if(!d)return;n.setLineDash(f||[]),n.lineDashOffset=u,p?(n.lineWidth=d*2,n.lineJoin=h||"round"):(n.lineWidth=d,n.lineJoin=h||"bevel");let m=t.endAngle;if(o){An(n,t,e,i,m,s);for(let g=0;g<o;++g)n.stroke();isNaN(r)||(m=a+(r%K||K))}p&&Wd(n,t,m),o||(An(n,t,e,i,m,s),n.stroke())}class Ye extends Pt{constructor(e){super();B(this,"circumference");B(this,"endAngle");B(this,"fullCircles");B(this,"innerRadius");B(this,"outerRadius");B(this,"pixelMargin");B(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}=us(o,{x:e,y:i}),{startAngle:l,endAngle:d,innerRadius:h,outerRadius:f,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),p=(this.options.spacing+this.options.borderWidth)/2,g=R(u,d-l)>=K||Ve(a,l,d),b=vt(r,h+p,f+p);return g&&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:d,spacing:h}=this.options,f=(o+a)/2,u=(r+l+h+d)/2;return{x:i+Math.cos(f)*u,y:s+Math.sin(f)*u}}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>K?Math.floor(s/K):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 d=1-Math.sin(Math.min(q,s||0)),h=o*d;e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,Yd(e,this,h,a,r),Ud(e,this,h,a,r),e.restore()}}B(Ye,"id","arc"),B(Ye,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),B(Ye,"defaultRoutes",{backgroundColor:"backgroundColor"}),B(Ye,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Lo(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 Xd(n,t,e){n.lineTo(e.x,e.y)}function qd(n){return n.stepped?bl:n.tension||n.cubicInterpolationMode==="monotone"?yl:Xd}function No(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),d=Math.min(o,r),h=s<a&&o<a||s>r&&o>r;return{count:i,start:l,loop:t.loop,ilen:d<l&&!h?i+d-l:d-l}}function Kd(n,t,e,i){const{points:s,options:o}=t,{count:a,start:r,loop:l,ilen:d}=No(s,e,i),h=qd(o);let{move:f=!0,reverse:u}=i||{},p,m,g;for(p=0;p<=d;++p)m=s[(r+(u?d-p:p))%a],!m.skip&&(f?(n.moveTo(m.x,m.y),f=!1):h(n,g,m,u,o.stepped),g=m);return l&&(m=s[(r+(u?d:0))%a],h(n,g,m,u,o.stepped)),!!l}function Gd(n,t,e,i){const s=t.points,{count:o,start:a,ilen:r}=No(s,e,i),{move:l=!0,reverse:d}=i||{};let h=0,f=0,u,p,m,g,b,y;const x=k=>(a+(d?r-k:k))%o,w=()=>{g!==b&&(n.lineTo(h,b),n.lineTo(h,g),n.lineTo(h,y))};for(l&&(p=s[x(0)],n.moveTo(p.x,p.y)),u=0;u<=r;++u){if(p=s[x(u)],p.skip)continue;const k=p.x,_=p.y,S=k|0;S===m?(_<g?g=_:_>b&&(b=_),h=(f*h+k)/++f):(w(),n.lineTo(k,_),m=S,f=0,g=b=_),y=_}w()}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?Gd:Kd}function Jd(n){return n.stepped?Gl:n.tension||n.cubicInterpolationMode==="monotone"?Jl:se}function Zd(n,t,e,i){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,i)&&s.closePath()),Lo(n,t.options),n.stroke(s)}function Qd(n,t,e,i){const{segments:s,options:o}=t,a=Ei(t);for(const r of s)Lo(n,o,r.style),n.beginPath(),a(n,t,r,{start:e,end:e+i-1})&&n.closePath(),n.stroke()}const th=typeof Path2D=="function";function eh(n,t,e,i){th&&!t.options.segment?Zd(n,t,e,i):Qd(n,t,e,i)}class Yt extends Pt{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;Wl(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=ic(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=Ys(this,{property:e,start:s,end:s});if(!a.length)return;const r=[],l=Jd(i);let d,h;for(d=0,h=a.length;d<h;++d){const{start:f,end:u}=a[d],p=o[f],m=o[u];if(p===m){r.push(p);continue}const g=Math.abs((s-p[e])/(m[e]-p[e])),b=l(p,m,g,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(),eh(t,this,i,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}B(Yt,"id","line"),B(Yt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),B(Yt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),B(Yt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Ro(n,t,e,i){const s=n.options,{[e]:o}=n.getProps([e],i);return Math.abs(t-o)<s.radius+s.hitRadius}class Fn extends Pt{constructor(e){super();B(this,"parsed");B(this,"skip");B(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 Ro(this,e,"x",i)}inYRange(e,i){return Ro(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||!Bt(this,i,this.size(s)/2)||(e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.fillStyle=s.backgroundColor,fi(e,s,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}B(Fn,"id","point"),B(Fn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),B(Fn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function $o(n,t){const{x:e,y:i,base:s,width:o,height:a}=n.getProps(["x","y","base","width","height"],t);let r,l,d,h,f;return n.horizontal?(f=a/2,r=Math.min(e,s),l=Math.max(e,s),d=i-f,h=i+f):(f=o/2,r=e-f,l=e+f,d=Math.min(i,s),h=Math.max(i,s)),{left:r,top:d,right:l,bottom:h}}function Ut(n,t,e,i){return n?0:st(t,e,i)}function nh(n,t,e){const i=n.options.borderWidth,s=n.borderSkipped,o=Es(i);return{t:Ut(s.top,o.top,0,e),r:Ut(s.right,o.right,0,t),b:Ut(s.bottom,o.bottom,0,e),l:Ut(s.left,o.left,0,t)}}function ih(n,t,e){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,o=ee(s),a=Math.min(t,e),r=n.borderSkipped,l=i||$(s);return{topLeft:Ut(!l||r.top||r.left,o.topLeft,0,a),topRight:Ut(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Ut(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Ut(!l||r.bottom||r.right,o.bottomRight,0,a)}}function sh(n){const t=$o(n),e=t.right-t.left,i=t.bottom-t.top,s=nh(n,e/2,i/2),o=ih(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 Bi(n,t,e,i){const s=t===null,o=e===null,r=n&&!(s&&o)&&$o(n,i);return r&&(s||vt(t,r.left,r.right))&&(o||vt(e,r.top,r.bottom))}function oh(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function ah(n,t){n.rect(t.x,t.y,t.w,t.h)}function Vi(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 Tn extends Pt{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}=sh(this),r=oh(a.radius)?Fe:ah;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,Vi(a,e,o)),t.clip(),r(t,Vi(o,-e,a)),t.fillStyle=i,t.fill("evenodd")),t.beginPath(),r(t,Vi(o,e)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,e,i){return Bi(this,t,e,i)}inXRange(t,e){return Bi(this,t,null,e)}inYRange(t,e){return Bi(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}}B(Tn,"id","bar"),B(Tn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),B(Tn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var rh=Object.freeze({__proto__:null,ArcElement:Ye,BarElement:Tn,LineElement:Yt,PointElement:Fn});const Pi=["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)"],zo=Pi.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Io(n){return Pi[n%Pi.length]}function Wo(n){return zo[n%zo.length]}function lh(n,t){return n.borderColor=Io(t),n.backgroundColor=Wo(t),++t}function ch(n,t){return n.backgroundColor=n.data.map(()=>Io(t++)),t}function dh(n,t){return n.backgroundColor=n.data.map(()=>Wo(t++)),t}function hh(n){let t=0;return(e,i)=>{const s=n.getDatasetMeta(i).controller;s instanceof oe?t=ch(e,t):s instanceof Ne?t=dh(e,t):s&&(t=lh(e,t))}}function Ho(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function fh(n){return n&&(n.borderColor||n.backgroundColor)}var uh={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&&(Ho(i)||fh(s)||o&&Ho(o)))return;const a=hh(n);i.forEach(a)}};function ph(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 d=t+e-1;let h=t,f,u,p,m,g;for(a[l++]=n[h],f=0;f<o-2;f++){let b=0,y=0,x;const w=Math.floor((f+1)*r)+1+t,k=Math.min(Math.floor((f+2)*r)+1,e)+t,_=k-w;for(x=w;x<k;x++)b+=n[x].x,y+=n[x].y;b/=_,y/=_;const S=Math.floor(f*r)+1+t,C=Math.min(Math.floor((f+1)*r)+1,e)+t,{x:v,y:A}=n[h];for(p=m=-1,x=S;x<C;x++)m=.5*Math.abs((v-b)*(n[x].y-A)-(v-n[x].x)*(y-A)),m>p&&(p=m,u=n[x],g=x);a[l++]=u,h=g}return a[l++]=n[d],a}function mh(n,t,e,i){let s=0,o=0,a,r,l,d,h,f,u,p,m,g;const b=[],y=t+e-1,x=n[t].x,k=n[y].x-x;for(a=t;a<t+e;++a){r=n[a],l=(r.x-x)/k*i,d=r.y;const _=l|0;if(_===h)d<m?(m=d,f=a):d>g&&(g=d,u=a),s=(o*s+r.x)/++o;else{const S=a-1;if(!z(f)&&!z(u)){const C=Math.min(f,u),v=Math.max(f,u);C!==p&&C!==S&&b.push({...n[C],x:s}),v!==p&&v!==S&&b.push({...n[v],x:s})}a>0&&S!==p&&b.push(n[S]),b.push(r),h=_,o=0,m=g=d,f=u=p=a}}return b}function jo(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 Yo(n){n.data.datasets.forEach(t=>{jo(t)})}function gh(n,t){const e=t.length;let i=0,s;const{iScale:o}=n,{min:a,max:r,minDefined:l,maxDefined:d}=o.getUserBounds();return l&&(i=st(Et(t,o.axis,a).lo,0,e-1)),d?s=st(Et(t,o.axis,r).hi+1,i,e)-i:s=e-i,{start:i,count:s}}var bh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){Yo(n);return}const i=n.width;n.data.datasets.forEach((s,o)=>{const{_data:a,indexAxis:r}=s,l=n.getDatasetMeta(o),d=a||s.data;if(Te([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:f,count:u}=gh(l,d);const p=e.threshold||4*i;if(u<=p){jo(s);return}z(a)&&(s._data=d,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(e.algorithm){case"lttb":m=ph(d,f,u,i,e);break;case"min-max":m=mh(d,f,u,i);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=m})},destroy(n){Yo(n)}};function yh(n,t,e){const i=n.segments,s=n.points,o=t.points,a=[];for(const r of i){let{start:l,end:d}=r;d=Ai(l,d,s);const h=Oi(e,s[l],s[d],r.loop);if(!t.segments){a.push({source:r,target:h,start:s[l],end:s[d]});continue}const f=Ys(t,h);for(const u of f){const p=Oi(e,o[u.start],o[u.end],u.loop),m=js(r,s,p);for(const g of m)a.push({source:g,target:u,start:{[e]:Uo(h,p,"start",Math.max)},end:{[e]:Uo(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=pt(s),o=pt(o)),{property:n,start:s,end:o}}function _h(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],d=s[r];i!==null?(o.push({x:l.x,y:i}),o.push({x:d.x,y:i})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:d.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 Uo(n,t,e,i){return n&&t?i(n[e],t[e]):n?n[e]:t?t[e]:0}function Xo(n,t){let e=[],i=!1;return X(n)?(i=!0,e=n):e=_h(n,t),e.length?new Yt({points:e,options:{tension:0},_loop:i,_fullLoop:i}):null}function qo(n){return n&&n.fill!==!1}function xh(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(!J(s))return s;if(a=n[s],!a)return!1;if(a.visible)return s;o.push(s),s=a.fill}return!1}function kh(n,t,e){const i=Mh(n);if($(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return J(s)&&Math.floor(s)===s?wh(i[0],t,s,e):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function wh(n,t,e,i){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=i?!1:e}function Sh(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:$(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Ch(n,t,e){let i;return n==="start"?i=e:n==="end"?i=t.options.reverse?t.min:t.max:$(n)?i=n.value:i=t.getBaseValue(),i}function Mh(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 Dh(n){const{scale:t,index:e,line:i}=n,s=[],o=i.segments,a=i.points,r=vh(t,e);r.push(Xo({x:null,y:t.bottom},i));for(let l=0;l<o.length;l++){const d=o[l];for(let h=d.start;h<=d.end;h++)Eh(s,a[h],r)}return new Yt({points:s,options:{}})}function vh(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 Eh(n,t,e){const i=[];for(let s=0;s<e.length;s++){const o=e[s],{first:a,last:r,point:l}=Bh(o,t,"x");if(!(!l||a&&r)){if(a)i.unshift(l);else if(n.push(l),!r)break}}n.push(...i)}function Bh(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 d=0;d<o.length;d++){const h=o[d],f=a[h.start][e],u=a[h.end][e];if(vt(s,f,u)){r=s===f,l=s===u;break}}return{first:r,last:l,point:i}}class Ko{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:K},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 Vh(n){const{chart:t,fill:e,line:i}=n;if(J(e))return Ph(t,e);if(e==="stack")return Dh(n);if(e==="shape")return!0;const s=Oh(n);return s instanceof Ko?s:Xo(s,i)}function Ph(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Oh(n){return(n.scale||{}).getPointPositionForValue?Fh(n):Ah(n)}function Ah(n){const{scale:t={},fill:e}=n,i=Sh(e,t);if(J(i)){const s=t.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Fh(n){const{scale:t,fill:e}=n,i=t.options,s=t.getLabels().length,o=i.reverse?t.max:t.min,a=Ch(e,t,o),r=[];if(i.grid.circular){const l=t.getPointPositionForValue(0,o);return new Ko({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 Fi(n,t,e){const i=Vh(t),{line:s,scale:o,axis:a}=t,r=s.options,l=r.fill,d=r.backgroundColor,{above:h=d,below:f=d}=l||{};i&&s.points.length&&(pn(n,e),Th(n,{line:s,target:i,above:h,below:f,area:e,scale:o,axis:a}),mn(n))}function Th(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&&(Go(n,i,a.top),Jo(n,{line:e,target:i,color:s,scale:r,property:l}),n.restore(),n.save(),Go(n,i,a.bottom)),Jo(n,{line:e,target:i,color:o,scale:r,property:l}),n.restore()}function Go(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:d}=r,h=s[l],f=s[Ai(l,d,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(f.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function Jo(n,t){const{line:e,target:i,property:s,color:o,scale:a}=t,r=yh(e,i,s);for(const{source:l,target:d,start:h,end:f}of r){const{style:{backgroundColor:u=o}={}}=l,p=i!==!0;n.save(),n.fillStyle=u,Lh(n,a,p&&Oi(s,h,f)),n.beginPath();const m=!!e.pathSegment(n,l);let g;if(p){m?n.closePath():Zo(n,i,f,s);const b=!!i.pathSegment(n,d,{move:m,reverse:!0});g=m&&b,g||Zo(n,i,h,s)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function Lh(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 Zo(n,t,e,i){const s=t.interpolate(e,i);s&&n.lineTo(s.x,s.y)}var Nh={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 Yt&&(l={visible:n.isDatasetVisible(a),index:a,fill:kh(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=xh(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&&Fi(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;qo(o)&&Fi(n.ctx,o,n.chartArea)}},beforeDatasetDraw(n,t,e){const i=t.meta.$filler;!qo(i)||e.drawTime!=="beforeDatasetDraw"||Fi(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Qo=(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)}},Rh=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class ta extends Pt{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}=Qo(i,o);let d,h;e.font=s.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,d=this._fitCols(a,s,r,l)+10),this.width=Math.min(d,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=[],d=this.lineWidths=[0],h=s+r;let f=t;o.textAlign="left",o.textBaseline="middle";let u=-1,p=-h;return this.legendItems.forEach((m,g)=>{const b=i+e/2+o.measureText(m.text).width;(g===0||d[d.length-1]+b+2*r>a)&&(f+=h,d[d.length-(g>0?0:1)]=0,p+=h,u++),l[g]={left:0,top:p,row:u,width:b,height:s},d[d.length-1]+=b+r}),f}_fitCols(t,e,i,s){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let f=r,u=0,p=0,m=0,g=0;return this.legendItems.forEach((b,y)=>{const{itemWidth:x,itemHeight:w}=$h(i,e,o,b,s);y>0&&p+w+2*r>h&&(f+=u+r,d.push({width:u,height:p}),m+=u+r,g++,u=p=0),l[y]={left:m,top:p,col:g,width:x,height:w},u=Math.max(u,x),p+=w+r}),f+=u,d.push({width:u,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,a=ye(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=at(i,this.left+s,this.right-this.lineWidths[r]);for(const d of e)r!==d.row&&(r=d.row,l=at(i,this.left+s,this.right-this.lineWidths[r])),d.top+=this.top+t+s,d.left=a.leftForLtr(a.x(l),d.width),l+=d.width+s}else{let r=0,l=at(i,this.top+t+s,this.bottom-this.columnSizes[r].height);for(const d of e)d.col!==r&&(r=d.col,l=at(i,this.top+t+s,this.bottom-this.columnSizes[r].height)),d.top=l,d.left+=this.left+s,d.left=a.leftForLtr(a.x(d.left),d.width),l+=d.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;pn(t,this),this._draw(),mn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:o,labels:a}=t,r=Z.color,l=ye(t.rtl,this.left,this.width),d=et(a.font),{padding:h}=a,f=d.size,u=f/2;let p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=d.string;const{boxWidth:m,boxHeight:g,itemHeight:b}=Qo(a,f),y=function(S,C,v){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;s.save();const A=R(v.lineWidth,1);if(s.fillStyle=R(v.fillStyle,r),s.lineCap=R(v.lineCap,"butt"),s.lineDashOffset=R(v.lineDashOffset,0),s.lineJoin=R(v.lineJoin,"miter"),s.lineWidth=A,s.strokeStyle=R(v.strokeStyle,r),s.setLineDash(R(v.lineDash,[])),a.usePointStyle){const F={radius:g*Math.SQRT2/2,pointStyle:v.pointStyle,rotation:v.rotation,borderWidth:A},P=l.xPlus(S,m/2),L=C+u;vs(s,F,P,L,a.pointStyleWidth&&m)}else{const F=C+Math.max((f-g)/2,0),P=l.leftForLtr(S,m),L=ee(v.borderRadius);s.beginPath(),Object.values(L).some(U=>U!==0)?Fe(s,{x:P,y:F,w:m,h:g,radius:L}):s.rect(P,F,m,g),s.fill(),A!==0&&s.stroke()}s.restore()},x=function(S,C,v){te(s,v.text,S,C+b/2,d,{strikethrough:v.hidden,textAlign:l.textAlign(v.textAlign)})},w=this.isHorizontal(),k=this._computeTitleHeight();w?p={x:at(o,this.left+h,this.right-i[0]),y:this.top+h+k,line:0}:p={x:this.left+h,y:at(o,this.top+k+h,this.bottom-e[0].height),line:0},zs(this.ctx,t.textDirection);const _=b+h;this.legendItems.forEach((S,C)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;const v=s.measureText(S.text).width,A=l.textAlign(S.textAlign||(S.textAlign=a.textAlign)),F=m+u+v;let P=p.x,L=p.y;l.setWidth(this.width),w?C>0&&P+F+h>this.right&&(L=p.y+=_,p.line++,P=p.x=at(o,this.left+h,this.right-i[p.line])):C>0&&L+_>this.bottom&&(P=p.x=P+e[p.line].width+h,p.line++,L=p.y=at(o,this.top+k+h,this.bottom-e[p.line].height));const U=l.x(P);if(y(U,L,S),P=al(A,P+m+u,w?P+F:this.right,t.rtl),x(l.x(P),L,S),w)p.x+=F+h;else if(typeof S.text!="string"){const O=d.lineHeight;p.y+=ea(S,O)+h}else p.y+=_}),Is(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=et(e.font),s=rt(e.padding);if(!e.display)return;const o=ye(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=i.size/2,d=s.top+l;let h,f=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+d,f=at(t.align,f,this.right-u);else{const m=this.columnSizes.reduce((g,b)=>Math.max(g,b.height),0);h=d+at(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const p=at(r,f,f+u);a.textAlign=o.textAlign(ri(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=i.string,te(a,e.text,p,h,i)}_computeTitleHeight(){const t=this.options.title,e=et(t.font),i=rt(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,o;if(vt(t,this.left,this.right)&&vt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;i<o.length;++i)if(s=o[i],vt(t,s.left,s.left+s.width)&&vt(e,s.top,s.top+s.height))return this.legendItems[i]}return null}handleEvent(t){const e=this.options;if(!Wh(t.type,e))return;const i=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,o=Rh(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 $h(n,t,e,i,s){const o=zh(i,n,t,e),a=Ih(s,i,t.lineHeight);return{itemWidth:o,itemHeight:a}}function zh(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 Ih(n,t,e){let i=n;return typeof t.text!="string"&&(i=ea(t,e)),i}function ea(n,t){const e=n.text?n.text.length:0;return t*e}function Wh(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Hh={id:"legend",_element:ta,start(n,t,e){const i=n.legend=new ta({ctx:n.ctx,options:e,chart:n});lt.configure(n,i,e),lt.addBox(n,i)},stop(n){lt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const i=n.legend;lt.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 d=l.controller.getStyle(e?0:void 0),h=rt(d.borderWidth);return{text:t[l.index].label,fillStyle:d.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:i||d.pointStyle,rotation:d.rotation,textAlign:s||d.textAlign,borderRadius:a&&(r||d.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 Ti extends Pt{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=X(i.text)?i.text.length:1;this._padding=rt(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,d,h,f;return this.isHorizontal()?(h=at(r,i,o),f=e+t,d=o-i):(a.position==="left"?(h=i+t,f=at(r,s,e),l=q*-.5):(h=o-t,f=at(r,e,s),l=q*.5),d=s-e),{titleX:h,titleY:f,maxWidth:d,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:d}=this._drawArgs(o);te(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:d,textAlign:ri(e.align),textBaseline:"middle",translation:[a,r]})}}function jh(n,t){const e=new Ti({ctx:n.ctx,options:t,chart:n});lt.configure(n,e,t),lt.addBox(n,e),n.titleBlock=e}var Yh={id:"title",_element:Ti,start(n,t,e){jh(n,e)},stop(n){const t=n.titleBlock;lt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const i=n.titleBlock;lt.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 Ln=new WeakMap;var Uh={id:"subtitle",start(n,t,e){const i=new Ti({ctx:n.ctx,options:e,chart:n});lt.configure(n,i,e),lt.addBox(n,i),Ln.set(n,i)},stop(n){lt.removeBox(n,Ln.get(n)),Ln.delete(n)},beforeUpdate(n,t,e){const i=Ln.get(n);lt.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 Ue={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 d=l.getCenterPoint(),h=oi(t,d);h<s&&(s=h,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,i=l.y}return{x:e,y:i}}};function St(n,t){return t&&(X(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function At(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
24
24
  `)>-1?n.split(`
25
- `):n}function $h(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 Qo(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:a,boxHeight:r}=t,l=et(t.bodyFont),d=et(t.titleFont),h=et(t.footerFont),f=o.length,u=s.length,p=i.length,m=rt(t.padding);let g=m.height,b=0,y=i.reduce((w,_)=>w+_.before.length+_.lines.length+_.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),y){const w=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;g+=p*w+(y-p)*l.lineHeight+(y-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let x=0;const k=function(w){b=Math.max(b,e.measureText(w).width+x)};return e.save(),e.font=d.string,H(n.title,k),e.font=l.string,H(n.beforeBody.concat(n.afterBody),k),x=t.displayColors?a+2+t.boxPadding:0,H(i,w=>{H(w.before,k),H(w.lines,k),H(w.after,k)}),x=0,e.font=h.string,H(n.footer,k),e.restore(),b+=m.width,{width:b,height:g}}function Rh(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Ih(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 zh(n,t,e,i){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=n;let d="center";return i==="center"?d=s<=(r+l)/2?"left":"right":s<=o/2?d="left":s>=a-o/2&&(d="right"),Ih(d,n,t,e)&&(d="center"),d}function ta(n,t,e){const i=e.yAlign||t.yAlign||Rh(n,e);return{xAlign:e.xAlign||t.xAlign||zh(n,t,e,i),yAlign:i}}function Wh(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Hh(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function ea(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=n,{xAlign:r,yAlign:l}=e,d=s+o,{topLeft:h,topRight:f,bottomLeft:u,bottomRight:p}=ee(a);let m=Wh(t,r);const g=Hh(t,l,d);return l==="center"?r==="left"?m+=d:r==="right"&&(m-=d):r==="left"?m-=Math.max(h,u)+s:r==="right"&&(m+=Math.max(f,p)+s),{x:it(m,0,i.width-t.width),y:it(g,0,i.height-t.height)}}function Ln(n,t,e){const i=rt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function na(n){return Ct([],At(n))}function jh(n,t,e){return Wt(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ia(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const sa={beforeTitle:Dt,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:Dt,beforeBody:Dt,beforeLabel:Dt,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 I(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:Dt,afterBody:Dt,beforeFooter:Dt,footer:Dt,afterFooter:Dt};function ct(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?sa[t].call(e,i):s}class Ai extends Pt{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 Us(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=jh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=ct(i,"beforeTitle",this,t),o=ct(i,"title",this,t),a=ct(i,"afterTitle",this,t);let r=[];return r=Ct(r,At(s)),r=Ct(r,At(o)),r=Ct(r,At(a)),r}getBeforeBody(t,e){return na(ct(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return H(t,o=>{const a={before:[],lines:[],after:[]},r=ia(i,o);Ct(a.before,At(ct(r,"beforeLabel",this,o))),Ct(a.lines,ct(r,"label",this,o)),Ct(a.after,At(ct(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return na(ct(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=ct(i,"beforeFooter",this,t),o=ct(i,"footer",this,t),a=ct(i,"afterFooter",this,t);let r=[];return r=Ct(r,At(s)),r=Ct(r,At(o)),r=Ct(r,At(a)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],a=[];let r=[],l,d;for(l=0,d=e.length;l<d;++l)r.push($h(this.chart,e[l]));return t.filter&&(r=r.filter((h,f,u)=>t.filter(h,f,u,i))),t.itemSort&&(r=r.sort((h,f)=>t.itemSort(h,f,i))),H(r,h=>{const f=ia(t.callbacks,h);s.push(ct(f,"labelColor",this,h)),o.push(ct(f,"labelPointStyle",this,h)),a.push(ct(f,"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=je[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=Qo(this,i),d=Object.assign({},r,l),h=ta(this.chart,i,d),f=ea(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:f.x,y:f.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:d,bottomLeft:h,bottomRight:f}=ee(r),{x:u,y:p}=t,{width:m,height:g}=e;let b,y,x,k,w,_;return o==="center"?(w=p+g/2,s==="left"?(b=u,y=b-a,k=w+a,_=w-a):(b=u+m,y=b+a,k=w-a,_=w+a),x=b):(s==="left"?y=u+Math.max(l,h)+a:s==="right"?y=u+m-Math.max(d,f)-a:y=this.caretX,o==="top"?(k=p,w=k-a,b=y-a,x=y+a):(k=p+g,w=k+a,b=y+a,x=y-a),_=k),{x1:b,x2:y,x3:x,y1:k,y2:w,y3:_}}drawTitle(t,e,i){const s=this.title,o=s.length;let a,r,l;if(o){const d=ge(i.rtl,this.x,this.width);for(t.x=Ln(this,i.titleAlign,i),e.textAlign=d.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],d.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:d}=o,h=et(o.bodyFont),f=Ln(this,"left",o),u=s.x(f),p=l<h.lineHeight?(h.lineHeight-l)/2:0,m=e.y+p;if(o.usePointStyle){const g={radius:Math.min(d,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},b=s.leftForLtr(u,d)+d/2,y=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,ci(t,g,b,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ci(t,g,b,y)}else{t.lineWidth=R(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 g=s.leftForLtr(u,d),b=s.leftForLtr(s.xPlus(u,1),d-2),y=ee(a.borderRadius);Object.values(y).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Oe(t,{x:g,y:m,w:d,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Oe(t,{x:b,y:m+1,w:d-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,m,d,l),t.strokeRect(g,m,d,l),t.fillStyle=a.backgroundColor,t.fillRect(b,m+1,d-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:d,boxPadding:h}=i,f=et(i.bodyFont);let u=f.lineHeight,p=0;const m=ge(i.rtl,this.x,this.width),g=function(v){e.fillText(v,m.x(t.x+p),t.y+u/2),t.y+=u+o},b=m.textAlign(a);let y,x,k,w,_,C,M;for(e.textAlign=a,e.textBaseline="middle",e.font=f.string,t.x=Ln(this,b,i),e.fillStyle=i.bodyColor,H(this.beforeBody,g),p=r&&b!=="right"?a==="center"?d/2+h:d+2+h:0,w=0,C=s.length;w<C;++w){for(y=s[w],x=this.labelTextColors[w],e.fillStyle=x,H(y.before,g),k=y.lines,r&&k.length&&(this._drawColorBox(e,t,w,m,i),u=Math.max(f.lineHeight,l)),_=0,M=k.length;_<M;++_)g(k[_]),u=f.lineHeight;H(y.after,g)}p=0,u=f.lineHeight,H(this.afterBody,g),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let a,r;if(o){const l=ge(i.rtl,this.x,this.width);for(t.x=Ln(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:d,height:h}=i,{topLeft:f,topRight:u,bottomLeft:p,bottomRight:m}=ee(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+f,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(r+d-u,l),e.quadraticCurveTo(r+d,l,r+d,l+u),a==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(r+d,l+h-m),e.quadraticCurveTo(r+d,l+h,r+d-m,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+f),e.quadraticCurveTo(r,l,r+f,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=je[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=Qo(this,t),l=Object.assign({},a,this._size),d=ta(e,t,l),h=ea(t,l,d,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.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=rt(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),Ns(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),$s(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:r,index:l})=>{const d=this.chart.getDatasetMeta(r);if(!d)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:d.data[l],index:l}}),o=!rn(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||!rn(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=je[o.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}B(Ai,"positioners",je);var Yh={id:"tooltip",_element:Ai,positioners:je,afterInit(n,t,e){e&&(n.tooltip=new Ai({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:sa},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"]},Uh=Object.freeze({__proto__:null,Colors:sh,Decimation:lh,Filler:Eh,Legend:Th,SubTitle:Nh,Title:Lh,Tooltip:Yh});const Xh=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function qh(n,t,e,i){const s=n.indexOf(t);if(s===-1)return Xh(n,t,e,i);const o=n.lastIndexOf(t);return s!==o?e:s}const Kh=(n,t)=>n===null?null:it(Math.round(n),0,t);function oa(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Ti extends re{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(I(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:qh(i,t,$(e,t),this._addedLabels),Kh(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 oa.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}}B(Ti,"id","category"),B(Ti,"defaults",{ticks:{callback:oa}});function Gh(n,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:d,maxTicks:h,maxDigits:f,includeBounds:u}=n,p=o||1,m=h-1,{min:g,max:b}=t,y=!I(a),x=!I(r),k=!I(d),w=(b-g)/(f+1);let _=rs((b-g)/m/p)*p,C,M,v,T;if(_<1e-14&&!y&&!x)return[{value:g},{value:b}];T=Math.ceil(b/_)-Math.floor(g/_),T>m&&(_=rs(T*_/m/p)*p),I(l)||(C=Math.pow(10,l),_=Math.ceil(_*C)/C),s==="ticks"?(M=Math.floor(g/_)*_,v=Math.ceil(b/_)*_):(M=g,v=b),y&&x&&o&&jr((r-a)/o,_/1e3)?(T=Math.round(Math.min((r-a)/_,h)),_=(r-a)/T,M=a,v=r):k?(M=y?a:M,v=x?r:v,T=d-1,_=(v-M)/T):(T=(v-M)/_,ve(T,Math.round(T),_/1e3)?T=Math.round(T):T=Math.ceil(T));const A=Math.max(cs(_),cs(M));C=Math.pow(10,I(l)?A:l),M=Math.round(M*C)/C,v=Math.round(v*C)/C;let P=0;for(y&&(u&&M!==a?(e.push({value:a}),M<a&&P++,ve(Math.round((M+P*_)*C)/C,a,aa(a,w,n))&&P++):M<a&&P++);P<T;++P){const L=Math.round((M+P*_)*C)/C;if(x&&L>r)break;e.push({value:L})}return x&&u&&v!==r?e.length&&ve(e[e.length-1].value,r,aa(r,w,n))?e[e.length-1].value=r:e.push({value:r}):(!x||v===r)&&e.push({value:v}),e}function aa(n,t,{horizontal:e,minRotation:i}){const s=_t(i),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/o,a)}class Nn extends re{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 I(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=kt(s),d=kt(o);l<0&&d<0?r(0):l>0&&d>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=Gh(s,o);return t.bounds==="ticks"&&ls(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 Ve(t,this.chart.options.locale,this.options.ticks.format)}}class Fi extends Nn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?t:0,this.max=J(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=_t(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}}B(Fi,"id","linear"),B(Fi,"defaults",{ticks:{callback:hn.formatters.numeric}});const Ye=n=>Math.floor(zt(n)),le=(n,t)=>Math.pow(10,Ye(n)+t);function ra(n){return n/Math.pow(10,Ye(n))===1}function la(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function Jh(n,t){const e=t-n;let i=Ye(e);for(;la(n,t,i)>10;)i++;for(;la(n,t,i)<10;)i--;return Math.min(i,Ye(n))}function Zh(n,{min:t,max:e}){t=ut(n.min,t);const i=[],s=Ye(t);let o=Jh(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,d=Math.round((t-l)*a)/a,h=Math.floor((t-l)/r/10)*r*10;let f=Math.floor((d-h)/Math.pow(10,o)),u=ut(n.min,Math.round((l+h+f*Math.pow(10,o))*a)/a);for(;u<e;)i.push({value:u,major:ra(u),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,a=o>=0?1:a),u=Math.round((l+h+f*Math.pow(10,o))*a)/a;const p=ut(n.max,u);return i.push({value:p,major:ra(p),significand:f}),i}class Li extends re{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Nn.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return J(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?Math.max(0,t):null,this.max=J(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!J(this._userMin)&&(this.min=t===le(this.min,0)?le(this.min,-1):le(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(le(i,-1)),a(le(s,1)))),i<=0&&o(le(s,-1)),s<=0&&a(le(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=Zh(e,this);return t.bounds==="ticks"&&ls(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":Ve(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=zt(t),this._valueRange=zt(this.max)-zt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(zt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}B(Li,"id","logarithmic"),B(Li,"defaults",{ticks:{callback:hn.formatters.logarithmic,major:{enabled:!0}}});function Ni(n){const t=n.ticks;if(t.display&&n.display){const e=rt(t.backdropPadding);return $(t.font&&t.font.size,Z.font.size)+e.height}return 0}function Qh(n,t,e){return e=X(e)?e:[e],{w:rl(n,t.string,e),h:e.length*t.lineHeight}}function ca(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 tf(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?q/o:0;for(let l=0;l<o;l++){const d=a.setContext(n.getPointLabelContext(l));s[l]=d.padding;const h=n.getPointPosition(l,n.drawingArea+s[l],r),f=et(d.font),u=Qh(n.ctx,f,n._pointLabels[l]);i[l]=u;const p=pt(n.getIndexAngle(l)+r),m=Math.round(ei(p)),g=ca(m,h.x,u.w,0,180),b=ca(m,h.y,u.h,90,270);ef(e,t,p,g,b)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=of(n,i,s)}function ef(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 nf(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=e,l=n.getPointPosition(t,i+s+a,o),d=Math.round(ei(pt(l.angle+tt))),h=lf(l.y,r.h,d),f=af(d),u=rf(l.x,r.w,f);return{visible:!0,x:l.x,y:h,textAlign:f,left:u,top:h,right:u+r.w,bottom:h+r.h}}function sf(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:o}=n;return!(Bt({x:e,y:i},t)||Bt({x:e,y:o},t)||Bt({x:s,y:i},t)||Bt({x:s,y:o},t))}function of(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:Ni(o)/2,additionalAngle:a?q/s:0};let d;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const f=nf(n,h,l);i.push(f),r==="auto"&&(f.visible=sf(f,d),f.visible&&(d=f))}return i}function af(n){return n===0||n===180?"center":n<180?"left":"right"}function rf(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function lf(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function cf(n,t,e){const{left:i,top:s,right:o,bottom:a}=e,{backdropColor:r}=t;if(!I(r)){const l=ee(t.borderRadius),d=rt(t.backdropPadding);n.fillStyle=r;const h=i-d.left,f=s-d.top,u=o-i+d.width,p=a-s+d.height;Object.values(l).some(m=>m!==0)?(n.beginPath(),Oe(n,{x:h,y:f,w:u,h:p,radius:l}),n.fill()):n.fillRect(h,f,u,p)}}function df(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));cf(e,a,o);const r=et(a.font),{x:l,y:d,textAlign:h}=o;te(e,n._pointLabels[s],l,d+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"})}}function da(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,K);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 hf(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(),da(n,e,a,i),o.closePath(),o.stroke(),o.restore())}function ff(n,t,e){return Wt(n,{label:e,index:t,type:"pointLabel"})}class Ue extends Nn{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=rt(Ni(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=J(t)&&!isNaN(t)?t:0,this.max=J(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Ni(this.options))}generateTickLabels(t){Nn.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?tf(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=K/(this._pointLabels.length||1),i=this.options.startAngle||0;return pt(t*e+_t(i))}getDistanceFromCenterForValue(t){if(I(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(I(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 ff(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-tt+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(),da(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,d;if(e.pointLabels.display&&df(this,a),s.display&&this.ticks.forEach((h,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(f),p=s.setContext(u),m=o.setContext(u);hf(this,p,l,a,m)}}),i.display){for(t.save(),r=a-1;r>=0;r--){const h=i.setContext(this.getPointLabelContext(r)),{color:f,lineWidth:u}=h;!u||!f||(t.lineWidth=u,t.strokeStyle=f,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),d=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.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 d=i.setContext(this.getContext(l)),h=et(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(r.label).width,t.fillStyle=d.backdropColor;const f=rt(d.backdropPadding);t.fillRect(-a/2-f.left,-o-h.size/2-f.top,a+f.width,h.size+f.height)}te(t,r.label,0,-o,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}B(Ue,"id","radialLinear"),B(Ue,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:hn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),B(Ue,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),B(Ue,"descriptors",{angleLines:{_fallback:"grid"}});const $n={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}},dt=Object.keys($n);function ha(n,t){return n-t}function fa(n,t){if(I(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)),J(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(ue(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function ua(n,t,e,i){const s=dt.length;for(let o=dt.indexOf(n);o<s-1;++o){const a=$n[dt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=i)return dt[o]}return dt[s-1]}function uf(n,t,e,i,s){for(let o=dt.length-1;o>=dt.indexOf(e);o--){const a=dt[o];if($n[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return dt[e?dt.indexOf(e):0]}function pf(n){for(let t=dt.indexOf(n)+1,e=dt.length;t<e;++t)if($n[dt[t]].common)return dt[t]}function pa(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=ii(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function mf(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 ma(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:mf(n,i,s,e)}class Xe extends re{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 Cc._date(t.adapters.date);s.init(e),Me(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:fa(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(d){!a&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!r&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=J(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=J(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=qr(s,o,a);return this._unit=e.unit||(i.autoSkip?ua(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):uf(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:pf(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),ma(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=it(e,0,a),i=it(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||ua(o.minUnit,e,i,this._getLabelCapacity(e)),r=$(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,d=ue(l)||l===!0,h={};let f=e,u,p;if(d&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,d?"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 m=s.ticks.source==="data"&&this.getDataTimestamps();for(u=f,p=0;u<i;u=+t.add(u,r,a),p++)pa(h,u,m);return(u===i||s.bounds==="ticks"||p===1)&&pa(h,u,m),Object.keys(h).sort(ha).map(g=>+g)}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,d=this._majorUnit,h=l&&r[l],f=d&&r[d],u=i[e],p=d&&f&&u&&u.major;return this._adapter.format(t,s||(p?f: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=_t(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,ma(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(fa(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return us(t.sort(ha))}}B(Xe,"id","time"),B(Xe,"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 Rn(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}=Et(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}=Et(n,"time",t)),{time:o,pos:r}=n[i],{time:a,pos:l}=n[s]);const d=a-o;return d?r+(l-r)*(t-o)/d:r}class $i extends Xe{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=Rn(e,this.min),this._tableRange=Rn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let a,r,l,d,h;for(a=0,r=t.length;a<r;++a)d=t[a],d>=e&&d<=i&&s.push(d);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],d=s[a],Math.round((h+l)/2)!==d&&o.push({time:d,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(Rn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Rn(this._table,i*this._tableRange+this._minPos,!0)}}B($i,"id","timeseries"),B($i,"defaults",Xe.defaults);var gf=Object.freeze({__proto__:null,CategoryScale:Ti,LinearScale:Fi,LogarithmicScale:Li,RadialLinearScale:Ue,TimeScale:Xe,TimeSeriesScale:$i});const bf=[wc,Zd,Uh,gf];Ot.register(...bf);const yf={class:"px-24 py-16"},_f={class:"flex flex-col gap-8"},xf={class:"fm-color-typo-primary fm-typo-body-lg-400"},kf={class:"fm-color-typo-secondary fm-typo-body-md-400"},wf=c.defineComponent({__name:"FmLine",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{}},setup(n){const t=n,e=c.ref(null);let i=null;c.watch([()=>t.xAxis,()=>t.datasets],()=>{i&&(i.data.datasets=t.datasets,i.data.labels=t.xAxis.categories,i.update())});function s(d,h){const f=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(d);if(f)return`rgba(${parseInt(f[1],16)},${parseInt(f[2],16)},${parseInt(f[3],16)},${h})`;if(d.startsWith("rgb")){const u=d.split(",");if(u.length===3)return[...u.slice(0,2),u[2].replace(")",`,${h})`)].join(",");if(u.length===4)return[...u.slice(0,3),`${h})`].join(",")}return""}function o(d){const h=getComputedStyle(document.documentElement).getPropertyValue(`--${d}`)||d;return h.startsWith("rgb")||h.startsWith("#")?h:null}function a({context:d,color:h}){const{ctx:f,chartArea:u}=d.chart;if(!u)return;const p=f==null?void 0:f.createLinearGradient(0,0,0,u.height);return p.addColorStop(0,s(h,.5)),p.addColorStop(1,s(h,0)),p}const r=c.computed(()=>({labels:t.xAxis.categories,datasets:t.datasets.map(d=>{const h=o(d.color)??"";return{...d,backgroundColor:h?f=>a({context:f,color:h}):"",borderColor:h,borderDash:d.dash?[5,5]:void 0,tension:.1}})}));function l(){e.value&&(i=new Ot(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 c.onMounted(()=>{l()}),(d,h)=>(c.openBlock(),c.createElementBlock("div",yf,[c.createElementVNode("div",_f,[c.createElementVNode("div",xf,c.toDisplayString(d.name),1),c.createElementVNode("div",kf,c.toDisplayString(d.paragraph),1)]),c.createElementVNode("canvas",{ref_key:"canvas",ref:e},null,512)]))}});var Cf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sf(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var ga={exports:{}};(function(n,t){(function(e,i){n.exports=i()})(Cf,function(){var e=1e3,i=6e4,s=36e5,o="millisecond",a="second",r="minute",l="hour",d="day",h="week",f="month",u="quarter",p="year",m="date",g="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,x={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(O){var D=["th","st","nd","rd"],S=O%100;return"["+O+(D[(S-20)%10]||D[S]||D[0])+"]"}},k=function(O,D,S){var E=String(O);return!E||E.length>=D?O:""+Array(D+1-E.length).join(S)+O},w={s:k,z:function(O){var D=-O.utcOffset(),S=Math.abs(D),E=Math.floor(S/60),V=S%60;return(D<=0?"+":"-")+k(E,2,"0")+":"+k(V,2,"0")},m:function O(D,S){if(D.date()<S.date())return-O(S,D);var E=12*(S.year()-D.year())+(S.month()-D.month()),V=D.clone().add(E,f),F=S-V<0,N=D.clone().add(E+(F?-1:1),f);return+(-(E+(S-V)/(F?V-N:N-V))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:f,y:p,w:h,d,D:m,h:l,m:r,s:a,ms:o,Q:u}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},_="en",C={};C[_]=x;var M="$isDayjsObject",v=function(O){return O instanceof L||!(!O||!O[M])},T=function O(D,S,E){var V;if(!D)return _;if(typeof D=="string"){var F=D.toLowerCase();C[F]&&(V=F),S&&(C[F]=S,V=F);var N=D.split("-");if(!V&&N.length>1)return O(N[0])}else{var W=D.name;C[W]=D,V=W}return!E&&V&&(_=V),V||!E&&_},A=function(O,D){if(v(O))return O.clone();var S=typeof D=="object"?D:{};return S.date=O,S.args=arguments,new L(S)},P=w;P.l=T,P.i=v,P.w=function(O,D){return A(O,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var L=function(){function O(S){this.$L=T(S.locale,null,!0),this.parse(S),this.$x=this.$x||S.x||{},this[M]=!0}var D=O.prototype;return D.parse=function(S){this.$d=function(E){var V=E.date,F=E.utc;if(V===null)return new Date(NaN);if(P.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var N=V.match(b);if(N){var W=N[2]-1||0,j=(N[7]||"0").substring(0,3);return F?new Date(Date.UTC(N[1],W,N[3]||1,N[4]||0,N[5]||0,N[6]||0,j)):new Date(N[1],W,N[3]||1,N[4]||0,N[5]||0,N[6]||0,j)}}return new Date(V)}(S),this.init()},D.init=function(){var S=this.$d;this.$y=S.getFullYear(),this.$M=S.getMonth(),this.$D=S.getDate(),this.$W=S.getDay(),this.$H=S.getHours(),this.$m=S.getMinutes(),this.$s=S.getSeconds(),this.$ms=S.getMilliseconds()},D.$utils=function(){return P},D.isValid=function(){return this.$d.toString()!==g},D.isSame=function(S,E){var V=A(S);return this.startOf(E)<=V&&V<=this.endOf(E)},D.isAfter=function(S,E){return A(S)<this.startOf(E)},D.isBefore=function(S,E){return this.endOf(E)<A(S)},D.$g=function(S,E,V){return P.u(S)?this[E]:this.set(V,S)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(S,E){var V=this,F=!!P.u(E)||E,N=P.p(S),W=function(he,ht){var Kt=P.w(V.$u?Date.UTC(V.$y,ht,he):new Date(V.$y,ht,he),V);return F?Kt:Kt.endOf(d)},j=function(he,ht){return P.w(V.toDate()[he].apply(V.toDate("s"),(F?[0,0,0,0]:[23,59,59,999]).slice(ht)),V)},G=this.$W,Q=this.$M,st=this.$D,yt="set"+(this.$u?"UTC":"");switch(N){case p:return F?W(1,0):W(31,11);case f:return F?W(1,Q):W(0,Q+1);case h:var de=this.$locale().weekStart||0,en=(G<de?G+7:G)-de;return W(F?st-en:st+(6-en),Q);case d:case m:return j(yt+"Hours",0);case l:return j(yt+"Minutes",1);case r:return j(yt+"Seconds",2);case a:return j(yt+"Milliseconds",3);default:return this.clone()}},D.endOf=function(S){return this.startOf(S,!1)},D.$set=function(S,E){var V,F=P.p(S),N="set"+(this.$u?"UTC":""),W=(V={},V[d]=N+"Date",V[m]=N+"Date",V[f]=N+"Month",V[p]=N+"FullYear",V[l]=N+"Hours",V[r]=N+"Minutes",V[a]=N+"Seconds",V[o]=N+"Milliseconds",V)[F],j=F===d?this.$D+(E-this.$W):E;if(F===f||F===p){var G=this.clone().set(m,1);G.$d[W](j),G.init(),this.$d=G.set(m,Math.min(this.$D,G.daysInMonth())).$d}else W&&this.$d[W](j);return this.init(),this},D.set=function(S,E){return this.clone().$set(S,E)},D.get=function(S){return this[P.p(S)]()},D.add=function(S,E){var V,F=this;S=Number(S);var N=P.p(E),W=function(Q){var st=A(F);return P.w(st.date(st.date()+Math.round(Q*S)),F)};if(N===f)return this.set(f,this.$M+S);if(N===p)return this.set(p,this.$y+S);if(N===d)return W(1);if(N===h)return W(7);var j=(V={},V[r]=i,V[l]=s,V[a]=e,V)[N]||1,G=this.$d.getTime()+S*j;return P.w(G,this)},D.subtract=function(S,E){return this.add(-1*S,E)},D.format=function(S){var E=this,V=this.$locale();if(!this.isValid())return V.invalidDate||g;var F=S||"YYYY-MM-DDTHH:mm:ssZ",N=P.z(this),W=this.$H,j=this.$m,G=this.$M,Q=V.weekdays,st=V.months,yt=V.meridiem,de=function(ht,Kt,nn,Xn){return ht&&(ht[Kt]||ht(E,F))||nn[Kt].slice(0,Xn)},en=function(ht){return P.s(W%12||12,ht,"0")},he=yt||function(ht,Kt,nn){var Xn=ht<12?"AM":"PM";return nn?Xn.toLowerCase():Xn};return F.replace(y,function(ht,Kt){return Kt||function(nn){switch(nn){case"YY":return String(E.$y).slice(-2);case"YYYY":return P.s(E.$y,4,"0");case"M":return G+1;case"MM":return P.s(G+1,2,"0");case"MMM":return de(V.monthsShort,G,st,3);case"MMMM":return de(st,G);case"D":return E.$D;case"DD":return P.s(E.$D,2,"0");case"d":return String(E.$W);case"dd":return de(V.weekdaysMin,E.$W,Q,2);case"ddd":return de(V.weekdaysShort,E.$W,Q,3);case"dddd":return Q[E.$W];case"H":return String(W);case"HH":return P.s(W,2,"0");case"h":return en(1);case"hh":return en(2);case"a":return he(W,j,!0);case"A":return he(W,j,!1);case"m":return String(j);case"mm":return P.s(j,2,"0");case"s":return String(E.$s);case"ss":return P.s(E.$s,2,"0");case"SSS":return P.s(E.$ms,3,"0");case"Z":return N}return null}(ht)||N.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(S,E,V){var F,N=this,W=P.p(E),j=A(S),G=(j.utcOffset()-this.utcOffset())*i,Q=this-j,st=function(){return P.m(N,j)};switch(W){case p:F=st()/12;break;case f:F=st();break;case u:F=st()/3;break;case h:F=(Q-G)/6048e5;break;case d:F=(Q-G)/864e5;break;case l:F=Q/s;break;case r:F=Q/i;break;case a:F=Q/e;break;default:F=Q}return V?F:P.a(F)},D.daysInMonth=function(){return this.endOf(f).$D},D.$locale=function(){return C[this.$L]},D.locale=function(S,E){if(!S)return this.$L;var V=this.clone(),F=T(S,E,!0);return F&&(V.$L=F),V},D.clone=function(){return P.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},O}(),U=L.prototype;return A.prototype=U,[["$ms",o],["$s",a],["$m",r],["$H",l],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(O){U[O[1]]=function(D){return this.$g(D,O[0],O[1])}}),A.extend=function(O,D){return O.$i||(O(D,L,A),O.$i=!0),A},A.locale=T,A.isDayjs=v,A.unix=function(O){return A(1e3*O)},A.en=C[_],A.Ls=C,A.p={},A})})(ga);var Mf=ga.exports;const Tt=Sf(Mf),Df={class:"relative"},vf={class:"w-full"},Ef={class:"flex h-10 justify-between p-2"},Bf={class:"fm-typo-body-lg-400"},Vf={class:"flex gap-1 items-center justify-center"},Pf={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Of=["onClick"],Af=c.defineComponent({__name:"FmDatePicker",props:{modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref([]),s=c.ref(null),o=c.ref(!1),a=c.ref(Tt()),r=c.ref(null),l=c.ref(null),d=g=>{s.value=g,t("update:modelValue",g.format("YYYY-MM-DD")),o.value=!1},h=()=>{i.value=[];const g=Tt(a.value).startOf("month"),b=g.endOf("month"),y=g.month();let x=g.startOf("week"),k=[];for(;x.isBefore(b.endOf("week"));)x.day()===0&&k.length>0&&(i.value.push(k),k=[]),k.push({date:x,isCurrentMonth:x.month()===y}),x=x.add(1,"day");k.length>0&&i.value.push(k)},f=()=>{e.disabled||(o.value=!o.value,requestAnimationFrame(()=>{var b;const g=(b=r.value)==null?void 0:b.getBoundingClientRect();l.value.style.top=`${g.height+4}px`,l.value.style.left="0px"}))},u=g=>{const b=g.path||g.composedPath();for(const y of b)if(y==r.value||y==l.value)return;o.value=!1},p=g=>{a.value=g?a.value.add(1,"month"):a.value.subtract(1,"month"),h()},m=c.computed(()=>Array.from(Array(7),(g,b)=>Tt().day(b).format("ddd")));return c.onMounted(()=>{window.addEventListener("click",u),h(),e.modelValue&&(s.value=Tt(e.modelValue,"YYYY-MM-DD"))}),c.onUnmounted(()=>{window.removeEventListener("click",u)}),(g,b)=>{var y;return c.openBlock(),c.createElementBlock("div",Df,[c.createElementVNode("label",{ref_key:"buttonEl",ref:r,onClick:f},[g.label?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["fm-typo-body-lg-400 mb-4",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},c.toDisplayString(e.label),3)):c.createCommentVNode("",!0),c.createElementVNode("div",{class:c.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[c.createElementVNode("div",{class:c.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"]])},c.toDisplayString(((y=s.value)==null?void 0:y.format("D MMM YYYY"))??"DD MM YYYY"),3)],2)],512),c.createElementVNode("div",{ref_key:"dropdownEl",ref:l,class:c.normalizeClass(["absolute bg-fm-color-white fm-calendar gap-6 p-3 rounded-lg shadow-light-neutral-300 w-[360px]",[o.value?"block":"hidden"]])},[c.createElementVNode("div",vf,[c.createElementVNode("div",Ef,[c.createElementVNode("div",Bf,c.toDisplayString(a.value.format("MMMM YYYY")),1),c.createElementVNode("div",Vf,[c.createVNode(z,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[0]||(b[0]=()=>p(!1))}),c.createVNode(z,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:b[1]||(b[1]=()=>p(!0))})])]),c.createElementVNode("div",null,[c.createElementVNode("div",Pf,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.value,x=>(c.openBlock(),c.createElementBlock("div",{key:x,class:"fm-calendar__cell"},c.toDisplayString(x),1))),128))]),c.createElementVNode("div",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.value,(x,k)=>(c.openBlock(),c.createElementBlock("div",{key:k,class:"fm-calendar__row fm-typo-body-lg-400"},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(x,w=>(c.openBlock(),c.createElementBlock("div",{key:w.date.date(),class:"fm-calendar__cell"},[w.isCurrentMonth?(c.openBlock(),c.createElementBlock("button",{key:0,class:c.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":s.value===w.date}]),onClick:()=>d(w.date)},c.toDisplayString(w.date.date()),11,Of)):c.createCommentVNode("",!0)]))),128))]))),128))])])])],2)])}}}),Gm="",Tf=ot(Af,[["__scopeId","data-v-1722ccfe"]]),Ff=n=>(c.pushScopeId("data-v-fdf144e1"),n=n(),c.popScopeId(),n),Lf={class:"flex gap-1 items-center relative w-full"},Nf=Ff(()=>c.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)),$f={class:"w-full"},Rf={class:"flex h-10 justify-between p-2"},If={class:"fm-typo-body-lg-400"},zf={class:"flex gap-1 items-center justify-center"},Wf={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Hf=["onClick"],jf=c.defineComponent({__name:"FmDateRangePicker",props:{modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref([]),s=c.ref({startDate:null,endDate:null}),o=c.ref(!1),a=c.ref(Tt()),r=c.ref(null),l=c.ref(null),d=c.ref(null),h=y=>{var x,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=y;else if(y.isBefore(s.value.startDate)){const w=s.value.startDate;s.value={startDate:y,endDate:w}}else s.value.endDate=y;t("update:modelValue",{startDate:(x=s.value.startDate)==null?void 0:x.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)},f=()=>{i.value=[];const y=Tt(a.value).startOf("month"),x=y.endOf("month"),k=y.month();let w=y.startOf("week"),_=[];for(;w.isBefore(x.endOf("week"));)w.day()===0&&_.length>0&&(i.value.push(_),_=[]),_.push({date:w,isCurrentMonth:w.month()===k}),w=w.add(1,"day");_.length>0&&i.value.push(_)},u=()=>{e.disabled||(o.value=!o.value,requestAnimationFrame(()=>{var x;const y=(x=r.value)==null?void 0:x.getBoundingClientRect();d.value.style.top=`${y.height+4}px`,d.value.style.left="0px"}))},p=y=>{const x=y.path||y.composedPath();for(const k of x)if(k==r.value||k==l.value||k==d.value)return;o.value=!1},m=y=>{a.value=y?a.value.add(1,"month"):a.value.subtract(1,"month"),f()},g=c.computed(()=>Array.from(Array(7),(y,x)=>Tt().day(x).format("ddd"))),b=y=>{var x,k,w,_;return{"fm-calendar__cell__button--selected":((x=s.value.startDate)==null?void 0:x.isSame(y))&&!s.value.endDate||((k=s.value.endDate)==null?void 0:k.isSame(y))&&!s.value.startDate,"fm-calendar__cell__button--selected-start":((w=s.value.startDate)==null?void 0:w.isSame(y))&&s.value.endDate,"fm-calendar__cell__button--selected-end":((_=s.value.endDate)==null?void 0:_.isSame(y))&&s.value.startDate,"fm-calendar__cell__button--selected-between":s.value.startDate&&s.value.endDate&&y.isAfter(s.value.startDate)&&y.isBefore(s.value.endDate)}};return c.onMounted(()=>{var y;window.addEventListener("click",p),f(),(y=e.modelValue)!=null&&y.startDate&&e.modelValue.endDate&&(s.value={startDate:Tt(e.modelValue.startDate,"YYYY-MM-DD"),endDate:Tt(e.modelValue.endDate,"YYYY-MM-DD")})}),c.onUnmounted(()=>{window.removeEventListener("click",p)}),(y,x)=>{var k,w;return c.openBlock(),c.createElementBlock("div",Lf,[c.createElementVNode("label",{ref_key:"startButtonEl",ref:r,class:"w-full",onClick:u},[c.createElementVNode("div",{class:c.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},c.toDisplayString(e.label),3),c.createElementVNode("div",{class:c.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[c.createElementVNode("div",{class:c.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"]])},c.toDisplayString(((k=s.value.startDate)==null?void 0:k.format("D MMM YYYY"))??"DD MM YYYY"),3)],2)],512),Nf,c.createElementVNode("label",{ref_key:"endButtonEl",ref:l,class:"w-full",onClick:u},[c.createElementVNode("div",{class:c.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},c.toDisplayString(e.label),3),c.createElementVNode("div",{class:c.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[c.createElementVNode("div",{class:c.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"]])},c.toDisplayString(((w=s.value.endDate)==null?void 0:w.format("D MMM YYYY"))??"DD MM YYYY"),3)],2)],512),c.createElementVNode("div",{ref_key:"dropdownEl",ref:d,class:c.normalizeClass(["absolute bg-fm-color-white fm-calendar gap-6 p-3 rounded-lg shadow-light-300 w-[360px]",[o.value?"block":"hidden"]])},[c.createElementVNode("div",$f,[c.createElementVNode("div",Rf,[c.createElementVNode("div",If,c.toDisplayString(a.value.format("MMMM YYYY")),1),c.createElementVNode("div",zf,[c.createVNode(z,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:x[0]||(x[0]=()=>m(!1))}),c.createVNode(z,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:x[1]||(x[1]=()=>m(!0))})])]),c.createElementVNode("div",null,[c.createElementVNode("div",Wf,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(g.value,_=>(c.openBlock(),c.createElementBlock("div",{key:_,class:"fm-calendar__cell"},c.toDisplayString(_),1))),128))]),c.createElementVNode("div",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.value,(_,C)=>(c.openBlock(),c.createElementBlock("div",{key:C,class:"fm-calendar__row fm-typo-body-lg-400"},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(_,M=>(c.openBlock(),c.createElementBlock("div",{key:M.date.date(),class:"fm-calendar__cell"},[M.isCurrentMonth?(c.openBlock(),c.createElementBlock("button",{key:0,class:c.normalizeClass(["fm-calendar__cell__button",b(M.date)]),onClick:()=>h(M.date)},c.toDisplayString(M.date.date()),11,Hf)):c.createCommentVNode("",!0)]))),128))]))),128))])])])],2)])}}}),Jm="",Yf=ot(jf,[["__scopeId","data-v-fdf144e1"]]),Uf={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Xf={class:"flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse"},qf=c.defineComponent({__name:"FmDialog",props:{modelValue:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},minWidth:{default:280},closeButton:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref(null),s=o=>{e.overlay&&i.value&&o.target===i.value&&t("update:modelValue",!1)};return(o,a)=>(c.openBlock(),c.createBlock(c.Transition,null,{default:c.withCtx(()=>[o.modelValue?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:i,class:c.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":o.overlay}),onClick:a[1]||(a[1]=r=>s(r))},[c.createElementVNode("div",{class:c.normalizeClass(`fm-dialog min-w-[${o.minWidth}px]`)},[c.createElementVNode("div",Uf,[c.renderSlot(o.$slots,"dialog-header"),o.closeButton?(c.openBlock(),c.createBlock(z,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:a[0]||(a[0]=r=>t("update:modelValue",!1))})):c.createCommentVNode("",!0)]),c.renderSlot(o.$slots,"dialog-content"),c.createElementVNode("div",Xf,[c.renderSlot(o.$slots,"dialog-footer")])],2)],2)):c.createCommentVNode("",!0)]),_:3}))}}),Zm="",Kf={class:"fm-checkbox"},Gf={class:"fm-checkbox--wrapper"},Jf={class:"fm-checkbox__input--container"},Zf=["checked","disabled","indeterminate"],Qf={key:0,class:"fm-checkbox__label-container"},tu={class:"fm-typo-body-lg-400"},eu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},ba=c.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=c.computed(()=>e.indeterminate?"remove":e.modelValue?"check_small":"");function s(){e.disabled||t("update:modelValue",!e.modelValue)}return(o,a)=>(c.openBlock(),c.createElementBlock("div",Kf,[c.createElementVNode("label",Gf,[c.createElementVNode("div",Jf,[c.createElementVNode("input",{class:c.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,Zf),e.indeterminate||e.modelValue?(c.openBlock(),c.createBlock(z,{key:0,class:"fm-checkbox__input--checkmark",name:i.value,size:"md",color:"#FFFFFF"},null,8,["name"])):c.createCommentVNode("",!0)]),e.label?(c.openBlock(),c.createElementBlock("div",Qf,[c.renderSlot(o.$slots,"label"),c.createElementVNode("div",tu,c.toDisplayString(e.label),1),e.sublabel?(c.openBlock(),c.createElementBlock("div",eu,c.toDisplayString(e.sublabel),1)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0)])]))}}),Qm="",nu={class:"w-full"},iu=c.defineComponent({__name:"FmField",props:{leadingIcon:{default:""},trailingIcon:{default:""},activeClass:{default:""},disabled:{type:Boolean,default:!1},iconColor:{default:"black"}},setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass({"fm-field":!0,"fm-field--disabled":t.disabled,activeClass:t.activeClass})},[c.createVNode(z,{name:t.leadingIcon,size:"md",color:t.disabled?"disabled":t.iconColor},null,8,["name","color"]),c.createElementVNode("div",nu,[c.renderSlot(t.$slots,"default",{},void 0,!0)]),c.createVNode(z,{name:t.trailingIcon,size:"md",color:t.disabled?"disabled":t.iconColor},null,8,["name","color"])],2))}}),tg="",ya=ot(iu,[["__scopeId","data-v-fae4e7ce"]]),_a=Symbol.for("fm:form"),xa=Symbol.for("fm:radio-group"),ka=Symbol.for("fm:stepper"),wa=Symbol.for("fm:dialog"),su=["onSubmit","onReset"],ou=c.defineComponent({__name:"FmForm",emits:["validation-success","validation-failed","reset"],setup(n,{emit:t}){const e=c.ref([]),i=c.ref(0),s=()=>{let a=[];for(let r=0;r<e.value.length;r++){const l=e.value[r];a=[...a,...l.validate()]}a.length?t("validation-failed",a):t("validation-success")},o=()=>{for(let a=0;a<e.value.length;a++){const r=e.value[a];r.resetValue(),r.resetValidation()}t("reset")};return c.provide(_a,{register({validate:a,resetValidation:r,resetValue:l}){return e.value.push({componentId:i.value,validate:a,resetValidation:r,resetValue:l}),i.value++},unregister(a){e.value.filter(r=>r.componentId!==a)}}),(a,r)=>(c.openBlock(),c.createElementBlock("form",{onSubmit:c.withModifiers(s,["prevent"]),onReset:c.withModifiers(o,["prevent"])},[c.renderSlot(a.$slots,"default")],40,su))}}),au={class:"fm-radio-btn"},ru={class:"fm-radio-btn__input--container"},lu=["value","disabled","checked"],cu={class:"py-8"},du={class:"fm-typo-body-lg-400"},hu={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},fu=c.defineComponent({__name:"FmRadio",props:{modelValue:{default:null},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref(),s=c.inject(xa,null),o=()=>{r.value||(s?s.updateValue(e.value):t("update:modelValue",e.value))},a=()=>{i.value&&s&&(i.value.checked=s.groupValue.value===e.value)};c.onMounted(()=>{s&&s.register(a)});const r=c.computed(()=>s?s.getDisabled():e.disabled);return(l,d)=>{const h=c.resolveDirective("wave");return c.openBlock(),c.createElementBlock("div",au,[c.createElementVNode("label",{class:c.normalizeClass({"fm-radio-btn--wrapper":!0,"cursor-not-allowed text-fm-color-typo-disabled":r.value,"cursor-pointer":!r.value}),onClick:o},[c.withDirectives((c.openBlock(),c.createElementBlock("div",ru,[c.createElementVNode("input",{ref_key:"inputEl",ref:i,class:"fm-radio-btn__input--btn",type:"radio",value:l.value,disabled:r.value,checked:l.value===l.modelValue},null,8,lu)])),[[h,!r.value]]),c.createElementVNode("div",cu,[c.renderSlot(l.$slots,"label",{},()=>[c.createElementVNode("div",du,c.toDisplayString(l.label),1),l.sublabel?(c.openBlock(),c.createElementBlock("div",hu,c.toDisplayString(l.sublabel),1)):c.createCommentVNode("",!0)],!0)])],2)])}}}),eg="",uu=ot(fu,[["__scopeId","data-v-94f94580"]]);function qe(n,t,e,i=null,s=null){const o=c.ref(),a=c.inject(_a,null),r=c.ref(!0),l=(d=s)=>{r.value=!0,t(),d&&typeof d=="function"&&d(),e("update:modelValue",i)};return c.onMounted(()=>{a&&(o.value=a.register({validate:n,resetValidation:t,resetValue:l}))}),c.onUnmounted(()=>{a&&a.unregister(o.value)}),{isPristine:r,resetValue:l}}function Ke(n){const t=c.ref([]),e=c.ref();function i(){const a=[];if(n.rules&&n.rules.length>0)for(const r of n.rules){const d=(typeof r=="function"?r:()=>r)(e.value);d!==!0&&a.push(d)}return t.value=a,t.value}function s(){t.value=[]}function o(a){e.value=a}return{validate:i,resetValidation:s,errorMessages:t,setValidationValue:o}}const pu={class:"fm-text-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},mu={key:0},gu={key:1},bu=c.defineComponent({__name:"FmRadioGroup",props:{modelValue:{},inline:{type:Boolean,default:!1},helperText:{default:""},disabled:{type:Boolean,default:!1},label:{},rules:{default:()=>[n=>!!n||"This field is required"]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref(),s=c.ref([]),o=()=>{i.value=null,s.value.forEach(f=>f())},{validate:a,errorMessages:r,resetValidation:l,setValidationValue:d}=Ke(e),{isPristine:h}=qe(a,l,t,"",o);return c.provide(xa,{groupValue:i,getDisabled:()=>e.disabled,register(f){s.value.push(f)},updateValue(f){i.value=f,s.value.forEach(u=>u()),t("update:modelValue",f)}}),c.watch(()=>e.modelValue,()=>{h.value=!1,i.value=e.modelValue,s.value.forEach(f=>f())}),c.onMounted(()=>{d(e.modelValue)}),(f,u)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass({"flex items-center gap-16 justify-start":f.inline})},[c.renderSlot(f.$slots,"default"),c.createElementVNode("div",pu,[c.unref(r).length===0?(c.openBlock(),c.createElementBlock("div",mu,[c.renderSlot(f.$slots,"helper-text",{},()=>[c.createTextVNode(c.toDisplayString(f.helperText),1)])])):(c.openBlock(),c.createElementBlock("div",gu,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(r),p=>(c.openBlock(),c.createElementBlock("div",{key:p,class:"flex gap-4 items-center text-fm-color-typo-error"},[c.createVNode(z,{name:"error",color:"#FF3B30",size:"sm"}),c.createElementVNode("span",null,c.toDisplayString(p),1)]))),128))]))])],2))}});function yu(n){for(;n;){if(_u(n))return n;n=n.parentElement}return document.scrollingElement}function _u(n){if(!n||n.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(n);return t.overflowY==="scroll"||t.overflowY==="auto"&&n.scrollHeight>n.clientHeight}class xu{constructor(t,e){B(this,"onScroll");B(this,"scrollParent");this.onScroll=e,this.scrollParent=yu(t)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const ku={class:"relative"},wu=c.defineComponent({__name:"FmMenu",props:{isOpen:{type:Boolean,default:!1},placement:{default:"bottom-left"},disabled:{type:Boolean,default:!1}},emits:["dropdown-changed"],setup(n,{expose:t,emit:e}){const i=n,s=c.ref(!1),o=c.ref(null),a=c.ref(null);let r;t({show:()=>{s.value||(s.value=!0,e("dropdown-changed",s.value))},hide:()=>{s.value&&(s.value=!1,e("dropdown-changed",s.value))}});const l=()=>{i.disabled||(s.value=!s.value,d(),e("dropdown-changed",s.value))},d=()=>{requestAnimationFrame(()=>{var m,g;const u=(m=a.value)==null?void 0:m.getBoundingClientRect(),p=(g=o.value)==null?void 0:g.getBoundingClientRect();i.placement.includes("bottom")?a.value.style.top=`${p.bottom+4}px`:i.placement.includes("top")&&(a.value.style.top=`${p.top-u.height-4}px`),i.placement.includes("left")?a.value.style.left=`${p.left}px`:i.placement.includes("center")?a.value.style.left=`${p.left+p.width/2-u.width/2}px`:i.placement.includes("right")&&(a.value.style.left=`${p.right-u.width}px`)})},h=u=>{if(!s.value)return;const p=u.path||u.composedPath();for(const m of p)if(m==o.value||m==a.value)return;s.value=!1,e("dropdown-changed",s.value)},f=()=>{e("dropdown-changed",!1)};return c.watch(()=>i.isOpen,u=>s.value=u),c.onMounted(()=>{s.value=i.isOpen,window.addEventListener("click",h),r=new xu(o.value,f),r.bindScroll()}),c.onUnmounted(()=>{window.removeEventListener("click",h),r.unbindScroll()}),(u,p)=>(c.openBlock(),c.createElementBlock("div",ku,[c.createElementVNode("div",{ref_key:"buttonEl",ref:o,class:"fm-menu",onClick:l},[c.renderSlot(u.$slots,"menu-button",{},void 0,!0)],512),(c.openBlock(),c.createBlock(c.Teleport,{to:"body"},[c.createElementVNode("div",{ref_key:"dropdownEl",ref:a,class:c.normalizeClass({"fm-menu__content":!0,"fm-menu__content--opened":s.value})},[c.renderSlot(u.$slots,"menu-content",{},void 0,!0)],2)]))]))}}),ng="",Ri=ot(wu,[["__scopeId","data-v-1f528682"]]),Cu={class:"fm-menu-item--left"},Su={key:0,class:"fm-menu-item--right"},Mu=c.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)=>(c.openBlock(),c.createElementBlock("div",null,[c.createElementVNode("div",{class:c.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":o.modelValue&&!o.hasCheckbox,"fm-menu-item--disabled":o.disabled}),onClick:i},[c.createElementVNode("div",Cu,[!o.hasCheckbox&&o.icon?(c.openBlock(),c.createBlock(z,{key:0,name:o.icon,size:"md",color:o.disabled?"#C7C7CC":o.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","color"])):c.createCommentVNode("",!0),o.hasCheckbox?(c.openBlock(),c.createBlock(ba,{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"])):c.createCommentVNode("",!0),c.renderSlot(o.$slots,"label",{},()=>[c.createElementVNode("div",null,[c.createElementVNode("div",{class:c.normalizeClass(`fm-typo-body-lg-400 ${o.disabled?"fm-color-typo-disabled":"fm-color-typo-primary"}`)},c.toDisplayString(o.label),3),o.sublabel?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(`fm-typo-body-md-400 ${o.disabled?"fm-color-typo-disabled":"fm-color-typo-secondary"}`)},c.toDisplayString(o.sublabel),3)):c.createCommentVNode("",!0)])],!0)]),o.expandable?(c.openBlock(),c.createElementBlock("div",Su,[c.createVNode(z,{name:"chevron_right",size:"md",color:o.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):c.createCommentVNode("",!0)],2)]))}}),ig="",Ca=ot(Mu,[["__scopeId","data-v-94ed27b3"]]),Du={class:"w-[280px]"},vu=c.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=c.ref(!1),s=(l,d)=>{if(e.multiselect){let h=[];l?h=[...c.toRaw(e.modelValue),d.value]:(h=[...e.modelValue],h=h.filter(f=>JSON.stringify(c.toRaw(f))!==JSON.stringify(d.value))),t("update:modelValue",h)}else i.value=!1,t("update:modelValue",d.value)},o=c.computed(()=>{const l=a.value.map(d=>d.label).join(", ");return l===""?e.placeholder:l}),a=c.computed(()=>e.multiselect?e.items.filter(l=>c.toRaw(e.modelValue).some(d=>r(d,l.value))):e.items.filter(l=>r(e.modelValue,l.value))),r=(l,d)=>JSON.stringify(l)===JSON.stringify(d);return(l,d)=>(c.openBlock(),c.createElementBlock("div",null,[c.createElementVNode("label",null,[c.renderSlot(l.$slots,"label",{},()=>[l.label?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["fm-typo-body-lg-400 mb-4",{"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!l.disabled,"text-fm-color-typo-disabled":l.disabled}])},c.toDisplayString(l.label),3)):c.createCommentVNode("",!0)],!0)]),c.createVNode(Ri,{disabled:l.disabled,"is-open":i.value,placement:l.placement,onDropdownChanged:d[0]||(d[0]=h=>i.value=h)},{"menu-button":c.withCtx(()=>[c.createElementVNode("label",{class:c.normalizeClass([`${l.disabled?"cursor-not-allowed":"cursor-pointer"} fm-select`])},[c.createElementVNode("div",{class:c.normalizeClass({"fm-select__container":!0,"fm-select__container--expanded":i.value,"fm-select__container--disabled":l.disabled})},[c.createElementVNode("div",{class:c.normalizeClass({"fm-typo-body-lg-400 w-full h-full overflow-hidden text-ellipsis whitespace-nowrap":!0,"text-fm-color-typo-tertiary":!l.modelValue,"text-fm-color-typo-primary":!!l.modelValue})},c.toDisplayString(o.value),3),c.createVNode(z,{name:i.value?"expand_less":"expand_more",size:"md",color:l.disabled?"#C7C7CC":"black"},null,8,["name","color"])],2)],2)]),"menu-content":c.withCtx(()=>[c.createElementVNode("div",Du,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(l.items,h=>(c.openBlock(),c.createBlock(Ca,{key:h.value,"has-checkbox":l.multiselect,label:h.label,value:h.value,"model-value":a.value.some(f=>r(f.value,h.value)),"onUpdate:modelValue":f=>s(f,h)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))])]),_:1},8,["disabled","is-open","placement"])]))}}),sg="",Eu=ot(vu,[["__scopeId","data-v-7475b9fb"]]),Bu={class:"fm-stepper-field"},Vu={class:"fm-typo-body-lg-400 text-fm-color-typo-primary"},Pu={key:0},Ou=["inputMode","value","placeholder","required","readOnly"],Au={key:0},Tu={key:0,class:"fm-stepper-field__stepper__container"},Fu={key:0,class:"fm-stepper-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},Lu={key:0},Nu={key:1},$u=c.defineComponent({__name:"FmStepperField",props:{label:{default:""},modelValue:{},required:{type:Boolean},disabled:{type:Boolean},placeholder:{default:""},helperText:{default:""},inputmode:{default:"numeric"},readonly:{type:Boolean},step:{default:1},min:{default:0},max:{},leadingIcon:{default:""},trailingIcon:{default:""},useGrouping:{type:Boolean,default:!0},isCurrency:{type:Boolean,default:!1},showSteppers:{type:Boolean,default:!0},rules:{default:()=>[]},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,{validate:i,errorMessages:s,resetValidation:o,setValidationValue:a}=Ke(e),{isPristine:r}=qe(i,o,t,null),l=c.ref(null),d=c.ref(!1),h=c.ref(!0);let f;const u=c.ref(""),p=_=>{if(_!==""){const C=+_.replace(/,/g,"");return isNaN(C)?null:C}return null},m=_=>f.format(_),g=_=>_>e.max?e.max:_<e.min?e.min:_,b=(_,C)=>{_.preventDefault(),r.value=!1;let v=(p(u.value)??0)+C;v=g(v),a(v),h.value=i().length===0,u.value=m(v),y()},y=()=>{const _=p(u.value);t("update:modelValue",_)},x=()=>{const _=p(u.value);_&&(u.value=m(g(_))),h.value=i().length===0,d.value=!1,y()},k=()=>{var C;const _=p((C=l.value)==null?void 0:C.value);u.value=_!=null?m(_):""},w=_=>{if(![...Array(10).keys()].map(C=>C.toString()).includes(_.key)&&!["Backspace","Tab","Enter",".","-","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(_.key)){_.preventDefault();return}};return c.watch(()=>e.modelValue,_=>{u.value=_!=null?m(_):"",h.value=i().length===0}),c.onMounted(()=>{a(e.modelValue),f=new Intl.NumberFormat("en-MY",{useGrouping:e.useGrouping}),u.value=e.modelValue!=null?m(e.modelValue):""}),(_,C)=>(c.openBlock(),c.createElementBlock("label",Bu,[c.createElementVNode("div",Vu,[c.renderSlot(_.$slots,"label",{},()=>[c.createTextVNode(c.toDisplayString(_.label),1)],!0)]),c.createElementVNode("div",{class:c.normalizeClass({"fm-stepper-field__container":!0,"fm-stepper-field__container--focused":d.value,"fm-stepper-field__container--invalid":!h.value&&!!_.modelValue,"fm-stepper-field__container--valid":_.showValidBorder&&h.value&&!!_.modelValue})},[c.renderSlot(_.$slots,"prepend",{},()=>[_.prependText?(c.openBlock(),c.createElementBlock("div",Pu,c.toDisplayString(_.prependText),1)):c.createCommentVNode("",!0),_.leadingIcon?(c.openBlock(),c.createBlock(z,{key:1,name:_.leadingIcon,size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):c.createCommentVNode("",!0)],!0),c.createElementVNode("input",{ref_key:"inputEl",ref:l,class:"fm-stepper-field--input",type:"text",inputMode:_.inputmode,value:u.value,placeholder:_.placeholder,required:_.required,readOnly:_.readonly,onInput:k,onFocus:C[0]||(C[0]=()=>d.value=!0),onBlur:x,onKeydown:w},null,40,Ou),c.renderSlot(_.$slots,"append",{},()=>[c.createElementVNode("div",{class:c.normalizeClass({"mr-32":_.showSteppers})},[_.appendText?(c.openBlock(),c.createElementBlock("div",Au,c.toDisplayString(_.appendText),1)):c.createCommentVNode("",!0),_.trailingIcon?(c.openBlock(),c.createBlock(z,{key:1,name:_.trailingIcon,size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):c.createCommentVNode("",!0)],2)],!0),_.showSteppers?(c.openBlock(),c.createElementBlock("div",Tu,[c.createElementVNode("div",{class:"fm-stepper-field__stepper__item",onMousedown:C[1]||(C[1]=M=>b(M,_.step))},[c.createVNode(z,{name:"expand_less",size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32),c.createElementVNode("div",{class:"fm-stepper-field__stepper__item",onMousedown:C[2]||(C[2]=M=>b(M,-_.step))},[c.createVNode(z,{name:"expand_more",size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32)])):c.createCommentVNode("",!0)],2),_.helperText||c.unref(s).length>0?(c.openBlock(),c.createElementBlock("div",Fu,[c.unref(s).length===0?(c.openBlock(),c.createElementBlock("div",Lu,[c.renderSlot(_.$slots,"helper-text",{},()=>[c.createTextVNode(c.toDisplayString(_.helperText),1)],!0)])):(c.openBlock(),c.createElementBlock("div",Nu,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(s),M=>(c.openBlock(),c.createElementBlock("div",{key:M,class:"flex gap-4 items-center text-fm-color-typo-error"},[c.createVNode(z,{name:"error",color:"#FF3B30",size:"sm"}),c.createElementVNode("span",null,c.toDisplayString(M),1)]))),128))]))])):c.createCommentVNode("",!0)]))}}),og="",Ru=ot($u,[["__scopeId","data-v-79048fb1"]]),Iu={class:"cursor-pointer fm-switch__container"},zu={key:0},Wu={class:"fm-typo-body-lg-400"},Hu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},ju={class:"fm-switch__input--container"},Yu=["checked","value","disabled"],Uu={key:1},Xu={class:"fm-typo-body-lg-400"},qu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Ku=c.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)=>(c.openBlock(),c.createElementBlock("label",Iu,[s.labelPlacement==="left"?(c.openBlock(),c.createElementBlock("div",zu,[c.renderSlot(s.$slots,"label",{},void 0,!0),c.createElementVNode("div",Wu,c.toDisplayString(s.label),1),s.sublabel?(c.openBlock(),c.createElementBlock("div",Hu,c.toDisplayString(s.sublabel),1)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),c.createElementVNode("div",ju,[c.createElementVNode("input",{checked:s.modelValue,class:"fm-switch__input--btn",type:"checkbox",value:s.value,disabled:s.disabled,onClick:i},null,8,Yu),c.createElementVNode("div",{class:c.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":s.showIcon})},[s.showIcon?(c.openBlock(),c.createBlock(z,{key:0,name:s.modelValue?"check":"close",size:"sm",color:s.disabled?"#C7C7CC":s.modelValue?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):c.createCommentVNode("",!0)],2)]),s.labelPlacement==="right"?(c.openBlock(),c.createElementBlock("div",Uu,[c.createElementVNode("div",Xu,c.toDisplayString(s.label),1),s.sublabel?(c.openBlock(),c.createElementBlock("div",qu,c.toDisplayString(s.sublabel),1)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0)]))}}),ag="",Gu=ot(Ku,[["__scopeId","data-v-77ad1e00"]]),Ju={class:"fm-text-field"},Zu={class:"fm-text-field--label"},Qu={key:0},tp=["value","inputMode","type","placeholder","required","minlength","maxlength","disabled","readOnly"],ep={key:0},np={key:0,class:"fm-text-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},ip={key:0},sp={key:1};var Sa=(n=>(n.required="*",n.optional="(optional)",n))(Sa||{});const op=c.defineComponent({__name:"FmTextField",props:{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},labelMark:{default:"none"},leadingIcon:{default:()=>({name:"",color:""})},trailingIcon:{default:()=>({name:"",color:""})},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},label:{},modelValue:{},rules:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref(null),s=c.ref(!1),{validate:o,errorMessages:a,resetValidation:r,setValidationValue:l}=Ke(e),{isPristine:d}=qe(o,r,t,""),h=u=>{d.value=!1,u.target.value||r(),l(u.target.value),t("update:modelValue",u.target.value)};c.watch(()=>e.modelValue,()=>{d.value||o()});const f=c.computed(()=>a.value.length===0);return c.onMounted(()=>{l(e.modelValue)}),(u,p)=>(c.openBlock(),c.createElementBlock("label",Ju,[c.createElementVNode("div",null,[c.createElementVNode("div",Zu,[c.renderSlot(u.$slots,"label"),c.createElementVNode("span",{class:c.normalizeClass({"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!u.disabled,"text-fm-color-typo-disabled":u.disabled})},c.toDisplayString(u.label),3),u.labelMark!=="none"?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass({"fm-color-typo-tertiary fm-typo-body-md-400":u.labelMark==="optional","fm-color-typo-error fm-typo-body-lg-700":u.labelMark==="required"})},c.toDisplayString(Sa[u.labelMark]),3)):c.createCommentVNode("",!0)])]),c.createElementVNode("div",{class:c.normalizeClass({"fm-text-field__container":!0,"fm-text-field__container--focused":s.value,"fm-text-field__container--invalid":!!u.modelValue&&!f.value,"fm-text-field__container--valid":u.showValidBorder&&u.showSuccess&&!!u.modelValue&&f.value,"fm-text-field__container--disabled":u.disabled})},[c.renderSlot(u.$slots,"prepend",{},()=>[u.prependText?(c.openBlock(),c.createElementBlock("div",Qu,c.toDisplayString(u.prependText),1)):c.createCommentVNode("",!0),u.leadingIcon.name?(c.openBlock(),c.createBlock(z,{key:1,name:u.leadingIcon.name,size:"md",color:u.leadingIcon.color??(u.disabled?"#C7C7CC":"#1C1C1E")},null,8,["name","color"])):c.createCommentVNode("",!0)]),c.createElementVNode("input",{ref_key:"inputEl",ref:i,class:c.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!u.disabled,"fm-color-typo-disabled":u.disabled}),value:u.modelValue,inputMode:u.inputmode,type:u.inputmode,placeholder:u.placeholder,required:u.required,minlength:u.minLength,maxlength:u.maxLength,disabled:u.disabled,readOnly:u.readonly,onInput:h,onFocus:p[0]||(p[0]=()=>s.value=!0),onBlur:p[1]||(p[1]=()=>s.value=!1)},null,42,tp),c.renderSlot(u.$slots,"append",{},()=>[u.appendText?(c.openBlock(),c.createElementBlock("div",ep,c.toDisplayString(u.appendText),1)):c.createCommentVNode("",!0),u.trailingIcon.name?(c.openBlock(),c.createBlock(z,{key:1,name:u.trailingIcon.name,size:"md",color:u.trailingIcon.color??(u.disabled?"#C7C7CC":"#1C1C1E")},null,8,["name","color"])):c.createCommentVNode("",!0)])],2),u.helperText||c.unref(a).length>0?(c.openBlock(),c.createElementBlock("div",np,[c.unref(a).length===0?(c.openBlock(),c.createElementBlock("div",ip,[c.renderSlot(u.$slots,"helper-text",{},()=>[c.createTextVNode(c.toDisplayString(u.helperText),1)])])):(c.openBlock(),c.createElementBlock("div",sp,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(a),m=>(c.openBlock(),c.createElementBlock("div",{key:m,class:"flex gap-4 items-center text-fm-color-typo-error"},[c.createVNode(z,{name:"error",color:"#FF3B30",size:"sm"}),c.createElementVNode("span",null,c.toDisplayString(m),1)]))),128))])),c.createElementVNode("div",{class:c.normalizeClass({"fm-color-typo-disabled":u.disabled})},c.toDisplayString(u.maxLength?`${u.modelValue.length} / ${u.maxLength}`:""),3)])):c.createCommentVNode("",!0)]))}}),rg="",ap={class:"fm-textarea"},rp={htmlFor:"{this.name}"},lp={class:"fm-textarea--label"},cp=["value","placeholder","required","minlength","maxlength","readOnly","disabled"],dp={key:0,class:"fm-color-typo-secondary fm-textarea__helper-container fm-typo-body-sm-400"},hp={key:0},fp={key:1};var Ma=(n=>(n.required="*",n.optional="(optional)",n))(Ma||{});const up=c.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},labelMark:{default:"none"},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},rules:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref(!1),{validate:s,errorMessages:o,resetValidation:a,setValidationValue:r}=Ke(e),{isPristine:l}=qe(s,a,t,""),d=f=>{l.value=!1,r(f.target.value),t("update:modelValue",f.target.value)},h=c.computed(()=>o.value.length===0);return c.watch(()=>e.modelValue,()=>{l.value||s()}),c.onMounted(()=>{r(e.modelValue)}),(f,u)=>(c.openBlock(),c.createElementBlock("div",ap,[c.createElementVNode("label",rp,[c.createElementVNode("div",lp,[c.renderSlot(f.$slots,"label"),c.createElementVNode("span",{class:c.normalizeClass({"fm-typo-body-lg-400":!0,"fm-color-typo-primary":!f.disabled,"fm-color-typo-disabled":f.disabled})},c.toDisplayString(f.label),3),f.labelMark!=="none"?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass({"fm-color-typo-tertiary fm-typo-body-md-400":f.labelMark==="optional","fm-color-typo-error fm-typo-body-lg-700":f.labelMark==="required"})},c.toDisplayString(Ma[f.labelMark]),3)):c.createCommentVNode("",!0)])]),c.createElementVNode("div",{class:c.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":i.value,"fm-textarea__container--invalid":!!f.modelValue&&!h.value,"fm-textarea__container--valid":f.showValidBorder&&f.showSuccess&&!!f.modelValue&&h.value,"fm-textarea__container--disabled":f.disabled})},[c.createElementVNode("textarea",{class:c.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!f.disabled,"fm-color-typo-disabled":f.disabled}),value:f.modelValue,placeholder:f.placeholder,required:f.required,minlength:f.minLength,maxlength:f.maxLength,readOnly:f.readonly,disabled:f.disabled,onInput:d,onFocus:u[0]||(u[0]=()=>i.value=!0),onBlur:u[1]||(u[1]=()=>i.value=!1)},null,42,cp)],2),f.helperText||c.unref(o).length>0?(c.openBlock(),c.createElementBlock("div",dp,[c.unref(o).length===0?(c.openBlock(),c.createElementBlock("div",hp,[c.renderSlot(f.$slots,"helper-text",{},()=>[c.createTextVNode(c.toDisplayString(f.helperText),1)])])):(c.openBlock(),c.createElementBlock("div",fp,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(o),p=>(c.openBlock(),c.createElementBlock("div",{key:p,class:"flex gap-4 items-center text-fm-color-typo-error"},[c.createVNode(z,{name:"error",color:"#FF3B30",size:"sm"}),c.createElementVNode("span",null,c.toDisplayString(p),1)]))),128))])),c.createElementVNode("div",{class:c.normalizeClass({"fm-color-typo-disabled":f.disabled})},c.toDisplayString(f.maxLength?`${f.modelValue.length} / ${f.maxLength}`:""),3)])):c.createCommentVNode("",!0)]))}}),lg="",pp=c.defineComponent({__name:"FmList",props:{separator:{type:Boolean,default:!1},disabled:{type:Boolean},activeClass:{default:""}},setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass({"fm-list--separator":t.separator,activeClass:t.activeClass})},[c.renderSlot(t.$slots,"default",{},void 0,!0)],2))}}),cg="",mp=ot(pp,[["__scopeId","data-v-884ba127"]]),gp=c.defineComponent({__name:"FmListItem",props:{tag:{default:"div"},clickable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},activeClass:{default:""}},setup(n){const t=n;return(e,i)=>{const s=c.resolveDirective("wave");return c.withDirectives((c.openBlock(),c.createBlock(t.tag,{class:c.normalizeClass({"fm-list-item":!0,"fm-list-item--disabled":e.disabled,"cursor-pointer":e.clickable&&!e.disabled,"cursor-not-allowed":e.clickable&&e.disabled,activeClass:e.activeClass})},{default:c.withCtx(()=>[c.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},8,["class"])),[[s,e.clickable&&!e.disabled]])}}}),dg="",bp=ot(gp,[["__scopeId","data-v-f565b558"]]),yp={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},Da=c.defineComponent({__name:"FmStepHeader",props:{title:{type:String,required:!0},description:{type:String,default:void 0},disabled:{type:Boolean,default:!1},titleBold:{type:Boolean,default:!1}},setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["flex flex-col",n.disabled?"text-fm-color-typo-disabled":""])},[c.createElementVNode("div",{class:c.normalizeClass(["fm-step-title line-clamp-2",n.titleBold?"fm-typo-body-xl-700":"fm-typo-body-md-400"])},c.toDisplayString(n.title),3),n.description?(c.openBlock(),c.createElementBlock("div",yp,c.toDisplayString(n.description),1)):c.createCommentVNode("",!0)],2))}}),_p={class:"fm-progress-indicator relative"},xp=["data-progress"],kp={class:"absolute flex fm-typo-body-sm-400 h-full inset-0 items-center justify-center w-full"},wp=c.defineComponent({__name:"FmProgressIndicator",props:{modelValue:{type:Number,required:!0}},setup(n){const t=n,e=c.ref(null),i=c.computed(()=>`${t.modelValue/100*360}deg`),s=o=>{e.value&&e.value.style.setProperty("--progress",o)};return c.onMounted(()=>{s(i.value)}),c.onUpdated(()=>{s(i.value)}),c.watch(i,async o=>{s(o)}),(o,a)=>(c.openBlock(),c.createElementBlock("div",_p,[c.createElementVNode("div",{ref_key:"progress",ref:e,class:"fm-progress-circular w-full","data-progress":i.value},null,8,xp),c.createElementVNode("div",kp,[c.renderSlot(o.$slots,"default")])]))}}),hg="",Cp={class:"hidden items-center xs:flex"},Sp={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},Mp=c.defineComponent({__name:"FmStepper",props:{modelValue:{type:Number,required:!0},orientation:{type:String,default:"horizontal"}},emits:["update:model-value"],setup(n,{emit:t}){const e=n,i=h=>{t("update:model-value",h)};c.provide(ka,{currentStep:()=>e.modelValue,goToStep:i});const s=c.ref(),o=c.ref([]),a=c.computed(()=>o.value[e.modelValue-1]),r=c.computed(()=>e.modelValue/o.value.length*100),l=c.computed(()=>`${e.modelValue} of ${o.value.length}`),d=()=>{var f;const h=Array.from(((f=s.value)==null?void 0:f.querySelectorAll(":scope > .fm-step"))??[]);o.value=h.map(u=>({title:u.dataset.title??"",description:u.dataset.description,disabled:u.dataset.disabled=="true"}))};return c.onMounted(()=>{d()}),(h,f)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(`fm-stepper fm-stepper__${n.orientation}`)},[c.createElementVNode("div",{ref_key:"stepperRef",ref:s,class:c.normalizeClass(`flex mx-24 mt-12 mb-24 xs:hidden ${n.orientation==="vertical"?"flex-col":""}`)},[c.renderSlot(h.$slots,"default")],2),c.createElementVNode("div",Cp,[c.createVNode(wp,{"model-value":r.value,class:"mr-12",style:{"min-width":"60px"}},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(l.value),1)]),_:1},8,["model-value"]),a.value?(c.openBlock(),c.createBlock(Da,{key:0,class:"grow","title-bold":"",title:a.value.title,description:a.value.description,disabled:a.value.disabled},null,8,["title","description","disabled"])):c.createCommentVNode("",!0)]),h.$slots.contents?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(`flex-col mx-24 mt-12 mb-24 ${n.orientation==="vertical"?"w-2/3":""}`)},[c.renderSlot(h.$slots,"contents"),c.createElementVNode("div",Sp,[c.renderSlot(h.$slots,"actions")])],2)):c.createCommentVNode("",!0)],2))}}),Dp=["data-title","data-description","data-disabled","onClick"],vp={class:"flex fm-step-container gap-12 grow"},Ep=c.defineComponent({__name:"FmStep",props:{title:{type:String,required:!0},description:{type:String,default:void 0},value:{type:Number,required:!0},complete:{type:Function,required:!0},error:{type:Function,default:void 0},disabled:{type:Function,default:void 0}},setup(n){const t=n,{currentStep:e,goToStep:i}=c.inject(ka);function s(){o.value||i(t.value)}const o=c.computed(()=>t.disabled?t.disabled():!1),a=c.computed(()=>t.error?t.error():!1),r=c.computed(()=>e()===t.value),l=c.computed(()=>t.complete()),d=c.computed(()=>r.value||l.value||e()>t.value?"bg-fm-color-primary":"bg-fm-color-neutral-gray-300"),h=c.computed(()=>r.value?{className:"bg-fm-color-primary"}:a.value?{config:{name:"warning",color:"system-error-300"}}:o.value?{className:"border-2 border-fm-color-neutral-gray-200"}:l.value?{config:{name:"check_small",color:"primary"},className:"border-2 border-fm-color-primary"}:{className:"border-2 border-fm-color-neutral-gray-300"});return(f,u)=>{const p=c.resolveDirective("wave");return c.withDirectives((c.openBlock(),c.createElementBlock("div",{"data-title":n.title,"data-description":n.description,"data-disabled":o.value,class:c.normalizeClass(`fm-step gap-4 grow ${o.value?"cursor-not-allowed":"cursor-pointer"}`),onClick:c.withModifiers(s,["stop"])},[c.createElementVNode("div",null,[c.createElementVNode("div",{class:c.normalizeClass(`fm-step-indicator ${d.value}`)},null,2)]),c.createElementVNode("div",vp,[c.createElementVNode("div",{class:c.normalizeClass(["flex fm-step-container-icon h-[24px] items-center justify-center min-h-[24px] min-w-[24px] relative rounded-full w-[24px]",h.value.className])},[h.value.config?(c.openBlock(),c.createBlock(z,{key:0,name:h.value.config.name,color:h.value.config.color,outline:"",class:"absolute"},null,8,["name","color"])):c.createCommentVNode("",!0)],2),c.createVNode(Da,{title:n.title,description:n.description,disabled:o.value,class:"grow"},null,8,["title","description","disabled"])])],10,Dp)),[[p,!o.value]])}}}),fg="",Bp=ot(Ep,[["__scopeId","data-v-ee172cad"]]),Vp={class:"flex"},Pp={key:0,class:"mt-8"},Op=c.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=c.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=c.computed(()=>e.title?{text:e.title,classes:"fm-typo-body-lg-700"}:{text:e.description,classes:""}),o=c.computed(()=>e.bgColor?qn(e.bgColor)?{style:{backgroundColor:e.bgColor}}:{class:`bg-fm-color-${e.bgColor}`}:{class:`bg-fm-color-${i.value.bgColor}`}),a=c.computed(()=>e.color?qn(e.color)?{style:{color:e.color}}:{class:`text-fm-color-${e.color}`}:{class:`text-fm-color-${i.value.actionColor}`});return(r,l)=>(c.openBlock(),c.createElementBlock("div",c.mergeProps(o.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[c.createElementVNode("div",Vp,[i.value.icon?(c.openBlock(),c.createBlock(z,{key:0,name:i.value.icon.name,color:e.color??i.value.icon.color,class:"mr-12"},null,8,["name","color"])):c.createCommentVNode("",!0),c.createElementVNode("div",{class:c.normalizeClass(`${s.value.classes} grow ellipsis`)},c.toDisplayString(s.value.text),3),e.dismissable?(c.openBlock(),c.createBlock(z,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:l[0]||(l[0]=()=>t("onDismiss"))})):c.createCommentVNode("",!0)]),e.title&&e.description?(c.openBlock(),c.createElementBlock("div",Pp,c.toDisplayString(e.description),1)):c.createCommentVNode("",!0),c.renderSlot(r.$slots,"actions",{},()=>[e.action?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:0},a.value,{class:"mt-16 fm-typo-body-lg-700"}),[c.createElementVNode("span",{class:"cursor-pointer",onClick:l[1]||(l[1]=()=>t("onAction"))},c.toDisplayString(e.action),1)],16)):c.createCommentVNode("",!0)],!0)],16))}}),ug="",Ap=ot(Op,[["__scopeId","data-v-b6db34bb"]]),Tp={},Fp={class:"flex-grow"};function Lp(n,t){return c.openBlock(),c.createElementBlock("div",Fp)}const va=ot(Tp,[["render",Lp]]),Np={class:"flex flex-col fm-time-input items-center"},$p=["value"],Rp=c.defineComponent({__name:"TimeInput",props:{modelValue:{type:String,required:!0},min:{type:Number,required:!0},max:{type:Number,required:!0}},emits:["update:model-value","update:cycle"],setup(n,{emit:t}){const e=n,i=c.ref();function s(d){i.value&&(i.value.value=d)}c.watch(()=>e.modelValue,s);function o(){if(!i.value)return;const d=a(i.value.value);if(d==null||d>e.max||d<e.min){s(e.modelValue);return}t("update:model-value",d)}function a(d){return d&&/^\d+$/.test(d)?Number(d):null}function r(){t("update:model-value",a(e.modelValue)+1)}function l(){t("update:model-value",a(e.modelValue)-1)}return(d,h)=>(c.openBlock(),c.createElementBlock("div",Np,[c.createElementVNode("div",{class:"fm-time-input__scroller",onClick:r},[c.createVNode(z,{name:"expand_less",size:"lg"})]),c.createElementVNode("input",{ref_key:"inputRef",ref:i,value:e.modelValue,onInput:o},null,40,$p),c.createElementVNode("div",{class:"fm-time-input__scroller",onClick:l},[c.createVNode(z,{name:"expand_more",size:"lg"})])]))}}),pg="",Ea=ot(Rp,[["__scopeId","data-v-35e4eeb2"]]);var Ft=(n=>(n.AM="AM",n.PM="PM",n))(Ft||{});function Yt(n){return n.toString().padStart(2,"0")}const Ip={class:"flex fm-time-input gap-16 items-center"},zp=c.createElementVNode("div",{class:"fm-typo-title-sm-700"}," : ",-1),Wp={class:"fm-time-input-periods"},Hp=["onClick"],Ba=c.defineComponent({__name:"FmTimeInput",props:{modelValue:{type:Object,required:!0}},emits:["update:model-value"],setup(n,{emit:t}){const e=n;function i(s){const o={hours:s.hours??e.modelValue.hours,minutes:s.minutes??e.modelValue.minutes,period:s.period??e.modelValue.period},a=e.modelValue.hours;(a===12&&o.hours===11||a===11&&o.hours===12)&&(o.period=e.modelValue.period===Ft.AM?Ft.PM:Ft.AM),o.hours>12?o.hours=1:o.hours<1&&(o.hours=12),o.minutes>59?o.minutes=0:o.minutes<0&&(o.minutes=59),t("update:model-value",o)}return(s,o)=>(c.openBlock(),c.createElementBlock("div",Ip,[c.createVNode(Ea,{"model-value":c.unref(Yt)(n.modelValue.hours),min:1,max:12,"onUpdate:modelValue":o[0]||(o[0]=a=>i({hours:a}))},null,8,["model-value"]),zp,c.createVNode(Ea,{"model-value":c.unref(Yt)(n.modelValue.minutes),min:0,max:59,"onUpdate:modelValue":o[1]||(o[1]=a=>i({minutes:a}))},null,8,["model-value"]),c.createElementVNode("div",Wp,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(Ft),a=>(c.openBlock(),c.createElementBlock("div",{key:a,class:c.normalizeClass([{"fm-time-input-period__selected":a===n.modelValue.period},"bg-fm-color-neutral-gray-100 fm-time-input-period"]),onClick:()=>i({period:a})},c.toDisplayString(a),11,Hp))),128))])]))}}),mg="",jp={class:"fm-time-picker"},Yp={class:"flex gap-8"},Up={class:"flex flex-col",style:{width:"343px"}},Xp=c.createElementVNode("div",{class:"fm-typo-body-xl-700 pt-12 px-12"}," Enter time ",-1),qp={class:"flex justify-center w-full"},Kp={class:"flex justify-end pb-12"},Gp=c.defineComponent({__name:"FmTimePicker",props:{modelValue:{type:[null,String],default:null}},emits:["update:model-value"],setup(n,{emit:t}){const e=n,i=c.ref(null),s=c.computed(()=>{if(!e.modelValue)return null;const{hours:p,minutes:m,period:g}=r(e.modelValue);return`${Yt(p)}:${Yt(m)} ${g}`});function o(){if(!i.value){t("update:model-value",null);return}const{hours:p,minutes:m,period:g}=i.value,b=a(p,m,g);t("update:model-value",b),h()}function a(p,m,g){let b=p;return g===Ft.PM?b=p===12?p:p+12:p===12&&(b=0),`${Yt(b)}:${Yt(m)}`}c.onMounted(()=>{e.modelValue&&(i.value=r(e.modelValue))}),c.watch(()=>e.modelValue,p=>{p&&(i.value=r(p))});function r(p){const[m,g,b]=l(p).split(":");return{hours:Number(m),minutes:Number(g),period:b}}function l(p){const[m,g]=p.split(":"),b=Number(m),y=Number(g),x=b>11?Ft.PM:Ft.AM;let k=b;return k===0?k=12:k>12&&(k-=12),`${Yt(k)}:${Yt(y)}:${x}`}const d=c.ref();function h(){var p;(p=d.value)==null||p.hide()}const f=c.ref(!1);function u(p){f.value=p}return(p,m)=>(c.openBlock(),c.createElementBlock("div",jp,[c.createVNode(Ri,{ref_key:"dropdownRef",ref:d,onDropdownChanged:u},{"menu-button":c.withCtx(()=>[c.createVNode(ya,null,{default:c.withCtx(()=>[c.createElementVNode("div",Yp,[c.createVNode(z,{name:"schedule",outline:!f.value},null,8,["outline"]),c.createElementVNode("div",{class:c.normalizeClass(["grow",{"text-fm-color-typo-disabled":!s.value}])},c.toDisplayString(s.value??"HH:MM"),3)])]),_:1})]),"menu-content":c.withCtx(()=>[c.createElementVNode("div",Up,[Xp,c.createElementVNode("div",qp,[c.createVNode(Ba,{"model-value":i.value??{hours:0,minutes:0,period:c.unref(Ft).AM},class:"py-16","onUpdate:modelValue":m[0]||(m[0]=g=>i.value=g)},null,8,["model-value"])]),c.createElementVNode("div",Kp,[c.createVNode(Gt,{label:"Cancel",variant:"tertiary",onClick:h}),c.createVNode(Gt,{label:"Confirm",variant:"tertiary",onClick:o})])])]),_:1},512)]))}}),gg="",Ge=Math.min,ye=Math.max,In=Math.round,Ut=n=>({x:n,y:n}),Jp={left:"right",right:"left",bottom:"top",top:"bottom"},Zp={start:"end",end:"start"};function Ii(n,t,e){return ye(n,Ge(t,e))}function Je(n,t){return typeof n=="function"?n(t):n}function ce(n){return n.split("-")[0]}function Ze(n){return n.split("-")[1]}function Va(n){return n==="x"?"y":"x"}function zi(n){return n==="y"?"height":"width"}function zn(n){return["top","bottom"].includes(ce(n))?"y":"x"}function Wi(n){return Va(zn(n))}function Qp(n,t,e){e===void 0&&(e=!1);const i=Ze(n),s=Wi(n),o=zi(s);let a=s==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Wn(a)),[a,Wn(a)]}function tm(n){const t=Wn(n);return[Hi(n),t,Hi(t)]}function Hi(n){return n.replace(/start|end/g,t=>Zp[t])}function em(n,t,e){const i=["left","right"],s=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(n){case"top":case"bottom":return e?t?s:i:t?i:s;case"left":case"right":return t?o:a;default:return[]}}function nm(n,t,e,i){const s=Ze(n);let o=em(ce(n),e==="start",i);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Hi)))),o}function Wn(n){return n.replace(/left|right|bottom|top/g,t=>Jp[t])}function im(n){return{top:0,right:0,bottom:0,left:0,...n}}function Pa(n){return typeof n!="number"?im(n):{top:n,right:n,bottom:n,left:n}}function Hn(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function Oa(n,t,e){let{reference:i,floating:s}=n;const o=zn(t),a=Wi(t),r=zi(a),l=ce(t),d=o==="y",h=i.x+i.width/2-s.width/2,f=i.y+i.height/2-s.height/2,u=i[r]/2-s[r]/2;let p;switch(l){case"top":p={x:h,y:i.y-s.height};break;case"bottom":p={x:h,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:f};break;case"left":p={x:i.x-s.width,y:f};break;default:p={x:i.x,y:i.y}}switch(Ze(t)){case"start":p[a]-=u*(e&&d?-1:1);break;case"end":p[a]+=u*(e&&d?-1:1);break}return p}const sm=async(n,t,e)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:a}=e,r=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:n,floating:t,strategy:s}),{x:h,y:f}=Oa(d,i,l),u=i,p={},m=0;for(let g=0;g<r.length;g++){const{name:b,fn:y}=r[g],{x,y:k,data:w,reset:_}=await y({x:h,y:f,initialPlacement:i,placement:u,strategy:s,middlewareData:p,rects:d,platform:a,elements:{reference:n,floating:t}});if(h=x??h,f=k??f,p={...p,[b]:{...p[b],...w}},_&&m<=50){m++,typeof _=="object"&&(_.placement&&(u=_.placement),_.rects&&(d=_.rects===!0?await a.getElementRects({reference:n,floating:t,strategy:s}):_.rects),{x:h,y:f}=Oa(d,u,l)),g=-1;continue}}return{x:h,y:f,placement:u,strategy:s,middlewareData:p}};async function Aa(n,t){var e;t===void 0&&(t={});const{x:i,y:s,platform:o,rects:a,elements:r,strategy:l}=n,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:u=!1,padding:p=0}=Je(t,n),m=Pa(p),b=r[u?f==="floating"?"reference":"floating":f],y=Hn(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(b)))==null||e?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(r.floating)),boundary:d,rootBoundary:h,strategy:l})),x=f==="floating"?{...a.floating,x:i,y:s}:a.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(r.floating)),w=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},_=Hn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:k,strategy:l}):x);return{top:(y.top-_.top+m.top)/w.y,bottom:(_.bottom-y.bottom+m.bottom)/w.y,left:(y.left-_.left+m.left)/w.x,right:(_.right-y.right+m.right)/w.x}}const om=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:i,placement:s,rects:o,platform:a,elements:r,middlewareData:l}=t,{element:d,padding:h=0}=Je(n,t)||{};if(d==null)return{};const f=Pa(h),u={x:e,y:i},p=Wi(s),m=zi(p),g=await a.getDimensions(d),b=p==="y",y=b?"top":"left",x=b?"bottom":"right",k=b?"clientHeight":"clientWidth",w=o.reference[m]+o.reference[p]-u[p]-o.floating[m],_=u[p]-o.reference[p],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let M=C?C[k]:0;(!M||!await(a.isElement==null?void 0:a.isElement(C)))&&(M=r.floating[k]||o.floating[m]);const v=w/2-_/2,T=M/2-g[m]/2-1,A=Ge(f[y],T),P=Ge(f[x],T),L=A,U=M-g[m]-P,O=M/2-g[m]/2+v,D=Ii(L,O,U),S=!l.arrow&&Ze(s)!=null&&O!=D&&o.reference[m]/2-(O<L?A:P)-g[m]/2<0,E=S?O<L?O-L:O-U:0;return{[p]:u[p]+E,data:{[p]:D,centerOffset:O-D-E,...S&&{alignmentOffset:E}},reset:S}}}),am=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,i;const{placement:s,middlewareData:o,rects:a,initialPlacement:r,platform:l,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...b}=Je(n,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};const y=ce(s),x=ce(r)===r,k=await(l.isRTL==null?void 0:l.isRTL(d.floating)),w=u||(x||!g?[Wn(r)]:tm(r));!u&&m!=="none"&&w.push(...nm(r,g,m,k));const _=[r,...w],C=await Aa(t,b),M=[];let v=((i=o.flip)==null?void 0:i.overflows)||[];if(h&&M.push(C[y]),f){const L=Qp(s,a,k);M.push(C[L[0]],C[L[1]])}if(v=[...v,{placement:s,overflows:M}],!M.every(L=>L<=0)){var T,A;const L=(((T=o.flip)==null?void 0:T.index)||0)+1,U=_[L];if(U)return{data:{index:L,overflows:v},reset:{placement:U}};let O=(A=v.filter(D=>D.overflows[0]<=0).sort((D,S)=>D.overflows[1]-S.overflows[1])[0])==null?void 0:A.placement;if(!O)switch(p){case"bestFit":{var P;const D=(P=v.map(S=>[S.placement,S.overflows.filter(E=>E>0).reduce((E,V)=>E+V,0)]).sort((S,E)=>S[1]-E[1])[0])==null?void 0:P[0];D&&(O=D);break}case"initialPlacement":O=r;break}if(s!==O)return{reset:{placement:O}}}return{}}}};async function rm(n,t){const{placement:e,platform:i,elements:s}=n,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),a=ce(e),r=Ze(e),l=zn(e)==="y",d=["left","top"].includes(a)?-1:1,h=o&&l?-1:1,f=Je(t,n);let{mainAxis:u,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return r&&typeof m=="number"&&(p=r==="end"?m*-1:m),l?{x:p*h,y:u*d}:{x:u*d,y:p*h}}const lm=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){const{x:e,y:i}=t,s=await rm(t,n);return{x:e+s.x,y:i+s.y,data:s}}}},cm=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:i,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:r={fn:b=>{let{x:y,y:x}=b;return{x:y,y:x}}},...l}=Je(n,t),d={x:e,y:i},h=await Aa(t,l),f=zn(ce(s)),u=Va(f);let p=d[u],m=d[f];if(o){const b=u==="y"?"top":"left",y=u==="y"?"bottom":"right",x=p+h[b],k=p-h[y];p=Ii(x,p,k)}if(a){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=m+h[b],k=m-h[y];m=Ii(x,m,k)}const g=r.fn({...t,[u]:p,[f]:m});return{...g,data:{x:g.x-e,y:g.y-i}}}}};function Xt(n){return Ta(n)?(n.nodeName||"").toLowerCase():"#document"}function mt(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function qt(n){var t;return(t=(Ta(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function Ta(n){return n instanceof Node||n instanceof mt(n).Node}function Lt(n){return n instanceof Element||n instanceof mt(n).Element}function St(n){return n instanceof HTMLElement||n instanceof mt(n).HTMLElement}function Fa(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof mt(n).ShadowRoot}function Qe(n){const{overflow:t,overflowX:e,overflowY:i,display:s}=bt(n);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&!["inline","contents"].includes(s)}function dm(n){return["table","td","th"].includes(Xt(n))}function ji(n){const t=Yi(),e=bt(n);return e.transform!=="none"||e.perspective!=="none"||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(e.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(e.contain||"").includes(i))}function hm(n){let t=_e(n);for(;St(t)&&!jn(t);){if(ji(t))return t;t=_e(t)}return null}function Yi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function jn(n){return["html","body","#document"].includes(Xt(n))}function bt(n){return mt(n).getComputedStyle(n)}function Yn(n){return Lt(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function _e(n){if(Xt(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Fa(n)&&n.host||qt(n);return Fa(t)?t.host:t}function La(n){const t=_e(n);return jn(t)?n.ownerDocument?n.ownerDocument.body:n.body:St(t)&&Qe(t)?t:La(t)}function Ui(n,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);const s=La(n),o=s===((i=n.ownerDocument)==null?void 0:i.body),a=mt(s);return o?t.concat(a,a.visualViewport||[],Qe(s)?s:[],a.frameElement&&e?Ui(a.frameElement):[]):t.concat(s,Ui(s,[],e))}function Na(n){const t=bt(n);let e=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=St(n),o=s?n.offsetWidth:e,a=s?n.offsetHeight:i,r=In(e)!==o||In(i)!==a;return r&&(e=o,i=a),{width:e,height:i,$:r}}function $a(n){return Lt(n)?n:n.contextElement}function xe(n){const t=$a(n);if(!St(t))return Ut(1);const e=t.getBoundingClientRect(),{width:i,height:s,$:o}=Na(t);let a=(o?In(e.width):e.width)/i,r=(o?In(e.height):e.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!r||!Number.isFinite(r))&&(r=1),{x:a,y:r}}const fm=Ut(0);function Ra(n){const t=mt(n);return!Yi()||!t.visualViewport?fm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function um(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==mt(n)?!1:t}function tn(n,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);const s=n.getBoundingClientRect(),o=$a(n);let a=Ut(1);t&&(i?Lt(i)&&(a=xe(i)):a=xe(n));const r=um(o,e,i)?Ra(o):Ut(0);let l=(s.left+r.x)/a.x,d=(s.top+r.y)/a.y,h=s.width/a.x,f=s.height/a.y;if(o){const u=mt(o),p=i&&Lt(i)?mt(i):i;let m=u.frameElement;for(;m&&i&&p!==u;){const g=xe(m),b=m.getBoundingClientRect(),y=bt(m),x=b.left+(m.clientLeft+parseFloat(y.paddingLeft))*g.x,k=b.top+(m.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,d*=g.y,h*=g.x,f*=g.y,l+=x,d+=k,m=mt(m).frameElement}}return Hn({width:h,height:f,x:l,y:d})}function pm(n){let{rect:t,offsetParent:e,strategy:i}=n;const s=St(e),o=qt(e);if(e===o)return t;let a={scrollLeft:0,scrollTop:0},r=Ut(1);const l=Ut(0);if((s||!s&&i!=="fixed")&&((Xt(e)!=="body"||Qe(o))&&(a=Yn(e)),St(e))){const d=tn(e);r=xe(e),l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}return{width:t.width*r.x,height:t.height*r.y,x:t.x*r.x-a.scrollLeft*r.x+l.x,y:t.y*r.y-a.scrollTop*r.y+l.y}}function mm(n){return Array.from(n.getClientRects())}function Ia(n){return tn(qt(n)).left+Yn(n).scrollLeft}function gm(n){const t=qt(n),e=Yn(n),i=n.ownerDocument.body,s=ye(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=ye(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-e.scrollLeft+Ia(n);const r=-e.scrollTop;return bt(i).direction==="rtl"&&(a+=ye(t.clientWidth,i.clientWidth)-s),{width:s,height:o,x:a,y:r}}function bm(n,t){const e=mt(n),i=qt(n),s=e.visualViewport;let o=i.clientWidth,a=i.clientHeight,r=0,l=0;if(s){o=s.width,a=s.height;const d=Yi();(!d||d&&t==="fixed")&&(r=s.offsetLeft,l=s.offsetTop)}return{width:o,height:a,x:r,y:l}}function ym(n,t){const e=tn(n,!0,t==="fixed"),i=e.top+n.clientTop,s=e.left+n.clientLeft,o=St(n)?xe(n):Ut(1),a=n.clientWidth*o.x,r=n.clientHeight*o.y,l=s*o.x,d=i*o.y;return{width:a,height:r,x:l,y:d}}function za(n,t,e){let i;if(t==="viewport")i=bm(n,e);else if(t==="document")i=gm(qt(n));else if(Lt(t))i=ym(t,e);else{const s=Ra(n);i={...t,x:t.x-s.x,y:t.y-s.y}}return Hn(i)}function Wa(n,t){const e=_e(n);return e===t||!Lt(e)||jn(e)?!1:bt(e).position==="fixed"||Wa(e,t)}function _m(n,t){const e=t.get(n);if(e)return e;let i=Ui(n,[],!1).filter(r=>Lt(r)&&Xt(r)!=="body"),s=null;const o=bt(n).position==="fixed";let a=o?_e(n):n;for(;Lt(a)&&!jn(a);){const r=bt(a),l=ji(a);!l&&r.position==="fixed"&&(s=null),(o?!l&&!s:!l&&r.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Qe(a)&&!l&&Wa(n,a))?i=i.filter(h=>h!==a):s=r,a=_e(a)}return t.set(n,i),i}function xm(n){let{element:t,boundary:e,rootBoundary:i,strategy:s}=n;const a=[...e==="clippingAncestors"?_m(t,this._c):[].concat(e),i],r=a[0],l=a.reduce((d,h)=>{const f=za(t,h,s);return d.top=ye(f.top,d.top),d.right=Ge(f.right,d.right),d.bottom=Ge(f.bottom,d.bottom),d.left=ye(f.left,d.left),d},za(t,r,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function km(n){return Na(n)}function wm(n,t,e){const i=St(t),s=qt(t),o=e==="fixed",a=tn(n,!0,o,t);let r={scrollLeft:0,scrollTop:0};const l=Ut(0);if(i||!i&&!o)if((Xt(t)!=="body"||Qe(s))&&(r=Yn(t)),i){const d=tn(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else s&&(l.x=Ia(s));return{x:a.left+r.scrollLeft-l.x,y:a.top+r.scrollTop-l.y,width:a.width,height:a.height}}function Ha(n,t){return!St(n)||bt(n).position==="fixed"?null:t?t(n):n.offsetParent}function ja(n,t){const e=mt(n);if(!St(n))return e;let i=Ha(n,t);for(;i&&dm(i)&&bt(i).position==="static";)i=Ha(i,t);return i&&(Xt(i)==="html"||Xt(i)==="body"&&bt(i).position==="static"&&!ji(i))?e:i||hm(n)||e}const Cm=async function(n){let{reference:t,floating:e,strategy:i}=n;const s=this.getOffsetParent||ja,o=this.getDimensions;return{reference:wm(t,await s(e),i),floating:{x:0,y:0,...await o(e)}}};function Sm(n){return bt(n).direction==="rtl"}const Mm={convertOffsetParentRelativeRectToViewportRelativeRect:pm,getDocumentElement:qt,getClippingRect:xm,getOffsetParent:ja,getElementRects:Cm,getClientRects:mm,getDimensions:km,getScale:xe,isElement:Lt,isRTL:Sm},Dm=(n,t,e)=>{const i=new Map,s={platform:Mm,...e},o={...s.platform,_c:i};return sm(n,t,{...s,platform:o})};function vm(n){var t;return(t=n==null?void 0:n.$el)!=null?t:n}function Em(n){return{name:"arrow",options:n,fn(t){const e=vm(c.unref(n.element));return e==null?{}:om({element:e,padding:n.padding}).fn(t)}}}const Bm={class:"px-2 py-0"},Vm={key:0,class:"fm-typo-body-xl-700"},Pm={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},Om={FmBreadcrumb:qa,FmButton:Gt,FmButtonGroup:ar,FmCard:cr,FmCardActions:dr,FmCardSection:hr,FmCardTitle:qi,FmLineChart:wf,FmDatePicker:Tf,FmDateRangePicker:Yf,FmDialog:qf,FmCheckbox:ba,FmField:ya,FmForm:ou,FmRadio:uu,FmRadioGroup:bu,FmSelect:Eu,FmStepperField:Ru,FmSwitch:Gu,FmTextField:op,FmTextarea:up,FmIcon:z,FmList:mp,FmListItem:bp,FmMenu:Ri,FmMenuItem:Ca,FmStepper:Mp,FmStep:Bp,FmSnackbar:Ap,FmSpacer:va,FmTimeInput:Ba,FmTimePicker:Gp,FmTooltip:c.defineComponent({__name:"FmTooltip",props:{variant:{default:"plain"},beak:{default:"top"},hasArrow:{type:Boolean,default:!0},titleText:{default:"Title"},contentText:{},actionButtons:{}},setup(n){const t=n,e=c.ref(null),i=c.ref(null),s=c.ref(null),o=async()=>{var y,x,k,w;const{x:p,y:m,placement:g,middlewareData:b}=await Dm(e.value,i.value,{placement:t.beak,middleware:[lm(10),am(),cm({padding:5}),t.hasArrow?Em({element:s.value,padding:10}):null]});if(Object.assign(i.value.style,{left:`${p}px`,top:`${m}px`}),t.hasArrow){const _={top:"bottom",right:"left",bottom:"top",left:"right"}[g.split("-")[0]];Object.assign(s.value.style,{left:((y=b.arrow)==null?void 0:y.x)!=null?`${(x=b.arrow)==null?void 0:x.x}px`:"",top:((k=b.arrow)==null?void 0:k.y)!=null?`${(w=b.arrow)==null?void 0:w.y}px`:"",right:"",bottom:"",background:t.variant==="rich"?"#FFF":"#1C1C1E",[_]:"-4px"})}},a=c.ref(!1),r=c.ref(0),l=c.ref(0),d=c.computed(()=>({...{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)"}}[t.variant],display:a.value?"block":"none"})),h=()=>{clearTimeout(l.value),r.value=window.setTimeout(()=>{a.value=!0},500)},f=()=>{clearTimeout(r.value),l.value=window.setTimeout(()=>a.value=!1,1500)},u=()=>{clearTimeout(l.value),a.value=!0};return c.watchEffect(()=>{a.value?(o(),window.addEventListener("resize",o)):window.removeEventListener("resize",o)}),(p,m)=>(c.openBlock(),c.createElementBlock("div",null,[c.createElementVNode("div",{ref_key:"tooltipContainer",ref:e,class:"cursor-pointer flex items-center justify-center relative w-max",onMouseenter:h,onMouseleave:f},[c.renderSlot(p.$slots,"default")],544),c.createElementVNode("div",{ref_key:"tooltip",ref:i,class:"absolute box-border break-words left-0 max-w-xs px-4 py-3 rounded-2xl top-0 w-max whitespace-normal z-50",style:c.normalizeStyle(d.value),onMouseenter:u,onMouseleave:f},[c.createElementVNode("div",null,[c.createElementVNode("div",Bm,[p.variant=="rich"?(c.openBlock(),c.createElementBlock("div",Vm,c.toDisplayString(p.titleText),1)):c.createCommentVNode("",!0),c.createElementVNode("div",{class:c.normalizeClass(p.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},c.toDisplayString(p.contentText),3)]),p.variant=="rich"?(c.openBlock(),c.createElementBlock("div",Pm,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p.actionButtons,(g,b)=>(c.openBlock(),c.createElementBlock("div",{key:b},[c.createVNode(Gt,{variant:"tertiary",label:g.label,onClick:g.handler},null,8,["label","onClick"])]))),128))])):c.createCommentVNode("",!0)]),c.createElementVNode("div",{ref_key:"arrowEl",ref:s,class:"-rotate-45 absolute h-3 w-3"},null,512)],36)]))}})},Am={key:0,class:"block"},Tm={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Fm={class:"fm-typo-title-md-700 text-fm-color-typo-primary"},Lm={key:0,class:"overflow-y-auto"},Nm={key:1,class:"fm-typo-body-md-400 overflow-y-auto text-fm-color-neutral-black"},$m={class:"flex gap-8 items-center justify-end sm:flex-col-reverse xs:flex-col-reverse"},Rm=c.defineComponent({__name:"FmDynamicDialog",props:{title:{},message:{},primaryActions:{default:null},secondaryActions:{default:null},tertiaryActions:{default:null},overlay:{type:Boolean,default:!0},closeButton:{type:Boolean,default:!0},minWidth:{default:280},dialogComponent:{default:null},contentComponent:{default:null},unmount:{},storedFunctions:{}},emits:["dialog-opened","dialog-closed"],setup(n,{emit:t}){const e=n,i=c.ref(!0),s=c.ref(null),o=()=>{e.overlay&&(e.unmount(),t("dialog-closed"))},a=l=>{s.value&&l.target===s.value&&o()},r=(l,d)=>{e.storedFunctions[d].forEach(h=>h()),l.close&&o()};return c.onMounted(()=>{t("dialog-opened")}),(l,d)=>(c.openBlock(),c.createBlock(c.Transition,null,{default:c.withCtx(()=>[i.value?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:s,class:c.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":l.overlay}),onClick:a},[l.dialogComponent?(c.openBlock(),c.createElementBlock("div",Am,[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(l.dialogComponent)))])):(c.openBlock(),c.createElementBlock("div",{key:1,class:"fm-dialog",style:c.normalizeStyle({"min-width":`${e.minWidth}px`})},[c.createElementVNode("div",Tm,[c.createElementVNode("div",Fm,c.toDisplayString(l.title),1),l.closeButton?(c.openBlock(),c.createBlock(z,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:o})):c.createCommentVNode("",!0)]),l.contentComponent?(c.openBlock(),c.createElementBlock("div",Lm,[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(l.contentComponent)))])):(c.openBlock(),c.createElementBlock("div",Nm,c.toDisplayString(l.message),1)),c.createElementVNode("div",$m,[l.tertiaryActions?(c.openBlock(),c.createBlock(Gt,{key:0,class:"sm:w-full xs:w-full",variant:"tertiary",label:l.tertiaryActions.text,size:"md",onClick:d[0]||(d[0]=h=>r(l.tertiaryActions,"tertiary"))},null,8,["label"])):c.createCommentVNode("",!0),c.createVNode(va,{class:"sm:hidden xs:hidden"}),l.secondaryActions?(c.openBlock(),c.createBlock(Gt,{key:1,class:"sm:w-full xs:w-full",variant:"secondary",label:l.secondaryActions.text,size:"md",onClick:d[1]||(d[1]=h=>r(l.secondaryActions,"secondary"))},null,8,["label"])):c.createCommentVNode("",!0),l.primaryActions?(c.openBlock(),c.createBlock(Gt,{key:2,class:"sm:w-full xs:w-full",variant:"primary",label:l.primaryActions.text,size:"md",onClick:d[2]||(d[2]=h=>r(l.primaryActions,"primary"))},null,8,["label"])):c.createCommentVNode("",!0)])],4))],2)):c.createCommentVNode("",!0)]),_:1}))}}),yg="",Im={install:n=>{const t={open:e=>{const i={primary:[],secondary:[],tertiary:[]},s={onPrimary:d=>(i.primary.push(d),s),onSecondary:d=>(i.secondary.push(d),s),onTertiary:d=>(i.tertiary.push(d),s)};function o(){a&&c.render(null,a),a=null,l=null}let a=document.createElement("div");document.body.appendChild(a);const r=c.markRaw(Rm);let l=c.createVNode(r,{...e,unmount:o,storedFunctions:i});return l.appContext=n._context,c.render(l,a),s}};n.config.globalProperties.$dialog=t,n.provide(wa,t)}};function zm(){const n=c.inject(wa);if(!n)throw new Error("No provider");return n}const Wm=n=>{n.use(ft,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),n.use(Im),Object.entries(Om).forEach(([t,e])=>{n.component(t,e)})};nt.uiPlugin=Wm,nt.useDialog=zm,nt.useFormChild=qe,nt.useValidation=Ke,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"})});
25
+ `):n}function Xh(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 na(n,t){const e=n.chart.ctx,{body:i,footer:s,title:o}=n,{boxWidth:a,boxHeight:r}=t,l=et(t.bodyFont),d=et(t.titleFont),h=et(t.footerFont),f=o.length,u=s.length,p=i.length,m=rt(t.padding);let g=m.height,b=0,y=i.reduce((k,_)=>k+_.before.length+_.lines.length+_.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),y){const k=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;g+=p*k+(y-p)*l.lineHeight+(y-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let x=0;const w=function(k){b=Math.max(b,e.measureText(k).width+x)};return e.save(),e.font=d.string,H(n.title,w),e.font=l.string,H(n.beforeBody.concat(n.afterBody),w),x=t.displayColors?a+2+t.boxPadding:0,H(i,k=>{H(k.before,w),H(k.lines,w),H(k.after,w)}),x=0,e.font=h.string,H(n.footer,w),e.restore(),b+=m.width,{width:b,height:g}}function qh(n,t){const{y:e,height:i}=t;return e<i/2?"top":e>n.height-i/2?"bottom":"center"}function Kh(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 Gh(n,t,e,i){const{x:s,width:o}=e,{width:a,chartArea:{left:r,right:l}}=n;let d="center";return i==="center"?d=s<=(r+l)/2?"left":"right":s<=o/2?d="left":s>=a-o/2&&(d="right"),Kh(d,n,t,e)&&(d="center"),d}function ia(n,t,e){const i=e.yAlign||t.yAlign||qh(n,e);return{xAlign:e.xAlign||t.xAlign||Gh(n,t,e,i),yAlign:i}}function Jh(n,t){let{x:e,width:i}=n;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function Zh(n,t,e){let{y:i,height:s}=n;return t==="top"?i+=e:t==="bottom"?i-=s+e:i-=s/2,i}function sa(n,t,e,i){const{caretSize:s,caretPadding:o,cornerRadius:a}=n,{xAlign:r,yAlign:l}=e,d=s+o,{topLeft:h,topRight:f,bottomLeft:u,bottomRight:p}=ee(a);let m=Jh(t,r);const g=Zh(t,l,d);return l==="center"?r==="left"?m+=d:r==="right"&&(m-=d):r==="left"?m-=Math.max(h,u)+s:r==="right"&&(m+=Math.max(f,p)+s),{x:st(m,0,i.width-t.width),y:st(g,0,i.height-t.height)}}function Nn(n,t,e){const i=rt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-i.right:n.x+i.left}function oa(n){return St([],At(n))}function Qh(n,t,e){return jt(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function aa(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const ra={beforeTitle:Dt,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:Dt,beforeBody:Dt,beforeLabel:Dt,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 z(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:Dt,afterBody:Dt,beforeFooter:Dt,footer:Dt,afterFooter:Dt};function ct(n,t,e,i){const s=n[t].call(e,i);return typeof s>"u"?ra[t].call(e,i):s}class Li extends Pt{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 Ks(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Qh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,s=ct(i,"beforeTitle",this,t),o=ct(i,"title",this,t),a=ct(i,"afterTitle",this,t);let r=[];return r=St(r,At(s)),r=St(r,At(o)),r=St(r,At(a)),r}getBeforeBody(t,e){return oa(ct(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,s=[];return H(t,o=>{const a={before:[],lines:[],after:[]},r=aa(i,o);St(a.before,At(ct(r,"beforeLabel",this,o))),St(a.lines,ct(r,"label",this,o)),St(a.after,At(ct(r,"afterLabel",this,o))),s.push(a)}),s}getAfterBody(t,e){return oa(ct(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,s=ct(i,"beforeFooter",this,t),o=ct(i,"footer",this,t),a=ct(i,"afterFooter",this,t);let r=[];return r=St(r,At(s)),r=St(r,At(o)),r=St(r,At(a)),r}_createItems(t){const e=this._active,i=this.chart.data,s=[],o=[],a=[];let r=[],l,d;for(l=0,d=e.length;l<d;++l)r.push(Xh(this.chart,e[l]));return t.filter&&(r=r.filter((h,f,u)=>t.filter(h,f,u,i))),t.itemSort&&(r=r.sort((h,f)=>t.itemSort(h,f,i))),H(r,h=>{const f=aa(t.callbacks,h);s.push(ct(f,"labelColor",this,h)),o.push(ct(f,"labelPointStyle",this,h)),a.push(ct(f,"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=Ue[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=na(this,i),d=Object.assign({},r,l),h=ia(this.chart,i,d),f=sa(i,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:f.x,y:f.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:d,bottomLeft:h,bottomRight:f}=ee(r),{x:u,y:p}=t,{width:m,height:g}=e;let b,y,x,w,k,_;return o==="center"?(k=p+g/2,s==="left"?(b=u,y=b-a,w=k+a,_=k-a):(b=u+m,y=b+a,w=k-a,_=k+a),x=b):(s==="left"?y=u+Math.max(l,h)+a:s==="right"?y=u+m-Math.max(d,f)-a:y=this.caretX,o==="top"?(w=p,k=w-a,b=y-a,x=y+a):(w=p+g,k=w+a,b=y+a,x=y-a),_=w),{x1:b,x2:y,x3:x,y1:w,y2:k,y3:_}}drawTitle(t,e,i){const s=this.title,o=s.length;let a,r,l;if(o){const d=ye(i.rtl,this.x,this.width);for(t.x=Nn(this,i.titleAlign,i),e.textAlign=d.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],d.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:d}=o,h=et(o.bodyFont),f=Nn(this,"left",o),u=s.x(f),p=l<h.lineHeight?(h.lineHeight-l)/2:0,m=e.y+p;if(o.usePointStyle){const g={radius:Math.min(d,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},b=s.leftForLtr(u,d)+d/2,y=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,fi(t,g,b,y),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,fi(t,g,b,y)}else{t.lineWidth=$(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 g=s.leftForLtr(u,d),b=s.leftForLtr(s.xPlus(u,1),d-2),y=ee(a.borderRadius);Object.values(y).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Fe(t,{x:g,y:m,w:d,h:l,radius:y}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Fe(t,{x:b,y:m+1,w:d-2,h:l-2,radius:y}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,m,d,l),t.strokeRect(g,m,d,l),t.fillStyle=a.backgroundColor,t.fillRect(b,m+1,d-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:d,boxPadding:h}=i,f=et(i.bodyFont);let u=f.lineHeight,p=0;const m=ye(i.rtl,this.x,this.width),g=function(v){e.fillText(v,m.x(t.x+p),t.y+u/2),t.y+=u+o},b=m.textAlign(a);let y,x,w,k,_,S,C;for(e.textAlign=a,e.textBaseline="middle",e.font=f.string,t.x=Nn(this,b,i),e.fillStyle=i.bodyColor,H(this.beforeBody,g),p=r&&b!=="right"?a==="center"?d/2+h:d+2+h:0,k=0,S=s.length;k<S;++k){for(y=s[k],x=this.labelTextColors[k],e.fillStyle=x,H(y.before,g),w=y.lines,r&&w.length&&(this._drawColorBox(e,t,k,m,i),u=Math.max(f.lineHeight,l)),_=0,C=w.length;_<C;++_)g(w[_]),u=f.lineHeight;H(y.after,g)}p=0,u=f.lineHeight,H(this.afterBody,g),t.y-=o}drawFooter(t,e,i){const s=this.footer,o=s.length;let a,r;if(o){const l=ye(i.rtl,this.x,this.width);for(t.x=Nn(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:d,height:h}=i,{topLeft:f,topRight:u,bottomLeft:p,bottomRight:m}=ee(s.cornerRadius);e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,e.lineWidth=s.borderWidth,e.beginPath(),e.moveTo(r+f,l),a==="top"&&this.drawCaret(t,e,i,s),e.lineTo(r+d-u,l),e.quadraticCurveTo(r+d,l,r+d,l+u),a==="center"&&o==="right"&&this.drawCaret(t,e,i,s),e.lineTo(r+d,l+h-m),e.quadraticCurveTo(r+d,l+h,r+d-m,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+f),e.quadraticCurveTo(r,l,r+f,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=Ue[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=na(this,t),l=Object.assign({},a,this._size),d=ia(e,t,l),h=sa(t,l,d,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.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=rt(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),zs(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Is(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map(({datasetIndex:r,index:l})=>{const d=this.chart.getDatasetMeta(r);if(!d)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:d.data[l],index:l}}),o=!ln(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||!ln(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=Ue[o.position].call(this,t,e);return a!==!1&&(i!==a.x||s!==a.y)}}B(Li,"positioners",Ue);var tf={id:"tooltip",_element:Li,positioners:Ue,afterInit(n,t,e){e&&(n.tooltip=new Li({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:ra},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"]},ef=Object.freeze({__proto__:null,Colors:uh,Decimation:bh,Filler:Nh,Legend:Hh,SubTitle:Uh,Title:Yh,Tooltip:tf});const nf=(n,t,e,i)=>(typeof t=="string"?(e=n.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function sf(n,t,e,i){const s=n.indexOf(t);if(s===-1)return nf(n,t,e,i);const o=n.lastIndexOf(t);return s!==o?e:s}const of=(n,t)=>n===null?null:st(Math.round(n),0,t);function la(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Ni extends re{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(z(t))return null;const i=this.getLabels();return e=isFinite(e)&&i[e]===t?e:sf(i,t,R(e,t),this._addedLabels),of(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 la.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}}B(Ni,"id","category"),B(Ni,"defaults",{ticks:{callback:la}});function af(n,t){const e=[],{bounds:s,step:o,min:a,max:r,precision:l,count:d,maxTicks:h,maxDigits:f,includeBounds:u}=n,p=o||1,m=h-1,{min:g,max:b}=t,y=!z(a),x=!z(r),w=!z(d),k=(b-g)/(f+1);let _=ds((b-g)/m/p)*p,S,C,v,A;if(_<1e-14&&!y&&!x)return[{value:g},{value:b}];A=Math.ceil(b/_)-Math.floor(g/_),A>m&&(_=ds(A*_/m/p)*p),z(l)||(S=Math.pow(10,l),_=Math.ceil(_*S)/S),s==="ticks"?(C=Math.floor(g/_)*_,v=Math.ceil(b/_)*_):(C=g,v=b),y&&x&&o&&Qr((r-a)/o,_/1e3)?(A=Math.round(Math.min((r-a)/_,h)),_=(r-a)/A,C=a,v=r):w?(C=y?a:C,v=x?r:v,A=d-1,_=(v-C)/A):(A=(v-C)/_,Be(A,Math.round(A),_/1e3)?A=Math.round(A):A=Math.ceil(A));const F=Math.max(fs(_),fs(C));S=Math.pow(10,z(l)?F:l),C=Math.round(C*S)/S,v=Math.round(v*S)/S;let P=0;for(y&&(u&&C!==a?(e.push({value:a}),C<a&&P++,Be(Math.round((C+P*_)*S)/S,a,ca(a,k,n))&&P++):C<a&&P++);P<A;++P){const L=Math.round((C+P*_)*S)/S;if(x&&L>r)break;e.push({value:L})}return x&&u&&v!==r?e.length&&Be(e[e.length-1].value,r,ca(r,k,n))?e[e.length-1].value=r:e.push({value:r}):(!x||v===r)&&e.push({value:v}),e}function ca(n,t,{horizontal:e,minRotation:i}){const s=_t(i),o=(e?Math.sin(s):Math.cos(s))||.001,a=.75*t*(""+n).length;return Math.min(t/o,a)}class Rn extends re{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined: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=kt(s),d=kt(o);l<0&&d<0?r(0):l>0&&d>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=af(s,o);return t.bounds==="ticks"&&hs(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 Oe(t,this.chart.options.locale,this.options.ticks.format)}}class Ri extends Rn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?t:0,this.max=J(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=_t(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}}B(Ri,"id","linear"),B(Ri,"defaults",{ticks:{callback:fn.formatters.numeric}});const Xe=n=>Math.floor(Ht(n)),le=(n,t)=>Math.pow(10,Xe(n)+t);function da(n){return n/Math.pow(10,Xe(n))===1}function ha(n,t,e){const i=Math.pow(10,e),s=Math.floor(n/i);return Math.ceil(t/i)-s}function rf(n,t){const e=t-n;let i=Xe(e);for(;ha(n,t,i)>10;)i++;for(;ha(n,t,i)<10;)i--;return Math.min(i,Xe(n))}function lf(n,{min:t,max:e}){t=ut(n.min,t);const i=[],s=Xe(t);let o=rf(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,d=Math.round((t-l)*a)/a,h=Math.floor((t-l)/r/10)*r*10;let f=Math.floor((d-h)/Math.pow(10,o)),u=ut(n.min,Math.round((l+h+f*Math.pow(10,o))*a)/a);for(;u<e;)i.push({value:u,major:da(u),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(o++,f=2,a=o>=0?1:a),u=Math.round((l+h+f*Math.pow(10,o))*a)/a;const p=ut(n.max,u);return i.push({value:p,major:da(p),significand:f}),i}class $i extends re{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const i=Rn.prototype.parse.apply(this,[t,e]);if(i===0){this._zero=!0;return}return J(i)&&i>0?i:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=J(t)?Math.max(0,t):null,this.max=J(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!J(this._userMin)&&(this.min=t===le(this.min,0)?le(this.min,-1):le(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(le(i,-1)),a(le(s,1)))),i<=0&&o(le(s,-1)),s<=0&&a(le(i,1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},i=lf(e,this);return t.bounds==="ticks"&&hs(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":Oe(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ht(t),this._valueRange=Ht(this.max)-Ht(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ht(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}B($i,"id","logarithmic"),B($i,"defaults",{ticks:{callback:fn.formatters.logarithmic,major:{enabled:!0}}});function zi(n){const t=n.ticks;if(t.display&&n.display){const e=rt(t.backdropPadding);return R(t.font&&t.font.size,Z.font.size)+e.height}return 0}function cf(n,t,e){return e=X(e)?e:[e],{w:gl(n,t.string,e),h:e.length*t.lineHeight}}function fa(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 df(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?q/o:0;for(let l=0;l<o;l++){const d=a.setContext(n.getPointLabelContext(l));s[l]=d.padding;const h=n.getPointPosition(l,n.drawingArea+s[l],r),f=et(d.font),u=cf(n.ctx,f,n._pointLabels[l]);i[l]=u;const p=pt(n.getIndexAngle(l)+r),m=Math.round(si(p)),g=fa(m,h.x,u.w,0,180),b=fa(m,h.y,u.h,90,270);hf(e,t,p,g,b)}n.setCenterPoint(t.l-e.l,e.r-t.r,t.t-e.t,e.b-t.b),n._pointLabelItems=pf(n,i,s)}function hf(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 ff(n,t,e){const i=n.drawingArea,{extra:s,additionalAngle:o,padding:a,size:r}=e,l=n.getPointPosition(t,i+s+a,o),d=Math.round(si(pt(l.angle+tt))),h=bf(l.y,r.h,d),f=mf(d),u=gf(l.x,r.w,f);return{visible:!0,x:l.x,y:h,textAlign:f,left:u,top:h,right:u+r.w,bottom:h+r.h}}function uf(n,t){if(!t)return!0;const{left:e,top:i,right:s,bottom:o}=n;return!(Bt({x:e,y:i},t)||Bt({x:e,y:o},t)||Bt({x:s,y:i},t)||Bt({x:s,y:o},t))}function pf(n,t,e){const i=[],s=n._pointLabels.length,o=n.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:zi(o)/2,additionalAngle:a?q/s:0};let d;for(let h=0;h<s;h++){l.padding=e[h],l.size=t[h];const f=ff(n,h,l);i.push(f),r==="auto"&&(f.visible=uf(f,d),f.visible&&(d=f))}return i}function mf(n){return n===0||n===180?"center":n<180?"left":"right"}function gf(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function bf(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function yf(n,t,e){const{left:i,top:s,right:o,bottom:a}=e,{backdropColor:r}=t;if(!z(r)){const l=ee(t.borderRadius),d=rt(t.backdropPadding);n.fillStyle=r;const h=i-d.left,f=s-d.top,u=o-i+d.width,p=a-s+d.height;Object.values(l).some(m=>m!==0)?(n.beginPath(),Fe(n,{x:h,y:f,w:u,h:p,radius:l}),n.fill()):n.fillRect(h,f,u,p)}}function _f(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));yf(e,a,o);const r=et(a.font),{x:l,y:d,textAlign:h}=o;te(e,n._pointLabels[s],l,d+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"})}}function ua(n,t,e,i){const{ctx:s}=n;if(e)s.arc(n.xCenter,n.yCenter,t,0,K);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 xf(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(),ua(n,e,a,i),o.closePath(),o.stroke(),o.restore())}function kf(n,t,e){return jt(n,{label:e,index:t,type:"pointLabel"})}class qe extends Rn{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=rt(zi(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=J(t)&&!isNaN(t)?t:0,this.max=J(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/zi(this.options))}generateTickLabels(t){Rn.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?df(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=K/(this._pointLabels.length||1),i=this.options.startAngle||0;return pt(t*e+_t(i))}getDistanceFromCenterForValue(t){if(z(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(z(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const i=e[t];return kf(this.getContext(),t,i)}}getPointPosition(t,e,i=0){const s=this.getIndexAngle(t)-tt+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(),ua(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,d;if(e.pointLabels.display&&_f(this,a),s.display&&this.ticks.forEach((h,f)=>{if(f!==0){l=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(f),p=s.setContext(u),m=o.setContext(u);xf(this,p,l,a,m)}}),i.display){for(t.save(),r=a-1;r>=0;r--){const h=i.setContext(this.getPointLabelContext(r)),{color:f,lineWidth:u}=h;!u||!f||(t.lineWidth=u,t.strokeStyle=f,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),d=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(d.x,d.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 d=i.setContext(this.getContext(l)),h=et(d.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(r.label).width,t.fillStyle=d.backdropColor;const f=rt(d.backdropPadding);t.fillRect(-a/2-f.left,-o-h.size/2-f.top,a+f.width,h.size+f.height)}te(t,r.label,0,-o,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}B(qe,"id","radialLinear"),B(qe,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:fn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),B(qe,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),B(qe,"descriptors",{angleLines:{_fallback:"grid"}});const $n={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}},dt=Object.keys($n);function pa(n,t){return n-t}function ma(n,t){if(z(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)),J(a)||(a=typeof i=="string"?e.parse(a,i):e.parse(a)),a===null?null:(s&&(a=s==="week"&&(me(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,s)),+a)}function ga(n,t,e,i){const s=dt.length;for(let o=dt.indexOf(n);o<s-1;++o){const a=$n[dt[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=i)return dt[o]}return dt[s-1]}function wf(n,t,e,i,s){for(let o=dt.length-1;o>=dt.indexOf(e);o--){const a=dt[o];if($n[a].common&&n._adapter.diff(s,i,a)>=t-1)return a}return dt[e?dt.indexOf(e):0]}function Sf(n){for(let t=dt.indexOf(n)+1,e=dt.length;t<e;++t)if($n[dt[t]].common)return dt[t]}function ba(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:i,hi:s}=ai(e,t),o=e[i]>=t?e[i]:e[s];n[o]=!0}}function Cf(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 ya(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:Cf(n,i,s,e)}class Ke extends re{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 Oc._date(t.adapters.date);s.init(e),ve(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:ma(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(d){!a&&!isNaN(d.min)&&(s=Math.min(s,d.min)),!r&&!isNaN(d.max)&&(o=Math.max(o,d.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=J(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),o=J(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=il(s,o,a);return this._unit=e.unit||(i.autoSkip?ga(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):wf(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:Sf(this._unit),this.initOffsets(s),t.reverse&&r.reverse(),ya(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=st(e,0,a),i=st(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||ga(o.minUnit,e,i,this._getLabelCapacity(e)),r=R(s.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,d=me(l)||l===!0,h={};let f=e,u,p;if(d&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,d?"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 m=s.ticks.source==="data"&&this.getDataTimestamps();for(u=f,p=0;u<i;u=+t.add(u,r,a),p++)ba(h,u,m);return(u===i||s.bounds==="ticks"||p===1)&&ba(h,u,m),Object.keys(h).sort(pa).map(g=>+g)}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,d=this._majorUnit,h=l&&r[l],f=d&&r[d],u=i[e],p=d&&f&&u&&u.major;return this._adapter.format(t,s||(p?f: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=_t(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,ya(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(ma(this,s[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return gs(t.sort(pa))}}B(Ke,"id","time"),B(Ke,"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 zn(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}=Et(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}=Et(n,"time",t)),{time:o,pos:r}=n[i],{time:a,pos:l}=n[s]);const d=a-o;return d?r+(l-r)*(t-o)/d:r}class Ii extends Ke{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=zn(e,this.min),this._tableRange=zn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],o=[];let a,r,l,d,h;for(a=0,r=t.length;a<r;++a)d=t[a],d>=e&&d<=i&&s.push(d);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],d=s[a],Math.round((h+l)/2)!==d&&o.push({time:d,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(zn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return zn(this._table,i*this._tableRange+this._minPos,!0)}}B(Ii,"id","timeseries"),B(Ii,"defaults",Ke.defaults);var Mf=Object.freeze({__proto__:null,CategoryScale:Ni,LinearScale:Ri,LogarithmicScale:$i,RadialLinearScale:qe,TimeScale:Ke,TimeSeriesScale:Ii});const Df=[Pc,rh,ef,Mf];Ot.register(...Df);const vf={class:"px-24 py-16"},Ef={class:"flex flex-col gap-8"},Bf={class:"fm-color-typo-primary fm-typo-body-lg-400"},Vf={class:"fm-color-typo-secondary fm-typo-body-md-400"},Pf=c.defineComponent({__name:"FmLine",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{}},setup(n){const t=n,e=c.ref(null);let i=null;c.watch([()=>t.xAxis,()=>t.datasets],()=>{i&&(i.data.datasets=t.datasets,i.data.labels=t.xAxis.categories,i.update())});function s(d,h){const f=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(d);if(f)return`rgba(${parseInt(f[1],16)},${parseInt(f[2],16)},${parseInt(f[3],16)},${h})`;if(d.startsWith("rgb")){const u=d.split(",");if(u.length===3)return[...u.slice(0,2),u[2].replace(")",`,${h})`)].join(",");if(u.length===4)return[...u.slice(0,3),`${h})`].join(",")}return""}function o(d){const h=getComputedStyle(document.documentElement).getPropertyValue(`--${d}`)||d;return h.startsWith("rgb")||h.startsWith("#")?h:null}function a({context:d,color:h}){const{ctx:f,chartArea:u}=d.chart;if(!u)return;const p=f==null?void 0:f.createLinearGradient(0,0,0,u.height);return p.addColorStop(0,s(h,.5)),p.addColorStop(1,s(h,0)),p}const r=c.computed(()=>({labels:t.xAxis.categories,datasets:t.datasets.map(d=>{const h=o(d.color)??"";return{...d,backgroundColor:h?f=>a({context:f,color:h}):"",borderColor:h,borderDash:d.dash?[5,5]:void 0,tension:.1}})}));function l(){e.value&&(i=new Ot(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 c.onMounted(()=>{l()}),(d,h)=>(c.openBlock(),c.createElementBlock("div",vf,[c.createElementVNode("div",Ef,[c.createElementVNode("div",Bf,c.toDisplayString(d.name),1),c.createElementVNode("div",Vf,c.toDisplayString(d.paragraph),1)]),c.createElementVNode("canvas",{ref_key:"canvas",ref:e},null,512)]))}});var Of=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Af(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var _a={exports:{}};(function(n,t){(function(e,i){n.exports=i()})(Of,function(){var e=1e3,i=6e4,s=36e5,o="millisecond",a="second",r="minute",l="hour",d="day",h="week",f="month",u="quarter",p="year",m="date",g="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,x={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(O){var D=["th","st","nd","rd"],M=O%100;return"["+O+(D[(M-20)%10]||D[M]||D[0])+"]"}},w=function(O,D,M){var E=String(O);return!E||E.length>=D?O:""+Array(D+1-E.length).join(M)+O},k={s:w,z:function(O){var D=-O.utcOffset(),M=Math.abs(D),E=Math.floor(M/60),V=M%60;return(D<=0?"+":"-")+w(E,2,"0")+":"+w(V,2,"0")},m:function O(D,M){if(D.date()<M.date())return-O(M,D);var E=12*(M.year()-D.year())+(M.month()-D.month()),V=D.clone().add(E,f),T=M-V<0,N=D.clone().add(E+(T?-1:1),f);return+(-(E+(M-V)/(T?V-N:N-V))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:f,y:p,w:h,d,D:m,h:l,m:r,s:a,ms:o,Q:u}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},_="en",S={};S[_]=x;var C="$isDayjsObject",v=function(O){return O instanceof L||!(!O||!O[C])},A=function O(D,M,E){var V;if(!D)return _;if(typeof D=="string"){var T=D.toLowerCase();S[T]&&(V=T),M&&(S[T]=M,V=T);var N=D.split("-");if(!V&&N.length>1)return O(N[0])}else{var W=D.name;S[W]=D,V=W}return!E&&V&&(_=V),V||!E&&_},F=function(O,D){if(v(O))return O.clone();var M=typeof D=="object"?D:{};return M.date=O,M.args=arguments,new L(M)},P=k;P.l=A,P.i=v,P.w=function(O,D){return F(O,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var L=function(){function O(M){this.$L=A(M.locale,null,!0),this.parse(M),this.$x=this.$x||M.x||{},this[C]=!0}var D=O.prototype;return D.parse=function(M){this.$d=function(E){var V=E.date,T=E.utc;if(V===null)return new Date(NaN);if(P.u(V))return new Date;if(V instanceof Date)return new Date(V);if(typeof V=="string"&&!/Z$/i.test(V)){var N=V.match(b);if(N){var W=N[2]-1||0,j=(N[7]||"0").substring(0,3);return T?new Date(Date.UTC(N[1],W,N[3]||1,N[4]||0,N[5]||0,N[6]||0,j)):new Date(N[1],W,N[3]||1,N[4]||0,N[5]||0,N[6]||0,j)}}return new Date(V)}(M),this.init()},D.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()},D.$utils=function(){return P},D.isValid=function(){return this.$d.toString()!==g},D.isSame=function(M,E){var V=F(M);return this.startOf(E)<=V&&V<=this.endOf(E)},D.isAfter=function(M,E){return F(M)<this.startOf(E)},D.isBefore=function(M,E){return this.endOf(E)<F(M)},D.$g=function(M,E,V){return P.u(M)?this[E]:this.set(V,M)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(M,E){var V=this,T=!!P.u(E)||E,N=P.p(M),W=function(ue,ht){var Gt=P.w(V.$u?Date.UTC(V.$y,ht,ue):new Date(V.$y,ht,ue),V);return T?Gt:Gt.endOf(d)},j=function(ue,ht){return P.w(V.toDate()[ue].apply(V.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(ht)),V)},G=this.$W,Q=this.$M,ot=this.$D,yt="set"+(this.$u?"UTC":"");switch(N){case p:return T?W(1,0):W(31,11);case f:return T?W(1,Q):W(0,Q+1);case h:var fe=this.$locale().weekStart||0,nn=(G<fe?G+7:G)-fe;return W(T?ot-nn:ot+(6-nn),Q);case d:case m:return j(yt+"Hours",0);case l:return j(yt+"Minutes",1);case r:return j(yt+"Seconds",2);case a:return j(yt+"Milliseconds",3);default:return this.clone()}},D.endOf=function(M){return this.startOf(M,!1)},D.$set=function(M,E){var V,T=P.p(M),N="set"+(this.$u?"UTC":""),W=(V={},V[d]=N+"Date",V[m]=N+"Date",V[f]=N+"Month",V[p]=N+"FullYear",V[l]=N+"Hours",V[r]=N+"Minutes",V[a]=N+"Seconds",V[o]=N+"Milliseconds",V)[T],j=T===d?this.$D+(E-this.$W):E;if(T===f||T===p){var G=this.clone().set(m,1);G.$d[W](j),G.init(),this.$d=G.set(m,Math.min(this.$D,G.daysInMonth())).$d}else W&&this.$d[W](j);return this.init(),this},D.set=function(M,E){return this.clone().$set(M,E)},D.get=function(M){return this[P.p(M)]()},D.add=function(M,E){var V,T=this;M=Number(M);var N=P.p(E),W=function(Q){var ot=F(T);return P.w(ot.date(ot.date()+Math.round(Q*M)),T)};if(N===f)return this.set(f,this.$M+M);if(N===p)return this.set(p,this.$y+M);if(N===d)return W(1);if(N===h)return W(7);var j=(V={},V[r]=i,V[l]=s,V[a]=e,V)[N]||1,G=this.$d.getTime()+M*j;return P.w(G,this)},D.subtract=function(M,E){return this.add(-1*M,E)},D.format=function(M){var E=this,V=this.$locale();if(!this.isValid())return V.invalidDate||g;var T=M||"YYYY-MM-DDTHH:mm:ssZ",N=P.z(this),W=this.$H,j=this.$m,G=this.$M,Q=V.weekdays,ot=V.months,yt=V.meridiem,fe=function(ht,Gt,sn,Gn){return ht&&(ht[Gt]||ht(E,T))||sn[Gt].slice(0,Gn)},nn=function(ht){return P.s(W%12||12,ht,"0")},ue=yt||function(ht,Gt,sn){var Gn=ht<12?"AM":"PM";return sn?Gn.toLowerCase():Gn};return T.replace(y,function(ht,Gt){return Gt||function(sn){switch(sn){case"YY":return String(E.$y).slice(-2);case"YYYY":return P.s(E.$y,4,"0");case"M":return G+1;case"MM":return P.s(G+1,2,"0");case"MMM":return fe(V.monthsShort,G,ot,3);case"MMMM":return fe(ot,G);case"D":return E.$D;case"DD":return P.s(E.$D,2,"0");case"d":return String(E.$W);case"dd":return fe(V.weekdaysMin,E.$W,Q,2);case"ddd":return fe(V.weekdaysShort,E.$W,Q,3);case"dddd":return Q[E.$W];case"H":return String(W);case"HH":return P.s(W,2,"0");case"h":return nn(1);case"hh":return nn(2);case"a":return ue(W,j,!0);case"A":return ue(W,j,!1);case"m":return String(j);case"mm":return P.s(j,2,"0");case"s":return String(E.$s);case"ss":return P.s(E.$s,2,"0");case"SSS":return P.s(E.$ms,3,"0");case"Z":return N}return null}(ht)||N.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(M,E,V){var T,N=this,W=P.p(E),j=F(M),G=(j.utcOffset()-this.utcOffset())*i,Q=this-j,ot=function(){return P.m(N,j)};switch(W){case p:T=ot()/12;break;case f:T=ot();break;case u:T=ot()/3;break;case h:T=(Q-G)/6048e5;break;case d:T=(Q-G)/864e5;break;case l:T=Q/s;break;case r:T=Q/i;break;case a:T=Q/e;break;default:T=Q}return V?T:P.a(T)},D.daysInMonth=function(){return this.endOf(f).$D},D.$locale=function(){return S[this.$L]},D.locale=function(M,E){if(!M)return this.$L;var V=this.clone(),T=A(M,E,!0);return T&&(V.$L=T),V},D.clone=function(){return P.w(this.$d,this)},D.toDate=function(){return new Date(this.valueOf())},D.toJSON=function(){return this.isValid()?this.toISOString():null},D.toISOString=function(){return this.$d.toISOString()},D.toString=function(){return this.$d.toUTCString()},O}(),U=L.prototype;return F.prototype=U,[["$ms",o],["$s",a],["$m",r],["$H",l],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(O){U[O[1]]=function(D){return this.$g(D,O[0],O[1])}}),F.extend=function(O,D){return O.$i||(O(D,L,F),O.$i=!0),F},F.locale=A,F.isDayjs=v,F.unix=function(O){return F(1e3*O)},F.en=S[_],F.Ls=S,F.p={},F})})(_a);var Ff=_a.exports;const Ft=Af(Ff),Tf={class:"relative"},Lf={class:"w-full"},Nf={class:"flex h-10 justify-between p-2"},Rf={class:"fm-typo-body-lg-400"},$f={class:"flex gap-1 items-center justify-center"},zf={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},If=["onClick"],Wf=c.defineComponent({__name:"FmDatePicker",props:{modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref([]),s=c.ref(null),o=c.ref(!1),a=c.ref(Ft()),r=c.ref(null),l=c.ref(null),d=g=>{s.value=g,t("update:modelValue",g.format("YYYY-MM-DD")),o.value=!1},h=()=>{i.value=[];const g=Ft(a.value).startOf("month"),b=g.endOf("month"),y=g.month();let x=g.startOf("week"),w=[];for(;x.isBefore(b.endOf("week"));)x.day()===0&&w.length>0&&(i.value.push(w),w=[]),w.push({date:x,isCurrentMonth:x.month()===y}),x=x.add(1,"day");w.length>0&&i.value.push(w)},f=()=>{e.disabled||(o.value=!o.value,requestAnimationFrame(()=>{var b;const g=(b=r.value)==null?void 0:b.getBoundingClientRect();l.value.style.top=`${g.height+4}px`,l.value.style.left="0px"}))},u=g=>{const b=g.path||g.composedPath();for(const y of b)if(y==r.value||y==l.value)return;o.value=!1},p=g=>{a.value=g?a.value.add(1,"month"):a.value.subtract(1,"month"),h()},m=c.computed(()=>Array.from(Array(7),(g,b)=>Ft().day(b).format("ddd")));return c.onMounted(()=>{window.addEventListener("click",u),h(),e.modelValue&&(s.value=Ft(e.modelValue,"YYYY-MM-DD"))}),c.onUnmounted(()=>{window.removeEventListener("click",u)}),(g,b)=>{var y;return c.openBlock(),c.createElementBlock("div",Tf,[c.createElementVNode("label",{ref_key:"buttonEl",ref:r,onClick:f},[g.label?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["fm-typo-body-lg-400 mb-4",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},c.toDisplayString(e.label),3)):c.createCommentVNode("",!0),c.createElementVNode("div",{class:c.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[c.createElementVNode("div",{class:c.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"]])},c.toDisplayString(((y=s.value)==null?void 0:y.format("D MMM YYYY"))??"DD MM YYYY"),3)],2)],512),c.createElementVNode("div",{ref_key:"dropdownEl",ref:l,class:c.normalizeClass(["absolute bg-fm-color-white fm-calendar gap-6 p-3 rounded-lg shadow-light-neutral-300 w-[360px]",[o.value?"block":"hidden"]])},[c.createElementVNode("div",Lf,[c.createElementVNode("div",Nf,[c.createElementVNode("div",Rf,c.toDisplayString(a.value.format("MMMM YYYY")),1),c.createElementVNode("div",$f,[c.createVNode(I,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[0]||(b[0]=()=>p(!1))}),c.createVNode(I,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:b[1]||(b[1]=()=>p(!0))})])]),c.createElementVNode("div",null,[c.createElementVNode("div",zf,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m.value,x=>(c.openBlock(),c.createElementBlock("div",{key:x,class:"fm-calendar__cell"},c.toDisplayString(x),1))),128))]),c.createElementVNode("div",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.value,(x,w)=>(c.openBlock(),c.createElementBlock("div",{key:w,class:"fm-calendar__row fm-typo-body-lg-400"},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(x,k=>(c.openBlock(),c.createElementBlock("div",{key:k.date.date(),class:"fm-calendar__cell"},[k.isCurrentMonth?(c.openBlock(),c.createElementBlock("button",{key:0,class:c.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":s.value===k.date}]),onClick:()=>d(k.date)},c.toDisplayString(k.date.date()),11,If)):c.createCommentVNode("",!0)]))),128))]))),128))])])])],2)])}}}),cg="",Hf=it(Wf,[["__scopeId","data-v-1722ccfe"]]),xe=Math.min,ce=Math.max,In=Math.round,Wn=Math.floor,Xt=n=>({x:n,y:n}),jf={left:"right",right:"left",bottom:"top",top:"bottom"},Yf={start:"end",end:"start"};function Wi(n,t,e){return ce(n,xe(t,e))}function Ge(n,t){return typeof n=="function"?n(t):n}function de(n){return n.split("-")[0]}function Je(n){return n.split("-")[1]}function xa(n){return n==="x"?"y":"x"}function Hi(n){return n==="y"?"height":"width"}function Hn(n){return["top","bottom"].includes(de(n))?"y":"x"}function ji(n){return xa(Hn(n))}function Uf(n,t,e){e===void 0&&(e=!1);const i=Je(n),s=ji(n),o=Hi(s);let a=s==="x"?i===(e?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=jn(a)),[a,jn(a)]}function Xf(n){const t=jn(n);return[Yi(n),t,Yi(t)]}function Yi(n){return n.replace(/start|end/g,t=>Yf[t])}function qf(n,t,e){const i=["left","right"],s=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(n){case"top":case"bottom":return e?t?s:i:t?i:s;case"left":case"right":return t?o:a;default:return[]}}function Kf(n,t,e,i){const s=Je(n);let o=qf(de(n),e==="start",i);return s&&(o=o.map(a=>a+"-"+s),t&&(o=o.concat(o.map(Yi)))),o}function jn(n){return n.replace(/left|right|bottom|top/g,t=>jf[t])}function Gf(n){return{top:0,right:0,bottom:0,left:0,...n}}function ka(n){return typeof n!="number"?Gf(n):{top:n,right:n,bottom:n,left:n}}function Yn(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function wa(n,t,e){let{reference:i,floating:s}=n;const o=Hn(t),a=ji(t),r=Hi(a),l=de(t),d=o==="y",h=i.x+i.width/2-s.width/2,f=i.y+i.height/2-s.height/2,u=i[r]/2-s[r]/2;let p;switch(l){case"top":p={x:h,y:i.y-s.height};break;case"bottom":p={x:h,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:f};break;case"left":p={x:i.x-s.width,y:f};break;default:p={x:i.x,y:i.y}}switch(Je(t)){case"start":p[a]-=u*(e&&d?-1:1);break;case"end":p[a]+=u*(e&&d?-1:1);break}return p}const Jf=async(n,t,e)=>{const{placement:i="bottom",strategy:s="absolute",middleware:o=[],platform:a}=e,r=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:n,floating:t,strategy:s}),{x:h,y:f}=wa(d,i,l),u=i,p={},m=0;for(let g=0;g<r.length;g++){const{name:b,fn:y}=r[g],{x,y:w,data:k,reset:_}=await y({x:h,y:f,initialPlacement:i,placement:u,strategy:s,middlewareData:p,rects:d,platform:a,elements:{reference:n,floating:t}});if(h=x??h,f=w??f,p={...p,[b]:{...p[b],...k}},_&&m<=50){m++,typeof _=="object"&&(_.placement&&(u=_.placement),_.rects&&(d=_.rects===!0?await a.getElementRects({reference:n,floating:t,strategy:s}):_.rects),{x:h,y:f}=wa(d,u,l)),g=-1;continue}}return{x:h,y:f,placement:u,strategy:s,middlewareData:p}};async function Sa(n,t){var e;t===void 0&&(t={});const{x:i,y:s,platform:o,rects:a,elements:r,strategy:l}=n,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:u=!1,padding:p=0}=Ge(t,n),m=ka(p),b=r[u?f==="floating"?"reference":"floating":f],y=Yn(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(b)))==null||e?b:b.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(r.floating)),boundary:d,rootBoundary:h,strategy:l})),x=f==="floating"?{...a.floating,x:i,y:s}:a.reference,w=await(o.getOffsetParent==null?void 0:o.getOffsetParent(r.floating)),k=await(o.isElement==null?void 0:o.isElement(w))?await(o.getScale==null?void 0:o.getScale(w))||{x:1,y:1}:{x:1,y:1},_=Yn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:w,strategy:l}):x);return{top:(y.top-_.top+m.top)/k.y,bottom:(_.bottom-y.bottom+m.bottom)/k.y,left:(y.left-_.left+m.left)/k.x,right:(_.right-y.right+m.right)/k.x}}const Zf=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:i,placement:s,rects:o,platform:a,elements:r,middlewareData:l}=t,{element:d,padding:h=0}=Ge(n,t)||{};if(d==null)return{};const f=ka(h),u={x:e,y:i},p=ji(s),m=Hi(p),g=await a.getDimensions(d),b=p==="y",y=b?"top":"left",x=b?"bottom":"right",w=b?"clientHeight":"clientWidth",k=o.reference[m]+o.reference[p]-u[p]-o.floating[m],_=u[p]-o.reference[p],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let C=S?S[w]:0;(!C||!await(a.isElement==null?void 0:a.isElement(S)))&&(C=r.floating[w]||o.floating[m]);const v=k/2-_/2,A=C/2-g[m]/2-1,F=xe(f[y],A),P=xe(f[x],A),L=F,U=C-g[m]-P,O=C/2-g[m]/2+v,D=Wi(L,O,U),M=!l.arrow&&Je(s)!=null&&O!=D&&o.reference[m]/2-(O<L?F:P)-g[m]/2<0,E=M?O<L?O-L:O-U:0;return{[p]:u[p]+E,data:{[p]:D,centerOffset:O-D-E,...M&&{alignmentOffset:E}},reset:M}}}),Ca=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,i;const{placement:s,middlewareData:o,rects:a,initialPlacement:r,platform:l,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...b}=Ge(n,t);if((e=o.arrow)!=null&&e.alignmentOffset)return{};const y=de(s),x=de(r)===r,w=await(l.isRTL==null?void 0:l.isRTL(d.floating)),k=u||(x||!g?[jn(r)]:Xf(r));!u&&m!=="none"&&k.push(...Kf(r,g,m,w));const _=[r,...k],S=await Sa(t,b),C=[];let v=((i=o.flip)==null?void 0:i.overflows)||[];if(h&&C.push(S[y]),f){const L=Uf(s,a,w);C.push(S[L[0]],S[L[1]])}if(v=[...v,{placement:s,overflows:C}],!C.every(L=>L<=0)){var A,F;const L=(((A=o.flip)==null?void 0:A.index)||0)+1,U=_[L];if(U)return{data:{index:L,overflows:v},reset:{placement:U}};let O=(F=v.filter(D=>D.overflows[0]<=0).sort((D,M)=>D.overflows[1]-M.overflows[1])[0])==null?void 0:F.placement;if(!O)switch(p){case"bestFit":{var P;const D=(P=v.map(M=>[M.placement,M.overflows.filter(E=>E>0).reduce((E,V)=>E+V,0)]).sort((M,E)=>M[1]-E[1])[0])==null?void 0:P[0];D&&(O=D);break}case"initialPlacement":O=r;break}if(s!==O)return{reset:{placement:O}}}return{}}}};async function Qf(n,t){const{placement:e,platform:i,elements:s}=n,o=await(i.isRTL==null?void 0:i.isRTL(s.floating)),a=de(e),r=Je(e),l=Hn(e)==="y",d=["left","top"].includes(a)?-1:1,h=o&&l?-1:1,f=Ge(t,n);let{mainAxis:u,crossAxis:p,alignmentAxis:m}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return r&&typeof m=="number"&&(p=r==="end"?m*-1:m),l?{x:p*h,y:u*d}:{x:u*d,y:p*h}}const Ma=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){const{x:e,y:i}=t,s=await Qf(t,n);return{x:e+s.x,y:i+s.y,data:s}}}},tu=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:i,placement:s}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:r={fn:b=>{let{x:y,y:x}=b;return{x:y,y:x}}},...l}=Ge(n,t),d={x:e,y:i},h=await Sa(t,l),f=Hn(de(s)),u=xa(f);let p=d[u],m=d[f];if(o){const b=u==="y"?"top":"left",y=u==="y"?"bottom":"right",x=p+h[b],w=p-h[y];p=Wi(x,p,w)}if(a){const b=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=m+h[b],w=m-h[y];m=Wi(x,m,w)}const g=r.fn({...t,[u]:p,[f]:m});return{...g,data:{x:g.x-e,y:g.y-i}}}}};function qt(n){return Da(n)?(n.nodeName||"").toLowerCase():"#document"}function mt(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function Tt(n){var t;return(t=(Da(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function Da(n){return n instanceof Node||n instanceof mt(n).Node}function Lt(n){return n instanceof Element||n instanceof mt(n).Element}function Ct(n){return n instanceof HTMLElement||n instanceof mt(n).HTMLElement}function va(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof mt(n).ShadowRoot}function Ze(n){const{overflow:t,overflowX:e,overflowY:i,display:s}=bt(n);return/auto|scroll|overlay|hidden|clip/.test(t+i+e)&&!["inline","contents"].includes(s)}function eu(n){return["table","td","th"].includes(qt(n))}function Ui(n){const t=Xi(),e=bt(n);return e.transform!=="none"||e.perspective!=="none"||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","perspective","filter"].some(i=>(e.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(e.contain||"").includes(i))}function nu(n){let t=ke(n);for(;Ct(t)&&!Un(t);){if(Ui(t))return t;t=ke(t)}return null}function Xi(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Un(n){return["html","body","#document"].includes(qt(n))}function bt(n){return mt(n).getComputedStyle(n)}function Xn(n){return Lt(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function ke(n){if(qt(n)==="html")return n;const t=n.assignedSlot||n.parentNode||va(n)&&n.host||Tt(n);return va(t)?t.host:t}function Ea(n){const t=ke(n);return Un(t)?n.ownerDocument?n.ownerDocument.body:n.body:Ct(t)&&Ze(t)?t:Ea(t)}function Qe(n,t,e){var i;t===void 0&&(t=[]),e===void 0&&(e=!0);const s=Ea(n),o=s===((i=n.ownerDocument)==null?void 0:i.body),a=mt(s);return o?t.concat(a,a.visualViewport||[],Ze(s)?s:[],a.frameElement&&e?Qe(a.frameElement):[]):t.concat(s,Qe(s,[],e))}function Ba(n){const t=bt(n);let e=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const s=Ct(n),o=s?n.offsetWidth:e,a=s?n.offsetHeight:i,r=In(e)!==o||In(i)!==a;return r&&(e=o,i=a),{width:e,height:i,$:r}}function qi(n){return Lt(n)?n:n.contextElement}function we(n){const t=qi(n);if(!Ct(t))return Xt(1);const e=t.getBoundingClientRect(),{width:i,height:s,$:o}=Ba(t);let a=(o?In(e.width):e.width)/i,r=(o?In(e.height):e.height)/s;return(!a||!Number.isFinite(a))&&(a=1),(!r||!Number.isFinite(r))&&(r=1),{x:a,y:r}}const iu=Xt(0);function Va(n){const t=mt(n);return!Xi()||!t.visualViewport?iu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function su(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==mt(n)?!1:t}function he(n,t,e,i){t===void 0&&(t=!1),e===void 0&&(e=!1);const s=n.getBoundingClientRect(),o=qi(n);let a=Xt(1);t&&(i?Lt(i)&&(a=we(i)):a=we(n));const r=su(o,e,i)?Va(o):Xt(0);let l=(s.left+r.x)/a.x,d=(s.top+r.y)/a.y,h=s.width/a.x,f=s.height/a.y;if(o){const u=mt(o),p=i&&Lt(i)?mt(i):i;let m=u.frameElement;for(;m&&i&&p!==u;){const g=we(m),b=m.getBoundingClientRect(),y=bt(m),x=b.left+(m.clientLeft+parseFloat(y.paddingLeft))*g.x,w=b.top+(m.clientTop+parseFloat(y.paddingTop))*g.y;l*=g.x,d*=g.y,h*=g.x,f*=g.y,l+=x,d+=w,m=mt(m).frameElement}}return Yn({width:h,height:f,x:l,y:d})}function ou(n){let{rect:t,offsetParent:e,strategy:i}=n;const s=Ct(e),o=Tt(e);if(e===o)return t;let a={scrollLeft:0,scrollTop:0},r=Xt(1);const l=Xt(0);if((s||!s&&i!=="fixed")&&((qt(e)!=="body"||Ze(o))&&(a=Xn(e)),Ct(e))){const d=he(e);r=we(e),l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}return{width:t.width*r.x,height:t.height*r.y,x:t.x*r.x-a.scrollLeft*r.x+l.x,y:t.y*r.y-a.scrollTop*r.y+l.y}}function au(n){return Array.from(n.getClientRects())}function Pa(n){return he(Tt(n)).left+Xn(n).scrollLeft}function ru(n){const t=Tt(n),e=Xn(n),i=n.ownerDocument.body,s=ce(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=ce(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-e.scrollLeft+Pa(n);const r=-e.scrollTop;return bt(i).direction==="rtl"&&(a+=ce(t.clientWidth,i.clientWidth)-s),{width:s,height:o,x:a,y:r}}function lu(n,t){const e=mt(n),i=Tt(n),s=e.visualViewport;let o=i.clientWidth,a=i.clientHeight,r=0,l=0;if(s){o=s.width,a=s.height;const d=Xi();(!d||d&&t==="fixed")&&(r=s.offsetLeft,l=s.offsetTop)}return{width:o,height:a,x:r,y:l}}function cu(n,t){const e=he(n,!0,t==="fixed"),i=e.top+n.clientTop,s=e.left+n.clientLeft,o=Ct(n)?we(n):Xt(1),a=n.clientWidth*o.x,r=n.clientHeight*o.y,l=s*o.x,d=i*o.y;return{width:a,height:r,x:l,y:d}}function Oa(n,t,e){let i;if(t==="viewport")i=lu(n,e);else if(t==="document")i=ru(Tt(n));else if(Lt(t))i=cu(t,e);else{const s=Va(n);i={...t,x:t.x-s.x,y:t.y-s.y}}return Yn(i)}function Aa(n,t){const e=ke(n);return e===t||!Lt(e)||Un(e)?!1:bt(e).position==="fixed"||Aa(e,t)}function du(n,t){const e=t.get(n);if(e)return e;let i=Qe(n,[],!1).filter(r=>Lt(r)&&qt(r)!=="body"),s=null;const o=bt(n).position==="fixed";let a=o?ke(n):n;for(;Lt(a)&&!Un(a);){const r=bt(a),l=Ui(a);!l&&r.position==="fixed"&&(s=null),(o?!l&&!s:!l&&r.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Ze(a)&&!l&&Aa(n,a))?i=i.filter(h=>h!==a):s=r,a=ke(a)}return t.set(n,i),i}function hu(n){let{element:t,boundary:e,rootBoundary:i,strategy:s}=n;const a=[...e==="clippingAncestors"?du(t,this._c):[].concat(e),i],r=a[0],l=a.reduce((d,h)=>{const f=Oa(t,h,s);return d.top=ce(f.top,d.top),d.right=xe(f.right,d.right),d.bottom=xe(f.bottom,d.bottom),d.left=ce(f.left,d.left),d},Oa(t,r,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function fu(n){return Ba(n)}function uu(n,t,e){const i=Ct(t),s=Tt(t),o=e==="fixed",a=he(n,!0,o,t);let r={scrollLeft:0,scrollTop:0};const l=Xt(0);if(i||!i&&!o)if((qt(t)!=="body"||Ze(s))&&(r=Xn(t)),i){const d=he(t,!0,o,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else s&&(l.x=Pa(s));return{x:a.left+r.scrollLeft-l.x,y:a.top+r.scrollTop-l.y,width:a.width,height:a.height}}function Fa(n,t){return!Ct(n)||bt(n).position==="fixed"?null:t?t(n):n.offsetParent}function Ta(n,t){const e=mt(n);if(!Ct(n))return e;let i=Fa(n,t);for(;i&&eu(i)&&bt(i).position==="static";)i=Fa(i,t);return i&&(qt(i)==="html"||qt(i)==="body"&&bt(i).position==="static"&&!Ui(i))?e:i||nu(n)||e}const pu=async function(n){let{reference:t,floating:e,strategy:i}=n;const s=this.getOffsetParent||Ta,o=this.getDimensions;return{reference:uu(t,await s(e),i),floating:{x:0,y:0,...await o(e)}}};function mu(n){return bt(n).direction==="rtl"}const gu={convertOffsetParentRelativeRectToViewportRelativeRect:ou,getDocumentElement:Tt,getClippingRect:hu,getOffsetParent:Ta,getElementRects:pu,getClientRects:au,getDimensions:fu,getScale:we,isElement:Lt,isRTL:mu};function bu(n,t){let e=null,i;const s=Tt(n);function o(){clearTimeout(i),e&&e.disconnect(),e=null}function a(r,l){r===void 0&&(r=!1),l===void 0&&(l=1),o();const{left:d,top:h,width:f,height:u}=n.getBoundingClientRect();if(r||t(),!f||!u)return;const p=Wn(h),m=Wn(s.clientWidth-(d+f)),g=Wn(s.clientHeight-(h+u)),b=Wn(d),x={rootMargin:-p+"px "+-m+"px "+-g+"px "+-b+"px",threshold:ce(0,xe(1,l))||1};let w=!0;function k(_){const S=_[0].intersectionRatio;if(S!==l){if(!w)return a();S?a(!1,S):i=setTimeout(()=>{a(!1,1e-7)},100)}w=!1}try{e=new IntersectionObserver(k,{...x,root:s.ownerDocument})}catch{e=new IntersectionObserver(k,x)}e.observe(n)}return a(!0),o}function yu(n,t,e,i){i===void 0&&(i={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:r=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,d=qi(n),h=s||o?[...d?Qe(d):[],...Qe(t)]:[];h.forEach(y=>{s&&y.addEventListener("scroll",e,{passive:!0}),o&&y.addEventListener("resize",e)});const f=d&&r?bu(d,e):null;let u=-1,p=null;a&&(p=new ResizeObserver(y=>{let[x]=y;x&&x.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{p&&p.observe(t)})),e()}),d&&!l&&p.observe(d),p.observe(t));let m,g=l?he(n):null;l&&b();function b(){const y=he(n);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&e(),g=y,m=requestAnimationFrame(b)}return e(),()=>{h.forEach(y=>{s&&y.removeEventListener("scroll",e),o&&y.removeEventListener("resize",e)}),f&&f(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(m)}}const La=(n,t,e)=>{const i=new Map,s={platform:gu,...e},o={...s.platform,_c:i};return Jf(n,t,{...s,platform:o})};function Ki(n){var t;return(t=n==null?void 0:n.$el)!=null?t:n}function _u(n){return{name:"arrow",options:n,fn(t){const e=Ki(c.unref(n.element));return e==null?{}:Zf({element:e,padding:n.padding}).fn(t)}}}function Na(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ra(n,t){const e=Na(n);return Math.round(t*e)/e}function xu(n,t,e){e===void 0&&(e={});const i=e.whileElementsMounted,s=c.computed(()=>{var C;return(C=c.unref(e.open))!=null?C:!0}),o=c.computed(()=>c.unref(e.middleware)),a=c.computed(()=>{var C;return(C=c.unref(e.placement))!=null?C:"bottom"}),r=c.computed(()=>{var C;return(C=c.unref(e.strategy))!=null?C:"absolute"}),l=c.computed(()=>{var C;return(C=c.unref(e.transform))!=null?C:!0}),d=c.computed(()=>Ki(n.value)),h=c.computed(()=>Ki(t.value)),f=c.ref(0),u=c.ref(0),p=c.ref(r.value),m=c.ref(a.value),g=c.shallowRef({}),b=c.ref(!1),y=c.computed(()=>{const C={position:p.value,left:"0",top:"0"};if(!h.value)return C;const v=Ra(h.value,f.value),A=Ra(h.value,u.value);return l.value?{...C,transform:"translate("+v+"px, "+A+"px)",...Na(h.value)>=1.5&&{willChange:"transform"}}:{position:p.value,left:v+"px",top:A+"px"}});let x;function w(){d.value==null||h.value==null||La(d.value,h.value,{middleware:o.value,placement:a.value,strategy:r.value}).then(C=>{f.value=C.x,u.value=C.y,p.value=C.strategy,m.value=C.placement,g.value=C.middlewareData,b.value=!0})}function k(){typeof x=="function"&&(x(),x=void 0)}function _(){if(k(),i===void 0){w();return}if(d.value!=null&&h.value!=null){x=i(d.value,h.value,w);return}}function S(){s.value||(b.value=!1)}return c.watch([o,a,r],w,{flush:"sync"}),c.watch([d,h],_,{flush:"sync"}),c.watch(s,S,{flush:"sync"}),c.getCurrentScope()&&c.onScopeDispose(k),{x:c.shallowReadonly(f),y:c.shallowReadonly(u),strategy:c.shallowReadonly(p),placement:c.shallowReadonly(m),middlewareData:c.shallowReadonly(g),isPositioned:c.shallowReadonly(b),floatingStyles:y,update:w}}function ku(n){for(;n;){if(wu(n))return n;n=n.parentElement}return document.scrollingElement}function wu(n){if(!n||n.nodeType!==Node.ELEMENT_NODE)return!1;const t=window.getComputedStyle(n);return t.overflowY==="scroll"||t.overflowY==="auto"&&n.scrollHeight>n.clientHeight}class Su{constructor(t,e){B(this,"onScroll");B(this,"scrollParent");this.onScroll=e,this.scrollParent=ku(t)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const Cu={class:"fm-menu__wrapper"},Mu=c.defineComponent({__name:"FmMenu",props:{showMenu:{type:Boolean,default:!1},placement:{default:"bottom-start"},disabled:{type:Boolean,default:!1}},emits:["dropdown-changed"],setup(n,{expose:t,emit:e}){const i=n,s=c.ref(!1),o=c.ref(null),a=c.ref(null),{floatingStyles:r}=xu(o,a,{middleware:[Ma(4),Ca()],placement:i.placement,whileElementsMounted:yu});let l;t({show:()=>{s.value||(s.value=!0,e("dropdown-changed",s.value))},hide:()=>{s.value&&(s.value=!1,e("dropdown-changed",s.value))}});const d=()=>{i.disabled||(s.value=!s.value,e("dropdown-changed",s.value))},h=u=>{if(!s.value)return;const p=u.path||u.composedPath();for(const m of p)if(m==o.value||m==a.value)return;s.value=!1,e("dropdown-changed",s.value)},f=()=>{e("dropdown-changed",!1)};return c.watch(()=>i.showMenu,u=>s.value=u),c.onMounted(()=>{s.value=i.showMenu,window.addEventListener("click",h),l=new Su(o.value,f),l.bindScroll()}),c.onUnmounted(()=>{window.removeEventListener("click",h),l.unbindScroll()}),(u,p)=>(c.openBlock(),c.createElementBlock("div",null,[c.createElementVNode("div",{ref_key:"anchorEl",ref:o,class:"fm-menu",onClick:d},[c.renderSlot(u.$slots,"menu-button",{},void 0,!0)],512),s.value?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"menuEl",ref:a,class:c.normalizeClass({"fm-menu__content":!0,"fm-menu__content--opened":s.value}),style:c.normalizeStyle(c.unref(r))},[c.renderSlot(u.$slots,"menu-wrapper",{},()=>[c.createElementVNode("div",Cu,[c.renderSlot(u.$slots,"menu-content",{},void 0,!0)])],!0)],6)):c.createCommentVNode("",!0)]))}}),dg="",qn=it(Mu,[["__scopeId","data-v-02f0b378"]]),Du=n=>(c.pushScopeId("data-v-b8640c84"),n=n(),c.popScopeId(),n),vu={class:"flex gap-1 items-center relative w-full"},Eu={ref:"startButtonEl",class:"w-full"},Bu=Du(()=>c.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)),Vu={ref:"endButtonEl",class:"w-full"},Pu={class:"fm-calendar gap-6 p-3 rounded-lg shadow-light-300 w-[360px]"},Ou={class:"w-full"},Au={class:"flex h-10 justify-between p-2"},Fu={class:"fm-typo-body-lg-400"},Tu={class:"flex gap-1 items-center justify-center"},Lu={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Nu=["onClick"],Ru=c.defineComponent({__name:"FmDateRangePicker",props:{modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref([]),s=c.ref({startDate:null,endDate:null}),o=c.ref(!1),a=c.ref(Ft()),r=u=>{var p,m;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=u;else if(u.isBefore(s.value.startDate)){const g=s.value.startDate;s.value={startDate:u,endDate:g}}else s.value.endDate=u;t("update:modelValue",{startDate:(p=s.value.startDate)==null?void 0:p.format("YYYY-MM-DD"),endDate:(m=s.value.endDate)==null?void 0:m.format("YYYY-MM-DD")}),s.value.startDate&&s.value.endDate&&(o.value=!1)},l=()=>{i.value=[];const u=Ft(a.value).startOf("month"),p=u.endOf("month"),m=u.month();let g=u.startOf("week"),b=[];for(;g.isBefore(p.endOf("week"));)g.day()===0&&b.length>0&&(i.value.push(b),b=[]),b.push({date:g,isCurrentMonth:g.month()===m}),g=g.add(1,"day");b.length>0&&i.value.push(b)},d=u=>{a.value=u?a.value.add(1,"month"):a.value.subtract(1,"month"),l()},h=c.computed(()=>Array.from(Array(7),(u,p)=>Ft().day(p).format("ddd"))),f=u=>{var p,m,g,b;return{"fm-calendar__cell__button--selected":((p=s.value.startDate)==null?void 0:p.isSame(u))&&!s.value.endDate||((m=s.value.endDate)==null?void 0:m.isSame(u))&&!s.value.startDate,"fm-calendar__cell__button--selected-start":((g=s.value.startDate)==null?void 0:g.isSame(u))&&s.value.endDate,"fm-calendar__cell__button--selected-end":((b=s.value.endDate)==null?void 0:b.isSame(u))&&s.value.startDate,"fm-calendar__cell__button--selected-between":s.value.startDate&&s.value.endDate&&u.isAfter(s.value.startDate)&&u.isBefore(s.value.endDate)}};return c.onMounted(()=>{var u;l(),(u=e.modelValue)!=null&&u.startDate&&e.modelValue.endDate&&(s.value={startDate:Ft(e.modelValue.startDate,"YYYY-MM-DD"),endDate:Ft(e.modelValue.endDate,"YYYY-MM-DD")})}),(u,p)=>(c.openBlock(),c.createBlock(qn,{"show-menu":o.value,disabled:u.disabled,onDropdownChanged:p[2]||(p[2]=m=>o.value=m)},{"menu-button":c.withCtx(()=>{var m,g;return[c.createElementVNode("div",vu,[c.createElementVNode("label",Eu,[c.createElementVNode("div",{class:c.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},c.toDisplayString(e.label),3),c.createElementVNode("div",{class:c.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[c.createElementVNode("div",{class:c.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"]])},c.toDisplayString(((m=s.value.startDate)==null?void 0:m.format("D MMM YYYY"))??"DD MM YYYY"),3)],2)],512),Bu,c.createElementVNode("label",Vu,[c.createElementVNode("div",{class:c.normalizeClass(["fm-typo-body-lg-400",[e.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},c.toDisplayString(e.label),3),c.createElementVNode("div",{class:c.normalizeClass(["fm-date-picker__container",{"fm-date-picker__container--opened":o.value,"fm-date-picker__container--disabled":e.disabled}])},[c.createElementVNode("div",{class:c.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"]])},c.toDisplayString(((g=s.value.endDate)==null?void 0:g.format("D MMM YYYY"))??"DD MM YYYY"),3)],2)],512)])]}),"menu-wrapper":c.withCtx(()=>[c.createElementVNode("div",Pu,[c.createElementVNode("div",Ou,[c.createElementVNode("div",Au,[c.createElementVNode("div",Fu,c.toDisplayString(a.value.format("MMMM YYYY")),1),c.createElementVNode("div",Tu,[c.createVNode(I,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:p[0]||(p[0]=()=>d(!1))}),c.createVNode(I,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:p[1]||(p[1]=()=>d(!0))})])]),c.createElementVNode("div",null,[c.createElementVNode("div",Lu,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(h.value,m=>(c.openBlock(),c.createElementBlock("div",{key:m,class:"fm-calendar__cell"},c.toDisplayString(m),1))),128))]),c.createElementVNode("div",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.value,(m,g)=>(c.openBlock(),c.createElementBlock("div",{key:g,class:"fm-calendar__row fm-typo-body-lg-400"},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(m,b=>(c.openBlock(),c.createElementBlock("div",{key:b.date.date(),class:"fm-calendar__cell"},[b.isCurrentMonth?(c.openBlock(),c.createElementBlock("button",{key:0,class:c.normalizeClass(["fm-calendar__cell__button",f(b.date)]),onClick:()=>r(b.date)},c.toDisplayString(b.date.date()),11,Nu)):c.createCommentVNode("",!0)]))),128))]))),128))])])])])]),_:1},8,["show-menu","disabled"]))}}),hg="",$u=it(Ru,[["__scopeId","data-v-b8640c84"]]),zu={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Iu={class:"flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse"},Wu=c.defineComponent({__name:"FmDialog",props:{modelValue:{type:Boolean,default:!1},overlay:{type:Boolean,default:!0},minWidth:{default:280},closeButton:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref(null),s=o=>{e.overlay&&i.value&&o.target===i.value&&t("update:modelValue",!1)};return(o,a)=>(c.openBlock(),c.createBlock(c.Transition,null,{default:c.withCtx(()=>[o.modelValue?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:i,class:c.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":o.overlay}),onClick:a[1]||(a[1]=r=>s(r))},[c.createElementVNode("div",{class:c.normalizeClass(`fm-dialog min-w-[${o.minWidth}px]`)},[c.createElementVNode("div",zu,[c.renderSlot(o.$slots,"dialog-header"),o.closeButton?(c.openBlock(),c.createBlock(I,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:a[0]||(a[0]=r=>t("update:modelValue",!1))})):c.createCommentVNode("",!0)]),c.renderSlot(o.$slots,"dialog-content"),c.createElementVNode("div",Iu,[c.renderSlot(o.$slots,"dialog-footer")])],2)],2)):c.createCommentVNode("",!0)]),_:3}))}}),fg="",Hu={class:"fm-drop-field"},ju=["accept","disabled"],Yu=c.defineComponent({__name:"FmDropField",props:{label:{default:""},disabled:{type:Boolean,default:!1},accept:{default:""},maxFileSize:{default:8e6}},emits:["file-upload","file-rejected"],setup(n,{emit:t}){const e=n,i=c.ref(!1),s=c.ref(),o=c.ref(),a=c.ref(),r=k=>{e.disabled||(k.stopPropagation(),k.preventDefault())},l=k=>{e.disabled||(k.stopPropagation(),k.preventDefault(),i.value=!0)},d=k=>{e.disabled||(k.stopPropagation(),k.preventDefault(),i.value=!1)},h=k=>{e.disabled||(k.stopPropagation(),k.preventDefault(),i.value=!1,f(k))},f=k=>{var S;a.value=((S=k.dataTransfer)==null?void 0:S.files)??k.target.files;const _=a.value;if(s.value=p(_[0]),o.value=m(_[0]),s.value&&o.value)t("file-upload",_[0]);else{const C=u();t("file-rejected",[{file:_[0],reason:C}])}},u=()=>{const k=[];return s.value||k.push("invalid-type"),o.value||k.push("invalid-size"),k},p=k=>{if(!e.accept)return!0;const _=e.accept.split(",").map(S=>S.trim());for(const S of _)if(g(S)){if(y(S)===y(k.type))return!0}else if(b(k)===S||k.type===S)return!0;return!1},m=k=>k.size<=e.maxFileSize,g=k=>k.indexOf("*")!==-1,b=k=>"."+k.name.split(".").pop(),y=k=>k.substring(0,k.indexOf("/")),x=c.computed(()=>{if(i.value)return"Drop file to upload";if(s.value){if(!o.value)return`File size exceeds ${e.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),w=c.computed(()=>a.value?!s.value||!o.value:!1);return(k,_)=>(c.openBlock(),c.createElementBlock("label",Hu,[c.renderSlot(k.$slots,"label",{},()=>[c.createElementVNode("div",{class:c.normalizeClass(["fm-typo-body-lg-400",[k.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},c.toDisplayString(k.label),3)],!0),c.createElementVNode("div",{class:c.normalizeClass(["fm-drop-field__container",{"fm-drop-field__container--dragging":i.value,"fm-drop-field__container--invalid":w.value&&!k.disabled,"fm-drop-field__container--disabled":k.disabled}]),onDragenter:r,onDragover:l,onDragleave:d,onDrop:h},[(i.value||w.value)&&!k.disabled?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass({"fm-typo-body-lg-700":!0,"text-fm-color-primary":i.value,"text-fm-color-typo-error":w.value})},c.toDisplayString(x.value),3)):(c.openBlock(),c.createBlock(Rt,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:k.disabled},null,8,["disabled"])),c.renderSlot(k.$slots,"accept-text",{},()=>[e.accept?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["fm-typo-body-md-400",[k.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},c.toDisplayString(`Accepts ${e.accept}`),3)):c.createCommentVNode("",!0)],!0),c.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:k.accept,disabled:k.disabled,onChange:f},null,40,ju)],34),c.renderSlot(k.$slots,"helper-text",{},()=>[c.createElementVNode("div",{class:c.normalizeClass(["fm-typo-body-sm-400",[k.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},c.toDisplayString(`Max size ${e.maxFileSize*1e-6}mb`),3)],!0)]))}}),ug="",Uu=it(Yu,[["__scopeId","data-v-31c17193"]]),Xu={},qu={class:"flex-grow"};function Ku(n,t){return c.openBlock(),c.createElementBlock("div",qu)}const $a=it(Xu,[["render",Ku]]),za=Symbol.for("fm:form"),Ia=Symbol.for("fm:radio-group"),Wa=Symbol.for("fm:stepper"),Ha=Symbol.for("fm:dialog"),Gu={install:n=>{const t={open:e=>{const i={primary:[],secondary:[],tertiary:[]},s={onPrimary:d=>(i.primary.push(d),s),onSecondary:d=>(i.secondary.push(d),s),onTertiary:d=>(i.tertiary.push(d),s)};function o(){a&&c.render(null,a),a=null,l=null}let a=document.createElement("div");document.body.appendChild(a);const r=c.markRaw(ja);let l=c.createVNode(r,{...e,unmount:o,storedFunctions:i});return l.appContext=n._context,c.render(l,a),s}};n.config.globalProperties.$dialog=t,n.provide(Ha,t)}},Ju={key:0,class:"block"},Zu={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Qu={class:"fm-typo-title-md-700 text-fm-color-typo-primary"},tp={key:0,class:"overflow-y-auto"},ep={key:1,class:"fm-typo-body-md-400 overflow-y-auto text-fm-color-neutral-black"},np={class:"flex gap-8 items-center justify-end sm:flex-col-reverse xs:flex-col-reverse"},ja=c.defineComponent({__name:"FmDynamicDialog",props:{title:{},message:{},primaryActions:{default:null},secondaryActions:{default:null},tertiaryActions:{default:null},overlay:{type:Boolean,default:!0},closeButton:{type:Boolean,default:!0},minWidth:{default:280},dialogComponent:{default:null},contentComponent:{default:null},dialogComponentProps:{},contentComponentProps:{},unmount:{},storedFunctions:{}},emits:["dialog-opened","dialog-closed"],setup(n,{emit:t}){const e=n,i=c.ref(!0),s=c.ref(null),o=()=>{e.overlay&&(e.unmount(),t("dialog-closed"))},a=l=>{s.value&&l.target===s.value&&o()},r=(l,d)=>{e.storedFunctions[d].forEach(h=>h()),l.close&&o()};return c.onMounted(()=>{t("dialog-opened")}),(l,d)=>(c.openBlock(),c.createBlock(c.Transition,null,{default:c.withCtx(()=>[i.value?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:s,class:c.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":l.overlay}),onClick:a},[l.dialogComponent?(c.openBlock(),c.createElementBlock("div",Ju,[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(l.dialogComponent),c.normalizeProps(c.guardReactiveProps(l.dialogComponentProps)),null,16))])):(c.openBlock(),c.createElementBlock("div",{key:1,class:"fm-dialog",style:c.normalizeStyle({"min-width":`${e.minWidth}px`})},[c.createElementVNode("div",Zu,[c.createElementVNode("div",Qu,c.toDisplayString(l.title),1),l.closeButton?(c.openBlock(),c.createBlock(I,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:o})):c.createCommentVNode("",!0)]),l.contentComponent?(c.openBlock(),c.createElementBlock("div",tp,[(c.openBlock(),c.createBlock(c.resolveDynamicComponent(l.contentComponent),c.normalizeProps(c.guardReactiveProps(l.contentComponentProps)),null,16))])):(c.openBlock(),c.createElementBlock("div",ep,c.toDisplayString(l.message),1)),c.createElementVNode("div",np,[l.tertiaryActions?(c.openBlock(),c.createBlock(Rt,{key:0,class:"sm:w-full xs:w-full",variant:"tertiary",label:l.tertiaryActions.text,size:"md",onClick:d[0]||(d[0]=h=>r(l.tertiaryActions,"tertiary"))},null,8,["label"])):c.createCommentVNode("",!0),c.createVNode($a,{class:"sm:hidden xs:hidden"}),l.secondaryActions?(c.openBlock(),c.createBlock(Rt,{key:1,class:"sm:w-full xs:w-full",variant:"secondary",label:l.secondaryActions.text,size:"md",onClick:d[1]||(d[1]=h=>r(l.secondaryActions,"secondary"))},null,8,["label"])):c.createCommentVNode("",!0),l.primaryActions?(c.openBlock(),c.createBlock(Rt,{key:2,class:"sm:w-full xs:w-full",variant:"primary",label:l.primaryActions.text,size:"md",onClick:d[2]||(d[2]=h=>r(l.primaryActions,"primary"))},null,8,["label"])):c.createCommentVNode("",!0)])],4))],2)):c.createCommentVNode("",!0)]),_:1}))}}),pg="",ip={class:"fm-checkbox"},sp={class:"fm-checkbox--wrapper"},op={class:"fm-checkbox__input--container"},ap=["checked","disabled","indeterminate"],rp={key:0,class:"fm-checkbox__label-container"},lp={class:"fm-typo-body-lg-400"},cp={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Ya=c.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=c.computed(()=>e.indeterminate?"remove":e.modelValue?"check_small":"");function s(){e.disabled||t("update:modelValue",!e.modelValue)}return(o,a)=>(c.openBlock(),c.createElementBlock("div",ip,[c.createElementVNode("label",sp,[c.createElementVNode("div",op,[c.createElementVNode("input",{class:c.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,ap),e.indeterminate||e.modelValue?(c.openBlock(),c.createBlock(I,{key:0,class:"fm-checkbox__input--checkmark",name:i.value,size:"md",color:"#FFFFFF"},null,8,["name"])):c.createCommentVNode("",!0)]),e.label?(c.openBlock(),c.createElementBlock("div",rp,[c.renderSlot(o.$slots,"label"),c.createElementVNode("div",lp,c.toDisplayString(e.label),1),e.sublabel?(c.openBlock(),c.createElementBlock("div",cp,c.toDisplayString(e.sublabel),1)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0)])]))}}),mg="",dp={class:"w-full"},hp=c.defineComponent({__name:"FmField",props:{leadingIcon:{default:""},trailingIcon:{default:""},activeClass:{default:""},disabled:{type:Boolean,default:!1},iconColor:{default:"black"}},setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass({"fm-field":!0,"fm-field--disabled":t.disabled,activeClass:t.activeClass})},[c.createVNode(I,{name:t.leadingIcon,size:"md",color:t.disabled?"disabled":t.iconColor},null,8,["name","color"]),c.createElementVNode("div",dp,[c.renderSlot(t.$slots,"default",{},void 0,!0)]),c.createVNode(I,{name:t.trailingIcon,size:"md",color:t.disabled?"disabled":t.iconColor},null,8,["name","color"])],2))}}),gg="",Ua=it(hp,[["__scopeId","data-v-fae4e7ce"]]),fp=["onSubmit","onReset"],up=c.defineComponent({__name:"FmForm",emits:["validation-reset","validation-success","validation-failed","reset"],setup(n,{expose:t,emit:e}){const i=c.ref([]),s=c.ref(0),o=()=>{let l=[];for(let d=0;d<i.value.length;d++){const h=i.value[d];l=[...l,...h.validate()]}l.length?e("validation-failed",l):e("validation-success")},a=()=>{for(let l=0;l<i.value.length;l++){const d=i.value[l];d.resetValue(),d.resetValidation()}e("reset")};return t({validateInputs:o,resetInputsValidation:()=>{for(let l=0;l<i.value.length;l++)i.value[l].resetValidation();e("validation-reset")}}),c.provide(za,{register({validate:l,resetValidation:d,resetValue:h}){return i.value.push({componentId:s.value,validate:l,resetValidation:d,resetValue:h}),s.value++},unregister(l){i.value.filter(d=>d.componentId!==l)}}),(l,d)=>(c.openBlock(),c.createElementBlock("form",{onSubmit:c.withModifiers(o,["prevent"]),onReset:c.withModifiers(a,["prevent"])},[c.renderSlot(l.$slots,"default")],40,fp))}}),pp={class:"fm-radio-btn"},mp={class:"fm-radio-btn__input--container"},gp=["value","disabled","checked"],bp={class:"py-8"},yp={class:"fm-typo-body-lg-400"},_p={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},xp=c.defineComponent({__name:"FmRadio",props:{modelValue:{default:null},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref(),s=c.inject(Ia,null),o=()=>{r.value||(s?s.updateValue(e.value):t("update:modelValue",e.value))},a=()=>{i.value&&s&&(i.value.checked=s.groupValue.value===e.value)};c.onMounted(()=>{s&&s.register(a)});const r=c.computed(()=>s?s.getDisabled():e.disabled);return(l,d)=>{const h=c.resolveDirective("wave");return c.openBlock(),c.createElementBlock("div",pp,[c.createElementVNode("label",{class:c.normalizeClass({"fm-radio-btn--wrapper":!0,"cursor-not-allowed text-fm-color-typo-disabled":r.value,"cursor-pointer":!r.value}),onClick:o},[c.withDirectives((c.openBlock(),c.createElementBlock("div",mp,[c.createElementVNode("input",{ref_key:"inputEl",ref:i,class:"fm-radio-btn__input--btn",type:"radio",value:l.value,disabled:r.value,checked:l.value===l.modelValue},null,8,gp)])),[[h,!r.value]]),c.createElementVNode("div",bp,[c.renderSlot(l.$slots,"label",{},()=>[c.createElementVNode("div",yp,c.toDisplayString(l.label),1),l.sublabel?(c.openBlock(),c.createElementBlock("div",_p,c.toDisplayString(l.sublabel),1)):c.createCommentVNode("",!0)],!0)])],2)])}}}),bg="",kp=it(xp,[["__scopeId","data-v-94f94580"]]);function tn(n,t,e,i=null,s=null){const o=c.ref(),a=c.inject(za,null),r=c.ref(!0),l=(d=s)=>{r.value=!0,t(),d&&typeof d=="function"&&d(),e("update:modelValue",i)};return c.onMounted(()=>{a&&(o.value=a.register({validate:n,resetValidation:t,resetValue:l}))}),c.onUnmounted(()=>{a&&a.unregister(o.value)}),{isPristine:r,resetValue:l}}function en(n){const t=c.ref([]),e=c.ref();function i(){const a=[];if(n.rules&&n.rules.length>0)for(const r of n.rules){const d=(typeof r=="function"?r:()=>r)(e.value);d!==!0&&a.push(d)}return t.value=a,t.value}function s(){t.value=[]}function o(a){e.value=a}return{validate:i,resetValidation:s,errorMessages:t,setValidationValue:o}}const wp={class:"fm-text-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},Sp={key:0},Cp={key:1},Mp=c.defineComponent({__name:"FmRadioGroup",props:{modelValue:{},inline:{type:Boolean,default:!1},helperText:{default:""},disabled:{type:Boolean,default:!1},label:{},rules:{default:()=>[n=>!!n||"This field is required"]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref(),s=c.ref([]),o=()=>{i.value=null,s.value.forEach(f=>f())},{validate:a,errorMessages:r,resetValidation:l,setValidationValue:d}=en(e),{isPristine:h}=tn(a,l,t,"",o);return c.provide(Ia,{groupValue:i,getDisabled:()=>e.disabled,register(f){s.value.push(f)},updateValue(f){i.value=f,s.value.forEach(u=>u()),t("update:modelValue",f)}}),c.watch(()=>e.modelValue,()=>{h.value=!1,i.value=e.modelValue,s.value.forEach(f=>f())}),c.onMounted(()=>{d(e.modelValue)}),(f,u)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass({"flex items-center gap-16 justify-start":f.inline})},[c.renderSlot(f.$slots,"default"),c.createElementVNode("div",wp,[c.unref(r).length===0?(c.openBlock(),c.createElementBlock("div",Sp,[c.renderSlot(f.$slots,"helper-text",{},()=>[c.createTextVNode(c.toDisplayString(f.helperText),1)])])):(c.openBlock(),c.createElementBlock("div",Cp,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(r),p=>(c.openBlock(),c.createElementBlock("div",{key:p,class:"flex gap-4 items-center text-fm-color-typo-error"},[c.createVNode(I,{name:"error",color:"#FF3B30",size:"sm"}),c.createElementVNode("span",null,c.toDisplayString(p),1)]))),128))]))])],2))}}),Dp={class:"fm-menu-item--left"},vp={key:0,class:"fm-menu-item--right"},Ep=c.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)=>(c.openBlock(),c.createElementBlock("div",null,[c.createElementVNode("div",{class:c.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":o.modelValue&&!o.hasCheckbox,"fm-menu-item--disabled":o.disabled}),onClick:i},[c.createElementVNode("div",Dp,[!o.hasCheckbox&&o.icon?(c.openBlock(),c.createBlock(I,{key:0,name:o.icon,size:"md",color:o.disabled?"#C7C7CC":o.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","color"])):c.createCommentVNode("",!0),o.hasCheckbox?(c.openBlock(),c.createBlock(Ya,{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"])):c.createCommentVNode("",!0),c.renderSlot(o.$slots,"label",{},()=>[c.createElementVNode("div",null,[c.createElementVNode("div",{class:c.normalizeClass(`fm-typo-body-lg-400 ${o.disabled?"fm-color-typo-disabled":"fm-color-typo-primary"}`)},c.toDisplayString(o.label),3),o.sublabel?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(`fm-typo-body-md-400 ${o.disabled?"fm-color-typo-disabled":"fm-color-typo-secondary"}`)},c.toDisplayString(o.sublabel),3)):c.createCommentVNode("",!0)])],!0)]),o.expandable?(c.openBlock(),c.createElementBlock("div",vp,[c.createVNode(I,{name:"chevron_right",size:"md",color:o.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):c.createCommentVNode("",!0)],2)]))}}),yg="",Xa=it(Ep,[["__scopeId","data-v-94ed27b3"]]),Bp={class:"w-[280px]"},Vp=c.defineComponent({__name:"FmSelect",props:{modelValue:{},label:{},items:{},disabled:{type:Boolean,default:!1},multiselect:{type:Boolean,default:!1},placement:{default:"bottom-start"},placeholder:{default:""}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref(!1),s=(l,d)=>{if(e.multiselect){let h=[];l?h=[...c.toRaw(e.modelValue),d.value]:(h=[...e.modelValue],h=h.filter(f=>JSON.stringify(c.toRaw(f))!==JSON.stringify(d.value))),t("update:modelValue",h)}else i.value=!1,t("update:modelValue",d.value)},o=c.computed(()=>{const l=a.value.map(d=>d.label).join(", ");return l===""?e.placeholder:l}),a=c.computed(()=>e.multiselect?e.items.filter(l=>c.toRaw(e.modelValue).some(d=>r(d,l.value))):e.items.filter(l=>r(e.modelValue,l.value))),r=(l,d)=>JSON.stringify(l)===JSON.stringify(d);return(l,d)=>(c.openBlock(),c.createElementBlock("label",null,[c.createElementVNode("div",null,[c.renderSlot(l.$slots,"label",{},()=>[l.label?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(["fm-typo-body-lg-400 mb-4",{"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!l.disabled,"text-fm-color-typo-disabled":l.disabled}])},c.toDisplayString(l.label),3)):c.createCommentVNode("",!0)],!0)]),c.createVNode(qn,{"show-menu":i.value,disabled:l.disabled,placement:l.placement,onDropdownChanged:d[0]||(d[0]=h=>i.value=h)},{"menu-button":c.withCtx(()=>[c.createElementVNode("div",{class:c.normalizeClass([`${l.disabled?"cursor-not-allowed":"cursor-pointer"} fm-select`])},[c.createElementVNode("div",{class:c.normalizeClass({"fm-select__container":!0,"fm-select__container--expanded":i.value,"fm-select__container--disabled":l.disabled})},[c.createElementVNode("div",{class:c.normalizeClass({"fm-typo-body-lg-400 w-full h-full overflow-hidden text-ellipsis whitespace-nowrap":!0,"text-fm-color-typo-tertiary":!l.modelValue,"text-fm-color-typo-primary":!!l.modelValue})},c.toDisplayString(o.value),3),c.createVNode(I,{name:i.value?"expand_less":"expand_more",size:"md",color:l.disabled?"#C7C7CC":"black"},null,8,["name","color"])],2)],2)]),"menu-content":c.withCtx(()=>[c.createElementVNode("div",Bp,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(l.items,h=>(c.openBlock(),c.createBlock(Xa,{key:h.value,"has-checkbox":l.multiselect,label:h.label,value:h.value,"model-value":a.value.some(f=>r(f.value,h.value)),"onUpdate:modelValue":f=>s(f,h)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))])]),_:1},8,["show-menu","disabled","placement"])]))}}),_g="",Pp=it(Vp,[["__scopeId","data-v-008c2759"]]),Op={class:"fm-stepper-field"},Ap={class:"fm-typo-body-lg-400 text-fm-color-typo-primary"},Fp={key:0},Tp=["inputMode","value","placeholder","required","readOnly"],Lp={key:0},Np={key:0,class:"fm-stepper-field__stepper__container"},Rp={key:0,class:"fm-stepper-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},$p={key:0},zp={key:1},Ip=c.defineComponent({__name:"FmStepperField",props:{label:{default:""},modelValue:{},required:{type:Boolean},disabled:{type:Boolean},placeholder:{default:""},helperText:{default:""},inputmode:{default:"numeric"},readonly:{type:Boolean},step:{default:1},min:{default:0},max:{},leadingIcon:{default:""},trailingIcon:{default:""},useGrouping:{type:Boolean,default:!0},isCurrency:{type:Boolean,default:!1},showSteppers:{type:Boolean,default:!0},rules:{default:()=>[]},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,{validate:i,errorMessages:s,resetValidation:o,setValidationValue:a}=en(e),{isPristine:r}=tn(i,o,t,null),l=c.ref(null),d=c.ref(!1),h=c.ref(!0);let f;const u=c.ref(""),p=_=>{if(_!==""){const S=+_.replace(/,/g,"");return isNaN(S)?null:S}return null},m=_=>f.format(_),g=_=>_>e.max?e.max:_<e.min?e.min:_,b=(_,S)=>{_.preventDefault(),r.value=!1;let v=(p(u.value)??0)+S;v=g(v),a(v),h.value=i().length===0,u.value=m(v),y()},y=()=>{const _=p(u.value);t("update:modelValue",_)},x=()=>{const _=p(u.value);_&&(u.value=m(g(_))),h.value=i().length===0,d.value=!1,y()},w=()=>{var S;const _=p((S=l.value)==null?void 0:S.value);u.value=_!=null?m(_):""},k=_=>{if(![...Array(10).keys()].map(S=>S.toString()).includes(_.key)&&!["Backspace","Tab","Enter",".","-","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(_.key)){_.preventDefault();return}};return c.watch(()=>e.modelValue,_=>{u.value=_!=null?m(_):"",h.value=i().length===0}),c.onMounted(()=>{a(e.modelValue),f=new Intl.NumberFormat("en-MY",{useGrouping:e.useGrouping}),u.value=e.modelValue!=null?m(e.modelValue):""}),(_,S)=>(c.openBlock(),c.createElementBlock("label",Op,[c.createElementVNode("div",Ap,[c.renderSlot(_.$slots,"label",{},()=>[c.createTextVNode(c.toDisplayString(_.label),1)],!0)]),c.createElementVNode("div",{class:c.normalizeClass({"fm-stepper-field__container":!0,"fm-stepper-field__container--focused":d.value,"fm-stepper-field__container--invalid":!h.value&&!!_.modelValue,"fm-stepper-field__container--valid":_.showValidBorder&&h.value&&!!_.modelValue})},[c.renderSlot(_.$slots,"prepend",{},()=>[_.prependText?(c.openBlock(),c.createElementBlock("div",Fp,c.toDisplayString(_.prependText),1)):c.createCommentVNode("",!0),_.leadingIcon?(c.openBlock(),c.createBlock(I,{key:1,name:_.leadingIcon,size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):c.createCommentVNode("",!0)],!0),c.createElementVNode("input",{ref_key:"inputEl",ref:l,class:"fm-stepper-field--input",type:"text",inputMode:_.inputmode,value:u.value,placeholder:_.placeholder,required:_.required,readOnly:_.readonly,onInput:w,onFocus:S[0]||(S[0]=()=>d.value=!0),onBlur:x,onKeydown:k},null,40,Tp),c.renderSlot(_.$slots,"append",{},()=>[c.createElementVNode("div",{class:c.normalizeClass({"mr-32":_.showSteppers})},[_.appendText?(c.openBlock(),c.createElementBlock("div",Lp,c.toDisplayString(_.appendText),1)):c.createCommentVNode("",!0),_.trailingIcon?(c.openBlock(),c.createBlock(I,{key:1,name:_.trailingIcon,size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):c.createCommentVNode("",!0)],2)],!0),_.showSteppers?(c.openBlock(),c.createElementBlock("div",Np,[c.createElementVNode("div",{class:"fm-stepper-field__stepper__item",onMousedown:S[1]||(S[1]=C=>b(C,_.step))},[c.createVNode(I,{name:"expand_less",size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32),c.createElementVNode("div",{class:"fm-stepper-field__stepper__item",onMousedown:S[2]||(S[2]=C=>b(C,-_.step))},[c.createVNode(I,{name:"expand_more",size:"md",color:_.disabled?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32)])):c.createCommentVNode("",!0)],2),_.helperText||c.unref(s).length>0?(c.openBlock(),c.createElementBlock("div",Rp,[c.unref(s).length===0?(c.openBlock(),c.createElementBlock("div",$p,[c.renderSlot(_.$slots,"helper-text",{},()=>[c.createTextVNode(c.toDisplayString(_.helperText),1)],!0)])):(c.openBlock(),c.createElementBlock("div",zp,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(s),C=>(c.openBlock(),c.createElementBlock("div",{key:C,class:"flex gap-4 items-center text-fm-color-typo-error"},[c.createVNode(I,{name:"error",color:"#FF3B30",size:"sm"}),c.createElementVNode("span",null,c.toDisplayString(C),1)]))),128))]))])):c.createCommentVNode("",!0)]))}}),xg="",Wp=it(Ip,[["__scopeId","data-v-79048fb1"]]),Hp={class:"cursor-pointer fm-switch__container"},jp={key:0},Yp={class:"fm-typo-body-lg-400"},Up={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Xp={class:"fm-switch__input--container"},qp=["checked","value","disabled"],Kp={key:1},Gp={class:"fm-typo-body-lg-400"},Jp={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Zp=c.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)=>(c.openBlock(),c.createElementBlock("label",Hp,[s.labelPlacement==="left"?(c.openBlock(),c.createElementBlock("div",jp,[c.renderSlot(s.$slots,"label",{},void 0,!0),c.createElementVNode("div",Yp,c.toDisplayString(s.label),1),s.sublabel?(c.openBlock(),c.createElementBlock("div",Up,c.toDisplayString(s.sublabel),1)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),c.createElementVNode("div",Xp,[c.createElementVNode("input",{checked:s.modelValue,class:"fm-switch__input--btn",type:"checkbox",value:s.value,disabled:s.disabled,onClick:i},null,8,qp),c.createElementVNode("div",{class:c.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":s.showIcon})},[s.showIcon?(c.openBlock(),c.createBlock(I,{key:0,name:s.modelValue?"check":"close",size:"sm",color:s.disabled?"#C7C7CC":s.modelValue?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):c.createCommentVNode("",!0)],2)]),s.labelPlacement==="right"?(c.openBlock(),c.createElementBlock("div",Kp,[c.createElementVNode("div",Gp,c.toDisplayString(s.label),1),s.sublabel?(c.openBlock(),c.createElementBlock("div",Jp,c.toDisplayString(s.sublabel),1)):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0)]))}}),kg="",Qp=it(Zp,[["__scopeId","data-v-77ad1e00"]]),tm={class:"fm-text-field"},em={class:"fm-text-field--label"},nm={key:0},im=["value","inputMode","type","placeholder","required","minlength","maxlength","disabled","readOnly"],sm={key:0},om={key:0,class:"fm-text-field__helper-container fm-typo-body-sm-400 text-fm-color-typo-secondary"},am={key:0},rm={key:1};var qa=(n=>(n.required="*",n.optional="(optional)",n))(qa||{});const lm=c.defineComponent({__name:"FmTextField",props:{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},labelMark:{default:"none"},leadingIcon:{default:()=>({name:"",color:""})},trailingIcon:{default:()=>({name:"",color:""})},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},label:{},modelValue:{},rules:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref(null),s=c.ref(!1),{validate:o,errorMessages:a,resetValidation:r,setValidationValue:l}=en(e),{isPristine:d}=tn(o,r,t,""),h=u=>{d.value=!1,u.target.value||r(),l(u.target.value),t("update:modelValue",u.target.value)};c.watch(()=>e.modelValue,()=>{l(e.modelValue),!d.value&&o()});const f=c.computed(()=>a.value.length===0);return c.onMounted(()=>{l(e.modelValue)}),(u,p)=>(c.openBlock(),c.createElementBlock("label",tm,[c.createElementVNode("div",null,[c.createElementVNode("div",em,[c.renderSlot(u.$slots,"label"),c.createElementVNode("span",{class:c.normalizeClass({"fm-typo-body-lg-400":!0,"text-fm-color-typo-primary":!u.disabled,"text-fm-color-typo-disabled":u.disabled})},c.toDisplayString(u.label),3),u.labelMark!=="none"?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass({"fm-color-typo-tertiary fm-typo-body-md-400":u.labelMark==="optional","fm-color-typo-error fm-typo-body-lg-700":u.labelMark==="required"})},c.toDisplayString(qa[u.labelMark]),3)):c.createCommentVNode("",!0)])]),c.createElementVNode("div",{class:c.normalizeClass({"fm-text-field__container":!0,"fm-text-field__container--focused":s.value,"fm-text-field__container--invalid":!!u.modelValue&&!f.value,"fm-text-field__container--valid":u.showValidBorder&&u.showSuccess&&!!u.modelValue&&f.value,"fm-text-field__container--disabled":u.disabled})},[c.renderSlot(u.$slots,"prepend",{},()=>[u.prependText?(c.openBlock(),c.createElementBlock("div",nm,c.toDisplayString(u.prependText),1)):c.createCommentVNode("",!0),u.leadingIcon.name?(c.openBlock(),c.createBlock(I,{key:1,name:u.leadingIcon.name,size:"md",color:u.leadingIcon.color??(u.disabled?"#C7C7CC":"#1C1C1E")},null,8,["name","color"])):c.createCommentVNode("",!0)]),c.createElementVNode("input",{ref_key:"inputEl",ref:i,class:c.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!u.disabled,"fm-color-typo-disabled":u.disabled}),value:u.modelValue,inputMode:u.inputmode,type:u.inputmode,placeholder:u.placeholder,required:u.required,minlength:u.minLength,maxlength:u.maxLength,disabled:u.disabled,readOnly:u.readonly,onInput:h,onFocus:p[0]||(p[0]=()=>s.value=!0),onBlur:p[1]||(p[1]=()=>s.value=!1)},null,42,im),c.renderSlot(u.$slots,"append",{},()=>[u.appendText?(c.openBlock(),c.createElementBlock("div",sm,c.toDisplayString(u.appendText),1)):c.createCommentVNode("",!0),u.trailingIcon.name?(c.openBlock(),c.createBlock(I,{key:1,name:u.trailingIcon.name,size:"md",color:u.trailingIcon.color??(u.disabled?"#C7C7CC":"#1C1C1E")},null,8,["name","color"])):c.createCommentVNode("",!0)])],2),u.helperText||c.unref(a).length>0?(c.openBlock(),c.createElementBlock("div",om,[c.unref(a).length===0?(c.openBlock(),c.createElementBlock("div",am,[c.renderSlot(u.$slots,"helper-text",{},()=>[c.createTextVNode(c.toDisplayString(u.helperText),1)])])):(c.openBlock(),c.createElementBlock("div",rm,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(a),m=>(c.openBlock(),c.createElementBlock("div",{key:m,class:"flex gap-4 items-center text-fm-color-typo-error"},[c.createVNode(I,{name:"error",color:"#FF3B30",size:"sm"}),c.createElementVNode("span",null,c.toDisplayString(m),1)]))),128))])),c.createElementVNode("div",{class:c.normalizeClass({"fm-color-typo-disabled":u.disabled})},c.toDisplayString(u.maxLength?`${u.modelValue.length} / ${u.maxLength}`:""),3)])):c.createCommentVNode("",!0)]))}}),wg="",cm={class:"fm-textarea"},dm={htmlFor:"{this.name}"},hm={class:"fm-textarea--label"},fm=["value","placeholder","required","minlength","maxlength","readOnly","disabled"],um={key:0,class:"fm-color-typo-secondary fm-textarea__helper-container fm-typo-body-sm-400"},pm={key:0},mm={key:1};var Ka=(n=>(n.required="*",n.optional="(optional)",n))(Ka||{});const gm=c.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},labelMark:{default:"none"},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},rules:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,i=c.ref(!1),{validate:s,errorMessages:o,resetValidation:a,setValidationValue:r}=en(e),{isPristine:l}=tn(s,a,t,""),d=f=>{l.value=!1,r(f.target.value),t("update:modelValue",f.target.value)},h=c.computed(()=>o.value.length===0);return c.watch(()=>e.modelValue,()=>{l.value||s()}),c.onMounted(()=>{r(e.modelValue)}),(f,u)=>(c.openBlock(),c.createElementBlock("div",cm,[c.createElementVNode("label",dm,[c.createElementVNode("div",hm,[c.renderSlot(f.$slots,"label"),c.createElementVNode("span",{class:c.normalizeClass({"fm-typo-body-lg-400":!0,"fm-color-typo-primary":!f.disabled,"fm-color-typo-disabled":f.disabled})},c.toDisplayString(f.label),3),f.labelMark!=="none"?(c.openBlock(),c.createElementBlock("span",{key:0,class:c.normalizeClass({"fm-color-typo-tertiary fm-typo-body-md-400":f.labelMark==="optional","fm-color-typo-error fm-typo-body-lg-700":f.labelMark==="required"})},c.toDisplayString(Ka[f.labelMark]),3)):c.createCommentVNode("",!0)])]),c.createElementVNode("div",{class:c.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":i.value,"fm-textarea__container--invalid":!!f.modelValue&&!h.value,"fm-textarea__container--valid":f.showValidBorder&&f.showSuccess&&!!f.modelValue&&h.value,"fm-textarea__container--disabled":f.disabled})},[c.createElementVNode("textarea",{class:c.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!f.disabled,"fm-color-typo-disabled":f.disabled}),value:f.modelValue,placeholder:f.placeholder,required:f.required,minlength:f.minLength,maxlength:f.maxLength,readOnly:f.readonly,disabled:f.disabled,onInput:d,onFocus:u[0]||(u[0]=()=>i.value=!0),onBlur:u[1]||(u[1]=()=>i.value=!1)},null,42,fm)],2),f.helperText||c.unref(o).length>0?(c.openBlock(),c.createElementBlock("div",um,[c.unref(o).length===0?(c.openBlock(),c.createElementBlock("div",pm,[c.renderSlot(f.$slots,"helper-text",{},()=>[c.createTextVNode(c.toDisplayString(f.helperText),1)])])):(c.openBlock(),c.createElementBlock("div",mm,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(o),p=>(c.openBlock(),c.createElementBlock("div",{key:p,class:"flex gap-4 items-center text-fm-color-typo-error"},[c.createVNode(I,{name:"error",color:"#FF3B30",size:"sm"}),c.createElementVNode("span",null,c.toDisplayString(p),1)]))),128))])),c.createElementVNode("div",{class:c.normalizeClass({"fm-color-typo-disabled":f.disabled})},c.toDisplayString(f.maxLength?`${f.modelValue.length} / ${f.maxLength}`:""),3)])):c.createCommentVNode("",!0)]))}}),Sg="",bm=c.defineComponent({__name:"FmList",props:{separator:{type:Boolean,default:!1},disabled:{type:Boolean},activeClass:{default:""}},setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass({"fm-list--separator":t.separator,activeClass:t.activeClass})},[c.renderSlot(t.$slots,"default",{},void 0,!0)],2))}}),Cg="",ym=it(bm,[["__scopeId","data-v-884ba127"]]),_m=c.defineComponent({__name:"FmListItem",props:{tag:{default:"div"},clickable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},activeClass:{default:""}},setup(n){const t=n;return(e,i)=>{const s=c.resolveDirective("wave");return c.withDirectives((c.openBlock(),c.createBlock(t.tag,{class:c.normalizeClass({"fm-list-item":!0,"fm-list-item--disabled":e.disabled,"cursor-pointer":e.clickable&&!e.disabled,"cursor-not-allowed":e.clickable&&e.disabled,activeClass:e.activeClass})},{default:c.withCtx(()=>[c.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},8,["class"])),[[s,e.clickable&&!e.disabled]])}}}),Mg="",xm=it(_m,[["__scopeId","data-v-f565b558"]]),km={class:"fm-progress-indicator relative"},wm=["data-progress"],Sm={class:"absolute flex fm-typo-body-sm-400 h-full inset-0 items-center justify-center w-full"},Ga=c.defineComponent({__name:"FmProgressIndicator",props:{modelValue:{type:Number,required:!0}},setup(n){const t=n,e=c.ref(null),i=c.computed(()=>`${t.modelValue/100*360}deg`),s=o=>{e.value&&e.value.style.setProperty("--progress",o)};return c.onMounted(()=>{s(i.value)}),c.onUpdated(()=>{s(i.value)}),c.watch(i,async o=>{s(o)}),(o,a)=>(c.openBlock(),c.createElementBlock("div",km,[c.createElementVNode("div",{ref_key:"progress",ref:e,class:"fm-progress-circular w-full","data-progress":i.value},null,8,wm),c.createElementVNode("div",Sm,[c.renderSlot(o.$slots,"default")])]))}}),Dg="",Cm={class:"flex"},Mm={key:0,class:"mt-8"},Dm=c.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=c.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=c.computed(()=>e.title?{text:e.title,classes:"fm-typo-body-lg-700"}:{text:e.description,classes:""}),o=c.computed(()=>e.bgColor?Jn(e.bgColor)?{style:{backgroundColor:e.bgColor}}:{class:`bg-fm-color-${e.bgColor}`}:{class:`bg-fm-color-${i.value.bgColor}`}),a=c.computed(()=>e.color?Jn(e.color)?{style:{color:e.color}}:{class:`text-fm-color-${e.color}`}:{class:`text-fm-color-${i.value.actionColor}`});return(r,l)=>(c.openBlock(),c.createElementBlock("div",c.mergeProps(o.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[c.createElementVNode("div",Cm,[i.value.icon?(c.openBlock(),c.createBlock(I,{key:0,name:i.value.icon.name,color:e.color??i.value.icon.color,class:"mr-12"},null,8,["name","color"])):c.createCommentVNode("",!0),c.createElementVNode("div",{class:c.normalizeClass(`${s.value.classes} grow ellipsis`)},c.toDisplayString(s.value.text),3),e.dismissable?(c.openBlock(),c.createBlock(I,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:l[0]||(l[0]=()=>t("onDismiss"))})):c.createCommentVNode("",!0)]),e.title&&e.description?(c.openBlock(),c.createElementBlock("div",Mm,c.toDisplayString(e.description),1)):c.createCommentVNode("",!0),c.renderSlot(r.$slots,"actions",{},()=>[e.action?(c.openBlock(),c.createElementBlock("div",c.mergeProps({key:0},a.value,{class:"mt-16 fm-typo-body-lg-700"}),[c.createElementVNode("span",{class:"cursor-pointer",onClick:l[1]||(l[1]=()=>t("onAction"))},c.toDisplayString(e.action),1)],16)):c.createCommentVNode("",!0)],!0)],16))}}),vg="",vm=it(Dm,[["__scopeId","data-v-b6db34bb"]]),Em={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},Ja=c.defineComponent({__name:"FmStepHeader",props:{title:{type:String,required:!0},description:{type:String,default:void 0},disabled:{type:Boolean,default:!1},titleBold:{type:Boolean,default:!1}},setup(n){return(t,e)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["flex flex-col",n.disabled?"text-fm-color-typo-disabled":""])},[c.createElementVNode("div",{class:c.normalizeClass(["fm-step-title line-clamp-2",n.titleBold?"fm-typo-body-xl-700":"fm-typo-body-md-400"])},c.toDisplayString(n.title),3),n.description?(c.openBlock(),c.createElementBlock("div",Em,c.toDisplayString(n.description),1)):c.createCommentVNode("",!0)],2))}}),Bm=["data-title","data-description","data-disabled","onClick"],Vm={class:"flex fm-step-container gap-12 grow"},Pm=c.defineComponent({__name:"FmStep",props:{title:{type:String,required:!0},description:{type:String,default:void 0},value:{type:Number,required:!0},complete:{type:Function,required:!0},error:{type:Function,default:void 0},disabled:{type:Function,default:void 0}},setup(n){const t=n,{currentStep:e,goToStep:i}=c.inject(Wa);function s(){o.value||i(t.value)}const o=c.computed(()=>t.disabled?t.disabled():!1),a=c.computed(()=>t.error?t.error():!1),r=c.computed(()=>e()===t.value),l=c.computed(()=>t.complete()),d=c.computed(()=>r.value||l.value||e()>t.value?"bg-fm-color-primary":"bg-fm-color-neutral-gray-300"),h=c.computed(()=>r.value?{className:"bg-fm-color-primary"}:a.value?{config:{name:"warning",color:"system-error-300"}}:o.value?{className:"border-2 border-fm-color-neutral-gray-200"}:l.value?{config:{name:"check_small",color:"primary"},className:"border-2 border-fm-color-primary"}:{className:"border-2 border-fm-color-neutral-gray-300"});return(f,u)=>{const p=c.resolveDirective("wave");return c.withDirectives((c.openBlock(),c.createElementBlock("div",{"data-title":n.title,"data-description":n.description,"data-disabled":o.value,class:c.normalizeClass(`fm-step gap-4 grow ${o.value?"cursor-not-allowed":"cursor-pointer"}`),onClick:c.withModifiers(s,["stop"])},[c.createElementVNode("div",null,[c.createElementVNode("div",{class:c.normalizeClass(`fm-step-indicator ${d.value}`)},null,2)]),c.createElementVNode("div",Vm,[c.createElementVNode("div",{class:c.normalizeClass(["flex fm-step-container-icon h-[24px] items-center justify-center min-h-[24px] min-w-[24px] relative rounded-full w-[24px]",h.value.className])},[h.value.config?(c.openBlock(),c.createBlock(I,{key:0,name:h.value.config.name,color:h.value.config.color,outline:"",class:"absolute"},null,8,["name","color"])):c.createCommentVNode("",!0)],2),c.createVNode(Ja,{title:n.title,description:n.description,disabled:o.value,class:"grow"},null,8,["title","description","disabled"])])],10,Bm)),[[p,!o.value]])}}}),Eg="",Om=it(Pm,[["__scopeId","data-v-ee172cad"]]),Am={class:"hidden items-center xs:flex"},Fm={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},Tm=c.defineComponent({__name:"FmStepper",props:{modelValue:{type:Number,required:!0},orientation:{type:String,default:"horizontal"}},emits:["update:model-value"],setup(n,{emit:t}){const e=n,i=h=>{t("update:model-value",h)};c.provide(Wa,{currentStep:()=>e.modelValue,goToStep:i});const s=c.ref(),o=c.ref([]),a=c.computed(()=>o.value[e.modelValue-1]),r=c.computed(()=>e.modelValue/o.value.length*100),l=c.computed(()=>`${e.modelValue} of ${o.value.length}`),d=()=>{var f;const h=Array.from(((f=s.value)==null?void 0:f.querySelectorAll(":scope > .fm-step"))??[]);o.value=h.map(u=>({title:u.dataset.title??"",description:u.dataset.description,disabled:u.dataset.disabled=="true"}))};return c.onMounted(()=>{d()}),(h,f)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(`fm-stepper fm-stepper__${n.orientation}`)},[c.createElementVNode("div",{ref_key:"stepperRef",ref:s,class:c.normalizeClass(`flex mx-24 mt-12 mb-24 xs:hidden ${n.orientation==="vertical"?"flex-col":""}`)},[c.renderSlot(h.$slots,"default")],2),c.createElementVNode("div",Am,[c.createVNode(Ga,{"model-value":r.value,class:"mr-12",style:{"min-width":"60px"}},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(l.value),1)]),_:1},8,["model-value"]),a.value?(c.openBlock(),c.createBlock(Ja,{key:0,class:"grow","title-bold":"",title:a.value.title,description:a.value.description,disabled:a.value.disabled},null,8,["title","description","disabled"])):c.createCommentVNode("",!0)]),h.$slots.contents?(c.openBlock(),c.createElementBlock("div",{key:0,class:c.normalizeClass(`flex-col mx-24 mt-12 mb-24 ${n.orientation==="vertical"?"w-2/3":""}`)},[c.renderSlot(h.$slots,"contents"),c.createElementVNode("div",Fm,[c.renderSlot(h.$slots,"actions")])],2)):c.createCommentVNode("",!0)],2))}}),Lm={class:"flex flex-col fm-time-input items-center"},Nm=["value"],Rm=c.defineComponent({__name:"TimeInput",props:{modelValue:{type:String,required:!0},min:{type:Number,required:!0},max:{type:Number,required:!0}},emits:["update:model-value","update:cycle"],setup(n,{emit:t}){const e=n,i=c.ref();function s(d){i.value&&(i.value.value=d)}c.watch(()=>e.modelValue,s);function o(){if(!i.value)return;const d=a(i.value.value);if(d==null||d>e.max||d<e.min){s(e.modelValue);return}t("update:model-value",d)}function a(d){return d&&/^\d+$/.test(d)?Number(d):null}function r(){t("update:model-value",a(e.modelValue)+1)}function l(){t("update:model-value",a(e.modelValue)-1)}return(d,h)=>(c.openBlock(),c.createElementBlock("div",Lm,[c.createElementVNode("div",{class:"fm-time-input__scroller",onClick:r},[c.createVNode(I,{name:"expand_less",size:"lg"})]),c.createElementVNode("input",{ref_key:"inputRef",ref:i,value:e.modelValue,onInput:o},null,40,Nm),c.createElementVNode("div",{class:"fm-time-input__scroller",onClick:l},[c.createVNode(I,{name:"expand_more",size:"lg"})])]))}}),Bg="",Za=it(Rm,[["__scopeId","data-v-35e4eeb2"]]);var Nt=(n=>(n.AM="AM",n.PM="PM",n))(Nt||{});function Kt(n){return n.toString().padStart(2,"0")}const $m={class:"flex fm-time-input gap-16 items-center"},zm=c.createElementVNode("div",{class:"fm-typo-title-sm-700"}," : ",-1),Im={class:"fm-time-input-periods"},Wm=["onClick"],Qa=c.defineComponent({__name:"FmTimeInput",props:{modelValue:{type:Object,required:!0}},emits:["update:model-value"],setup(n,{emit:t}){const e=n;function i(s){const o={hours:s.hours??e.modelValue.hours,minutes:s.minutes??e.modelValue.minutes,period:s.period??e.modelValue.period},a=e.modelValue.hours;(a===12&&o.hours===11||a===11&&o.hours===12)&&(o.period=e.modelValue.period===Nt.AM?Nt.PM:Nt.AM),o.hours>12?o.hours=1:o.hours<1&&(o.hours=12),o.minutes>59?o.minutes=0:o.minutes<0&&(o.minutes=59),t("update:model-value",o)}return(s,o)=>(c.openBlock(),c.createElementBlock("div",$m,[c.createVNode(Za,{"model-value":c.unref(Kt)(n.modelValue.hours),min:1,max:12,"onUpdate:modelValue":o[0]||(o[0]=a=>i({hours:a}))},null,8,["model-value"]),zm,c.createVNode(Za,{"model-value":c.unref(Kt)(n.modelValue.minutes),min:0,max:59,"onUpdate:modelValue":o[1]||(o[1]=a=>i({minutes:a}))},null,8,["model-value"]),c.createElementVNode("div",Im,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(Nt),a=>(c.openBlock(),c.createElementBlock("div",{key:a,class:c.normalizeClass([{"fm-time-input-period__selected":a===n.modelValue.period},"bg-fm-color-neutral-gray-100 fm-time-input-period"]),onClick:()=>i({period:a})},c.toDisplayString(a),11,Wm))),128))])]))}}),Vg="",Hm={class:"fm-time-picker"},jm={class:"flex gap-8"},Ym={class:"flex flex-col",style:{width:"343px"}},Um=c.createElementVNode("div",{class:"fm-typo-body-xl-700 pt-12 px-12"}," Enter time ",-1),Xm={class:"flex justify-center w-full"},qm={class:"flex justify-end pb-12"},Km=c.defineComponent({__name:"FmTimePicker",props:{modelValue:{type:[null,String],default:null}},emits:["update:model-value"],setup(n,{emit:t}){const e=n,i=c.ref(null),s=c.computed(()=>{if(!e.modelValue)return null;const{hours:p,minutes:m,period:g}=r(e.modelValue);return`${Kt(p)}:${Kt(m)} ${g}`});function o(){if(!i.value){t("update:model-value",null);return}const{hours:p,minutes:m,period:g}=i.value,b=a(p,m,g);t("update:model-value",b),h()}function a(p,m,g){let b=p;return g===Nt.PM?b=p===12?p:p+12:p===12&&(b=0),`${Kt(b)}:${Kt(m)}`}c.onMounted(()=>{e.modelValue&&(i.value=r(e.modelValue))}),c.watch(()=>e.modelValue,p=>{p&&(i.value=r(p))});function r(p){const[m,g,b]=l(p).split(":");return{hours:Number(m),minutes:Number(g),period:b}}function l(p){const[m,g]=p.split(":"),b=Number(m),y=Number(g),x=b>11?Nt.PM:Nt.AM;let w=b;return w===0?w=12:w>12&&(w-=12),`${Kt(w)}:${Kt(y)}:${x}`}const d=c.ref();function h(){var p;(p=d.value)==null||p.hide()}const f=c.ref(!1);function u(p){f.value=p}return(p,m)=>(c.openBlock(),c.createElementBlock("div",Hm,[c.createVNode(qn,{ref_key:"dropdownRef",ref:d,onDropdownChanged:u},{"menu-button":c.withCtx(()=>[c.createVNode(Ua,null,{default:c.withCtx(()=>[c.createElementVNode("div",jm,[c.createVNode(I,{name:"schedule",outline:!f.value},null,8,["outline"]),c.createElementVNode("div",{class:c.normalizeClass(["grow",{"text-fm-color-typo-disabled":!s.value}])},c.toDisplayString(s.value??"HH:MM"),3)])]),_:1})]),"menu-content":c.withCtx(()=>[c.createElementVNode("div",Ym,[Um,c.createElementVNode("div",Xm,[c.createVNode(Qa,{"model-value":i.value??{hours:0,minutes:0,period:c.unref(Nt).AM},class:"py-16","onUpdate:modelValue":m[0]||(m[0]=g=>i.value=g)},null,8,["model-value"])]),c.createElementVNode("div",qm,[c.createVNode(Rt,{label:"Cancel",variant:"tertiary",onClick:h}),c.createVNode(Rt,{label:"Confirm",variant:"tertiary",onClick:o})])])]),_:1},512)]))}}),Pg="",Gm={class:"px-2 py-0"},Jm={key:0,class:"fm-typo-body-xl-700"},Zm={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},Qm={FmBreadcrumb:ir,FmButton:Rt,FmButtonGroup:mr,FmCard:yr,FmCardActions:_r,FmCardSection:xr,FmCardTitle:Ji,FmLineChart:Pf,FmDatePicker:Hf,FmDateRangePicker:$u,FmDialog:Wu,FmDropField:Uu,FmDynamicDialog:ja,FmCheckbox:Ya,FmField:Ua,FmForm:up,FmRadio:kp,FmRadioGroup:Mp,FmSelect:Pp,FmStepperField:Wp,FmSwitch:Qp,FmTextField:lm,FmTextarea:gm,FmIcon:I,FmList:ym,FmListItem:xm,FmMenu:qn,FmMenuItem:Xa,FmProgressIndicator:Ga,FmSnackbar:vm,FmSpacer:$a,FmStep:Om,FmStepper:Tm,FmTimeInput:Qa,FmTimePicker:Km,FmTooltip:c.defineComponent({__name:"FmTooltip",props:{variant:{default:"plain"},beak:{default:"top"},hasArrow:{type:Boolean,default:!0},titleText:{default:"Title"},contentText:{},actionButtons:{}},setup(n){const t=n,e=c.ref(null),i=c.ref(null),s=c.ref(null),o=async()=>{var y,x,w,k;const{x:p,y:m,placement:g,middlewareData:b}=await La(e.value,i.value,{placement:t.beak,middleware:[Ma(10),Ca(),tu({padding:5}),t.hasArrow?_u({element:s.value,padding:10}):null]});if(Object.assign(i.value.style,{left:`${p}px`,top:`${m}px`}),t.hasArrow){const _={top:"bottom",right:"left",bottom:"top",left:"right"}[g.split("-")[0]];Object.assign(s.value.style,{left:((y=b.arrow)==null?void 0:y.x)!=null?`${(x=b.arrow)==null?void 0:x.x}px`:"",top:((w=b.arrow)==null?void 0:w.y)!=null?`${(k=b.arrow)==null?void 0:k.y}px`:"",right:"",bottom:"",background:t.variant==="rich"?"#FFF":"#1C1C1E",[_]:"-4px"})}},a=c.ref(!1),r=c.ref(0),l=c.ref(0),d=c.computed(()=>({...{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)"}}[t.variant],display:a.value?"block":"none"})),h=()=>{clearTimeout(l.value),r.value=window.setTimeout(()=>{a.value=!0},500)},f=()=>{clearTimeout(r.value),l.value=window.setTimeout(()=>a.value=!1,1500)},u=()=>{clearTimeout(l.value),a.value=!0};return c.watchEffect(()=>{a.value?(o(),window.addEventListener("resize",o)):window.removeEventListener("resize",o)}),(p,m)=>(c.openBlock(),c.createElementBlock("div",null,[c.createElementVNode("div",{ref_key:"tooltipContainer",ref:e,class:"cursor-pointer flex items-center justify-center relative w-max",onMouseenter:h,onMouseleave:f},[c.renderSlot(p.$slots,"default")],544),c.createElementVNode("div",{ref_key:"tooltip",ref:i,class:"absolute box-border break-words left-0 max-w-xs px-4 py-3 rounded-2xl top-0 w-max whitespace-normal z-50",style:c.normalizeStyle(d.value),onMouseenter:u,onMouseleave:f},[c.createElementVNode("div",null,[c.createElementVNode("div",Gm,[p.variant=="rich"?(c.openBlock(),c.createElementBlock("div",Jm,c.toDisplayString(p.titleText),1)):c.createCommentVNode("",!0),c.createElementVNode("div",{class:c.normalizeClass(p.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},c.toDisplayString(p.contentText),3)]),p.variant=="rich"?(c.openBlock(),c.createElementBlock("div",Zm,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p.actionButtons,(g,b)=>(c.openBlock(),c.createElementBlock("div",{key:b},[c.createVNode(Rt,{variant:"tertiary",label:g.label,onClick:g.handler},null,8,["label","onClick"])]))),128))])):c.createCommentVNode("",!0)]),c.createElementVNode("div",{ref_key:"arrowEl",ref:s,class:"-rotate-45 absolute h-3 w-3"},null,512)],36)]))}})};function tg(){const n=c.inject(Ha);if(!n)throw new Error("No provider");return n}const eg=n=>{n.use(ft,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),n.use(Gu),Object.entries(Qm).forEach(([t,e])=>{n.component(t,e)})};nt.uiPlugin=eg,nt.useDialog=tg,nt.useFormChild=tn,nt.useValidation=en,Object.defineProperty(nt,Symbol.toStringTag,{value:"Module"})});