@feedmepos/ui-library 0.0.17 → 0.0.18

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.
@@ -1,25 +1,25 @@
1
- var Mg=Object.defineProperty;var Sg=(st,pt,r)=>pt in st?Mg(st,pt,{enumerable:!0,configurable:!0,writable:!0,value:r}):st[pt]=r;var P=(st,pt,r)=>(Sg(st,typeof pt!="symbol"?pt+"":pt,r),r);(function(st,pt){typeof exports=="object"&&typeof module<"u"?pt(exports,require("v-wave"),require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","v-wave","vue","vue-router"],pt):(st=typeof globalThis<"u"?globalThis:st||self,pt(st["feedmepos-ui-library"]={},st.VWave,st.Vue,st.VueRouter))})(this,function(st,pt,r,eo){var ts;"use strict";const Dg="",cr={class:"gap-8 inline-flex items-center relative select-none"},dr={key:0,class:"fm-typo-body-sm-400 justify-center"},hr=r.defineComponent({__name:"FmBadge",props:{inline:{type:Boolean,default:!1},value:{default:null},variant:{default:"neutral"}},setup(n){const t=n,e=r.computed(()=>t.value&&t.value>99?"99+":t.value);return(s,o)=>(r.openBlock(),r.createElementBlock("div",cr,[r.renderSlot(s.$slots,"default",{},void 0,!0),r.createElementVNode("div",{class:r.normalizeClass(["fm-badge",`fm-badge--${s.variant}`,{absolute:!s.inline,"top-0 right-0 w-[6px] h-[6px]":t.value===null,"top-[-2px] right-[-4px] w-[16px] h-[16px]":t.value&&t.value<10,"top-[-2px] right-[-12px] px-4 h-[20px] min-w-[24px]":t.value&&t.value>10&&t.value<100,"top-[-2px] right-[-20px] px-4 h-[20px] min-w-[24px]":t.value&&t.value>99}])},[t.value!==null?(r.openBlock(),r.createElementBlock("span",dr,r.toDisplayString(e.value),1)):r.createCommentVNode("",!0)],2)]))}}),Bg="",et=(n,t)=>{const e=n.__vccOpts||n;for(const[s,o]of t)e[s]=o;return e},cn=et(hr,[["__scopeId","data-v-02018628"]]),fr={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},ur=["onMouseenter"],pr={key:0},mr=r.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(n){const t=n,e=eo.useRoute(),s=eo.useRouter();r.onMounted(async()=>{await s.isReady();const m=t.items.findIndex(g=>g.route==e.path);m!=-1&&!t.items[m].disabled&&(o.value=m)});const o=r.ref(-1),i=r.ref(-1),a=r.ref(" / "),l=r.ref("... /"),c=r.ref(!1),d=m=>o.value===m?"selected":i.value===m?"hovered":t.items[m].disabled?"disabled":"default",h=m=>{t.items[m].disabled||(o.value=m)},f=m=>m!=t.items.length-1,u=m=>!c.value&&t.items.length>5&&m>=2&&m<t.items.length-2,p=()=>{c.value=!c.value};return(m,g)=>{const b=r.resolveComponent("RouterLink");return r.openBlock(),r.createElementBlock("nav",null,[r.createElementVNode("ul",fr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.items,(_,y)=>(r.openBlock(),r.createElementBlock("li",{key:y,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:k=>i.value=y,onMouseleave:g[0]||(g[0]=k=>i.value=-1)},[u(y)?y===3&&!c.value?(r.openBlock(),r.createElementBlock("a",{key:1,onClick:p},r.toDisplayString(l.value),1)):r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(b,{key:0,class:r.normalizeClass(d(y)),to:_.disabled?"":_.route,onClick:k=>h(y)},{default:r.withCtx(()=>[r.createElementVNode("span",null,r.toDisplayString(_.label),1),f(y)?(r.openBlock(),r.createElementBlock("span",pr,r.toDisplayString(a.value),1)):r.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,ur))),128))])])}}}),vg="",gr=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,br=/^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}[)]$/,yr=/^^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*[)]$/,_r=/^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*[)]$/,xr=/^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 ns(n){return[gr,br,yr,_r,xr].some(t=>t.test(n))}const kr=r.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=r.computed(()=>{const i=[],a={};return i.push(s()),i.push(o()),ns(t.color)?a.color=t.color:i.push(`text-fm-color-${t.color}`),{class:i.join(" "),style:a}});function s(){return`fm-icon--${t.outline?"outlined":"rounded"}`}function o(){return`fm-icon--${t.size}`}return(i,a)=>(r.openBlock(),r.createElementBlock("span",r.mergeProps(e.value,{class:"fm-icon"}),r.toDisplayString(t.name),17))}}),Eg="",R=et(kr,[["__scopeId","data-v-fd802d37"]]),wr=["disabled","type"],Cr={key:1,class:"fm-typo-body-lg-700"},Mr=r.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=r.ref(!1),s=r.computed(()=>`${o[t.variant]} ${t.disabled?"cursor-not-allowed":"cursor-pointer"}`),o={primary:"bg-fm-color-primary text-fm-color-typo-white rounded-lg",secondary:"bg-transparent rounded-lg",destructive:"bg-fm-color-system-error-300 text-fm-color-white text-fm-color-typo-white rounded-lg",tertiary:"bg-transparent text-fm-color-primary rounded-lg",fab:"bg-fm-color-primary text-fm-color-white rounded-full text-fm-color-typo-white rounded-xxxl"};function i(a){e.value=a}return(a,l)=>{const c=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("button",{ref:"buttonEl",class:r.normalizeClass(`
1
+ var jg=Object.defineProperty;var Yg=(it,r,jt)=>r in it?jg(it,r,{enumerable:!0,configurable:!0,writable:!0,value:jt}):it[r]=jt;var P=(it,r,jt)=>(Yg(it,typeof r!="symbol"?r+"":r,jt),jt);(function(it,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("vue-router")):typeof define=="function"&&define.amd?define(["exports","vue","vue-router"],r):(it=typeof globalThis<"u"?globalThis:it||self,r(it["feedmepos-ui-library"]={},it.Vue,it.VueRouter))})(this,function(it,r,jt){var ns;"use strict";const Hg="",ao={directive:"wave",color:"currentColor",initialOpacity:.2,finalOpacity:.1,duration:.4,dissolveDuration:.15,easing:"ease-out",cancellationPeriod:75,trigger:"auto",tagName:"div"},yr=n=>"config"in n&&"globalProperties"in n.config,_r=n=>{let t;return n==="vue2"?t=!1:n==="vue3"?t=!0:t=yr(n),t?{mounted:"mounted",updated:"updated"}:{mounted:"inserted",updated:"componentUpdated"}},ro=n=>typeof n=="string"&&n!=="auto",lo=(n,t)=>{n.dataset.vWaveBoundary=ro(t)?t:"true"},xr=({borderTopLeftRadius:n,borderTopRightRadius:t,borderBottomLeftRadius:e,borderBottomRightRadius:s},o)=>{const i=document.createElement(o);return i.style.top="0",i.style.left="0",i.style.width="100%",i.style.height="100%",i.style.display="block",i.style.position="absolute",i.style.borderRadius=`${n} ${t} ${s} ${e}`,i.style.overflow="hidden",i.style.pointerEvents="none",i.style.webkitMaskImage="-webkit-radial-gradient(white, black)",i},kr=(n,t,e,s)=>{const o=document.createElement("div");return o.style.position="absolute",o.style.width=`${e}px`,o.style.height=`${e}px`,o.style.top=`${t}px`,o.style.left=`${n}px`,o.style.background=s.color,o.style.borderRadius="50%",o.style.opacity=`${s.initialOpacity}`,o.style.transform="translate(-50%,-50%) scale(0)",o.style.transition=`transform ${s.duration}s ${s.easing}, opacity ${s.duration}s ${s.easing}`,o};function dn(n,t,e,s){const o=n-e,i=t-s;return Math.sqrt(o*o+i*i)}function wr(n,t,{width:e,height:s}){const o=dn(n,t,0,0),i=dn(n,t,e,0),a=dn(n,t,0,s),l=dn(n,t,e,s);return Math.max(o,i,a,l)}const Cr=({x:n,y:t},{top:e,left:s})=>({x:n-s,y:t-e}),os="vWaveCountInternal";function Sr(n){const t=is(n);co(n,t+1)}function Mr(n){const t=is(n);co(n,t-1)}function co(n,t){n.dataset[os]=t.toString()}function is(n){var t;return parseInt((t=n.dataset[os])!==null&&t!==void 0?t:"0",10)}function vr(n){delete n.dataset[os]}const as=(n,t,e)=>{const s=t.getBoundingClientRect(),o=window.getComputedStyle(t),{x:i,y:a}=Cr(n,s),l=2.05*wr(i,a,s),c=xr(o,e.tagName),d=kr(i,a,l,e);Sr(t);let h="";o.position==="static"&&(t.style.position&&(h=t.style.position),t.style.position="relative"),c.appendChild(d),t.appendChild(c);let f=!1;const u=b=>{typeof b<"u"&&(document.removeEventListener("pointerup",u),document.removeEventListener("pointercancel",u)),f?p():f=!0},p=()=>{d.style.transition=`opacity ${e.dissolveDuration}s linear`,d.style.opacity="0",setTimeout(()=>{c.remove(),Mr(t),is(t)===0&&(vr(t),t.style.position=h)},e.dissolveDuration*1e3)};document.addEventListener("pointerup",u),document.addEventListener("pointercancel",u);const m=setTimeout(()=>{document.removeEventListener("pointercancel",g),requestAnimationFrame(()=>{d.style.transform="translate(-50%,-50%) scale(1)",d.style.opacity=`${e.finalOpacity}`,setTimeout(()=>u(),e.duration*1e3)})},e.cancellationPeriod),g=()=>{clearTimeout(m),c.remove(),document.removeEventListener("pointerup",u),document.removeEventListener("pointercancel",u),document.removeEventListener("pointercancel",g)};document.addEventListener("pointercancel",g)},Ee=new WeakMap,ho=(n={},t="vue3")=>{const e=Object.assign(Object.assign({},ao),n),s=_r(t),o=l=>{const c=l.currentTarget.dataset.vWaveTrigger;document.querySelectorAll(`[data-v-wave-boundary="${c}"]`).forEach(h=>as(l,h,Object.assign(Object.assign({},e),Ee.get(h))))},i={[s.mounted](l,{value:c={}}){var d;Ee.set(l,c),lo(l,(d=c&&c.trigger)!==null&&d!==void 0?d:e.trigger),l.addEventListener("pointerdown",h=>{if(Ee.get(l)===!1)return;const f=Object.assign(Object.assign({},e),Ee.get(l));if(f.trigger===!1)return as(h,l,f);if(ro(f.trigger))return;const u=l.querySelector('[data-v-wave-trigger="true"]');!u&&f.trigger===!0||u&&!h.composedPath().includes(u)||as(h,l,f)})},[s.updated](l,{value:c={}}){var d;Ee.set(l,c),lo(l,(d=c&&c.trigger)!==null&&d!==void 0?d:e.trigger)}},a={[s.mounted](l,{arg:c="true"}){l.dataset.vWaveTrigger=c,c!=="true"&&l.addEventListener("pointerdown",o)},[s.updated](l,{arg:c="true"}){l.dataset.vWaveTrigger=c,c==="true"?l.removeEventListener("pointerdown",o):l.addEventListener("pointerdown",o)}};return{wave:i,vWave:i,waveTrigger:a,vWaveTrigger:a}},Dr={install(n,t={}){if(this.installed)return;this.installed=!0;const e=Object.assign(Object.assign({},ao),t),{vWave:s,vWaveTrigger:o}=ho(e,n);n.directive(e.directive,s),n.directive(`${e.directive}-trigger`,o)},installed:!1,createLocalWaveDirective:ho},Br={class:"gap-8 inline-flex items-center relative select-none"},Er={key:0,class:"fm-typo-body-sm-400 justify-center"},Vr=r.defineComponent({__name:"FmBadge",props:{inline:{type:Boolean,default:!1},value:{default:null},variant:{default:"neutral"}},setup(n){const t=n,e=r.computed(()=>t.value&&t.value>99?"99+":t.value);return(s,o)=>(r.openBlock(),r.createElementBlock("div",Br,[r.renderSlot(s.$slots,"default",{},void 0,!0),r.createElementVNode("div",{class:r.normalizeClass(["fm-badge",`fm-badge--${s.variant}`,{absolute:!s.inline,"top-0 right-0 w-[6px] h-[6px]":t.value===null,"top-[-2px] right-[-4px] w-[16px] h-[16px]":t.value&&t.value<10,"top-[-2px] right-[-12px] px-4 h-[20px] min-w-[24px]":t.value&&t.value>10&&t.value<100,"top-[-2px] right-[-20px] px-4 h-[20px] min-w-[24px]":t.value&&t.value>99}])},[t.value!==null?(r.openBlock(),r.createElementBlock("span",Er,r.toDisplayString(e.value),1)):r.createCommentVNode("",!0)],2)]))}}),Ug="",et=(n,t)=>{const e=n.__vccOpts||n;for(const[s,o]of t)e[s]=o;return e},hn=et(Vr,[["__scopeId","data-v-02018628"]]),Pr={class:"content-start flex flex-wrap gap-0 items-start max-w-full p-0"},Or=["onMouseenter"],Ar={key:0},Fr=r.defineComponent({__name:"FmBreadcrumb",props:{items:{}},setup(n){const t=n,e=jt.useRoute(),s=jt.useRouter();r.onMounted(async()=>{await s.isReady();const m=t.items.findIndex(g=>g.route==e.path);m!=-1&&!t.items[m].disabled&&(o.value=m)});const o=r.ref(-1),i=r.ref(-1),a=r.ref(" / "),l=r.ref("... /"),c=r.ref(!1),d=m=>o.value===m?"selected":i.value===m?"hovered":t.items[m].disabled?"disabled":"default",h=m=>{t.items[m].disabled||(o.value=m)},f=m=>m!=t.items.length-1,u=m=>!c.value&&t.items.length>5&&m>=2&&m<t.items.length-2,p=()=>{c.value=!c.value};return(m,g)=>{const b=r.resolveComponent("RouterLink");return r.openBlock(),r.createElementBlock("nav",null,[r.createElementVNode("ul",Pr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.items,(_,y)=>(r.openBlock(),r.createElementBlock("li",{key:y,class:"empty:hidden flex gap-2 items-center justify-center pl-2 pr-0 py-1",onMouseenter:k=>i.value=y,onMouseleave:g[0]||(g[0]=k=>i.value=-1)},[u(y)?y===3&&!c.value?(r.openBlock(),r.createElementBlock("a",{key:1,onClick:p},r.toDisplayString(l.value),1)):r.createCommentVNode("",!0):(r.openBlock(),r.createBlock(b,{key:0,class:r.normalizeClass(d(y)),to:_.disabled?"":_.route,onClick:k=>h(y)},{default:r.withCtx(()=>[r.createElementVNode("span",null,r.toDisplayString(_.label),1),f(y)?(r.openBlock(),r.createElementBlock("span",Ar,r.toDisplayString(a.value),1)):r.createCommentVNode("",!0)]),_:2},1032,["class","to","onClick"]))],40,Or))),128))])])}}}),qg="",Tr=/^(#)((?:[A-Fa-f0-9]{3}){1,2})$/,Nr=/^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}[)]$/,$r=/^^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*[)]$/,Lr=/^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*[)]$/,Rr=/^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 rs(n){return[Tr,Nr,$r,Lr,Rr].some(t=>t.test(n))}const Ir=r.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=r.computed(()=>{const i=[],a={};return i.push(s()),i.push(o()),rs(t.color)?a.color=t.color:i.push(`text-fm-color-${t.color}`),{class:i.join(" "),style:a}});function s(){return`fm-icon--${t.outline?"outlined":"rounded"}`}function o(){return`fm-icon--${t.size}`}return(i,a)=>(r.openBlock(),r.createElementBlock("span",r.mergeProps(e.value,{class:"fm-icon"}),r.toDisplayString(t.name),17))}}),Xg="",R=et(Ir,[["__scopeId","data-v-fd802d37"]]),zr=["disabled","type"],Wr={key:1,class:"fm-typo-body-lg-700"},jr=r.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=r.ref(!1),s=r.computed(()=>`${o[t.variant]} ${t.disabled?"cursor-not-allowed":"cursor-pointer"}`),o={primary:"bg-fm-color-primary text-fm-color-typo-white rounded-lg",secondary:"bg-transparent rounded-lg",destructive:"bg-fm-color-system-error-300 text-fm-color-white text-fm-color-typo-white rounded-lg",tertiary:"bg-transparent text-fm-color-primary rounded-lg",fab:"bg-fm-color-primary text-fm-color-white rounded-full text-fm-color-typo-white rounded-xxxl"};function i(a){e.value=a}return(a,l)=>{const c=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("button",{ref:"buttonEl",class:r.normalizeClass(`
2
2
  fm-btn
3
3
  ${s.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:l[0]||(l[0]=()=>i(!0)),onMouseup:l[1]||(l[1]=()=>i(!1)),onMouseleave:l[2]||(l[2]=()=>i(!1))},[a.icon?(r.openBlock(),r.createBlock(R,{key:0,name:a.icon,outline:!e.value,color:a.disabled?"neutral-gray-200":a.iconColor??"",size:"md"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),a.label?(r.openBlock(),r.createElementBlock("span",Cr,r.toDisplayString(a.label),1)):r.createCommentVNode("",!0)],42,wr)),[[c,!a.disabled]])}}}),Vg="",xt=et(Mr,[["__scopeId","data-v-d942a068"]]),Sr={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},Dr=["v-wave","disabled","onClick","onMousedown"],Br=r.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=c=>{t("update:modelValue",c)},o=r.ref(null),i=c=>{o.value=c},a=c=>c.disabled||e.disabled,l=c=>JSON.stringify(c)===JSON.stringify(e.modelValue);return(c,d)=>(r.openBlock(),r.createElementBlock("div",Sr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.items,(h,f)=>(r.openBlock(),r.createElementBlock("button",{key:f,"v-wave":a(h),class:r.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":l(h),"hover:bg-fm-color-neutral-white cursor-not-allowed":a(h)}]),disabled:a(h),onClick:u=>s(h),onMousedown:u=>i(h),onMouseup:d[0]||(d[0]=u=>i(null)),onMouseleave:d[1]||(d[1]=u=>i(null))},[h.icon?(r.openBlock(),r.createBlock(R,{key:0,name:h.icon,size:"md",color:a(h)?"neutral-gray-200":l(h)?"primary":"",outline:JSON.stringify(o.value)!==JSON.stringify(h)&&!l(h)},null,8,["name","color","outline"])):r.createCommentVNode("",!0),h.label?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-lg-700",[a(h)?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},r.toDisplayString(h.label),3)):r.createCommentVNode("",!0)],42,Dr))),128))]))}}),vr={class:"grow"},no=r.defineComponent({__name:"FmCardTitle",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card-title",n.padding])},[r.createElementVNode("div",vr,[r.renderSlot(t.$slots,"default")]),r.renderSlot(t.$slots,"actions")],2))}}),Er={class:"fm-typo-title-md-700 grow"},Vr=r.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=r.useSlots();return(s,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex-nowrap fm-card",`${n.variant==="elevated"?"fm-shadow-light-400":"border-1"} ${n.horizontal?"fm-card--horizontal":""}`])},[r.renderSlot(s.$slots,"header",{title:t.title},()=>[n.title||r.unref(e)["header-title"]||r.unref(e)["header-actions"]?(r.openBlock(),r.createBlock(no,{key:0},{actions:r.withCtx(()=>[r.renderSlot(s.$slots,"header-actions")]),default:r.withCtx(()=>[r.createElementVNode("div",null,[r.renderSlot(s.$slots,"header-title",{title:t.title},()=>[r.createElementVNode("div",Er,r.toDisplayString(t.title),1)])])]),_:3})):r.createCommentVNode("",!0)]),r.renderSlot(s.$slots,"default"),r.renderSlot(s.$slots,"actions")],2))}}),Pg="",Pr=r.defineComponent({__name:"FmCardActions",props:{alignment:{type:String,default:"right"},padding:{type:String,default:"p-16"}},setup(n){const t=n,e=r.computed(()=>{switch(t.alignment){case"left":return"justify-start";case"right":return"justify-end";case"center":return"justify-center";default:return""}});return(s,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card-actions",`${e.value} ${n.padding}`])},[r.renderSlot(s.$slots,"default")],2))}}),Ar=r.defineComponent({__name:"FmCardSection",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card-section",n.padding])},[r.renderSlot(t.$slots,"default")],2))}}),so=r.defineComponent({__name:"FmChip",props:{label:{default:""},icon:{default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},emits:["chip-closed"],setup(n,{emit:t}){const e=n,s=r.ref(!1),o=r.ref(!1);function i(c){e.selectable&&(o.value=c)}const a=()=>{!e.selectable||e.disabled||(s.value=!s.value)},l=()=>{e.disabled||t("chip-closed")};return r.onMounted(()=>{s.value=e.selected}),r.watch(()=>e.selected,()=>{s.value=e.selected}),(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["inline-flex rounded-md items-center gap-4 justify-center max-w-[200px]",s.value&&!c.disabled?"bg-fm-color-neutral-black":"bg-fm-color-neutral-gray-100",c.compact?"h-[22px] px-8":"h-[30px] px-8 py-4",{"bg-fm-color-neutral-gray-100 cursor-not-allowed":c.disabled,"cursor-pointer":c.selectable&&!c.disabled,"hover:bg-fm-color-opacity-sm":!s.value&&!c.disabled&&c.selectable}]),onClick:a,onMousedown:d[0]||(d[0]=()=>i(!0)),onMouseup:d[1]||(d[1]=()=>i(!1)),onMouseleave:d[2]||(d[2]=()=>i(!1))},[r.renderSlot(c.$slots,"default",{},()=>[c.icon?(r.openBlock(),r.createBlock(R,{key:0,name:c.icon,size:"sm",outline:!o.value&&!s.value,color:c.disabled?"neutral-gray-200":s.value?"neutral-white":"neutral-black"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),c.label?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["fm-typo-body-md-700 select-none text-ellipsis overflow-hidden whitespace-nowrap",c.disabled?"text-fm-color-typo-disabled":s.value?"text-fm-color-typo-white":"text-fm-color-typo-primary"])},r.toDisplayString(c.label),3)):r.createCommentVNode("",!0)]),c.removable?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["flex items-center justify-center rounded-xxxl",!s.value&&!c.disabled?"hover:bg-fm-color-opacity-sm":"",{"cursor-not-allowed":c.disabled,"cursor-pointer":c.selectable&&!c.disabled}]),onClick:l},[r.createVNode(R,{name:"close",size:"sm",color:c.disabled?"neutral-gray-200":s.value?"neutral-white":"neutral-black"},null,8,["color"])],2)):r.createCommentVNode("",!0)],34))}}),oo=r.defineComponent({__name:"FmChipGroup",props:{items:{},selectable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},removable:{type:Boolean,default:!1}},emits:["chip-closed"],setup(n,{emit:t}){const e=n,s=r.ref(null),o=r.ref(0),i=r.ref(null),a=r.ref(),l=()=>{var f,u;if(!s.value)return;const d=s.value.getBoundingClientRect();o.value>0&&i.value&&((f=a.value)==null||f.splice(i.value,1)),o.value=0;let h=0;Array.from(s.value.children).forEach((p,m)=>{const g=p.getBoundingClientRect(),b=g.y-d.y;h=Math.max(g.height*2+4,h),b>h&&(o.value+=1,i.value=i.value===null?m:m-o.value)}),o.value>0&&i.value&&((u=a.value)==null||u.splice(i.value,0,{label:`+${o.value}`,removable:!1,selectable:!1,compact:e.compact}))},c=d=>{t("chip-closed",d)};return r.onMounted(()=>{a.value=e.items,l(),new ResizeObserver(()=>{l()}).observe(s.value)}),r.watch(()=>e.items,()=>{a.value=e.items,l()}),(d,h)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"chipsContainer",ref:s,class:r.normalizeClass(["flex flex-wrap gap-4 items-center overflow-y-hidden",d.compact?"max-h-48":"max-h-64"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,(f,u)=>(r.openBlock(),r.createBlock(so,{key:u,label:f.label,icon:f.icon,selected:f.selected,removable:f.removable!==void 0?f.removable:d.removable,selectable:f.selectable!==void 0?f.selectable:d.selectable,disabled:f.disabled!==void 0?f.disabled:d.disabled,compact:d.compact,onChipClosed:p=>c(u)},null,8,["label","icon","selected","removable","selectable","disabled","compact","onChipClosed"]))),128))],2))}}),Or={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Fr={class:"overflow-y-auto"},Tr={class:"flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse"},Nr=r.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,s=r.ref(null),o=i=>{e.overlay&&s.value&&i.target===s.value&&t("update:modelValue",!1)};return(i,a)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[i.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:s,class:r.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":i.overlay}),onClick:a[1]||(a[1]=l=>o(l))},[r.createElementVNode("div",{class:r.normalizeClass(`fm-dialog min-w-[${i.minWidth}px]`)},[r.createElementVNode("div",Or,[r.renderSlot(i.$slots,"dialog-header"),i.closeButton?(r.openBlock(),r.createBlock(R,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:a[0]||(a[0]=l=>t("update:modelValue",!1))})):r.createCommentVNode("",!0)]),r.createElementVNode("div",Fr,[r.renderSlot(i.$slots,"dialog-content")]),r.createElementVNode("div",Tr,[r.renderSlot(i.$slots,"dialog-footer")])],2)],2)):r.createCommentVNode("",!0)]),_:3})]))}}),Ag="",$r={class:"fm-drop-field"},Lr=["accept","disabled"],Rr=r.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,s=r.ref(!1),o=r.ref(),i=r.ref(),a=r.ref(),l=w=>{e.disabled||(w.stopPropagation(),w.preventDefault())},c=w=>{e.disabled||(w.stopPropagation(),w.preventDefault(),s.value=!0)},d=w=>{e.disabled||(w.stopPropagation(),w.preventDefault(),s.value=!1)},h=w=>{e.disabled||(w.stopPropagation(),w.preventDefault(),s.value=!1,f(w))},f=w=>{var C;a.value=((C=w.dataTransfer)==null?void 0:C.files)??w.target.files;const x=a.value;if(o.value=p(x[0]),i.value=m(x[0]),o.value&&i.value)t("file-upload",x[0]);else{const S=u();t("file-rejected",[{file:x[0],reason:S}])}},u=()=>{const w=[];return o.value||w.push("invalid-type"),i.value||w.push("invalid-size"),w},p=w=>{if(!e.accept)return!0;const x=e.accept.split(",").map(C=>C.trim());for(const C of x)if(g(C)){if(_(C)===_(w.type))return!0}else if(b(w)===C||w.type===C)return!0;return!1},m=w=>w.size<=e.maxFileSize,g=w=>w.indexOf("*")!==-1,b=w=>"."+w.name.split(".").pop(),_=w=>w.substring(0,w.indexOf("/")),y=r.computed(()=>{if(s.value)return"Drop file to upload";if(o.value){if(!i.value)return`File size exceeds ${e.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),k=r.computed(()=>a.value?!o.value||!i.value:!1);return(w,x)=>(r.openBlock(),r.createElementBlock("label",$r,[r.renderSlot(w.$slots,"label",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[w.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},r.toDisplayString(w.label),3)],!0),r.createElementVNode("div",{class:r.normalizeClass(["fm-drop-field__container",{"fm-drop-field__container--dragging":s.value,"fm-drop-field__container--invalid":k.value&&!w.disabled,"fm-drop-field__container--disabled":w.disabled}]),onDragenter:l,onDragover:c,onDragleave:d,onDrop:h},[(s.value||k.value)&&!w.disabled?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass({"fm-typo-body-lg-700":!0,"text-fm-color-primary":s.value,"text-fm-color-typo-error":k.value})},r.toDisplayString(y.value),3)):(r.openBlock(),r.createBlock(xt,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:w.disabled},null,8,["disabled"])),r.renderSlot(w.$slots,"accept-text",{},()=>[e.accept?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-md-400",[w.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},r.toDisplayString(`Accepts ${e.accept}`),3)):r.createCommentVNode("",!0)],!0),r.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:w.accept,disabled:w.disabled,onChange:f},null,40,Lr)],34),r.renderSlot(w.$slots,"helper-text",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-sm-400",[w.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},r.toDisplayString(`Max size ${e.maxFileSize*1e-6}mb`),3)],!0)]))}}),Og="",zr=et(Rr,[["__scopeId","data-v-c914dc32"]]),Ir={},Wr={class:"flex-grow"};function Yr(n,t){return r.openBlock(),r.createElementBlock("div",Wr)}const io=et(Ir,[["render",Yr]]),ao=Symbol.for("fm:form"),ro=Symbol.for("fm:radio-group"),lo=Symbol.for("fm:stepper"),co=Symbol.for("fm:dialog"),jr={install:n=>{const t={open:e=>{const s={primary:[],secondary:[],tertiary:[]},o={onPrimary:d=>(s.primary.push(d),o),onSecondary:d=>(s.secondary.push(d),o),onTertiary:d=>(s.tertiary.push(d),o)};function i(){a&&r.render(null,a),a=null,c=null}let a=document.createElement("div");document.body.appendChild(a);const l=r.markRaw(ho);let c=r.createVNode(l,{...e,unmount:i,storedFunctions:s});return c.appContext=n._context,r.render(c,a),o}};n.config.globalProperties.$dialog=t,n.provide(co,t)}},Hr={key:0,class:"block relative"},Ur={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Xr={class:"fm-typo-title-md-700 text-fm-color-typo-primary"},qr={key:0,class:"overflow-y-auto"},Kr={key:1,class:"fm-typo-body-md-400 overflow-y-auto text-fm-color-neutral-black"},Gr={class:"flex gap-8 items-center justify-end sm:flex-col-reverse xs:flex-col-reverse"},ho=r.defineComponent({__name:"FmDynamicDialog",props:{title:{},message:{default:""},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:{default:null},contentComponentProps:{default:null},unmount:{type:Function,default:()=>{}},storedFunctions:{default:null}},emits:["dialog-opened","dialog-closed"],setup(n,{emit:t}){const e=n,s=r.ref(!0),o=r.ref(null),i=()=>{e.overlay&&(e.unmount(),t("dialog-closed"))},a=c=>{o.value&&c.target===o.value&&i()},l=(c,d)=>{e.storedFunctions[d].forEach(h=>h()),c.close&&i()};return r.onMounted(()=>{t("dialog-opened")}),(c,d)=>(r.openBlock(),r.createBlock(r.Transition,null,{default:r.withCtx(()=>[s.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:o,class:r.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":c.overlay}),onClick:a},[c.dialogComponent?(r.openBlock(),r.createElementBlock("div",Hr,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.dialogComponent),r.normalizeProps(r.guardReactiveProps(c.dialogComponentProps)),null,16)),c.closeButton?(r.openBlock(),r.createBlock(R,{key:0,class:"absolute cursor-pointer right-[12px] top-[18px]",name:"close",size:"md",onClick:i})):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",{key:1,class:"fm-dialog",style:r.normalizeStyle({"min-width":`${e.minWidth}px`})},[r.createElementVNode("div",Ur,[r.createElementVNode("div",Xr,r.toDisplayString(c.title),1),c.closeButton?(r.openBlock(),r.createBlock(R,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:i})):r.createCommentVNode("",!0)]),c.contentComponent?(r.openBlock(),r.createElementBlock("div",qr,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.contentComponent),r.normalizeProps(r.guardReactiveProps(c.contentComponentProps)),null,16))])):(r.openBlock(),r.createElementBlock("div",Kr,r.toDisplayString(c.message),1)),r.createElementVNode("div",Gr,[c.tertiaryActions?(r.openBlock(),r.createBlock(xt,{key:0,class:"sm:w-full xs:w-full",variant:"tertiary",label:c.tertiaryActions.text,size:"md",onClick:d[0]||(d[0]=h=>l(c.tertiaryActions,"tertiary"))},null,8,["label"])):r.createCommentVNode("",!0),r.createVNode(io,{class:"sm:hidden xs:hidden"}),c.secondaryActions?(r.openBlock(),r.createBlock(xt,{key:1,class:"sm:w-full xs:w-full",variant:"secondary",label:c.secondaryActions.text,size:"md",onClick:d[1]||(d[1]=h=>l(c.secondaryActions,"secondary"))},null,8,["label"])):r.createCommentVNode("",!0),c.primaryActions?(r.openBlock(),r.createBlock(xt,{key:2,class:"sm:w-full xs:w-full",variant:"primary",label:c.primaryActions.text,size:"md",onClick:d[2]||(d[2]=h=>l(c.primaryActions,"primary"))},null,8,["label"])):r.createCommentVNode("",!0)])],4))],2)):r.createCommentVNode("",!0)]),_:1}))}}),Fg="";/*!
8
+ `),disabled:a.disabled,type:a.type,onMousedown:l[0]||(l[0]=()=>i(!0)),onMouseup:l[1]||(l[1]=()=>i(!1)),onMouseleave:l[2]||(l[2]=()=>i(!1))},[a.icon?(r.openBlock(),r.createBlock(R,{key:0,name:a.icon,outline:!e.value,color:a.disabled?"neutral-gray-200":a.iconColor??"",size:"md"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),a.label?(r.openBlock(),r.createElementBlock("span",Wr,r.toDisplayString(a.label),1)):r.createCommentVNode("",!0)],42,zr)),[[c,!a.disabled]])}}}),Kg="",_t=et(jr,[["__scopeId","data-v-d942a068"]]),Yr={class:"bg-fm-color-neutral-white border-1 border-fm-color-neutral-gray-200 flex items-center overflow-hidden rounded-lg"},Hr=["v-wave","disabled","onClick","onMousedown"],Ur=r.defineComponent({__name:"FmButtonGroup",props:{modelValue:{},disabled:{type:Boolean},items:{}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=c=>{t("update:modelValue",c)},o=r.ref(null),i=c=>{o.value=c},a=c=>c.disabled||e.disabled,l=c=>JSON.stringify(c)===JSON.stringify(e.modelValue);return(c,d)=>(r.openBlock(),r.createElementBlock("div",Yr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.items,(h,f)=>(r.openBlock(),r.createElementBlock("button",{key:f,"v-wave":a(h),class:r.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":l(h),"hover:bg-fm-color-neutral-white cursor-not-allowed":a(h)}]),disabled:a(h),onClick:u=>s(h),onMousedown:u=>i(h),onMouseup:d[0]||(d[0]=u=>i(null)),onMouseleave:d[1]||(d[1]=u=>i(null))},[h.icon?(r.openBlock(),r.createBlock(R,{key:0,name:h.icon,size:"md",color:a(h)?"neutral-gray-200":l(h)?"primary":"",outline:JSON.stringify(o.value)!==JSON.stringify(h)&&!l(h)},null,8,["name","color","outline"])):r.createCommentVNode("",!0),h.label?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-lg-700",[a(h)?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},r.toDisplayString(h.label),3)):r.createCommentVNode("",!0)],42,Hr))),128))]))}}),qr={class:"grow"},fo=r.defineComponent({__name:"FmCardTitle",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card-title",n.padding])},[r.createElementVNode("div",qr,[r.renderSlot(t.$slots,"default")]),r.renderSlot(t.$slots,"actions")],2))}}),Xr={class:"fm-typo-title-md-700 grow"},Kr=r.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=r.useSlots();return(s,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex-nowrap fm-card",`${n.variant==="elevated"?"fm-shadow-light-400":"border-1"} ${n.horizontal?"fm-card--horizontal":""}`])},[r.renderSlot(s.$slots,"header",{title:t.title},()=>[n.title||r.unref(e)["header-title"]||r.unref(e)["header-actions"]?(r.openBlock(),r.createBlock(fo,{key:0},{actions:r.withCtx(()=>[r.renderSlot(s.$slots,"header-actions")]),default:r.withCtx(()=>[r.createElementVNode("div",null,[r.renderSlot(s.$slots,"header-title",{title:t.title},()=>[r.createElementVNode("div",Xr,r.toDisplayString(t.title),1)])])]),_:3})):r.createCommentVNode("",!0)]),r.renderSlot(s.$slots,"default"),r.renderSlot(s.$slots,"actions")],2))}}),Gg="",Gr=r.defineComponent({__name:"FmCardActions",props:{alignment:{type:String,default:"right"},padding:{type:String,default:"p-16"}},setup(n){const t=n,e=r.computed(()=>{switch(t.alignment){case"left":return"justify-start";case"right":return"justify-end";case"center":return"justify-center";default:return""}});return(s,o)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card-actions",`${e.value} ${n.padding}`])},[r.renderSlot(s.$slots,"default")],2))}}),Zr=r.defineComponent({__name:"FmCardSection",props:{padding:{type:String,default:"p-16"}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-card-section",n.padding])},[r.renderSlot(t.$slots,"default")],2))}}),uo=r.defineComponent({__name:"FmChip",props:{label:{default:""},icon:{default:""},selected:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},removable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},compact:{type:Boolean,default:!1}},emits:["chip-closed"],setup(n,{emit:t}){const e=n,s=r.ref(!1),o=r.ref(!1);function i(c){e.selectable&&(o.value=c)}const a=()=>{!e.selectable||e.disabled||(s.value=!s.value)},l=()=>{e.disabled||t("chip-closed")};return r.onMounted(()=>{s.value=e.selected}),r.watch(()=>e.selected,()=>{s.value=e.selected}),(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["inline-flex rounded-md items-center gap-4 justify-center max-w-[200px]",s.value&&!c.disabled?"bg-fm-color-neutral-black":"bg-fm-color-neutral-gray-100",c.compact?"h-[22px] px-8":"h-[30px] px-8 py-4",{"bg-fm-color-neutral-gray-100 cursor-not-allowed":c.disabled,"cursor-pointer":c.selectable&&!c.disabled,"hover:bg-fm-color-opacity-sm":!s.value&&!c.disabled&&c.selectable}]),onClick:a,onMousedown:d[0]||(d[0]=()=>i(!0)),onMouseup:d[1]||(d[1]=()=>i(!1)),onMouseleave:d[2]||(d[2]=()=>i(!1))},[r.renderSlot(c.$slots,"default",{},()=>[c.icon?(r.openBlock(),r.createBlock(R,{key:0,name:c.icon,size:"sm",outline:!o.value&&!s.value,color:c.disabled?"neutral-gray-200":s.value?"neutral-white":"neutral-black"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),c.label?(r.openBlock(),r.createElementBlock("div",{key:1,class:r.normalizeClass(["fm-typo-body-md-700 select-none text-ellipsis overflow-hidden whitespace-nowrap",c.disabled?"text-fm-color-typo-disabled":s.value?"text-fm-color-typo-white":"text-fm-color-typo-primary"])},r.toDisplayString(c.label),3)):r.createCommentVNode("",!0)]),c.removable?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["flex items-center justify-center rounded-xxxl",!s.value&&!c.disabled?"hover:bg-fm-color-opacity-sm":"",{"cursor-not-allowed":c.disabled,"cursor-pointer":c.selectable&&!c.disabled}]),onClick:l},[r.createVNode(R,{name:"close",size:"sm",color:c.disabled?"neutral-gray-200":s.value?"neutral-white":"neutral-black"},null,8,["color"])],2)):r.createCommentVNode("",!0)],34))}}),po=r.defineComponent({__name:"FmChipGroup",props:{items:{},selectable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},compact:{type:Boolean,default:!1},removable:{type:Boolean,default:!1}},emits:["chip-closed"],setup(n,{emit:t}){const e=n,s=r.ref(null),o=r.ref(0),i=r.ref(null),a=r.ref(),l=()=>{var f,u;if(!s.value)return;const d=s.value.getBoundingClientRect();o.value>0&&i.value&&((f=a.value)==null||f.splice(i.value,1)),o.value=0;let h=0;Array.from(s.value.children).forEach((p,m)=>{const g=p.getBoundingClientRect(),b=g.y-d.y;h=Math.max(g.height*2+4,h),b>h&&(o.value+=1,i.value=i.value===null?m:m-o.value)}),o.value>0&&i.value&&((u=a.value)==null||u.splice(i.value,0,{label:`+${o.value}`,removable:!1,selectable:!1,compact:e.compact}))},c=d=>{t("chip-closed",d)};return r.onMounted(()=>{a.value=e.items,l(),new ResizeObserver(()=>{l()}).observe(s.value)}),r.watch(()=>e.items,()=>{a.value=e.items,l()}),(d,h)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"chipsContainer",ref:s,class:r.normalizeClass(["flex flex-wrap gap-4 items-center overflow-y-hidden",d.compact?"max-h-48":"max-h-64"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,(f,u)=>(r.openBlock(),r.createBlock(uo,{key:u,label:f.label,icon:f.icon,selected:f.selected,removable:f.removable!==void 0?f.removable:d.removable,selectable:f.selectable!==void 0?f.selectable:d.selectable,disabled:f.disabled!==void 0?f.disabled:d.disabled,compact:d.compact,onChipClosed:p=>c(u)},null,8,["label","icon","selected","removable","selectable","disabled","compact","onChipClosed"]))),128))],2))}}),Jr={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},Qr={class:"overflow-y-auto"},tl={class:"flex gap-8 items-center sm:flex-col-reverse xs:flex-col-reverse"},el=r.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,s=r.ref(null),o=i=>{e.overlay&&s.value&&i.target===s.value&&t("update:modelValue",!1)};return(i,a)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[i.modelValue?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:s,class:r.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":i.overlay}),onClick:a[1]||(a[1]=l=>o(l))},[r.createElementVNode("div",{class:r.normalizeClass(`fm-dialog min-w-[${i.minWidth}px]`)},[r.createElementVNode("div",Jr,[r.renderSlot(i.$slots,"dialog-header"),i.closeButton?(r.openBlock(),r.createBlock(R,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:a[0]||(a[0]=l=>t("update:modelValue",!1))})):r.createCommentVNode("",!0)]),r.createElementVNode("div",Qr,[r.renderSlot(i.$slots,"dialog-content")]),r.createElementVNode("div",tl,[r.renderSlot(i.$slots,"dialog-footer")])],2)],2)):r.createCommentVNode("",!0)]),_:3})]))}}),Zg="",nl={class:"fm-drop-field"},sl=["accept","disabled"],ol=r.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,s=r.ref(!1),o=r.ref(),i=r.ref(),a=r.ref(),l=w=>{e.disabled||(w.stopPropagation(),w.preventDefault())},c=w=>{e.disabled||(w.stopPropagation(),w.preventDefault(),s.value=!0)},d=w=>{e.disabled||(w.stopPropagation(),w.preventDefault(),s.value=!1)},h=w=>{e.disabled||(w.stopPropagation(),w.preventDefault(),s.value=!1,f(w))},f=w=>{var C;a.value=((C=w.dataTransfer)==null?void 0:C.files)??w.target.files;const x=a.value;if(o.value=p(x[0]),i.value=m(x[0]),o.value&&i.value)t("file-upload",x[0]);else{const M=u();t("file-rejected",[{file:x[0],reason:M}])}},u=()=>{const w=[];return o.value||w.push("invalid-type"),i.value||w.push("invalid-size"),w},p=w=>{if(!e.accept)return!0;const x=e.accept.split(",").map(C=>C.trim());for(const C of x)if(g(C)){if(_(C)===_(w.type))return!0}else if(b(w)===C||w.type===C)return!0;return!1},m=w=>w.size<=e.maxFileSize,g=w=>w.indexOf("*")!==-1,b=w=>"."+w.name.split(".").pop(),_=w=>w.substring(0,w.indexOf("/")),y=r.computed(()=>{if(s.value)return"Drop file to upload";if(o.value){if(!i.value)return`File size exceeds ${e.maxFileSize*1e-6}mb`}else return"File type is not valid";return""}),k=r.computed(()=>a.value?!o.value||!i.value:!1);return(w,x)=>(r.openBlock(),r.createElementBlock("label",nl,[r.renderSlot(w.$slots,"label",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[w.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-primary"]])},r.toDisplayString(w.label),3)],!0),r.createElementVNode("div",{class:r.normalizeClass(["fm-drop-field__container",{"fm-drop-field__container--dragging":s.value,"fm-drop-field__container--invalid":k.value&&!w.disabled,"fm-drop-field__container--disabled":w.disabled}]),onDragenter:l,onDragover:c,onDragleave:d,onDrop:h},[(s.value||k.value)&&!w.disabled?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass({"fm-typo-body-lg-700":!0,"text-fm-color-primary":s.value,"text-fm-color-typo-error":k.value})},r.toDisplayString(y.value),3)):(r.openBlock(),r.createBlock(_t,{key:1,label:"Add files",size:"md",variant:"secondary",disabled:w.disabled},null,8,["disabled"])),r.renderSlot(w.$slots,"accept-text",{},()=>[e.accept?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-md-400",[w.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},r.toDisplayString(`Accepts ${e.accept}`),3)):r.createCommentVNode("",!0)],!0),r.createElementVNode("input",{type:"file",class:"fm-drop-field__input",accept:w.accept,disabled:w.disabled,onChange:f},null,40,sl)],34),r.renderSlot(w.$slots,"helper-text",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-sm-400",[w.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary"]])},r.toDisplayString(`Max size ${e.maxFileSize*1e-6}mb`),3)],!0)]))}}),Jg="",il=et(ol,[["__scopeId","data-v-c914dc32"]]),al={},rl={class:"flex-grow"};function ll(n,t){return r.openBlock(),r.createElementBlock("div",rl)}const mo=et(al,[["render",ll]]),go=Symbol.for("fm:form"),bo=Symbol.for("fm:radio-group"),yo=Symbol.for("fm:stepper"),_o=Symbol.for("fm:dialog"),cl={install:n=>{const t={open:e=>{const s={primary:[],secondary:[],tertiary:[]},o={onPrimary:d=>(s.primary.push(d),o),onSecondary:d=>(s.secondary.push(d),o),onTertiary:d=>(s.tertiary.push(d),o)};function i(){a&&r.render(null,a),a=null,c=null}let a=document.createElement("div");document.body.appendChild(a);const l=r.markRaw(xo);let c=r.createVNode(l,{...e,unmount:i,storedFunctions:s});return c.appContext=n._context,r.render(c,a),o}};n.config.globalProperties.$dialog=t,n.provide(_o,t)}},dl={key:0,class:"block relative"},hl={class:"flex fm-typo-title-sm-700 items-center justify-between text-fm-color-typo-primary"},fl={class:"fm-typo-title-md-700 text-fm-color-typo-primary"},ul={key:0,class:"overflow-y-auto"},pl={key:1,class:"fm-typo-body-md-400 overflow-y-auto text-fm-color-neutral-black"},ml={class:"flex gap-8 items-center justify-end sm:flex-col-reverse xs:flex-col-reverse"},xo=r.defineComponent({__name:"FmDynamicDialog",props:{title:{},message:{default:""},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:{default:null},contentComponentProps:{default:null},unmount:{type:Function,default:()=>{}},storedFunctions:{default:null}},emits:["dialog-opened","dialog-closed"],setup(n,{emit:t}){const e=n,s=r.ref(!0),o=r.ref(null),i=()=>{e.overlay&&(e.unmount(),t("dialog-closed"))},a=c=>{o.value&&c.target===o.value&&i()},l=(c,d)=>{e.storedFunctions[d].forEach(h=>h()),c.close&&i()};return r.onMounted(()=>{t("dialog-opened")}),(c,d)=>(r.openBlock(),r.createBlock(r.Transition,null,{default:r.withCtx(()=>[s.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"overlayRef",ref:o,class:r.normalizeClass({"fm-dialog--container":!0,"fm-dialog--overlay":c.overlay}),onClick:a},[c.dialogComponent?(r.openBlock(),r.createElementBlock("div",dl,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.dialogComponent),r.normalizeProps(r.guardReactiveProps(c.dialogComponentProps)),null,16)),c.closeButton?(r.openBlock(),r.createBlock(R,{key:0,class:"absolute cursor-pointer right-[12px] top-[18px]",name:"close",size:"md",onClick:i})):r.createCommentVNode("",!0)])):(r.openBlock(),r.createElementBlock("div",{key:1,class:"fm-dialog",style:r.normalizeStyle({"min-width":`${e.minWidth}px`})},[r.createElementVNode("div",hl,[r.createElementVNode("div",fl,r.toDisplayString(c.title),1),c.closeButton?(r.openBlock(),r.createBlock(R,{key:0,class:"cursor-pointer",name:"close",size:"md",onClick:i})):r.createCommentVNode("",!0)]),c.contentComponent?(r.openBlock(),r.createElementBlock("div",ul,[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(c.contentComponent),r.normalizeProps(r.guardReactiveProps(c.contentComponentProps)),null,16))])):(r.openBlock(),r.createElementBlock("div",pl,r.toDisplayString(c.message),1)),r.createElementVNode("div",ml,[c.tertiaryActions?(r.openBlock(),r.createBlock(_t,{key:0,class:"sm:w-full xs:w-full",variant:"tertiary",label:c.tertiaryActions.text,size:"md",onClick:d[0]||(d[0]=h=>l(c.tertiaryActions,"tertiary"))},null,8,["label"])):r.createCommentVNode("",!0),r.createVNode(mo,{class:"sm:hidden xs:hidden"}),c.secondaryActions?(r.openBlock(),r.createBlock(_t,{key:1,class:"sm:w-full xs:w-full",variant:"secondary",label:c.secondaryActions.text,size:"md",onClick:d[1]||(d[1]=h=>l(c.secondaryActions,"secondary"))},null,8,["label"])):r.createCommentVNode("",!0),c.primaryActions?(r.openBlock(),r.createBlock(_t,{key:2,class:"sm:w-full xs:w-full",variant:"primary",label:c.primaryActions.text,size:"md",onClick:d[2]||(d[2]=h=>l(c.primaryActions,"primary"))},null,8,["label"])):r.createCommentVNode("",!0)])],4))],2)):r.createCommentVNode("",!0)]),_:1}))}}),Qg="";/*!
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 Ee(n){return n+.5|0}const jt=(n,t,e)=>Math.max(Math.min(n,e),t);function Ve(n){return jt(Ee(n*2.55),0,255)}function Ht(n){return jt(Ee(n*255),0,255)}function Pt(n){return jt(Ee(n/2.55)/100,0,1)}function fo(n){return jt(Ee(n*100),0,100)}const kt={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},ss=[..."0123456789ABCDEF"],Zr=n=>ss[n&15],Jr=n=>ss[(n&240)>>4]+ss[n&15],dn=n=>(n&240)>>4===(n&15),Qr=n=>dn(n.r)&&dn(n.g)&&dn(n.b)&&dn(n.a);function tl(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&kt[n[1]]*17,g:255&kt[n[2]]*17,b:255&kt[n[3]]*17,a:t===5?kt[n[4]]*17:255}:(t===7||t===9)&&(e={r:kt[n[1]]<<4|kt[n[2]],g:kt[n[3]]<<4|kt[n[4]],b:kt[n[5]]<<4|kt[n[6]],a:t===9?kt[n[7]]<<4|kt[n[8]]:255})),e}const el=(n,t)=>n<255?t(n):"";function nl(n){var t=Qr(n)?Zr:Jr;return n?"#"+t(n.r)+t(n.g)+t(n.b)+el(n.a,t):void 0}const sl=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function uo(n,t,e){const s=t*Math.min(e,1-e),o=(i,a=(i+n/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[o(0),o(8),o(4)]}function ol(n,t,e){const s=(o,i=(o+n/60)%6)=>e-e*t*Math.max(Math.min(i,4-i,1),0);return[s(5),s(3),s(1)]}function il(n,t,e){const s=uo(n,1,.5);let o;for(t+e>1&&(o=1/(t+e),t*=o,e*=o),o=0;o<3;o++)s[o]*=1-t-e,s[o]+=t;return s}function al(n,t,e,s,o){return n===o?(t-e)/s+(t<e?6:0):t===o?(e-n)/s+2:(n-t)/s+4}function os(n){const e=n.r/255,s=n.g/255,o=n.b/255,i=Math.max(e,s,o),a=Math.min(e,s,o),l=(i+a)/2;let c,d,h;return i!==a&&(h=i-a,d=l>.5?h/(2-i-a):h/(i+a),c=al(e,s,o,h,i),c=c*60+.5),[c|0,d||0,l]}function is(n,t,e,s){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,s)).map(Ht)}function as(n,t,e){return is(uo,n,t,e)}function rl(n,t,e){return is(il,n,t,e)}function ll(n,t,e){return is(ol,n,t,e)}function po(n){return(n%360+360)%360}function cl(n){const t=sl.exec(n);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Ve(+t[5]):Ht(+t[5]));const o=po(+t[2]),i=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=rl(o,i,a):t[1]==="hsv"?s=ll(o,i,a):s=as(o,i,a),{r:s[0],g:s[1],b:s[2],a:e}}function dl(n,t){var e=os(n);e[0]=po(e[0]+t),e=as(e),n.r=e[0],n.g=e[1],n.b=e[2]}function hl(n){if(!n)return;const t=os(n),e=t[0],s=fo(t[1]),o=fo(t[2]);return n.a<255?`hsla(${e}, ${s}%, ${o}%, ${Pt(n.a)})`:`hsl(${e}, ${s}%, ${o}%)`}const mo={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"},go={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 fl(){const n={},t=Object.keys(go),e=Object.keys(mo);let s,o,i,a,l;for(s=0;s<t.length;s++){for(a=l=t[s],o=0;o<e.length;o++)i=e[o],l=l.replace(i,mo[i]);i=parseInt(go[a],16),n[l]=[i>>16&255,i>>8&255,i&255]}return n}let hn;function ul(n){hn||(hn=fl(),hn.transparent=[0,0,0,0]);const t=hn[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const pl=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ml(n){const t=pl.exec(n);let e=255,s,o,i;if(t){if(t[7]!==s){const a=+t[7];e=t[8]?Ve(a):jt(a*255,0,255)}return s=+t[1],o=+t[3],i=+t[5],s=255&(t[2]?Ve(s):jt(s,0,255)),o=255&(t[4]?Ve(o):jt(o,0,255)),i=255&(t[6]?Ve(i):jt(i,0,255)),{r:s,g:o,b:i,a:e}}}function gl(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Pt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const rs=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,xe=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function bl(n,t,e){const s=xe(Pt(n.r)),o=xe(Pt(n.g)),i=xe(Pt(n.b));return{r:Ht(rs(s+e*(xe(Pt(t.r))-s))),g:Ht(rs(o+e*(xe(Pt(t.g))-o))),b:Ht(rs(i+e*(xe(Pt(t.b))-i))),a:n.a+e*(t.a-n.a)}}function fn(n,t,e){if(n){let s=os(n);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=as(s),n.r=s[0],n.g=s[1],n.b=s[2]}}function bo(n,t){return n&&Object.assign(t||{},n)}function yo(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=Ht(n[3]))):(t=bo(n,{r:0,g:0,b:0,a:1}),t.a=Ht(t.a)),t}function yl(n){return n.charAt(0)==="r"?ml(n):cl(n)}class Pe{constructor(t){if(t instanceof Pe)return t;const e=typeof t;let s;e==="object"?s=yo(t):e==="string"&&(s=tl(t)||ul(t)||yl(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=bo(this._rgb);return t&&(t.a=Pt(t.a)),t}set rgb(t){this._rgb=yo(t)}rgbString(){return this._valid?gl(this._rgb):void 0}hexString(){return this._valid?nl(this._rgb):void 0}hslString(){return this._valid?hl(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,o=t.rgb;let i;const a=e===i?.5:e,l=2*a-1,c=s.a-o.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;i=1-d,s.r=255&d*s.r+i*o.r+.5,s.g=255&d*s.g+i*o.g+.5,s.b=255&d*s.b+i*o.b+.5,s.a=a*s.a+(1-a)*o.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=bl(this._rgb,t._rgb,e)),this}clone(){return new Pe(this.rgb)}alpha(t){return this._rgb.a=Ht(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ee(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 fn(this._rgb,2,t),this}darken(t){return fn(this._rgb,2,-t),this}saturate(t){return fn(this._rgb,1,t),this}desaturate(t){return fn(this._rgb,1,-t),this}rotate(t){return dl(this._rgb,t),this}}/*!
13
+ */function Ve(n){return n+.5|0}const Yt=(n,t,e)=>Math.max(Math.min(n,e),t);function Pe(n){return Yt(Ve(n*2.55),0,255)}function Ht(n){return Yt(Ve(n*255),0,255)}function Vt(n){return Yt(Ve(n/2.55)/100,0,1)}function ko(n){return Yt(Ve(n*100),0,100)}const xt={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},ls=[..."0123456789ABCDEF"],gl=n=>ls[n&15],bl=n=>ls[(n&240)>>4]+ls[n&15],fn=n=>(n&240)>>4===(n&15),yl=n=>fn(n.r)&&fn(n.g)&&fn(n.b)&&fn(n.a);function _l(n){var t=n.length,e;return n[0]==="#"&&(t===4||t===5?e={r:255&xt[n[1]]*17,g:255&xt[n[2]]*17,b:255&xt[n[3]]*17,a:t===5?xt[n[4]]*17:255}:(t===7||t===9)&&(e={r:xt[n[1]]<<4|xt[n[2]],g:xt[n[3]]<<4|xt[n[4]],b:xt[n[5]]<<4|xt[n[6]],a:t===9?xt[n[7]]<<4|xt[n[8]]:255})),e}const xl=(n,t)=>n<255?t(n):"";function kl(n){var t=yl(n)?gl:bl;return n?"#"+t(n.r)+t(n.g)+t(n.b)+xl(n.a,t):void 0}const wl=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function wo(n,t,e){const s=t*Math.min(e,1-e),o=(i,a=(i+n/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[o(0),o(8),o(4)]}function Cl(n,t,e){const s=(o,i=(o+n/60)%6)=>e-e*t*Math.max(Math.min(i,4-i,1),0);return[s(5),s(3),s(1)]}function Sl(n,t,e){const s=wo(n,1,.5);let o;for(t+e>1&&(o=1/(t+e),t*=o,e*=o),o=0;o<3;o++)s[o]*=1-t-e,s[o]+=t;return s}function Ml(n,t,e,s,o){return n===o?(t-e)/s+(t<e?6:0):t===o?(e-n)/s+2:(n-t)/s+4}function cs(n){const e=n.r/255,s=n.g/255,o=n.b/255,i=Math.max(e,s,o),a=Math.min(e,s,o),l=(i+a)/2;let c,d,h;return i!==a&&(h=i-a,d=l>.5?h/(2-i-a):h/(i+a),c=Ml(e,s,o,h,i),c=c*60+.5),[c|0,d||0,l]}function ds(n,t,e,s){return(Array.isArray(t)?n(t[0],t[1],t[2]):n(t,e,s)).map(Ht)}function hs(n,t,e){return ds(wo,n,t,e)}function vl(n,t,e){return ds(Sl,n,t,e)}function Dl(n,t,e){return ds(Cl,n,t,e)}function Co(n){return(n%360+360)%360}function Bl(n){const t=wl.exec(n);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Pe(+t[5]):Ht(+t[5]));const o=Co(+t[2]),i=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=vl(o,i,a):t[1]==="hsv"?s=Dl(o,i,a):s=hs(o,i,a),{r:s[0],g:s[1],b:s[2],a:e}}function El(n,t){var e=cs(n);e[0]=Co(e[0]+t),e=hs(e),n.r=e[0],n.g=e[1],n.b=e[2]}function Vl(n){if(!n)return;const t=cs(n),e=t[0],s=ko(t[1]),o=ko(t[2]);return n.a<255?`hsla(${e}, ${s}%, ${o}%, ${Vt(n.a)})`:`hsl(${e}, ${s}%, ${o}%)`}const So={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"},Mo={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 Pl(){const n={},t=Object.keys(Mo),e=Object.keys(So);let s,o,i,a,l;for(s=0;s<t.length;s++){for(a=l=t[s],o=0;o<e.length;o++)i=e[o],l=l.replace(i,So[i]);i=parseInt(Mo[a],16),n[l]=[i>>16&255,i>>8&255,i&255]}return n}let un;function Ol(n){un||(un=Pl(),un.transparent=[0,0,0,0]);const t=un[n.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Al=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Fl(n){const t=Al.exec(n);let e=255,s,o,i;if(t){if(t[7]!==s){const a=+t[7];e=t[8]?Pe(a):Yt(a*255,0,255)}return s=+t[1],o=+t[3],i=+t[5],s=255&(t[2]?Pe(s):Yt(s,0,255)),o=255&(t[4]?Pe(o):Yt(o,0,255)),i=255&(t[6]?Pe(i):Yt(i,0,255)),{r:s,g:o,b:i,a:e}}}function Tl(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${Vt(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const fs=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,xe=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Nl(n,t,e){const s=xe(Vt(n.r)),o=xe(Vt(n.g)),i=xe(Vt(n.b));return{r:Ht(fs(s+e*(xe(Vt(t.r))-s))),g:Ht(fs(o+e*(xe(Vt(t.g))-o))),b:Ht(fs(i+e*(xe(Vt(t.b))-i))),a:n.a+e*(t.a-n.a)}}function pn(n,t,e){if(n){let s=cs(n);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=hs(s),n.r=s[0],n.g=s[1],n.b=s[2]}}function vo(n,t){return n&&Object.assign(t||{},n)}function Do(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=Ht(n[3]))):(t=vo(n,{r:0,g:0,b:0,a:1}),t.a=Ht(t.a)),t}function $l(n){return n.charAt(0)==="r"?Fl(n):Bl(n)}class Oe{constructor(t){if(t instanceof Oe)return t;const e=typeof t;let s;e==="object"?s=Do(t):e==="string"&&(s=_l(t)||Ol(t)||$l(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=vo(this._rgb);return t&&(t.a=Vt(t.a)),t}set rgb(t){this._rgb=Do(t)}rgbString(){return this._valid?Tl(this._rgb):void 0}hexString(){return this._valid?kl(this._rgb):void 0}hslString(){return this._valid?Vl(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,o=t.rgb;let i;const a=e===i?.5:e,l=2*a-1,c=s.a-o.a,d=((l*c===-1?l:(l+c)/(1+l*c))+1)/2;i=1-d,s.r=255&d*s.r+i*o.r+.5,s.g=255&d*s.g+i*o.g+.5,s.b=255&d*s.b+i*o.b+.5,s.a=a*s.a+(1-a)*o.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=Nl(this._rgb,t._rgb,e)),this}clone(){return new Oe(this.rgb)}alpha(t){return this._rgb.a=Ht(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=Ve(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 pn(this._rgb,2,t),this}darken(t){return pn(this._rgb,2,-t),this}saturate(t){return pn(this._rgb,1,t),this}desaturate(t){return pn(this._rgb,1,-t),this}rotate(t){return El(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 At(){}const _l=(()=>{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 z(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Z(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function mt(n,t){return Z(n)?n:t}function L(n,t){return typeof n>"u"?t:n}const xl=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,_o=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function H(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function Y(n,t,e,s){let o,i,a;if(X(n))if(i=n.length,s)for(o=i-1;o>=0;o--)t.call(e,n[o],o);else for(o=0;o<i;o++)t.call(e,n[o],o);else if(z(n))for(a=Object.keys(n),i=a.length,o=0;o<i;o++)t.call(e,n[a[o]],a[o])}function un(n,t){let e,s,o,i;if(!n||!t||n.length!==t.length)return!1;for(e=0,s=n.length;e<s;++e)if(o=n[e],i=t[e],o.datasetIndex!==i.datasetIndex||o.index!==i.index)return!1;return!0}function pn(n){if(X(n))return n.map(pn);if(z(n)){const t=Object.create(null),e=Object.keys(n),s=e.length;let o=0;for(;o<s;++o)t[e[o]]=pn(n[e[o]]);return t}return n}function xo(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function kl(n,t,e,s){if(!xo(n))return;const o=t[n],i=e[n];z(o)&&z(i)?Ae(o,i,s):t[n]=pn(i)}function Ae(n,t,e){const s=X(t)?t:[t],o=s.length;if(!z(n))return n;e=e||{};const i=e.merger||kl;let a;for(let l=0;l<o;++l){if(a=s[l],!z(a))continue;const c=Object.keys(a);for(let d=0,h=c.length;d<h;++d)i(c[d],n,a,e)}return n}function Oe(n,t){return Ae(n,t,{merger:wl})}function wl(n,t,e){if(!xo(n))return;const s=t[n],o=e[n];z(s)&&z(o)?Oe(s,o):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=pn(o))}const ko={"":n=>n,x:n=>n.x,y:n=>n.y};function Cl(n){const t=n.split("."),e=[];let s="";for(const o of t)s+=o,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function Ml(n){const t=Cl(n);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Ut(n,t){return(ko[t]||(ko[t]=Ml(t)))(n)}function ls(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Fe=n=>typeof n<"u",Xt=n=>typeof n=="function",wo=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Sl(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const q=Math.PI,K=2*q,Dl=K+q,mn=Number.POSITIVE_INFINITY,Bl=q/180,tt=q/2,se=q/4,Co=q*2/3,qt=Math.log10,Dt=Math.sign;function Te(n,t,e){return Math.abs(n-t)<e}function Mo(n){const t=Math.round(n);n=Te(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(qt(n))),s=n/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function vl(n){const t=[],e=Math.sqrt(n);let s;for(s=1;s<e;s++)n%s===0&&(t.push(s),t.push(n/s));return e===(e|0)&&t.push(e),t.sort((o,i)=>o-i).pop(),t}function ke(n){return!isNaN(parseFloat(n))&&isFinite(n)}function El(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function So(n,t,e){let s,o,i;for(s=0,o=n.length;s<o;s++)i=n[s][e],isNaN(i)||(t.min=Math.min(t.min,i),t.max=Math.max(t.max,i))}function Mt(n){return n*(q/180)}function cs(n){return n*(180/q)}function Do(n){if(!Z(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function Bo(n,t){const e=t.x-n.x,s=t.y-n.y,o=Math.sqrt(e*e+s*s);let i=Math.atan2(s,e);return i<-.5*q&&(i+=K),{angle:i,distance:o}}function ds(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Vl(n,t){return(n-t+Dl)%K-q}function gt(n){return(n%K+K)%K}function Ne(n,t,e,s){const o=gt(n),i=gt(t),a=gt(e),l=gt(i-o),c=gt(a-o),d=gt(o-i),h=gt(o-a);return o===i||o===a||s&&i===a||l>c&&d<h}function ot(n,t,e){return Math.max(t,Math.min(e,n))}function Pl(n){return ot(n,-32768,32767)}function Ot(n,t,e,s=1e-6){return n>=Math.min(t,e)-s&&n<=Math.max(t,e)+s}function hs(n,t,e){e=e||(a=>n[a]<t);let s=n.length-1,o=0,i;for(;s-o>1;)i=o+s>>1,e(i)?o=i:s=i;return{lo:o,hi:s}}const Ft=(n,t,e,s)=>hs(n,e,s?o=>{const i=n[o][t];return i<e||i===e&&n[o+1][t]===e}:o=>n[o][t]<e),Al=(n,t,e)=>hs(n,e,s=>n[s][t]>=e);function Ol(n,t,e){let s=0,o=n.length;for(;s<o&&n[s]<t;)s++;for(;o>s&&n[o-1]>e;)o--;return s>0||o<n.length?n.slice(s,o):n}const vo=["push","pop","shift","splice","unshift"];function Fl(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),vo.forEach(e=>{const s="_onData"+ls(e),o=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...i){const a=o.apply(this,i);return n._chartjs.listeners.forEach(l=>{typeof l[s]=="function"&&l[s](...i)}),a}})})}function Eo(n,t){const e=n._chartjs;if(!e)return;const s=e.listeners,o=s.indexOf(t);o!==-1&&s.splice(o,1),!(s.length>0)&&(vo.forEach(i=>{delete n[i]}),delete n._chartjs)}function Vo(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Po=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Ao(n,t){let e=[],s=!1;return function(...o){e=o,s||(s=!0,Po.call(window,()=>{s=!1,n.apply(t,e)}))}}function Tl(n,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(n,t,s)):n.apply(this,s),t}}const fs=n=>n==="start"?"left":n==="end"?"right":"center",at=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,Nl=(n,t,e,s)=>n===(s?"left":"right")?e:n==="center"?(t+e)/2:t;function Oo(n,t,e){const s=t.length;let o=0,i=s;if(n._sorted){const{iScale:a,_parsed:l}=n,c=a.axis,{min:d,max:h,minDefined:f,maxDefined:u}=a.getUserBounds();f&&(o=ot(Math.min(Ft(l,c,d).lo,e?s:Ft(t,c,a.getPixelForValue(d)).lo),0,s-1)),u?i=ot(Math.max(Ft(l,a.axis,h,!0).hi+1,e?0:Ft(t,c,a.getPixelForValue(h),!0).hi+1),o,s)-o:i=s-o}return{start:o,count:i}}function Fo(n){const{xScale:t,yScale:e,_scaleRanges:s}=n,o={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return n._scaleRanges=o,!0;const i=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,o),i}const gn=n=>n===0||n===1,To=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*K/e)),No=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*K/e)+1,$e={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=>gn(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=>gn(n)?n:To(n,.075,.3),easeOutElastic:n=>gn(n)?n:No(n,.075,.3),easeInOutElastic(n){return gn(n)?n:n<.5?.5*To(n*2,.1125,.45):.5+.5*No(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-$e.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?$e.easeInBounce(n*2)*.5:$e.easeOutBounce(n*2-1)*.5+.5};function us(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function $o(n){return us(n)?n:new Pe(n)}function ps(n){return us(n)?n:new Pe(n).saturate(.5).darken(.1).hexString()}const $l=["x","y","borderWidth","radius","tension"],Ll=["color","borderColor","backgroundColor"];function Rl(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:$l}}),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 zl(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Lo=new Map;function Il(n,t){t=t||{};const e=n+JSON.stringify(t);let s=Lo.get(e);return s||(s=new Intl.NumberFormat(n,t),Lo.set(e,s)),s}function Le(n,t,e){return Il(t,e).format(n)}const Ro={values(n){return X(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const s=this.chart.options.locale;let o,i=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)&&(o="scientific"),i=Wl(n,e)}const a=qt(Math.abs(i)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:o,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Le(n,s,c)},logarithmic(n,t,e){if(n===0)return"0";const s=e[t].significand||n/Math.pow(10,Math.floor(qt(n)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?Ro.numeric.call(this,n,t,e):""}};function Wl(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 bn={formatters:Ro};function Yl(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:bn.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 oe=Object.create(null),ms=Object.create(null);function Re(n,t){if(!t)return n;const e=t.split(".");for(let s=0,o=e.length;s<o;++s){const i=e[s];n=n[i]||(n[i]=Object.create(null))}return n}function gs(n,t,e){return typeof t=="string"?Ae(Re(n,t),e):Ae(Re(n,""),t)}class jl{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,o)=>ps(o.backgroundColor),this.hoverBorderColor=(s,o)=>ps(o.borderColor),this.hoverColor=(s,o)=>ps(o.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 gs(this,t,e)}get(t){return Re(this,t)}describe(t,e){return gs(ms,t,e)}override(t,e){return gs(oe,t,e)}route(t,e,s,o){const i=Re(this,t),a=Re(this,s),l="_"+e;Object.defineProperties(i,{[l]:{value:i[e],writable:!0},[e]:{enumerable:!0,get(){const c=this[l],d=a[o];return z(c)?Object.assign({},d,c):L(c,d)},set(c){this[l]=c}}})}apply(t){t.forEach(e=>e(this))}}var J=new jl({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Rl,zl,Yl]);function Hl(n){return!n||I(n.size)||I(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function yn(n,t,e,s,o){let i=t[o];return i||(i=t[o]=n.measureText(o).width,e.push(o)),i>s&&(s=i),s}function Ul(n,t,e,s){s=s||{};let o=s.data=s.data||{},i=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(o=s.data={},i=s.garbageCollect=[],s.font=t),n.save(),n.font=t;let a=0;const l=e.length;let c,d,h,f,u;for(c=0;c<l;c++)if(f=e[c],f!=null&&!X(f))a=yn(n,o,i,a,f);else if(X(f))for(d=0,h=f.length;d<h;d++)u=f[d],u!=null&&!X(u)&&(a=yn(n,o,i,a,u));n.restore();const p=i.length/2;if(p>e.length){for(c=0;c<p;c++)delete o[i[c]];i.splice(0,p)}return a}function ie(n,t,e){const s=n.currentDevicePixelRatio,o=e!==0?Math.max(e/2,.5):0;return Math.round((t-o)*s)/s+o}function zo(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function bs(n,t,e,s){Io(n,t,e,s,null)}function Io(n,t,e,s,o){let i,a,l,c,d,h,f,u;const p=t.pointStyle,m=t.rotation,g=t.radius;let b=(m||0)*Bl;if(p&&typeof p=="object"&&(i=p.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){n.save(),n.translate(e,s),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:o?n.ellipse(e,s,o/2,g,0,0,K):n.arc(e,s,g,0,K),n.closePath();break;case"triangle":h=o?o/2:g,n.moveTo(e+Math.sin(b)*h,s-Math.cos(b)*g),b+=Co,n.lineTo(e+Math.sin(b)*h,s-Math.cos(b)*g),b+=Co,n.lineTo(e+Math.sin(b)*h,s-Math.cos(b)*g),n.closePath();break;case"rectRounded":d=g*.516,c=g-d,a=Math.cos(b+se)*c,f=Math.cos(b+se)*(o?o/2-d:c),l=Math.sin(b+se)*c,u=Math.sin(b+se)*(o?o/2-d:c),n.arc(e-f,s-l,d,b-q,b-tt),n.arc(e+u,s-a,d,b-tt,b),n.arc(e+f,s+l,d,b,b+tt),n.arc(e-u,s+a,d,b+tt,b+q),n.closePath();break;case"rect":if(!m){c=Math.SQRT1_2*g,h=o?o/2:c,n.rect(e-h,s-c,2*h,2*c);break}b+=se;case"rectRot":f=Math.cos(b)*(o?o/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(o?o/2:g),n.moveTo(e-f,s-l),n.lineTo(e+u,s-a),n.lineTo(e+f,s+l),n.lineTo(e-u,s+a),n.closePath();break;case"crossRot":b+=se;case"cross":f=Math.cos(b)*(o?o/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(o?o/2:g),n.moveTo(e-f,s-l),n.lineTo(e+f,s+l),n.moveTo(e+u,s-a),n.lineTo(e-u,s+a);break;case"star":f=Math.cos(b)*(o?o/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(o?o/2:g),n.moveTo(e-f,s-l),n.lineTo(e+f,s+l),n.moveTo(e+u,s-a),n.lineTo(e-u,s+a),b+=se,f=Math.cos(b)*(o?o/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(o?o/2:g),n.moveTo(e-f,s-l),n.lineTo(e+f,s+l),n.moveTo(e+u,s-a),n.lineTo(e-u,s+a);break;case"line":a=o?o/2:Math.cos(b)*g,l=Math.sin(b)*g,n.moveTo(e-a,s-l),n.lineTo(e+a,s+l);break;case"dash":n.moveTo(e,s),n.lineTo(e+Math.cos(b)*(o?o/2:g),s+Math.sin(b)*g);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Tt(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 _n(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function xn(n){n.restore()}function Xl(n,t,e,s,o){if(!t)return n.lineTo(e.x,e.y);if(o==="middle"){const i=(t.x+e.x)/2;n.lineTo(i,t.y),n.lineTo(i,e.y)}else o==="after"!=!!s?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function ql(n,t,e,s){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function Kl(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 Gl(n,t,e,s,o){if(o.strikethrough||o.underline){const i=n.measureText(s),a=t-i.actualBoundingBoxLeft,l=t+i.actualBoundingBoxRight,c=e-i.actualBoundingBoxAscent,d=e+i.actualBoundingBoxDescent,h=o.strikethrough?(c+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=o.decorationWidth||2,n.moveTo(a,h),n.lineTo(l,h),n.stroke()}}function Zl(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ae(n,t,e,s,o,i={}){const a=X(t)?t:[t],l=i.strokeWidth>0&&i.strokeColor!=="";let c,d;for(n.save(),n.font=o.string,Kl(n,i),c=0;c<a.length;++c)d=a[c],i.backdrop&&Zl(n,i.backdrop),l&&(i.strokeColor&&(n.strokeStyle=i.strokeColor),I(i.strokeWidth)||(n.lineWidth=i.strokeWidth),n.strokeText(d,e,s,i.maxWidth)),n.fillText(d,e,s,i.maxWidth),Gl(n,e,s,d,i),s+=Number(o.lineHeight);n.restore()}function ze(n,t){const{x:e,y:s,w:o,h:i,radius:a}=t;n.arc(e+a.topLeft,s+a.topLeft,a.topLeft,1.5*q,q,!0),n.lineTo(e,s+i-a.bottomLeft),n.arc(e+a.bottomLeft,s+i-a.bottomLeft,a.bottomLeft,q,tt,!0),n.lineTo(e+o-a.bottomRight,s+i),n.arc(e+o-a.bottomRight,s+i-a.bottomRight,a.bottomRight,tt,0,!0),n.lineTo(e+o,s+a.topRight),n.arc(e+o-a.topRight,s+a.topRight,a.topRight,0,-tt,!0),n.lineTo(e+a.topLeft,s)}const Jl=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ql=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function tc(n,t){const e=(""+n).match(Jl);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 ec=n=>+n||0;function ys(n,t){const e={},s=z(t),o=s?Object.keys(t):t,i=z(n)?s?a=>L(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of o)e[a]=ec(i(a));return e}function Wo(n){return ys(n,{top:"y",right:"x",bottom:"y",left:"x"})}function re(n){return ys(n,["topLeft","topRight","bottomLeft","bottomRight"])}function rt(n){const t=Wo(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function nt(n,t){n=n||{},t=t||J.font;let e=L(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=L(n.style,t.style);s&&!(""+s).match(Ql)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const o={family:L(n.family,t.family),lineHeight:tc(L(n.lineHeight,t.lineHeight),e),size:e,style:s,weight:L(n.weight,t.weight),string:""};return o.string=Hl(o),o}function Ie(n,t,e,s){let o=!0,i,a,l;for(i=0,a=n.length;i<a;++i)if(l=n[i],l!==void 0&&(t!==void 0&&typeof l=="function"&&(l=l(t),o=!1),e!==void 0&&X(l)&&(l=l[e%l.length],o=!1),l!==void 0))return s&&!o&&(s.cacheable=!1),l}function nc(n,t,e){const{min:s,max:o}=n,i=_o(t,(o-s)/2),a=(l,c)=>e&&l===0?0:l+c;return{min:a(s,-Math.abs(i)),max:a(o,i)}}function Kt(n,t){return Object.assign(Object.create(n),t)}function _s(n,t=[""],e,s,o=()=>n[0]){const i=e||n;typeof s>"u"&&(s=Xo("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:i,_fallback:s,_getTarget:o,override:l=>_s([l,...n],t,i,s)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete n[0][c],!0},get(l,c){return jo(l,c,()=>dc(c,t,n,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,c){return qo(l).includes(c)},ownKeys(l){return qo(l)},set(l,c,d){const h=l._storage||(l._storage=o());return l[c]=h[c]=d,delete l._keys,!0}})}function we(n,t,e,s){const o={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Yo(n,s),setContext:i=>we(n,i,e,s),override:i=>we(n.override(i),t,e,s)};return new Proxy(o,{deleteProperty(i,a){return delete i[a],delete n[a],!0},get(i,a,l){return jo(i,a,()=>oc(i,a,l))},getOwnPropertyDescriptor(i,a){return i._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(i,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(i,a,l){return n[a]=l,delete i[a],!0}})}function Yo(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:o=t.allKeys}=n;return{allKeys:o,scriptable:e,indexable:s,isScriptable:Xt(e)?e:()=>e,isIndexable:Xt(s)?s:()=>s}}const sc=(n,t)=>n?n+ls(t):t,xs=(n,t)=>z(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function jo(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const s=e();return n[t]=s,s}function oc(n,t,e){const{_proxy:s,_context:o,_subProxy:i,_descriptors:a}=n;let l=s[t];return Xt(l)&&a.isScriptable(t)&&(l=ic(t,l,n,e)),X(l)&&l.length&&(l=ac(t,l,n,a.isIndexable)),xs(t,l)&&(l=we(l,o,i&&i[t],a)),l}function ic(n,t,e,s){const{_proxy:o,_context:i,_subProxy:a,_stack:l}=e;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let c=t(i,a||s);return l.delete(n),xs(n,c)&&(c=ks(o._scopes,o,n,c)),c}function ac(n,t,e,s){const{_proxy:o,_context:i,_subProxy:a,_descriptors:l}=e;if(typeof i.index<"u"&&s(n))return t[i.index%t.length];if(z(t[0])){const c=t,d=o._scopes.filter(h=>h!==c);t=[];for(const h of c){const f=ks(d,o,n,h);t.push(we(f,i,a&&a[n],l))}}return t}function Ho(n,t,e){return Xt(n)?n(t,e):n}const rc=(n,t)=>n===!0?t:typeof n=="string"?Ut(t,n):void 0;function lc(n,t,e,s,o){for(const i of t){const a=rc(e,i);if(a){n.add(a);const l=Ho(a._fallback,e,o);if(typeof l<"u"&&l!==e&&l!==s)return l}else if(a===!1&&typeof s<"u"&&e!==s)return null}return!1}function ks(n,t,e,s){const o=t._rootScopes,i=Ho(t._fallback,e,s),a=[...n,...o],l=new Set;l.add(s);let c=Uo(l,a,e,i||e,s);return c===null||typeof i<"u"&&i!==e&&(c=Uo(l,a,i,c,s),c===null)?!1:_s(Array.from(l),[""],o,i,()=>cc(t,e,s))}function Uo(n,t,e,s,o){for(;e;)e=lc(n,t,e,s,o);return e}function cc(n,t,e){const s=n._getTarget();t in s||(s[t]={});const o=s[t];return X(o)&&z(e)?e:o||{}}function dc(n,t,e,s){let o;for(const i of t)if(o=Xo(sc(i,n),e),typeof o<"u")return xs(n,o)?ks(e,s,n,o):o}function Xo(n,t){for(const e of t){if(!e)continue;const s=e[n];if(typeof s<"u")return s}}function qo(n){let t=n._keys;return t||(t=n._keys=hc(n._scopes)),t}function hc(n){const t=new Set;for(const e of n)for(const s of Object.keys(e).filter(o=>!o.startsWith("_")))t.add(s);return Array.from(t)}function Ko(n,t,e,s){const{iScale:o}=n,{key:i="r"}=this._parsing,a=new Array(s);let l,c,d,h;for(l=0,c=s;l<c;++l)d=l+e,h=t[d],a[l]={r:o.parse(Ut(h,i),d)};return a}const fc=Number.EPSILON||1e-14,Ce=(n,t)=>t<n.length&&!n[t].skip&&n[t],Go=n=>n==="x"?"y":"x";function uc(n,t,e,s){const o=n.skip?t:n,i=t,a=e.skip?t:e,l=ds(i,o),c=ds(a,i);let d=l/(l+c),h=c/(l+c);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const f=s*d,u=s*h;return{previous:{x:i.x-f*(a.x-o.x),y:i.y-f*(a.y-o.y)},next:{x:i.x+u*(a.x-o.x),y:i.y+u*(a.y-o.y)}}}function pc(n,t,e){const s=n.length;let o,i,a,l,c,d=Ce(n,0);for(let h=0;h<s-1;++h)if(c=d,d=Ce(n,h+1),!(!c||!d)){if(Te(t[h],0,fc)){e[h]=e[h+1]=0;continue}o=e[h]/t[h],i=e[h+1]/t[h],l=Math.pow(o,2)+Math.pow(i,2),!(l<=9)&&(a=3/Math.sqrt(l),e[h]=o*a*t[h],e[h+1]=i*a*t[h])}}function mc(n,t,e="x"){const s=Go(e),o=n.length;let i,a,l,c=Ce(n,0);for(let d=0;d<o;++d){if(a=l,l=c,c=Ce(n,d+1),!l)continue;const h=l[e],f=l[s];a&&(i=(h-a[e])/3,l[`cp1${e}`]=h-i,l[`cp1${s}`]=f-i*t[d]),c&&(i=(c[e]-h)/3,l[`cp2${e}`]=h+i,l[`cp2${s}`]=f+i*t[d])}}function gc(n,t="x"){const e=Go(t),s=n.length,o=Array(s).fill(0),i=Array(s);let a,l,c,d=Ce(n,0);for(a=0;a<s;++a)if(l=c,c=d,d=Ce(n,a+1),!!c){if(d){const h=d[t]-c[t];o[a]=h!==0?(d[e]-c[e])/h:0}i[a]=l?d?Dt(o[a-1])!==Dt(o[a])?0:(o[a-1]+o[a])/2:o[a-1]:o[a]}pc(n,o,i),mc(n,i,t)}function kn(n,t,e){return Math.max(Math.min(n,e),t)}function bc(n,t){let e,s,o,i,a,l=Tt(n[0],t);for(e=0,s=n.length;e<s;++e)a=i,i=l,l=e<s-1&&Tt(n[e+1],t),i&&(o=n[e],a&&(o.cp1x=kn(o.cp1x,t.left,t.right),o.cp1y=kn(o.cp1y,t.top,t.bottom)),l&&(o.cp2x=kn(o.cp2x,t.left,t.right),o.cp2y=kn(o.cp2y,t.top,t.bottom)))}function yc(n,t,e,s,o){let i,a,l,c;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")gc(n,o);else{let d=s?n[n.length-1]:n[0];for(i=0,a=n.length;i<a;++i)l=n[i],c=uc(d,l,n[Math.min(i+1,a-(s?0:1))%a],t.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}t.capBezierPoints&&bc(n,e)}function Zo(){return typeof window<"u"&&typeof document<"u"}function ws(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function wn(n,t,e){let s;return typeof n=="string"?(s=parseInt(n,10),n.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=n,s}const Cn=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function _c(n,t){return Cn(n).getPropertyValue(t)}const xc=["top","right","bottom","left"];function le(n,t,e){const s={};e=e?"-"+e:"";for(let o=0;o<4;o++){const i=xc[o];s[i]=parseFloat(n[t+"-"+i+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const kc=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function wc(n,t){const e=n.touches,s=e&&e.length?e[0]:n,{offsetX:o,offsetY:i}=s;let a=!1,l,c;if(kc(o,i,n.target))l=o,c=i;else{const d=t.getBoundingClientRect();l=s.clientX-d.left,c=s.clientY-d.top,a=!0}return{x:l,y:c,box:a}}function ce(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:s}=t,o=Cn(e),i=o.boxSizing==="border-box",a=le(o,"padding"),l=le(o,"border","width"),{x:c,y:d,box:h}=wc(n,e),f=a.left+(h&&l.left),u=a.top+(h&&l.top);let{width:p,height:m}=t;return i&&(p-=a.width+l.width,m-=a.height+l.height),{x:Math.round((c-f)/p*e.width/s),y:Math.round((d-u)/m*e.height/s)}}function Cc(n,t,e){let s,o;if(t===void 0||e===void 0){const i=ws(n);if(!i)t=n.clientWidth,e=n.clientHeight;else{const a=i.getBoundingClientRect(),l=Cn(i),c=le(l,"border","width"),d=le(l,"padding");t=a.width-d.width-c.width,e=a.height-d.height-c.height,s=wn(l.maxWidth,i,"clientWidth"),o=wn(l.maxHeight,i,"clientHeight")}}return{width:t,height:e,maxWidth:s||mn,maxHeight:o||mn}}const Mn=n=>Math.round(n*10)/10;function Mc(n,t,e,s){const o=Cn(n),i=le(o,"margin"),a=wn(o.maxWidth,n,"clientWidth")||mn,l=wn(o.maxHeight,n,"clientHeight")||mn,c=Cc(n,t,e);let{width:d,height:h}=c;if(o.boxSizing==="content-box"){const u=le(o,"border","width"),p=le(o,"padding");d-=p.width+u.width,h-=p.height+u.height}return d=Math.max(0,d-i.width),h=Math.max(0,s?d/s:h-i.height),d=Mn(Math.min(d,a,c.maxWidth)),h=Mn(Math.min(h,l,c.maxHeight)),d&&!h&&(h=Mn(d/2)),(t!==void 0||e!==void 0)&&s&&c.height&&h>c.height&&(h=c.height,d=Mn(Math.floor(h*s))),{width:d,height:h}}function Jo(n,t,e){const s=t||1,o=Math.floor(n.height*s),i=Math.floor(n.width*s);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!==s||a.height!==o||a.width!==i?(n.currentDevicePixelRatio=s,a.height=o,a.width=i,n.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Sc=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 Qo(n,t){const e=_c(n,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function de(n,t,e,s){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Dc(n,t,e,s){return{x:n.x+e*(t.x-n.x),y:s==="middle"?e<.5?n.y:t.y:s==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Bc(n,t,e,s){const o={x:n.cp2x,y:n.cp2y},i={x:t.cp1x,y:t.cp1y},a=de(n,o,e),l=de(o,i,e),c=de(i,t,e),d=de(a,l,e),h=de(l,c,e);return de(d,h,e)}const vc=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,s){return e-s},leftForLtr(e,s){return e-s}}},Ec=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Me(n,t,e){return n?vc(t,e):Ec()}function ti(n,t){let e,s;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=s)}function ei(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function ni(n){return n==="angle"?{between:Ne,compare:Vl,normalize:gt}:{between:Ot,compare:(t,e)=>t-e,normalize:t=>t}}function si({start:n,end:t,count:e,loop:s,style:o}){return{start:n%e,end:t%e,loop:s&&(t-n+1)%e===0,style:o}}function Vc(n,t,e){const{property:s,start:o,end:i}=e,{between:a,normalize:l}=ni(s),c=t.length;let{start:d,end:h,loop:f}=n,u,p;if(f){for(d+=c,h+=c,u=0,p=c;u<p&&a(l(t[d%c][s]),o,i);++u)d--,h--;d%=c,h%=c}return h<d&&(h+=c),{start:d,end:h,loop:f,style:n.style}}function oi(n,t,e){if(!e)return[n];const{property:s,start:o,end:i}=e,a=t.length,{compare:l,between:c,normalize:d}=ni(s),{start:h,end:f,loop:u,style:p}=Vc(n,t,e),m=[];let g=!1,b=null,_,y,k;const w=()=>c(o,k,_)&&l(o,k)!==0,x=()=>l(i,_)===0||c(i,k,_),C=()=>g||w(),S=()=>!g||x();for(let M=h,v=h;M<=f;++M)y=t[M%a],!y.skip&&(_=d(y[s]),_!==k&&(g=c(_,o,i),b===null&&C()&&(b=l(_,o)===0?M:v),b!==null&&S()&&(m.push(si({start:b,end:M,loop:u,count:a,style:p})),b=null),v=M,k=_));return b!==null&&m.push(si({start:b,end:f,loop:u,count:a,style:p})),m}function ii(n,t){const e=[],s=n.segments;for(let o=0;o<s.length;o++){const i=oi(s[o],n.points,t);i.length&&e.push(...i)}return e}function Pc(n,t,e,s){let o=0,i=t-1;if(e&&!s)for(;o<t&&!n[o].skip;)o++;for(;o<t&&n[o].skip;)o++;for(o%=t,e&&(i+=o);i>o&&n[i%t].skip;)i--;return i%=t,{start:o,end:i}}function Ac(n,t,e,s){const o=n.length,i=[];let a=t,l=n[t],c;for(c=t+1;c<=e;++c){const d=n[c%o];d.skip||d.stop?l.skip||(s=!1,i.push({start:t%o,end:(c-1)%o,loop:s}),t=a=d.stop?c:null):(a=c,l.skip&&(t=c)),l=d}return a!==null&&i.push({start:t%o,end:a%o,loop:s}),i}function Oc(n,t){const e=n.points,s=n.options.spanGaps,o=e.length;if(!o)return[];const i=!!n._loop,{start:a,end:l}=Pc(e,o,i,s);if(s===!0)return ai(n,[{start:a,end:l,loop:i}],e,t);const c=l<a?l+o:l,d=!!n._fullLoop&&a===0&&l===o-1;return ai(n,Ac(e,a,c,d),e,t)}function ai(n,t,e,s){return!s||!s.setContext||!e?t:Fc(n,t,e,s)}function Fc(n,t,e,s){const o=n._chart.getContext(),i=ri(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,c=e.length,d=[];let h=i,f=t[0].start,u=f;function p(m,g,b,_){const y=l?-1:1;if(m!==g){for(m+=c;e[m%c].skip;)m-=y;for(;e[g%c].skip;)g+=y;m%c!==g%c&&(d.push({start:m%c,end:g%c,loop:b,style:_}),h=_,f=g%c)}}for(const m of t){f=l?f:m.start;let g=e[f%c],b;for(u=f+1;u<=m.end;u++){const _=e[u%c];b=ri(s.setContext(Kt(o,{type:"segment",p0:g,p1:_,p0DataIndex:(u-1)%c,p1DataIndex:u%c,datasetIndex:a}))),Tc(b,h)&&p(f,u-1,m.loop,h),g=_,h=b}f<u-1&&p(f,u-1,m.loop,h)}return d}function ri(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Tc(n,t){if(!t)return!1;const e=[],s=function(o,i){return us(i)?(e.includes(i)||e.push(i),e.indexOf(i)):i};return JSON.stringify(n,s)!==JSON.stringify(t,s)}/*!
18
+ */function Pt(){}const Ll=(()=>{let n=0;return()=>n++})();function z(n){return n===null||typeof n>"u"}function q(n){if(Array.isArray&&Array.isArray(n))return!0;const t=Object.prototype.toString.call(n);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function I(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Z(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function pt(n,t){return Z(n)?n:t}function L(n,t){return typeof n>"u"?t:n}const Rl=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/t,Bo=(n,t)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*t:+n;function H(n,t,e){if(n&&typeof n.call=="function")return n.apply(e,t)}function j(n,t,e,s){let o,i,a;if(q(n))if(i=n.length,s)for(o=i-1;o>=0;o--)t.call(e,n[o],o);else for(o=0;o<i;o++)t.call(e,n[o],o);else if(I(n))for(a=Object.keys(n),i=a.length,o=0;o<i;o++)t.call(e,n[a[o]],a[o])}function mn(n,t){let e,s,o,i;if(!n||!t||n.length!==t.length)return!1;for(e=0,s=n.length;e<s;++e)if(o=n[e],i=t[e],o.datasetIndex!==i.datasetIndex||o.index!==i.index)return!1;return!0}function gn(n){if(q(n))return n.map(gn);if(I(n)){const t=Object.create(null),e=Object.keys(n),s=e.length;let o=0;for(;o<s;++o)t[e[o]]=gn(n[e[o]]);return t}return n}function Eo(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Il(n,t,e,s){if(!Eo(n))return;const o=t[n],i=e[n];I(o)&&I(i)?Ae(o,i,s):t[n]=gn(i)}function Ae(n,t,e){const s=q(t)?t:[t],o=s.length;if(!I(n))return n;e=e||{};const i=e.merger||Il;let a;for(let l=0;l<o;++l){if(a=s[l],!I(a))continue;const c=Object.keys(a);for(let d=0,h=c.length;d<h;++d)i(c[d],n,a,e)}return n}function Fe(n,t){return Ae(n,t,{merger:zl})}function zl(n,t,e){if(!Eo(n))return;const s=t[n],o=e[n];I(s)&&I(o)?Fe(s,o):Object.prototype.hasOwnProperty.call(t,n)||(t[n]=gn(o))}const Vo={"":n=>n,x:n=>n.x,y:n=>n.y};function Wl(n){const t=n.split("."),e=[];let s="";for(const o of t)s+=o,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function jl(n){const t=Wl(n);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Ut(n,t){return(Vo[t]||(Vo[t]=jl(t)))(n)}function us(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Te=n=>typeof n<"u",qt=n=>typeof n=="function",Po=(n,t)=>{if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0};function Yl(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const X=Math.PI,K=2*X,Hl=K+X,bn=Number.POSITIVE_INFINITY,Ul=X/180,tt=X/2,se=X/4,Oo=X*2/3,Xt=Math.log10,Mt=Math.sign;function Ne(n,t,e){return Math.abs(n-t)<e}function Ao(n){const t=Math.round(n);n=Ne(n,t,n/1e3)?t:n;const e=Math.pow(10,Math.floor(Xt(n))),s=n/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function ql(n){const t=[],e=Math.sqrt(n);let s;for(s=1;s<e;s++)n%s===0&&(t.push(s),t.push(n/s));return e===(e|0)&&t.push(e),t.sort((o,i)=>o-i).pop(),t}function ke(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Xl(n,t){const e=Math.round(n);return e-t<=n&&e+t>=n}function Fo(n,t,e){let s,o,i;for(s=0,o=n.length;s<o;s++)i=n[s][e],isNaN(i)||(t.min=Math.min(t.min,i),t.max=Math.max(t.max,i))}function Ct(n){return n*(X/180)}function ps(n){return n*(180/X)}function To(n){if(!Z(n))return;let t=1,e=0;for(;Math.round(n*t)/t!==n;)t*=10,e++;return e}function No(n,t){const e=t.x-n.x,s=t.y-n.y,o=Math.sqrt(e*e+s*s);let i=Math.atan2(s,e);return i<-.5*X&&(i+=K),{angle:i,distance:o}}function ms(n,t){return Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2))}function Kl(n,t){return(n-t+Hl)%K-X}function mt(n){return(n%K+K)%K}function $e(n,t,e,s){const o=mt(n),i=mt(t),a=mt(e),l=mt(i-o),c=mt(a-o),d=mt(o-i),h=mt(o-a);return o===i||o===a||s&&i===a||l>c&&d<h}function st(n,t,e){return Math.max(t,Math.min(e,n))}function Gl(n){return st(n,-32768,32767)}function Ot(n,t,e,s=1e-6){return n>=Math.min(t,e)-s&&n<=Math.max(t,e)+s}function gs(n,t,e){e=e||(a=>n[a]<t);let s=n.length-1,o=0,i;for(;s-o>1;)i=o+s>>1,e(i)?o=i:s=i;return{lo:o,hi:s}}const At=(n,t,e,s)=>gs(n,e,s?o=>{const i=n[o][t];return i<e||i===e&&n[o+1][t]===e}:o=>n[o][t]<e),Zl=(n,t,e)=>gs(n,e,s=>n[s][t]>=e);function Jl(n,t,e){let s=0,o=n.length;for(;s<o&&n[s]<t;)s++;for(;o>s&&n[o-1]>e;)o--;return s>0||o<n.length?n.slice(s,o):n}const $o=["push","pop","shift","splice","unshift"];function Ql(n,t){if(n._chartjs){n._chartjs.listeners.push(t);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),$o.forEach(e=>{const s="_onData"+us(e),o=n[e];Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value(...i){const a=o.apply(this,i);return n._chartjs.listeners.forEach(l=>{typeof l[s]=="function"&&l[s](...i)}),a}})})}function Lo(n,t){const e=n._chartjs;if(!e)return;const s=e.listeners,o=s.indexOf(t);o!==-1&&s.splice(o,1),!(s.length>0)&&($o.forEach(i=>{delete n[i]}),delete n._chartjs)}function Ro(n){const t=new Set(n);return t.size===n.length?n:Array.from(t)}const Io=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function zo(n,t){let e=[],s=!1;return function(...o){e=o,s||(s=!0,Io.call(window,()=>{s=!1,n.apply(t,e)}))}}function tc(n,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(n,t,s)):n.apply(this,s),t}}const bs=n=>n==="start"?"left":n==="end"?"right":"center",at=(n,t,e)=>n==="start"?t:n==="end"?e:(t+e)/2,ec=(n,t,e,s)=>n===(s?"left":"right")?e:n==="center"?(t+e)/2:t;function Wo(n,t,e){const s=t.length;let o=0,i=s;if(n._sorted){const{iScale:a,_parsed:l}=n,c=a.axis,{min:d,max:h,minDefined:f,maxDefined:u}=a.getUserBounds();f&&(o=st(Math.min(At(l,c,d).lo,e?s:At(t,c,a.getPixelForValue(d)).lo),0,s-1)),u?i=st(Math.max(At(l,a.axis,h,!0).hi+1,e?0:At(t,c,a.getPixelForValue(h),!0).hi+1),o,s)-o:i=s-o}return{start:o,count:i}}function jo(n){const{xScale:t,yScale:e,_scaleRanges:s}=n,o={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return n._scaleRanges=o,!0;const i=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,o),i}const yn=n=>n===0||n===1,Yo=(n,t,e)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-t)*K/e)),Ho=(n,t,e)=>Math.pow(2,-10*n)*Math.sin((n-t)*K/e)+1,Le={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(X*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>yn(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=>yn(n)?n:Yo(n,.075,.3),easeOutElastic:n=>yn(n)?n:Ho(n,.075,.3),easeInOutElastic(n){return yn(n)?n:n<.5?.5*Yo(n*2,.1125,.45):.5+.5*Ho(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-Le.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?Le.easeInBounce(n*2)*.5:Le.easeOutBounce(n*2-1)*.5+.5};function ys(n){if(n&&typeof n=="object"){const t=n.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Uo(n){return ys(n)?n:new Oe(n)}function _s(n){return ys(n)?n:new Oe(n).saturate(.5).darken(.1).hexString()}const nc=["x","y","borderWidth","radius","tension"],sc=["color","borderColor","backgroundColor"];function oc(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:sc},numbers:{type:"number",properties:nc}}),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 ic(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const qo=new Map;function ac(n,t){t=t||{};const e=n+JSON.stringify(t);let s=qo.get(e);return s||(s=new Intl.NumberFormat(n,t),qo.set(e,s)),s}function Re(n,t,e){return ac(t,e).format(n)}const Xo={values(n){return q(n)?n:""+n},numeric(n,t,e){if(n===0)return"0";const s=this.chart.options.locale;let o,i=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)&&(o="scientific"),i=rc(n,e)}const a=Xt(Math.abs(i)),l=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),c={notation:o,minimumFractionDigits:l,maximumFractionDigits:l};return Object.assign(c,this.options.ticks.format),Re(n,s,c)},logarithmic(n,t,e){if(n===0)return"0";const s=e[t].significand||n/Math.pow(10,Math.floor(Xt(n)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?Xo.numeric.call(this,n,t,e):""}};function rc(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 _n={formatters:Xo};function lc(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:_n.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 oe=Object.create(null),xs=Object.create(null);function Ie(n,t){if(!t)return n;const e=t.split(".");for(let s=0,o=e.length;s<o;++s){const i=e[s];n=n[i]||(n[i]=Object.create(null))}return n}function ks(n,t,e){return typeof t=="string"?Ae(Ie(n,t),e):Ae(Ie(n,""),t)}class cc{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,o)=>_s(o.backgroundColor),this.hoverBorderColor=(s,o)=>_s(o.borderColor),this.hoverColor=(s,o)=>_s(o.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 ks(this,t,e)}get(t){return Ie(this,t)}describe(t,e){return ks(xs,t,e)}override(t,e){return ks(oe,t,e)}route(t,e,s,o){const i=Ie(this,t),a=Ie(this,s),l="_"+e;Object.defineProperties(i,{[l]:{value:i[e],writable:!0},[e]:{enumerable:!0,get(){const c=this[l],d=a[o];return I(c)?Object.assign({},d,c):L(c,d)},set(c){this[l]=c}}})}apply(t){t.forEach(e=>e(this))}}var J=new cc({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[oc,ic,lc]);function dc(n){return!n||z(n.size)||z(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function xn(n,t,e,s,o){let i=t[o];return i||(i=t[o]=n.measureText(o).width,e.push(o)),i>s&&(s=i),s}function hc(n,t,e,s){s=s||{};let o=s.data=s.data||{},i=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(o=s.data={},i=s.garbageCollect=[],s.font=t),n.save(),n.font=t;let a=0;const l=e.length;let c,d,h,f,u;for(c=0;c<l;c++)if(f=e[c],f!=null&&!q(f))a=xn(n,o,i,a,f);else if(q(f))for(d=0,h=f.length;d<h;d++)u=f[d],u!=null&&!q(u)&&(a=xn(n,o,i,a,u));n.restore();const p=i.length/2;if(p>e.length){for(c=0;c<p;c++)delete o[i[c]];i.splice(0,p)}return a}function ie(n,t,e){const s=n.currentDevicePixelRatio,o=e!==0?Math.max(e/2,.5):0;return Math.round((t-o)*s)/s+o}function Ko(n,t){t=t||n.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,n.width,n.height),t.restore()}function ws(n,t,e,s){Go(n,t,e,s,null)}function Go(n,t,e,s,o){let i,a,l,c,d,h,f,u;const p=t.pointStyle,m=t.rotation,g=t.radius;let b=(m||0)*Ul;if(p&&typeof p=="object"&&(i=p.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){n.save(),n.translate(e,s),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:o?n.ellipse(e,s,o/2,g,0,0,K):n.arc(e,s,g,0,K),n.closePath();break;case"triangle":h=o?o/2:g,n.moveTo(e+Math.sin(b)*h,s-Math.cos(b)*g),b+=Oo,n.lineTo(e+Math.sin(b)*h,s-Math.cos(b)*g),b+=Oo,n.lineTo(e+Math.sin(b)*h,s-Math.cos(b)*g),n.closePath();break;case"rectRounded":d=g*.516,c=g-d,a=Math.cos(b+se)*c,f=Math.cos(b+se)*(o?o/2-d:c),l=Math.sin(b+se)*c,u=Math.sin(b+se)*(o?o/2-d:c),n.arc(e-f,s-l,d,b-X,b-tt),n.arc(e+u,s-a,d,b-tt,b),n.arc(e+f,s+l,d,b,b+tt),n.arc(e-u,s+a,d,b+tt,b+X),n.closePath();break;case"rect":if(!m){c=Math.SQRT1_2*g,h=o?o/2:c,n.rect(e-h,s-c,2*h,2*c);break}b+=se;case"rectRot":f=Math.cos(b)*(o?o/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(o?o/2:g),n.moveTo(e-f,s-l),n.lineTo(e+u,s-a),n.lineTo(e+f,s+l),n.lineTo(e-u,s+a),n.closePath();break;case"crossRot":b+=se;case"cross":f=Math.cos(b)*(o?o/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(o?o/2:g),n.moveTo(e-f,s-l),n.lineTo(e+f,s+l),n.moveTo(e+u,s-a),n.lineTo(e-u,s+a);break;case"star":f=Math.cos(b)*(o?o/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(o?o/2:g),n.moveTo(e-f,s-l),n.lineTo(e+f,s+l),n.moveTo(e+u,s-a),n.lineTo(e-u,s+a),b+=se,f=Math.cos(b)*(o?o/2:g),a=Math.cos(b)*g,l=Math.sin(b)*g,u=Math.sin(b)*(o?o/2:g),n.moveTo(e-f,s-l),n.lineTo(e+f,s+l),n.moveTo(e+u,s-a),n.lineTo(e-u,s+a);break;case"line":a=o?o/2:Math.cos(b)*g,l=Math.sin(b)*g,n.moveTo(e-a,s-l),n.lineTo(e+a,s+l);break;case"dash":n.moveTo(e,s),n.lineTo(e+Math.cos(b)*(o?o/2:g),s+Math.sin(b)*g);break;case!1:n.closePath();break}n.fill(),t.borderWidth>0&&n.stroke()}}function Ft(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 kn(n,t){n.save(),n.beginPath(),n.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),n.clip()}function wn(n){n.restore()}function fc(n,t,e,s,o){if(!t)return n.lineTo(e.x,e.y);if(o==="middle"){const i=(t.x+e.x)/2;n.lineTo(i,t.y),n.lineTo(i,e.y)}else o==="after"!=!!s?n.lineTo(t.x,e.y):n.lineTo(e.x,t.y);n.lineTo(e.x,e.y)}function uc(n,t,e,s){if(!t)return n.lineTo(e.x,e.y);n.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function pc(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 mc(n,t,e,s,o){if(o.strikethrough||o.underline){const i=n.measureText(s),a=t-i.actualBoundingBoxLeft,l=t+i.actualBoundingBoxRight,c=e-i.actualBoundingBoxAscent,d=e+i.actualBoundingBoxDescent,h=o.strikethrough?(c+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=o.decorationWidth||2,n.moveTo(a,h),n.lineTo(l,h),n.stroke()}}function gc(n,t){const e=n.fillStyle;n.fillStyle=t.color,n.fillRect(t.left,t.top,t.width,t.height),n.fillStyle=e}function ae(n,t,e,s,o,i={}){const a=q(t)?t:[t],l=i.strokeWidth>0&&i.strokeColor!=="";let c,d;for(n.save(),n.font=o.string,pc(n,i),c=0;c<a.length;++c)d=a[c],i.backdrop&&gc(n,i.backdrop),l&&(i.strokeColor&&(n.strokeStyle=i.strokeColor),z(i.strokeWidth)||(n.lineWidth=i.strokeWidth),n.strokeText(d,e,s,i.maxWidth)),n.fillText(d,e,s,i.maxWidth),mc(n,e,s,d,i),s+=Number(o.lineHeight);n.restore()}function ze(n,t){const{x:e,y:s,w:o,h:i,radius:a}=t;n.arc(e+a.topLeft,s+a.topLeft,a.topLeft,1.5*X,X,!0),n.lineTo(e,s+i-a.bottomLeft),n.arc(e+a.bottomLeft,s+i-a.bottomLeft,a.bottomLeft,X,tt,!0),n.lineTo(e+o-a.bottomRight,s+i),n.arc(e+o-a.bottomRight,s+i-a.bottomRight,a.bottomRight,tt,0,!0),n.lineTo(e+o,s+a.topRight),n.arc(e+o-a.topRight,s+a.topRight,a.topRight,0,-tt,!0),n.lineTo(e+a.topLeft,s)}const bc=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,yc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function _c(n,t){const e=(""+n).match(bc);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 xc=n=>+n||0;function Cs(n,t){const e={},s=I(t),o=s?Object.keys(t):t,i=I(n)?s?a=>L(n[a],n[t[a]]):a=>n[a]:()=>n;for(const a of o)e[a]=xc(i(a));return e}function Zo(n){return Cs(n,{top:"y",right:"x",bottom:"y",left:"x"})}function re(n){return Cs(n,["topLeft","topRight","bottomLeft","bottomRight"])}function rt(n){const t=Zo(n);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function nt(n,t){n=n||{},t=t||J.font;let e=L(n.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=L(n.style,t.style);s&&!(""+s).match(yc)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const o={family:L(n.family,t.family),lineHeight:_c(L(n.lineHeight,t.lineHeight),e),size:e,style:s,weight:L(n.weight,t.weight),string:""};return o.string=dc(o),o}function We(n,t,e,s){let o=!0,i,a,l;for(i=0,a=n.length;i<a;++i)if(l=n[i],l!==void 0&&(t!==void 0&&typeof l=="function"&&(l=l(t),o=!1),e!==void 0&&q(l)&&(l=l[e%l.length],o=!1),l!==void 0))return s&&!o&&(s.cacheable=!1),l}function kc(n,t,e){const{min:s,max:o}=n,i=Bo(t,(o-s)/2),a=(l,c)=>e&&l===0?0:l+c;return{min:a(s,-Math.abs(i)),max:a(o,i)}}function Kt(n,t){return Object.assign(Object.create(n),t)}function Ss(n,t=[""],e,s,o=()=>n[0]){const i=e||n;typeof s>"u"&&(s=ni("_fallback",n));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:i,_fallback:s,_getTarget:o,override:l=>Ss([l,...n],t,i,s)};return new Proxy(a,{deleteProperty(l,c){return delete l[c],delete l._keys,delete n[0][c],!0},get(l,c){return Qo(l,c,()=>Ec(c,t,n,l))},getOwnPropertyDescriptor(l,c){return Reflect.getOwnPropertyDescriptor(l._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(l,c){return si(l).includes(c)},ownKeys(l){return si(l)},set(l,c,d){const h=l._storage||(l._storage=o());return l[c]=h[c]=d,delete l._keys,!0}})}function we(n,t,e,s){const o={_cacheable:!1,_proxy:n,_context:t,_subProxy:e,_stack:new Set,_descriptors:Jo(n,s),setContext:i=>we(n,i,e,s),override:i=>we(n.override(i),t,e,s)};return new Proxy(o,{deleteProperty(i,a){return delete i[a],delete n[a],!0},get(i,a,l){return Qo(i,a,()=>Cc(i,a,l))},getOwnPropertyDescriptor(i,a){return i._descriptors.allKeys?Reflect.has(n,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,a)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(i,a){return Reflect.has(n,a)},ownKeys(){return Reflect.ownKeys(n)},set(i,a,l){return n[a]=l,delete i[a],!0}})}function Jo(n,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:o=t.allKeys}=n;return{allKeys:o,scriptable:e,indexable:s,isScriptable:qt(e)?e:()=>e,isIndexable:qt(s)?s:()=>s}}const wc=(n,t)=>n?n+us(t):t,Ms=(n,t)=>I(t)&&n!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Qo(n,t,e){if(Object.prototype.hasOwnProperty.call(n,t))return n[t];const s=e();return n[t]=s,s}function Cc(n,t,e){const{_proxy:s,_context:o,_subProxy:i,_descriptors:a}=n;let l=s[t];return qt(l)&&a.isScriptable(t)&&(l=Sc(t,l,n,e)),q(l)&&l.length&&(l=Mc(t,l,n,a.isIndexable)),Ms(t,l)&&(l=we(l,o,i&&i[t],a)),l}function Sc(n,t,e,s){const{_proxy:o,_context:i,_subProxy:a,_stack:l}=e;if(l.has(n))throw new Error("Recursion detected: "+Array.from(l).join("->")+"->"+n);l.add(n);let c=t(i,a||s);return l.delete(n),Ms(n,c)&&(c=vs(o._scopes,o,n,c)),c}function Mc(n,t,e,s){const{_proxy:o,_context:i,_subProxy:a,_descriptors:l}=e;if(typeof i.index<"u"&&s(n))return t[i.index%t.length];if(I(t[0])){const c=t,d=o._scopes.filter(h=>h!==c);t=[];for(const h of c){const f=vs(d,o,n,h);t.push(we(f,i,a&&a[n],l))}}return t}function ti(n,t,e){return qt(n)?n(t,e):n}const vc=(n,t)=>n===!0?t:typeof n=="string"?Ut(t,n):void 0;function Dc(n,t,e,s,o){for(const i of t){const a=vc(e,i);if(a){n.add(a);const l=ti(a._fallback,e,o);if(typeof l<"u"&&l!==e&&l!==s)return l}else if(a===!1&&typeof s<"u"&&e!==s)return null}return!1}function vs(n,t,e,s){const o=t._rootScopes,i=ti(t._fallback,e,s),a=[...n,...o],l=new Set;l.add(s);let c=ei(l,a,e,i||e,s);return c===null||typeof i<"u"&&i!==e&&(c=ei(l,a,i,c,s),c===null)?!1:Ss(Array.from(l),[""],o,i,()=>Bc(t,e,s))}function ei(n,t,e,s,o){for(;e;)e=Dc(n,t,e,s,o);return e}function Bc(n,t,e){const s=n._getTarget();t in s||(s[t]={});const o=s[t];return q(o)&&I(e)?e:o||{}}function Ec(n,t,e,s){let o;for(const i of t)if(o=ni(wc(i,n),e),typeof o<"u")return Ms(n,o)?vs(e,s,n,o):o}function ni(n,t){for(const e of t){if(!e)continue;const s=e[n];if(typeof s<"u")return s}}function si(n){let t=n._keys;return t||(t=n._keys=Vc(n._scopes)),t}function Vc(n){const t=new Set;for(const e of n)for(const s of Object.keys(e).filter(o=>!o.startsWith("_")))t.add(s);return Array.from(t)}function oi(n,t,e,s){const{iScale:o}=n,{key:i="r"}=this._parsing,a=new Array(s);let l,c,d,h;for(l=0,c=s;l<c;++l)d=l+e,h=t[d],a[l]={r:o.parse(Ut(h,i),d)};return a}const Pc=Number.EPSILON||1e-14,Ce=(n,t)=>t<n.length&&!n[t].skip&&n[t],ii=n=>n==="x"?"y":"x";function Oc(n,t,e,s){const o=n.skip?t:n,i=t,a=e.skip?t:e,l=ms(i,o),c=ms(a,i);let d=l/(l+c),h=c/(l+c);d=isNaN(d)?0:d,h=isNaN(h)?0:h;const f=s*d,u=s*h;return{previous:{x:i.x-f*(a.x-o.x),y:i.y-f*(a.y-o.y)},next:{x:i.x+u*(a.x-o.x),y:i.y+u*(a.y-o.y)}}}function Ac(n,t,e){const s=n.length;let o,i,a,l,c,d=Ce(n,0);for(let h=0;h<s-1;++h)if(c=d,d=Ce(n,h+1),!(!c||!d)){if(Ne(t[h],0,Pc)){e[h]=e[h+1]=0;continue}o=e[h]/t[h],i=e[h+1]/t[h],l=Math.pow(o,2)+Math.pow(i,2),!(l<=9)&&(a=3/Math.sqrt(l),e[h]=o*a*t[h],e[h+1]=i*a*t[h])}}function Fc(n,t,e="x"){const s=ii(e),o=n.length;let i,a,l,c=Ce(n,0);for(let d=0;d<o;++d){if(a=l,l=c,c=Ce(n,d+1),!l)continue;const h=l[e],f=l[s];a&&(i=(h-a[e])/3,l[`cp1${e}`]=h-i,l[`cp1${s}`]=f-i*t[d]),c&&(i=(c[e]-h)/3,l[`cp2${e}`]=h+i,l[`cp2${s}`]=f+i*t[d])}}function Tc(n,t="x"){const e=ii(t),s=n.length,o=Array(s).fill(0),i=Array(s);let a,l,c,d=Ce(n,0);for(a=0;a<s;++a)if(l=c,c=d,d=Ce(n,a+1),!!c){if(d){const h=d[t]-c[t];o[a]=h!==0?(d[e]-c[e])/h:0}i[a]=l?d?Mt(o[a-1])!==Mt(o[a])?0:(o[a-1]+o[a])/2:o[a-1]:o[a]}Ac(n,o,i),Fc(n,i,t)}function Cn(n,t,e){return Math.max(Math.min(n,e),t)}function Nc(n,t){let e,s,o,i,a,l=Ft(n[0],t);for(e=0,s=n.length;e<s;++e)a=i,i=l,l=e<s-1&&Ft(n[e+1],t),i&&(o=n[e],a&&(o.cp1x=Cn(o.cp1x,t.left,t.right),o.cp1y=Cn(o.cp1y,t.top,t.bottom)),l&&(o.cp2x=Cn(o.cp2x,t.left,t.right),o.cp2y=Cn(o.cp2y,t.top,t.bottom)))}function $c(n,t,e,s,o){let i,a,l,c;if(t.spanGaps&&(n=n.filter(d=>!d.skip)),t.cubicInterpolationMode==="monotone")Tc(n,o);else{let d=s?n[n.length-1]:n[0];for(i=0,a=n.length;i<a;++i)l=n[i],c=Oc(d,l,n[Math.min(i+1,a-(s?0:1))%a],t.tension),l.cp1x=c.previous.x,l.cp1y=c.previous.y,l.cp2x=c.next.x,l.cp2y=c.next.y,d=l}t.capBezierPoints&&Nc(n,e)}function ai(){return typeof window<"u"&&typeof document<"u"}function Ds(n){let t=n.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Sn(n,t,e){let s;return typeof n=="string"?(s=parseInt(n,10),n.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=n,s}const Mn=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Lc(n,t){return Mn(n).getPropertyValue(t)}const Rc=["top","right","bottom","left"];function le(n,t,e){const s={};e=e?"-"+e:"";for(let o=0;o<4;o++){const i=Rc[o];s[i]=parseFloat(n[t+"-"+i+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const Ic=(n,t,e)=>(n>0||t>0)&&(!e||!e.shadowRoot);function zc(n,t){const e=n.touches,s=e&&e.length?e[0]:n,{offsetX:o,offsetY:i}=s;let a=!1,l,c;if(Ic(o,i,n.target))l=o,c=i;else{const d=t.getBoundingClientRect();l=s.clientX-d.left,c=s.clientY-d.top,a=!0}return{x:l,y:c,box:a}}function ce(n,t){if("native"in n)return n;const{canvas:e,currentDevicePixelRatio:s}=t,o=Mn(e),i=o.boxSizing==="border-box",a=le(o,"padding"),l=le(o,"border","width"),{x:c,y:d,box:h}=zc(n,e),f=a.left+(h&&l.left),u=a.top+(h&&l.top);let{width:p,height:m}=t;return i&&(p-=a.width+l.width,m-=a.height+l.height),{x:Math.round((c-f)/p*e.width/s),y:Math.round((d-u)/m*e.height/s)}}function Wc(n,t,e){let s,o;if(t===void 0||e===void 0){const i=Ds(n);if(!i)t=n.clientWidth,e=n.clientHeight;else{const a=i.getBoundingClientRect(),l=Mn(i),c=le(l,"border","width"),d=le(l,"padding");t=a.width-d.width-c.width,e=a.height-d.height-c.height,s=Sn(l.maxWidth,i,"clientWidth"),o=Sn(l.maxHeight,i,"clientHeight")}}return{width:t,height:e,maxWidth:s||bn,maxHeight:o||bn}}const vn=n=>Math.round(n*10)/10;function jc(n,t,e,s){const o=Mn(n),i=le(o,"margin"),a=Sn(o.maxWidth,n,"clientWidth")||bn,l=Sn(o.maxHeight,n,"clientHeight")||bn,c=Wc(n,t,e);let{width:d,height:h}=c;if(o.boxSizing==="content-box"){const u=le(o,"border","width"),p=le(o,"padding");d-=p.width+u.width,h-=p.height+u.height}return d=Math.max(0,d-i.width),h=Math.max(0,s?d/s:h-i.height),d=vn(Math.min(d,a,c.maxWidth)),h=vn(Math.min(h,l,c.maxHeight)),d&&!h&&(h=vn(d/2)),(t!==void 0||e!==void 0)&&s&&c.height&&h>c.height&&(h=c.height,d=vn(Math.floor(h*s))),{width:d,height:h}}function ri(n,t,e){const s=t||1,o=Math.floor(n.height*s),i=Math.floor(n.width*s);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!==s||a.height!==o||a.width!==i?(n.currentDevicePixelRatio=s,a.height=o,a.width=i,n.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Yc=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 li(n,t){const e=Lc(n,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function de(n,t,e,s){return{x:n.x+e*(t.x-n.x),y:n.y+e*(t.y-n.y)}}function Hc(n,t,e,s){return{x:n.x+e*(t.x-n.x),y:s==="middle"?e<.5?n.y:t.y:s==="after"?e<1?n.y:t.y:e>0?t.y:n.y}}function Uc(n,t,e,s){const o={x:n.cp2x,y:n.cp2y},i={x:t.cp1x,y:t.cp1y},a=de(n,o,e),l=de(o,i,e),c=de(i,t,e),d=de(a,l,e),h=de(l,c,e);return de(d,h,e)}const qc=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,s){return e-s},leftForLtr(e,s){return e-s}}},Xc=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,t){return n+t},leftForLtr(n,t){return n}}};function Se(n,t,e){return n?qc(t,e):Xc()}function ci(n,t){let e,s;(t==="ltr"||t==="rtl")&&(e=n.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),n.prevTextDirection=s)}function di(n,t){t!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",t[0],t[1]))}function hi(n){return n==="angle"?{between:$e,compare:Kl,normalize:mt}:{between:Ot,compare:(t,e)=>t-e,normalize:t=>t}}function fi({start:n,end:t,count:e,loop:s,style:o}){return{start:n%e,end:t%e,loop:s&&(t-n+1)%e===0,style:o}}function Kc(n,t,e){const{property:s,start:o,end:i}=e,{between:a,normalize:l}=hi(s),c=t.length;let{start:d,end:h,loop:f}=n,u,p;if(f){for(d+=c,h+=c,u=0,p=c;u<p&&a(l(t[d%c][s]),o,i);++u)d--,h--;d%=c,h%=c}return h<d&&(h+=c),{start:d,end:h,loop:f,style:n.style}}function ui(n,t,e){if(!e)return[n];const{property:s,start:o,end:i}=e,a=t.length,{compare:l,between:c,normalize:d}=hi(s),{start:h,end:f,loop:u,style:p}=Kc(n,t,e),m=[];let g=!1,b=null,_,y,k;const w=()=>c(o,k,_)&&l(o,k)!==0,x=()=>l(i,_)===0||c(i,k,_),C=()=>g||w(),M=()=>!g||x();for(let S=h,B=h;S<=f;++S)y=t[S%a],!y.skip&&(_=d(y[s]),_!==k&&(g=c(_,o,i),b===null&&C()&&(b=l(_,o)===0?S:B),b!==null&&M()&&(m.push(fi({start:b,end:S,loop:u,count:a,style:p})),b=null),B=S,k=_));return b!==null&&m.push(fi({start:b,end:f,loop:u,count:a,style:p})),m}function pi(n,t){const e=[],s=n.segments;for(let o=0;o<s.length;o++){const i=ui(s[o],n.points,t);i.length&&e.push(...i)}return e}function Gc(n,t,e,s){let o=0,i=t-1;if(e&&!s)for(;o<t&&!n[o].skip;)o++;for(;o<t&&n[o].skip;)o++;for(o%=t,e&&(i+=o);i>o&&n[i%t].skip;)i--;return i%=t,{start:o,end:i}}function Zc(n,t,e,s){const o=n.length,i=[];let a=t,l=n[t],c;for(c=t+1;c<=e;++c){const d=n[c%o];d.skip||d.stop?l.skip||(s=!1,i.push({start:t%o,end:(c-1)%o,loop:s}),t=a=d.stop?c:null):(a=c,l.skip&&(t=c)),l=d}return a!==null&&i.push({start:t%o,end:a%o,loop:s}),i}function Jc(n,t){const e=n.points,s=n.options.spanGaps,o=e.length;if(!o)return[];const i=!!n._loop,{start:a,end:l}=Gc(e,o,i,s);if(s===!0)return mi(n,[{start:a,end:l,loop:i}],e,t);const c=l<a?l+o:l,d=!!n._fullLoop&&a===0&&l===o-1;return mi(n,Zc(e,a,c,d),e,t)}function mi(n,t,e,s){return!s||!s.setContext||!e?t:Qc(n,t,e,s)}function Qc(n,t,e,s){const o=n._chart.getContext(),i=gi(n.options),{_datasetIndex:a,options:{spanGaps:l}}=n,c=e.length,d=[];let h=i,f=t[0].start,u=f;function p(m,g,b,_){const y=l?-1:1;if(m!==g){for(m+=c;e[m%c].skip;)m-=y;for(;e[g%c].skip;)g+=y;m%c!==g%c&&(d.push({start:m%c,end:g%c,loop:b,style:_}),h=_,f=g%c)}}for(const m of t){f=l?f:m.start;let g=e[f%c],b;for(u=f+1;u<=m.end;u++){const _=e[u%c];b=gi(s.setContext(Kt(o,{type:"segment",p0:g,p1:_,p0DataIndex:(u-1)%c,p1DataIndex:u%c,datasetIndex:a}))),td(b,h)&&p(f,u-1,m.loop,h),g=_,h=b}f<u-1&&p(f,u-1,m.loop,h)}return d}function gi(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function td(n,t){if(!t)return!1;const e=[],s=function(o,i){return ys(i)?(e.includes(i)||e.push(i),e.indexOf(i)):i};return JSON.stringify(n,s)!==JSON.stringify(t,s)}/*!
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 Nc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,o){const i=e.listeners[o],a=e.duration;i.forEach(l=>l({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Po.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,o)=>{if(!s.running||!s.items.length)return;const i=s.items;let a=i.length-1,l=!1,c;for(;a>=0;--a)c=i[a],c._active?(c._total>s.duration&&(s.duration=c._total),c.tick(t),l=!0):(i[a]=i[i.length-1],i.pop());l&&(o.draw(),this._notify(o,s,t,"progress")),i.length||(s.running=!1,this._notify(o,s,t,"complete"),s.initial=!1),e+=i.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,o)=>Math.max(s,o._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let o=s.length-1;for(;o>=0;--o)s[o].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Nt=new Nc;const li="transparent",$c={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const s=$o(n||li),o=s.valid&&$o(t||li);return o&&o.valid?o.mix(s,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class Lc{constructor(t,e,s,o){const i=e[s];o=Ie([t.to,o,i,t.from]);const a=Ie([t.from,i,o]);this._active=!0,this._fn=t.fn||$c[t.type||typeof a],this._easing=$e[t.easing]||$e.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=o,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const o=this._target[this._prop],i=s-this._start,a=this._duration-i;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=Ie([t.to,e,o,t.from]),this._from=Ie([t.from,o,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,o=this._prop,i=this._from,a=this._loop,l=this._to;let c;if(this._active=i!==l&&(a||e<s),!this._active){this._target[o]=l,this._notify(!0);return}if(e<0){this._target[o]=i;return}c=e/s%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[o]=this._fn(i,l,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let o=0;o<s.length;o++)s[o][e]()}}class ci{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!z(t))return;const e=Object.keys(J.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!z(i))return;const a={};for(const l of e)a[l]=i[l];(X(i.properties)&&i.properties||[o]).forEach(l=>{(l===o||!s.has(l))&&s.set(l,a)})})}_animateOptions(t,e){const s=e.options,o=zc(t,s);if(!o)return[];const i=this._createAnimations(o,s);return s.$shared&&Rc(t.options.$animations,s).then(()=>{t.options=s},()=>{}),i}_createAnimations(t,e){const s=this._properties,o=[],i=t.$animations||(t.$animations={}),a=Object.keys(e),l=Date.now();let c;for(c=a.length-1;c>=0;--c){const d=a[c];if(d.charAt(0)==="$")continue;if(d==="options"){o.push(...this._animateOptions(t,e));continue}const h=e[d];let f=i[d];const u=s.get(d);if(f)if(u&&f.active()){f.update(u,h,l);continue}else f.cancel();if(!u||!u.duration){t[d]=h;continue}i[d]=f=new Lc(u,t,d,h),o.push(f)}return o}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return Nt.add(this._chart,s),!0}}function Rc(n,t){const e=[],s=Object.keys(t);for(let o=0;o<s.length;o++){const i=n[s[o]];i&&i.active()&&e.push(i.wait())}return Promise.all(e)}function zc(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 di(n,t){const e=n&&n.options||{},s=e.reverse,o=e.min===void 0?t:0,i=e.max===void 0?t:0;return{start:s?i:o,end:s?o:i}}function Ic(n,t,e){if(e===!1)return!1;const s=di(n,e),o=di(t,e);return{top:o.end,right:s.end,bottom:o.start,left:s.start}}function Wc(n){let t,e,s,o;return z(n)?(t=n.top,e=n.right,s=n.bottom,o=n.left):t=e=s=o=n,{top:t,right:e,bottom:s,left:o,disabled:n===!1}}function hi(n,t){const e=[],s=n._getSortedDatasetMetas(t);let o,i;for(o=0,i=s.length;o<i;++o)e.push(s[o].index);return e}function fi(n,t,e,s={}){const o=n.keys,i=s.mode==="single";let a,l,c,d;if(t!==null){for(a=0,l=o.length;a<l;++a){if(c=+o[a],c===e){if(s.all)continue;break}d=n.values[c],Z(d)&&(i||t===0||Dt(t)===Dt(d))&&(t+=d)}return t}}function Yc(n){const t=Object.keys(n),e=new Array(t.length);let s,o,i;for(s=0,o=t.length;s<o;++s)i=t[s],e[s]={x:i,y:n[i]};return e}function ui(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function jc(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function Hc(n){const{min:t,max:e,minDefined:s,maxDefined:o}=n.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:o?e:Number.POSITIVE_INFINITY}}function Uc(n,t,e){const s=n[t]||(n[t]={});return s[e]||(s[e]={})}function pi(n,t,e,s){for(const o of t.getMatchingVisibleMetas(s).reverse()){const i=n[o.index];if(e&&i>0||!e&&i<0)return o.index}return null}function mi(n,t){const{chart:e,_cachedMeta:s}=n,o=e._stacks||(e._stacks={}),{iScale:i,vScale:a,index:l}=s,c=i.axis,d=a.axis,h=jc(i,a,s),f=t.length;let u;for(let p=0;p<f;++p){const m=t[p],{[c]:g,[d]:b}=m,_=m._stacks||(m._stacks={});u=_[d]=Uc(o,h,g),u[l]=b,u._top=pi(u,a,!0,s.type),u._bottom=pi(u,a,!1,s.type);const y=u._visualValues||(u._visualValues={});y[l]=b}}function Cs(n,t){const e=n.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function Xc(n,t){return Kt(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function qc(n,t,e){return Kt(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function We(n,t){const e=n.controller.index,s=n.vScale&&n.vScale.axis;if(s){t=t||n._parsed;for(const o of t){const i=o._stacks;if(!i||i[s]===void 0||i[s][e]===void 0)return;delete i[s][e],i[s]._visualValues!==void 0&&i[s]._visualValues[e]!==void 0&&delete i[s]._visualValues[e]}}}const Ms=n=>n==="reset"||n==="none",gi=(n,t)=>t?n:Object.assign({},n),Kc=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:hi(e,!0),values:null};class St{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=ui(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&&We(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),o=(f,u,p,m)=>f==="x"?u:f==="r"?m:p,i=e.xAxisID=L(s.xAxisID,Cs(t,"x")),a=e.yAxisID=L(s.yAxisID,Cs(t,"y")),l=e.rAxisID=L(s.rAxisID,Cs(t,"r")),c=e.indexAxis,d=e.iAxisID=o(c,i,a,l),h=e.vAxisID=o(c,a,i,l);e.xScale=this.getScaleForId(i),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),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&&Eo(this._data,this),t._stacked&&We(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(z(e))this._data=Yc(e);else if(s!==e){if(s){Eo(s,this);const o=this._cachedMeta;We(o),o._parsed=[]}e&&Object.isExtensible(e)&&Fl(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let o=!1;this._dataCheck();const i=e._stacked;e._stacked=ui(e.vScale,e),e.stack!==s.stack&&(o=!0,We(e),e.stack=s.stack),this._resyncElements(t),(o||i!==e._stacked)&&mi(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:o}=this,{iScale:i,_stacked:a}=s,l=i.axis;let c=t===0&&e===o.length?!0:s._sorted,d=t>0&&s._parsed[t-1],h,f,u;if(this._parsing===!1)s._parsed=o,s._sorted=!0,u=o;else{X(o[t])?u=this.parseArrayData(s,o,t,e):z(o[t])?u=this.parseObjectData(s,o,t,e):u=this.parsePrimitiveData(s,o,t,e);const p=()=>f[l]===null||d&&f[l]<d[l];for(h=0;h<e;++h)s._parsed[h+t]=f=u[h],c&&(p()&&(c=!1),d=f);s._sorted=c}a&&mi(this,u)}parsePrimitiveData(t,e,s,o){const{iScale:i,vScale:a}=t,l=i.axis,c=a.axis,d=i.getLabels(),h=i===a,f=new Array(o);let u,p,m;for(u=0,p=o;u<p;++u)m=u+s,f[u]={[l]:h||i.parse(d[m],m),[c]:a.parse(e[m],m)};return f}parseArrayData(t,e,s,o){const{xScale:i,yScale:a}=t,l=new Array(o);let c,d,h,f;for(c=0,d=o;c<d;++c)h=c+s,f=e[h],l[c]={x:i.parse(f[0],h),y:a.parse(f[1],h)};return l}parseObjectData(t,e,s,o){const{xScale:i,yScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(o);let h,f,u,p;for(h=0,f=o;h<f;++h)u=h+s,p=e[u],d[h]={x:i.parse(Ut(p,l),u),y:a.parse(Ut(p,c),u)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const o=this.chart,i=this._cachedMeta,a=e[t.axis],l={keys:hi(o,!0),values:e._stacks[t.axis]._visualValues};return fi(l,a,i.index,{mode:s})}updateRangeFromParsed(t,e,s,o){const i=s[e.axis];let a=i===null?NaN:i;const l=o&&s._stacks[e.axis];o&&l&&(o.values=l,a=fi(o,i,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const s=this._cachedMeta,o=s._parsed,i=s._sorted&&t===s.iScale,a=o.length,l=this._getOtherScale(t),c=Kc(e,s,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:f}=Hc(l);let u,p;function m(){p=o[u];const g=p[l.axis];return!Z(p[t.axis])||h>g||f<g}for(u=0;u<a&&!(!m()&&(this.updateRangeFromParsed(d,t,p,c),i));++u);if(i){for(u=a-1;u>=0;--u)if(!m()){this.updateRangeFromParsed(d,t,p,c);break}}return d}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let o,i,a;for(o=0,i=e.length;o<i;++o)a=e[o][t.axis],Z(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,o=e.vScale,i=this.getParsed(t);return{label:s?""+s.getLabelForValue(i[s.axis]):"",value:o?""+o.getLabelForValue(i[o.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Wc(L(this.options.clip,Ic(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,o=s.data||[],i=e.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||o.length-l,d=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,i,l,c),h=l;h<l+c;++h){const f=o[h];f.hidden||(f.active&&d?a.push(f):f.draw(t,i))}for(h=0;h<a.length;++h)a[h].draw(t,i)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const o=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];i=a.$context||(a.$context=qc(this.getContext(),t,a)),i.parsed=this.getParsed(t),i.raw=o.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=Xc(this.chart.getContext(),this.index)),i.dataset=o,i.index=i.datasetIndex=this.index;return i.active=!!e,i.mode=s,i}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const o=e==="active",i=this._cachedDataOpts,a=t+"-"+e,l=i[a],c=this.enableOptionSharing&&Fe(s);if(l)return gi(l,c);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),f=o?[`${t}Hover`,"hover",t,""]:[t,""],u=d.getOptionScopes(this.getDataset(),h),p=Object.keys(J.elements[t]),m=()=>this.getContext(s,o,e),g=d.resolveNamedOptions(u,p,m,f);return g.$shared&&(g.$shared=c,i[a]=Object.freeze(gi(g,c))),g}_resolveAnimations(t,e,s){const o=this.chart,i=this._cachedDataOpts,a=`animation-${e}`,l=i[a];if(l)return l;let c;if(o.options.animation!==!1){const h=this.chart.config,f=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),f);c=h.createResolver(u,this.getContext(t,s,e))}const d=new ci(o,c&&c.animations);return c&&c._cacheable&&(i[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ms(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),o=this._sharedOptions,i=this.getSharedOptions(s),a=this.includeOptions(e,i)||i!==o;return this.updateSharedOptions(i,e,s),{sharedOptions:i,includeOptions:a}}updateElement(t,e,s,o){Ms(o)?Object.assign(t,s):this._resolveAnimations(e,o).update(t,s)}updateSharedOptions(t,e,s){t&&!Ms(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,o){t.active=o;const i=this.getStyle(e,o);this._resolveAnimations(e,s,o).update(t,{options:!o&&this.getSharedOptions(i)||i})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const o=s.length,i=e.length,a=Math.min(i,o);a&&this.parse(0,a),i>o?this._insertElements(o,i-o,t):i<o&&this._removeElements(i,o-i)}_insertElements(t,e,s=!0){const o=this._cachedMeta,i=o.data,a=t+e;let l;const c=d=>{for(d.length+=e,l=d.length-1;l>=a;l--)d[l]=d[l-e]};for(c(i),l=t;l<a;++l)i[l]=new this.dataElementType;this._parsing&&c(o._parsed),this.parse(t,e),s&&this.updateElements(i,t,e,"reset")}updateElements(t,e,s,o){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const o=s._parsed.splice(t,e);s._stacked&&We(s,o)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,o]=t;this[e](s,o)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}P(St,"defaults",{}),P(St,"datasetElementType",null),P(St,"dataElementType",null);function Gc(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let s=[];for(let o=0,i=e.length;o<i;o++)s=s.concat(e[o].controller.getAllParsedValues(n));n._cache.$bar=Vo(s.sort((o,i)=>o-i))}return n._cache.$bar}function Zc(n){const t=n.iScale,e=Gc(t,n.type);let s=t._length,o,i,a,l;const c=()=>{a===32767||a===-32768||(Fe(l)&&(s=Math.min(s,Math.abs(a-l)||s)),l=a)};for(o=0,i=e.length;o<i;++o)a=t.getPixelForValue(e[o]),c();for(l=void 0,o=0,i=t.ticks.length;o<i;++o)a=t.getPixelForTick(o),c();return s}function Jc(n,t,e,s){const o=e.barThickness;let i,a;return I(o)?(i=t.min*e.categoryPercentage,a=e.barPercentage):(i=o*s,a=1),{chunk:i/s,ratio:a,start:t.pixels[n]-i/2}}function Qc(n,t,e,s){const o=t.pixels,i=o[n];let a=n>0?o[n-1]:null,l=n<o.length-1?o[n+1]:null;const c=e.categoryPercentage;a===null&&(a=i-(l===null?t.end-t.start:l-i)),l===null&&(l=i+i-a);const d=i-(i-Math.min(a,l))/2*c;return{chunk:Math.abs(l-a)/2*c/s,ratio:e.barPercentage,start:d}}function td(n,t,e,s){const o=e.parse(n[0],s),i=e.parse(n[1],s),a=Math.min(o,i),l=Math.max(o,i);let c=a,d=l;Math.abs(a)>Math.abs(l)&&(c=l,d=a),t[e.axis]=d,t._custom={barStart:c,barEnd:d,start:o,end:i,min:a,max:l}}function bi(n,t,e,s){return X(n)?td(n,t,e,s):t[e.axis]=e.parse(n,s),t}function yi(n,t,e,s){const o=n.iScale,i=n.vScale,a=o.getLabels(),l=o===i,c=[];let d,h,f,u;for(d=e,h=e+s;d<h;++d)u=t[d],f={},f[o.axis]=l||o.parse(a[d],d),c.push(bi(u,f,i,d));return c}function Ss(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function ed(n,t,e){return n!==0?Dt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function nd(n){let t,e,s,o,i;return n.horizontal?(t=n.base>n.x,e="left",s="right"):(t=n.base<n.y,e="bottom",s="top"),t?(o="end",i="start"):(o="start",i="end"),{start:e,end:s,reverse:t,top:o,bottom:i}}function sd(n,t,e,s){let o=t.borderSkipped;const i={};if(!o){n.borderSkipped=i;return}if(o===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:c,top:d,bottom:h}=nd(n);o==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===s?o=d:(e._bottom||0)===s?o=h:(i[_i(h,a,l,c)]=!0,o=d)),i[_i(o,a,l,c)]=!0,n.borderSkipped=i}function _i(n,t,e,s){return s?(n=od(n,t,e),n=xi(n,e,t)):n=xi(n,t,e),n}function od(n,t,e){return n===t?e:n===e?t:n}function xi(n,t,e){return n==="start"?t:n==="end"?e:n}function id(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Sn extends St{parsePrimitiveData(t,e,s,o){return yi(t,e,s,o)}parseArrayData(t,e,s,o){return yi(t,e,s,o)}parseObjectData(t,e,s,o){const{iScale:i,vScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=i.axis==="x"?l:c,h=a.axis==="x"?l:c,f=[];let u,p,m,g;for(u=s,p=s+o;u<p;++u)g=e[u],m={},m[i.axis]=i.parse(Ut(g,d),u),f.push(bi(Ut(g,h),m,a,u));return f}updateRangeFromParsed(t,e,s,o){super.updateRangeFromParsed(t,e,s,o);const i=s._custom;i&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:s,vScale:o}=e,i=this.getParsed(t),a=i._custom,l=Ss(a)?"["+a.start+", "+a.end+"]":""+o.getLabelForValue(i[o.axis]);return{label:""+s.getLabelForValue(i[s.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,o){const i=o==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),h=this._getRuler(),{sharedOptions:f,includeOptions:u}=this._getSharedOptions(e,o);for(let p=e;p<e+s;p++){const m=this.getParsed(p),g=i||I(m[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,h),_=(m._stacks||{})[l.axis],y={horizontal:d,base:g.base,enableBorderRadius:!_||Ss(m._custom)||a===_._top||a===_._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&&(y.options=f||this.resolveDataElementOptions(p,t[p].active?"active":o));const k=y.options||t[p].options;sd(y,k,_,a),id(y,k,h.ratio),this.updateElement(t[p],p,y,o)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,o=s.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),i=s.options.stacked,a=[],l=c=>{const d=c.controller.getParsed(e),h=d&&d[c.vScale.axis];if(I(h)||isNaN(h))return!0};for(const c of o)if(!(e!==void 0&&l(c))&&((i===!1||a.indexOf(c.stack)===-1||i===void 0&&c.stack===void 0)&&a.push(c.stack),c.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){const o=this._getStacks(t,s),i=e!==void 0?o.indexOf(e):-1;return i===-1?o.length-1:i}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,o=[];let i,a;for(i=0,a=e.data.length;i<a;++i)o.push(s.getPixelForValue(this.getParsed(i)[s.axis],i));const l=t.barThickness;return{min:l||Zc(e),pixels:o,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:o},options:{base:i,minBarLength:a}}=this,l=i||0,c=this.getParsed(t),d=c._custom,h=Ss(d);let f=c[e.axis],u=0,p=s?this.applyStack(e,c,s):f,m,g;p!==f&&(u=p-f,p=f),h&&(f=d.barStart,p=d.barEnd-d.barStart,f!==0&&Dt(f)!==Dt(d.barEnd)&&(u=0),u+=f);const b=!I(i)&&!h?i:u;let _=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(u+p):m=_,g=m-_,Math.abs(g)<a){g=ed(g,e,l)*a,f===l&&(_-=g/2);const y=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),w=Math.min(y,k),x=Math.max(y,k);_=Math.max(Math.min(_,x),w),m=_+g,s&&!h&&(c._stacks[e.axis]._visualValues[o]=e.getValueForPixel(m)-e.getValueForPixel(_))}if(_===e.getPixelForValue(l)){const y=Dt(g)*e.getLineWidthForValue(l)/2;_+=y,g-=y}return{size:g,base:_,head:m,center:m+g/2}}_calculateBarIndexPixels(t,e){const s=e.scale,o=this.options,i=o.skipNull,a=L(o.maxBarThickness,1/0);let l,c;if(e.grouped){const d=i?this._getStackCount(t):e.stackCount,h=o.barThickness==="flex"?Qc(t,e,o,d):Jc(t,e,o,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);l=h.start+h.chunk*f+h.chunk/2,c=Math.min(a,h.chunk*h.ratio)}else l=s.getPixelForValue(this.getParsed(t)[s.axis],t),c=Math.min(a,e.min*e.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const t=this._cachedMeta,e=t.vScale,s=t.data,o=s.length;let i=0;for(;i<o;++i)this.getParsed(i)[e.axis]!==null&&s[i].draw(this._ctx)}}P(Sn,"id","bar"),P(Sn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(Sn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Dn extends St{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,s,o){const i=super.parsePrimitiveData(t,e,s,o);for(let a=0;a<i.length;a++)i[a]._custom=this.resolveDataElementOptions(a+s).radius;return i}parseArrayData(t,e,s,o){const i=super.parseArrayData(t,e,s,o);for(let a=0;a<i.length;a++){const l=e[s+a];i[a]._custom=L(l[2],this.resolveDataElementOptions(a+s).radius)}return i}parseObjectData(t,e,s,o){const i=super.parseObjectData(t,e,s,o);for(let a=0;a<i.length;a++){const l=e[s+a];i[a]._custom=L(l&&l.r&&+l.r,this.resolveDataElementOptions(a+s).radius)}return i}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let s=t.length-1;s>=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:o,yScale:i}=e,a=this.getParsed(t),l=o.getLabelForValue(a.x),c=i.getLabelForValue(a.y),d=a._custom;return{label:s[t]||"",value:"("+l+", "+c+(d?", "+d:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,o){const i=o==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,o),h=a.axis,f=l.axis;for(let u=e;u<e+s;u++){const p=t[u],m=!i&&this.getParsed(u),g={},b=g[h]=i?a.getPixelForDecimal(.5):a.getPixelForValue(m[h]),_=g[f]=i?l.getBasePixel():l.getPixelForValue(m[f]);g.skip=isNaN(b)||isNaN(_),d&&(g.options=c||this.resolveDataElementOptions(u,p.active?"active":o),i&&(g.options.radius=0)),this.updateElement(p,u,g,o)}}resolveDataElementOptions(t,e){const s=this.getParsed(t);let o=super.resolveDataElementOptions(t,e);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const i=o.radius;return e!=="active"&&(o.radius=0),o.radius+=L(s&&s._custom,i),o}}P(Dn,"id","bubble"),P(Dn,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(Dn,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function ad(n,t,e){let s=1,o=1,i=0,a=0;if(t<K){const l=n,c=l+t,d=Math.cos(l),h=Math.sin(l),f=Math.cos(c),u=Math.sin(c),p=(k,w,x)=>Ne(k,l,c,!0)?1:Math.max(w,w*e,x,x*e),m=(k,w,x)=>Ne(k,l,c,!0)?-1:Math.min(w,w*e,x,x*e),g=p(0,d,f),b=p(tt,h,u),_=m(q,d,f),y=m(q+tt,h,u);s=(g-_)/2,o=(b-y)/2,i=-(g+_)/2,a=-(b+y)/2}return{ratioX:s,ratioY:o,offsetX:i,offsetY:a}}class he extends St{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=s;else{let i=c=>+s[c];if(z(s[t])){const{key:c="value"}=this._parsing;i=d=>+Ut(s[d],c)}let a,l;for(a=t,l=t+e;a<l;++a)o._parsed[a]=i(a)}}_getRotation(){return Mt(this.options.rotation-90)}_getCircumference(){return Mt(this.options.circumference)}_getRotationExtents(){let t=K,e=-K;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const o=this.chart.getDatasetMeta(s).controller,i=o._getRotation(),a=o._getCircumference();t=Math.min(t,i),e=Math.max(e,i+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:s}=e,o=this._cachedMeta,i=o.data,a=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,l=Math.max((Math.min(s.width,s.height)-a)/2,0),c=Math.min(xl(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:f}=this._getRotationExtents(),{ratioX:u,ratioY:p,offsetX:m,offsetY:g}=ad(f,h,c),b=(s.width-a)/u,_=(s.height-a)/p,y=Math.max(Math.min(b,_)/2,0),k=_o(this.options.radius,y),w=Math.max(k*c,0),x=(k-w)/this._getVisibleDatasetWeightTotal();this.offsetX=m*k,this.offsetY=g*k,o.total=this.calculateTotal(),this.outerRadius=k-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*d,0),this.updateElements(i,0,i.length,t)}_circumference(t,e){const s=this.options,o=this._cachedMeta,i=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*i/K)}updateElements(t,e,s,o){const i=o==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,h=(l.left+l.right)/2,f=(l.top+l.bottom)/2,u=i&&d.animateScale,p=u?0:this.innerRadius,m=u?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(e,o);let _=this._getRotation(),y;for(y=0;y<e;++y)_+=this._circumference(y,i);for(y=e;y<e+s;++y){const k=this._circumference(y,i),w=t[y],x={x:h+this.offsetX,y:f+this.offsetY,startAngle:_,endAngle:_+k,circumference:k,outerRadius:m,innerRadius:p};b&&(x.options=g||this.resolveDataElementOptions(y,w.active?"active":o)),_+=k,this.updateElement(w,y,x,o)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,o;for(o=0;o<e.length;o++){const i=t._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!e[o].hidden&&(s+=Math.abs(i))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?K*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,o=s.data.labels||[],i=Le(e._parsed[t],s.options.locale);return{label:o[t]||"",value:i}}getMaxBorderWidth(t){let e=0;const s=this.chart;let o,i,a,l,c;if(!t){for(o=0,i=s.data.datasets.length;o<i;++o)if(s.isDatasetVisible(o)){a=s.getDatasetMeta(o),t=a.data,l=a.controller;break}}if(!t)return 0;for(o=0,i=t.length;o<i;++o)c=l.resolveDataElementOptions(o),c.borderAlign!=="inner"&&(e=Math.max(e,c.borderWidth||0,c.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,o=t.length;s<o;++s){const i=this.resolveDataElementOptions(s);e=Math.max(e,i.offset||0,i.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(L(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(he,"id","doughnut"),P(he,"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"}),P(he,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(he,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:o}}=t.legend.options;return e.labels.map((i,a)=>{const c=t.getDatasetMeta(0).controller.getStyle(a);return{text:i,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}});class Bn extends St{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:o=[],_dataset:i}=e,a=this.chart._animationsDisabled;let{start:l,count:c}=Oo(e,o,a);this._drawStart=l,this._drawCount=c,Fo(e)&&(l=0,c=o.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!i._decimated,s.points=o;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:d},t),this.updateElements(o,l,c,t)}updateElements(t,e,s,o){const i=o==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,o),u=a.axis,p=l.axis,{spanGaps:m,segment:g}=this.options,b=ke(m)?m:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||i||o==="none",y=e+s,k=t.length;let w=e>0&&this.getParsed(e-1);for(let x=0;x<k;++x){const C=t[x],S=_?C:{};if(x<e||x>=y){S.skip=!0;continue}const M=this.getParsed(x),v=I(M[p]),E=S[u]=a.getPixelForValue(M[u],x),O=S[p]=i||v?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,M,c):M[p],x);S.skip=isNaN(E)||isNaN(O)||v,S.stop=x>0&&Math.abs(M[u]-w[u])>b,g&&(S.parsed=M,S.raw=d.data[x]),f&&(S.options=h||this.resolveDataElementOptions(x,C.active?"active":o)),_||this.updateElement(C,x,S,o),w=M}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,o=t.data||[];if(!o.length)return s;const i=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(s,i,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}P(Bn,"id","line"),P(Bn,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(Bn,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ye extends St{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,o=s.data.labels||[],i=Le(e._parsed[t].r,s.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,e,s,o){return Ko.bind(this)(t,e,s,o)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(i<e.min&&(e.min=i),i>e.max&&(e.max=i))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,o=Math.min(e.right-e.left,e.bottom-e.top),i=Math.max(o/2,0),a=Math.max(s.cutoutPercentage?i/100*s.cutoutPercentage:1,0),l=(i-a)/t.getVisibleDatasetCount();this.outerRadius=i-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,s,o){const i=o==="reset",a=this.chart,c=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,o,g);for(m=e;m<e+s;m++){const b=t[m];let _=p,y=p+this._computeAngle(m,o,g),k=a.getDataVisibility(m)?d.getDistanceFromCenterForValue(this.getParsed(m).r):0;p=y,i&&(c.animateScale&&(k=0),c.animateRotate&&(_=y=u));const w={x:h,y:f,innerRadius:0,outerRadius:k,startAngle:_,endAngle:y,options:this.resolveDataElementOptions(m,b.active?"active":o)};this.updateElement(b,m,w,o)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((s,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?Mt(this.resolveDataElementOptions(t,e).angle||s):0}}P(Ye,"id","polarArea"),P(Ye,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(Ye,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:o}}=t.legend.options;return e.labels.map((i,a)=>{const c=t.getDatasetMeta(0).controller.getStyle(a);return{text:i,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Ds extends he{}P(Ds,"id","pie"),P(Ds,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class vn extends St{getLabelAndValue(t){const e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,o){return Ko.bind(this)(t,e,s,o)}update(t){const e=this._cachedMeta,s=e.dataset,o=e.data||[],i=e.iScale.getLabels();if(s.points=o,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:i.length===o.length,options:a};this.updateElement(s,void 0,l,t)}this.updateElements(o,0,o.length,t)}updateElements(t,e,s,o){const i=this._cachedMeta.rScale,a=o==="reset";for(let l=e;l<e+s;l++){const c=t[l],d=this.resolveDataElementOptions(l,c.active?"active":o),h=i.getPointPositionForValue(l,this.getParsed(l).r),f=a?i.xCenter:h.x,u=a?i.yCenter:h.y,p={x:f,y:u,angle:h.angle,skip:isNaN(f)||isNaN(u),options:d};this.updateElement(c,l,p,o)}}}P(vn,"id","radar"),P(vn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(vn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class En extends St{getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:o,yScale:i}=e,a=this.getParsed(t),l=o.getLabelForValue(a.x),c=i.getLabelForValue(a.y);return{label:s[t]||"",value:"("+l+", "+c+")"}}update(t){const e=this._cachedMeta,{data:s=[]}=e,o=this.chart._animationsDisabled;let{start:i,count:a}=Oo(e,s,o);if(this._drawStart=i,this._drawCount=a,Fo(e)&&(i=0,a=s.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:c}=e;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=s;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!o,options:d},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(s,i,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,s,o){const i=o==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,o),f=this.getSharedOptions(h),u=this.includeOptions(o,f),p=a.axis,m=l.axis,{spanGaps:g,segment:b}=this.options,_=ke(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||i||o==="none";let k=e>0&&this.getParsed(e-1);for(let w=e;w<e+s;++w){const x=t[w],C=this.getParsed(w),S=y?x:{},M=I(C[m]),v=S[p]=a.getPixelForValue(C[p],w),E=S[m]=i||M?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,C,c):C[m],w);S.skip=isNaN(v)||isNaN(E)||M,S.stop=w>0&&Math.abs(C[p]-k[p])>_,b&&(S.parsed=C,S.raw=d.data[w]),u&&(S.options=f||this.resolveDataElementOptions(w,x.active?"active":o)),y||this.updateElement(x,w,S,o),k=C}this.updateSharedOptions(f,o,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let c=e.length-1;c>=0;--c)l=Math.max(l,e[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const s=t.dataset,o=s.options&&s.options.borderWidth||0;if(!e.length)return o;const i=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(o,i,a)/2}}P(En,"id","scatter"),P(En,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(En,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var rd=Object.freeze({__proto__:null,BarController:Sn,BubbleController:Dn,DoughnutController:he,LineController:Bn,PieController:Ds,PolarAreaController:Ye,RadarController:vn,ScatterController:En});function fe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Bs{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(Bs.prototype,t)}init(){}formats(){return fe()}parse(){return fe()}format(){return fe()}add(){return fe()}diff(){return fe()}startOf(){return fe()}endOf(){return fe()}}var ld={_date:Bs};function cd(n,t,e,s){const{controller:o,data:i,_sorted:a}=n,l=o._cachedMeta.iScale;if(l&&t===l.axis&&t!=="r"&&a&&i.length){const c=l._reversePixels?Al:Ft;if(s){if(o._sharedOptions){const d=i[0],h=typeof d.getRange=="function"&&d.getRange(t);if(h){const f=c(i,t,e-h),u=c(i,t,e+h);return{lo:f.lo,hi:u.hi}}}}else return c(i,t,e)}return{lo:0,hi:i.length-1}}function je(n,t,e,s,o){const i=n.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,c=i.length;l<c;++l){const{index:d,data:h}=i[l],{lo:f,hi:u}=cd(i[l],t,a,o);for(let p=f;p<=u;++p){const m=h[p];m.skip||s(m,d,p)}}}function dd(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(s,o){const i=t?Math.abs(s.x-o.x):0,a=e?Math.abs(s.y-o.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(a,2))}}function vs(n,t,e,s,o){const i=[];return!o&&!n.isPointInArea(t)||je(n,e,t,function(l,c,d){!o&&!Tt(l,n.chartArea,0)||l.inRange(t.x,t.y,s)&&i.push({element:l,datasetIndex:c,index:d})},!0),i}function hd(n,t,e,s){let o=[];function i(a,l,c){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],s),{angle:f}=Bo(a,{x:t.x,y:t.y});Ne(f,d,h)&&o.push({element:a,datasetIndex:l,index:c})}return je(n,e,t,i),o}function fd(n,t,e,s,o,i){let a=[];const l=dd(e);let c=Number.POSITIVE_INFINITY;function d(h,f,u){const p=h.inRange(t.x,t.y,o);if(s&&!p)return;const m=h.getCenterPoint(o);if(!(!!i||n.isPointInArea(m))&&!p)return;const b=l(t,m);b<c?(a=[{element:h,datasetIndex:f,index:u}],c=b):b===c&&a.push({element:h,datasetIndex:f,index:u})}return je(n,e,t,d),a}function Es(n,t,e,s,o,i){return!i&&!n.isPointInArea(t)?[]:e==="r"&&!s?hd(n,t,e,o):fd(n,t,e,s,o,i)}function ki(n,t,e,s,o){const i=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return je(n,e,t,(c,d,h)=>{c[a](t[e],o)&&(i.push({element:c,datasetIndex:d,index:h}),l=l||c.inRange(t.x,t.y,o))}),s&&!l?[]:i}var ud={evaluateInteractionItems:je,modes:{index(n,t,e,s){const o=ce(t,n),i=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?vs(n,o,i,s,a):Es(n,o,i,!1,s,a),c=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=l[0].index,f=d.data[h];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:h})}),c):[]},dataset(n,t,e,s){const o=ce(t,n),i=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?vs(n,o,i,s,a):Es(n,o,i,!1,s,a);if(l.length>0){const c=l[0].datasetIndex,d=n.getDatasetMeta(c).data;l=[];for(let h=0;h<d.length;++h)l.push({element:d[h],datasetIndex:c,index:h})}return l},point(n,t,e,s){const o=ce(t,n),i=e.axis||"xy",a=e.includeInvisible||!1;return vs(n,o,i,s,a)},nearest(n,t,e,s){const o=ce(t,n),i=e.axis||"xy",a=e.includeInvisible||!1;return Es(n,o,i,e.intersect,s,a)},x(n,t,e,s){const o=ce(t,n);return ki(n,o,"x",e.intersect,s)},y(n,t,e,s){const o=ce(t,n);return ki(n,o,"y",e.intersect,s)}}};const wi=["left","top","right","bottom"];function He(n,t){return n.filter(e=>e.pos===t)}function Ci(n,t){return n.filter(e=>wi.indexOf(e.pos)===-1&&e.box.axis===t)}function Ue(n,t){return n.sort((e,s)=>{const o=t?s:e,i=t?e:s;return o.weight===i.weight?o.index-i.index:o.weight-i.weight})}function pd(n){const t=[];let e,s,o,i,a,l;for(e=0,s=(n||[]).length;e<s;++e)o=n[e],{position:i,options:{stack:a,stackWeight:l=1}}=o,t.push({index:e,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&i+a,stackWeight:l});return t}function md(n){const t={};for(const e of n){const{stack:s,pos:o,stackWeight:i}=e;if(!s||!wi.includes(o))continue;const a=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function gd(n,t){const e=md(n),{vBoxMaxWidth:s,hBoxMaxHeight:o}=t;let i,a,l;for(i=0,a=n.length;i<a;++i){l=n[i];const{fullSize:c}=l.box,d=e[l.stack],h=d&&l.stackWeight/d.weight;l.horizontal?(l.width=h?h*s:c&&t.availableWidth,l.height=o):(l.width=s,l.height=h?h*o:c&&t.availableHeight)}return e}function bd(n){const t=pd(n),e=Ue(t.filter(d=>d.box.fullSize),!0),s=Ue(He(t,"left"),!0),o=Ue(He(t,"right")),i=Ue(He(t,"top"),!0),a=Ue(He(t,"bottom")),l=Ci(t,"x"),c=Ci(t,"y");return{fullSize:e,leftAndTop:s.concat(i),rightAndBottom:o.concat(c).concat(a).concat(l),chartArea:He(t,"chartArea"),vertical:s.concat(o).concat(c),horizontal:i.concat(a).concat(l)}}function Mi(n,t,e,s){return Math.max(n[e],t[e])+Math.max(n[s],t[s])}function Si(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 yd(n,t,e,s){const{pos:o,box:i}=e,a=n.maxPadding;if(!z(o)){e.size&&(n[o]-=e.size);const f=s[e.stack]||{size:0,count:1};f.size=Math.max(f.size,e.horizontal?i.height:i.width),e.size=f.size/f.count,n[o]+=e.size}i.getPadding&&Si(a,i.getPadding());const l=Math.max(0,t.outerWidth-Mi(a,n,"left","right")),c=Math.max(0,t.outerHeight-Mi(a,n,"top","bottom")),d=l!==n.w,h=c!==n.h;return n.w=l,n.h=c,e.horizontal?{same:d,other:h}:{same:h,other:d}}function _d(n){const t=n.maxPadding;function e(s){const o=Math.max(t[s]-n[s],0);return n[s]+=o,o}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function xd(n,t){const e=t.maxPadding;function s(o){const i={left:0,top:0,right:0,bottom:0};return o.forEach(a=>{i[a]=Math.max(t[a],e[a])}),i}return s(n?["left","right"]:["top","bottom"])}function Xe(n,t,e,s){const o=[];let i,a,l,c,d,h;for(i=0,a=n.length,d=0;i<a;++i){l=n[i],c=l.box,c.update(l.width||t.w,l.height||t.h,xd(l.horizontal,t));const{same:f,other:u}=yd(t,e,l,s);d|=f&&o.length,h=h||u,c.fullSize||o.push(l)}return d&&Xe(o,t,e,s)||h}function Vn(n,t,e,s,o){n.top=e,n.left=t,n.right=t+s,n.bottom=e+o,n.width=s,n.height=o}function Di(n,t,e,s){const o=e.padding;let{x:i,y:a}=t;for(const l of n){const c=l.box,d=s[l.stack]||{count:1,placed:0,weight:1},h=l.stackWeight/d.weight||1;if(l.horizontal){const f=t.w*h,u=d.size||c.height;Fe(d.start)&&(a=d.start),c.fullSize?Vn(c,o.left,a,e.outerWidth-o.right-o.left,u):Vn(c,t.left+d.placed,a,f,u),d.start=a,d.placed+=f,a=c.bottom}else{const f=t.h*h,u=d.size||c.width;Fe(d.start)&&(i=d.start),c.fullSize?Vn(c,i,o.top,u,e.outerHeight-o.bottom-o.top):Vn(c,i,t.top+d.placed,u,f),d.start=i,d.placed+=f,i=c.right}}t.x=i,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,s){if(!n)return;const o=rt(n.options.layout.padding),i=Math.max(t-o.width,0),a=Math.max(e-o.height,0),l=bd(n.boxes),c=l.vertical,d=l.horizontal;Y(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=c.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:o,availableWidth:i,availableHeight:a,vBoxMaxWidth:i/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},o);Si(u,rt(s));const p=Object.assign({maxPadding:u,w:i,h:a,x:o.left,y:o.top},o),m=gd(c.concat(d),f);Xe(l.fullSize,p,f,m),Xe(c,p,f,m),Xe(d,p,f,m)&&Xe(c,p,f,m),_d(p),Di(l.leftAndTop,p,f,m),p.x+=p.w,p.y+=p.h,Di(l.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},Y(l.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 Bi{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,o){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,o?Math.floor(e/o):s)}}isAttached(t){return!0}updateConfig(t){}}class kd extends Bi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Pn="$chartjs",wd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vi=n=>n===null||n==="";function Cd(n,t){const e=n.style,s=n.getAttribute("height"),o=n.getAttribute("width");if(n[Pn]={initial:{height:s,width:o,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",vi(o)){const i=Qo(n,"width");i!==void 0&&(n.width=i)}if(vi(s))if(n.style.height==="")n.height=n.width/(t||2);else{const i=Qo(n,"height");i!==void 0&&(n.height=i)}return n}const Ei=Sc?{passive:!0}:!1;function Md(n,t,e){n.addEventListener(t,e,Ei)}function Sd(n,t,e){n.canvas.removeEventListener(t,e,Ei)}function Dd(n,t){const e=wd[n.type]||n.type,{x:s,y:o}=ce(n,t);return{type:e,chart:t,native:n,x:s!==void 0?s:null,y:o!==void 0?o:null}}function An(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Bd(n,t,e){const s=n.canvas,o=new MutationObserver(i=>{let a=!1;for(const l of i)a=a||An(l.addedNodes,s),a=a&&!An(l.removedNodes,s);a&&e()});return o.observe(document,{childList:!0,subtree:!0}),o}function vd(n,t,e){const s=n.canvas,o=new MutationObserver(i=>{let a=!1;for(const l of i)a=a||An(l.removedNodes,s),a=a&&!An(l.addedNodes,s);a&&e()});return o.observe(document,{childList:!0,subtree:!0}),o}const qe=new Map;let Vi=0;function Pi(){const n=window.devicePixelRatio;n!==Vi&&(Vi=n,qe.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Ed(n,t){qe.size||window.addEventListener("resize",Pi),qe.set(n,t)}function Vd(n){qe.delete(n),qe.size||window.removeEventListener("resize",Pi)}function Pd(n,t,e){const s=n.canvas,o=s&&ws(s);if(!o)return;const i=Ao((l,c)=>{const d=o.clientWidth;e(l,c),d<o.clientWidth&&e()},window),a=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,h=c.contentRect.height;d===0&&h===0||i(d,h)});return a.observe(o),Ed(n,i),a}function Vs(n,t,e){e&&e.disconnect(),t==="resize"&&Vd(n)}function Ad(n,t,e){const s=n.canvas,o=Ao(i=>{n.ctx!==null&&e(Dd(i,n))},n);return Md(s,t,o),o}class Od extends Bi{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Cd(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[Pn])return!1;const s=e[Pn].initial;["height","width"].forEach(i=>{const a=s[i];I(a)?e.removeAttribute(i):e.setAttribute(i,a)});const o=s.style||{};return Object.keys(o).forEach(i=>{e.style[i]=o[i]}),e.width=e.width,delete e[Pn],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const o=t.$proxies||(t.$proxies={}),a={attach:Bd,detach:vd,resize:Pd}[e]||Ad;o[e]=a(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),o=s[e];if(!o)return;({attach:Vs,detach:Vs,resize:Vs}[e]||Sd)(t,e,o),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,o){return Mc(t,e,s,o)}isAttached(t){const e=ws(t);return!!(e&&e.isConnected)}}function Fd(n){return!Zo()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?kd:Od}let $t=(ts=class{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return ke(this.x)&&ke(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const o={};return t.forEach(i=>{o[i]=s[i]&&s[i].active()?s[i]._to:this[i]}),o}},P(ts,"defaults",{}),P(ts,"defaultRoutes"),ts);function Td(n,t){const e=n.options.ticks,s=Nd(n),o=Math.min(e.maxTicksLimit||s,s),i=e.major.enabled?Ld(t):[],a=i.length,l=i[0],c=i[a-1],d=[];if(a>o)return Rd(t,d,i,a/o),d;const h=$d(i,t,o);if(a>0){let f,u;const p=a>1?Math.round((c-l)/(a-1)):null;for(On(t,d,h,I(p)?0:l-p,l),f=0,u=a-1;f<u;f++)On(t,d,h,i[f],i[f+1]);return On(t,d,h,c,I(p)?t.length:c+p),d}return On(t,d,h),d}function Nd(n){const t=n.options.offset,e=n._tickSize(),s=n._length/e+(t?0:1),o=n._maxLength/e;return Math.floor(Math.min(s,o))}function $d(n,t,e){const s=zd(n),o=t.length/e;if(!s)return Math.max(o,1);const i=vl(s);for(let a=0,l=i.length-1;a<l;a++){const c=i[a];if(c>o)return c}return Math.max(o,1)}function Ld(n){const t=[];let e,s;for(e=0,s=n.length;e<s;e++)n[e].major&&t.push(e);return t}function Rd(n,t,e,s){let o=0,i=e[0],a;for(s=Math.ceil(s),a=0;a<n.length;a++)a===i&&(t.push(n[a]),o++,i=e[o*s])}function On(n,t,e,s,o){const i=L(s,0),a=Math.min(L(o,n.length),n.length);let l=0,c,d,h;for(e=Math.ceil(e),o&&(c=o-s,e=c/Math.floor(c/e)),h=i;h<0;)l++,h=Math.round(i+l*e);for(d=Math.max(i,0);d<a;d++)d===h&&(t.push(n[d]),l++,h=Math.round(i+l*e))}function zd(n){const t=n.length;let e,s;if(t<2)return!1;for(s=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==s)return!1;return s}const Id=n=>n==="left"?"right":n==="right"?"left":n,Ai=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Oi=(n,t)=>Math.min(t||n,n);function Fi(n,t){const e=[],s=n.length/t,o=n.length;let i=0;for(;i<o;i+=s)e.push(n[Math.floor(i)]);return e}function Wd(n,t,e){const s=n.ticks.length,o=Math.min(t,s-1),i=n._startPixel,a=n._endPixel,l=1e-6;let c=n.getPixelForTick(o),d;if(!(e&&(s===1?d=Math.max(c-i,a-c):t===0?d=(n.getPixelForTick(1)-c)/2:d=(c-n.getPixelForTick(o-1))/2,c+=o<t?d:-d,c<i-l||c>a+l)))return c}function Yd(n,t){Y(n,e=>{const s=e.gc,o=s.length/2;let i;if(o>t){for(i=0;i<o;++i)delete e.data[s[i]];s.splice(0,o)}})}function Ke(n){return n.drawTicks?n.tickLength:0}function Ti(n,t){if(!n.display)return 0;const e=nt(n.font,t),s=rt(n.padding);return(X(n.text)?n.text.length:1)*e.lineHeight+s.height}function jd(n,t){return Kt(n,{scale:t,type:"scale"})}function Hd(n,t,e){return Kt(n,{tick:e,index:t,type:"tick"})}function Ud(n,t,e){let s=fs(n);return(e&&t!=="right"||!e&&t==="right")&&(s=Id(s)),s}function Xd(n,t,e,s){const{top:o,left:i,bottom:a,right:l,chart:c}=n,{chartArea:d,scales:h}=c;let f=0,u,p,m;const g=a-o,b=l-i;if(n.isHorizontal()){if(p=at(s,i,l),z(e)){const _=Object.keys(e)[0],y=e[_];m=h[_].getPixelForValue(y)+g-t}else e==="center"?m=(d.bottom+d.top)/2+g-t:m=Ai(n,e,t);u=l-i}else{if(z(e)){const _=Object.keys(e)[0],y=e[_];p=h[_].getPixelForValue(y)-b+t}else e==="center"?p=(d.left+d.right)/2-b+t:p=Ai(n,e,t);m=at(s,a,o),f=e==="left"?-tt:tt}return{titleX:p,titleY:m,maxWidth:u,rotation:f}}class ue extends $t{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:o}=this;return t=mt(t,Number.POSITIVE_INFINITY),e=mt(e,Number.NEGATIVE_INFINITY),s=mt(s,Number.POSITIVE_INFINITY),o=mt(o,Number.NEGATIVE_INFINITY),{min:mt(t,s),max:mt(e,o),minDefined:Z(t),maxDefined:Z(e)}}getMinMax(t){let{min:e,max:s,minDefined:o,maxDefined:i}=this.getUserBounds(),a;if(o&&i)return{min:e,max:s};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)a=l[c].controller.getMinMax(this,t),o||(e=Math.min(e,a.min)),i||(s=Math.max(s,a.max));return e=i&&e>s?s:e,s=o&&e>s?e:s,{min:mt(e,mt(s,e)),max:mt(s,mt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){H(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:o,grace:i,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=nc(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?Fi(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Td(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){H(this.options.afterUpdate,[this])}beforeSetDimensions(){H(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(){H(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),H(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){H(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,o,i;for(s=0,o=t.length;s<o;s++)i=t[s],i.label=H(e.callback,[i.value,s,t],this)}afterTickToLabelConversion(){H(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){H(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=Oi(this.ticks.length,t.ticks.maxTicksLimit),o=e.minRotation||0,i=e.maxRotation;let a=o,l,c,d;if(!this._isVisible()||!e.display||o>=i||s<=1||!this.isHorizontal()){this.labelRotation=o;return}const h=this._getLabelSizes(),f=h.widest.width,u=h.highest.height,p=ot(this.chart.width-f,0,this.maxWidth);l=t.offset?this.maxWidth/s:p/(s-1),f+6>l&&(l=p/(s-(t.offset?.5:1)),c=this.maxHeight-Ke(t.grid)-e.padding-Ti(t.title,this.chart.options.font),d=Math.sqrt(f*f+u*u),a=cs(Math.min(Math.asin(ot((h.highest.height+6)/l,-1,1)),Math.asin(ot(c/d,-1,1))-Math.asin(ot(u/d,-1,1)))),a=Math.max(o,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){H(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){H(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:o,grid:i}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const c=Ti(o,e.options.font);if(l?(t.width=this.maxWidth,t.height=Ke(i)+c):(t.height=this.maxHeight,t.width=Ke(i)+c),s.display&&this.ticks.length){const{first:d,last:h,widest:f,highest:u}=this._getLabelSizes(),p=s.padding*2,m=Mt(this.labelRotation),g=Math.cos(m),b=Math.sin(m);if(l){const _=s.mirror?0:b*f.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+_+p)}else{const _=s.mirror?0:g*f.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+_+p)}this._calculatePadding(d,h,b,g)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,o){const{ticks:{align:i,padding:a},position:l}=this.options,c=this.labelRotation!==0,d=l!=="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;c?d?(u=o*t.width,p=s*e.height):(u=s*t.height,p=o*e.width):i==="start"?p=e.width:i==="end"?u=t.width:i!=="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;i==="start"?(h=0,f=t.height):i==="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(){H(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)I(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=Fi(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:o,_longestTextCache:i}=this,a=[],l=[],c=Math.floor(e/Oi(e,s));let d=0,h=0,f,u,p,m,g,b,_,y,k,w,x;for(f=0;f<e;f+=c){if(m=t[f].label,g=this._resolveTickFontOptions(f),o.font=b=g.string,_=i[b]=i[b]||{data:{},gc:[]},y=g.lineHeight,k=w=0,!I(m)&&!X(m))k=yn(o,_.data,_.gc,k,m),w=y;else if(X(m))for(u=0,p=m.length;u<p;++u)x=m[u],!I(x)&&!X(x)&&(k=yn(o,_.data,_.gc,k,x),w+=y);a.push(k),l.push(w),d=Math.max(k,d),h=Math.max(w,h)}Yd(i,e);const C=a.indexOf(d),S=l.indexOf(h),M=v=>({width:a[v]||0,height:l[v]||0});return{first:M(0),last:M(e-1),widest:M(C),highest:M(S),widths:a,heights:l}}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 Pl(this._alignToPixels?ie(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=Hd(this.getContext(),t,s))}return this.$context||(this.$context=jd(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Mt(this.labelRotation),s=Math.abs(Math.cos(e)),o=Math.abs(Math.sin(e)),i=this._getLabelSizes(),a=t.autoSkipPadding||0,l=i?i.widest.width+a:0,c=i?i.highest.height+a:0;return this.isHorizontal()?c*s>l*o?l/s:c/o:c*o<l*s?c/s:l/o}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,o=this.options,{grid:i,position:a,border:l}=o,c=i.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),u=Ke(i),p=[],m=l.setContext(this.getContext()),g=m.display?m.width:0,b=g/2,_=function(D){return ie(s,D,g)};let y,k,w,x,C,S,M,v,E,O,N,U;if(a==="top")y=_(this.bottom),S=this.bottom-u,v=y-b,O=_(t.top)+b,U=t.bottom;else if(a==="bottom")y=_(this.top),O=t.top,U=_(t.bottom)-b,S=y+b,v=this.top+u;else if(a==="left")y=_(this.right),C=this.right-u,M=y-b,E=_(t.left)+b,N=t.right;else if(a==="right")y=_(this.left),E=t.left,N=_(t.right)-b,C=y+b,M=this.left+u;else if(e==="x"){if(a==="center")y=_((t.top+t.bottom)/2+.5);else if(z(a)){const D=Object.keys(a)[0],V=a[D];y=_(this.chart.scales[D].getPixelForValue(V))}O=t.top,U=t.bottom,S=y+b,v=S+u}else if(e==="y"){if(a==="center")y=_((t.left+t.right)/2);else if(z(a)){const D=Object.keys(a)[0],V=a[D];y=_(this.chart.scales[D].getPixelForValue(V))}C=y-b,M=C-u,E=t.left,N=t.right}const F=L(o.ticks.maxTicksLimit,f),B=Math.max(1,Math.ceil(f/F));for(k=0;k<f;k+=B){const D=this.getContext(k),V=i.setContext(D),A=l.setContext(D),T=V.lineWidth,$=V.color,W=A.dash||[],j=A.dashOffset,G=V.tickWidth,Q=V.tickColor,it=V.tickBorderDash||[],Ct=V.tickBorderDashOffset;w=Wd(this,k,c),w!==void 0&&(x=ie(s,w,T),d?C=M=E=N=x:S=v=O=U=x,p.push({tx1:C,ty1:S,tx2:M,ty2:v,x1:E,y1:O,x2:N,y2:U,width:T,color:$,borderDash:W,borderDashOffset:j,tickWidth:G,tickColor:Q,tickBorderDash:it,tickBorderDashOffset:Ct}))}return this._ticksLength=f,this._borderValue=y,p}_computeLabelItems(t){const e=this.axis,s=this.options,{position:o,ticks:i}=s,a=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:h,mirror:f}=i,u=Ke(s.grid),p=u+h,m=f?-h:p,g=-Mt(this.labelRotation),b=[];let _,y,k,w,x,C,S,M,v,E,O,N,U="middle";if(o==="top")C=this.bottom-m,S=this._getXAxisLabelAlignment();else if(o==="bottom")C=this.top+m,S=this._getXAxisLabelAlignment();else if(o==="left"){const B=this._getYAxisLabelAlignment(u);S=B.textAlign,x=B.x}else if(o==="right"){const B=this._getYAxisLabelAlignment(u);S=B.textAlign,x=B.x}else if(e==="x"){if(o==="center")C=(t.top+t.bottom)/2+p;else if(z(o)){const B=Object.keys(o)[0],D=o[B];C=this.chart.scales[B].getPixelForValue(D)+p}S=this._getXAxisLabelAlignment()}else if(e==="y"){if(o==="center")x=(t.left+t.right)/2-p;else if(z(o)){const B=Object.keys(o)[0],D=o[B];x=this.chart.scales[B].getPixelForValue(D)}S=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(c==="start"?U="top":c==="end"&&(U="bottom"));const F=this._getLabelSizes();for(_=0,y=l.length;_<y;++_){k=l[_],w=k.label;const B=i.setContext(this.getContext(_));M=this.getPixelForTick(_)+i.labelOffset,v=this._resolveTickFontOptions(_),E=v.lineHeight,O=X(w)?w.length:1;const D=O/2,V=B.color,A=B.textStrokeColor,T=B.textStrokeWidth;let $=S;a?(x=M,S==="inner"&&(_===y-1?$=this.options.reverse?"left":"right":_===0?$=this.options.reverse?"right":"left":$="center"),o==="top"?d==="near"||g!==0?N=-O*E+E/2:d==="center"?N=-F.highest.height/2-D*E+E:N=-F.highest.height+E/2:d==="near"||g!==0?N=E/2:d==="center"?N=F.highest.height/2-D*E:N=F.highest.height-O*E,f&&(N*=-1),g!==0&&!B.showLabelBackdrop&&(x+=E/2*Math.sin(g))):(C=M,N=(1-O)*E/2);let W;if(B.showLabelBackdrop){const j=rt(B.backdropPadding),G=F.heights[_],Q=F.widths[_];let it=N-j.top,Ct=0-j.left;switch(U){case"middle":it-=G/2;break;case"bottom":it-=G;break}switch(S){case"center":Ct-=Q/2;break;case"right":Ct-=Q;break}W={left:Ct,top:it,width:Q+j.width,height:G+j.height,color:B.backdropColor}}b.push({label:w,font:v,textOffset:N,options:{rotation:g,color:V,strokeColor:A,strokeWidth:T,textAlign:$,textBaseline:U,translation:[x,C],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Mt(this.labelRotation))return t==="top"?"left":"right";let o="center";return e.align==="start"?o="left":e.align==="end"?o="right":e.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:o,padding:i}}=this.options,a=this._getLabelSizes(),l=t+i,c=a.widest.width;let d,h;return e==="left"?o?(h=this.right+i,s==="near"?d="left":s==="center"?(d="center",h+=c/2):(d="right",h+=c)):(h=this.right-l,s==="near"?d="right":s==="center"?(d="center",h-=c/2):(d="left",h=this.left)):e==="right"?o?(h=this.left+i,s==="near"?d="right":s==="center"?(d="center",h-=c/2):(d="left",h-=c)):(h=this.left+l,s==="near"?d="left":s==="center"?(d="center",h+=c/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:s,top:o,width:i,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,o,i,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const o=this.ticks.findIndex(i=>i.value===t);return o>=0?e.setContext(this.getContext(o)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,a;const l=(c,d,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(c.x,c.y),s.lineTo(d.x,d.y),s.stroke(),s.restore())};if(e.display)for(i=0,a=o.length;i<a;++i){const c=o[i];e.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),e.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:o}}=this,i=s.setContext(this.getContext()),a=s.display?i.width:0;if(!a)return;const l=o.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,h,f,u;this.isHorizontal()?(d=ie(t,this.left,a)-a/2,h=ie(t,this.right,l)+l/2,f=u=c):(f=ie(t,this.top,a)-a/2,u=ie(t,this.bottom,l)+l/2,d=h=c),e.save(),e.lineWidth=i.width,e.strokeStyle=i.color,e.beginPath(),e.moveTo(d,f),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,o=this._computeLabelArea();o&&_n(s,o);const i=this.getLabelItems(t);for(const a of i){const l=a.options,c=a.font,d=a.label,h=a.textOffset;ae(s,d,0,h,c,l)}o&&xn(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:o}}=this;if(!s.display)return;const i=nt(s.font),a=rt(s.padding),l=s.align;let c=i.lineHeight/2;e==="bottom"||e==="center"||z(e)?(c+=a.bottom,X(s.text)&&(c+=i.lineHeight*(s.text.length-1))):c+=a.top;const{titleX:d,titleY:h,maxWidth:f,rotation:u}=Xd(this,c,e,l);ae(t,s.text,0,0,i,{color:s.color,maxWidth:f,rotation:u,textAlign:Ud(l,e,o),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,s=L(t.grid&&t.grid.z,-1),o=L(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ue.prototype.draw?[{z:e,draw:i=>{this.draw(i)}}]:[{z:s,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:e,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",o=[];let i,a;for(i=0,a=e.length;i<a;++i){const l=e[i];l[s]===this.id&&(!t||l.type===t)&&o.push(l)}return o}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return nt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Fn{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;Gd(e)&&(s=this.register(e));const o=this.items,i=t.id,a=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in o||(o[i]=t,qd(t,a,s),this.override&&J.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,o=this.scope;s in e&&delete e[s],o&&s in J[o]&&(delete J[o][s],this.override&&delete oe[s])}}function qd(n,t,e){const s=Ae(Object.create(null),[e?J.get(e):{},J.get(t),n.defaults]);J.set(t,s),n.defaultRoutes&&Kd(t,n.defaultRoutes),n.descriptors&&J.describe(t,n.descriptors)}function Kd(n,t){Object.keys(t).forEach(e=>{const s=e.split("."),o=s.pop(),i=[n].concat(s).join("."),a=t[e].split("."),l=a.pop(),c=a.join(".");J.route(i,o,c,l)})}function Gd(n){return"id"in n&&"defaults"in n}class Zd{constructor(){this.controllers=new Fn(St,"datasets",!0),this.elements=new Fn($t,"elements"),this.plugins=new Fn(Object,"plugins"),this.scales=new Fn(ue,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(o=>{const i=s||this._getRegistryForType(o);s||i.isForType(o)||i===this.plugins&&o.id?this._exec(t,i,o):Y(o,a=>{const l=s||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,s){const o=ls(t);H(s["before"+o],[],s),e[t](s),H(s["after"+o],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const o=e.get(t);if(o===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return o}}var Bt=new Zd;class Jd{constructor(){this._init=[]}notify(t,e,s,o){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const i=o?this._descriptors(t).filter(o):this._descriptors(t),a=this._notify(i,t,e,s);return e==="afterDestroy"&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,s,o){o=o||{};for(const i of t){const a=i.plugin,l=a[s],c=[e,o,i.options];if(H(l,c,a)===!1&&o.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 s=t&&t.config,o=L(s.options&&s.options.plugins,{}),i=Qd(s);return o===!1&&!e?[]:eh(t,i,o,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,o=(i,a)=>i.filter(l=>!a.some(c=>l.plugin.id===c.plugin.id));this._notify(o(e,s),t,"stop"),this._notify(o(s,e),t,"start")}}function Qd(n){const t={},e=[],s=Object.keys(Bt.plugins.items);for(let i=0;i<s.length;i++)e.push(Bt.getPlugin(s[i]));const o=n.plugins||[];for(let i=0;i<o.length;i++){const a=o[i];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function th(n,t){return!t&&n===!1?null:n===!0?{}:n}function eh(n,{plugins:t,localIds:e},s,o){const i=[],a=n.getContext();for(const l of t){const c=l.id,d=th(s[c],o);d!==null&&i.push({plugin:l,options:nh(n.config,{plugin:l,local:e[c]},d,a)})}return i}function nh(n,{plugin:t,local:e},s,o){const i=n.pluginScopeKeys(t),a=n.getOptionScopes(s,i);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ps(n,t){const e=J.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function sh(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function oh(n,t){return n===t?"_index_":"_value_"}function Ni(n){if(n==="x"||n==="y"||n==="r")return n}function ih(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function As(n,...t){if(Ni(n))return n;for(const e of t){const s=e.axis||ih(e.position)||n.length>1&&Ni(n[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function $i(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function ah(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===n||s.yAxisID===n);if(e.length)return $i(n,"x",e[0])||$i(n,"y",e[0])}return{}}function rh(n,t){const e=oe[n.type]||{scales:{}},s=t.scales||{},o=Ps(n.type,t),i=Object.create(null);return Object.keys(s).forEach(a=>{const l=s[a];if(!z(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=As(a,l,ah(a,n),J.scales[l.type]),d=oh(c,o),h=e.scales||{};i[a]=Oe(Object.create(null),[{axis:c},l,h[c],h[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,c=a.indexAxis||Ps(l,t),h=(oe[l]||{}).scales||{};Object.keys(h).forEach(f=>{const u=sh(f,c),p=a[u+"AxisID"]||u;i[p]=i[p]||Object.create(null),Oe(i[p],[{axis:u},s[p],h[f]])})}),Object.keys(i).forEach(a=>{const l=i[a];Oe(l,[J.scales[l.type],J.scale])}),i}function Li(n){const t=n.options||(n.options={});t.plugins=L(t.plugins,{}),t.scales=rh(n,t)}function Ri(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function lh(n){return n=n||{},n.data=Ri(n.data),Li(n),n}const zi=new Map,Ii=new Set;function Tn(n,t){let e=zi.get(n);return e||(e=t(),zi.set(n,e),Ii.add(e)),e}const Ge=(n,t,e)=>{const s=Ut(t,e);s!==void 0&&n.add(s)};class ch{constructor(t){this._config=lh(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=Ri(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(),Li(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Tn(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Tn(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Tn(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return Tn(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let o=s.get(t);return(!o||e)&&(o=new Map,s.set(t,o)),o}getOptionScopes(t,e,s){const{options:o,type:i}=this,a=this._cachedScopes(t,s),l=a.get(e);if(l)return l;const c=new Set;e.forEach(h=>{t&&(c.add(t),h.forEach(f=>Ge(c,t,f))),h.forEach(f=>Ge(c,o,f)),h.forEach(f=>Ge(c,oe[i]||{},f)),h.forEach(f=>Ge(c,J,f)),h.forEach(f=>Ge(c,ms,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Ii.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,oe[e]||{},J.datasets[e]||{},{type:e},J,ms]}resolveNamedOptions(t,e,s,o=[""]){const i={$shared:!0},{resolver:a,subPrefixes:l}=Wi(this._resolverCache,t,o);let c=a;if(hh(a,e)){i.$shared=!1,s=Xt(s)?s():s;const d=this.createResolver(t,s,l);c=we(a,s,d)}for(const d of e)i[d]=c[d];return i}createResolver(t,e,s=[""],o){const{resolver:i}=Wi(this._resolverCache,t,s);return z(e)?we(i,e,void 0,o):i}}function Wi(n,t,e){let s=n.get(t);s||(s=new Map,n.set(t,s));const o=e.join();let i=s.get(o);return i||(i={resolver:_s(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},s.set(o,i)),i}const dh=n=>z(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||Xt(n[e]),!1);function hh(n,t){const{isScriptable:e,isIndexable:s}=Yo(n);for(const o of t){const i=e(o),a=s(o),l=(a||i)&&n[o];if(i&&(Xt(l)||dh(l))||a&&X(l))return!0}return!1}var fh="4.4.0";const uh=["top","bottom","left","right","chartArea"];function Yi(n,t){return n==="top"||n==="bottom"||uh.indexOf(n)===-1&&t==="x"}function ji(n,t){return function(e,s){return e[n]===s[n]?e[t]-s[t]:e[n]-s[n]}}function Hi(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),H(e&&e.onComplete,[n],t)}function ph(n){const t=n.chart,e=t.options.animation;H(e&&e.onProgress,[n],t)}function Ui(n){return Zo()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Nn={},Xi=n=>{const t=Ui(n);return Object.values(Nn).filter(e=>e.canvas===t).pop()};function mh(n,t,e){const s=Object.keys(n);for(const o of s){const i=+o;if(i>=t){const a=n[o];delete n[o],(e>0||i>t)&&(n[i+e]=a)}}}function gh(n,t,e,s){return!e||n.type==="mouseout"?null:s?t:n}function $n(n,t,e){return n.options.clip?n[e]:t[e]}function bh(n,t){const{xScale:e,yScale:s}=n;return e&&s?{left:$n(e,t,"left"),right:$n(e,t,"right"),top:$n(s,t,"top"),bottom:$n(s,t,"bottom")}:t}class Lt{static register(...t){Bt.add(...t),qi()}static unregister(...t){Bt.remove(...t),qi()}constructor(t,e){const s=this.config=new ch(e),o=Ui(t),i=Xi(o);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Fd(o)),this.platform.updateConfig(s);const l=this.platform.acquireContext(o,a.aspectRatio),c=l&&l.canvas,d=c&&c.height,h=c&&c.width;if(this.id=_l(),this.ctx=l,this.canvas=c,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 Jd,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Tl(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],Nn[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Nt.listen(this,"complete",Hi),Nt.listen(this,"progress",ph),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:o,_aspectRatio:i}=this;return I(t)?e&&i?i:o?s/o: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 Bt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Jo(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return zo(this.canvas,this.ctx),this}stop(){return Nt.stop(this),this}resize(t,e){Nt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,o=this.canvas,i=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(o,t,e,i),l=s.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Jo(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),H(s.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Y(e,(s,o)=>{s.id=o})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,o=Object.keys(s).reduce((a,l)=>(a[l]=!1,a),{});let i=[];e&&(i=i.concat(Object.keys(e).map(a=>{const l=e[a],c=As(a,l),d=c==="r",h=c==="x";return{options:l,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),Y(i,a=>{const l=a.options,c=l.id,d=As(c,l),h=L(l.type,a.dtype);(l.position===void 0||Yi(l.position,d)!==Yi(a.dposition))&&(l.position=a.dposition),o[c]=!0;let f=null;if(c in s&&s[c].type===h)f=s[c];else{const u=Bt.getScale(h);f=new u({id:c,type:h,ctx:this.ctx,chart:this}),s[f.id]=f}f.init(l,t)}),Y(o,(a,l)=>{a||delete s[l]}),Y(s,a=>{lt.configure(this,a,a.options),lt.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((o,i)=>o.index-i.index),s>e){for(let o=e;o<s;++o)this._destroyDatasetMeta(o);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(ji("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,o)=>{e.filter(i=>i===s._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,o;for(this._removeUnreferencedMetasets(),s=0,o=e.length;s<o;s++){const i=e[s];let a=this.getDatasetMeta(s);const l=i.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=l,a.indexAxis=i.indexAxis||Ps(l,this.options),a.order=i.order||0,a.index=s,a.label=""+i.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{const c=Bt.getController(l),{datasetElementType:d,dataElementType:h}=J.datasets[l];Object.assign(c,{dataElementType:Bt.getElement(h),datasetElementType:d&&Bt.getElement(d)}),a.controller=new c(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){Y(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=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=!o&&i.indexOf(f)===-1;f.buildOrUpdateElements(u),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),o||Y(i,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ji("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){Y(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!wo(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:o,count:i}of e){const a=s==="_removeElements"?-i:i;mh(t,o,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=i=>new Set(t.filter(a=>a[0]===i).map((a,l)=>l+","+a.splice(1).join(","))),o=s(0);for(let i=1;i<e;i++)if(!wo(o,s(i)))return;return Array.from(o).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;lt.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],Y(this.boxes,o=>{s&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,Xt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),o={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(s.controller._update(e),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Nt.has(this)?this.attached&&!Nt.running(this)&&Nt.start(this):(this.draw(),Hi({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:o}=this._resizeBeforeDraw;this._resize(s,o),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let o,i;for(o=0,i=e.length;o<i;++o){const a=e[o];(!t||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,o=!s.disabled,i=bh(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(o&&_n(e,{left:s.left===!1?0:i.left-s.left,right:s.right===!1?this.width:i.right+s.right,top:s.top===!1?0:i.top-s.top,bottom:s.bottom===!1?this.height:i.bottom+s.bottom}),t.controller.draw(),o&&xn(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Tt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,o){const i=ud.modes[e];return typeof i=="function"?i(this,t,s,o):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let o=s.filter(i=>i&&i._dataset===e).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(o)),o}getContext(){return this.$context||(this.$context=Kt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const o=s?"show":"hide",i=this.getDatasetMeta(t),a=i.controller._resolveAnimations(void 0,o);Fe(e)?(i.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(i,{visible:s}),this.update(l=>l.datasetIndex===t?o: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(),Nt.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(),zo(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Nn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(i,a)=>{e.addEventListener(this,i,a),t[i]=a},o=(i,a,l)=>{i.offsetX=a,i.offsetY=l,this._eventHandler(i)};Y(this.options.events,i=>s(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(c,d)=>{e.addEventListener(this,c,d),t[c]=d},o=(c,d)=>{t[c]&&(e.removeEventListener(this,c,d),delete t[c])},i=(c,d)=>{this.canvas&&this.resize(c,d)};let a;const l=()=>{o("attach",l),this.attached=!0,this.resize(),s("resize",i),s("detach",a)};a=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),s("attach",l)},e.isAttached(this.canvas)?l():a()}unbindEvents(){Y(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Y(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const o=s?"set":"remove";let i,a,l,c;for(e==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){a=t[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[o+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:i,index:a})=>{const l=this.getDatasetMeta(i);if(!l)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:l.data[a],index:a}});!un(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const o=this.options.hover,i=(c,d)=>c.filter(h=>!d.some(f=>h.datasetIndex===f.datasetIndex&&h.index===f.index)),a=i(e,t),l=s?t:i(t,e);a.length&&this.updateHoverStyle(a,o.mode,!1),l.length&&o.mode&&this.updateHoverStyle(l,o.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},o=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,o)===!1)return;const i=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,o),(i||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:o=[],options:i}=this,a=e,l=this._getActiveElements(t,o,s,a),c=Sl(t),d=gh(t,this._lastEvent,s,c);s&&(this._lastEvent=null,H(i.onHover,[t,l,this],this),c&&H(i.onClick,[t,l,this],this));const h=!un(l,o);return(h||e)&&(this._active=l,this._updateHoverStyles(l,o,e)),this._lastEvent=d,h}_getActiveElements(t,e,s,o){if(t.type==="mouseout")return[];if(!s)return e;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,o)}}P(Lt,"defaults",J),P(Lt,"instances",Nn),P(Lt,"overrides",oe),P(Lt,"registry",Bt),P(Lt,"version",fh),P(Lt,"getChart",Xi);function qi(){return Y(Lt.instances,n=>n._plugins.invalidate())}function yh(n,t,e){const{startAngle:s,pixelMargin:o,x:i,y:a,outerRadius:l,innerRadius:c}=t;let d=o/l;n.beginPath(),n.arc(i,a,l,s-d,e+d),c>o?(d=o/c,n.arc(i,a,c,e+d,s-d,!0)):n.arc(i,a,o,e+tt,s-tt),n.closePath(),n.clip()}function _h(n){return ys(n,["outerStart","outerEnd","innerStart","innerEnd"])}function xh(n,t,e,s){const o=_h(n.options.borderRadius),i=(e-t)/2,a=Math.min(i,s*t/2),l=c=>{const d=(e-Math.min(i,c))*s/2;return ot(c,0,Math.min(i,d))};return{outerStart:l(o.outerStart),outerEnd:l(o.outerEnd),innerStart:ot(o.innerStart,0,a),innerEnd:ot(o.innerEnd,0,a)}}function Se(n,t,e,s){return{x:e+n*Math.cos(t),y:s+n*Math.sin(t)}}function Ln(n,t,e,s,o,i){const{x:a,y:l,startAngle:c,pixelMargin:d,innerRadius:h}=t,f=Math.max(t.outerRadius+s+e-d,0),u=h>0?h+s+e+d:0;let p=0;const m=o-c;if(s){const B=h>0?h-s:0,D=f>0?f-s:0,V=(B+D)/2,A=V!==0?m*V/(V+s):m;p=(m-A)/2}const g=Math.max(.001,m*f-e/q)/f,b=(m-g)/2,_=c+b+p,y=o-b-p,{outerStart:k,outerEnd:w,innerStart:x,innerEnd:C}=xh(t,u,f,y-_),S=f-k,M=f-w,v=_+k/S,E=y-w/M,O=u+x,N=u+C,U=_+x/O,F=y-C/N;if(n.beginPath(),i){const B=(v+E)/2;if(n.arc(a,l,f,v,B),n.arc(a,l,f,B,E),w>0){const T=Se(M,E,a,l);n.arc(T.x,T.y,w,E,y+tt)}const D=Se(N,y,a,l);if(n.lineTo(D.x,D.y),C>0){const T=Se(N,F,a,l);n.arc(T.x,T.y,C,y+tt,F+Math.PI)}const V=(y-C/u+(_+x/u))/2;if(n.arc(a,l,u,y-C/u,V,!0),n.arc(a,l,u,V,_+x/u,!0),x>0){const T=Se(O,U,a,l);n.arc(T.x,T.y,x,U+Math.PI,_-tt)}const A=Se(S,_,a,l);if(n.lineTo(A.x,A.y),k>0){const T=Se(S,v,a,l);n.arc(T.x,T.y,k,_-tt,v)}}else{n.moveTo(a,l);const B=Math.cos(v)*f+a,D=Math.sin(v)*f+l;n.lineTo(B,D);const V=Math.cos(E)*f+a,A=Math.sin(E)*f+l;n.lineTo(V,A)}n.closePath()}function kh(n,t,e,s,o){const{fullCircles:i,startAngle:a,circumference:l}=t;let c=t.endAngle;if(i){Ln(n,t,e,s,c,o);for(let d=0;d<i;++d)n.fill();isNaN(l)||(c=a+(l%K||K))}return Ln(n,t,e,s,c,o),n.fill(),c}function wh(n,t,e,s,o){const{fullCircles:i,startAngle:a,circumference:l,options:c}=t,{borderWidth:d,borderJoinStyle:h,borderDash:f,borderDashOffset:u}=c,p=c.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(i){Ln(n,t,e,s,m,o);for(let g=0;g<i;++g)n.stroke();isNaN(l)||(m=a+(l%K||K))}p&&yh(n,t,m),i||(Ln(n,t,e,s,m,o),n.stroke())}class Ze extends $t{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,s,o){const i=this.getProps(["x","y"],o),{angle:a,distance:l}=Bo(i,{x:e,y:s}),{startAngle:c,endAngle:d,innerRadius:h,outerRadius:f,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),p=(this.options.spacing+this.options.borderWidth)/2,g=L(u,d-c)>=K||Ne(a,c,d),b=Ot(l,h+p,f+p);return g&&b}getCenterPoint(e){const{x:s,y:o,startAngle:i,endAngle:a,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:d,spacing:h}=this.options,f=(i+a)/2,u=(l+c+h+d)/2;return{x:s+Math.cos(f)*u,y:o+Math.sin(f)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:s,circumference:o}=this,i=(s.offset||0)/4,a=(s.spacing||0)/2,l=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=o>K?Math.floor(o/K):0,o===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const c=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(c)*i,Math.sin(c)*i);const d=1-Math.sin(Math.min(q,o||0)),h=i*d;e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,kh(e,this,h,a,l),wh(e,this,h,a,l),e.restore()}}P(Ze,"id","arc"),P(Ze,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),P(Ze,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(Ze,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Ki(n,t,e=t){n.lineCap=L(e.borderCapStyle,t.borderCapStyle),n.setLineDash(L(e.borderDash,t.borderDash)),n.lineDashOffset=L(e.borderDashOffset,t.borderDashOffset),n.lineJoin=L(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=L(e.borderWidth,t.borderWidth),n.strokeStyle=L(e.borderColor,t.borderColor)}function Ch(n,t,e){n.lineTo(e.x,e.y)}function Mh(n){return n.stepped?Xl:n.tension||n.cubicInterpolationMode==="monotone"?ql:Ch}function Gi(n,t,e={}){const s=n.length,{start:o=0,end:i=s-1}=e,{start:a,end:l}=t,c=Math.max(o,a),d=Math.min(i,l),h=o<a&&i<a||o>l&&i>l;return{count:s,start:c,loop:t.loop,ilen:d<c&&!h?s+d-c:d-c}}function Sh(n,t,e,s){const{points:o,options:i}=t,{count:a,start:l,loop:c,ilen:d}=Gi(o,e,s),h=Mh(i);let{move:f=!0,reverse:u}=s||{},p,m,g;for(p=0;p<=d;++p)m=o[(l+(u?d-p:p))%a],!m.skip&&(f?(n.moveTo(m.x,m.y),f=!1):h(n,g,m,u,i.stepped),g=m);return c&&(m=o[(l+(u?d:0))%a],h(n,g,m,u,i.stepped)),!!c}function Dh(n,t,e,s){const o=t.points,{count:i,start:a,ilen:l}=Gi(o,e,s),{move:c=!0,reverse:d}=s||{};let h=0,f=0,u,p,m,g,b,_;const y=w=>(a+(d?l-w:w))%i,k=()=>{g!==b&&(n.lineTo(h,b),n.lineTo(h,g),n.lineTo(h,_))};for(c&&(p=o[y(0)],n.moveTo(p.x,p.y)),u=0;u<=l;++u){if(p=o[y(u)],p.skip)continue;const w=p.x,x=p.y,C=w|0;C===m?(x<g?g=x:x>b&&(b=x),h=(f*h+w)/++f):(k(),n.lineTo(w,x),m=C,f=0,g=b=x),_=x}k()}function Os(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Dh:Sh}function Bh(n){return n.stepped?Dc:n.tension||n.cubicInterpolationMode==="monotone"?Bc:de}function vh(n,t,e,s){let o=t._path;o||(o=t._path=new Path2D,t.path(o,e,s)&&o.closePath()),Ki(n,t.options),n.stroke(o)}function Eh(n,t,e,s){const{segments:o,options:i}=t,a=Os(t);for(const l of o)Ki(n,i,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+s-1})&&n.closePath(),n.stroke()}const Vh=typeof Path2D=="function";function Ph(n,t,e,s){Vh&&!t.options.segment?vh(n,t,e,s):Eh(n,t,e,s)}class Gt extends $t{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const o=s.spanGaps?this._loop:this._fullLoop;yc(this._points,s,t,o,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=Oc(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,o=t[e],i=this.points,a=ii(this,{property:e,start:o,end:o});if(!a.length)return;const l=[],c=Bh(s);let d,h;for(d=0,h=a.length;d<h;++d){const{start:f,end:u}=a[d],p=i[f],m=i[u];if(p===m){l.push(p);continue}const g=Math.abs((o-p[e])/(m[e]-p[e])),b=c(p,m,g,s.stepped);b[e]=t[e],l.push(b)}return l.length===1?l[0]:l}pathSegment(t,e,s){return Os(this)(t,this,e,s)}path(t,e,s){const o=this.segments,i=Os(this);let a=this._loop;e=e||0,s=s||this.points.length-e;for(const l of o)a&=i(t,this,l,{start:e,end:e+s-1});return!!a}draw(t,e,s,o){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(t.save(),Ph(t,this,s,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(Gt,"id","line"),P(Gt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(Gt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(Gt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Zi(n,t,e,s){const o=n.options,{[e]:i}=n.getProps([e],s);return Math.abs(t-i)<o.radius+o.hitRadius}class Rn extends $t{constructor(e){super();P(this,"parsed");P(this,"skip");P(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,s,o){const i=this.options,{x:a,y:l}=this.getProps(["x","y"],o);return Math.pow(e-a,2)+Math.pow(s-l,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(e,s){return Zi(this,e,"x",s)}inYRange(e,s){return Zi(this,e,"y",s)}getCenterPoint(e){const{x:s,y:o}=this.getProps(["x","y"],e);return{x:s,y:o}}size(e){e=e||this.options||{};let s=e.radius||0;s=Math.max(s,s&&e.hoverRadius||0);const o=s&&e.borderWidth||0;return(s+o)*2}draw(e,s){const o=this.options;this.skip||o.radius<.1||!Tt(this,s,this.size(o)/2)||(e.strokeStyle=o.borderColor,e.lineWidth=o.borderWidth,e.fillStyle=o.backgroundColor,bs(e,o,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(Rn,"id","point"),P(Rn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(Rn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Ji(n,t){const{x:e,y:s,base:o,width:i,height:a}=n.getProps(["x","y","base","width","height"],t);let l,c,d,h,f;return n.horizontal?(f=a/2,l=Math.min(e,o),c=Math.max(e,o),d=s-f,h=s+f):(f=i/2,l=e-f,c=e+f,d=Math.min(s,o),h=Math.max(s,o)),{left:l,top:d,right:c,bottom:h}}function Zt(n,t,e,s){return n?0:ot(t,e,s)}function Ah(n,t,e){const s=n.options.borderWidth,o=n.borderSkipped,i=Wo(s);return{t:Zt(o.top,i.top,0,e),r:Zt(o.right,i.right,0,t),b:Zt(o.bottom,i.bottom,0,e),l:Zt(o.left,i.left,0,t)}}function Oh(n,t,e){const{enableBorderRadius:s}=n.getProps(["enableBorderRadius"]),o=n.options.borderRadius,i=re(o),a=Math.min(t,e),l=n.borderSkipped,c=s||z(o);return{topLeft:Zt(!c||l.top||l.left,i.topLeft,0,a),topRight:Zt(!c||l.top||l.right,i.topRight,0,a),bottomLeft:Zt(!c||l.bottom||l.left,i.bottomLeft,0,a),bottomRight:Zt(!c||l.bottom||l.right,i.bottomRight,0,a)}}function Fh(n){const t=Ji(n),e=t.right-t.left,s=t.bottom-t.top,o=Ah(n,e/2,s/2),i=Oh(n,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:e-o.l-o.r,h:s-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function Fs(n,t,e,s){const o=t===null,i=e===null,l=n&&!(o&&i)&&Ji(n,s);return l&&(o||Ot(t,l.left,l.right))&&(i||Ot(e,l.top,l.bottom))}function Th(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function Nh(n,t){n.rect(t.x,t.y,t.w,t.h)}function Ts(n,t,e={}){const s=n.x!==e.x?-t:0,o=n.y!==e.y?-t:0,i=(n.x+n.w!==e.x+e.w?t:0)-s,a=(n.y+n.h!==e.y+e.h?t:0)-o;return{x:n.x+s,y:n.y+o,w:n.w+i,h:n.h+a,radius:n.radius}}class zn extends $t{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:s,backgroundColor:o}}=this,{inner:i,outer:a}=Fh(this),l=Th(a.radius)?ze:Nh;t.save(),(a.w!==i.w||a.h!==i.h)&&(t.beginPath(),l(t,Ts(a,e,i)),t.clip(),l(t,Ts(i,-e,a)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),l(t,Ts(i,e)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,e,s){return Fs(this,t,e,s)}inXRange(t,e){return Fs(this,t,null,e)}inYRange(t,e){return Fs(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:o,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(e+o)/2:e,y:i?s:(s+o)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}P(zn,"id","bar"),P(zn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(zn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var $h=Object.freeze({__proto__:null,ArcElement:Ze,BarElement:zn,LineElement:Gt,PointElement:Rn});const Ns=["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)"],Qi=Ns.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ta(n){return Ns[n%Ns.length]}function ea(n){return Qi[n%Qi.length]}function Lh(n,t){return n.borderColor=ta(t),n.backgroundColor=ea(t),++t}function Rh(n,t){return n.backgroundColor=n.data.map(()=>ta(t++)),t}function zh(n,t){return n.backgroundColor=n.data.map(()=>ea(t++)),t}function Ih(n){let t=0;return(e,s)=>{const o=n.getDatasetMeta(s).controller;o instanceof he?t=Rh(e,t):o instanceof Ye?t=zh(e,t):o&&(t=Lh(e,t))}}function na(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function Wh(n){return n&&(n.borderColor||n.backgroundColor)}var Yh={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:s},options:o}=n.config,{elements:i}=o;if(!e.forceOverride&&(na(s)||Wh(o)||i&&na(i)))return;const a=Ih(n);s.forEach(a)}};function jh(n,t,e,s,o){const i=o.samples||s;if(i>=e)return n.slice(t,t+e);const a=[],l=(e-2)/(i-2);let c=0;const d=t+e-1;let h=t,f,u,p,m,g;for(a[c++]=n[h],f=0;f<i-2;f++){let b=0,_=0,y;const k=Math.floor((f+1)*l)+1+t,w=Math.min(Math.floor((f+2)*l)+1,e)+t,x=w-k;for(y=k;y<w;y++)b+=n[y].x,_+=n[y].y;b/=x,_/=x;const C=Math.floor(f*l)+1+t,S=Math.min(Math.floor((f+1)*l)+1,e)+t,{x:M,y:v}=n[h];for(p=m=-1,y=C;y<S;y++)m=.5*Math.abs((M-b)*(n[y].y-v)-(M-n[y].x)*(_-v)),m>p&&(p=m,u=n[y],g=y);a[c++]=u,h=g}return a[c++]=n[d],a}function Hh(n,t,e,s){let o=0,i=0,a,l,c,d,h,f,u,p,m,g;const b=[],_=t+e-1,y=n[t].x,w=n[_].x-y;for(a=t;a<t+e;++a){l=n[a],c=(l.x-y)/w*s,d=l.y;const x=c|0;if(x===h)d<m?(m=d,f=a):d>g&&(g=d,u=a),o=(i*o+l.x)/++i;else{const C=a-1;if(!I(f)&&!I(u)){const S=Math.min(f,u),M=Math.max(f,u);S!==p&&S!==C&&b.push({...n[S],x:o}),M!==p&&M!==C&&b.push({...n[M],x:o})}a>0&&C!==p&&b.push(n[C]),b.push(l),h=x,i=0,m=g=d,f=u=p=a}}return b}function sa(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 oa(n){n.data.datasets.forEach(t=>{sa(t)})}function Uh(n,t){const e=t.length;let s=0,o;const{iScale:i}=n,{min:a,max:l,minDefined:c,maxDefined:d}=i.getUserBounds();return c&&(s=ot(Ft(t,i.axis,a).lo,0,e-1)),d?o=ot(Ft(t,i.axis,l).hi+1,s,e)-s:o=e-s,{start:s,count:o}}var Xh={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){oa(n);return}const s=n.width;n.data.datasets.forEach((o,i)=>{const{_data:a,indexAxis:l}=o,c=n.getDatasetMeta(i),d=a||o.data;if(Ie([l,n.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const h=n.scales[c.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:f,count:u}=Uh(c,d);const p=e.threshold||4*s;if(u<=p){sa(o);return}I(a)&&(o._data=d,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(e.algorithm){case"lttb":m=jh(d,f,u,s,e);break;case"min-max":m=Hh(d,f,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}o._decimated=m})},destroy(n){oa(n)}};function qh(n,t,e){const s=n.segments,o=n.points,i=t.points,a=[];for(const l of s){let{start:c,end:d}=l;d=Ls(c,d,o);const h=$s(e,o[c],o[d],l.loop);if(!t.segments){a.push({source:l,target:h,start:o[c],end:o[d]});continue}const f=ii(t,h);for(const u of f){const p=$s(e,i[u.start],i[u.end],u.loop),m=oi(l,o,p);for(const g of m)a.push({source:g,target:u,start:{[e]:ia(h,p,"start",Math.max)},end:{[e]:ia(h,p,"end",Math.min)}})}}return a}function $s(n,t,e,s){if(s)return;let o=t[n],i=e[n];return n==="angle"&&(o=gt(o),i=gt(i)),{property:n,start:o,end:i}}function Kh(n,t){const{x:e=null,y:s=null}=n||{},o=t.points,i=[];return t.segments.forEach(({start:a,end:l})=>{l=Ls(a,l,o);const c=o[a],d=o[l];s!==null?(i.push({x:c.x,y:s}),i.push({x:d.x,y:s})):e!==null&&(i.push({x:e,y:c.y}),i.push({x:e,y:d.y}))}),i}function Ls(n,t,e){for(;t>n;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function ia(n,t,e,s){return n&&t?s(n[e],t[e]):n?n[e]:t?t[e]:0}function aa(n,t){let e=[],s=!1;return X(n)?(s=!0,e=n):e=Kh(n,t),e.length?new Gt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function ra(n){return n&&n.fill!==!1}function Gh(n,t,e){let o=n[t].fill;const i=[t];let a;if(!e)return o;for(;o!==!1&&i.indexOf(o)===-1;){if(!Z(o))return o;if(a=n[o],!a)return!1;if(a.visible)return o;i.push(o),o=a.fill}return!1}function Zh(n,t,e){const s=ef(n);if(z(s))return isNaN(s.value)?!1:s;let o=parseFloat(s);return Z(o)&&Math.floor(o)===o?Jh(s[0],t,o,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Jh(n,t,e,s){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function Qh(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:z(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function tf(n,t,e){let s;return n==="start"?s=e:n==="end"?s=t.options.reverse?t.min:t.max:z(n)?s=n.value:s=t.getBaseValue(),s}function ef(n){const t=n.options,e=t.fill;let s=L(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function nf(n){const{scale:t,index:e,line:s}=n,o=[],i=s.segments,a=s.points,l=sf(t,e);l.push(aa({x:null,y:t.bottom},s));for(let c=0;c<i.length;c++){const d=i[c];for(let h=d.start;h<=d.end;h++)of(o,a[h],l)}return new Gt({points:o,options:{}})}function sf(n,t){const e=[],s=n.getMatchingVisibleMetas("line");for(let o=0;o<s.length;o++){const i=s[o];if(i.index===t)break;i.hidden||e.unshift(i.dataset)}return e}function of(n,t,e){const s=[];for(let o=0;o<e.length;o++){const i=e[o],{first:a,last:l,point:c}=af(i,t,"x");if(!(!c||a&&l)){if(a)s.unshift(c);else if(n.push(c),!l)break}}n.push(...s)}function af(n,t,e){const s=n.interpolate(t,e);if(!s)return{};const o=s[e],i=n.segments,a=n.points;let l=!1,c=!1;for(let d=0;d<i.length;d++){const h=i[d],f=a[h.start][e],u=a[h.end][e];if(Ot(o,f,u)){l=o===f,c=o===u;break}}return{first:l,last:c,point:s}}class la{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){const{x:o,y:i,radius:a}=this;return e=e||{start:0,end:K},t.arc(o,i,a,e.end,e.start,!0),!s.bounds}interpolate(t){const{x:e,y:s,radius:o}=this,i=t.angle;return{x:e+Math.cos(i)*o,y:s+Math.sin(i)*o,angle:i}}}function rf(n){const{chart:t,fill:e,line:s}=n;if(Z(e))return lf(t,e);if(e==="stack")return nf(n);if(e==="shape")return!0;const o=cf(n);return o instanceof la?o:aa(o,s)}function lf(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function cf(n){return(n.scale||{}).getPointPositionForValue?hf(n):df(n)}function df(n){const{scale:t={},fill:e}=n,s=Qh(e,t);if(Z(s)){const o=t.isHorizontal();return{x:o?s:null,y:o?null:s}}return null}function hf(n){const{scale:t,fill:e}=n,s=t.options,o=t.getLabels().length,i=s.reverse?t.max:t.min,a=tf(e,t,i),l=[];if(s.grid.circular){const c=t.getPointPositionForValue(0,i);return new la({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(a)})}for(let c=0;c<o;++c)l.push(t.getPointPositionForValue(c,a));return l}function Rs(n,t,e){const s=rf(t),{line:o,scale:i,axis:a}=t,l=o.options,c=l.fill,d=l.backgroundColor,{above:h=d,below:f=d}=c||{};s&&o.points.length&&(_n(n,e),ff(n,{line:o,target:s,above:h,below:f,area:e,scale:i,axis:a}),xn(n))}function ff(n,t){const{line:e,target:s,above:o,below:i,area:a,scale:l}=t,c=e._loop?"angle":t.axis;n.save(),c==="x"&&i!==o&&(ca(n,s,a.top),da(n,{line:e,target:s,color:o,scale:l,property:c}),n.restore(),n.save(),ca(n,s,a.bottom)),da(n,{line:e,target:s,color:i,scale:l,property:c}),n.restore()}function ca(n,t,e){const{segments:s,points:o}=t;let i=!0,a=!1;n.beginPath();for(const l of s){const{start:c,end:d}=l,h=o[c],f=o[Ls(c,d,o)];i?(n.moveTo(h.x,h.y),i=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(f.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function da(n,t){const{line:e,target:s,property:o,color:i,scale:a}=t,l=qh(e,s,o);for(const{source:c,target:d,start:h,end:f}of l){const{style:{backgroundColor:u=i}={}}=c,p=s!==!0;n.save(),n.fillStyle=u,uf(n,a,p&&$s(o,h,f)),n.beginPath();const m=!!e.pathSegment(n,c);let g;if(p){m?n.closePath():ha(n,s,f,o);const b=!!s.pathSegment(n,d,{move:m,reverse:!0});g=m&&b,g||ha(n,s,h,o)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function uf(n,t,e){const{top:s,bottom:o}=t.chart.chartArea,{property:i,start:a,end:l}=e||{};i==="x"&&(n.beginPath(),n.rect(a,s,l-a,o-s),n.clip())}function ha(n,t,e,s){const o=t.interpolate(e,s);o&&n.lineTo(o.x,o.y)}var pf={id:"filler",afterDatasetsUpdate(n,t,e){const s=(n.data.datasets||[]).length,o=[];let i,a,l,c;for(a=0;a<s;++a)i=n.getDatasetMeta(a),l=i.dataset,c=null,l&&l.options&&l instanceof Gt&&(c={visible:n.isDatasetVisible(a),index:a,fill:Zh(l,a,s),chart:n,axis:i.controller.options.indexAxis,scale:i.vScale,line:l}),i.$filler=c,o.push(c);for(a=0;a<s;++a)c=o[a],!(!c||c.fill===!1)&&(c.fill=Gh(o,a,e.propagate))},beforeDraw(n,t,e){const s=e.drawTime==="beforeDraw",o=n.getSortedVisibleDatasetMetas(),i=n.chartArea;for(let a=o.length-1;a>=0;--a){const l=o[a].$filler;l&&(l.line.updateControlPoints(i,l.axis),s&&l.fill&&Rs(n.ctx,l,i))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=n.getSortedVisibleDatasetMetas();for(let o=s.length-1;o>=0;--o){const i=s[o].$filler;ra(i)&&Rs(n.ctx,i,n.chartArea)}},beforeDatasetDraw(n,t,e){const s=t.meta.$filler;!ra(s)||e.drawTime!=="beforeDatasetDraw"||Rs(n.ctx,s,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const fa=(n,t)=>{let{boxHeight:e=t,boxWidth:s=t}=n;return n.usePointStyle&&(e=Math.min(e,t),s=n.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},mf=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class ua extends $t{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=H(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,o)=>t.sort(s,o,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,o=nt(s.font),i=o.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=fa(s,i);let d,h;e.font=o.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(a,i,l,c)+10):(h=this.maxHeight,d=this._fitCols(a,o,l,c)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,o){const{ctx:i,maxWidth:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],h=o+l;let f=t;i.textAlign="left",i.textBaseline="middle";let u=-1,p=-h;return this.legendItems.forEach((m,g)=>{const b=s+e/2+i.measureText(m.text).width;(g===0||d[d.length-1]+b+2*l>a)&&(f+=h,d[d.length-(g>0?0:1)]=0,p+=h,u++),c[g]={left:0,top:p,row:u,width:b,height:o},d[d.length-1]+=b+l}),f}_fitCols(t,e,s,o){const{ctx:i,maxHeight:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let f=l,u=0,p=0,m=0,g=0;return this.legendItems.forEach((b,_)=>{const{itemWidth:y,itemHeight:k}=gf(s,e,i,b,o);_>0&&p+k+2*l>h&&(f+=u+l,d.push({width:u,height:p}),m+=u+l,g++,u=p=0),c[_]={left:m,top:p,col:g,width:y,height:k},u=Math.max(u,y),p+=k+l}),f+=u,d.push({width:u,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:o},rtl:i}}=this,a=Me(i,this.left,this.width);if(this.isHorizontal()){let l=0,c=at(s,this.left+o,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,c=at(s,this.left+o,this.right-this.lineWidths[l])),d.top+=this.top+t+o,d.left=a.leftForLtr(a.x(c),d.width),c+=d.width+o}else{let l=0,c=at(s,this.top+t+o,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,c=at(s,this.top+t+o,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+o,d.left=a.leftForLtr(a.x(d.left),d.width),c+=d.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;_n(t,this),this._draw(),xn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:o}=this,{align:i,labels:a}=t,l=J.color,c=Me(t.rtl,this.left,this.width),d=nt(a.font),{padding:h}=a,f=d.size,u=f/2;let p;this.drawTitle(),o.textAlign=c.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=d.string;const{boxWidth:m,boxHeight:g,itemHeight:b}=fa(a,f),_=function(C,S,M){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;o.save();const v=L(M.lineWidth,1);if(o.fillStyle=L(M.fillStyle,l),o.lineCap=L(M.lineCap,"butt"),o.lineDashOffset=L(M.lineDashOffset,0),o.lineJoin=L(M.lineJoin,"miter"),o.lineWidth=v,o.strokeStyle=L(M.strokeStyle,l),o.setLineDash(L(M.lineDash,[])),a.usePointStyle){const E={radius:g*Math.SQRT2/2,pointStyle:M.pointStyle,rotation:M.rotation,borderWidth:v},O=c.xPlus(C,m/2),N=S+u;Io(o,E,O,N,a.pointStyleWidth&&m)}else{const E=S+Math.max((f-g)/2,0),O=c.leftForLtr(C,m),N=re(M.borderRadius);o.beginPath(),Object.values(N).some(U=>U!==0)?ze(o,{x:O,y:E,w:m,h:g,radius:N}):o.rect(O,E,m,g),o.fill(),v!==0&&o.stroke()}o.restore()},y=function(C,S,M){ae(o,M.text,C,S+b/2,d,{strikethrough:M.hidden,textAlign:c.textAlign(M.textAlign)})},k=this.isHorizontal(),w=this._computeTitleHeight();k?p={x:at(i,this.left+h,this.right-s[0]),y:this.top+h+w,line:0}:p={x:this.left+h,y:at(i,this.top+w+h,this.bottom-e[0].height),line:0},ti(this.ctx,t.textDirection);const x=b+h;this.legendItems.forEach((C,S)=>{o.strokeStyle=C.fontColor,o.fillStyle=C.fontColor;const M=o.measureText(C.text).width,v=c.textAlign(C.textAlign||(C.textAlign=a.textAlign)),E=m+u+M;let O=p.x,N=p.y;c.setWidth(this.width),k?S>0&&O+E+h>this.right&&(N=p.y+=x,p.line++,O=p.x=at(i,this.left+h,this.right-s[p.line])):S>0&&N+x>this.bottom&&(O=p.x=O+e[p.line].width+h,p.line++,N=p.y=at(i,this.top+w+h,this.bottom-e[p.line].height));const U=c.x(O);if(_(U,N,C),O=Nl(v,O+m+u,k?O+E:this.right,t.rtl),y(c.x(O),N,C),k)p.x+=E+h;else if(typeof C.text!="string"){const F=d.lineHeight;p.y+=pa(C,F)+h}else p.y+=x}),ei(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=nt(e.font),o=rt(e.padding);if(!e.display)return;const i=Me(t.rtl,this.left,this.width),a=this.ctx,l=e.position,c=s.size/2,d=o.top+c;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(l,f,f+u);a.textAlign=i.textAlign(fs(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,ae(a,e.text,p,h,s)}_computeTitleHeight(){const t=this.options.title,e=nt(t.font),s=rt(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,o,i;if(Ot(t,this.left,this.right)&&Ot(e,this.top,this.bottom)){for(i=this.legendHitBoxes,s=0;s<i.length;++s)if(o=i[s],Ot(t,o.left,o.left+o.width)&&Ot(e,o.top,o.top+o.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!_f(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=mf(o,s);o&&!i&&H(e.onLeave,[t,o,this],this),this._hoveredItem=s,s&&!i&&H(e.onHover,[t,s,this],this)}else s&&H(e.onClick,[t,s,this],this)}}function gf(n,t,e,s,o){const i=bf(s,n,t,e),a=yf(o,s,t.lineHeight);return{itemWidth:i,itemHeight:a}}function bf(n,t,e,s){let o=n.text;return o&&typeof o!="string"&&(o=o.reduce((i,a)=>i.length>a.length?i:a)),t+e.size/2+s.measureText(o).width}function yf(n,t,e){let s=n;return typeof t.text!="string"&&(s=pa(t,e)),s}function pa(n,t){const e=n.text?n.text.length:0;return t*e}function _f(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var xf={id:"legend",_element:ua,start(n,t,e){const s=n.legend=new ua({ctx:n.ctx,options:e,chart:n});lt.configure(n,s,e),lt.addBox(n,s)},stop(n){lt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const s=n.legend;lt.configure(n,s,e),s.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 s=t.datasetIndex,o=e.chart;o.isDatasetVisible(s)?(o.hide(s),t.hidden=!0):(o.show(s),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:s,textAlign:o,color:i,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(e?0:void 0),h=rt(d.borderWidth);return{text:t[c.index].label,fillStyle:d.backgroundColor,fontColor:i,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:s||d.pointStyle,rotation:d.rotation,textAlign:o||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:c.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 zs extends $t{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const o=X(s.text)?s.text.length:1;this._padding=rt(s.padding);const i=o*nt(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:o,right:i,options:a}=this,l=a.align;let c=0,d,h,f;return this.isHorizontal()?(h=at(l,s,i),f=e+t,d=i-s):(a.position==="left"?(h=s+t,f=at(l,o,e),c=q*-.5):(h=i-t,f=at(l,e,o),c=q*.5),d=o-e),{titleX:h,titleY:f,maxWidth:d,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=nt(e.font),i=s.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(i);ae(t,e.text,0,0,s,{color:e.color,maxWidth:c,rotation:d,textAlign:fs(e.align),textBaseline:"middle",translation:[a,l]})}}function kf(n,t){const e=new zs({ctx:n.ctx,options:t,chart:n});lt.configure(n,e,t),lt.addBox(n,e),n.titleBlock=e}var wf={id:"title",_element:zs,start(n,t,e){kf(n,e)},stop(n){const t=n.titleBlock;lt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const s=n.titleBlock;lt.configure(n,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const In=new WeakMap;var Cf={id:"subtitle",start(n,t,e){const s=new zs({ctx:n.ctx,options:e,chart:n});lt.configure(n,s,e),lt.addBox(n,s),In.set(n,s)},stop(n){lt.removeBox(n,In.get(n)),In.delete(n)},beforeUpdate(n,t,e){const s=In.get(n);lt.configure(n,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Je={average(n){if(!n.length)return!1;let t,e,s=0,o=0,i=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s+=l.x,o+=l.y,++i}}return{x:s/i,y:o/i}},nearest(n,t){if(!n.length)return!1;let e=t.x,s=t.y,o=Number.POSITIVE_INFINITY,i,a,l;for(i=0,a=n.length;i<a;++i){const c=n[i].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),h=ds(t,d);h<o&&(o=h,l=c)}}if(l){const c=l.tooltipPosition();e=c.x,s=c.y}return{x:e,y:s}}};function vt(n,t){return t&&(X(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Rt(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
23
+ */class ed{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,o){const i=e.listeners[o],a=e.duration;i.forEach(l=>l({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Io.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,o)=>{if(!s.running||!s.items.length)return;const i=s.items;let a=i.length-1,l=!1,c;for(;a>=0;--a)c=i[a],c._active?(c._total>s.duration&&(s.duration=c._total),c.tick(t),l=!0):(i[a]=i[i.length-1],i.pop());l&&(o.draw(),this._notify(o,s,t,"progress")),i.length||(s.running=!1,this._notify(o,s,t,"complete"),s.initial=!1),e+=i.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,o)=>Math.max(s,o._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let o=s.length-1;for(;o>=0;--o)s[o].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Tt=new ed;const bi="transparent",nd={boolean(n,t,e){return e>.5?t:n},color(n,t,e){const s=Uo(n||bi),o=s.valid&&Uo(t||bi);return o&&o.valid?o.mix(s,e).hexString():t},number(n,t,e){return n+(t-n)*e}};class sd{constructor(t,e,s,o){const i=e[s];o=We([t.to,o,i,t.from]);const a=We([t.from,i,o]);this._active=!0,this._fn=t.fn||nd[t.type||typeof a],this._easing=Le[t.easing]||Le.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=o,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const o=this._target[this._prop],i=s-this._start,a=this._duration-i;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=We([t.to,e,o,t.from]),this._from=We([t.from,o,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,o=this._prop,i=this._from,a=this._loop,l=this._to;let c;if(this._active=i!==l&&(a||e<s),!this._active){this._target[o]=l,this._notify(!0);return}if(e<0){this._target[o]=i;return}c=e/s%2,c=a&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[o]=this._fn(i,l,c)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let o=0;o<s.length;o++)s[o][e]()}}class yi{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!I(t))return;const e=Object.keys(J.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(o=>{const i=t[o];if(!I(i))return;const a={};for(const l of e)a[l]=i[l];(q(i.properties)&&i.properties||[o]).forEach(l=>{(l===o||!s.has(l))&&s.set(l,a)})})}_animateOptions(t,e){const s=e.options,o=id(t,s);if(!o)return[];const i=this._createAnimations(o,s);return s.$shared&&od(t.options.$animations,s).then(()=>{t.options=s},()=>{}),i}_createAnimations(t,e){const s=this._properties,o=[],i=t.$animations||(t.$animations={}),a=Object.keys(e),l=Date.now();let c;for(c=a.length-1;c>=0;--c){const d=a[c];if(d.charAt(0)==="$")continue;if(d==="options"){o.push(...this._animateOptions(t,e));continue}const h=e[d];let f=i[d];const u=s.get(d);if(f)if(u&&f.active()){f.update(u,h,l);continue}else f.cancel();if(!u||!u.duration){t[d]=h;continue}i[d]=f=new sd(u,t,d,h),o.push(f)}return o}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return Tt.add(this._chart,s),!0}}function od(n,t){const e=[],s=Object.keys(t);for(let o=0;o<s.length;o++){const i=n[s[o]];i&&i.active()&&e.push(i.wait())}return Promise.all(e)}function id(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 _i(n,t){const e=n&&n.options||{},s=e.reverse,o=e.min===void 0?t:0,i=e.max===void 0?t:0;return{start:s?i:o,end:s?o:i}}function ad(n,t,e){if(e===!1)return!1;const s=_i(n,e),o=_i(t,e);return{top:o.end,right:s.end,bottom:o.start,left:s.start}}function rd(n){let t,e,s,o;return I(n)?(t=n.top,e=n.right,s=n.bottom,o=n.left):t=e=s=o=n,{top:t,right:e,bottom:s,left:o,disabled:n===!1}}function xi(n,t){const e=[],s=n._getSortedDatasetMetas(t);let o,i;for(o=0,i=s.length;o<i;++o)e.push(s[o].index);return e}function ki(n,t,e,s={}){const o=n.keys,i=s.mode==="single";let a,l,c,d;if(t!==null){for(a=0,l=o.length;a<l;++a){if(c=+o[a],c===e){if(s.all)continue;break}d=n.values[c],Z(d)&&(i||t===0||Mt(t)===Mt(d))&&(t+=d)}return t}}function ld(n){const t=Object.keys(n),e=new Array(t.length);let s,o,i;for(s=0,o=t.length;s<o;++s)i=t[s],e[s]={x:i,y:n[i]};return e}function wi(n,t){const e=n&&n.options.stacked;return e||e===void 0&&t.stack!==void 0}function cd(n,t,e){return`${n.id}.${t.id}.${e.stack||e.type}`}function dd(n){const{min:t,max:e,minDefined:s,maxDefined:o}=n.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:o?e:Number.POSITIVE_INFINITY}}function hd(n,t,e){const s=n[t]||(n[t]={});return s[e]||(s[e]={})}function Ci(n,t,e,s){for(const o of t.getMatchingVisibleMetas(s).reverse()){const i=n[o.index];if(e&&i>0||!e&&i<0)return o.index}return null}function Si(n,t){const{chart:e,_cachedMeta:s}=n,o=e._stacks||(e._stacks={}),{iScale:i,vScale:a,index:l}=s,c=i.axis,d=a.axis,h=cd(i,a,s),f=t.length;let u;for(let p=0;p<f;++p){const m=t[p],{[c]:g,[d]:b}=m,_=m._stacks||(m._stacks={});u=_[d]=hd(o,h,g),u[l]=b,u._top=Ci(u,a,!0,s.type),u._bottom=Ci(u,a,!1,s.type);const y=u._visualValues||(u._visualValues={});y[l]=b}}function Bs(n,t){const e=n.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function fd(n,t){return Kt(n,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function ud(n,t,e){return Kt(n,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function je(n,t){const e=n.controller.index,s=n.vScale&&n.vScale.axis;if(s){t=t||n._parsed;for(const o of t){const i=o._stacks;if(!i||i[s]===void 0||i[s][e]===void 0)return;delete i[s][e],i[s]._visualValues!==void 0&&i[s]._visualValues[e]!==void 0&&delete i[s]._visualValues[e]}}}const Es=n=>n==="reset"||n==="none",Mi=(n,t)=>t?n:Object.assign({},n),pd=(n,t,e)=>n&&!t.hidden&&t._stacked&&{keys:xi(e,!0),values:null};class St{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=wi(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&&je(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),o=(f,u,p,m)=>f==="x"?u:f==="r"?m:p,i=e.xAxisID=L(s.xAxisID,Bs(t,"x")),a=e.yAxisID=L(s.yAxisID,Bs(t,"y")),l=e.rAxisID=L(s.rAxisID,Bs(t,"r")),c=e.indexAxis,d=e.iAxisID=o(c,i,a,l),h=e.vAxisID=o(c,a,i,l);e.xScale=this.getScaleForId(i),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(l),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&&Lo(this._data,this),t._stacked&&je(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(I(e))this._data=ld(e);else if(s!==e){if(s){Lo(s,this);const o=this._cachedMeta;je(o),o._parsed=[]}e&&Object.isExtensible(e)&&Ql(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let o=!1;this._dataCheck();const i=e._stacked;e._stacked=wi(e.vScale,e),e.stack!==s.stack&&(o=!0,je(e),e.stack=s.stack),this._resyncElements(t),(o||i!==e._stacked)&&Si(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:o}=this,{iScale:i,_stacked:a}=s,l=i.axis;let c=t===0&&e===o.length?!0:s._sorted,d=t>0&&s._parsed[t-1],h,f,u;if(this._parsing===!1)s._parsed=o,s._sorted=!0,u=o;else{q(o[t])?u=this.parseArrayData(s,o,t,e):I(o[t])?u=this.parseObjectData(s,o,t,e):u=this.parsePrimitiveData(s,o,t,e);const p=()=>f[l]===null||d&&f[l]<d[l];for(h=0;h<e;++h)s._parsed[h+t]=f=u[h],c&&(p()&&(c=!1),d=f);s._sorted=c}a&&Si(this,u)}parsePrimitiveData(t,e,s,o){const{iScale:i,vScale:a}=t,l=i.axis,c=a.axis,d=i.getLabels(),h=i===a,f=new Array(o);let u,p,m;for(u=0,p=o;u<p;++u)m=u+s,f[u]={[l]:h||i.parse(d[m],m),[c]:a.parse(e[m],m)};return f}parseArrayData(t,e,s,o){const{xScale:i,yScale:a}=t,l=new Array(o);let c,d,h,f;for(c=0,d=o;c<d;++c)h=c+s,f=e[h],l[c]={x:i.parse(f[0],h),y:a.parse(f[1],h)};return l}parseObjectData(t,e,s,o){const{xScale:i,yScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=new Array(o);let h,f,u,p;for(h=0,f=o;h<f;++h)u=h+s,p=e[u],d[h]={x:i.parse(Ut(p,l),u),y:a.parse(Ut(p,c),u)};return d}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const o=this.chart,i=this._cachedMeta,a=e[t.axis],l={keys:xi(o,!0),values:e._stacks[t.axis]._visualValues};return ki(l,a,i.index,{mode:s})}updateRangeFromParsed(t,e,s,o){const i=s[e.axis];let a=i===null?NaN:i;const l=o&&s._stacks[e.axis];o&&l&&(o.values=l,a=ki(o,i,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const s=this._cachedMeta,o=s._parsed,i=s._sorted&&t===s.iScale,a=o.length,l=this._getOtherScale(t),c=pd(e,s,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:f}=dd(l);let u,p;function m(){p=o[u];const g=p[l.axis];return!Z(p[t.axis])||h>g||f<g}for(u=0;u<a&&!(!m()&&(this.updateRangeFromParsed(d,t,p,c),i));++u);if(i){for(u=a-1;u>=0;--u)if(!m()){this.updateRangeFromParsed(d,t,p,c);break}}return d}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let o,i,a;for(o=0,i=e.length;o<i;++o)a=e[o][t.axis],Z(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,o=e.vScale,i=this.getParsed(t);return{label:s?""+s.getLabelForValue(i[s.axis]):"",value:o?""+o.getLabelForValue(i[o.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=rd(L(this.options.clip,ad(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,o=s.data||[],i=e.chartArea,a=[],l=this._drawStart||0,c=this._drawCount||o.length-l,d=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,i,l,c),h=l;h<l+c;++h){const f=o[h];f.hidden||(f.active&&d?a.push(f):f.draw(t,i))}for(h=0;h<a.length;++h)a[h].draw(t,i)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const o=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];i=a.$context||(a.$context=ud(this.getContext(),t,a)),i.parsed=this.getParsed(t),i.raw=o.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=fd(this.chart.getContext(),this.index)),i.dataset=o,i.index=i.datasetIndex=this.index;return i.active=!!e,i.mode=s,i}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const o=e==="active",i=this._cachedDataOpts,a=t+"-"+e,l=i[a],c=this.enableOptionSharing&&Te(s);if(l)return Mi(l,c);const d=this.chart.config,h=d.datasetElementScopeKeys(this._type,t),f=o?[`${t}Hover`,"hover",t,""]:[t,""],u=d.getOptionScopes(this.getDataset(),h),p=Object.keys(J.elements[t]),m=()=>this.getContext(s,o,e),g=d.resolveNamedOptions(u,p,m,f);return g.$shared&&(g.$shared=c,i[a]=Object.freeze(Mi(g,c))),g}_resolveAnimations(t,e,s){const o=this.chart,i=this._cachedDataOpts,a=`animation-${e}`,l=i[a];if(l)return l;let c;if(o.options.animation!==!1){const h=this.chart.config,f=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),f);c=h.createResolver(u,this.getContext(t,s,e))}const d=new yi(o,c&&c.animations);return c&&c._cacheable&&(i[a]=Object.freeze(d)),d}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Es(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),o=this._sharedOptions,i=this.getSharedOptions(s),a=this.includeOptions(e,i)||i!==o;return this.updateSharedOptions(i,e,s),{sharedOptions:i,includeOptions:a}}updateElement(t,e,s,o){Es(o)?Object.assign(t,s):this._resolveAnimations(e,o).update(t,s)}updateSharedOptions(t,e,s){t&&!Es(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,o){t.active=o;const i=this.getStyle(e,o);this._resolveAnimations(e,s,o).update(t,{options:!o&&this.getSharedOptions(i)||i})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[l,c,d]of this._syncList)this[l](c,d);this._syncList=[];const o=s.length,i=e.length,a=Math.min(i,o);a&&this.parse(0,a),i>o?this._insertElements(o,i-o,t):i<o&&this._removeElements(i,o-i)}_insertElements(t,e,s=!0){const o=this._cachedMeta,i=o.data,a=t+e;let l;const c=d=>{for(d.length+=e,l=d.length-1;l>=a;l--)d[l]=d[l-e]};for(c(i),l=t;l<a;++l)i[l]=new this.dataElementType;this._parsing&&c(o._parsed),this.parse(t,e),s&&this.updateElements(i,t,e,"reset")}updateElements(t,e,s,o){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const o=s._parsed.splice(t,e);s._stacked&&je(s,o)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,o]=t;this[e](s,o)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}P(St,"defaults",{}),P(St,"datasetElementType",null),P(St,"dataElementType",null);function md(n,t){if(!n._cache.$bar){const e=n.getMatchingVisibleMetas(t);let s=[];for(let o=0,i=e.length;o<i;o++)s=s.concat(e[o].controller.getAllParsedValues(n));n._cache.$bar=Ro(s.sort((o,i)=>o-i))}return n._cache.$bar}function gd(n){const t=n.iScale,e=md(t,n.type);let s=t._length,o,i,a,l;const c=()=>{a===32767||a===-32768||(Te(l)&&(s=Math.min(s,Math.abs(a-l)||s)),l=a)};for(o=0,i=e.length;o<i;++o)a=t.getPixelForValue(e[o]),c();for(l=void 0,o=0,i=t.ticks.length;o<i;++o)a=t.getPixelForTick(o),c();return s}function bd(n,t,e,s){const o=e.barThickness;let i,a;return z(o)?(i=t.min*e.categoryPercentage,a=e.barPercentage):(i=o*s,a=1),{chunk:i/s,ratio:a,start:t.pixels[n]-i/2}}function yd(n,t,e,s){const o=t.pixels,i=o[n];let a=n>0?o[n-1]:null,l=n<o.length-1?o[n+1]:null;const c=e.categoryPercentage;a===null&&(a=i-(l===null?t.end-t.start:l-i)),l===null&&(l=i+i-a);const d=i-(i-Math.min(a,l))/2*c;return{chunk:Math.abs(l-a)/2*c/s,ratio:e.barPercentage,start:d}}function _d(n,t,e,s){const o=e.parse(n[0],s),i=e.parse(n[1],s),a=Math.min(o,i),l=Math.max(o,i);let c=a,d=l;Math.abs(a)>Math.abs(l)&&(c=l,d=a),t[e.axis]=d,t._custom={barStart:c,barEnd:d,start:o,end:i,min:a,max:l}}function vi(n,t,e,s){return q(n)?_d(n,t,e,s):t[e.axis]=e.parse(n,s),t}function Di(n,t,e,s){const o=n.iScale,i=n.vScale,a=o.getLabels(),l=o===i,c=[];let d,h,f,u;for(d=e,h=e+s;d<h;++d)u=t[d],f={},f[o.axis]=l||o.parse(a[d],d),c.push(vi(u,f,i,d));return c}function Vs(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function xd(n,t,e){return n!==0?Mt(n):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function kd(n){let t,e,s,o,i;return n.horizontal?(t=n.base>n.x,e="left",s="right"):(t=n.base<n.y,e="bottom",s="top"),t?(o="end",i="start"):(o="start",i="end"),{start:e,end:s,reverse:t,top:o,bottom:i}}function wd(n,t,e,s){let o=t.borderSkipped;const i={};if(!o){n.borderSkipped=i;return}if(o===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:l,reverse:c,top:d,bottom:h}=kd(n);o==="middle"&&e&&(n.enableBorderRadius=!0,(e._top||0)===s?o=d:(e._bottom||0)===s?o=h:(i[Bi(h,a,l,c)]=!0,o=d)),i[Bi(o,a,l,c)]=!0,n.borderSkipped=i}function Bi(n,t,e,s){return s?(n=Cd(n,t,e),n=Ei(n,e,t)):n=Ei(n,t,e),n}function Cd(n,t,e){return n===t?e:n===e?t:n}function Ei(n,t,e){return n==="start"?t:n==="end"?e:n}function Sd(n,{inflateAmount:t},e){n.inflateAmount=t==="auto"?e===1?.33:0:t}class Dn extends St{parsePrimitiveData(t,e,s,o){return Di(t,e,s,o)}parseArrayData(t,e,s,o){return Di(t,e,s,o)}parseObjectData(t,e,s,o){const{iScale:i,vScale:a}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,d=i.axis==="x"?l:c,h=a.axis==="x"?l:c,f=[];let u,p,m,g;for(u=s,p=s+o;u<p;++u)g=e[u],m={},m[i.axis]=i.parse(Ut(g,d),u),f.push(vi(Ut(g,h),m,a,u));return f}updateRangeFromParsed(t,e,s,o){super.updateRangeFromParsed(t,e,s,o);const i=s._custom;i&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:s,vScale:o}=e,i=this.getParsed(t),a=i._custom,l=Vs(a)?"["+a.start+", "+a.end+"]":""+o.getLabelForValue(i[o.axis]);return{label:""+s.getLabelForValue(i[s.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,o){const i=o==="reset",{index:a,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),d=l.isHorizontal(),h=this._getRuler(),{sharedOptions:f,includeOptions:u}=this._getSharedOptions(e,o);for(let p=e;p<e+s;p++){const m=this.getParsed(p),g=i||z(m[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,h),_=(m._stacks||{})[l.axis],y={horizontal:d,base:g.base,enableBorderRadius:!_||Vs(m._custom)||a===_._top||a===_._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&&(y.options=f||this.resolveDataElementOptions(p,t[p].active?"active":o));const k=y.options||t[p].options;wd(y,k,_,a),Sd(y,k,h.ratio),this.updateElement(t[p],p,y,o)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,o=s.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),i=s.options.stacked,a=[],l=c=>{const d=c.controller.getParsed(e),h=d&&d[c.vScale.axis];if(z(h)||isNaN(h))return!0};for(const c of o)if(!(e!==void 0&&l(c))&&((i===!1||a.indexOf(c.stack)===-1||i===void 0&&c.stack===void 0)&&a.push(c.stack),c.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){const o=this._getStacks(t,s),i=e!==void 0?o.indexOf(e):-1;return i===-1?o.length-1:i}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,o=[];let i,a;for(i=0,a=e.data.length;i<a;++i)o.push(s.getPixelForValue(this.getParsed(i)[s.axis],i));const l=t.barThickness;return{min:l||gd(e),pixels:o,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:o},options:{base:i,minBarLength:a}}=this,l=i||0,c=this.getParsed(t),d=c._custom,h=Vs(d);let f=c[e.axis],u=0,p=s?this.applyStack(e,c,s):f,m,g;p!==f&&(u=p-f,p=f),h&&(f=d.barStart,p=d.barEnd-d.barStart,f!==0&&Mt(f)!==Mt(d.barEnd)&&(u=0),u+=f);const b=!z(i)&&!h?i:u;let _=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?m=e.getPixelForValue(u+p):m=_,g=m-_,Math.abs(g)<a){g=xd(g,e,l)*a,f===l&&(_-=g/2);const y=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),w=Math.min(y,k),x=Math.max(y,k);_=Math.max(Math.min(_,x),w),m=_+g,s&&!h&&(c._stacks[e.axis]._visualValues[o]=e.getValueForPixel(m)-e.getValueForPixel(_))}if(_===e.getPixelForValue(l)){const y=Mt(g)*e.getLineWidthForValue(l)/2;_+=y,g-=y}return{size:g,base:_,head:m,center:m+g/2}}_calculateBarIndexPixels(t,e){const s=e.scale,o=this.options,i=o.skipNull,a=L(o.maxBarThickness,1/0);let l,c;if(e.grouped){const d=i?this._getStackCount(t):e.stackCount,h=o.barThickness==="flex"?yd(t,e,o,d):bd(t,e,o,d),f=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0);l=h.start+h.chunk*f+h.chunk/2,c=Math.min(a,h.chunk*h.ratio)}else l=s.getPixelForValue(this.getParsed(t)[s.axis],t),c=Math.min(a,e.min*e.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){const t=this._cachedMeta,e=t.vScale,s=t.data,o=s.length;let i=0;for(;i<o;++i)this.getParsed(i)[e.axis]!==null&&s[i].draw(this._ctx)}}P(Dn,"id","bar"),P(Dn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(Dn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Bn extends St{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,e,s,o){const i=super.parsePrimitiveData(t,e,s,o);for(let a=0;a<i.length;a++)i[a]._custom=this.resolveDataElementOptions(a+s).radius;return i}parseArrayData(t,e,s,o){const i=super.parseArrayData(t,e,s,o);for(let a=0;a<i.length;a++){const l=e[s+a];i[a]._custom=L(l[2],this.resolveDataElementOptions(a+s).radius)}return i}parseObjectData(t,e,s,o){const i=super.parseObjectData(t,e,s,o);for(let a=0;a<i.length;a++){const l=e[s+a];i[a]._custom=L(l&&l.r&&+l.r,this.resolveDataElementOptions(a+s).radius)}return i}getMaxOverflow(){const t=this._cachedMeta.data;let e=0;for(let s=t.length-1;s>=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:o,yScale:i}=e,a=this.getParsed(t),l=o.getLabelForValue(a.x),c=i.getLabelForValue(a.y),d=a._custom;return{label:s[t]||"",value:"("+l+", "+c+(d?", "+d:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,o){const i=o==="reset",{iScale:a,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(e,o),h=a.axis,f=l.axis;for(let u=e;u<e+s;u++){const p=t[u],m=!i&&this.getParsed(u),g={},b=g[h]=i?a.getPixelForDecimal(.5):a.getPixelForValue(m[h]),_=g[f]=i?l.getBasePixel():l.getPixelForValue(m[f]);g.skip=isNaN(b)||isNaN(_),d&&(g.options=c||this.resolveDataElementOptions(u,p.active?"active":o),i&&(g.options.radius=0)),this.updateElement(p,u,g,o)}}resolveDataElementOptions(t,e){const s=this.getParsed(t);let o=super.resolveDataElementOptions(t,e);o.$shared&&(o=Object.assign({},o,{$shared:!1}));const i=o.radius;return e!=="active"&&(o.radius=0),o.radius+=L(s&&s._custom,i),o}}P(Bn,"id","bubble"),P(Bn,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),P(Bn,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Md(n,t,e){let s=1,o=1,i=0,a=0;if(t<K){const l=n,c=l+t,d=Math.cos(l),h=Math.sin(l),f=Math.cos(c),u=Math.sin(c),p=(k,w,x)=>$e(k,l,c,!0)?1:Math.max(w,w*e,x,x*e),m=(k,w,x)=>$e(k,l,c,!0)?-1:Math.min(w,w*e,x,x*e),g=p(0,d,f),b=p(tt,h,u),_=m(X,d,f),y=m(X+tt,h,u);s=(g-_)/2,o=(b-y)/2,i=-(g+_)/2,a=-(b+y)/2}return{ratioX:s,ratioY:o,offsetX:i,offsetY:a}}class he extends St{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=s;else{let i=c=>+s[c];if(I(s[t])){const{key:c="value"}=this._parsing;i=d=>+Ut(s[d],c)}let a,l;for(a=t,l=t+e;a<l;++a)o._parsed[a]=i(a)}}_getRotation(){return Ct(this.options.rotation-90)}_getCircumference(){return Ct(this.options.circumference)}_getRotationExtents(){let t=K,e=-K;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const o=this.chart.getDatasetMeta(s).controller,i=o._getRotation(),a=o._getCircumference();t=Math.min(t,i),e=Math.max(e,i+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:s}=e,o=this._cachedMeta,i=o.data,a=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,l=Math.max((Math.min(s.width,s.height)-a)/2,0),c=Math.min(Rl(this.options.cutout,l),1),d=this._getRingWeight(this.index),{circumference:h,rotation:f}=this._getRotationExtents(),{ratioX:u,ratioY:p,offsetX:m,offsetY:g}=Md(f,h,c),b=(s.width-a)/u,_=(s.height-a)/p,y=Math.max(Math.min(b,_)/2,0),k=Bo(this.options.radius,y),w=Math.max(k*c,0),x=(k-w)/this._getVisibleDatasetWeightTotal();this.offsetX=m*k,this.offsetY=g*k,o.total=this.calculateTotal(),this.outerRadius=k-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*d,0),this.updateElements(i,0,i.length,t)}_circumference(t,e){const s=this.options,o=this._cachedMeta,i=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*i/K)}updateElements(t,e,s,o){const i=o==="reset",a=this.chart,l=a.chartArea,d=a.options.animation,h=(l.left+l.right)/2,f=(l.top+l.bottom)/2,u=i&&d.animateScale,p=u?0:this.innerRadius,m=u?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(e,o);let _=this._getRotation(),y;for(y=0;y<e;++y)_+=this._circumference(y,i);for(y=e;y<e+s;++y){const k=this._circumference(y,i),w=t[y],x={x:h+this.offsetX,y:f+this.offsetY,startAngle:_,endAngle:_+k,circumference:k,outerRadius:m,innerRadius:p};b&&(x.options=g||this.resolveDataElementOptions(y,w.active?"active":o)),_+=k,this.updateElement(w,y,x,o)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,o;for(o=0;o<e.length;o++){const i=t._parsed[o];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(o)&&!e[o].hidden&&(s+=Math.abs(i))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?K*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,o=s.data.labels||[],i=Re(e._parsed[t],s.options.locale);return{label:o[t]||"",value:i}}getMaxBorderWidth(t){let e=0;const s=this.chart;let o,i,a,l,c;if(!t){for(o=0,i=s.data.datasets.length;o<i;++o)if(s.isDatasetVisible(o)){a=s.getDatasetMeta(o),t=a.data,l=a.controller;break}}if(!t)return 0;for(o=0,i=t.length;o<i;++o)c=l.resolveDataElementOptions(o),c.borderAlign!=="inner"&&(e=Math.max(e,c.borderWidth||0,c.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,o=t.length;s<o;++s){const i=this.resolveDataElementOptions(s);e=Math.max(e,i.offset||0,i.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(L(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(he,"id","doughnut"),P(he,"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"}),P(he,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(he,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:o}}=t.legend.options;return e.labels.map((i,a)=>{const c=t.getDatasetMeta(0).controller.getStyle(a);return{text:i,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}});class En extends St{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:o=[],_dataset:i}=e,a=this.chart._animationsDisabled;let{start:l,count:c}=Wo(e,o,a);this._drawStart=l,this._drawCount=c,jo(e)&&(l=0,c=o.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!i._decimated,s.points=o;const d=this.resolveDatasetElementOptions(t);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:d},t),this.updateElements(o,l,c,t)}updateElements(t,e,s,o){const i=o==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:h,includeOptions:f}=this._getSharedOptions(e,o),u=a.axis,p=l.axis,{spanGaps:m,segment:g}=this.options,b=ke(m)?m:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||i||o==="none",y=e+s,k=t.length;let w=e>0&&this.getParsed(e-1);for(let x=0;x<k;++x){const C=t[x],M=_?C:{};if(x<e||x>=y){M.skip=!0;continue}const S=this.getParsed(x),B=z(S[p]),E=M[u]=a.getPixelForValue(S[u],x),A=M[p]=i||B?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,S,c):S[p],x);M.skip=isNaN(E)||isNaN(A)||B,M.stop=x>0&&Math.abs(S[u]-w[u])>b,g&&(M.parsed=S,M.raw=d.data[x]),f&&(M.options=h||this.resolveDataElementOptions(x,C.active?"active":o)),_||this.updateElement(C,x,M,o),w=S}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,o=t.data||[];if(!o.length)return s;const i=o[0].size(this.resolveDataElementOptions(0)),a=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(s,i,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}P(En,"id","line"),P(En,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P(En,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class Ye extends St{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,o=s.data.labels||[],i=Re(e._parsed[t].r,s.options.locale);return{label:o[t]||"",value:i}}parseObjectData(t,e,s,o){return oi.bind(this)(t,e,s,o)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,o)=>{const i=this.getParsed(o).r;!isNaN(i)&&this.chart.getDataVisibility(o)&&(i<e.min&&(e.min=i),i>e.max&&(e.max=i))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,o=Math.min(e.right-e.left,e.bottom-e.top),i=Math.max(o/2,0),a=Math.max(s.cutoutPercentage?i/100*s.cutoutPercentage:1,0),l=(i-a)/t.getVisibleDatasetCount();this.outerRadius=i-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,e,s,o){const i=o==="reset",a=this.chart,c=a.options.animation,d=this._cachedMeta.rScale,h=d.xCenter,f=d.yCenter,u=d.getIndexAngle(0)-.5*X;let p=u,m;const g=360/this.countVisibleElements();for(m=0;m<e;++m)p+=this._computeAngle(m,o,g);for(m=e;m<e+s;m++){const b=t[m];let _=p,y=p+this._computeAngle(m,o,g),k=a.getDataVisibility(m)?d.getDistanceFromCenterForValue(this.getParsed(m).r):0;p=y,i&&(c.animateScale&&(k=0),c.animateRotate&&(_=y=u));const w={x:h,y:f,innerRadius:0,outerRadius:k,startAngle:_,endAngle:y,options:this.resolveDataElementOptions(m,b.active?"active":o)};this.updateElement(b,m,w,o)}}countVisibleElements(){const t=this._cachedMeta;let e=0;return t.data.forEach((s,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?Ct(this.resolveDataElementOptions(t,e).angle||s):0}}P(Ye,"id","polarArea"),P(Ye,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),P(Ye,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:s,color:o}}=t.legend.options;return e.labels.map((i,a)=>{const c=t.getDatasetMeta(0).controller.getStyle(a);return{text:i,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Ps extends he{}P(Ps,"id","pie"),P(Ps,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Vn extends St{getLabelAndValue(t){const e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,o){return oi.bind(this)(t,e,s,o)}update(t){const e=this._cachedMeta,s=e.dataset,o=e.data||[],i=e.iScale.getLabels();if(s.points=o,t!=="resize"){const a=this.resolveDatasetElementOptions(t);this.options.showLine||(a.borderWidth=0);const l={_loop:!0,_fullLoop:i.length===o.length,options:a};this.updateElement(s,void 0,l,t)}this.updateElements(o,0,o.length,t)}updateElements(t,e,s,o){const i=this._cachedMeta.rScale,a=o==="reset";for(let l=e;l<e+s;l++){const c=t[l],d=this.resolveDataElementOptions(l,c.active?"active":o),h=i.getPointPositionForValue(l,this.getParsed(l).r),f=a?i.xCenter:h.x,u=a?i.yCenter:h.y,p={x:f,y:u,angle:h.angle,skip:isNaN(f)||isNaN(u),options:d};this.updateElement(c,l,p,o)}}}P(Vn,"id","radar"),P(Vn,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),P(Vn,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Pn extends St{getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:o,yScale:i}=e,a=this.getParsed(t),l=o.getLabelForValue(a.x),c=i.getLabelForValue(a.y);return{label:s[t]||"",value:"("+l+", "+c+")"}}update(t){const e=this._cachedMeta,{data:s=[]}=e,o=this.chart._animationsDisabled;let{start:i,count:a}=Wo(e,s,o);if(this._drawStart=i,this._drawCount=a,jo(e)&&(i=0,a=s.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:l,_dataset:c}=e;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=s;const d=this.resolveDatasetElementOptions(t);d.segment=this.options.segment,this.updateElement(l,void 0,{animated:!o,options:d},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(s,i,a,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,s,o){const i=o==="reset",{iScale:a,vScale:l,_stacked:c,_dataset:d}=this._cachedMeta,h=this.resolveDataElementOptions(e,o),f=this.getSharedOptions(h),u=this.includeOptions(o,f),p=a.axis,m=l.axis,{spanGaps:g,segment:b}=this.options,_=ke(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||i||o==="none";let k=e>0&&this.getParsed(e-1);for(let w=e;w<e+s;++w){const x=t[w],C=this.getParsed(w),M=y?x:{},S=z(C[m]),B=M[p]=a.getPixelForValue(C[p],w),E=M[m]=i||S?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,C,c):C[m],w);M.skip=isNaN(B)||isNaN(E)||S,M.stop=w>0&&Math.abs(C[p]-k[p])>_,b&&(M.parsed=C,M.raw=d.data[w]),u&&(M.options=f||this.resolveDataElementOptions(w,x.active?"active":o)),y||this.updateElement(x,w,M,o),k=C}this.updateSharedOptions(f,o,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let l=0;for(let c=e.length-1;c>=0;--c)l=Math.max(l,e[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}const s=t.dataset,o=s.options&&s.options.borderWidth||0;if(!e.length)return o;const i=e[0].size(this.resolveDataElementOptions(0)),a=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(o,i,a)/2}}P(Pn,"id","scatter"),P(Pn,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),P(Pn,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var vd=Object.freeze({__proto__:null,BarController:Dn,BubbleController:Bn,DoughnutController:he,LineController:En,PieController:Ps,PolarAreaController:Ye,RadarController:Vn,ScatterController:Pn});function fe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Os{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(Os.prototype,t)}init(){}formats(){return fe()}parse(){return fe()}format(){return fe()}add(){return fe()}diff(){return fe()}startOf(){return fe()}endOf(){return fe()}}var Dd={_date:Os};function Bd(n,t,e,s){const{controller:o,data:i,_sorted:a}=n,l=o._cachedMeta.iScale;if(l&&t===l.axis&&t!=="r"&&a&&i.length){const c=l._reversePixels?Zl:At;if(s){if(o._sharedOptions){const d=i[0],h=typeof d.getRange=="function"&&d.getRange(t);if(h){const f=c(i,t,e-h),u=c(i,t,e+h);return{lo:f.lo,hi:u.hi}}}}else return c(i,t,e)}return{lo:0,hi:i.length-1}}function He(n,t,e,s,o){const i=n.getSortedVisibleDatasetMetas(),a=e[t];for(let l=0,c=i.length;l<c;++l){const{index:d,data:h}=i[l],{lo:f,hi:u}=Bd(i[l],t,a,o);for(let p=f;p<=u;++p){const m=h[p];m.skip||s(m,d,p)}}}function Ed(n){const t=n.indexOf("x")!==-1,e=n.indexOf("y")!==-1;return function(s,o){const i=t?Math.abs(s.x-o.x):0,a=e?Math.abs(s.y-o.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(a,2))}}function As(n,t,e,s,o){const i=[];return!o&&!n.isPointInArea(t)||He(n,e,t,function(l,c,d){!o&&!Ft(l,n.chartArea,0)||l.inRange(t.x,t.y,s)&&i.push({element:l,datasetIndex:c,index:d})},!0),i}function Vd(n,t,e,s){let o=[];function i(a,l,c){const{startAngle:d,endAngle:h}=a.getProps(["startAngle","endAngle"],s),{angle:f}=No(a,{x:t.x,y:t.y});$e(f,d,h)&&o.push({element:a,datasetIndex:l,index:c})}return He(n,e,t,i),o}function Pd(n,t,e,s,o,i){let a=[];const l=Ed(e);let c=Number.POSITIVE_INFINITY;function d(h,f,u){const p=h.inRange(t.x,t.y,o);if(s&&!p)return;const m=h.getCenterPoint(o);if(!(!!i||n.isPointInArea(m))&&!p)return;const b=l(t,m);b<c?(a=[{element:h,datasetIndex:f,index:u}],c=b):b===c&&a.push({element:h,datasetIndex:f,index:u})}return He(n,e,t,d),a}function Fs(n,t,e,s,o,i){return!i&&!n.isPointInArea(t)?[]:e==="r"&&!s?Vd(n,t,e,o):Pd(n,t,e,s,o,i)}function Vi(n,t,e,s,o){const i=[],a=e==="x"?"inXRange":"inYRange";let l=!1;return He(n,e,t,(c,d,h)=>{c[a](t[e],o)&&(i.push({element:c,datasetIndex:d,index:h}),l=l||c.inRange(t.x,t.y,o))}),s&&!l?[]:i}var Od={evaluateInteractionItems:He,modes:{index(n,t,e,s){const o=ce(t,n),i=e.axis||"x",a=e.includeInvisible||!1,l=e.intersect?As(n,o,i,s,a):Fs(n,o,i,!1,s,a),c=[];return l.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const h=l[0].index,f=d.data[h];f&&!f.skip&&c.push({element:f,datasetIndex:d.index,index:h})}),c):[]},dataset(n,t,e,s){const o=ce(t,n),i=e.axis||"xy",a=e.includeInvisible||!1;let l=e.intersect?As(n,o,i,s,a):Fs(n,o,i,!1,s,a);if(l.length>0){const c=l[0].datasetIndex,d=n.getDatasetMeta(c).data;l=[];for(let h=0;h<d.length;++h)l.push({element:d[h],datasetIndex:c,index:h})}return l},point(n,t,e,s){const o=ce(t,n),i=e.axis||"xy",a=e.includeInvisible||!1;return As(n,o,i,s,a)},nearest(n,t,e,s){const o=ce(t,n),i=e.axis||"xy",a=e.includeInvisible||!1;return Fs(n,o,i,e.intersect,s,a)},x(n,t,e,s){const o=ce(t,n);return Vi(n,o,"x",e.intersect,s)},y(n,t,e,s){const o=ce(t,n);return Vi(n,o,"y",e.intersect,s)}}};const Pi=["left","top","right","bottom"];function Ue(n,t){return n.filter(e=>e.pos===t)}function Oi(n,t){return n.filter(e=>Pi.indexOf(e.pos)===-1&&e.box.axis===t)}function qe(n,t){return n.sort((e,s)=>{const o=t?s:e,i=t?e:s;return o.weight===i.weight?o.index-i.index:o.weight-i.weight})}function Ad(n){const t=[];let e,s,o,i,a,l;for(e=0,s=(n||[]).length;e<s;++e)o=n[e],{position:i,options:{stack:a,stackWeight:l=1}}=o,t.push({index:e,box:o,pos:i,horizontal:o.isHorizontal(),weight:o.weight,stack:a&&i+a,stackWeight:l});return t}function Fd(n){const t={};for(const e of n){const{stack:s,pos:o,stackWeight:i}=e;if(!s||!Pi.includes(o))continue;const a=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=i}return t}function Td(n,t){const e=Fd(n),{vBoxMaxWidth:s,hBoxMaxHeight:o}=t;let i,a,l;for(i=0,a=n.length;i<a;++i){l=n[i];const{fullSize:c}=l.box,d=e[l.stack],h=d&&l.stackWeight/d.weight;l.horizontal?(l.width=h?h*s:c&&t.availableWidth,l.height=o):(l.width=s,l.height=h?h*o:c&&t.availableHeight)}return e}function Nd(n){const t=Ad(n),e=qe(t.filter(d=>d.box.fullSize),!0),s=qe(Ue(t,"left"),!0),o=qe(Ue(t,"right")),i=qe(Ue(t,"top"),!0),a=qe(Ue(t,"bottom")),l=Oi(t,"x"),c=Oi(t,"y");return{fullSize:e,leftAndTop:s.concat(i),rightAndBottom:o.concat(c).concat(a).concat(l),chartArea:Ue(t,"chartArea"),vertical:s.concat(o).concat(c),horizontal:i.concat(a).concat(l)}}function Ai(n,t,e,s){return Math.max(n[e],t[e])+Math.max(n[s],t[s])}function Fi(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 $d(n,t,e,s){const{pos:o,box:i}=e,a=n.maxPadding;if(!I(o)){e.size&&(n[o]-=e.size);const f=s[e.stack]||{size:0,count:1};f.size=Math.max(f.size,e.horizontal?i.height:i.width),e.size=f.size/f.count,n[o]+=e.size}i.getPadding&&Fi(a,i.getPadding());const l=Math.max(0,t.outerWidth-Ai(a,n,"left","right")),c=Math.max(0,t.outerHeight-Ai(a,n,"top","bottom")),d=l!==n.w,h=c!==n.h;return n.w=l,n.h=c,e.horizontal?{same:d,other:h}:{same:h,other:d}}function Ld(n){const t=n.maxPadding;function e(s){const o=Math.max(t[s]-n[s],0);return n[s]+=o,o}n.y+=e("top"),n.x+=e("left"),e("right"),e("bottom")}function Rd(n,t){const e=t.maxPadding;function s(o){const i={left:0,top:0,right:0,bottom:0};return o.forEach(a=>{i[a]=Math.max(t[a],e[a])}),i}return s(n?["left","right"]:["top","bottom"])}function Xe(n,t,e,s){const o=[];let i,a,l,c,d,h;for(i=0,a=n.length,d=0;i<a;++i){l=n[i],c=l.box,c.update(l.width||t.w,l.height||t.h,Rd(l.horizontal,t));const{same:f,other:u}=$d(t,e,l,s);d|=f&&o.length,h=h||u,c.fullSize||o.push(l)}return d&&Xe(o,t,e,s)||h}function On(n,t,e,s,o){n.top=e,n.left=t,n.right=t+s,n.bottom=e+o,n.width=s,n.height=o}function Ti(n,t,e,s){const o=e.padding;let{x:i,y:a}=t;for(const l of n){const c=l.box,d=s[l.stack]||{count:1,placed:0,weight:1},h=l.stackWeight/d.weight||1;if(l.horizontal){const f=t.w*h,u=d.size||c.height;Te(d.start)&&(a=d.start),c.fullSize?On(c,o.left,a,e.outerWidth-o.right-o.left,u):On(c,t.left+d.placed,a,f,u),d.start=a,d.placed+=f,a=c.bottom}else{const f=t.h*h,u=d.size||c.width;Te(d.start)&&(i=d.start),c.fullSize?On(c,i,o.top,u,e.outerHeight-o.bottom-o.top):On(c,i,t.top+d.placed,u,f),d.start=i,d.placed+=f,i=c.right}}t.x=i,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,s){if(!n)return;const o=rt(n.options.layout.padding),i=Math.max(t-o.width,0),a=Math.max(e-o.height,0),l=Nd(n.boxes),c=l.vertical,d=l.horizontal;j(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=c.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:e,padding:o,availableWidth:i,availableHeight:a,vBoxMaxWidth:i/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},o);Fi(u,rt(s));const p=Object.assign({maxPadding:u,w:i,h:a,x:o.left,y:o.top},o),m=Td(c.concat(d),f);Xe(l.fullSize,p,f,m),Xe(c,p,f,m),Xe(d,p,f,m)&&Xe(c,p,f,m),Ld(p),Ti(l.leftAndTop,p,f,m),p.x+=p.w,p.y+=p.h,Ti(l.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},j(l.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 Ni{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,o){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,o?Math.floor(e/o):s)}}isAttached(t){return!0}updateConfig(t){}}class Id extends Ni{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const An="$chartjs",zd={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},$i=n=>n===null||n==="";function Wd(n,t){const e=n.style,s=n.getAttribute("height"),o=n.getAttribute("width");if(n[An]={initial:{height:s,width:o,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",$i(o)){const i=li(n,"width");i!==void 0&&(n.width=i)}if($i(s))if(n.style.height==="")n.height=n.width/(t||2);else{const i=li(n,"height");i!==void 0&&(n.height=i)}return n}const Li=Yc?{passive:!0}:!1;function jd(n,t,e){n.addEventListener(t,e,Li)}function Yd(n,t,e){n.canvas.removeEventListener(t,e,Li)}function Hd(n,t){const e=zd[n.type]||n.type,{x:s,y:o}=ce(n,t);return{type:e,chart:t,native:n,x:s!==void 0?s:null,y:o!==void 0?o:null}}function Fn(n,t){for(const e of n)if(e===t||e.contains(t))return!0}function Ud(n,t,e){const s=n.canvas,o=new MutationObserver(i=>{let a=!1;for(const l of i)a=a||Fn(l.addedNodes,s),a=a&&!Fn(l.removedNodes,s);a&&e()});return o.observe(document,{childList:!0,subtree:!0}),o}function qd(n,t,e){const s=n.canvas,o=new MutationObserver(i=>{let a=!1;for(const l of i)a=a||Fn(l.removedNodes,s),a=a&&!Fn(l.addedNodes,s);a&&e()});return o.observe(document,{childList:!0,subtree:!0}),o}const Ke=new Map;let Ri=0;function Ii(){const n=window.devicePixelRatio;n!==Ri&&(Ri=n,Ke.forEach((t,e)=>{e.currentDevicePixelRatio!==n&&t()}))}function Xd(n,t){Ke.size||window.addEventListener("resize",Ii),Ke.set(n,t)}function Kd(n){Ke.delete(n),Ke.size||window.removeEventListener("resize",Ii)}function Gd(n,t,e){const s=n.canvas,o=s&&Ds(s);if(!o)return;const i=zo((l,c)=>{const d=o.clientWidth;e(l,c),d<o.clientWidth&&e()},window),a=new ResizeObserver(l=>{const c=l[0],d=c.contentRect.width,h=c.contentRect.height;d===0&&h===0||i(d,h)});return a.observe(o),Xd(n,i),a}function Ts(n,t,e){e&&e.disconnect(),t==="resize"&&Kd(n)}function Zd(n,t,e){const s=n.canvas,o=zo(i=>{n.ctx!==null&&e(Hd(i,n))},n);return jd(s,t,o),o}class Jd extends Ni{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Wd(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[An])return!1;const s=e[An].initial;["height","width"].forEach(i=>{const a=s[i];z(a)?e.removeAttribute(i):e.setAttribute(i,a)});const o=s.style||{};return Object.keys(o).forEach(i=>{e.style[i]=o[i]}),e.width=e.width,delete e[An],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const o=t.$proxies||(t.$proxies={}),a={attach:Ud,detach:qd,resize:Gd}[e]||Zd;o[e]=a(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),o=s[e];if(!o)return;({attach:Ts,detach:Ts,resize:Ts}[e]||Yd)(t,e,o),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,o){return jc(t,e,s,o)}isAttached(t){const e=Ds(t);return!!(e&&e.isConnected)}}function Qd(n){return!ai()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Id:Jd}let Nt=(ns=class{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return ke(this.x)&&ke(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const o={};return t.forEach(i=>{o[i]=s[i]&&s[i].active()?s[i]._to:this[i]}),o}},P(ns,"defaults",{}),P(ns,"defaultRoutes"),ns);function th(n,t){const e=n.options.ticks,s=eh(n),o=Math.min(e.maxTicksLimit||s,s),i=e.major.enabled?sh(t):[],a=i.length,l=i[0],c=i[a-1],d=[];if(a>o)return oh(t,d,i,a/o),d;const h=nh(i,t,o);if(a>0){let f,u;const p=a>1?Math.round((c-l)/(a-1)):null;for(Tn(t,d,h,z(p)?0:l-p,l),f=0,u=a-1;f<u;f++)Tn(t,d,h,i[f],i[f+1]);return Tn(t,d,h,c,z(p)?t.length:c+p),d}return Tn(t,d,h),d}function eh(n){const t=n.options.offset,e=n._tickSize(),s=n._length/e+(t?0:1),o=n._maxLength/e;return Math.floor(Math.min(s,o))}function nh(n,t,e){const s=ih(n),o=t.length/e;if(!s)return Math.max(o,1);const i=ql(s);for(let a=0,l=i.length-1;a<l;a++){const c=i[a];if(c>o)return c}return Math.max(o,1)}function sh(n){const t=[];let e,s;for(e=0,s=n.length;e<s;e++)n[e].major&&t.push(e);return t}function oh(n,t,e,s){let o=0,i=e[0],a;for(s=Math.ceil(s),a=0;a<n.length;a++)a===i&&(t.push(n[a]),o++,i=e[o*s])}function Tn(n,t,e,s,o){const i=L(s,0),a=Math.min(L(o,n.length),n.length);let l=0,c,d,h;for(e=Math.ceil(e),o&&(c=o-s,e=c/Math.floor(c/e)),h=i;h<0;)l++,h=Math.round(i+l*e);for(d=Math.max(i,0);d<a;d++)d===h&&(t.push(n[d]),l++,h=Math.round(i+l*e))}function ih(n){const t=n.length;let e,s;if(t<2)return!1;for(s=n[0],e=1;e<t;++e)if(n[e]-n[e-1]!==s)return!1;return s}const ah=n=>n==="left"?"right":n==="right"?"left":n,zi=(n,t,e)=>t==="top"||t==="left"?n[t]+e:n[t]-e,Wi=(n,t)=>Math.min(t||n,n);function ji(n,t){const e=[],s=n.length/t,o=n.length;let i=0;for(;i<o;i+=s)e.push(n[Math.floor(i)]);return e}function rh(n,t,e){const s=n.ticks.length,o=Math.min(t,s-1),i=n._startPixel,a=n._endPixel,l=1e-6;let c=n.getPixelForTick(o),d;if(!(e&&(s===1?d=Math.max(c-i,a-c):t===0?d=(n.getPixelForTick(1)-c)/2:d=(c-n.getPixelForTick(o-1))/2,c+=o<t?d:-d,c<i-l||c>a+l)))return c}function lh(n,t){j(n,e=>{const s=e.gc,o=s.length/2;let i;if(o>t){for(i=0;i<o;++i)delete e.data[s[i]];s.splice(0,o)}})}function Ge(n){return n.drawTicks?n.tickLength:0}function Yi(n,t){if(!n.display)return 0;const e=nt(n.font,t),s=rt(n.padding);return(q(n.text)?n.text.length:1)*e.lineHeight+s.height}function ch(n,t){return Kt(n,{scale:t,type:"scale"})}function dh(n,t,e){return Kt(n,{tick:e,index:t,type:"tick"})}function hh(n,t,e){let s=bs(n);return(e&&t!=="right"||!e&&t==="right")&&(s=ah(s)),s}function fh(n,t,e,s){const{top:o,left:i,bottom:a,right:l,chart:c}=n,{chartArea:d,scales:h}=c;let f=0,u,p,m;const g=a-o,b=l-i;if(n.isHorizontal()){if(p=at(s,i,l),I(e)){const _=Object.keys(e)[0],y=e[_];m=h[_].getPixelForValue(y)+g-t}else e==="center"?m=(d.bottom+d.top)/2+g-t:m=zi(n,e,t);u=l-i}else{if(I(e)){const _=Object.keys(e)[0],y=e[_];p=h[_].getPixelForValue(y)-b+t}else e==="center"?p=(d.left+d.right)/2-b+t:p=zi(n,e,t);m=at(s,a,o),f=e==="left"?-tt:tt}return{titleX:p,titleY:m,maxWidth:u,rotation:f}}class ue extends Nt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:o}=this;return t=pt(t,Number.POSITIVE_INFINITY),e=pt(e,Number.NEGATIVE_INFINITY),s=pt(s,Number.POSITIVE_INFINITY),o=pt(o,Number.NEGATIVE_INFINITY),{min:pt(t,s),max:pt(e,o),minDefined:Z(t),maxDefined:Z(e)}}getMinMax(t){let{min:e,max:s,minDefined:o,maxDefined:i}=this.getUserBounds(),a;if(o&&i)return{min:e,max:s};const l=this.getMatchingVisibleMetas();for(let c=0,d=l.length;c<d;++c)a=l[c].controller.getMinMax(this,t),o||(e=Math.min(e,a.min)),i||(s=Math.max(s,a.max));return e=i&&e>s?s:e,s=o&&e>s?e:s,{min:pt(e,pt(s,e)),max:pt(s,pt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){H(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:o,grace:i,ticks:a}=this.options,l=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=kc(this,i,o),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=l<this.ticks.length;this._convertTicksToLabels(c?ji(this.ticks,l):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=th(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){H(this.options.afterUpdate,[this])}beforeSetDimensions(){H(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(){H(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),H(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){H(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const e=this.options.ticks;let s,o,i;for(s=0,o=t.length;s<o;s++)i=t[s],i.label=H(e.callback,[i.value,s,t],this)}afterTickToLabelConversion(){H(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){H(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=Wi(this.ticks.length,t.ticks.maxTicksLimit),o=e.minRotation||0,i=e.maxRotation;let a=o,l,c,d;if(!this._isVisible()||!e.display||o>=i||s<=1||!this.isHorizontal()){this.labelRotation=o;return}const h=this._getLabelSizes(),f=h.widest.width,u=h.highest.height,p=st(this.chart.width-f,0,this.maxWidth);l=t.offset?this.maxWidth/s:p/(s-1),f+6>l&&(l=p/(s-(t.offset?.5:1)),c=this.maxHeight-Ge(t.grid)-e.padding-Yi(t.title,this.chart.options.font),d=Math.sqrt(f*f+u*u),a=ps(Math.min(Math.asin(st((h.highest.height+6)/l,-1,1)),Math.asin(st(c/d,-1,1))-Math.asin(st(u/d,-1,1)))),a=Math.max(o,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){H(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){H(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:o,grid:i}}=this,a=this._isVisible(),l=this.isHorizontal();if(a){const c=Yi(o,e.options.font);if(l?(t.width=this.maxWidth,t.height=Ge(i)+c):(t.height=this.maxHeight,t.width=Ge(i)+c),s.display&&this.ticks.length){const{first:d,last:h,widest:f,highest:u}=this._getLabelSizes(),p=s.padding*2,m=Ct(this.labelRotation),g=Math.cos(m),b=Math.sin(m);if(l){const _=s.mirror?0:b*f.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+_+p)}else{const _=s.mirror?0:g*f.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+_+p)}this._calculatePadding(d,h,b,g)}}this._handleMargins(),l?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,o){const{ticks:{align:i,padding:a},position:l}=this.options,c=this.labelRotation!==0,d=l!=="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;c?d?(u=o*t.width,p=s*e.height):(u=s*t.height,p=o*e.width):i==="start"?p=e.width:i==="end"?u=t.width:i!=="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;i==="start"?(h=0,f=t.height):i==="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(){H(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)z(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=ji(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:o,_longestTextCache:i}=this,a=[],l=[],c=Math.floor(e/Wi(e,s));let d=0,h=0,f,u,p,m,g,b,_,y,k,w,x;for(f=0;f<e;f+=c){if(m=t[f].label,g=this._resolveTickFontOptions(f),o.font=b=g.string,_=i[b]=i[b]||{data:{},gc:[]},y=g.lineHeight,k=w=0,!z(m)&&!q(m))k=xn(o,_.data,_.gc,k,m),w=y;else if(q(m))for(u=0,p=m.length;u<p;++u)x=m[u],!z(x)&&!q(x)&&(k=xn(o,_.data,_.gc,k,x),w+=y);a.push(k),l.push(w),d=Math.max(k,d),h=Math.max(w,h)}lh(i,e);const C=a.indexOf(d),M=l.indexOf(h),S=B=>({width:a[B]||0,height:l[B]||0});return{first:S(0),last:S(e-1),widest:S(C),highest:S(M),widths:a,heights:l}}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 Gl(this._alignToPixels?ie(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=dh(this.getContext(),t,s))}return this.$context||(this.$context=ch(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=Ct(this.labelRotation),s=Math.abs(Math.cos(e)),o=Math.abs(Math.sin(e)),i=this._getLabelSizes(),a=t.autoSkipPadding||0,l=i?i.widest.width+a:0,c=i?i.highest.height+a:0;return this.isHorizontal()?c*s>l*o?l/s:c/o:c*o<l*s?c/s:l/o}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,o=this.options,{grid:i,position:a,border:l}=o,c=i.offset,d=this.isHorizontal(),f=this.ticks.length+(c?1:0),u=Ge(i),p=[],m=l.setContext(this.getContext()),g=m.display?m.width:0,b=g/2,_=function(v){return ie(s,v,g)};let y,k,w,x,C,M,S,B,E,A,N,U;if(a==="top")y=_(this.bottom),M=this.bottom-u,B=y-b,A=_(t.top)+b,U=t.bottom;else if(a==="bottom")y=_(this.top),A=t.top,U=_(t.bottom)-b,M=y+b,B=this.top+u;else if(a==="left")y=_(this.right),C=this.right-u,S=y-b,E=_(t.left)+b,N=t.right;else if(a==="right")y=_(this.left),E=t.left,N=_(t.right)-b,C=y+b,S=this.left+u;else if(e==="x"){if(a==="center")y=_((t.top+t.bottom)/2+.5);else if(I(a)){const v=Object.keys(a)[0],V=a[v];y=_(this.chart.scales[v].getPixelForValue(V))}A=t.top,U=t.bottom,M=y+b,B=M+u}else if(e==="y"){if(a==="center")y=_((t.left+t.right)/2);else if(I(a)){const v=Object.keys(a)[0],V=a[v];y=_(this.chart.scales[v].getPixelForValue(V))}C=y-b,S=C-u,E=t.left,N=t.right}const F=L(o.ticks.maxTicksLimit,f),D=Math.max(1,Math.ceil(f/F));for(k=0;k<f;k+=D){const v=this.getContext(k),V=i.setContext(v),O=l.setContext(v),T=V.lineWidth,$=V.color,W=O.dash||[],Y=O.dashOffset,G=V.tickWidth,Q=V.tickColor,ot=V.tickBorderDash||[],wt=V.tickBorderDashOffset;w=rh(this,k,c),w!==void 0&&(x=ie(s,w,T),d?C=S=E=N=x:M=B=A=U=x,p.push({tx1:C,ty1:M,tx2:S,ty2:B,x1:E,y1:A,x2:N,y2:U,width:T,color:$,borderDash:W,borderDashOffset:Y,tickWidth:G,tickColor:Q,tickBorderDash:ot,tickBorderDashOffset:wt}))}return this._ticksLength=f,this._borderValue=y,p}_computeLabelItems(t){const e=this.axis,s=this.options,{position:o,ticks:i}=s,a=this.isHorizontal(),l=this.ticks,{align:c,crossAlign:d,padding:h,mirror:f}=i,u=Ge(s.grid),p=u+h,m=f?-h:p,g=-Ct(this.labelRotation),b=[];let _,y,k,w,x,C,M,S,B,E,A,N,U="middle";if(o==="top")C=this.bottom-m,M=this._getXAxisLabelAlignment();else if(o==="bottom")C=this.top+m,M=this._getXAxisLabelAlignment();else if(o==="left"){const D=this._getYAxisLabelAlignment(u);M=D.textAlign,x=D.x}else if(o==="right"){const D=this._getYAxisLabelAlignment(u);M=D.textAlign,x=D.x}else if(e==="x"){if(o==="center")C=(t.top+t.bottom)/2+p;else if(I(o)){const D=Object.keys(o)[0],v=o[D];C=this.chart.scales[D].getPixelForValue(v)+p}M=this._getXAxisLabelAlignment()}else if(e==="y"){if(o==="center")x=(t.left+t.right)/2-p;else if(I(o)){const D=Object.keys(o)[0],v=o[D];x=this.chart.scales[D].getPixelForValue(v)}M=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(c==="start"?U="top":c==="end"&&(U="bottom"));const F=this._getLabelSizes();for(_=0,y=l.length;_<y;++_){k=l[_],w=k.label;const D=i.setContext(this.getContext(_));S=this.getPixelForTick(_)+i.labelOffset,B=this._resolveTickFontOptions(_),E=B.lineHeight,A=q(w)?w.length:1;const v=A/2,V=D.color,O=D.textStrokeColor,T=D.textStrokeWidth;let $=M;a?(x=S,M==="inner"&&(_===y-1?$=this.options.reverse?"left":"right":_===0?$=this.options.reverse?"right":"left":$="center"),o==="top"?d==="near"||g!==0?N=-A*E+E/2:d==="center"?N=-F.highest.height/2-v*E+E:N=-F.highest.height+E/2:d==="near"||g!==0?N=E/2:d==="center"?N=F.highest.height/2-v*E:N=F.highest.height-A*E,f&&(N*=-1),g!==0&&!D.showLabelBackdrop&&(x+=E/2*Math.sin(g))):(C=S,N=(1-A)*E/2);let W;if(D.showLabelBackdrop){const Y=rt(D.backdropPadding),G=F.heights[_],Q=F.widths[_];let ot=N-Y.top,wt=0-Y.left;switch(U){case"middle":ot-=G/2;break;case"bottom":ot-=G;break}switch(M){case"center":wt-=Q/2;break;case"right":wt-=Q;break}W={left:wt,top:ot,width:Q+Y.width,height:G+Y.height,color:D.backdropColor}}b.push({label:w,font:B,textOffset:N,options:{rotation:g,color:V,strokeColor:O,strokeWidth:T,textAlign:$,textBaseline:U,translation:[x,C],backdrop:W}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Ct(this.labelRotation))return t==="top"?"left":"right";let o="center";return e.align==="start"?o="left":e.align==="end"?o="right":e.align==="inner"&&(o="inner"),o}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:o,padding:i}}=this.options,a=this._getLabelSizes(),l=t+i,c=a.widest.width;let d,h;return e==="left"?o?(h=this.right+i,s==="near"?d="left":s==="center"?(d="center",h+=c/2):(d="right",h+=c)):(h=this.right-l,s==="near"?d="right":s==="center"?(d="center",h-=c/2):(d="left",h=this.left)):e==="right"?o?(h=this.left+i,s==="near"?d="right":s==="center"?(d="center",h-=c/2):(d="left",h-=c)):(h=this.left+l,s==="near"?d="left":s==="center"?(d="center",h+=c/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:s,top:o,width:i,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,o,i,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const o=this.ticks.findIndex(i=>i.value===t);return o>=0?e.setContext(this.getContext(o)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,o=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,a;const l=(c,d,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(c.x,c.y),s.lineTo(d.x,d.y),s.stroke(),s.restore())};if(e.display)for(i=0,a=o.length;i<a;++i){const c=o[i];e.drawOnChartArea&&l({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),e.drawTicks&&l({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:o}}=this,i=s.setContext(this.getContext()),a=s.display?i.width:0;if(!a)return;const l=o.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,h,f,u;this.isHorizontal()?(d=ie(t,this.left,a)-a/2,h=ie(t,this.right,l)+l/2,f=u=c):(f=ie(t,this.top,a)-a/2,u=ie(t,this.bottom,l)+l/2,d=h=c),e.save(),e.lineWidth=i.width,e.strokeStyle=i.color,e.beginPath(),e.moveTo(d,f),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,o=this._computeLabelArea();o&&kn(s,o);const i=this.getLabelItems(t);for(const a of i){const l=a.options,c=a.font,d=a.label,h=a.textOffset;ae(s,d,0,h,c,l)}o&&wn(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:o}}=this;if(!s.display)return;const i=nt(s.font),a=rt(s.padding),l=s.align;let c=i.lineHeight/2;e==="bottom"||e==="center"||I(e)?(c+=a.bottom,q(s.text)&&(c+=i.lineHeight*(s.text.length-1))):c+=a.top;const{titleX:d,titleY:h,maxWidth:f,rotation:u}=fh(this,c,e,l);ae(t,s.text,0,0,i,{color:s.color,maxWidth:f,rotation:u,textAlign:hh(l,e,o),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,s=L(t.grid&&t.grid.z,-1),o=L(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ue.prototype.draw?[{z:e,draw:i=>{this.draw(i)}}]:[{z:s,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:o,draw:()=>{this.drawBorder()}},{z:e,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",o=[];let i,a;for(i=0,a=e.length;i<a;++i){const l=e[i];l[s]===this.id&&(!t||l.type===t)&&o.push(l)}return o}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return nt(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Nn{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;mh(e)&&(s=this.register(e));const o=this.items,i=t.id,a=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in o||(o[i]=t,uh(t,a,s),this.override&&J.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,o=this.scope;s in e&&delete e[s],o&&s in J[o]&&(delete J[o][s],this.override&&delete oe[s])}}function uh(n,t,e){const s=Ae(Object.create(null),[e?J.get(e):{},J.get(t),n.defaults]);J.set(t,s),n.defaultRoutes&&ph(t,n.defaultRoutes),n.descriptors&&J.describe(t,n.descriptors)}function ph(n,t){Object.keys(t).forEach(e=>{const s=e.split("."),o=s.pop(),i=[n].concat(s).join("."),a=t[e].split("."),l=a.pop(),c=a.join(".");J.route(i,o,c,l)})}function mh(n){return"id"in n&&"defaults"in n}class gh{constructor(){this.controllers=new Nn(St,"datasets",!0),this.elements=new Nn(Nt,"elements"),this.plugins=new Nn(Object,"plugins"),this.scales=new Nn(ue,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(o=>{const i=s||this._getRegistryForType(o);s||i.isForType(o)||i===this.plugins&&o.id?this._exec(t,i,o):j(o,a=>{const l=s||this._getRegistryForType(a);this._exec(t,l,a)})})}_exec(t,e,s){const o=us(t);H(s["before"+o],[],s),e[t](s),H(s["after"+o],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const o=e.get(t);if(o===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return o}}var vt=new gh;class bh{constructor(){this._init=[]}notify(t,e,s,o){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const i=o?this._descriptors(t).filter(o):this._descriptors(t),a=this._notify(i,t,e,s);return e==="afterDestroy"&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall")),a}_notify(t,e,s,o){o=o||{};for(const i of t){const a=i.plugin,l=a[s],c=[e,o,i.options];if(H(l,c,a)===!1&&o.cancelable)return!1}return!0}invalidate(){z(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,o=L(s.options&&s.options.plugins,{}),i=yh(s);return o===!1&&!e?[]:xh(t,i,o,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,o=(i,a)=>i.filter(l=>!a.some(c=>l.plugin.id===c.plugin.id));this._notify(o(e,s),t,"stop"),this._notify(o(s,e),t,"start")}}function yh(n){const t={},e=[],s=Object.keys(vt.plugins.items);for(let i=0;i<s.length;i++)e.push(vt.getPlugin(s[i]));const o=n.plugins||[];for(let i=0;i<o.length;i++){const a=o[i];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function _h(n,t){return!t&&n===!1?null:n===!0?{}:n}function xh(n,{plugins:t,localIds:e},s,o){const i=[],a=n.getContext();for(const l of t){const c=l.id,d=_h(s[c],o);d!==null&&i.push({plugin:l,options:kh(n.config,{plugin:l,local:e[c]},d,a)})}return i}function kh(n,{plugin:t,local:e},s,o){const i=n.pluginScopeKeys(t),a=n.getOptionScopes(s,i);return e&&t.defaults&&a.push(t.defaults),n.createResolver(a,o,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Ns(n,t){const e=J.datasets[n]||{};return((t.datasets||{})[n]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function wh(n,t){let e=n;return n==="_index_"?e=t:n==="_value_"&&(e=t==="x"?"y":"x"),e}function Ch(n,t){return n===t?"_index_":"_value_"}function Hi(n){if(n==="x"||n==="y"||n==="r")return n}function Sh(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function $s(n,...t){if(Hi(n))return n;for(const e of t){const s=e.axis||Sh(e.position)||n.length>1&&Hi(n[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function Ui(n,t,e){if(e[t+"AxisID"]===n)return{axis:t}}function Mh(n,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===n||s.yAxisID===n);if(e.length)return Ui(n,"x",e[0])||Ui(n,"y",e[0])}return{}}function vh(n,t){const e=oe[n.type]||{scales:{}},s=t.scales||{},o=Ns(n.type,t),i=Object.create(null);return Object.keys(s).forEach(a=>{const l=s[a];if(!I(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=$s(a,l,Mh(a,n),J.scales[l.type]),d=Ch(c,o),h=e.scales||{};i[a]=Fe(Object.create(null),[{axis:c},l,h[c],h[d]])}),n.data.datasets.forEach(a=>{const l=a.type||n.type,c=a.indexAxis||Ns(l,t),h=(oe[l]||{}).scales||{};Object.keys(h).forEach(f=>{const u=wh(f,c),p=a[u+"AxisID"]||u;i[p]=i[p]||Object.create(null),Fe(i[p],[{axis:u},s[p],h[f]])})}),Object.keys(i).forEach(a=>{const l=i[a];Fe(l,[J.scales[l.type],J.scale])}),i}function qi(n){const t=n.options||(n.options={});t.plugins=L(t.plugins,{}),t.scales=vh(n,t)}function Xi(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Dh(n){return n=n||{},n.data=Xi(n.data),qi(n),n}const Ki=new Map,Gi=new Set;function $n(n,t){let e=Ki.get(n);return e||(e=t(),Ki.set(n,e),Gi.add(e)),e}const Ze=(n,t,e)=>{const s=Ut(t,e);s!==void 0&&n.add(s)};class Bh{constructor(t){this._config=Dh(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=Xi(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(),qi(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return $n(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return $n(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return $n(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return $n(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let o=s.get(t);return(!o||e)&&(o=new Map,s.set(t,o)),o}getOptionScopes(t,e,s){const{options:o,type:i}=this,a=this._cachedScopes(t,s),l=a.get(e);if(l)return l;const c=new Set;e.forEach(h=>{t&&(c.add(t),h.forEach(f=>Ze(c,t,f))),h.forEach(f=>Ze(c,o,f)),h.forEach(f=>Ze(c,oe[i]||{},f)),h.forEach(f=>Ze(c,J,f)),h.forEach(f=>Ze(c,xs,f))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Gi.has(e)&&a.set(e,d),d}chartOptionScopes(){const{options:t,type:e}=this;return[t,oe[e]||{},J.datasets[e]||{},{type:e},J,xs]}resolveNamedOptions(t,e,s,o=[""]){const i={$shared:!0},{resolver:a,subPrefixes:l}=Zi(this._resolverCache,t,o);let c=a;if(Vh(a,e)){i.$shared=!1,s=qt(s)?s():s;const d=this.createResolver(t,s,l);c=we(a,s,d)}for(const d of e)i[d]=c[d];return i}createResolver(t,e,s=[""],o){const{resolver:i}=Zi(this._resolverCache,t,s);return I(e)?we(i,e,void 0,o):i}}function Zi(n,t,e){let s=n.get(t);s||(s=new Map,n.set(t,s));const o=e.join();let i=s.get(o);return i||(i={resolver:Ss(t,e),subPrefixes:e.filter(l=>!l.toLowerCase().includes("hover"))},s.set(o,i)),i}const Eh=n=>I(n)&&Object.getOwnPropertyNames(n).reduce((t,e)=>t||qt(n[e]),!1);function Vh(n,t){const{isScriptable:e,isIndexable:s}=Jo(n);for(const o of t){const i=e(o),a=s(o),l=(a||i)&&n[o];if(i&&(qt(l)||Eh(l))||a&&q(l))return!0}return!1}var Ph="4.4.0";const Oh=["top","bottom","left","right","chartArea"];function Ji(n,t){return n==="top"||n==="bottom"||Oh.indexOf(n)===-1&&t==="x"}function Qi(n,t){return function(e,s){return e[n]===s[n]?e[t]-s[t]:e[n]-s[n]}}function ta(n){const t=n.chart,e=t.options.animation;t.notifyPlugins("afterRender"),H(e&&e.onComplete,[n],t)}function Ah(n){const t=n.chart,e=t.options.animation;H(e&&e.onProgress,[n],t)}function ea(n){return ai()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Ln={},na=n=>{const t=ea(n);return Object.values(Ln).filter(e=>e.canvas===t).pop()};function Fh(n,t,e){const s=Object.keys(n);for(const o of s){const i=+o;if(i>=t){const a=n[o];delete n[o],(e>0||i>t)&&(n[i+e]=a)}}}function Th(n,t,e,s){return!e||n.type==="mouseout"?null:s?t:n}function Rn(n,t,e){return n.options.clip?n[e]:t[e]}function Nh(n,t){const{xScale:e,yScale:s}=n;return e&&s?{left:Rn(e,t,"left"),right:Rn(e,t,"right"),top:Rn(s,t,"top"),bottom:Rn(s,t,"bottom")}:t}class $t{static register(...t){vt.add(...t),sa()}static unregister(...t){vt.remove(...t),sa()}constructor(t,e){const s=this.config=new Bh(e),o=ea(t),i=na(o);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Qd(o)),this.platform.updateConfig(s);const l=this.platform.acquireContext(o,a.aspectRatio),c=l&&l.canvas,d=c&&c.height,h=c&&c.width;if(this.id=Ll(),this.ctx=l,this.canvas=c,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 bh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=tc(f=>this.update(f),a.resizeDelay||0),this._dataChanges=[],Ln[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}Tt.listen(this,"complete",ta),Tt.listen(this,"progress",Ah),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:o,_aspectRatio:i}=this;return z(t)?e&&i?i:o?s/o: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 vt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ri(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ko(this.canvas,this.ctx),this}stop(){return Tt.stop(this),this}resize(t,e){Tt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,o=this.canvas,i=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(o,t,e,i),l=s.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,ri(this,l,!0)&&(this.notifyPlugins("resize",{size:a}),H(s.onResize,[this,a],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};j(e,(s,o)=>{s.id=o})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,o=Object.keys(s).reduce((a,l)=>(a[l]=!1,a),{});let i=[];e&&(i=i.concat(Object.keys(e).map(a=>{const l=e[a],c=$s(a,l),d=c==="r",h=c==="x";return{options:l,dposition:d?"chartArea":h?"bottom":"left",dtype:d?"radialLinear":h?"category":"linear"}}))),j(i,a=>{const l=a.options,c=l.id,d=$s(c,l),h=L(l.type,a.dtype);(l.position===void 0||Ji(l.position,d)!==Ji(a.dposition))&&(l.position=a.dposition),o[c]=!0;let f=null;if(c in s&&s[c].type===h)f=s[c];else{const u=vt.getScale(h);f=new u({id:c,type:h,ctx:this.ctx,chart:this}),s[f.id]=f}f.init(l,t)}),j(o,(a,l)=>{a||delete s[l]}),j(s,a=>{lt.configure(this,a,a.options),lt.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((o,i)=>o.index-i.index),s>e){for(let o=e;o<s;++o)this._destroyDatasetMeta(o);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(Qi("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,o)=>{e.filter(i=>i===s._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,o;for(this._removeUnreferencedMetasets(),s=0,o=e.length;s<o;s++){const i=e[s];let a=this.getDatasetMeta(s);const l=i.type||this.config.type;if(a.type&&a.type!==l&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=l,a.indexAxis=i.indexAxis||Ns(l,this.options),a.order=i.order||0,a.index=s,a.label=""+i.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{const c=vt.getController(l),{datasetElementType:d,dataElementType:h}=J.datasets[l];Object.assign(c,{dataElementType:vt.getElement(h),datasetElementType:d&&vt.getElement(d)}),a.controller=new c(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){j(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=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=!o&&i.indexOf(f)===-1;f.buildOrUpdateElements(u),a=Math.max(+f.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),o||j(i,d=>{d.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Qi("z","_idx"));const{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){j(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Po(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:o,count:i}of e){const a=s==="_removeElements"?-i:i;Fh(t,o,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=i=>new Set(t.filter(a=>a[0]===i).map((a,l)=>l+","+a.splice(1).join(","))),o=s(0);for(let i=1;i<e;i++)if(!Po(o,s(i)))return;return Array.from(o).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;lt.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],j(this.boxes,o=>{s&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,i)=>{o._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,qt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),o={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(s.controller._update(e),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Tt.has(this)?this.attached&&!Tt.running(this)&&Tt.start(this):(this.draw(),ta({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:o}=this._resizeBeforeDraw;this._resize(s,o),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let o,i;for(o=0,i=e.length;o<i;++o){const a=e[o];(!t||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,o=!s.disabled,i=Nh(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(o&&kn(e,{left:s.left===!1?0:i.left-s.left,right:s.right===!1?this.width:i.right+s.right,top:s.top===!1?0:i.top-s.top,bottom:s.bottom===!1?this.height:i.bottom+s.bottom}),t.controller.draw(),o&&wn(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return Ft(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,o){const i=Od.modes[e];return typeof i=="function"?i(this,t,s,o):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let o=s.filter(i=>i&&i._dataset===e).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(o)),o}getContext(){return this.$context||(this.$context=Kt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const o=s?"show":"hide",i=this.getDatasetMeta(t),a=i.controller._resolveAnimations(void 0,o);Te(e)?(i.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(i,{visible:s}),this.update(l=>l.datasetIndex===t?o: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(),Tt.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(),Ko(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Ln[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(i,a)=>{e.addEventListener(this,i,a),t[i]=a},o=(i,a,l)=>{i.offsetX=a,i.offsetY=l,this._eventHandler(i)};j(this.options.events,i=>s(i,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(c,d)=>{e.addEventListener(this,c,d),t[c]=d},o=(c,d)=>{t[c]&&(e.removeEventListener(this,c,d),delete t[c])},i=(c,d)=>{this.canvas&&this.resize(c,d)};let a;const l=()=>{o("attach",l),this.attached=!0,this.resize(),s("resize",i),s("detach",a)};a=()=>{this.attached=!1,o("resize",i),this._stop(),this._resize(0,0),s("attach",l)},e.isAttached(this.canvas)?l():a()}unbindEvents(){j(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},j(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const o=s?"set":"remove";let i,a,l,c;for(e==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+o+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){a=t[l];const d=a&&this.getDatasetMeta(a.datasetIndex).controller;d&&d[o+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:i,index:a})=>{const l=this.getDatasetMeta(i);if(!l)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:l.data[a],index:a}});!mn(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const o=this.options.hover,i=(c,d)=>c.filter(h=>!d.some(f=>h.datasetIndex===f.datasetIndex&&h.index===f.index)),a=i(e,t),l=s?t:i(t,e);a.length&&this.updateHoverStyle(a,o.mode,!1),l.length&&o.mode&&this.updateHoverStyle(l,o.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},o=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,o)===!1)return;const i=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,o),(i||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:o=[],options:i}=this,a=e,l=this._getActiveElements(t,o,s,a),c=Yl(t),d=Th(t,this._lastEvent,s,c);s&&(this._lastEvent=null,H(i.onHover,[t,l,this],this),c&&H(i.onClick,[t,l,this],this));const h=!mn(l,o);return(h||e)&&(this._active=l,this._updateHoverStyles(l,o,e)),this._lastEvent=d,h}_getActiveElements(t,e,s,o){if(t.type==="mouseout")return[];if(!s)return e;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,o)}}P($t,"defaults",J),P($t,"instances",Ln),P($t,"overrides",oe),P($t,"registry",vt),P($t,"version",Ph),P($t,"getChart",na);function sa(){return j($t.instances,n=>n._plugins.invalidate())}function $h(n,t,e){const{startAngle:s,pixelMargin:o,x:i,y:a,outerRadius:l,innerRadius:c}=t;let d=o/l;n.beginPath(),n.arc(i,a,l,s-d,e+d),c>o?(d=o/c,n.arc(i,a,c,e+d,s-d,!0)):n.arc(i,a,o,e+tt,s-tt),n.closePath(),n.clip()}function Lh(n){return Cs(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Rh(n,t,e,s){const o=Lh(n.options.borderRadius),i=(e-t)/2,a=Math.min(i,s*t/2),l=c=>{const d=(e-Math.min(i,c))*s/2;return st(c,0,Math.min(i,d))};return{outerStart:l(o.outerStart),outerEnd:l(o.outerEnd),innerStart:st(o.innerStart,0,a),innerEnd:st(o.innerEnd,0,a)}}function Me(n,t,e,s){return{x:e+n*Math.cos(t),y:s+n*Math.sin(t)}}function In(n,t,e,s,o,i){const{x:a,y:l,startAngle:c,pixelMargin:d,innerRadius:h}=t,f=Math.max(t.outerRadius+s+e-d,0),u=h>0?h+s+e+d:0;let p=0;const m=o-c;if(s){const D=h>0?h-s:0,v=f>0?f-s:0,V=(D+v)/2,O=V!==0?m*V/(V+s):m;p=(m-O)/2}const g=Math.max(.001,m*f-e/X)/f,b=(m-g)/2,_=c+b+p,y=o-b-p,{outerStart:k,outerEnd:w,innerStart:x,innerEnd:C}=Rh(t,u,f,y-_),M=f-k,S=f-w,B=_+k/M,E=y-w/S,A=u+x,N=u+C,U=_+x/A,F=y-C/N;if(n.beginPath(),i){const D=(B+E)/2;if(n.arc(a,l,f,B,D),n.arc(a,l,f,D,E),w>0){const T=Me(S,E,a,l);n.arc(T.x,T.y,w,E,y+tt)}const v=Me(N,y,a,l);if(n.lineTo(v.x,v.y),C>0){const T=Me(N,F,a,l);n.arc(T.x,T.y,C,y+tt,F+Math.PI)}const V=(y-C/u+(_+x/u))/2;if(n.arc(a,l,u,y-C/u,V,!0),n.arc(a,l,u,V,_+x/u,!0),x>0){const T=Me(A,U,a,l);n.arc(T.x,T.y,x,U+Math.PI,_-tt)}const O=Me(M,_,a,l);if(n.lineTo(O.x,O.y),k>0){const T=Me(M,B,a,l);n.arc(T.x,T.y,k,_-tt,B)}}else{n.moveTo(a,l);const D=Math.cos(B)*f+a,v=Math.sin(B)*f+l;n.lineTo(D,v);const V=Math.cos(E)*f+a,O=Math.sin(E)*f+l;n.lineTo(V,O)}n.closePath()}function Ih(n,t,e,s,o){const{fullCircles:i,startAngle:a,circumference:l}=t;let c=t.endAngle;if(i){In(n,t,e,s,c,o);for(let d=0;d<i;++d)n.fill();isNaN(l)||(c=a+(l%K||K))}return In(n,t,e,s,c,o),n.fill(),c}function zh(n,t,e,s,o){const{fullCircles:i,startAngle:a,circumference:l,options:c}=t,{borderWidth:d,borderJoinStyle:h,borderDash:f,borderDashOffset:u}=c,p=c.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(i){In(n,t,e,s,m,o);for(let g=0;g<i;++g)n.stroke();isNaN(l)||(m=a+(l%K||K))}p&&$h(n,t,m),i||(In(n,t,e,s,m,o),n.stroke())}class Je extends Nt{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,s,o){const i=this.getProps(["x","y"],o),{angle:a,distance:l}=No(i,{x:e,y:s}),{startAngle:c,endAngle:d,innerRadius:h,outerRadius:f,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],o),p=(this.options.spacing+this.options.borderWidth)/2,g=L(u,d-c)>=K||$e(a,c,d),b=Ot(l,h+p,f+p);return g&&b}getCenterPoint(e){const{x:s,y:o,startAngle:i,endAngle:a,innerRadius:l,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:d,spacing:h}=this.options,f=(i+a)/2,u=(l+c+h+d)/2;return{x:s+Math.cos(f)*u,y:o+Math.sin(f)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:s,circumference:o}=this,i=(s.offset||0)/4,a=(s.spacing||0)/2,l=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=o>K?Math.floor(o/K):0,o===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const c=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(c)*i,Math.sin(c)*i);const d=1-Math.sin(Math.min(X,o||0)),h=i*d;e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,Ih(e,this,h,a,l),zh(e,this,h,a,l),e.restore()}}P(Je,"id","arc"),P(Je,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),P(Je,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(Je,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function oa(n,t,e=t){n.lineCap=L(e.borderCapStyle,t.borderCapStyle),n.setLineDash(L(e.borderDash,t.borderDash)),n.lineDashOffset=L(e.borderDashOffset,t.borderDashOffset),n.lineJoin=L(e.borderJoinStyle,t.borderJoinStyle),n.lineWidth=L(e.borderWidth,t.borderWidth),n.strokeStyle=L(e.borderColor,t.borderColor)}function Wh(n,t,e){n.lineTo(e.x,e.y)}function jh(n){return n.stepped?fc:n.tension||n.cubicInterpolationMode==="monotone"?uc:Wh}function ia(n,t,e={}){const s=n.length,{start:o=0,end:i=s-1}=e,{start:a,end:l}=t,c=Math.max(o,a),d=Math.min(i,l),h=o<a&&i<a||o>l&&i>l;return{count:s,start:c,loop:t.loop,ilen:d<c&&!h?s+d-c:d-c}}function Yh(n,t,e,s){const{points:o,options:i}=t,{count:a,start:l,loop:c,ilen:d}=ia(o,e,s),h=jh(i);let{move:f=!0,reverse:u}=s||{},p,m,g;for(p=0;p<=d;++p)m=o[(l+(u?d-p:p))%a],!m.skip&&(f?(n.moveTo(m.x,m.y),f=!1):h(n,g,m,u,i.stepped),g=m);return c&&(m=o[(l+(u?d:0))%a],h(n,g,m,u,i.stepped)),!!c}function Hh(n,t,e,s){const o=t.points,{count:i,start:a,ilen:l}=ia(o,e,s),{move:c=!0,reverse:d}=s||{};let h=0,f=0,u,p,m,g,b,_;const y=w=>(a+(d?l-w:w))%i,k=()=>{g!==b&&(n.lineTo(h,b),n.lineTo(h,g),n.lineTo(h,_))};for(c&&(p=o[y(0)],n.moveTo(p.x,p.y)),u=0;u<=l;++u){if(p=o[y(u)],p.skip)continue;const w=p.x,x=p.y,C=w|0;C===m?(x<g?g=x:x>b&&(b=x),h=(f*h+w)/++f):(k(),n.lineTo(w,x),m=C,f=0,g=b=x),_=x}k()}function Ls(n){const t=n.options,e=t.borderDash&&t.borderDash.length;return!n._decimated&&!n._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Hh:Yh}function Uh(n){return n.stepped?Hc:n.tension||n.cubicInterpolationMode==="monotone"?Uc:de}function qh(n,t,e,s){let o=t._path;o||(o=t._path=new Path2D,t.path(o,e,s)&&o.closePath()),oa(n,t.options),n.stroke(o)}function Xh(n,t,e,s){const{segments:o,options:i}=t,a=Ls(t);for(const l of o)oa(n,i,l.style),n.beginPath(),a(n,t,l,{start:e,end:e+s-1})&&n.closePath(),n.stroke()}const Kh=typeof Path2D=="function";function Gh(n,t,e,s){Kh&&!t.options.segment?qh(n,t,e,s):Xh(n,t,e,s)}class Gt extends Nt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const o=s.spanGaps?this._loop:this._fullLoop;$c(this._points,s,t,o,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=Jc(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,o=t[e],i=this.points,a=pi(this,{property:e,start:o,end:o});if(!a.length)return;const l=[],c=Uh(s);let d,h;for(d=0,h=a.length;d<h;++d){const{start:f,end:u}=a[d],p=i[f],m=i[u];if(p===m){l.push(p);continue}const g=Math.abs((o-p[e])/(m[e]-p[e])),b=c(p,m,g,s.stepped);b[e]=t[e],l.push(b)}return l.length===1?l[0]:l}pathSegment(t,e,s){return Ls(this)(t,this,e,s)}path(t,e,s){const o=this.segments,i=Ls(this);let a=this._loop;e=e||0,s=s||this.points.length-e;for(const l of o)a&=i(t,this,l,{start:e,end:e+s-1});return!!a}draw(t,e,s,o){const i=this.options||{};(this.points||[]).length&&i.borderWidth&&(t.save(),Gh(t,this,s,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(Gt,"id","line"),P(Gt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(Gt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(Gt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function aa(n,t,e,s){const o=n.options,{[e]:i}=n.getProps([e],s);return Math.abs(t-i)<o.radius+o.hitRadius}class zn extends Nt{constructor(e){super();P(this,"parsed");P(this,"skip");P(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,s,o){const i=this.options,{x:a,y:l}=this.getProps(["x","y"],o);return Math.pow(e-a,2)+Math.pow(s-l,2)<Math.pow(i.hitRadius+i.radius,2)}inXRange(e,s){return aa(this,e,"x",s)}inYRange(e,s){return aa(this,e,"y",s)}getCenterPoint(e){const{x:s,y:o}=this.getProps(["x","y"],e);return{x:s,y:o}}size(e){e=e||this.options||{};let s=e.radius||0;s=Math.max(s,s&&e.hoverRadius||0);const o=s&&e.borderWidth||0;return(s+o)*2}draw(e,s){const o=this.options;this.skip||o.radius<.1||!Ft(this,s,this.size(o)/2)||(e.strokeStyle=o.borderColor,e.lineWidth=o.borderWidth,e.fillStyle=o.backgroundColor,ws(e,o,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(zn,"id","point"),P(zn,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(zn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function ra(n,t){const{x:e,y:s,base:o,width:i,height:a}=n.getProps(["x","y","base","width","height"],t);let l,c,d,h,f;return n.horizontal?(f=a/2,l=Math.min(e,o),c=Math.max(e,o),d=s-f,h=s+f):(f=i/2,l=e-f,c=e+f,d=Math.min(s,o),h=Math.max(s,o)),{left:l,top:d,right:c,bottom:h}}function Zt(n,t,e,s){return n?0:st(t,e,s)}function Zh(n,t,e){const s=n.options.borderWidth,o=n.borderSkipped,i=Zo(s);return{t:Zt(o.top,i.top,0,e),r:Zt(o.right,i.right,0,t),b:Zt(o.bottom,i.bottom,0,e),l:Zt(o.left,i.left,0,t)}}function Jh(n,t,e){const{enableBorderRadius:s}=n.getProps(["enableBorderRadius"]),o=n.options.borderRadius,i=re(o),a=Math.min(t,e),l=n.borderSkipped,c=s||I(o);return{topLeft:Zt(!c||l.top||l.left,i.topLeft,0,a),topRight:Zt(!c||l.top||l.right,i.topRight,0,a),bottomLeft:Zt(!c||l.bottom||l.left,i.bottomLeft,0,a),bottomRight:Zt(!c||l.bottom||l.right,i.bottomRight,0,a)}}function Qh(n){const t=ra(n),e=t.right-t.left,s=t.bottom-t.top,o=Zh(n,e/2,s/2),i=Jh(n,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:i},inner:{x:t.left+o.l,y:t.top+o.t,w:e-o.l-o.r,h:s-o.t-o.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(o.t,o.l)),topRight:Math.max(0,i.topRight-Math.max(o.t,o.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(o.b,o.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(o.b,o.r))}}}}function Rs(n,t,e,s){const o=t===null,i=e===null,l=n&&!(o&&i)&&ra(n,s);return l&&(o||Ot(t,l.left,l.right))&&(i||Ot(e,l.top,l.bottom))}function tf(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function ef(n,t){n.rect(t.x,t.y,t.w,t.h)}function Is(n,t,e={}){const s=n.x!==e.x?-t:0,o=n.y!==e.y?-t:0,i=(n.x+n.w!==e.x+e.w?t:0)-s,a=(n.y+n.h!==e.y+e.h?t:0)-o;return{x:n.x+s,y:n.y+o,w:n.w+i,h:n.h+a,radius:n.radius}}class Wn extends Nt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:s,backgroundColor:o}}=this,{inner:i,outer:a}=Qh(this),l=tf(a.radius)?ze:ef;t.save(),(a.w!==i.w||a.h!==i.h)&&(t.beginPath(),l(t,Is(a,e,i)),t.clip(),l(t,Is(i,-e,a)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),l(t,Is(i,e)),t.fillStyle=o,t.fill(),t.restore()}inRange(t,e,s){return Rs(this,t,e,s)}inXRange(t,e){return Rs(this,t,null,e)}inYRange(t,e){return Rs(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:o,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(e+o)/2:e,y:i?s:(s+o)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}P(Wn,"id","bar"),P(Wn,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(Wn,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var nf=Object.freeze({__proto__:null,ArcElement:Je,BarElement:Wn,LineElement:Gt,PointElement:zn});const zs=["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)"],la=zs.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function ca(n){return zs[n%zs.length]}function da(n){return la[n%la.length]}function sf(n,t){return n.borderColor=ca(t),n.backgroundColor=da(t),++t}function of(n,t){return n.backgroundColor=n.data.map(()=>ca(t++)),t}function af(n,t){return n.backgroundColor=n.data.map(()=>da(t++)),t}function rf(n){let t=0;return(e,s)=>{const o=n.getDatasetMeta(s).controller;o instanceof he?t=of(e,t):o instanceof Ye?t=af(e,t):o&&(t=sf(e,t))}}function ha(n){let t;for(t in n)if(n[t].borderColor||n[t].backgroundColor)return!0;return!1}function lf(n){return n&&(n.borderColor||n.backgroundColor)}var cf={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,t,e){if(!e.enabled)return;const{data:{datasets:s},options:o}=n.config,{elements:i}=o;if(!e.forceOverride&&(ha(s)||lf(o)||i&&ha(i)))return;const a=rf(n);s.forEach(a)}};function df(n,t,e,s,o){const i=o.samples||s;if(i>=e)return n.slice(t,t+e);const a=[],l=(e-2)/(i-2);let c=0;const d=t+e-1;let h=t,f,u,p,m,g;for(a[c++]=n[h],f=0;f<i-2;f++){let b=0,_=0,y;const k=Math.floor((f+1)*l)+1+t,w=Math.min(Math.floor((f+2)*l)+1,e)+t,x=w-k;for(y=k;y<w;y++)b+=n[y].x,_+=n[y].y;b/=x,_/=x;const C=Math.floor(f*l)+1+t,M=Math.min(Math.floor((f+1)*l)+1,e)+t,{x:S,y:B}=n[h];for(p=m=-1,y=C;y<M;y++)m=.5*Math.abs((S-b)*(n[y].y-B)-(S-n[y].x)*(_-B)),m>p&&(p=m,u=n[y],g=y);a[c++]=u,h=g}return a[c++]=n[d],a}function hf(n,t,e,s){let o=0,i=0,a,l,c,d,h,f,u,p,m,g;const b=[],_=t+e-1,y=n[t].x,w=n[_].x-y;for(a=t;a<t+e;++a){l=n[a],c=(l.x-y)/w*s,d=l.y;const x=c|0;if(x===h)d<m?(m=d,f=a):d>g&&(g=d,u=a),o=(i*o+l.x)/++i;else{const C=a-1;if(!z(f)&&!z(u)){const M=Math.min(f,u),S=Math.max(f,u);M!==p&&M!==C&&b.push({...n[M],x:o}),S!==p&&S!==C&&b.push({...n[S],x:o})}a>0&&C!==p&&b.push(n[C]),b.push(l),h=x,i=0,m=g=d,f=u=p=a}}return b}function fa(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 ua(n){n.data.datasets.forEach(t=>{fa(t)})}function ff(n,t){const e=t.length;let s=0,o;const{iScale:i}=n,{min:a,max:l,minDefined:c,maxDefined:d}=i.getUserBounds();return c&&(s=st(At(t,i.axis,a).lo,0,e-1)),d?o=st(At(t,i.axis,l).hi+1,s,e)-s:o=e-s,{start:s,count:o}}var uf={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,t,e)=>{if(!e.enabled){ua(n);return}const s=n.width;n.data.datasets.forEach((o,i)=>{const{_data:a,indexAxis:l}=o,c=n.getDatasetMeta(i),d=a||o.data;if(We([l,n.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const h=n.scales[c.xAxisID];if(h.type!=="linear"&&h.type!=="time"||n.options.parsing)return;let{start:f,count:u}=ff(c,d);const p=e.threshold||4*s;if(u<=p){fa(o);return}z(a)&&(o._data=d,delete o.data,Object.defineProperty(o,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let m;switch(e.algorithm){case"lttb":m=df(d,f,u,s,e);break;case"min-max":m=hf(d,f,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}o._decimated=m})},destroy(n){ua(n)}};function pf(n,t,e){const s=n.segments,o=n.points,i=t.points,a=[];for(const l of s){let{start:c,end:d}=l;d=js(c,d,o);const h=Ws(e,o[c],o[d],l.loop);if(!t.segments){a.push({source:l,target:h,start:o[c],end:o[d]});continue}const f=pi(t,h);for(const u of f){const p=Ws(e,i[u.start],i[u.end],u.loop),m=ui(l,o,p);for(const g of m)a.push({source:g,target:u,start:{[e]:pa(h,p,"start",Math.max)},end:{[e]:pa(h,p,"end",Math.min)}})}}return a}function Ws(n,t,e,s){if(s)return;let o=t[n],i=e[n];return n==="angle"&&(o=mt(o),i=mt(i)),{property:n,start:o,end:i}}function mf(n,t){const{x:e=null,y:s=null}=n||{},o=t.points,i=[];return t.segments.forEach(({start:a,end:l})=>{l=js(a,l,o);const c=o[a],d=o[l];s!==null?(i.push({x:c.x,y:s}),i.push({x:d.x,y:s})):e!==null&&(i.push({x:e,y:c.y}),i.push({x:e,y:d.y}))}),i}function js(n,t,e){for(;t>n;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function pa(n,t,e,s){return n&&t?s(n[e],t[e]):n?n[e]:t?t[e]:0}function ma(n,t){let e=[],s=!1;return q(n)?(s=!0,e=n):e=mf(n,t),e.length?new Gt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function ga(n){return n&&n.fill!==!1}function gf(n,t,e){let o=n[t].fill;const i=[t];let a;if(!e)return o;for(;o!==!1&&i.indexOf(o)===-1;){if(!Z(o))return o;if(a=n[o],!a)return!1;if(a.visible)return o;i.push(o),o=a.fill}return!1}function bf(n,t,e){const s=kf(n);if(I(s))return isNaN(s.value)?!1:s;let o=parseFloat(s);return Z(o)&&Math.floor(o)===o?yf(s[0],t,o,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function yf(n,t,e,s){return(n==="-"||n==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function _f(n,t){let e=null;return n==="start"?e=t.bottom:n==="end"?e=t.top:I(n)?e=t.getPixelForValue(n.value):t.getBasePixel&&(e=t.getBasePixel()),e}function xf(n,t,e){let s;return n==="start"?s=e:n==="end"?s=t.options.reverse?t.min:t.max:I(n)?s=n.value:s=t.getBaseValue(),s}function kf(n){const t=n.options,e=t.fill;let s=L(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function wf(n){const{scale:t,index:e,line:s}=n,o=[],i=s.segments,a=s.points,l=Cf(t,e);l.push(ma({x:null,y:t.bottom},s));for(let c=0;c<i.length;c++){const d=i[c];for(let h=d.start;h<=d.end;h++)Sf(o,a[h],l)}return new Gt({points:o,options:{}})}function Cf(n,t){const e=[],s=n.getMatchingVisibleMetas("line");for(let o=0;o<s.length;o++){const i=s[o];if(i.index===t)break;i.hidden||e.unshift(i.dataset)}return e}function Sf(n,t,e){const s=[];for(let o=0;o<e.length;o++){const i=e[o],{first:a,last:l,point:c}=Mf(i,t,"x");if(!(!c||a&&l)){if(a)s.unshift(c);else if(n.push(c),!l)break}}n.push(...s)}function Mf(n,t,e){const s=n.interpolate(t,e);if(!s)return{};const o=s[e],i=n.segments,a=n.points;let l=!1,c=!1;for(let d=0;d<i.length;d++){const h=i[d],f=a[h.start][e],u=a[h.end][e];if(Ot(o,f,u)){l=o===f,c=o===u;break}}return{first:l,last:c,point:s}}class ba{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){const{x:o,y:i,radius:a}=this;return e=e||{start:0,end:K},t.arc(o,i,a,e.end,e.start,!0),!s.bounds}interpolate(t){const{x:e,y:s,radius:o}=this,i=t.angle;return{x:e+Math.cos(i)*o,y:s+Math.sin(i)*o,angle:i}}}function vf(n){const{chart:t,fill:e,line:s}=n;if(Z(e))return Df(t,e);if(e==="stack")return wf(n);if(e==="shape")return!0;const o=Bf(n);return o instanceof ba?o:ma(o,s)}function Df(n,t){const e=n.getDatasetMeta(t);return e&&n.isDatasetVisible(t)?e.dataset:null}function Bf(n){return(n.scale||{}).getPointPositionForValue?Vf(n):Ef(n)}function Ef(n){const{scale:t={},fill:e}=n,s=_f(e,t);if(Z(s)){const o=t.isHorizontal();return{x:o?s:null,y:o?null:s}}return null}function Vf(n){const{scale:t,fill:e}=n,s=t.options,o=t.getLabels().length,i=s.reverse?t.max:t.min,a=xf(e,t,i),l=[];if(s.grid.circular){const c=t.getPointPositionForValue(0,i);return new ba({x:c.x,y:c.y,radius:t.getDistanceFromCenterForValue(a)})}for(let c=0;c<o;++c)l.push(t.getPointPositionForValue(c,a));return l}function Ys(n,t,e){const s=vf(t),{line:o,scale:i,axis:a}=t,l=o.options,c=l.fill,d=l.backgroundColor,{above:h=d,below:f=d}=c||{};s&&o.points.length&&(kn(n,e),Pf(n,{line:o,target:s,above:h,below:f,area:e,scale:i,axis:a}),wn(n))}function Pf(n,t){const{line:e,target:s,above:o,below:i,area:a,scale:l}=t,c=e._loop?"angle":t.axis;n.save(),c==="x"&&i!==o&&(ya(n,s,a.top),_a(n,{line:e,target:s,color:o,scale:l,property:c}),n.restore(),n.save(),ya(n,s,a.bottom)),_a(n,{line:e,target:s,color:i,scale:l,property:c}),n.restore()}function ya(n,t,e){const{segments:s,points:o}=t;let i=!0,a=!1;n.beginPath();for(const l of s){const{start:c,end:d}=l,h=o[c],f=o[js(c,d,o)];i?(n.moveTo(h.x,h.y),i=!1):(n.lineTo(h.x,e),n.lineTo(h.x,h.y)),a=!!t.pathSegment(n,l,{move:a}),a?n.closePath():n.lineTo(f.x,e)}n.lineTo(t.first().x,e),n.closePath(),n.clip()}function _a(n,t){const{line:e,target:s,property:o,color:i,scale:a}=t,l=pf(e,s,o);for(const{source:c,target:d,start:h,end:f}of l){const{style:{backgroundColor:u=i}={}}=c,p=s!==!0;n.save(),n.fillStyle=u,Of(n,a,p&&Ws(o,h,f)),n.beginPath();const m=!!e.pathSegment(n,c);let g;if(p){m?n.closePath():xa(n,s,f,o);const b=!!s.pathSegment(n,d,{move:m,reverse:!0});g=m&&b,g||xa(n,s,h,o)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function Of(n,t,e){const{top:s,bottom:o}=t.chart.chartArea,{property:i,start:a,end:l}=e||{};i==="x"&&(n.beginPath(),n.rect(a,s,l-a,o-s),n.clip())}function xa(n,t,e,s){const o=t.interpolate(e,s);o&&n.lineTo(o.x,o.y)}var Af={id:"filler",afterDatasetsUpdate(n,t,e){const s=(n.data.datasets||[]).length,o=[];let i,a,l,c;for(a=0;a<s;++a)i=n.getDatasetMeta(a),l=i.dataset,c=null,l&&l.options&&l instanceof Gt&&(c={visible:n.isDatasetVisible(a),index:a,fill:bf(l,a,s),chart:n,axis:i.controller.options.indexAxis,scale:i.vScale,line:l}),i.$filler=c,o.push(c);for(a=0;a<s;++a)c=o[a],!(!c||c.fill===!1)&&(c.fill=gf(o,a,e.propagate))},beforeDraw(n,t,e){const s=e.drawTime==="beforeDraw",o=n.getSortedVisibleDatasetMetas(),i=n.chartArea;for(let a=o.length-1;a>=0;--a){const l=o[a].$filler;l&&(l.line.updateControlPoints(i,l.axis),s&&l.fill&&Ys(n.ctx,l,i))}},beforeDatasetsDraw(n,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=n.getSortedVisibleDatasetMetas();for(let o=s.length-1;o>=0;--o){const i=s[o].$filler;ga(i)&&Ys(n.ctx,i,n.chartArea)}},beforeDatasetDraw(n,t,e){const s=t.meta.$filler;!ga(s)||e.drawTime!=="beforeDatasetDraw"||Ys(n.ctx,s,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ka=(n,t)=>{let{boxHeight:e=t,boxWidth:s=t}=n;return n.usePointStyle&&(e=Math.min(e,t),s=n.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},Ff=(n,t)=>n!==null&&t!==null&&n.datasetIndex===t.datasetIndex&&n.index===t.index;class wa extends Nt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=H(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,o)=>t.sort(s,o,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,o=nt(s.font),i=o.size,a=this._computeTitleHeight(),{boxWidth:l,itemHeight:c}=ka(s,i);let d,h;e.font=o.string,this.isHorizontal()?(d=this.maxWidth,h=this._fitRows(a,i,l,c)+10):(h=this.maxHeight,d=this._fitCols(a,o,l,c)+10),this.width=Math.min(d,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,o){const{ctx:i,maxWidth:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],h=o+l;let f=t;i.textAlign="left",i.textBaseline="middle";let u=-1,p=-h;return this.legendItems.forEach((m,g)=>{const b=s+e/2+i.measureText(m.text).width;(g===0||d[d.length-1]+b+2*l>a)&&(f+=h,d[d.length-(g>0?0:1)]=0,p+=h,u++),c[g]={left:0,top:p,row:u,width:b,height:o},d[d.length-1]+=b+l}),f}_fitCols(t,e,s,o){const{ctx:i,maxHeight:a,options:{labels:{padding:l}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],h=a-t;let f=l,u=0,p=0,m=0,g=0;return this.legendItems.forEach((b,_)=>{const{itemWidth:y,itemHeight:k}=Tf(s,e,i,b,o);_>0&&p+k+2*l>h&&(f+=u+l,d.push({width:u,height:p}),m+=u+l,g++,u=p=0),c[_]={left:m,top:p,col:g,width:y,height:k},u=Math.max(u,y),p+=k+l}),f+=u,d.push({width:u,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:o},rtl:i}}=this,a=Se(i,this.left,this.width);if(this.isHorizontal()){let l=0,c=at(s,this.left+o,this.right-this.lineWidths[l]);for(const d of e)l!==d.row&&(l=d.row,c=at(s,this.left+o,this.right-this.lineWidths[l])),d.top+=this.top+t+o,d.left=a.leftForLtr(a.x(c),d.width),c+=d.width+o}else{let l=0,c=at(s,this.top+t+o,this.bottom-this.columnSizes[l].height);for(const d of e)d.col!==l&&(l=d.col,c=at(s,this.top+t+o,this.bottom-this.columnSizes[l].height)),d.top=c,d.left+=this.left+o,d.left=a.leftForLtr(a.x(d.left),d.width),c+=d.height+o}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;kn(t,this),this._draw(),wn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:o}=this,{align:i,labels:a}=t,l=J.color,c=Se(t.rtl,this.left,this.width),d=nt(a.font),{padding:h}=a,f=d.size,u=f/2;let p;this.drawTitle(),o.textAlign=c.textAlign("left"),o.textBaseline="middle",o.lineWidth=.5,o.font=d.string;const{boxWidth:m,boxHeight:g,itemHeight:b}=ka(a,f),_=function(C,M,S){if(isNaN(m)||m<=0||isNaN(g)||g<0)return;o.save();const B=L(S.lineWidth,1);if(o.fillStyle=L(S.fillStyle,l),o.lineCap=L(S.lineCap,"butt"),o.lineDashOffset=L(S.lineDashOffset,0),o.lineJoin=L(S.lineJoin,"miter"),o.lineWidth=B,o.strokeStyle=L(S.strokeStyle,l),o.setLineDash(L(S.lineDash,[])),a.usePointStyle){const E={radius:g*Math.SQRT2/2,pointStyle:S.pointStyle,rotation:S.rotation,borderWidth:B},A=c.xPlus(C,m/2),N=M+u;Go(o,E,A,N,a.pointStyleWidth&&m)}else{const E=M+Math.max((f-g)/2,0),A=c.leftForLtr(C,m),N=re(S.borderRadius);o.beginPath(),Object.values(N).some(U=>U!==0)?ze(o,{x:A,y:E,w:m,h:g,radius:N}):o.rect(A,E,m,g),o.fill(),B!==0&&o.stroke()}o.restore()},y=function(C,M,S){ae(o,S.text,C,M+b/2,d,{strikethrough:S.hidden,textAlign:c.textAlign(S.textAlign)})},k=this.isHorizontal(),w=this._computeTitleHeight();k?p={x:at(i,this.left+h,this.right-s[0]),y:this.top+h+w,line:0}:p={x:this.left+h,y:at(i,this.top+w+h,this.bottom-e[0].height),line:0},ci(this.ctx,t.textDirection);const x=b+h;this.legendItems.forEach((C,M)=>{o.strokeStyle=C.fontColor,o.fillStyle=C.fontColor;const S=o.measureText(C.text).width,B=c.textAlign(C.textAlign||(C.textAlign=a.textAlign)),E=m+u+S;let A=p.x,N=p.y;c.setWidth(this.width),k?M>0&&A+E+h>this.right&&(N=p.y+=x,p.line++,A=p.x=at(i,this.left+h,this.right-s[p.line])):M>0&&N+x>this.bottom&&(A=p.x=A+e[p.line].width+h,p.line++,N=p.y=at(i,this.top+w+h,this.bottom-e[p.line].height));const U=c.x(A);if(_(U,N,C),A=ec(B,A+m+u,k?A+E:this.right,t.rtl),y(c.x(A),N,C),k)p.x+=E+h;else if(typeof C.text!="string"){const F=d.lineHeight;p.y+=Ca(C,F)+h}else p.y+=x}),di(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=nt(e.font),o=rt(e.padding);if(!e.display)return;const i=Se(t.rtl,this.left,this.width),a=this.ctx,l=e.position,c=s.size/2,d=o.top+c;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(l,f,f+u);a.textAlign=i.textAlign(bs(l)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,ae(a,e.text,p,h,s)}_computeTitleHeight(){const t=this.options.title,e=nt(t.font),s=rt(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,o,i;if(Ot(t,this.left,this.right)&&Ot(e,this.top,this.bottom)){for(i=this.legendHitBoxes,s=0;s<i.length;++s)if(o=i[s],Ot(t,o.left,o.left+o.width)&&Ot(e,o.top,o.top+o.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!Lf(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const o=this._hoveredItem,i=Ff(o,s);o&&!i&&H(e.onLeave,[t,o,this],this),this._hoveredItem=s,s&&!i&&H(e.onHover,[t,s,this],this)}else s&&H(e.onClick,[t,s,this],this)}}function Tf(n,t,e,s,o){const i=Nf(s,n,t,e),a=$f(o,s,t.lineHeight);return{itemWidth:i,itemHeight:a}}function Nf(n,t,e,s){let o=n.text;return o&&typeof o!="string"&&(o=o.reduce((i,a)=>i.length>a.length?i:a)),t+e.size/2+s.measureText(o).width}function $f(n,t,e){let s=n;return typeof t.text!="string"&&(s=Ca(t,e)),s}function Ca(n,t){const e=n.text?n.text.length:0;return t*e}function Lf(n,t){return!!((n==="mousemove"||n==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(n==="click"||n==="mouseup"))}var Rf={id:"legend",_element:wa,start(n,t,e){const s=n.legend=new wa({ctx:n.ctx,options:e,chart:n});lt.configure(n,s,e),lt.addBox(n,s)},stop(n){lt.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,t,e){const s=n.legend;lt.configure(n,s,e),s.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 s=t.datasetIndex,o=e.chart;o.isDatasetVisible(s)?(o.hide(s),t.hidden=!0):(o.show(s),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:s,textAlign:o,color:i,useBorderRadius:a,borderRadius:l}}=n.legend.options;return n._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(e?0:void 0),h=rt(d.borderWidth);return{text:t[c.index].label,fillStyle:d.backgroundColor,fontColor:i,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:d.borderColor,pointStyle:s||d.pointStyle,rotation:d.rotation,textAlign:o||d.textAlign,borderRadius:a&&(l||d.borderRadius),datasetIndex:c.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 Hs extends Nt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const o=q(s.text)?s.text.length:1;this._padding=rt(s.padding);const i=o*nt(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:o,right:i,options:a}=this,l=a.align;let c=0,d,h,f;return this.isHorizontal()?(h=at(l,s,i),f=e+t,d=i-s):(a.position==="left"?(h=s+t,f=at(l,o,e),c=X*-.5):(h=i-t,f=at(l,e,o),c=X*.5),d=o-e),{titleX:h,titleY:f,maxWidth:d,rotation:c}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=nt(e.font),i=s.lineHeight/2+this._padding.top,{titleX:a,titleY:l,maxWidth:c,rotation:d}=this._drawArgs(i);ae(t,e.text,0,0,s,{color:e.color,maxWidth:c,rotation:d,textAlign:bs(e.align),textBaseline:"middle",translation:[a,l]})}}function If(n,t){const e=new Hs({ctx:n.ctx,options:t,chart:n});lt.configure(n,e,t),lt.addBox(n,e),n.titleBlock=e}var zf={id:"title",_element:Hs,start(n,t,e){If(n,e)},stop(n){const t=n.titleBlock;lt.removeBox(n,t),delete n.titleBlock},beforeUpdate(n,t,e){const s=n.titleBlock;lt.configure(n,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const jn=new WeakMap;var Wf={id:"subtitle",start(n,t,e){const s=new Hs({ctx:n.ctx,options:e,chart:n});lt.configure(n,s,e),lt.addBox(n,s),jn.set(n,s)},stop(n){lt.removeBox(n,jn.get(n)),jn.delete(n)},beforeUpdate(n,t,e){const s=jn.get(n);lt.configure(n,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Qe={average(n){if(!n.length)return!1;let t,e,s=0,o=0,i=0;for(t=0,e=n.length;t<e;++t){const a=n[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s+=l.x,o+=l.y,++i}}return{x:s/i,y:o/i}},nearest(n,t){if(!n.length)return!1;let e=t.x,s=t.y,o=Number.POSITIVE_INFINITY,i,a,l;for(i=0,a=n.length;i<a;++i){const c=n[i].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),h=ms(t,d);h<o&&(o=h,l=c)}}if(l){const c=l.tooltipPosition();e=c.x,s=c.y}return{x:e,y:s}}};function Dt(n,t){return t&&(q(t)?Array.prototype.push.apply(n,t):n.push(t)),n}function Lt(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
24
24
  `)>-1?n.split(`
25
- `):n}function Mf(n,t){const{element:e,datasetIndex:s,index:o}=t,i=n.getDatasetMeta(s).controller,{label:a,value:l}=i.getLabelAndValue(o);return{chart:n,label:a,parsed:i.getParsed(o),raw:n.data.datasets[s].data[o],formattedValue:l,dataset:i.getDataset(),dataIndex:o,datasetIndex:s,element:e}}function ma(n,t){const e=n.chart.ctx,{body:s,footer:o,title:i}=n,{boxWidth:a,boxHeight:l}=t,c=nt(t.bodyFont),d=nt(t.titleFont),h=nt(t.footerFont),f=i.length,u=o.length,p=s.length,m=rt(t.padding);let g=m.height,b=0,_=s.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(_+=n.beforeBody.length+n.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),_){const w=t.displayColors?Math.max(l,c.lineHeight):c.lineHeight;g+=p*w+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const k=function(w){b=Math.max(b,e.measureText(w).width+y)};return e.save(),e.font=d.string,Y(n.title,k),e.font=c.string,Y(n.beforeBody.concat(n.afterBody),k),y=t.displayColors?a+2+t.boxPadding:0,Y(s,w=>{Y(w.before,k),Y(w.lines,k),Y(w.after,k)}),y=0,e.font=h.string,Y(n.footer,k),e.restore(),b+=m.width,{width:b,height:g}}function Sf(n,t){const{y:e,height:s}=t;return e<s/2?"top":e>n.height-s/2?"bottom":"center"}function Df(n,t,e,s){const{x:o,width:i}=s,a=e.caretSize+e.caretPadding;if(n==="left"&&o+i+a>t.width||n==="right"&&o-i-a<0)return!0}function Bf(n,t,e,s){const{x:o,width:i}=e,{width:a,chartArea:{left:l,right:c}}=n;let d="center";return s==="center"?d=o<=(l+c)/2?"left":"right":o<=i/2?d="left":o>=a-i/2&&(d="right"),Df(d,n,t,e)&&(d="center"),d}function ga(n,t,e){const s=e.yAlign||t.yAlign||Sf(n,e);return{xAlign:e.xAlign||t.xAlign||Bf(n,t,e,s),yAlign:s}}function vf(n,t){let{x:e,width:s}=n;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Ef(n,t,e){let{y:s,height:o}=n;return t==="top"?s+=e:t==="bottom"?s-=o+e:s-=o/2,s}function ba(n,t,e,s){const{caretSize:o,caretPadding:i,cornerRadius:a}=n,{xAlign:l,yAlign:c}=e,d=o+i,{topLeft:h,topRight:f,bottomLeft:u,bottomRight:p}=re(a);let m=vf(t,l);const g=Ef(t,c,d);return c==="center"?l==="left"?m+=d:l==="right"&&(m-=d):l==="left"?m-=Math.max(h,u)+o:l==="right"&&(m+=Math.max(f,p)+o),{x:ot(m,0,s.width-t.width),y:ot(g,0,s.height-t.height)}}function Wn(n,t,e){const s=rt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-s.right:n.x+s.left}function ya(n){return vt([],Rt(n))}function Vf(n,t,e){return Kt(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function _a(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const xa={beforeTitle:At,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:At,beforeBody:At,beforeLabel:At,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:At,afterBody:At,beforeFooter:At,footer:At,afterFooter:At};function dt(n,t,e,s){const o=n[t].call(e,s);return typeof o>"u"?xa[t].call(e,s):o}class Is extends $t{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),o=s.enabled&&e.options.animation&&s.animations,i=new ci(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=Vf(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,o=dt(s,"beforeTitle",this,t),i=dt(s,"title",this,t),a=dt(s,"afterTitle",this,t);let l=[];return l=vt(l,Rt(o)),l=vt(l,Rt(i)),l=vt(l,Rt(a)),l}getBeforeBody(t,e){return ya(dt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,o=[];return Y(t,i=>{const a={before:[],lines:[],after:[]},l=_a(s,i);vt(a.before,Rt(dt(l,"beforeLabel",this,i))),vt(a.lines,dt(l,"label",this,i)),vt(a.after,Rt(dt(l,"afterLabel",this,i))),o.push(a)}),o}getAfterBody(t,e){return ya(dt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,o=dt(s,"beforeFooter",this,t),i=dt(s,"footer",this,t),a=dt(s,"afterFooter",this,t);let l=[];return l=vt(l,Rt(o)),l=vt(l,Rt(i)),l=vt(l,Rt(a)),l}_createItems(t){const e=this._active,s=this.chart.data,o=[],i=[],a=[];let l=[],c,d;for(c=0,d=e.length;c<d;++c)l.push(Mf(this.chart,e[c]));return t.filter&&(l=l.filter((h,f,u)=>t.filter(h,f,u,s))),t.itemSort&&(l=l.sort((h,f)=>t.itemSort(h,f,s))),Y(l,h=>{const f=_a(t.callbacks,h);o.push(dt(f,"labelColor",this,h)),i.push(dt(f,"labelPointStyle",this,h)),a.push(dt(f,"labelTextColor",this,h))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const s=this.options.setContext(this.getContext()),o=this._active;let i,a=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const l=Je[s.position].call(this,o,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);const c=this._size=ma(this,s),d=Object.assign({},l,c),h=ga(this.chart,s,d),f=ba(s,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,i={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,o){const i=this.getCaretPosition(t,s,o);e.lineTo(i.x1,i.y1),e.lineTo(i.x2,i.y2),e.lineTo(i.x3,i.y3)}getCaretPosition(t,e,s){const{xAlign:o,yAlign:i}=this,{caretSize:a,cornerRadius:l}=s,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:f}=re(l),{x:u,y:p}=t,{width:m,height:g}=e;let b,_,y,k,w,x;return i==="center"?(w=p+g/2,o==="left"?(b=u,_=b-a,k=w+a,x=w-a):(b=u+m,_=b+a,k=w-a,x=w+a),y=b):(o==="left"?_=u+Math.max(c,h)+a:o==="right"?_=u+m-Math.max(d,f)-a:_=this.caretX,i==="top"?(k=p,w=k-a,b=_-a,y=_+a):(k=p+g,w=k+a,b=_+a,y=_-a),x=k),{x1:b,x2:_,x3:y,y1:k,y2:w,y3:x}}drawTitle(t,e,s){const o=this.title,i=o.length;let a,l,c;if(i){const d=Me(s.rtl,this.x,this.width);for(t.x=Wn(this,s.titleAlign,s),e.textAlign=d.textAlign(s.titleAlign),e.textBaseline="middle",a=nt(s.titleFont),l=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,c=0;c<i;++c)e.fillText(o[c],d.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,c+1===i&&(t.y+=s.titleMarginBottom-l)}}_drawColorBox(t,e,s,o,i){const a=this.labelColors[s],l=this.labelPointStyles[s],{boxHeight:c,boxWidth:d}=i,h=nt(i.bodyFont),f=Wn(this,"left",i),u=o.x(f),p=c<h.lineHeight?(h.lineHeight-c)/2:0,m=e.y+p;if(i.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=o.leftForLtr(u,d)+d/2,_=m+c/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,bs(t,g,b,_),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,bs(t,g,b,_)}else{t.lineWidth=z(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=o.leftForLtr(u,d),b=o.leftForLtr(o.xPlus(u,1),d-2),_=re(a.borderRadius);Object.values(_).some(y=>y!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,ze(t,{x:g,y:m,w:d,h:c,radius:_}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ze(t,{x:b,y:m+1,w:d-2,h:c-2,radius:_}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(g,m,d,c),t.strokeRect(g,m,d,c),t.fillStyle=a.backgroundColor,t.fillRect(b,m+1,d-2,c-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:o}=this,{bodySpacing:i,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:h}=s,f=nt(s.bodyFont);let u=f.lineHeight,p=0;const m=Me(s.rtl,this.x,this.width),g=function(M){e.fillText(M,m.x(t.x+p),t.y+u/2),t.y+=u+i},b=m.textAlign(a);let _,y,k,w,x,C,S;for(e.textAlign=a,e.textBaseline="middle",e.font=f.string,t.x=Wn(this,b,s),e.fillStyle=s.bodyColor,Y(this.beforeBody,g),p=l&&b!=="right"?a==="center"?d/2+h:d+2+h:0,w=0,C=o.length;w<C;++w){for(_=o[w],y=this.labelTextColors[w],e.fillStyle=y,Y(_.before,g),k=_.lines,l&&k.length&&(this._drawColorBox(e,t,w,m,s),u=Math.max(f.lineHeight,c)),x=0,S=k.length;x<S;++x)g(k[x]),u=f.lineHeight;Y(_.after,g)}p=0,u=f.lineHeight,Y(this.afterBody,g),t.y-=i}drawFooter(t,e,s){const o=this.footer,i=o.length;let a,l;if(i){const c=Me(s.rtl,this.x,this.width);for(t.x=Wn(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=c.textAlign(s.footerAlign),e.textBaseline="middle",a=nt(s.footerFont),e.fillStyle=s.footerColor,e.font=a.string,l=0;l<i;++l)e.fillText(o[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,e,s,o){const{xAlign:i,yAlign:a}=this,{x:l,y:c}=t,{width:d,height:h}=s,{topLeft:f,topRight:u,bottomLeft:p,bottomRight:m}=re(o.cornerRadius);e.fillStyle=o.backgroundColor,e.strokeStyle=o.borderColor,e.lineWidth=o.borderWidth,e.beginPath(),e.moveTo(l+f,c),a==="top"&&this.drawCaret(t,e,s,o),e.lineTo(l+d-u,c),e.quadraticCurveTo(l+d,c,l+d,c+u),a==="center"&&i==="right"&&this.drawCaret(t,e,s,o),e.lineTo(l+d,c+h-m),e.quadraticCurveTo(l+d,c+h,l+d-m,c+h),a==="bottom"&&this.drawCaret(t,e,s,o),e.lineTo(l+p,c+h),e.quadraticCurveTo(l,c+h,l,c+h-p),a==="center"&&i==="left"&&this.drawCaret(t,e,s,o),e.lineTo(l,c+f),e.quadraticCurveTo(l,c,l+f,c),e.closePath(),e.fill(),o.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,o=s&&s.x,i=s&&s.y;if(o||i){const a=Je[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=ma(this,t),c=Object.assign({},a,this._size),d=ga(e,t,c),h=ba(t,c,d,e);(o._to!==h.x||i._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.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 s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const a=rt(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=s,this.drawBackground(i,t,o,e),ti(t,e.textDirection),i.y+=a.top,this.drawTitle(i,t,e),this.drawBody(i,t,e),this.drawFooter(i,t,e),ei(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,o=t.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),i=!un(s,o),a=this._positionChanged(o,e);(i||a)&&(this._active=o,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],a=this._getActiveElements(t,i,e,s),l=this._positionChanged(a,t),c=e||!un(a,i)||l;return c&&(this._active=a,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),c}_getActiveElements(t,e,s,o){const i=this.options;if(t.type==="mouseout")return[];if(!o)return e;const a=this.chart.getElementsAtEventForMode(t,i.mode,i,s);return i.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:s,caretY:o,options:i}=this,a=Je[i.position].call(this,t,e);return a!==!1&&(s!==a.x||o!==a.y)}}P(Is,"positioners",Je);var Pf={id:"tooltip",_element:Is,positioners:Je,afterInit(n,t,e){e&&(n.tooltip=new Is({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:xa},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"]},Af=Object.freeze({__proto__:null,Colors:Yh,Decimation:Xh,Filler:pf,Legend:xf,SubTitle:Cf,Title:wf,Tooltip:Pf});const Of=(n,t,e,s)=>(typeof t=="string"?(e=n.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Ff(n,t,e,s){const o=n.indexOf(t);if(o===-1)return Of(n,t,e,s);const i=n.lastIndexOf(t);return o!==i?e:o}const Tf=(n,t)=>n===null?null:ot(Math.round(n),0,t);function ka(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class Ws extends ue{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:o,label:i}of e)s[o]===i&&s.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(I(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Ff(s,t,L(e,t),this._addedLabels),Tf(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(o=this.getLabels().length-1)),this.min=s,this.max=o}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,o=[];let i=this.getLabels();i=t===0&&e===i.length-1?i:i.slice(t,e+1),this._valueRange=Math.max(i.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=e;a++)o.push({value:a});return o}getLabelForValue(t){return ka.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}}P(Ws,"id","category"),P(Ws,"defaults",{ticks:{callback:ka}});function Nf(n,t){const e=[],{bounds:o,step:i,min:a,max:l,precision:c,count:d,maxTicks:h,maxDigits:f,includeBounds:u}=n,p=i||1,m=h-1,{min:g,max:b}=t,_=!I(a),y=!I(l),k=!I(d),w=(b-g)/(f+1);let x=Mo((b-g)/m/p)*p,C,S,M,v;if(x<1e-14&&!_&&!y)return[{value:g},{value:b}];v=Math.ceil(b/x)-Math.floor(g/x),v>m&&(x=Mo(v*x/m/p)*p),I(c)||(C=Math.pow(10,c),x=Math.ceil(x*C)/C),o==="ticks"?(S=Math.floor(g/x)*x,M=Math.ceil(b/x)*x):(S=g,M=b),_&&y&&i&&El((l-a)/i,x/1e3)?(v=Math.round(Math.min((l-a)/x,h)),x=(l-a)/v,S=a,M=l):k?(S=_?a:S,M=y?l:M,v=d-1,x=(M-S)/v):(v=(M-S)/x,Te(v,Math.round(v),x/1e3)?v=Math.round(v):v=Math.ceil(v));const E=Math.max(Do(x),Do(S));C=Math.pow(10,I(c)?E:c),S=Math.round(S*C)/C,M=Math.round(M*C)/C;let O=0;for(_&&(u&&S!==a?(e.push({value:a}),S<a&&O++,Te(Math.round((S+O*x)*C)/C,a,wa(a,w,n))&&O++):S<a&&O++);O<v;++O){const N=Math.round((S+O*x)*C)/C;if(y&&N>l)break;e.push({value:N})}return y&&u&&M!==l?e.length&&Te(e[e.length-1].value,l,wa(l,w,n))?e[e.length-1].value=l:e.push({value:l}):(!y||M===l)&&e.push({value:M}),e}function wa(n,t,{horizontal:e,minRotation:s}){const o=Mt(s),i=(e?Math.sin(o):Math.cos(o))||.001,a=.75*t*(""+n).length;return Math.min(t/i,a)}class Yn extends ue{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:s}=this.getUserBounds();let{min:o,max:i}=this;const a=c=>o=e?o:c,l=c=>i=s?i:c;if(t){const c=Dt(o),d=Dt(i);c<0&&d<0?l(0):c>0&&d>0&&a(0)}if(o===i){let c=i===0?1:Math.abs(i*.05);l(i+c),t||a(o-c)}this.min=o,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,o;return s?(o=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),e=e||11),e&&(o=Math.min(e,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const o={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},i=this._range||this,a=Nf(o,i);return t.bounds==="ticks"&&So(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const o=(s-e)/Math.max(t.length-1,1)/2;e-=o,s+=o}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return Le(t,this.chart.options.locale,this.options.ticks.format)}}class Ys extends Yn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?t:0,this.max=Z(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=Mt(this.options.ticks.minRotation),o=(t?Math.sin(s):Math.cos(s))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,i.lineHeight/o))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(Ys,"id","linear"),P(Ys,"defaults",{ticks:{callback:bn.formatters.numeric}});const Qe=n=>Math.floor(qt(n)),pe=(n,t)=>Math.pow(10,Qe(n)+t);function Ca(n){return n/Math.pow(10,Qe(n))===1}function Ma(n,t,e){const s=Math.pow(10,e),o=Math.floor(n/s);return Math.ceil(t/s)-o}function $f(n,t){const e=t-n;let s=Qe(e);for(;Ma(n,t,s)>10;)s++;for(;Ma(n,t,s)<10;)s--;return Math.min(s,Qe(n))}function Lf(n,{min:t,max:e}){t=mt(n.min,t);const s=[],o=Qe(t);let i=$f(t,e),a=i<0?Math.pow(10,Math.abs(i)):1;const l=Math.pow(10,i),c=o>i?Math.pow(10,o):0,d=Math.round((t-c)*a)/a,h=Math.floor((t-c)/l/10)*l*10;let f=Math.floor((d-h)/Math.pow(10,i)),u=mt(n.min,Math.round((c+h+f*Math.pow(10,i))*a)/a);for(;u<e;)s.push({value:u,major:Ca(u),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(i++,f=2,a=i>=0?1:a),u=Math.round((c+h+f*Math.pow(10,i))*a)/a;const p=mt(n.max,u);return s.push({value:p,major:Ca(p),significand:f}),s}class js extends ue{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const s=Yn.prototype.parse.apply(this,[t,e]);if(s===0){this._zero=!0;return}return Z(s)&&s>0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?Math.max(0,t):null,this.max=Z(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Z(this._userMin)&&(this.min=t===pe(this.min,0)?pe(this.min,-1):pe(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,o=this.max;const i=l=>s=t?s:l,a=l=>o=e?o:l;s===o&&(s<=0?(i(1),a(10)):(i(pe(s,-1)),a(pe(o,1)))),s<=0&&i(pe(o,-1)),o<=0&&a(pe(s,1)),this.min=s,this.max=o}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=Lf(e,this);return t.bounds==="ticks"&&So(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":Le(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=qt(t),this._valueRange=qt(this.max)-qt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(qt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(js,"id","logarithmic"),P(js,"defaults",{ticks:{callback:bn.formatters.logarithmic,major:{enabled:!0}}});function Hs(n){const t=n.ticks;if(t.display&&n.display){const e=rt(t.backdropPadding);return L(t.font&&t.font.size,J.font.size)+e.height}return 0}function Rf(n,t,e){return e=X(e)?e:[e],{w:Ul(n,t.string,e),h:e.length*t.lineHeight}}function Sa(n,t,e,s,o){return n===s||n===o?{start:t-e/2,end:t+e/2}:n<s||n>o?{start:t-e,end:t}:{start:t,end:t+e}}function zf(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),s=[],o=[],i=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?q/i:0;for(let c=0;c<i;c++){const d=a.setContext(n.getPointLabelContext(c));o[c]=d.padding;const h=n.getPointPosition(c,n.drawingArea+o[c],l),f=nt(d.font),u=Rf(n.ctx,f,n._pointLabels[c]);s[c]=u;const p=gt(n.getIndexAngle(c)+l),m=Math.round(cs(p)),g=Sa(m,h.x,u.w,0,180),b=Sa(m,h.y,u.h,90,270);If(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=jf(n,s,o)}function If(n,t,e,s,o){const i=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let l=0,c=0;s.start<t.l?(l=(t.l-s.start)/i,n.l=Math.min(n.l,t.l-l)):s.end>t.r&&(l=(s.end-t.r)/i,n.r=Math.max(n.r,t.r+l)),o.start<t.t?(c=(t.t-o.start)/a,n.t=Math.min(n.t,t.t-c)):o.end>t.b&&(c=(o.end-t.b)/a,n.b=Math.max(n.b,t.b+c))}function Wf(n,t,e){const s=n.drawingArea,{extra:o,additionalAngle:i,padding:a,size:l}=e,c=n.getPointPosition(t,s+o+a,i),d=Math.round(cs(gt(c.angle+tt))),h=Xf(c.y,l.h,d),f=Hf(d),u=Uf(c.x,l.w,f);return{visible:!0,x:c.x,y:h,textAlign:f,left:u,top:h,right:u+l.w,bottom:h+l.h}}function Yf(n,t){if(!t)return!0;const{left:e,top:s,right:o,bottom:i}=n;return!(Tt({x:e,y:s},t)||Tt({x:e,y:i},t)||Tt({x:o,y:s},t)||Tt({x:o,y:i},t))}function jf(n,t,e){const s=[],o=n._pointLabels.length,i=n.options,{centerPointLabels:a,display:l}=i.pointLabels,c={extra:Hs(i)/2,additionalAngle:a?q/o:0};let d;for(let h=0;h<o;h++){c.padding=e[h],c.size=t[h];const f=Wf(n,h,c);s.push(f),l==="auto"&&(f.visible=Yf(f,d),f.visible&&(d=f))}return s}function Hf(n){return n===0||n===180?"center":n<180?"left":"right"}function Uf(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function Xf(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function qf(n,t,e){const{left:s,top:o,right:i,bottom:a}=e,{backdropColor:l}=t;if(!I(l)){const c=re(t.borderRadius),d=rt(t.backdropPadding);n.fillStyle=l;const h=s-d.left,f=o-d.top,u=i-s+d.width,p=a-o+d.height;Object.values(c).some(m=>m!==0)?(n.beginPath(),ze(n,{x:h,y:f,w:u,h:p,radius:c}),n.fill()):n.fillRect(h,f,u,p)}}function Kf(n,t){const{ctx:e,options:{pointLabels:s}}=n;for(let o=t-1;o>=0;o--){const i=n._pointLabelItems[o];if(!i.visible)continue;const a=s.setContext(n.getPointLabelContext(o));qf(e,a,i);const l=nt(a.font),{x:c,y:d,textAlign:h}=i;ae(e,n._pointLabels[o],c,d+l.lineHeight/2,l,{color:a.color,textAlign:h,textBaseline:"middle"})}}function Da(n,t,e,s){const{ctx:o}=n;if(e)o.arc(n.xCenter,n.yCenter,t,0,K);else{let i=n.getPointPosition(0,t);o.moveTo(i.x,i.y);for(let a=1;a<s;a++)i=n.getPointPosition(a,t),o.lineTo(i.x,i.y)}}function Gf(n,t,e,s,o){const i=n.ctx,a=t.circular,{color:l,lineWidth:c}=t;!a&&!s||!l||!c||e<0||(i.save(),i.strokeStyle=l,i.lineWidth=c,i.setLineDash(o.dash),i.lineDashOffset=o.dashOffset,i.beginPath(),Da(n,e,a,s),i.closePath(),i.stroke(),i.restore())}function Zf(n,t,e){return Kt(n,{label:e,index:t,type:"pointLabel"})}class tn extends Yn{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=rt(Hs(this.options)/2),e=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(e,s)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Z(t)&&!isNaN(t)?t:0,this.max=Z(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Hs(this.options))}generateTickLabels(t){Yn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{const o=H(this.options.pointLabels.callback,[e,s],this);return o||o===0?o:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?zf(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,o){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,o))}getIndexAngle(t){const e=K/(this._pointLabels.length||1),s=this.options.startAngle||0;return gt(t*e+Mt(s))}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 s=e[t];return Zf(this.getContext(),t,s)}}getPointPosition(t,e,s=0){const o=this.getIndexAngle(t)-tt+s;return{x:Math.cos(o)*e+this.xCenter,y:Math.sin(o)*e+this.yCenter,angle:o}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:s,right:o,bottom:i}=this._pointLabelItems[t];return{left:e,top:s,right:o,bottom:i}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const s=this.ctx;s.save(),s.beginPath(),Da(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:s,grid:o,border:i}=e,a=this._pointLabels.length;let l,c,d;if(e.pointLabels.display&&Kf(this,a),o.display&&this.ticks.forEach((h,f)=>{if(f!==0){c=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(f),p=o.setContext(u),m=i.setContext(u);Gf(this,p,c,a,m)}}),s.display){for(t.save(),l=a-1;l>=0;l--){const h=s.setContext(this.getPointLabelContext(l)),{color:f,lineWidth:u}=h;!u||!f||(t.lineWidth=u,t.strokeStyle=f,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,c=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),d=this.getPointPosition(l,c),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,s=e.ticks;if(!s.display)return;const o=this.getIndexAngle(0);let i,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&!e.reverse)return;const d=s.setContext(this.getContext(c)),h=nt(d.font);if(i=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const f=rt(d.backdropPadding);t.fillRect(-a/2-f.left,-i-h.size/2-f.top,a+f.width,h.size+f.height)}ae(t,l.label,0,-i,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}P(tn,"id","radialLinear"),P(tn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:bn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(tn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(tn,"descriptors",{angleLines:{_fallback:"grid"}});const jn={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}},ht=Object.keys(jn);function Ba(n,t){return n-t}function va(n,t){if(I(t))return null;const e=n._adapter,{parser:s,round:o,isoWeekday:i}=n._parseOpts;let a=t;return typeof s=="function"&&(a=s(a)),Z(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(o&&(a=o==="week"&&(ke(i)||i===!0)?e.startOf(a,"isoWeek",i):e.startOf(a,o)),+a)}function Ea(n,t,e,s){const o=ht.length;for(let i=ht.indexOf(n);i<o-1;++i){const a=jn[ht[i]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=s)return ht[i]}return ht[o-1]}function Jf(n,t,e,s,o){for(let i=ht.length-1;i>=ht.indexOf(e);i--){const a=ht[i];if(jn[a].common&&n._adapter.diff(o,s,a)>=t-1)return a}return ht[e?ht.indexOf(e):0]}function Qf(n){for(let t=ht.indexOf(n)+1,e=ht.length;t<e;++t)if(jn[ht[t]].common)return ht[t]}function Va(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:s,hi:o}=hs(e,t),i=e[s]>=t?e[s]:e[o];n[i]=!0}}function tu(n,t,e,s){const o=n._adapter,i=+o.startOf(t[0].value,s),a=t[t.length-1].value;let l,c;for(l=i;l<=a;l=+o.add(l,1,s))c=e[l],c>=0&&(t[c].major=!0);return t}function Pa(n,t,e){const s=[],o={},i=t.length;let a,l;for(a=0;a<i;++a)l=t[a],o[l]=a,s.push({value:l,major:!1});return i===0||!e?s:tu(n,s,o,e)}class en extends ue{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),o=this._adapter=new ld._date(t.adapters.date);o.init(e),Oe(s.displayFormats,o.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:va(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:o,max:i,minDefined:a,maxDefined:l}=this.getUserBounds();function c(d){!a&&!isNaN(d.min)&&(o=Math.min(o,d.min)),!l&&!isNaN(d.max)&&(i=Math.max(i,d.max))}(!a||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),o=Z(o)&&!isNaN(o)?o:+e.startOf(Date.now(),s),i=Z(i)&&!isNaN(i)?i:+e.endOf(Date.now(),s)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,o=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const i=this.min,a=this.max,l=Ol(o,i,a);return this._unit=e.unit||(s.autoSkip?Ea(e.minUnit,this.min,this.max,this._getLabelCapacity(i)):Jf(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:Qf(this._unit),this.initOffsets(o),t.reverse&&l.reverse(),Pa(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,o,i;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?e=1-o:e=(this.getDecimalForValue(t[1])-o)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?s=i:s=(i-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=ot(e,0,a),s=ot(s,0,a),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,o=this.options,i=o.time,a=i.unit||Ea(i.minUnit,e,s,this._getLabelCapacity(e)),l=L(o.ticks.stepSize,1),c=a==="week"?i.isoWeekday:!1,d=ke(c)||c===!0,h={};let f=e,u,p;if(d&&(f=+t.startOf(f,"isoWeek",c)),f=+t.startOf(f,d?"day":a),t.diff(s,e,a)>1e5*l)throw new Error(e+" and "+s+" are too far apart with stepSize of "+l+" "+a);const m=o.ticks.source==="data"&&this.getDataTimestamps();for(u=f,p=0;u<s;u=+t.add(u,l,a),p++)Va(h,u,m);return(u===s||o.bounds==="ticks"||p===1)&&Va(h,u,m),Object.keys(h).sort(Ba).map(g=>+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const o=this.options.time.displayFormats,i=this._unit,a=e||o[i];return this._adapter.format(t,a)}_tickFormatFunction(t,e,s,o){const i=this.options,a=i.ticks.callback;if(a)return H(a,[t,e,s],this);const l=i.time.displayFormats,c=this._unit,d=this._majorUnit,h=c&&l[c],f=d&&l[d],u=s[e],p=d&&f&&u&&u.major;return this._adapter.format(t,o||(p?f:h))}generateTickLabels(t){let e,s,o;for(e=0,s=t.length;e<s;++e)o=t[e],o.label=this._tickFormatFunction(o.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,o=Mt(this.isHorizontal()?e.maxRotation:e.minRotation),i=Math.cos(o),a=Math.sin(o),l=this._resolveTickFontOptions(0).size;return{w:s*i+l*a,h:s*a+l*i}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,o=s[e.unit]||s.millisecond,i=this._tickFormatFunction(t,0,Pa(this,[t],this._majorUnit),o),a=this._getLabelSize(i),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(e=0,s=o.length;e<s;++e)t=t.concat(o[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const o=this.getLabels();for(e=0,s=o.length;e<s;++e)t.push(va(this,o[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Vo(t.sort(Ba))}}P(en,"id","time"),P(en,"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 Hn(n,t,e){let s=0,o=n.length-1,i,a,l,c;e?(t>=n[s].pos&&t<=n[o].pos&&({lo:s,hi:o}=Ft(n,"pos",t)),{pos:i,time:l}=n[s],{pos:a,time:c}=n[o]):(t>=n[s].time&&t<=n[o].time&&({lo:s,hi:o}=Ft(n,"time",t)),{time:i,pos:l}=n[s],{time:a,pos:c}=n[o]);const d=a-i;return d?l+(c-l)*(t-i)/d:l}class Us extends en{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=Hn(e,this.min),this._tableRange=Hn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,o=[],i=[];let a,l,c,d,h;for(a=0,l=t.length;a<l;++a)d=t[a],d>=e&&d<=s&&o.push(d);if(o.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(a=0,l=o.length;a<l;++a)h=o[a+1],c=o[a-1],d=o[a],Math.round((h+c)/2)!==d&&i.push({time:d,pos:a/(l-1)});return i}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((o,i)=>o-i)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Hn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Hn(this._table,s*this._tableRange+this._minPos,!0)}}P(Us,"id","timeseries"),P(Us,"defaults",en.defaults);var eu=Object.freeze({__proto__:null,CategoryScale:Ws,LinearScale:Ys,LogarithmicScale:js,RadialLinearScale:tn,TimeScale:en,TimeSeriesScale:Us});const nu=[rd,$h,Af,eu];Lt.register(...nu);const su={class:"px-24 py-16"},ou={class:"flex flex-col gap-8"},iu={class:"fm-color-typo-primary fm-typo-body-lg-400"},au={class:"fm-color-typo-secondary fm-typo-body-md-400"},ru=r.defineComponent({__name:"FmLine",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{}},setup(n){const t=n,e=r.ref(null);let s=null;r.watch([()=>t.xAxis,()=>t.datasets],()=>{s&&(s.data.datasets=t.datasets,s.data.labels=t.xAxis.categories,s.update())});function o(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 i(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,o(h,.5)),p.addColorStop(1,o(h,0)),p}const l=r.computed(()=>({labels:t.xAxis.categories,datasets:t.datasets.map(d=>{const h=i(d.color)??"";return{...d,backgroundColor:h?f=>a({context:f,color:h}):"",borderColor:h,borderDash:d.dash?[5,5]:void 0,tension:.1}})}));function c(){e.value&&(s=new Lt(e.value,{type:"line",data:l.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 r.onMounted(()=>{c()}),(d,h)=>(r.openBlock(),r.createElementBlock("div",su,[r.createElementVNode("div",ou,[r.createElementVNode("div",iu,r.toDisplayString(d.name),1),r.createElementVNode("div",au,r.toDisplayString(d.paragraph),1)]),r.createElementVNode("canvas",{ref_key:"canvas",ref:e},null,512)]))}});function lu(){var n;return(n=r.getCurrentInstance())==null?void 0:n.emit}function bt(n,t){const e=lu(),s=r.ref(n[t]);return r.watch(()=>n[t],()=>{s.value=n[t]}),r.computed({get(){return s.value},set(i){s.value=i,e==null||e(`update:${t}`,i)}})}function ft(n,t){return typeof n!="object"&&typeof t!="object"?n===t:Object.keys(n).length!==Object.keys(t).length?!1:Object.keys(n).every(e=>ft(n[e],t[e]))}const cu={class:"fm-checkbox"},du={class:"fm-checkbox--wrapper"},hu={class:"fm-checkbox__input--container"},fu=["checked","disabled","indeterminate"],uu={key:0,class:"fm-checkbox__label-container"},pu={class:"fm-typo-body-lg-400"},mu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Aa=r.defineComponent({__name:"FmCheckbox",props:{modelValue:{type:[Boolean,Array]},label:{},sublabel:{default:""},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},value:{}},emits:["update:modelValue","update:indeterminate"],setup(n){const t=n,e=bt(t,"modelValue"),s=bt(t,"indeterminate"),o=Array.isArray(e.value),i=r.ref(o?e.value.some(c=>ft(c,t.value)):e.value),a=r.computed(()=>{const c=o?e.value.some(d=>ft(d,t.value)):e.value;return s.value&&!c?"remove":e.value?"check_small":""});function l(){if(t.disabled)return;s.value=!1,i.value=!i.value;let c=e.value;o?c=i.value?c.concat(t.value):c.filter(d=>!ft(d,t.value)):c=i.value,e.value=c}return r.watch(()=>e.value,()=>{i.value=o?e.value.some(c=>ft(c,t.value)):e.value}),(c,d)=>(r.openBlock(),r.createElementBlock("div",cu,[r.createElementVNode("label",du,[r.createElementVNode("div",hu,[r.createElementVNode("input",{class:r.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":i.value}),type:"checkbox",checked:i.value,disabled:t.disabled,indeterminate:r.unref(s),onClick:l},null,10,fu),r.unref(s)||i.value?(r.openBlock(),r.createBlock(R,{key:0,class:"fm-checkbox__input--checkmark",name:a.value,size:"md",color:"#FFFFFF"},null,8,["name"])):r.createCommentVNode("",!0)]),t.label?(r.openBlock(),r.createElementBlock("div",uu,[r.renderSlot(c.$slots,"label"),r.createElementVNode("div",pu,r.toDisplayString(t.label),1),t.sublabel?(r.openBlock(),r.createElementBlock("div",mu,r.toDisplayString(t.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)])]))}}),Tg="";var gu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Oa={exports:{}};(function(n,t){(function(e,s){n.exports=s()})(gu,function(){var e=1e3,s=6e4,o=36e5,i="millisecond",a="second",l="minute",c="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{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var B=["th","st","nd","rd"],D=F%100;return"["+F+(B[(D-20)%10]||B[D]||B[0])+"]"}},k=function(F,B,D){var V=String(F);return!V||V.length>=B?F:""+Array(B+1-V.length).join(D)+F},w={s:k,z:function(F){var B=-F.utcOffset(),D=Math.abs(B),V=Math.floor(D/60),A=D%60;return(B<=0?"+":"-")+k(V,2,"0")+":"+k(A,2,"0")},m:function F(B,D){if(B.date()<D.date())return-F(D,B);var V=12*(D.year()-B.year())+(D.month()-B.month()),A=B.clone().add(V,f),T=D-A<0,$=B.clone().add(V+(T?-1:1),f);return+(-(V+(D-A)/(T?A-$:$-A))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:f,y:p,w:h,d,D:m,h:c,m:l,s:a,ms:i,Q:u}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},x="en",C={};C[x]=y;var S="$isDayjsObject",M=function(F){return F instanceof N||!(!F||!F[S])},v=function F(B,D,V){var A;if(!B)return x;if(typeof B=="string"){var T=B.toLowerCase();C[T]&&(A=T),D&&(C[T]=D,A=T);var $=B.split("-");if(!A&&$.length>1)return F($[0])}else{var W=B.name;C[W]=B,A=W}return!V&&A&&(x=A),A||!V&&x},E=function(F,B){if(M(F))return F.clone();var D=typeof B=="object"?B:{};return D.date=F,D.args=arguments,new N(D)},O=w;O.l=v,O.i=M,O.w=function(F,B){return E(F,{locale:B.$L,utc:B.$u,x:B.$x,$offset:B.$offset})};var N=function(){function F(D){this.$L=v(D.locale,null,!0),this.parse(D),this.$x=this.$x||D.x||{},this[S]=!0}var B=F.prototype;return B.parse=function(D){this.$d=function(V){var A=V.date,T=V.utc;if(A===null)return new Date(NaN);if(O.u(A))return new Date;if(A instanceof Date)return new Date(A);if(typeof A=="string"&&!/Z$/i.test(A)){var $=A.match(b);if($){var W=$[2]-1||0,j=($[7]||"0").substring(0,3);return T?new Date(Date.UTC($[1],W,$[3]||1,$[4]||0,$[5]||0,$[6]||0,j)):new Date($[1],W,$[3]||1,$[4]||0,$[5]||0,$[6]||0,j)}}return new Date(A)}(D),this.init()},B.init=function(){var D=this.$d;this.$y=D.getFullYear(),this.$M=D.getMonth(),this.$D=D.getDate(),this.$W=D.getDay(),this.$H=D.getHours(),this.$m=D.getMinutes(),this.$s=D.getSeconds(),this.$ms=D.getMilliseconds()},B.$utils=function(){return O},B.isValid=function(){return this.$d.toString()!==g},B.isSame=function(D,V){var A=E(D);return this.startOf(V)<=A&&A<=this.endOf(V)},B.isAfter=function(D,V){return E(D)<this.startOf(V)},B.isBefore=function(D,V){return this.endOf(V)<E(D)},B.$g=function(D,V,A){return O.u(D)?this[V]:this.set(A,D)},B.unix=function(){return Math.floor(this.valueOf()/1e3)},B.valueOf=function(){return this.$d.getTime()},B.startOf=function(D,V){var A=this,T=!!O.u(V)||V,$=O.p(D),W=function(_e,ut){var ne=O.w(A.$u?Date.UTC(A.$y,ut,_e):new Date(A.$y,ut,_e),A);return T?ne:ne.endOf(d)},j=function(_e,ut){return O.w(A.toDate()[_e].apply(A.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(ut)),A)},G=this.$W,Q=this.$M,it=this.$D,Ct="set"+(this.$u?"UTC":"");switch($){case p:return T?W(1,0):W(31,11);case f:return T?W(1,Q):W(0,Q+1);case h:var ye=this.$locale().weekStart||0,rn=(G<ye?G+7:G)-ye;return W(T?it-rn:it+(6-rn),Q);case d:case m:return j(Ct+"Hours",0);case c:return j(Ct+"Minutes",1);case l:return j(Ct+"Seconds",2);case a:return j(Ct+"Milliseconds",3);default:return this.clone()}},B.endOf=function(D){return this.startOf(D,!1)},B.$set=function(D,V){var A,T=O.p(D),$="set"+(this.$u?"UTC":""),W=(A={},A[d]=$+"Date",A[m]=$+"Date",A[f]=$+"Month",A[p]=$+"FullYear",A[c]=$+"Hours",A[l]=$+"Minutes",A[a]=$+"Seconds",A[i]=$+"Milliseconds",A)[T],j=T===d?this.$D+(V-this.$W):V;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},B.set=function(D,V){return this.clone().$set(D,V)},B.get=function(D){return this[O.p(D)]()},B.add=function(D,V){var A,T=this;D=Number(D);var $=O.p(V),W=function(Q){var it=E(T);return O.w(it.date(it.date()+Math.round(Q*D)),T)};if($===f)return this.set(f,this.$M+D);if($===p)return this.set(p,this.$y+D);if($===d)return W(1);if($===h)return W(7);var j=(A={},A[l]=s,A[c]=o,A[a]=e,A)[$]||1,G=this.$d.getTime()+D*j;return O.w(G,this)},B.subtract=function(D,V){return this.add(-1*D,V)},B.format=function(D){var V=this,A=this.$locale();if(!this.isValid())return A.invalidDate||g;var T=D||"YYYY-MM-DDTHH:mm:ssZ",$=O.z(this),W=this.$H,j=this.$m,G=this.$M,Q=A.weekdays,it=A.months,Ct=A.meridiem,ye=function(ut,ne,ln,es){return ut&&(ut[ne]||ut(V,T))||ln[ne].slice(0,es)},rn=function(ut){return O.s(W%12||12,ut,"0")},_e=Ct||function(ut,ne,ln){var es=ut<12?"AM":"PM";return ln?es.toLowerCase():es};return T.replace(_,function(ut,ne){return ne||function(ln){switch(ln){case"YY":return String(V.$y).slice(-2);case"YYYY":return O.s(V.$y,4,"0");case"M":return G+1;case"MM":return O.s(G+1,2,"0");case"MMM":return ye(A.monthsShort,G,it,3);case"MMMM":return ye(it,G);case"D":return V.$D;case"DD":return O.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return ye(A.weekdaysMin,V.$W,Q,2);case"ddd":return ye(A.weekdaysShort,V.$W,Q,3);case"dddd":return Q[V.$W];case"H":return String(W);case"HH":return O.s(W,2,"0");case"h":return rn(1);case"hh":return rn(2);case"a":return _e(W,j,!0);case"A":return _e(W,j,!1);case"m":return String(j);case"mm":return O.s(j,2,"0");case"s":return String(V.$s);case"ss":return O.s(V.$s,2,"0");case"SSS":return O.s(V.$ms,3,"0");case"Z":return $}return null}(ut)||$.replace(":","")})},B.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},B.diff=function(D,V,A){var T,$=this,W=O.p(V),j=E(D),G=(j.utcOffset()-this.utcOffset())*s,Q=this-j,it=function(){return O.m($,j)};switch(W){case p:T=it()/12;break;case f:T=it();break;case u:T=it()/3;break;case h:T=(Q-G)/6048e5;break;case d:T=(Q-G)/864e5;break;case c:T=Q/o;break;case l:T=Q/s;break;case a:T=Q/e;break;default:T=Q}return A?T:O.a(T)},B.daysInMonth=function(){return this.endOf(f).$D},B.$locale=function(){return C[this.$L]},B.locale=function(D,V){if(!D)return this.$L;var A=this.clone(),T=v(D,V,!0);return T&&(A.$L=T),A},B.clone=function(){return O.w(this.$d,this)},B.toDate=function(){return new Date(this.valueOf())},B.toJSON=function(){return this.isValid()?this.toISOString():null},B.toISOString=function(){return this.$d.toISOString()},B.toString=function(){return this.$d.toUTCString()},F}(),U=N.prototype;return E.prototype=U,[["$ms",i],["$s",a],["$m",l],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(F){U[F[1]]=function(B){return this.$g(B,F[0],F[1])}}),E.extend=function(F,B){return F.$i||(F(B,N,E),F.$i=!0),E},E.locale=v,E.isDayjs=M,E.unix=function(F){return E(1e3*F)},E.en=C[x],E.Ls=C,E.p={},E})})(Oa);var yu=Oa.exports;const ct=bu(yu),De=Math.min,me=Math.max,Un=Math.round,Xn=Math.floor,Jt=n=>({x:n,y:n}),_u={left:"right",right:"left",bottom:"top",top:"bottom"},xu={start:"end",end:"start"};function Xs(n,t,e){return me(n,De(t,e))}function nn(n,t){return typeof n=="function"?n(t):n}function ge(n){return n.split("-")[0]}function sn(n){return n.split("-")[1]}function Fa(n){return n==="x"?"y":"x"}function qs(n){return n==="y"?"height":"width"}function qn(n){return["top","bottom"].includes(ge(n))?"y":"x"}function Ks(n){return Fa(qn(n))}function ku(n,t,e){e===void 0&&(e=!1);const s=sn(n),o=Ks(n),i=qs(o);let a=o==="x"?s===(e?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Kn(a)),[a,Kn(a)]}function wu(n){const t=Kn(n);return[Gs(n),t,Gs(t)]}function Gs(n){return n.replace(/start|end/g,t=>xu[t])}function Cu(n,t,e){const s=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(n){case"top":case"bottom":return e?t?o:s:t?s:o;case"left":case"right":return t?i:a;default:return[]}}function Mu(n,t,e,s){const o=sn(n);let i=Cu(ge(n),e==="start",s);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Gs)))),i}function Kn(n){return n.replace(/left|right|bottom|top/g,t=>_u[t])}function Su(n){return{top:0,right:0,bottom:0,left:0,...n}}function Ta(n){return typeof n!="number"?Su(n):{top:n,right:n,bottom:n,left:n}}function Gn(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function Na(n,t,e){let{reference:s,floating:o}=n;const i=qn(t),a=Ks(t),l=qs(a),c=ge(t),d=i==="y",h=s.x+s.width/2-o.width/2,f=s.y+s.height/2-o.height/2,u=s[l]/2-o[l]/2;let p;switch(c){case"top":p={x:h,y:s.y-o.height};break;case"bottom":p={x:h,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:f};break;case"left":p={x:s.x-o.width,y:f};break;default:p={x:s.x,y:s.y}}switch(sn(t)){case"start":p[a]-=u*(e&&d?-1:1);break;case"end":p[a]+=u*(e&&d?-1:1);break}return p}const Du=async(n,t,e)=>{const{placement:s="bottom",strategy:o="absolute",middleware:i=[],platform:a}=e,l=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:n,floating:t,strategy:o}),{x:h,y:f}=Na(d,s,c),u=s,p={},m=0;for(let g=0;g<l.length;g++){const{name:b,fn:_}=l[g],{x:y,y:k,data:w,reset:x}=await _({x:h,y:f,initialPlacement:s,placement:u,strategy:o,middlewareData:p,rects:d,platform:a,elements:{reference:n,floating:t}});if(h=y??h,f=k??f,p={...p,[b]:{...p[b],...w}},x&&m<=50){m++,typeof x=="object"&&(x.placement&&(u=x.placement),x.rects&&(d=x.rects===!0?await a.getElementRects({reference:n,floating:t,strategy:o}):x.rects),{x:h,y:f}=Na(d,u,c)),g=-1;continue}}return{x:h,y:f,placement:u,strategy:o,middlewareData:p}};async function $a(n,t){var e;t===void 0&&(t={});const{x:s,y:o,platform:i,rects:a,elements:l,strategy:c}=n,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:u=!1,padding:p=0}=nn(t,n),m=Ta(p),b=l[u?f==="floating"?"reference":"floating":f],_=Gn(await i.getClippingRect({element:(e=await(i.isElement==null?void 0:i.isElement(b)))==null||e?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:c})),y=f==="floating"?{...a.floating,x:s,y:o}:a.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),w=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},x=Gn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:k,strategy:c}):y);return{top:(_.top-x.top+m.top)/w.y,bottom:(x.bottom-_.bottom+m.bottom)/w.y,left:(_.left-x.left+m.left)/w.x,right:(x.right-_.right+m.right)/w.x}}const Bu=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:s,placement:o,rects:i,platform:a,elements:l,middlewareData:c}=t,{element:d,padding:h=0}=nn(n,t)||{};if(d==null)return{};const f=Ta(h),u={x:e,y:s},p=Ks(o),m=qs(p),g=await a.getDimensions(d),b=p==="y",_=b?"top":"left",y=b?"bottom":"right",k=b?"clientHeight":"clientWidth",w=i.reference[m]+i.reference[p]-u[p]-i.floating[m],x=u[p]-i.reference[p],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(d));let S=C?C[k]:0;(!S||!await(a.isElement==null?void 0:a.isElement(C)))&&(S=l.floating[k]||i.floating[m]);const M=w/2-x/2,v=S/2-g[m]/2-1,E=De(f[_],v),O=De(f[y],v),N=E,U=S-g[m]-O,F=S/2-g[m]/2+M,B=Xs(N,F,U),D=!c.arrow&&sn(o)!=null&&F!=B&&i.reference[m]/2-(F<N?E:O)-g[m]/2<0,V=D?F<N?F-N:F-U:0;return{[p]:u[p]+V,data:{[p]:B,centerOffset:F-B-V,...D&&{alignmentOffset:V}},reset:D}}}),La=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,s;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...b}=nn(n,t);if((e=i.arrow)!=null&&e.alignmentOffset)return{};const _=ge(o),y=ge(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),w=u||(y||!g?[Kn(l)]:wu(l));!u&&m!=="none"&&w.push(...Mu(l,g,m,k));const x=[l,...w],C=await $a(t,b),S=[];let M=((s=i.flip)==null?void 0:s.overflows)||[];if(h&&S.push(C[_]),f){const N=ku(o,a,k);S.push(C[N[0]],C[N[1]])}if(M=[...M,{placement:o,overflows:S}],!S.every(N=>N<=0)){var v,E;const N=(((v=i.flip)==null?void 0:v.index)||0)+1,U=x[N];if(U)return{data:{index:N,overflows:M},reset:{placement:U}};let F=(E=M.filter(B=>B.overflows[0]<=0).sort((B,D)=>B.overflows[1]-D.overflows[1])[0])==null?void 0:E.placement;if(!F)switch(p){case"bestFit":{var O;const B=(O=M.map(D=>[D.placement,D.overflows.filter(V=>V>0).reduce((V,A)=>V+A,0)]).sort((D,V)=>D[1]-V[1])[0])==null?void 0:O[0];B&&(F=B);break}case"initialPlacement":F=l;break}if(o!==F)return{reset:{placement:F}}}return{}}}};async function vu(n,t){const{placement:e,platform:s,elements:o}=n,i=await(s.isRTL==null?void 0:s.isRTL(o.floating)),a=ge(e),l=sn(e),c=qn(e)==="y",d=["left","top"].includes(a)?-1:1,h=i&&c?-1:1,f=nn(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 l&&typeof m=="number"&&(p=l==="end"?m*-1:m),c?{x:p*h,y:u*d}:{x:u*d,y:p*h}}const Ra=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){const{x:e,y:s}=t,o=await vu(t,n);return{x:e+o.x,y:s+o.y,data:o}}}},Eu=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:s,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:_,y}=b;return{x:_,y}}},...c}=nn(n,t),d={x:e,y:s},h=await $a(t,c),f=qn(ge(o)),u=Fa(f);let p=d[u],m=d[f];if(i){const b=u==="y"?"top":"left",_=u==="y"?"bottom":"right",y=p+h[b],k=p-h[_];p=Xs(y,p,k)}if(a){const b=f==="y"?"top":"left",_=f==="y"?"bottom":"right",y=m+h[b],k=m-h[_];m=Xs(y,m,k)}const g=l.fn({...t,[u]:p,[f]:m});return{...g,data:{x:g.x-e,y:g.y-s}}}}};function Qt(n){return za(n)?(n.nodeName||"").toLowerCase():"#document"}function yt(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function zt(n){var t;return(t=(za(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function za(n){return n instanceof Node||n instanceof yt(n).Node}function It(n){return n instanceof Element||n instanceof yt(n).Element}function Et(n){return n instanceof HTMLElement||n instanceof yt(n).HTMLElement}function Ia(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof yt(n).ShadowRoot}function on(n){const{overflow:t,overflowX:e,overflowY:s,display:o}=wt(n);return/auto|scroll|overlay|hidden|clip/.test(t+s+e)&&!["inline","contents"].includes(o)}function Vu(n){return["table","td","th"].includes(Qt(n))}function Zs(n){const t=Js(),e=wt(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(s=>(e.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(e.contain||"").includes(s))}function Pu(n){let t=Be(n);for(;Et(t)&&!Zn(t);){if(Zs(t))return t;t=Be(t)}return null}function Js(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zn(n){return["html","body","#document"].includes(Qt(n))}function wt(n){return yt(n).getComputedStyle(n)}function Jn(n){return It(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function Be(n){if(Qt(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Ia(n)&&n.host||zt(n);return Ia(t)?t.host:t}function Wa(n){const t=Be(n);return Zn(t)?n.ownerDocument?n.ownerDocument.body:n.body:Et(t)&&on(t)?t:Wa(t)}function an(n,t,e){var s;t===void 0&&(t=[]),e===void 0&&(e=!0);const o=Wa(n),i=o===((s=n.ownerDocument)==null?void 0:s.body),a=yt(o);return i?t.concat(a,a.visualViewport||[],on(o)?o:[],a.frameElement&&e?an(a.frameElement):[]):t.concat(o,an(o,[],e))}function Ya(n){const t=wt(n);let e=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=Et(n),i=o?n.offsetWidth:e,a=o?n.offsetHeight:s,l=Un(e)!==i||Un(s)!==a;return l&&(e=i,s=a),{width:e,height:s,$:l}}function Qs(n){return It(n)?n:n.contextElement}function ve(n){const t=Qs(n);if(!Et(t))return Jt(1);const e=t.getBoundingClientRect(),{width:s,height:o,$:i}=Ya(t);let a=(i?Un(e.width):e.width)/s,l=(i?Un(e.height):e.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const Au=Jt(0);function ja(n){const t=yt(n);return!Js()||!t.visualViewport?Au:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ou(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==yt(n)?!1:t}function be(n,t,e,s){t===void 0&&(t=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),i=Qs(n);let a=Jt(1);t&&(s?It(s)&&(a=ve(s)):a=ve(n));const l=Ou(i,e,s)?ja(i):Jt(0);let c=(o.left+l.x)/a.x,d=(o.top+l.y)/a.y,h=o.width/a.x,f=o.height/a.y;if(i){const u=yt(i),p=s&&It(s)?yt(s):s;let m=u.frameElement;for(;m&&s&&p!==u;){const g=ve(m),b=m.getBoundingClientRect(),_=wt(m),y=b.left+(m.clientLeft+parseFloat(_.paddingLeft))*g.x,k=b.top+(m.clientTop+parseFloat(_.paddingTop))*g.y;c*=g.x,d*=g.y,h*=g.x,f*=g.y,c+=y,d+=k,m=yt(m).frameElement}}return Gn({width:h,height:f,x:c,y:d})}function Fu(n){let{rect:t,offsetParent:e,strategy:s}=n;const o=Et(e),i=zt(e);if(e===i)return t;let a={scrollLeft:0,scrollTop:0},l=Jt(1);const c=Jt(0);if((o||!o&&s!=="fixed")&&((Qt(e)!=="body"||on(i))&&(a=Jn(e)),Et(e))){const d=be(e);l=ve(e),c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+c.x,y:t.y*l.y-a.scrollTop*l.y+c.y}}function Tu(n){return Array.from(n.getClientRects())}function Ha(n){return be(zt(n)).left+Jn(n).scrollLeft}function Nu(n){const t=zt(n),e=Jn(n),s=n.ownerDocument.body,o=me(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=me(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let a=-e.scrollLeft+Ha(n);const l=-e.scrollTop;return wt(s).direction==="rtl"&&(a+=me(t.clientWidth,s.clientWidth)-o),{width:o,height:i,x:a,y:l}}function $u(n,t){const e=yt(n),s=zt(n),o=e.visualViewport;let i=s.clientWidth,a=s.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;const d=Js();(!d||d&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}function Lu(n,t){const e=be(n,!0,t==="fixed"),s=e.top+n.clientTop,o=e.left+n.clientLeft,i=Et(n)?ve(n):Jt(1),a=n.clientWidth*i.x,l=n.clientHeight*i.y,c=o*i.x,d=s*i.y;return{width:a,height:l,x:c,y:d}}function Ua(n,t,e){let s;if(t==="viewport")s=$u(n,e);else if(t==="document")s=Nu(zt(n));else if(It(t))s=Lu(t,e);else{const o=ja(n);s={...t,x:t.x-o.x,y:t.y-o.y}}return Gn(s)}function Xa(n,t){const e=Be(n);return e===t||!It(e)||Zn(e)?!1:wt(e).position==="fixed"||Xa(e,t)}function Ru(n,t){const e=t.get(n);if(e)return e;let s=an(n,[],!1).filter(l=>It(l)&&Qt(l)!=="body"),o=null;const i=wt(n).position==="fixed";let a=i?Be(n):n;for(;It(a)&&!Zn(a);){const l=wt(a),c=Zs(a);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||on(a)&&!c&&Xa(n,a))?s=s.filter(h=>h!==a):o=l,a=Be(a)}return t.set(n,s),s}function zu(n){let{element:t,boundary:e,rootBoundary:s,strategy:o}=n;const a=[...e==="clippingAncestors"?Ru(t,this._c):[].concat(e),s],l=a[0],c=a.reduce((d,h)=>{const f=Ua(t,h,o);return d.top=me(f.top,d.top),d.right=De(f.right,d.right),d.bottom=De(f.bottom,d.bottom),d.left=me(f.left,d.left),d},Ua(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Iu(n){return Ya(n)}function Wu(n,t,e){const s=Et(t),o=zt(t),i=e==="fixed",a=be(n,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Jt(0);if(s||!s&&!i)if((Qt(t)!=="body"||on(o))&&(l=Jn(t)),s){const d=be(t,!0,i,t);c.x=d.x+t.clientLeft,c.y=d.y+t.clientTop}else o&&(c.x=Ha(o));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function qa(n,t){return!Et(n)||wt(n).position==="fixed"?null:t?t(n):n.offsetParent}function Ka(n,t){const e=yt(n);if(!Et(n))return e;let s=qa(n,t);for(;s&&Vu(s)&&wt(s).position==="static";)s=qa(s,t);return s&&(Qt(s)==="html"||Qt(s)==="body"&&wt(s).position==="static"&&!Zs(s))?e:s||Pu(n)||e}const Yu=async function(n){let{reference:t,floating:e,strategy:s}=n;const o=this.getOffsetParent||Ka,i=this.getDimensions;return{reference:Wu(t,await o(e),s),floating:{x:0,y:0,...await i(e)}}};function ju(n){return wt(n).direction==="rtl"}const Hu={convertOffsetParentRelativeRectToViewportRelativeRect:Fu,getDocumentElement:zt,getClippingRect:zu,getOffsetParent:Ka,getElementRects:Yu,getClientRects:Tu,getDimensions:Iu,getScale:ve,isElement:It,isRTL:ju};function Uu(n,t){let e=null,s;const o=zt(n);function i(){clearTimeout(s),e&&e.disconnect(),e=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:d,top:h,width:f,height:u}=n.getBoundingClientRect();if(l||t(),!f||!u)return;const p=Xn(h),m=Xn(o.clientWidth-(d+f)),g=Xn(o.clientHeight-(h+u)),b=Xn(d),y={rootMargin:-p+"px "+-m+"px "+-g+"px "+-b+"px",threshold:me(0,De(1,c))||1};let k=!0;function w(x){const C=x[0].intersectionRatio;if(C!==c){if(!k)return a();C?a(!1,C):s=setTimeout(()=>{a(!1,1e-7)},100)}k=!1}try{e=new IntersectionObserver(w,{...y,root:o.ownerDocument})}catch{e=new IntersectionObserver(w,y)}e.observe(n)}return a(!0),i}function Xu(n,t,e,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=Qs(n),h=o||i?[...d?an(d):[],...an(t)]:[];h.forEach(_=>{o&&_.addEventListener("scroll",e,{passive:!0}),i&&_.addEventListener("resize",e)});const f=d&&l?Uu(d,e):null;let u=-1,p=null;a&&(p=new ResizeObserver(_=>{let[y]=_;y&&y.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{p&&p.observe(t)})),e()}),d&&!c&&p.observe(d),p.observe(t));let m,g=c?be(n):null;c&&b();function b(){const _=be(n);g&&(_.x!==g.x||_.y!==g.y||_.width!==g.width||_.height!==g.height)&&e(),g=_,m=requestAnimationFrame(b)}return e(),()=>{h.forEach(_=>{o&&_.removeEventListener("scroll",e),i&&_.removeEventListener("resize",e)}),f&&f(),p&&p.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const Ga=(n,t,e)=>{const s=new Map,o={platform:Hu,...e},i={...o.platform,_c:s};return Du(n,t,{...o,platform:i})};function to(n){var t;return(t=n==null?void 0:n.$el)!=null?t:n}function qu(n){return{name:"arrow",options:n,fn(t){const e=to(r.unref(n.element));return e==null?{}:Bu({element:e,padding:n.padding}).fn(t)}}}function Za(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function Ja(n,t){const e=Za(n);return Math.round(t*e)/e}function Ku(n,t,e){e===void 0&&(e={});const s=e.whileElementsMounted,o=r.computed(()=>{var S;return(S=r.unref(e.open))!=null?S:!0}),i=r.computed(()=>r.unref(e.middleware)),a=r.computed(()=>{var S;return(S=r.unref(e.placement))!=null?S:"bottom"}),l=r.computed(()=>{var S;return(S=r.unref(e.strategy))!=null?S:"absolute"}),c=r.computed(()=>{var S;return(S=r.unref(e.transform))!=null?S:!0}),d=r.computed(()=>to(n.value)),h=r.computed(()=>to(t.value)),f=r.ref(0),u=r.ref(0),p=r.ref(l.value),m=r.ref(a.value),g=r.shallowRef({}),b=r.ref(!1),_=r.computed(()=>{const S={position:p.value,left:"0",top:"0"};if(!h.value)return S;const M=Ja(h.value,f.value),v=Ja(h.value,u.value);return c.value?{...S,transform:"translate("+M+"px, "+v+"px)",...Za(h.value)>=1.5&&{willChange:"transform"}}:{position:p.value,left:M+"px",top:v+"px"}});let y;function k(){d.value==null||h.value==null||Ga(d.value,h.value,{middleware:i.value,placement:a.value,strategy:l.value}).then(S=>{f.value=S.x,u.value=S.y,p.value=S.strategy,m.value=S.placement,g.value=S.middlewareData,b.value=!0})}function w(){typeof y=="function"&&(y(),y=void 0)}function x(){if(w(),s===void 0){k();return}if(d.value!=null&&h.value!=null){y=s(d.value,h.value,k);return}}function C(){o.value||(b.value=!1)}return r.watch([i,a,l],k,{flush:"sync"}),r.watch([d,h],x,{flush:"sync"}),r.watch(o,C,{flush:"sync"}),r.getCurrentScope()&&r.onScopeDispose(w),{x:r.shallowReadonly(f),y:r.shallowReadonly(u),strategy:r.shallowReadonly(p),placement:r.shallowReadonly(m),middlewareData:r.shallowReadonly(g),isPositioned:r.shallowReadonly(b),floatingStyles:_,update:k}}function Gu(n){for(;n;){if(Zu(n))return n;n=n.parentElement}return document.scrollingElement}function Zu(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 Ju{constructor(t,e){P(this,"onScroll");P(this,"scrollParent");this.onScroll=e,this.scrollParent=Gu(t)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const Qu={class:"fm-menu__wrapper"},tp=r.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 s=n,o=r.ref(!1),i=r.ref(null),a=r.ref(null),{floatingStyles:l}=Ku(i,a,{middleware:[Ra(4),La()],placement:s.placement,whileElementsMounted:Xu});let c;t({show:()=>{o.value||(o.value=!0,e("dropdown-changed",o.value))},hide:()=>{o.value&&(o.value=!1,e("dropdown-changed",o.value))}});const d=u=>{u.preventDefault(),u.stopPropagation(),!s.disabled&&(o.value=!o.value,e("dropdown-changed",o.value))},h=u=>{if(!o.value)return;const p=u.path||u.composedPath();for(const m of p)if(m==i.value||m==a.value)return;o.value=!1,e("dropdown-changed",o.value)},f=()=>{e("dropdown-changed",!1)};return r.watch(()=>s.showMenu,u=>o.value=u),r.onMounted(()=>{o.value=s.showMenu,window.addEventListener("click",h),c=new Ju(i.value,f),c.bindScroll()}),r.onUnmounted(()=>{window.removeEventListener("click",h),c.unbindScroll()}),(u,p)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"anchorEl",ref:i,class:"fm-menu",onClick:d},[r.renderSlot(u.$slots,"menu-button",{},void 0,!0)],512),o.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"menuEl",ref:a,class:r.normalizeClass({"fm-menu__content":!0,"fm-menu__content--opened":o.value}),style:r.normalizeStyle(r.unref(l))},[r.renderSlot(u.$slots,"menu-wrapper",{},()=>[r.createElementVNode("div",Qu,[r.renderSlot(u.$slots,"menu-content",{},void 0,!0)])],!0)],6)):r.createCommentVNode("",!0)]))}}),Ng="",_t=et(tp,[["__scopeId","data-v-6ad9d23d"]]),ep={class:"fm-menu-item--left"},np={key:0,class:"fm-menu-item--right"},sp=r.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,s=r.ref(!1),o=l=>{l.preventDefault(),!e.disabled&&t("update:modelValue",!e.modelValue)},i=()=>{t("update:modelValue",e.modelValue)};function a(l){s.value=l}return(l,c)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{class:r.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":l.modelValue&&!l.hasCheckbox,"fm-menu-item--disabled":l.disabled}),onClick:o,onMousedown:c[1]||(c[1]=()=>a(!0)),onMouseup:c[2]||(c[2]=()=>a(!1)),onMouseleave:c[3]||(c[3]=()=>a(!1))},[r.createElementVNode("div",ep,[!l.hasCheckbox&&l.icon?(r.openBlock(),r.createBlock(R,{key:0,name:l.icon,size:"md",outline:!s.value&&!l.modelValue,color:l.disabled?"#C7C7CC":l.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),l.hasCheckbox?(r.openBlock(),r.createBlock(Aa,{key:1,"model-value":l.modelValue,name:"something",label:"",sublabel:"",value:"",indeterminate:!1,disabled:l.disabled,"onUpdate:modelValue":i,onClick:c[0]||(c[0]=d=>d.preventDefault())},null,8,["model-value","disabled"])):r.createCommentVNode("",!0),r.renderSlot(l.$slots,"label",{},()=>[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(`fm-typo-body-lg-400 ${l.disabled?"fm-color-typo-disabled":"fm-color-typo-primary"}`)},r.toDisplayString(l.label),3),l.sublabel?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`fm-typo-body-md-400 ${l.disabled?"fm-color-typo-disabled":"fm-color-typo-secondary"}`)},r.toDisplayString(l.sublabel),3)):r.createCommentVNode("",!0)])],!0)]),r.renderSlot(l.$slots,"append",{},void 0,!0),l.expandable?(r.openBlock(),r.createElementBlock("div",np,[r.createVNode(R,{name:"chevron_right",size:"md",color:l.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):r.createCommentVNode("",!0)],34)]))}}),$g="",Vt=et(sp,[["__scopeId","data-v-a50682bb"]]),op={class:"w-full"},ip=r.defineComponent({__name:"FmField",props:{tag:{default:"div"},prependIcon:{default:""},appendIcon:{default:""},invalid:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1}},setup(n){const t=n;return(e,s)=>(r.openBlock(),r.createBlock(t.tag,{class:r.normalizeClass({"fm-field":!0,"fm-field--focused":e.focused,"fm-field--invalid":e.invalid,"fm-field--valid":e.showValidBorder&&!e.invalid,"fm-field--disabled":e.disabled}),tabindex:"0"},{default:r.withCtx(()=>[r.renderSlot(e.$slots,"prepend",{},()=>[e.prependIcon?(r.openBlock(),r.createBlock(R,{key:0,name:e.prependIcon,size:"md",color:e.disabled?"disabled":"neutral-black"},null,8,["name","color"])):r.createCommentVNode("",!0)],!0),r.createElementVNode("div",op,[r.renderSlot(e.$slots,"default",{},void 0,!0)]),r.renderSlot(e.$slots,"append",{},()=>[e.appendIcon?(r.openBlock(),r.createBlock(R,{key:0,name:e.appendIcon,size:"md",color:e.disabled?"disabled":"neutral-black"},null,8,["name","color"])):r.createCommentVNode("",!0)],!0)]),_:3},8,["class"]))}}),Lg="",te=et(ip,[["__scopeId","data-v-177cd78a"]]),ap={class:"flex gap-4"},Qa=r.defineComponent({__name:"FmHelperText",props:{text:{default:""},disabled:{type:Boolean,default:!1},state:{default:"none"},errorMessages:{default:()=>[]}},setup(n){const t=n,e=r.computed(()=>t.state==="success"?"check_circle":t.state==="warning"?"warning":t.state==="error"?"error":""),s=r.computed(()=>t.state==="success"?"text-fm-color-system-success-300":t.state==="warning"?"text-fm-color-system-warning-300":t.state==="error"?"text-fm-color-system-error-300":"");return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-typo-body-sm-400",{"text-fm-color-typo-disabled":o.disabled,"text-fm-color-typo-secondary":o.state==="none"&&!o.disabled,"text-fm-color-typo-success":o.state==="success"&&!o.disabled,"text-fm-color-typo-warning":o.state==="warning"&&!o.disabled,"text-fm-color-typo-error":o.state==="error"&&!o.disabled}])},[o.errorMessages.length===0?r.renderSlot(o.$slots,"default",{key:0},()=>[r.createElementVNode("div",ap,[e.value?(r.openBlock(),r.createBlock(R,{key:0,size:"sm",name:e.value,class:r.normalizeClass(["mt-[2px]",s.value])},null,8,["name","class"])):r.createCommentVNode("",!0),r.createElementVNode("span",null,r.toDisplayString(o.text),1)])]):r.renderSlot(o.$slots,"default",{key:1},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.errorMessages,a=>(r.openBlock(),r.createElementBlock("div",{key:a,class:"flex gap-4 text-fm-color-typo-error"},[r.createVNode(R,{size:"sm",name:"error",class:"mt-[2px] text-fm-color-system-error-300"}),r.createElementVNode("span",null,r.toDisplayString(a),1)]))),128))])],2))}}),rp={class:"px-2 py-0"},lp={key:0,class:"fm-typo-body-xl-700"},cp={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},tr=r.defineComponent({__name:"FmTooltip",props:{variant:{default:"plain"},beak:{default:"top"},hasArrow:{type:Boolean,default:!0},titleText:{default:"Title"},contentText:{},actionButtons:{default:null},disabled:{type:Boolean,default:!1}},setup(n){const t=n,e=r.ref(null),s=r.ref(null),o=r.ref(null),i=async()=>{var _,y,k,w;const{x:p,y:m,placement:g,middlewareData:b}=await Ga(e.value,s.value,{placement:t.beak,middleware:[Ra(10),La(),Eu({padding:5}),t.hasArrow?qu({element:o.value,padding:10}):null]});if(Object.assign(s.value.style,{left:`${p}px`,top:`${m}px`}),t.hasArrow){const x={top:"bottom",right:"left",bottom:"top",left:"right"}[g.split("-")[0]];Object.assign(o.value.style,{left:((_=b.arrow)==null?void 0:_.x)!=null?`${(y=b.arrow)==null?void 0:y.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",[x]:"-4px"})}},a=r.ref(!1),l=r.ref(0),c=r.ref(0),d=r.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(c.value),l.value=window.setTimeout(()=>{a.value=!0},500)},f=()=>{clearTimeout(l.value),c.value=window.setTimeout(()=>a.value=!1,1500)},u=()=>{clearTimeout(c.value),a.value=!0};return r.watchEffect(()=>{a.value?(i(),window.addEventListener("resize",i)):window.removeEventListener("resize",i)}),(p,m)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"tooltipContainer",ref:e,class:r.normalizeClass(["cursor-pointer flex items-center justify-center relative w-max",{"cursor-not-allowed pointer-events-none":p.disabled}]),onMouseenter:h,onMouseleave:f},[r.renderSlot(p.$slots,"default")],34),r.createElementVNode("div",{ref_key:"tooltip",ref:s,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:r.normalizeStyle(d.value),onMouseenter:u,onMouseleave:f},[r.createElementVNode("div",null,[r.createElementVNode("div",rp,[p.variant=="rich"?(r.openBlock(),r.createElementBlock("div",lp,r.toDisplayString(p.titleText),1)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(p.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},r.toDisplayString(p.contentText),3)]),p.variant=="rich"?(r.openBlock(),r.createElementBlock("div",cp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.actionButtons,(g,b)=>(r.openBlock(),r.createElementBlock("div",{key:b},[r.createVNode(xt,{variant:"tertiary",label:g.label,onClick:g.handler},null,8,["label","onClick"])]))),128))])):r.createCommentVNode("",!0)]),r.createElementVNode("div",{ref_key:"arrowEl",ref:o,class:"-rotate-45 absolute h-3 w-3"},null,512)],36)]))}}),er=r.defineComponent({__name:"FmLabel",props:{label:{default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""}},setup(n){return(t,e)=>t.label?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-lg-400 flex gap-4",t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary",{"items-center":t.info}])},[r.renderSlot(t.$slots,"default",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.label),1),t.required?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(["fm-typo-body-lg-700",t.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-error"])}," * ",2)):r.createCommentVNode("",!0),t.optional?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-md-400",t.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-tertiary"])}," (optional) ",2)):r.createCommentVNode("",!0),t.info?(r.openBlock(),r.createBlock(tr,{key:2,beak:"top","content-text":t.info,disabled:t.disabled},{default:r.withCtx(()=>[r.createVNode(R,{name:"info",size:"sm",class:r.normalizeClass(["fm-typo-body-md-400",t.disabled?"text-fm-color-typo-disabled":"text-fm-color-neutral-gray-300"])},null,8,["class"])]),_:1},8,["content-text","disabled"])):r.createCommentVNode("",!0)])],2)):r.createCommentVNode("",!0)}});function nr(n,t){const e=r.ref([]);function s(){const i=[];if(t.value&&t.value.length>0)for(const a of t.value){const c=(typeof a=="function"?a:()=>a)(n.value);c!==!0&&i.push(c)}return e.value=i,e.value}function o(){e.value=[]}return{validate:s,resetValidation:o,errorMessages:e}}function sr(n,t=null,e=null){let s=null;const o=bt(n,"modelValue"),i=r.ref(!0),a=r.inject(ao,null),{validate:l,resetValidation:c,errorMessages:d}=nr(o,r.toRef(()=>n.rules)),h=(f=e)=>{i.value=!0,c(),f&&typeof f=="function"&&f(),o.value=t};return r.onMounted(()=>{a&&(s=a.register({validate:l,resetValidation:c,resetValue:h})),t=t??o.value}),r.onUnmounted(()=>{a&&a.unregister(s)}),r.watch(()=>o.value,()=>{i.value=!1,o.value!==t&&l()}),r.watch(()=>n.focused,f=>{i.value=!1,f||l()}),{validate:l,resetValidation:c,errorMessages:d,resetValue:h,isPristine:i}}function Qn(){const n=r.ref(!1);function t(){n.value=!0}function e(){n.value=!1}return{focus:t,blur:e,isFocused:n}}const dp={key:1,class:"flex items-center justify-between"},Wt=r.defineComponent({__name:"FmFormGroup",props:{modelValue:{},rules:{default:()=>[]},focused:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:{default:""},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""},helperText:{default:""},helperState:{default:"none"},tag:{default:"label"}},setup(n){const t=n,{errorMessages:e,isPristine:s}=sr(t),{focus:o,blur:i}=Qn(),a=r.computed(()=>({label:t.label,disabled:t.disabled,required:t.required,optional:t.optional,info:t.info})),l=r.computed(()=>({text:t.helperText,disabled:t.disabled,state:t.helperState,errorMessages:e.value})),c=r.computed(()=>({isPristine:s,invalid:e.value.length>0}));return(d,h)=>(r.openBlock(),r.createBlock(t.tag,{class:"flex flex-col gap-4",onClick:r.unref(o),onBlur:r.unref(i)},{default:r.withCtx(()=>[d.label?(r.openBlock(),r.createBlock(er,r.normalizeProps(r.mergeProps({key:0},a.value)),{default:r.withCtx(()=>[r.renderSlot(d.$slots,"label")]),_:3},16)):r.createCommentVNode("",!0),r.renderSlot(d.$slots,"default",r.normalizeProps(r.guardReactiveProps(c.value))),l.value.text||l.value.errorMessages.length>0||d.$slots["helper-append"]?(r.openBlock(),r.createElementBlock("div",dp,[r.createVNode(Qa,r.normalizeProps(r.guardReactiveProps(l.value)),{default:r.withCtx(()=>[r.renderSlot(d.$slots,"helper-text")]),_:3},16),r.renderSlot(d.$slots,"helper-append")])):r.createCommentVNode("",!0)]),_:3},8,["onClick","onBlur"]))}}),hp={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[360px]"},fp={class:"w-max"},up={class:"flex h-40 justify-between px-4 py-8"},pp={class:"flex gap-4 items-center"},mp={class:"fm-typo-body-lg-700"},gp={class:"h-[264px] w-[160px]"},bp={class:"fm-typo-body-lg-700"},yp={class:"h-[264px] w-[160px]"},_p={class:"flex gap-4 items-center justify-center"},xp={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},kp=["onClick"],wp={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},Cp=r.defineComponent({__name:"FmDatePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=bt(t,"modelValue"),s=r.ref(ct(e.value,"YYYY-MM-DD")),o=r.ref(!1),i=r.ref(ct().startOf("month")),a=r.ref(!1),l=r.ref(!1),c=g=>{s.value=g},d=()=>{e.value=s.value.format("YYYY-MM-DD"),setTimeout(()=>{o.value=!1},0)},h=()=>{s.value=e.value?ct(e.value):null,o.value=!1},f=g=>{const b=[],_=g.endOf("month"),y=g.month();let k=g.startOf("week"),w=[];for(;k.isBefore(_.endOf("week"));)k.day()===0&&w.length>0&&(b.push(w),w=[]),w.push({date:k,isCurrentMonth:k.month()===y}),k=k.add(1,"day");return w.length>0&&b.push(w),b},u=g=>{a.value=!1,l.value=!1,i.value=g},p=r.computed(()=>Array.from(Array(7),(g,b)=>ct().day(b).format("ddd"))),m=r.computed(()=>{let g=-5;const b=[];for(;g!=5;)b.push(i.value.add(g,"year")),g++;return b});return(g,b)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":b[5]||(b[5]=_=>r.isRef(e)?e.value=_:null),label:g.label,disabled:g.disabled,required:g.labelMark==="required",optional:g.labelMark==="optional",info:g.labelInfo,rules:g.rules,focused:o.value,"helper-text":g.helperText,"helper-state":g.helperState,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(g.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:_})=>[r.createVNode(_t,{"show-menu":o.value,disabled:g.disabled,onDropdownChanged:b[4]||(b[4]=y=>o.value=y)},{"menu-button":r.withCtx(()=>[r.createVNode(te,{class:"cursor-text",focused:o.value,invalid:_,"show-valid-border":g.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(g.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(g.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":r.unref(e)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString(r.unref(e)?r.unref(ct)(r.unref(e)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","invalid","show-valid-border"])]),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",hp,[r.createElementVNode("div",fp,[r.createElementVNode("div",up,[r.createElementVNode("div",pp,[r.createVNode(_t,{"show-menu":a.value,onDropdownChanged:b[0]||(b[0]=y=>a.value=y)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",a.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",mp,r.toDisplayString(i.value.format("MMMM")),1),r.createVNode(R,{name:a.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",gp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Array.from(Array(12),(y,k)=>i.value.month(k)),y=>(r.openBlock(),r.createElementBlock("li",{key:y.format("MMMM")},[r.createVNode(Vt,{"model-value":i.value.format("MMMM")===y.format("MMMM"),label:y.format("MMMM"),"onUpdate:modelValue":k=>u(y)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),r.createVNode(_t,{"show-menu":l.value,onDropdownChanged:b[1]||(b[1]=y=>l.value=y)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",l.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",bp,r.toDisplayString(i.value.format("YYYY")),1),r.createVNode(R,{name:l.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",yp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,y=>(r.openBlock(),r.createElementBlock("li",{key:y.format("YYYY")},[r.createVNode(Vt,{"model-value":i.value.format("YYYY")===y.format("YYYY"),label:y.format("YYYY"),"onUpdate:modelValue":k=>u(y)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),r.createElementVNode("div",_p,[r.createVNode(R,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[2]||(b[2]=()=>u(i.value.subtract(1,"month")))}),r.createVNode(R,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:b[3]||(b[3]=()=>u(i.value.add(1,"month")))})])]),r.createElementVNode("div",null,[r.createElementVNode("div",xp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.value,y=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"fm-calendar__cell"},r.toDisplayString(y),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f(i.value),(y,k)=>(r.openBlock(),r.createElementBlock("div",{key:k,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y,w=>(r.openBlock(),r.createElementBlock("div",{key:w.date.date(),class:"fm-calendar__cell"},[w.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":w.date.isSame(s.value)}]),type:"button",onClick:()=>c(w.date)},r.toDisplayString(w.date.date()),11,kp)):r.createCommentVNode("",!0)]))),128))]))),128))])])]),r.createElementVNode("div",wp,[r.createVNode(xt,{label:"Cancel",size:"md",variant:"tertiary",onClick:h}),r.createVNode(xt,{label:"Apply",size:"md",variant:"primary",disabled:!s.value,onClick:d},null,8,["disabled"])])])]),_:2},1032,["show-menu","disabled"])]),"helper-text":r.withCtx(()=>[r.renderSlot(g.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Rg="",Mp=et(Cp,[["__scopeId","data-v-ac574b04"]]),Sp=n=>(r.pushScopeId("data-v-431b8ad3"),n=n(),r.popScopeId(),n),Dp={class:"flex gap-1 items-center relative w-full"},Bp={class:"flex flex-col gap-4 w-full"},vp=Sp(()=>r.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)),Ep={class:"flex flex-col gap-4 w-full"},Vp={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[720px]"},Pp={class:"flex gap-24"},Ap={class:"w-max"},Op={class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},Fp={class:"flex gap-4 items-center"},Tp={class:"fm-typo-body-lg-700"},Np={class:"h-[264px] w-[160px]"},$p={class:"fm-typo-body-lg-700"},Lp={class:"h-[264px] w-[160px]"},Rp={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},zp=["onClick","onMouseover"],Ip={class:"w-max"},Wp={class:"flex gap-16 h-10 items-center justify-end px-4 py-8"},Yp={class:"flex gap-4 items-center"},jp={class:"fm-typo-body-lg-700"},Hp={class:"h-[264px] w-[160px]"},Up={class:"fm-typo-body-lg-700"},Xp={class:"h-[264px] w-[160px]"},qp={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Kp=["onClick","onMouseover"],Gp={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},Zp=r.defineComponent({__name:"FmDateRangePicker",props:{modelValue:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=bt(t,"modelValue"),s=r.ref({startDate:ct(e.value.startDate,"YYYY-MM-DD"),endDate:ct(e.value.endDate,"YYYY-MM-DD")}),o=r.ref(!1),i=r.ref(ct().startOf("month")),a=r.ref(ct().startOf("month").add(1,"month")),l=r.ref(null),c=r.ref(!1),d=r.ref(!1),h=r.ref(!1),f=r.ref(!1),u=x=>{if(s.value.startDate&&s.value.endDate){s.value={startDate:x,endDate:null};return}if(!s.value.startDate&&!s.value.endDate)s.value.startDate=x;else if(x.isBefore(s.value.startDate)){const C=s.value.startDate;s.value={startDate:x,endDate:C}}else s.value.endDate=x},p=()=>{e.value={startDate:s.value.startDate.format("YYYY-MM-DD"),endDate:s.value.endDate.format("YYYY-MM-DD")},setTimeout(()=>{o.value=!1})},m=()=>{var x,C;s.value={startDate:(x=e.value)!=null&&x.startDate?ct(e.value.startDate,"YYYY-MM-DD"):null,endDate:(C=e.value)!=null&&C.endDate?ct(e.value.endDate,"YYYY-MM-DD"):null},o.value=!1},g=x=>{const C=[],S=x.endOf("month"),M=x.month();let v=x.startOf("week"),E=[];for(;v.isBefore(S.endOf("week"));)v.day()===0&&E.length>0&&(C.push(E),E=[]),E.push({date:v,isCurrentMonth:v.month()===M}),v=v.add(1,"day");return E.length>0&&C.push(E),C},b=(x,C)=>{c.value=!1,h.value=!1,d.value=!1,f.value=!1,x==="left"?(i.value=C,a.value=C.add(1,"month")):x==="right"&&(a.value=C,i.value=C.subtract(1,"month"))},_=r.computed(()=>Array.from(Array(7),(x,C)=>ct().day(C).format("ddd"))),y=x=>{const C=s.value.startDate,S=s.value.endDate;l.value=C&&S?null:l.value;const M=l.value,v=C==null?void 0:C.isSame(x),E=S==null?void 0:S.isSame(x),O=M==null?void 0:M.isSame(x);return{"fm-calendar__cell__button--selected":v&&E||v&&!S,"fm-calendar__cell__button--selected-start":v&&S&&!(v&&E)||C&&!S&&v&&(M==null?void 0:M.isAfter(C))||C&&!S&&O&&(M==null?void 0:M.isBefore(C)),"fm-calendar__cell__button--selected-end":E&&C&&!(v&&E)||C&&!S&&v&&(M==null?void 0:M.isBefore(C))||C&&!S&&O&&(M==null?void 0:M.isAfter(C)),"fm-calendar__cell__button--selected-between":C&&(S||M)&&S?x.isAfter(C)&&x.isBefore(S):x.isAfter(M)&&x.isBefore(C)||x.isBefore(M)&&x.isAfter(C)}},k=x=>{l.value=x},w=r.computed(()=>{let x=-5;const C=[];for(;x!=5;)C.push(i.value.add(x,"year")),x++;return C});return r.watch(()=>e.value,()=>{var x,C;return s.value={startDate:(x=e.value)!=null&&x.startDate?ct(e.value.startDate,"YYYY-MM-DD"):null,endDate:(C=e.value)!=null&&C.endDate?ct(e.value.endDate,"YYYY-MM-DD"):null}}),(x,C)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":C[7]||(C[7]=S=>r.isRef(e)?e.value=S:null),disabled:x.disabled,rules:x.rules,focused:o.value,"helper-text":x.helperText,"helper-state":x.helperState,tag:"div"},{default:r.withCtx(({invalid:S})=>[r.createVNode(_t,{"show-menu":o.value,disabled:x.disabled,onDropdownChanged:C[6]||(C[6]=M=>o.value=M)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",Dp,[r.createElementVNode("label",Bp,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(t.startLabel),3),r.createVNode(te,{class:r.normalizeClass(x.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.value,invalid:S,"show-valid-border":x.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(x.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(x.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>{var M,v;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":(M=r.unref(e))!=null&&M.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((v=r.unref(e))!=null&&v.startDate?r.unref(ct)(r.unref(e).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])]),vp,r.createElementVNode("label",Ep,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(t.endLabel),3),r.createVNode(te,{class:r.normalizeClass(x.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.value,invalid:S,"show-valid-border":x.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(x.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(x.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>{var M,v;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":(M=r.unref(e))!=null&&M.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((v=r.unref(e))!=null&&v.endDate?r.unref(ct)(r.unref(e).endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])])])]),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",Vp,[r.createElementVNode("div",Pp,[r.createElementVNode("div",Ap,[r.createElementVNode("div",Op,[r.createElementVNode("div",Fp,[r.createVNode(R,{class:"cursor-pointer select-none",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:C[0]||(C[0]=()=>b("left",i.value.subtract(1,"month")))}),r.createVNode(_t,{"show-menu":c.value,onDropdownChanged:C[1]||(C[1]=M=>c.value=M)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",c.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",Tp,r.toDisplayString(i.value.format("MMMM")),1),r.createVNode(R,{name:c.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Np,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Array.from(Array(12),(M,v)=>i.value.month(v)),M=>(r.openBlock(),r.createElementBlock("li",{key:M.format("MMMM")},[r.createVNode(Vt,{"model-value":i.value.format("MMMM")===M.format("MMMM"),label:M.format("MMMM"),"onUpdate:modelValue":v=>b("left",M)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),r.createVNode(_t,{"show-menu":h.value,onDropdownChanged:C[2]||(C[2]=M=>h.value=M)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",h.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",$p,r.toDisplayString(i.value.format("YYYY")),1),r.createVNode(R,{name:h.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Lp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,M=>(r.openBlock(),r.createElementBlock("li",{key:M.format("YYYY")},[r.createVNode(Vt,{"model-value":i.value.format("YYYY")===M.format("YYYY"),label:M.format("YYYY"),"onUpdate:modelValue":v=>b("left",M)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])])]),r.createElementVNode("div",null,[r.createElementVNode("div",Rp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(_.value,M=>(r.openBlock(),r.createElementBlock("div",{key:M,class:"fm-calendar__cell"},r.toDisplayString(M),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g(i.value),(M,v)=>(r.openBlock(),r.createElementBlock("div",{key:v,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(M,E=>(r.openBlock(),r.createElementBlock("div",{key:E.date.date(),class:"fm-calendar__cell"},[E.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["fm-calendar__cell__button",y(E.date)]),type:"button",onClick:()=>u(E.date),onMouseover:O=>k(E.date)},r.toDisplayString(E.date.date()),43,zp)):r.createCommentVNode("",!0)]))),128))]))),128))])])]),r.createElementVNode("div",Ip,[r.createElementVNode("div",Wp,[r.createElementVNode("div",Yp,[r.createVNode(_t,{"show-menu":d.value,onDropdownChanged:C[3]||(C[3]=M=>d.value=M)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",d.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",jp,r.toDisplayString(a.value.format("MMMM")),1),r.createVNode(R,{name:d.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Hp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Array.from(Array(12),(M,v)=>a.value.month(v)),M=>(r.openBlock(),r.createElementBlock("li",{key:M.format("MMMM")},[r.createVNode(Vt,{"model-value":a.value.format("MMMM")===M.format("MMMM"),label:M.format("MMMM"),"onUpdate:modelValue":v=>b("right",M)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),r.createVNode(_t,{"show-menu":f.value,onDropdownChanged:C[4]||(C[4]=M=>f.value=M)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",f.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",Up,r.toDisplayString(a.value.format("YYYY")),1),r.createVNode(R,{name:f.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Xp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,M=>(r.openBlock(),r.createElementBlock("li",{key:M.format("YYYY")},[r.createVNode(Vt,{"model-value":a.value.format("YYYY")===M.format("YYYY"),label:M.format("YYYY"),"onUpdate:modelValue":v=>b("right",M)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),r.createVNode(R,{class:"cursor-pointer select-none",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:C[5]||(C[5]=()=>b("left",i.value.add(1,"month")))})]),r.createElementVNode("div",null,[r.createElementVNode("div",qp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(_.value,M=>(r.openBlock(),r.createElementBlock("div",{key:M,class:"fm-calendar__cell"},r.toDisplayString(M),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g(a.value),(M,v)=>(r.openBlock(),r.createElementBlock("div",{key:v,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(M,E=>(r.openBlock(),r.createElementBlock("div",{key:E.date.date(),class:"fm-calendar__cell"},[E.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["fm-calendar__cell__button",y(E.date)]),type:"button",onClick:()=>u(E.date),onMouseover:O=>k(E.date)},r.toDisplayString(E.date.date()),43,Kp)):r.createCommentVNode("",!0)]))),128))]))),128))])])])]),r.createElementVNode("div",Gp,[r.createVNode(xt,{label:"Cancel",size:"md",variant:"tertiary",onClick:m}),r.createVNode(xt,{label:"OK",size:"md",variant:"primary",disabled:!s.value.startDate||!s.value.endDate,onClick:p},null,8,["disabled"])])])]),_:2},1032,["show-menu","disabled"])]),"helper-text":r.withCtx(()=>[r.renderSlot(x.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","disabled","rules","focused","helper-text","helper-state"]))}}),zg="",Jp=et(Zp,[["__scopeId","data-v-431b8ad3"]]),Qp=["onSubmit","onReset"],tm=r.defineComponent({__name:"FmForm",emits:["validation-reset","validation-success","validation-failed","reset"],setup(n,{expose:t,emit:e}){const s=r.ref([]),o=r.ref(0),i=()=>{let c=[];for(let d=0;d<s.value.length;d++){const h=s.value[d];c=[...c,...h.validate()]}c.length?e("validation-failed",c):e("validation-success")},a=()=>{for(let c=0;c<s.value.length;c++)s.value[c].resetValue();e("reset")};return t({validateInputs:i,resetInputsValidation:()=>{for(let c=0;c<s.value.length;c++)s.value[c].resetValidation();e("validation-reset")},resetInputs:a}),r.provide(ao,{register({validate:c,resetValidation:d,resetValue:h}){return s.value.push({componentId:o.value,validate:c,resetValidation:d,resetValue:h}),o.value++},unregister(c){s.value.filter(d=>d.componentId!==c)}}),(c,d)=>(r.openBlock(),r.createElementBlock("form",{onSubmit:r.withModifiers(i,["prevent"]),onReset:r.withModifiers(a,["prevent"])},[r.renderSlot(c.$slots,"default")],40,Qp))}}),em={class:"fm-radio-btn"},nm={class:"fm-radio-btn__input--container"},sm=["value","disabled","checked"],om={class:"py-8"},im={class:"fm-typo-body-lg-400"},am={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},rm=r.defineComponent({__name:"FmRadio",props:{modelValue:{default:null},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n){const t=n,e=bt(t,"modelValue"),s=r.ref(),o=r.inject(ro,null),i=()=>{a.value||(o?o.updateValue(t.value):e.value=t.value)},a=r.computed(()=>o?o.getDisabled():t.disabled),l=r.computed(()=>o?t.value===o.groupValue.value:e.value===t.value);return(c,d)=>{const h=r.resolveDirective("wave");return r.openBlock(),r.createElementBlock("div",em,[r.createElementVNode("label",{class:r.normalizeClass({"fm-radio-btn--wrapper":!0,"cursor-not-allowed text-fm-color-typo-disabled":a.value,"cursor-pointer":!a.value}),onClick:i},[r.withDirectives((r.openBlock(),r.createElementBlock("div",nm,[r.createElementVNode("input",{ref_key:"inputEl",ref:s,class:"fm-radio-btn__input--btn",type:"radio",value:c.value,disabled:a.value,checked:l.value},null,8,sm)])),[[h,!a.value]]),r.createElementVNode("div",om,[r.renderSlot(c.$slots,"label",{},()=>[r.createElementVNode("div",im,r.toDisplayString(c.label),1),c.sublabel?(r.openBlock(),r.createElementBlock("div",am,r.toDisplayString(c.sublabel),1)):r.createCommentVNode("",!0)],!0)])],2)])}}}),Ig="",lm=et(rm,[["__scopeId","data-v-24fa5bf9"]]),cm=r.defineComponent({__name:"FmRadioGroup",props:{modelValue:{},inline:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[n=>!!n||"This field is required"]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=bt(t,"modelValue");return r.provide(ro,{groupValue:e,getDisabled:()=>t.disabled,updateValue(s){e.value=s}}),(s,o)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":o[0]||(o[0]=i=>r.isRef(e)?e.value=i:null),label:s.label,disabled:s.disabled,required:s.labelMark==="required",optional:s.labelMark==="optional",info:s.labelInfo,rules:s.rules,"helper-text":s.helperText,"helper-state":s.helperState},{label:r.withCtx(()=>[r.renderSlot(s.$slots,"label")]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass({"flex items-center gap-16 justify-start":s.inline})},[r.renderSlot(s.$slots,"default")],2)]),"helper-text":r.withCtx(()=>[r.renderSlot(s.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","helper-text","helper-state"]))}}),dm={class:"flex flex-col gap-4"},hm={class:"w-[280px]"},fm={class:"flex flex-col gap-4 justify-center"},um=r.defineComponent({__name:"FmSelect",props:{modelValue:{},items:{},multiselect:{type:Boolean,default:!1},placement:{default:"bottom-start"},placeholder:{default:"Select item"},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=bt(t,"modelValue"),s=r.ref(!1),o=(d,h)=>{if(t.multiselect){let f=[];d?f=e.value.length===0?[h]:t.items.filter(u=>e.value.some(p=>ft(u.value,p)||ft(u.value,h.value))):f=t.items.filter(u=>e.value.some(p=>ft(u.value,p)&&!ft(u.value,h.value))),e.value=f.map(u=>u.value)}else e.value=h.value,setTimeout(()=>{s.value=!1},0)},i=d=>{const h=[...e.value].filter((f,u)=>u!==d);e.value=h},a=r.computed(()=>t.multiselect?t.items.filter(d=>r.toRaw(e.value).some(h=>ft(h,d.value))):t.items.filter(d=>ft(e.value,d.value))),l=r.computed(()=>t.items.filter(d=>e.value.some(h=>ft(d.value,h))).map(d=>({label:d.label}))),c=r.computed(()=>{var d;return t.multiselect?t.placeholder:((d=t.items.find(h=>ft(h.value,e.value)))==null?void 0:d.label)??t.placeholder});return(d,h)=>(r.openBlock(),r.createElementBlock("div",dm,[r.createVNode(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":h[1]||(h[1]=f=>r.isRef(e)?e.value=f:null),label:d.label,disabled:d.disabled,required:d.labelMark==="required",optional:d.labelMark==="optional",info:d.labelInfo,rules:d.rules,focused:s.value,"helper-text":d.helperText,"helper-state":d.helperState},{label:r.withCtx(()=>[r.renderSlot(d.$slots,"label")]),default:r.withCtx(({invalid:f})=>[r.createVNode(_t,{"show-menu":s.value,disabled:d.disabled,placement:d.placement,onDropdownChanged:h[0]||(h[0]=u=>s.value=u)},{"menu-button":r.withCtx(()=>[r.createVNode(te,{class:r.normalizeClass(d.disabled?"cursor-not-allowed":"cursor-pointer"),focused:s.value,invalid:f,"show-valid-border":d.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(d.$slots,"prepend")]),append:r.withCtx(()=>[r.createVNode(R,{name:s.value?"expand_less":"expand_more",size:"md",color:d.disabled?"#C7C7CC":"black"},null,8,["name","color"])]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":r.unref(e)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString(c.value),3)]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",hm,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.items,u=>(r.openBlock(),r.createBlock(Vt,{key:u.value,"has-checkbox":d.multiselect,label:u.label,value:u.value,"model-value":a.value.some(p=>r.unref(ft)(p.value,u.value)),"onUpdate:modelValue":p=>o(p,u)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))])]),_:2},1032,["show-menu","disabled","placement"])]),"helper-text":r.withCtx(()=>[r.renderSlot(d.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]),r.createElementVNode("div",fm,[d.multiselect&&a.value.length>0?(r.openBlock(),r.createBlock(oo,{key:0,items:l.value,removable:"",disabled:d.disabled,onChipClosed:i},null,8,["items","disabled"])):r.createCommentVNode("",!0)])]))}}),pm=["inputMode","value","placeholder","readOnly"],mm={key:0},gm=r.defineComponent({__name:"FmStepperField",props:{modelValue:{},placeholder:{default:""},inputmode:{default:"numeric"},readonly:{type:Boolean},labelMark:{default:"none"},step:{default:1},min:{default:void 0},max:{default:void 0},prependIcon:{default:""},appendIcon:{default:""},useGrouping:{type:Boolean,default:!0},isCurrency:{type:Boolean,default:!1},showSteppers:{type:Boolean,default:!0},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},label:{default:""},disabled:{type:Boolean},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=bt(t,"modelValue"),{isFocused:s,blur:o,focus:i}=Qn(),a=r.ref(null);let l;const c=y=>{if(y!==""){const k=+y.replace(/,/g,"");return isNaN(k)?null:k}return null},d=y=>l.format(y),h=y=>{if(typeof e.value!="number"){e.value=+e.value;return}if(y>0&&g.value||y<0&&b.value)return;let k=_(e.value)?e.value+y:0;k=f(k),e.value=k},f=y=>t.max!==void 0&&y>t.max?t.max:t.min!==void 0&&y<t.min?t.min:y,u=()=>{var y;e.value=c(((y=a.value)==null?void 0:y.value)??"")},p=y=>{if(![...Array(10).keys()].map(k=>k.toString()).includes(y.key)&&!["Backspace","Tab","Enter",".","-","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(y.key)){y.preventDefault();return}},m=r.computed(()=>e.value!=null?d(e.value):""),g=r.computed(()=>{let y=!1;return t.max!==void 0&&(y=e.value>=t.max),t.min!==void 0&&(y=e.value<t.min),y}),b=r.computed(()=>{let y=!1;return t.max!==void 0&&(y=e.value>t.max),t.min!==void 0&&(y=e.value<=t.min),y});r.onMounted(()=>{l=new Intl.NumberFormat("en-MY",{useGrouping:t.useGrouping})});function _(y){return typeof y=="number"&&isFinite(y)}return(y,k)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":k[8]||(k[8]=w=>r.isRef(e)?e.value=w:null),label:y.label,disabled:y.disabled,required:y.labelMark==="required",optional:y.labelMark==="optional",info:y.labelInfo,rules:y.rules,focused:r.unref(s),"helper-text":y.helperText,"helper-state":y.helperState},{label:r.withCtx(()=>[r.renderSlot(y.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:w})=>[r.createVNode(te,{class:"cursor-text","append-icon":y.appendIcon,"prepend-icon":y.prependIcon,focused:r.unref(s),invalid:w,"show-valid-border":y.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(y.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(y.$slots,"append",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["flex items-center justify-center",{"mr-32":y.showSteppers}])},[y.appendText?(r.openBlock(),r.createElementBlock("div",mm,r.toDisplayString(y.appendText),1)):r.createCommentVNode("",!0),y.appendIcon?(r.openBlock(),r.createBlock(R,{key:1,name:y.appendIcon,size:"md",color:y.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):r.createCommentVNode("",!0)],2)],!0),y.showSteppers?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-stepper-field__stepper__container",r.unref(s)?"right-[6px]":"right-[7px]"])},[r.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"0",onMousedown:k[2]||(k[2]=()=>h(y.step)),onFocus:k[3]||(k[3]=(...x)=>r.unref(i)&&r.unref(i)(...x)),onBlur:k[4]||(k[4]=(...x)=>r.unref(o)&&r.unref(o)(...x))},[r.createVNode(R,{name:"expand_less",size:"md",color:y.disabled||g.value?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32),r.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"1",onMousedown:k[5]||(k[5]=()=>h(-y.step)),onFocus:k[6]||(k[6]=(...x)=>r.unref(i)&&r.unref(i)(...x)),onBlur:k[7]||(k[7]=(...x)=>r.unref(o)&&r.unref(o)(...x))},[r.createVNode(R,{name:"expand_more",size:"md",color:y.disabled||b.value?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32)],2)):r.createCommentVNode("",!0)]),default:r.withCtx(()=>[r.createElementVNode("input",{ref_key:"inputEl",ref:a,class:"fm-stepper-field--input",type:"text",inputMode:y.inputmode,value:m.value,placeholder:y.placeholder,readOnly:y.readonly,onInput:u,onFocus:k[0]||(k[0]=(...x)=>r.unref(i)&&r.unref(i)(...x)),onBlur:k[1]||(k[1]=(...x)=>r.unref(o)&&r.unref(o)(...x)),onKeydown:p},null,40,pm)]),_:2},1032,["append-icon","prepend-icon","focused","invalid","show-valid-border"])]),"helper-text":r.withCtx(()=>[r.renderSlot(y.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Wg="",bm=et(gm,[["__scopeId","data-v-46378d3b"]]),ym={class:"cursor-pointer fm-switch__container"},_m={key:0},xm={class:"fm-typo-body-lg-400"},km={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},wm={class:"fm-switch__input--container"},Cm=["checked","value","disabled"],Mm={key:1},Sm={class:"fm-typo-body-lg-400"},Dm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Bm=r.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){const t=n,e=bt(t,"modelValue"),s=()=>{t.disabled||(e.value=!e.value)};return(o,i)=>(r.openBlock(),r.createElementBlock("label",ym,[o.labelPlacement==="left"?(r.openBlock(),r.createElementBlock("div",_m,[r.renderSlot(o.$slots,"label",{},void 0,!0),r.createElementVNode("div",xm,r.toDisplayString(o.label),1),o.sublabel?(r.openBlock(),r.createElementBlock("div",km,r.toDisplayString(o.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",wm,[r.createElementVNode("input",{checked:r.unref(e),class:"fm-switch__input--btn",type:"checkbox",value:o.value,disabled:o.disabled,onClick:s},null,8,Cm),r.createElementVNode("div",{class:r.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":o.showIcon})},[o.showIcon?(r.openBlock(),r.createBlock(R,{key:0,name:r.unref(e)?"check":"close",size:"sm",color:o.disabled?"#C7C7CC":r.unref(e)?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):r.createCommentVNode("",!0)],2)]),o.labelPlacement==="right"?(r.openBlock(),r.createElementBlock("div",Mm,[r.createElementVNode("div",Sm,r.toDisplayString(o.label),1),o.sublabel?(r.openBlock(),r.createElementBlock("div",Dm,r.toDisplayString(o.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]))}}),Yg="",vm=et(Bm,[["__scopeId","data-v-c967bf28"]]),Em=["value","inputMode","type","placeholder","minlength","maxlength","disabled","readOnly"],Vm=r.defineComponent({__name:"FmTextField",props:{placeholder:{default:""},minLength:{default:0},maxLength:{default:NaN},inputmode:{default:"text"},readonly:{type:Boolean,default:!1},labelMark:{default:"none"},prependIcon:{default:""},appendIcon:{default:""},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},showWordCount:{type:Boolean,default:!1},modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=r.ref(null),s=bt(t,"modelValue"),{isFocused:o,focus:i,blur:a}=Qn(),l=c=>{s.value=c.target.value};return(c,d)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(s),"onUpdate:modelValue":d[2]||(d[2]=h=>r.isRef(s)?s.value=h:null),label:c.label,disabled:c.disabled,required:c.labelMark==="required",optional:c.labelMark==="optional",info:c.labelInfo,rules:c.rules,focused:r.unref(o),"helper-text":c.helperText,"helper-state":c.helperState},r.createSlots({label:r.withCtx(()=>[r.renderSlot(c.$slots,"label")]),default:r.withCtx(({invalid:h})=>[r.createVNode(te,{class:"cursor-text","append-icon":c.appendIcon,"prepend-icon":c.prependIcon,focused:r.unref(o),invalid:h,"show-valid-border":c.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(c.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(c.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("input",{ref_key:"inputEl",ref:e,class:r.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!c.disabled,"fm-color-typo-disabled":c.disabled}),value:r.unref(s),inputMode:c.inputmode,type:c.inputmode,placeholder:c.placeholder,minlength:c.minLength,maxlength:c.maxLength,disabled:c.disabled,readOnly:c.readonly,onInput:l,onFocus:d[0]||(d[0]=(...f)=>r.unref(i)&&r.unref(i)(...f)),onBlur:d[1]||(d[1]=(...f)=>r.unref(a)&&r.unref(a)(...f))},null,42,Em)]),_:2},1032,["append-icon","prepend-icon","focused","invalid","show-valid-border"])]),"helper-text":r.withCtx(()=>[r.renderSlot(c.$slots,"helper-text")]),_:2},[c.showWordCount?{name:"helper-append",fn:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([c.disabled?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},r.toDisplayString(c.maxLength?`${r.unref(s).length} / ${c.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),jg="",Pm=["value","placeholder","minlength","maxlength","readOnly","disabled"],Am=r.defineComponent({__name:"FmTextarea",props:{modelValue:{default:""},placeholder:{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},labelInfo:{default:""},helperText:{default:""},helperState:{default:"none"},showWordCount:{type:Boolean,default:!1},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]}},emits:["update:modelValue"],setup(n){const e=bt(n,"modelValue"),{isFocused:s,focus:o,blur:i}=Qn(),a=l=>{e.value=l.target.value};return(l,c)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":c[2]||(c[2]=d=>r.isRef(e)?e.value=d:null),label:l.label,disabled:l.disabled,required:l.labelMark==="required",optional:l.labelMark==="optional",info:l.labelInfo,rules:l.rules,focused:r.unref(s),"helper-text":l.helperText,"helper-state":l.helperState},r.createSlots({label:r.withCtx(()=>[r.renderSlot(l.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:d})=>[r.createElementVNode("div",{class:r.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":r.unref(s),"fm-textarea__container--invalid":!!r.unref(e)&&d,"fm-textarea__container--valid":l.showValidBorder&&l.showSuccess&&!!r.unref(e)&&!d,"fm-textarea__container--disabled":l.disabled})},[r.createElementVNode("textarea",{class:r.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!l.disabled,"fm-color-typo-disabled":l.disabled}),value:r.unref(e),placeholder:l.placeholder,minlength:l.minLength,maxlength:l.maxLength,readOnly:l.readonly,disabled:l.disabled,onInput:a,onFocus:c[0]||(c[0]=(...h)=>r.unref(o)&&r.unref(o)(...h)),onBlur:c[1]||(c[1]=(...h)=>r.unref(i)&&r.unref(i)(...h))},null,42,Pm)],2)]),"helper-text":r.withCtx(()=>[r.renderSlot(l.$slots,"helper-text",{},void 0,!0)]),_:2},[l.showWordCount?{name:"helper-append",fn:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([l.disabled?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},r.toDisplayString(l.maxLength?`${r.unref(e).length} / ${l.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Hg="",Om=et(Am,[["__scopeId","data-v-280a005d"]]),Fm={class:"flex flex-col fm-time-input items-center"},Tm=["value"],Nm=r.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,s=r.ref();function o(d){s.value&&(s.value.value=d)}r.watch(()=>e.modelValue,o);function i(){if(!s.value)return;const d=a(s.value.value);if(d==null||d>e.max||d<e.min){o(e.modelValue);return}t("update:model-value",d)}function a(d){return d&&/^\d+$/.test(d)?Number(d):null}function l(){t("update:model-value",a(e.modelValue)+1)}function c(){t("update:model-value",a(e.modelValue)-1)}return(d,h)=>(r.openBlock(),r.createElementBlock("div",Fm,[r.createElementVNode("div",{class:"fm-time-input__scroller",onClick:l},[r.createVNode(R,{name:"expand_less",size:"lg"})]),r.createElementVNode("input",{ref_key:"inputRef",ref:s,value:e.modelValue,onInput:i},null,40,Tm),r.createElementVNode("div",{class:"fm-time-input__scroller",onClick:c},[r.createVNode(R,{name:"expand_more",size:"lg"})])]))}}),Ug="",or=et(Nm,[["__scopeId","data-v-e8ddb125"]]);var Yt=(n=>(n.AM="AM",n.PM="PM",n))(Yt||{});function ee(n){return n.toString().padStart(2,"0")}const $m={class:"flex fm-time-input gap-16 items-center"},Lm=r.createElementVNode("div",{class:"fm-typo-title-sm-700"}," : ",-1),Rm={class:"fm-time-input-periods"},zm=["onClick"],ir=r.defineComponent({__name:"FmTimeInput",props:{modelValue:{type:Object,required:!0}},emits:["update:model-value"],setup(n,{emit:t}){const e=n;function s(o){const i={hours:o.hours??e.modelValue.hours,minutes:o.minutes??e.modelValue.minutes,period:o.period??e.modelValue.period},a=e.modelValue.hours;(a===12&&i.hours===11||a===11&&i.hours===12)&&(i.period=e.modelValue.period===Yt.AM?Yt.PM:Yt.AM),i.hours>12?i.hours=1:i.hours<1&&(i.hours=12),i.minutes>59?i.minutes=0:i.minutes<0&&(i.minutes=59),t("update:model-value",i)}return(o,i)=>(r.openBlock(),r.createElementBlock("div",$m,[r.createVNode(or,{"model-value":r.unref(ee)(n.modelValue.hours),min:1,max:12,"onUpdate:modelValue":i[0]||(i[0]=a=>s({hours:a}))},null,8,["model-value"]),Lm,r.createVNode(or,{"model-value":r.unref(ee)(n.modelValue.minutes),min:0,max:59,"onUpdate:modelValue":i[1]||(i[1]=a=>s({minutes:a}))},null,8,["model-value"]),r.createElementVNode("div",Rm,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Yt),a=>(r.openBlock(),r.createElementBlock("div",{key:a,class:r.normalizeClass([{"fm-time-input-period__selected":a===n.modelValue.period},"bg-fm-color-neutral-gray-100 fm-time-input-period"]),onClick:()=>s({period:a})},r.toDisplayString(a),11,zm))),128))])]))}}),Xg="",Im={class:"flex gap-8"},Wm={class:"bg-fm-color-neutral-white flex flex-col p-12 rounded-lg shadow-light-300 w-[343px]"},Ym=r.createElementVNode("div",{class:"fm-typo-body-xl-700"}," Enter time ",-1),jm={class:"flex justify-center w-full"},Hm={class:"flex justify-end"},Um=r.defineComponent({__name:"FmTimePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const e=bt(n,"modelValue"),s=r.ref(null),o=r.computed(()=>{if(!e.value)return null;const{hours:p,minutes:m,period:g}=l(e.value);return`${ee(p)}:${ee(m)} ${g}`});function i(){if(!s.value){e.value=null;return}const{hours:p,minutes:m,period:g}=s.value,b=a(p,m,g);e.value=b,h()}function a(p,m,g){let b=p;return g===Yt.PM?b=p===12?p:p+12:p===12&&(b=0),`${ee(b)}:${ee(m)}`}r.onMounted(()=>{e.value&&(s.value=l(e.value))}),r.watch(()=>e.value,p=>{p&&(s.value=l(p))});function l(p){const[m,g,b]=c(p).split(":");return{hours:Number(m),minutes:Number(g),period:b}}function c(p){const[m,g]=p.split(":"),b=Number(m),_=Number(g),y=b>11?Yt.PM:Yt.AM;let k=b;return k===0?k=12:k>12&&(k-=12),`${ee(k)}:${ee(_)}:${y}`}const d=r.ref();function h(){var p;(p=d.value)==null||p.hide()}const f=r.ref(!1);function u(p){p?s.value=l(e.value??"00:00"):s.value=e.value?l(e.value):null,f.value=p}return(p,m)=>(r.openBlock(),r.createBlock(Wt,{modelValue:r.unref(e),"onUpdate:modelValue":m[1]||(m[1]=g=>r.isRef(e)?e.value=g:null),label:p.label,disabled:p.disabled,required:p.labelMark==="required",optional:p.labelMark==="optional",info:p.labelInfo,rules:p.rules,focused:f.value,"helper-text":p.helperText,"helper-state":p.helperState},{label:r.withCtx(()=>[r.renderSlot(p.$slots,"label")]),default:r.withCtx(({invalid:g})=>[r.createVNode(_t,{ref_key:"dropdownRef",ref:d,onDropdownChanged:u},{"menu-button":r.withCtx(()=>[r.createVNode(te,{class:r.normalizeClass(p.disabled?"cursor-not-allowed":"cursor-pointer"),focused:f.value,invalid:g,"show-valid-border":p.showValidBorder},{default:r.withCtx(()=>[r.createElementVNode("div",Im,[r.createVNode(R,{name:"schedule",outline:!f.value},null,8,["outline"]),r.createElementVNode("div",{class:r.normalizeClass(["grow",{"text-fm-color-typo-disabled":!o.value}])},r.toDisplayString(o.value??"HH:MM"),3)])]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",Wm,[Ym,r.createElementVNode("div",jm,[r.createVNode(ir,{"model-value":s.value??{hours:0,minutes:0,period:r.unref(Yt).AM},class:"py-16","onUpdate:modelValue":m[0]||(m[0]=b=>s.value=b)},null,8,["model-value"])]),r.createElementVNode("div",Hm,[r.createVNode(xt,{label:"Cancel",variant:"tertiary",onClick:h}),r.createVNode(xt,{label:"Confirm",variant:"tertiary",onClick:i})])])]),_:2},1536)]),"helper-text":r.withCtx(()=>[r.renderSlot(p.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),Xm=r.defineComponent({__name:"FmList",props:{separator:{type:Boolean,default:!1},disabled:{type:Boolean},activeClass:{default:""}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass({"fm-list--separator":t.separator,activeClass:t.activeClass})},[r.renderSlot(t.$slots,"default",{},void 0,!0)],2))}}),qg="",qm=et(Xm,[["__scopeId","data-v-884ba127"]]),Km=r.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,s)=>{const o=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createBlock(t.tag,{class:r.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:r.withCtx(()=>[r.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},8,["class"])),[[o,e.clickable&&!e.disabled]])}}}),Kg="",Gm=et(Km,[["__scopeId","data-v-f565b558"]]),Zm={class:"fm-progress-indicator relative"},Jm=["data-progress"],Qm={class:"absolute flex fm-typo-body-sm-400 h-full inset-0 items-center justify-center w-full"},ar=r.defineComponent({__name:"FmProgressIndicator",props:{modelValue:{type:Number,required:!0}},setup(n){const t=n,e=r.ref(null),s=r.computed(()=>`${t.modelValue/100*360}deg`),o=i=>{e.value&&e.value.style.setProperty("--progress",i)};return r.onMounted(()=>{o(s.value)}),r.onUpdated(()=>{o(s.value)}),r.watch(s,async i=>{o(i)}),(i,a)=>(r.openBlock(),r.createElementBlock("div",Zm,[r.createElementVNode("div",{ref_key:"progress",ref:e,class:"fm-progress-circular w-full","data-progress":s.value},null,8,Jm),r.createElementVNode("div",Qm,[r.renderSlot(i.$slots,"default")])]))}}),Gg="",tg={class:"flex"},eg={key:0,class:"mt-8"},ng=r.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,s=r.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}`)}}),o=r.computed(()=>e.title?{text:e.title,classes:"fm-typo-body-lg-700"}:{text:e.description,classes:""}),i=r.computed(()=>e.bgColor?ns(e.bgColor)?{style:{backgroundColor:e.bgColor}}:{class:`bg-fm-color-${e.bgColor}`}:{class:`bg-fm-color-${s.value.bgColor}`}),a=r.computed(()=>e.color?ns(e.color)?{style:{color:e.color}}:{class:`text-fm-color-${e.color}`}:{class:`text-fm-color-${s.value.actionColor}`});return(l,c)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(i.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[r.createElementVNode("div",tg,[s.value.icon?(r.openBlock(),r.createBlock(R,{key:0,name:s.value.icon.name,color:e.color??s.value.icon.color,class:"mr-12"},null,8,["name","color"])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(`${o.value.classes} grow ellipsis`)},r.toDisplayString(o.value.text),3),e.dismissable?(r.openBlock(),r.createBlock(R,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:c[0]||(c[0]=()=>t("onDismiss"))})):r.createCommentVNode("",!0)]),e.title&&e.description?(r.openBlock(),r.createElementBlock("div",eg,r.toDisplayString(e.description),1)):r.createCommentVNode("",!0),r.renderSlot(l.$slots,"actions",{},()=>[e.action?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0},a.value,{class:"mt-16 fm-typo-body-lg-700"}),[r.createElementVNode("span",{class:"cursor-pointer",onClick:c[1]||(c[1]=()=>t("onAction"))},r.toDisplayString(e.action),1)],16)):r.createCommentVNode("",!0)],!0)],16))}}),Zg="",sg=et(ng,[["__scopeId","data-v-b6db34bb"]]),og={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},rr=r.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)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex flex-col",n.disabled?"text-fm-color-typo-disabled":""])},[r.createElementVNode("div",{class:r.normalizeClass(["fm-step-title line-clamp-2",n.titleBold?"fm-typo-body-xl-700":"fm-typo-body-md-400"])},r.toDisplayString(n.title),3),n.description?(r.openBlock(),r.createElementBlock("div",og,r.toDisplayString(n.description),1)):r.createCommentVNode("",!0)],2))}}),ig=["data-title","data-description","data-disabled","onClick"],ag={class:"flex fm-step-container gap-12 grow"},rg=r.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:s}=r.inject(lo);function o(){i.value||s(t.value)}const i=r.computed(()=>t.disabled?t.disabled():!1),a=r.computed(()=>t.error?t.error():!1),l=r.computed(()=>e()===t.value),c=r.computed(()=>t.complete()),d=r.computed(()=>l.value||c.value||e()>t.value?"bg-fm-color-primary":"bg-fm-color-neutral-gray-300"),h=r.computed(()=>l.value?{className:"bg-fm-color-primary"}:a.value?{config:{name:"warning",color:"system-error-300"}}:i.value?{className:"border-2 border-fm-color-neutral-gray-200"}:c.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=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{"data-title":n.title,"data-description":n.description,"data-disabled":i.value,class:r.normalizeClass(`fm-step gap-4 grow ${i.value?"cursor-not-allowed":"cursor-pointer"}`),onClick:r.withModifiers(o,["stop"])},[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(`fm-step-indicator ${d.value}`)},null,2)]),r.createElementVNode("div",ag,[r.createElementVNode("div",{class:r.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?(r.openBlock(),r.createBlock(R,{key:0,name:h.value.config.name,color:h.value.config.color,outline:"",class:"absolute"},null,8,["name","color"])):r.createCommentVNode("",!0)],2),r.createVNode(rr,{title:n.title,description:n.description,disabled:i.value,class:"grow"},null,8,["title","description","disabled"])])],10,ig)),[[p,!i.value]])}}}),Jg="",lg=et(rg,[["__scopeId","data-v-ee172cad"]]),cg={class:"hidden items-center xs:flex"},dg={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},hg=r.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,s=h=>{t("update:model-value",h)};r.provide(lo,{currentStep:()=>e.modelValue,goToStep:s});const o=r.ref(),i=r.ref([]),a=r.computed(()=>i.value[e.modelValue-1]),l=r.computed(()=>e.modelValue/i.value.length*100),c=r.computed(()=>`${e.modelValue} of ${i.value.length}`),d=()=>{var f;const h=Array.from(((f=o.value)==null?void 0:f.querySelectorAll(":scope > .fm-step"))??[]);i.value=h.map(u=>({title:u.dataset.title??"",description:u.dataset.description,disabled:u.dataset.disabled=="true"}))};return r.onMounted(()=>{d()}),(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(`fm-stepper fm-stepper__${n.orientation}`)},[r.createElementVNode("div",{ref_key:"stepperRef",ref:o,class:r.normalizeClass(`flex mx-24 mt-12 mb-24 xs:hidden ${n.orientation==="vertical"?"flex-col":""}`)},[r.renderSlot(h.$slots,"default")],2),r.createElementVNode("div",cg,[r.createVNode(ar,{"model-value":l.value,class:"mr-12",style:{"min-width":"60px"}},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(c.value),1)]),_:1},8,["model-value"]),a.value?(r.openBlock(),r.createBlock(rr,{key:0,class:"grow","title-bold":"",title:a.value.title,description:a.value.description,disabled:a.value.disabled},null,8,["title","description","disabled"])):r.createCommentVNode("",!0)]),h.$slots.contents?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`flex-col mx-24 mt-12 mb-24 ${n.orientation==="vertical"?"w-2/3":""}`)},[r.renderSlot(h.$slots,"contents"),r.createElementVNode("div",dg,[r.renderSlot(h.$slots,"actions")])],2)):r.createCommentVNode("",!0)],2))}});let fg=0;function ug(){return fg++}const pg=n=>(r.pushScopeId("data-v-fae3740e"),n=n(),r.popScopeId(),n),mg=["disabled"],gg=[pg(()=>r.createElementVNode("div",{class:"fm-tab__indicator"},null,-1))],bg={class:"max-w-[360px] min-w-[186px]"},yg=r.defineComponent({__name:"FmTab",props:{modelValue:{default:null},label:{default:""},vertical:{type:Boolean,default:!1},icon:{default:""},disabled:{type:Boolean,default:!1},badge:{default:0},value:{default:()=>ug()},children:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=r.ref(!1),o=r.ref(!1);function i(h){s.value=h}const a=()=>{e.disabled||e.children.length>0||t("update:modelValue",e.value)},l=h=>{e.children.length!==0&&(o.value=h)},c=r.computed(()=>e.children.length>0?e.children.some(h=>h.value===e.modelValue):e.modelValue===e.value),d=h=>{o.value=!1,t("update:modelValue",h)};return(h,f)=>(r.openBlock(),r.createBlock(_t,{"show-menu":o.value,disabled:h.children.length===0,class:r.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":h.vertical}]),placement:h.vertical?"right-start":"bottom-start",onDropdownChanged:l},{"menu-button":r.withCtx(()=>[r.createElementVNode("button",{class:r.normalizeClass(["fm-tab",`fm-tab--${h.vertical?"vertical":"horizontal"}`,h.disabled?"cursor-not-allowed":"cursor-pointer",{"fm-tab--selected":c.value}]),disabled:h.disabled,onMousedown:f[0]||(f[0]=()=>i(!0)),onMouseup:f[1]||(f[1]=()=>i(!1)),onMouseleave:f[2]||(f[2]=()=>i(!1)),onClick:a},[r.renderSlot(h.$slots,"prepend",{},void 0,!0),h.icon?(r.openBlock(),r.createBlock(R,{key:0,name:h.icon,outline:!s.value&&!c.value,color:h.disabled?"neutral-gray-200":c.value?"primary":"neutral-black",size:"md"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),h.label?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-lg-700 text-fm-color-typo-primary col-start-2 row-start-1",c.value?"visible":"invisible"])},r.toDisplayString(h.label),3)):r.createCommentVNode("",!0),h.label?(r.openBlock(),r.createElementBlock("span",{key:2,class:r.normalizeClass(["fm-typo-body-lg-400 col-start-2 row-start-1",h.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary",!c.value||h.disabled?"visible":"invisible"])},r.toDisplayString(h.label),3)):r.createCommentVNode("",!0),h.badge?(r.openBlock(),r.createBlock(cn,{key:3,value:h.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0),h.children.length>0?(r.openBlock(),r.createBlock(R,{key:4,size:"md",name:o.value?"expand_less":"expand_more"},null,8,["name"])):r.createCommentVNode("",!0),r.renderSlot(h.$slots,"append",{},void 0,!0),c.value?(r.openBlock(),r.createElementBlock("div",{key:5,class:r.normalizeClass([`fm-tab__indicator__wrapper--${h.vertical?"vertical":"horizontal"}`])},gg,2)):r.createCommentVNode("",!0)],42,mg)]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",bg,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.children,u=>r.renderSlot(h.$slots,"list-item",r.normalizeProps(r.guardReactiveProps(u)),()=>[r.createVNode(Vt,{"model-value":e.modelValue===u.value,label:u.label,icon:u.icon,disabled:u.disabled,onClick:p=>d(u.value)},{append:r.withCtx(()=>[u.badge?(r.openBlock(),r.createBlock(cn,{key:0,value:u.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])],!0)),256))])]),_:3},8,["show-menu","disabled","class","placement"]))}}),tb="",lr=et(yg,[["__scopeId","data-v-fae3740e"]]),_g=r.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"}," More ",-1),xg={class:"max-w-[360px] min-w-[186px]"},kg={FmBadge:cn,FmBreadcrumb:mr,FmButton:xt,FmButtonGroup:Br,FmCard:Vr,FmCardActions:Pr,FmCardSection:Ar,FmCardTitle:no,FmChip:so,FmChipGroup:oo,FmDialog:Nr,FmDropField:zr,FmDynamicDialog:ho,FmLineChart:ru,FmCheckbox:Aa,FmDatePicker:Mp,FmDateRangePicker:Jp,FmField:te,FmForm:tm,FmFormGroup:Wt,FmHelperText:Qa,FmLabel:er,FmRadio:lm,FmRadioGroup:cm,FmSelect:um,FmStepperField:bm,FmSwitch:vm,FmTextField:Vm,FmTextarea:Om,FmTimeInput:ir,FmTimePicker:Um,FmIcon:R,FmList:qm,FmListItem:Gm,FmMenu:_t,FmMenuItem:Vt,FmProgressIndicator:ar,FmSnackbar:sg,FmSpacer:io,FmStep:lg,FmStepper:hg,FmTab:lr,FmTabs:r.defineComponent({__name:"FmTabs",props:{modelValue:{default:null},items:{},vertical:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showMoreAt:{default:6}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=r.ref(!1),o=r.computed(()=>({vertical:e.vertical,disabled:e.disabled})),i=r.computed(()=>e.items.slice(0,e.showMoreAt)),a=r.computed(()=>e.items.slice(e.showMoreAt)),l=c=>{s.value=!1,t("update:modelValue",c)};return(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex",c.vertical?"flex-col":"flex-row items-center"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,h=>r.renderSlot(c.$slots,"default",r.normalizeProps(r.guardReactiveProps({...h,tabsProps:o.value})),()=>[r.createVNode(lr,r.mergeProps({"model-value":e.modelValue},{children:h.children,label:h.label,icon:h.icon,disabled:h.disabled,badge:h.badge,value:h.value,tabsProps:o.value},{disabled:h.disabled===void 0?c.disabled:h.disabled,vertical:c.vertical,"onUpdate:modelValue":d[0]||(d[0]=f=>t("update:modelValue",f))}),null,16,["model-value","disabled","vertical"])])),256)),a.value.length>0?(r.openBlock(),r.createBlock(_t,{key:0,"show-menu":s.value,class:r.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":c.vertical}]),placement:c.vertical?"right-start":"bottom-start",onDropdownChanged:d[1]||(d[1]=h=>s.value=h)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["flex gap-8 hover:bg-fm-color-opacity-sm items-center px-16 rounded-sm",[c.vertical?"h-40":"h-[46px]"]])},[r.createVNode(R,{name:"more_vert"}),_g],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",xg,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,h=>r.renderSlot(c.$slots,"list-item",r.normalizeProps(r.guardReactiveProps(h)),()=>[r.createVNode(Vt,{"model-value":e.modelValue===h.value,label:h.label,icon:h.icon,disabled:h.disabled,onClick:f=>l(h.value)},{append:r.withCtx(()=>[h.badge?(r.openBlock(),r.createBlock(cn,{key:0,value:h.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])])),256))])]),_:3},8,["show-menu","class","placement"])):r.createCommentVNode("",!0)],2))}}),FmTooltip:tr};function wg(){const n=r.inject(co);if(!n)throw new Error("No provider");return n}const Cg=n=>{n.use(pt,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),n.use(jr),Object.entries(kg).forEach(([t,e])=>{n.component(t,e)})};st.uiPlugin=Cg,st.useDialog=wg,st.useFormChild=sr,st.useValidation=nr,Object.defineProperty(st,Symbol.toStringTag,{value:"Module"})});
25
+ `):n}function jf(n,t){const{element:e,datasetIndex:s,index:o}=t,i=n.getDatasetMeta(s).controller,{label:a,value:l}=i.getLabelAndValue(o);return{chart:n,label:a,parsed:i.getParsed(o),raw:n.data.datasets[s].data[o],formattedValue:l,dataset:i.getDataset(),dataIndex:o,datasetIndex:s,element:e}}function Sa(n,t){const e=n.chart.ctx,{body:s,footer:o,title:i}=n,{boxWidth:a,boxHeight:l}=t,c=nt(t.bodyFont),d=nt(t.titleFont),h=nt(t.footerFont),f=i.length,u=o.length,p=s.length,m=rt(t.padding);let g=m.height,b=0,_=s.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(_+=n.beforeBody.length+n.afterBody.length,f&&(g+=f*d.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),_){const w=t.displayColors?Math.max(l,c.lineHeight):c.lineHeight;g+=p*w+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}u&&(g+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const k=function(w){b=Math.max(b,e.measureText(w).width+y)};return e.save(),e.font=d.string,j(n.title,k),e.font=c.string,j(n.beforeBody.concat(n.afterBody),k),y=t.displayColors?a+2+t.boxPadding:0,j(s,w=>{j(w.before,k),j(w.lines,k),j(w.after,k)}),y=0,e.font=h.string,j(n.footer,k),e.restore(),b+=m.width,{width:b,height:g}}function Yf(n,t){const{y:e,height:s}=t;return e<s/2?"top":e>n.height-s/2?"bottom":"center"}function Hf(n,t,e,s){const{x:o,width:i}=s,a=e.caretSize+e.caretPadding;if(n==="left"&&o+i+a>t.width||n==="right"&&o-i-a<0)return!0}function Uf(n,t,e,s){const{x:o,width:i}=e,{width:a,chartArea:{left:l,right:c}}=n;let d="center";return s==="center"?d=o<=(l+c)/2?"left":"right":o<=i/2?d="left":o>=a-i/2&&(d="right"),Hf(d,n,t,e)&&(d="center"),d}function Ma(n,t,e){const s=e.yAlign||t.yAlign||Yf(n,e);return{xAlign:e.xAlign||t.xAlign||Uf(n,t,e,s),yAlign:s}}function qf(n,t){let{x:e,width:s}=n;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Xf(n,t,e){let{y:s,height:o}=n;return t==="top"?s+=e:t==="bottom"?s-=o+e:s-=o/2,s}function va(n,t,e,s){const{caretSize:o,caretPadding:i,cornerRadius:a}=n,{xAlign:l,yAlign:c}=e,d=o+i,{topLeft:h,topRight:f,bottomLeft:u,bottomRight:p}=re(a);let m=qf(t,l);const g=Xf(t,c,d);return c==="center"?l==="left"?m+=d:l==="right"&&(m-=d):l==="left"?m-=Math.max(h,u)+o:l==="right"&&(m+=Math.max(f,p)+o),{x:st(m,0,s.width-t.width),y:st(g,0,s.height-t.height)}}function Yn(n,t,e){const s=rt(e.padding);return t==="center"?n.x+n.width/2:t==="right"?n.x+n.width-s.right:n.x+s.left}function Da(n){return Dt([],Lt(n))}function Kf(n,t,e){return Kt(n,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ba(n,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?n.override(e):n}const Ea={beforeTitle:Pt,title(n){if(n.length>0){const t=n[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:Pt,beforeBody:Pt,beforeLabel:Pt,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:Pt,afterBody:Pt,beforeFooter:Pt,footer:Pt,afterFooter:Pt};function dt(n,t,e,s){const o=n[t].call(e,s);return typeof o>"u"?Ea[t].call(e,s):o}class Us extends Nt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),o=s.enabled&&e.options.animation&&s.animations,i=new yi(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=Kf(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,o=dt(s,"beforeTitle",this,t),i=dt(s,"title",this,t),a=dt(s,"afterTitle",this,t);let l=[];return l=Dt(l,Lt(o)),l=Dt(l,Lt(i)),l=Dt(l,Lt(a)),l}getBeforeBody(t,e){return Da(dt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,o=[];return j(t,i=>{const a={before:[],lines:[],after:[]},l=Ba(s,i);Dt(a.before,Lt(dt(l,"beforeLabel",this,i))),Dt(a.lines,dt(l,"label",this,i)),Dt(a.after,Lt(dt(l,"afterLabel",this,i))),o.push(a)}),o}getAfterBody(t,e){return Da(dt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,o=dt(s,"beforeFooter",this,t),i=dt(s,"footer",this,t),a=dt(s,"afterFooter",this,t);let l=[];return l=Dt(l,Lt(o)),l=Dt(l,Lt(i)),l=Dt(l,Lt(a)),l}_createItems(t){const e=this._active,s=this.chart.data,o=[],i=[],a=[];let l=[],c,d;for(c=0,d=e.length;c<d;++c)l.push(jf(this.chart,e[c]));return t.filter&&(l=l.filter((h,f,u)=>t.filter(h,f,u,s))),t.itemSort&&(l=l.sort((h,f)=>t.itemSort(h,f,s))),j(l,h=>{const f=Ba(t.callbacks,h);o.push(dt(f,"labelColor",this,h)),i.push(dt(f,"labelPointStyle",this,h)),a.push(dt(f,"labelTextColor",this,h))}),this.labelColors=o,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=l,l}update(t,e){const s=this.options.setContext(this.getContext()),o=this._active;let i,a=[];if(!o.length)this.opacity!==0&&(i={opacity:0});else{const l=Qe[s.position].call(this,o,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);const c=this._size=Sa(this,s),d=Object.assign({},l,c),h=Ma(this.chart,s,d),f=va(s,d,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,i={opacity:1,x:f.x,y:f.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,o){const i=this.getCaretPosition(t,s,o);e.lineTo(i.x1,i.y1),e.lineTo(i.x2,i.y2),e.lineTo(i.x3,i.y3)}getCaretPosition(t,e,s){const{xAlign:o,yAlign:i}=this,{caretSize:a,cornerRadius:l}=s,{topLeft:c,topRight:d,bottomLeft:h,bottomRight:f}=re(l),{x:u,y:p}=t,{width:m,height:g}=e;let b,_,y,k,w,x;return i==="center"?(w=p+g/2,o==="left"?(b=u,_=b-a,k=w+a,x=w-a):(b=u+m,_=b+a,k=w-a,x=w+a),y=b):(o==="left"?_=u+Math.max(c,h)+a:o==="right"?_=u+m-Math.max(d,f)-a:_=this.caretX,i==="top"?(k=p,w=k-a,b=_-a,y=_+a):(k=p+g,w=k+a,b=_+a,y=_-a),x=k),{x1:b,x2:_,x3:y,y1:k,y2:w,y3:x}}drawTitle(t,e,s){const o=this.title,i=o.length;let a,l,c;if(i){const d=Se(s.rtl,this.x,this.width);for(t.x=Yn(this,s.titleAlign,s),e.textAlign=d.textAlign(s.titleAlign),e.textBaseline="middle",a=nt(s.titleFont),l=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,c=0;c<i;++c)e.fillText(o[c],d.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+l,c+1===i&&(t.y+=s.titleMarginBottom-l)}}_drawColorBox(t,e,s,o,i){const a=this.labelColors[s],l=this.labelPointStyles[s],{boxHeight:c,boxWidth:d}=i,h=nt(i.bodyFont),f=Yn(this,"left",i),u=o.x(f),p=c<h.lineHeight?(h.lineHeight-c)/2:0,m=e.y+p;if(i.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=o.leftForLtr(u,d)+d/2,_=m+c/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,ws(t,g,b,_),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,ws(t,g,b,_)}else{t.lineWidth=I(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const g=o.leftForLtr(u,d),b=o.leftForLtr(o.xPlus(u,1),d-2),_=re(a.borderRadius);Object.values(_).some(y=>y!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,ze(t,{x:g,y:m,w:d,h:c,radius:_}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ze(t,{x:b,y:m+1,w:d-2,h:c-2,radius:_}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(g,m,d,c),t.strokeRect(g,m,d,c),t.fillStyle=a.backgroundColor,t.fillRect(b,m+1,d-2,c-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:o}=this,{bodySpacing:i,bodyAlign:a,displayColors:l,boxHeight:c,boxWidth:d,boxPadding:h}=s,f=nt(s.bodyFont);let u=f.lineHeight,p=0;const m=Se(s.rtl,this.x,this.width),g=function(S){e.fillText(S,m.x(t.x+p),t.y+u/2),t.y+=u+i},b=m.textAlign(a);let _,y,k,w,x,C,M;for(e.textAlign=a,e.textBaseline="middle",e.font=f.string,t.x=Yn(this,b,s),e.fillStyle=s.bodyColor,j(this.beforeBody,g),p=l&&b!=="right"?a==="center"?d/2+h:d+2+h:0,w=0,C=o.length;w<C;++w){for(_=o[w],y=this.labelTextColors[w],e.fillStyle=y,j(_.before,g),k=_.lines,l&&k.length&&(this._drawColorBox(e,t,w,m,s),u=Math.max(f.lineHeight,c)),x=0,M=k.length;x<M;++x)g(k[x]),u=f.lineHeight;j(_.after,g)}p=0,u=f.lineHeight,j(this.afterBody,g),t.y-=i}drawFooter(t,e,s){const o=this.footer,i=o.length;let a,l;if(i){const c=Se(s.rtl,this.x,this.width);for(t.x=Yn(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=c.textAlign(s.footerAlign),e.textBaseline="middle",a=nt(s.footerFont),e.fillStyle=s.footerColor,e.font=a.string,l=0;l<i;++l)e.fillText(o[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,e,s,o){const{xAlign:i,yAlign:a}=this,{x:l,y:c}=t,{width:d,height:h}=s,{topLeft:f,topRight:u,bottomLeft:p,bottomRight:m}=re(o.cornerRadius);e.fillStyle=o.backgroundColor,e.strokeStyle=o.borderColor,e.lineWidth=o.borderWidth,e.beginPath(),e.moveTo(l+f,c),a==="top"&&this.drawCaret(t,e,s,o),e.lineTo(l+d-u,c),e.quadraticCurveTo(l+d,c,l+d,c+u),a==="center"&&i==="right"&&this.drawCaret(t,e,s,o),e.lineTo(l+d,c+h-m),e.quadraticCurveTo(l+d,c+h,l+d-m,c+h),a==="bottom"&&this.drawCaret(t,e,s,o),e.lineTo(l+p,c+h),e.quadraticCurveTo(l,c+h,l,c+h-p),a==="center"&&i==="left"&&this.drawCaret(t,e,s,o),e.lineTo(l,c+f),e.quadraticCurveTo(l,c,l+f,c),e.closePath(),e.fill(),o.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,o=s&&s.x,i=s&&s.y;if(o||i){const a=Qe[t.position].call(this,this._active,this._eventPosition);if(!a)return;const l=this._size=Sa(this,t),c=Object.assign({},a,this._size),d=Ma(e,t,c),h=va(t,c,d,e);(o._to!==h.x||i._to!==h.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=l.width,this.height=l.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 s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const o={width:this.width,height:this.height},i={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const a=rt(e.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&l&&(t.save(),t.globalAlpha=s,this.drawBackground(i,t,o,e),ci(t,e.textDirection),i.y+=a.top,this.drawTitle(i,t,e),this.drawBody(i,t,e),this.drawFooter(i,t,e),di(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,o=t.map(({datasetIndex:l,index:c})=>{const d=this.chart.getDatasetMeta(l);if(!d)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:d.data[c],index:c}}),i=!mn(s,o),a=this._positionChanged(o,e);(i||a)&&(this._active=o,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const o=this.options,i=this._active||[],a=this._getActiveElements(t,i,e,s),l=this._positionChanged(a,t),c=e||!mn(a,i)||l;return c&&(this._active=a,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),c}_getActiveElements(t,e,s,o){const i=this.options;if(t.type==="mouseout")return[];if(!o)return e;const a=this.chart.getElementsAtEventForMode(t,i.mode,i,s);return i.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:s,caretY:o,options:i}=this,a=Qe[i.position].call(this,t,e);return a!==!1&&(s!==a.x||o!==a.y)}}P(Us,"positioners",Qe);var Gf={id:"tooltip",_element:Us,positioners:Qe,afterInit(n,t,e){e&&(n.tooltip=new Us({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:Ea},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"]},Zf=Object.freeze({__proto__:null,Colors:cf,Decimation:uf,Filler:Af,Legend:Rf,SubTitle:Wf,Title:zf,Tooltip:Gf});const Jf=(n,t,e,s)=>(typeof t=="string"?(e=n.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Qf(n,t,e,s){const o=n.indexOf(t);if(o===-1)return Jf(n,t,e,s);const i=n.lastIndexOf(t);return o!==i?e:o}const tu=(n,t)=>n===null?null:st(Math.round(n),0,t);function Va(n){const t=this.getLabels();return n>=0&&n<t.length?t[n]:n}class qs extends ue{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:o,label:i}of e)s[o]===i&&s.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(z(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Qf(s,t,L(e,t),this._addedLabels),tu(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(o=this.getLabels().length-1)),this.min=s,this.max=o}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,o=[];let i=this.getLabels();i=t===0&&e===i.length-1?i:i.slice(t,e+1),this._valueRange=Math.max(i.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=e;a++)o.push({value:a});return o}getLabelForValue(t){return Va.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}}P(qs,"id","category"),P(qs,"defaults",{ticks:{callback:Va}});function eu(n,t){const e=[],{bounds:o,step:i,min:a,max:l,precision:c,count:d,maxTicks:h,maxDigits:f,includeBounds:u}=n,p=i||1,m=h-1,{min:g,max:b}=t,_=!z(a),y=!z(l),k=!z(d),w=(b-g)/(f+1);let x=Ao((b-g)/m/p)*p,C,M,S,B;if(x<1e-14&&!_&&!y)return[{value:g},{value:b}];B=Math.ceil(b/x)-Math.floor(g/x),B>m&&(x=Ao(B*x/m/p)*p),z(c)||(C=Math.pow(10,c),x=Math.ceil(x*C)/C),o==="ticks"?(M=Math.floor(g/x)*x,S=Math.ceil(b/x)*x):(M=g,S=b),_&&y&&i&&Xl((l-a)/i,x/1e3)?(B=Math.round(Math.min((l-a)/x,h)),x=(l-a)/B,M=a,S=l):k?(M=_?a:M,S=y?l:S,B=d-1,x=(S-M)/B):(B=(S-M)/x,Ne(B,Math.round(B),x/1e3)?B=Math.round(B):B=Math.ceil(B));const E=Math.max(To(x),To(M));C=Math.pow(10,z(c)?E:c),M=Math.round(M*C)/C,S=Math.round(S*C)/C;let A=0;for(_&&(u&&M!==a?(e.push({value:a}),M<a&&A++,Ne(Math.round((M+A*x)*C)/C,a,Pa(a,w,n))&&A++):M<a&&A++);A<B;++A){const N=Math.round((M+A*x)*C)/C;if(y&&N>l)break;e.push({value:N})}return y&&u&&S!==l?e.length&&Ne(e[e.length-1].value,l,Pa(l,w,n))?e[e.length-1].value=l:e.push({value:l}):(!y||S===l)&&e.push({value:S}),e}function Pa(n,t,{horizontal:e,minRotation:s}){const o=Ct(s),i=(e?Math.sin(o):Math.cos(o))||.001,a=.75*t*(""+n).length;return Math.min(t/i,a)}class Hn extends ue{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:o,max:i}=this;const a=c=>o=e?o:c,l=c=>i=s?i:c;if(t){const c=Mt(o),d=Mt(i);c<0&&d<0?l(0):c>0&&d>0&&a(0)}if(o===i){let c=i===0?1:Math.abs(i*.05);l(i+c),t||a(o-c)}this.min=o,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,o;return s?(o=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,o>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${o} ticks. Limiting to 1000.`),o=1e3)):(o=this.computeTickLimit(),e=e||11),e&&(o=Math.min(e,o)),o}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const o={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},i=this._range||this,a=eu(o,i);return t.bounds==="ticks"&&Fo(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const o=(s-e)/Math.max(t.length-1,1)/2;e-=o,s+=o}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return Re(t,this.chart.options.locale,this.options.ticks.format)}}class Xs extends Hn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?t:0,this.max=Z(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=Ct(this.options.ticks.minRotation),o=(t?Math.sin(s):Math.cos(s))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,i.lineHeight/o))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(Xs,"id","linear"),P(Xs,"defaults",{ticks:{callback:_n.formatters.numeric}});const tn=n=>Math.floor(Xt(n)),pe=(n,t)=>Math.pow(10,tn(n)+t);function Oa(n){return n/Math.pow(10,tn(n))===1}function Aa(n,t,e){const s=Math.pow(10,e),o=Math.floor(n/s);return Math.ceil(t/s)-o}function nu(n,t){const e=t-n;let s=tn(e);for(;Aa(n,t,s)>10;)s++;for(;Aa(n,t,s)<10;)s--;return Math.min(s,tn(n))}function su(n,{min:t,max:e}){t=pt(n.min,t);const s=[],o=tn(t);let i=nu(t,e),a=i<0?Math.pow(10,Math.abs(i)):1;const l=Math.pow(10,i),c=o>i?Math.pow(10,o):0,d=Math.round((t-c)*a)/a,h=Math.floor((t-c)/l/10)*l*10;let f=Math.floor((d-h)/Math.pow(10,i)),u=pt(n.min,Math.round((c+h+f*Math.pow(10,i))*a)/a);for(;u<e;)s.push({value:u,major:Oa(u),significand:f}),f>=10?f=f<15?15:20:f++,f>=20&&(i++,f=2,a=i>=0?1:a),u=Math.round((c+h+f*Math.pow(10,i))*a)/a;const p=pt(n.max,u);return s.push({value:p,major:Oa(p),significand:f}),s}class Ks extends ue{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const s=Hn.prototype.parse.apply(this,[t,e]);if(s===0){this._zero=!0;return}return Z(s)&&s>0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=Z(t)?Math.max(0,t):null,this.max=Z(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Z(this._userMin)&&(this.min=t===pe(this.min,0)?pe(this.min,-1):pe(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,o=this.max;const i=l=>s=t?s:l,a=l=>o=e?o:l;s===o&&(s<=0?(i(1),a(10)):(i(pe(s,-1)),a(pe(o,1)))),s<=0&&i(pe(o,-1)),o<=0&&a(pe(s,1)),this.min=s,this.max=o}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=su(e,this);return t.bounds==="ticks"&&Fo(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":Re(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Xt(t),this._valueRange=Xt(this.max)-Xt(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Xt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}P(Ks,"id","logarithmic"),P(Ks,"defaults",{ticks:{callback:_n.formatters.logarithmic,major:{enabled:!0}}});function Gs(n){const t=n.ticks;if(t.display&&n.display){const e=rt(t.backdropPadding);return L(t.font&&t.font.size,J.font.size)+e.height}return 0}function ou(n,t,e){return e=q(e)?e:[e],{w:hc(n,t.string,e),h:e.length*t.lineHeight}}function Fa(n,t,e,s,o){return n===s||n===o?{start:t-e/2,end:t+e/2}:n<s||n>o?{start:t-e,end:t}:{start:t,end:t+e}}function iu(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),s=[],o=[],i=n._pointLabels.length,a=n.options.pointLabels,l=a.centerPointLabels?X/i:0;for(let c=0;c<i;c++){const d=a.setContext(n.getPointLabelContext(c));o[c]=d.padding;const h=n.getPointPosition(c,n.drawingArea+o[c],l),f=nt(d.font),u=ou(n.ctx,f,n._pointLabels[c]);s[c]=u;const p=mt(n.getIndexAngle(c)+l),m=Math.round(ps(p)),g=Fa(m,h.x,u.w,0,180),b=Fa(m,h.y,u.h,90,270);au(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=cu(n,s,o)}function au(n,t,e,s,o){const i=Math.abs(Math.sin(e)),a=Math.abs(Math.cos(e));let l=0,c=0;s.start<t.l?(l=(t.l-s.start)/i,n.l=Math.min(n.l,t.l-l)):s.end>t.r&&(l=(s.end-t.r)/i,n.r=Math.max(n.r,t.r+l)),o.start<t.t?(c=(t.t-o.start)/a,n.t=Math.min(n.t,t.t-c)):o.end>t.b&&(c=(o.end-t.b)/a,n.b=Math.max(n.b,t.b+c))}function ru(n,t,e){const s=n.drawingArea,{extra:o,additionalAngle:i,padding:a,size:l}=e,c=n.getPointPosition(t,s+o+a,i),d=Math.round(ps(mt(c.angle+tt))),h=fu(c.y,l.h,d),f=du(d),u=hu(c.x,l.w,f);return{visible:!0,x:c.x,y:h,textAlign:f,left:u,top:h,right:u+l.w,bottom:h+l.h}}function lu(n,t){if(!t)return!0;const{left:e,top:s,right:o,bottom:i}=n;return!(Ft({x:e,y:s},t)||Ft({x:e,y:i},t)||Ft({x:o,y:s},t)||Ft({x:o,y:i},t))}function cu(n,t,e){const s=[],o=n._pointLabels.length,i=n.options,{centerPointLabels:a,display:l}=i.pointLabels,c={extra:Gs(i)/2,additionalAngle:a?X/o:0};let d;for(let h=0;h<o;h++){c.padding=e[h],c.size=t[h];const f=ru(n,h,c);s.push(f),l==="auto"&&(f.visible=lu(f,d),f.visible&&(d=f))}return s}function du(n){return n===0||n===180?"center":n<180?"left":"right"}function hu(n,t,e){return e==="right"?n-=t:e==="center"&&(n-=t/2),n}function fu(n,t,e){return e===90||e===270?n-=t/2:(e>270||e<90)&&(n-=t),n}function uu(n,t,e){const{left:s,top:o,right:i,bottom:a}=e,{backdropColor:l}=t;if(!z(l)){const c=re(t.borderRadius),d=rt(t.backdropPadding);n.fillStyle=l;const h=s-d.left,f=o-d.top,u=i-s+d.width,p=a-o+d.height;Object.values(c).some(m=>m!==0)?(n.beginPath(),ze(n,{x:h,y:f,w:u,h:p,radius:c}),n.fill()):n.fillRect(h,f,u,p)}}function pu(n,t){const{ctx:e,options:{pointLabels:s}}=n;for(let o=t-1;o>=0;o--){const i=n._pointLabelItems[o];if(!i.visible)continue;const a=s.setContext(n.getPointLabelContext(o));uu(e,a,i);const l=nt(a.font),{x:c,y:d,textAlign:h}=i;ae(e,n._pointLabels[o],c,d+l.lineHeight/2,l,{color:a.color,textAlign:h,textBaseline:"middle"})}}function Ta(n,t,e,s){const{ctx:o}=n;if(e)o.arc(n.xCenter,n.yCenter,t,0,K);else{let i=n.getPointPosition(0,t);o.moveTo(i.x,i.y);for(let a=1;a<s;a++)i=n.getPointPosition(a,t),o.lineTo(i.x,i.y)}}function mu(n,t,e,s,o){const i=n.ctx,a=t.circular,{color:l,lineWidth:c}=t;!a&&!s||!l||!c||e<0||(i.save(),i.strokeStyle=l,i.lineWidth=c,i.setLineDash(o.dash),i.lineDashOffset=o.dashOffset,i.beginPath(),Ta(n,e,a,s),i.closePath(),i.stroke(),i.restore())}function gu(n,t,e){return Kt(n,{label:e,index:t,type:"pointLabel"})}class en extends Hn{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(Gs(this.options)/2),e=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(e,s)/2)}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!1);this.min=Z(t)&&!isNaN(t)?t:0,this.max=Z(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gs(this.options))}generateTickLabels(t){Hn.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{const o=H(this.options.pointLabels.callback,[e,s],this);return o||o===0?o:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?iu(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,o){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-o)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,o))}getIndexAngle(t){const e=K/(this._pointLabels.length||1),s=this.options.startAngle||0;return mt(t*e+Ct(s))}getDistanceFromCenterForValue(t){if(z(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(z(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t<e.length){const s=e[t];return gu(this.getContext(),t,s)}}getPointPosition(t,e,s=0){const o=this.getIndexAngle(t)-tt+s;return{x:Math.cos(o)*e+this.xCenter,y:Math.sin(o)*e+this.yCenter,angle:o}}getPointPositionForValue(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:e,top:s,right:o,bottom:i}=this._pointLabelItems[t];return{left:e,top:s,right:o,bottom:i}}drawBackground(){const{backgroundColor:t,grid:{circular:e}}=this.options;if(t){const s=this.ctx;s.save(),s.beginPath(),Ta(this,this.getDistanceFromCenterForValue(this._endValue),e,this._pointLabels.length),s.closePath(),s.fillStyle=t,s.fill(),s.restore()}}drawGrid(){const t=this.ctx,e=this.options,{angleLines:s,grid:o,border:i}=e,a=this._pointLabels.length;let l,c,d;if(e.pointLabels.display&&pu(this,a),o.display&&this.ticks.forEach((h,f)=>{if(f!==0){c=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(f),p=o.setContext(u),m=i.setContext(u);mu(this,p,c,a,m)}}),s.display){for(t.save(),l=a-1;l>=0;l--){const h=s.setContext(this.getPointLabelContext(l)),{color:f,lineWidth:u}=h;!u||!f||(t.lineWidth=u,t.strokeStyle=f,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,c=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),d=this.getPointPosition(l,c),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,s=e.ticks;if(!s.display)return;const o=this.getIndexAngle(0);let i,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(o),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((l,c)=>{if(c===0&&!e.reverse)return;const d=s.setContext(this.getContext(c)),h=nt(d.font);if(i=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){t.font=h.string,a=t.measureText(l.label).width,t.fillStyle=d.backdropColor;const f=rt(d.backdropPadding);t.fillRect(-a/2-f.left,-i-h.size/2-f.top,a+f.width,h.size+f.height)}ae(t,l.label,0,-i,h,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),t.restore()}drawTitle(){}}P(en,"id","radialLinear"),P(en,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:_n.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),P(en,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),P(en,"descriptors",{angleLines:{_fallback:"grid"}});const Un={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}},ht=Object.keys(Un);function Na(n,t){return n-t}function $a(n,t){if(z(t))return null;const e=n._adapter,{parser:s,round:o,isoWeekday:i}=n._parseOpts;let a=t;return typeof s=="function"&&(a=s(a)),Z(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(o&&(a=o==="week"&&(ke(i)||i===!0)?e.startOf(a,"isoWeek",i):e.startOf(a,o)),+a)}function La(n,t,e,s){const o=ht.length;for(let i=ht.indexOf(n);i<o-1;++i){const a=Un[ht[i]],l=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(l*a.size))<=s)return ht[i]}return ht[o-1]}function bu(n,t,e,s,o){for(let i=ht.length-1;i>=ht.indexOf(e);i--){const a=ht[i];if(Un[a].common&&n._adapter.diff(o,s,a)>=t-1)return a}return ht[e?ht.indexOf(e):0]}function yu(n){for(let t=ht.indexOf(n)+1,e=ht.length;t<e;++t)if(Un[ht[t]].common)return ht[t]}function Ra(n,t,e){if(!e)n[t]=!0;else if(e.length){const{lo:s,hi:o}=gs(e,t),i=e[s]>=t?e[s]:e[o];n[i]=!0}}function _u(n,t,e,s){const o=n._adapter,i=+o.startOf(t[0].value,s),a=t[t.length-1].value;let l,c;for(l=i;l<=a;l=+o.add(l,1,s))c=e[l],c>=0&&(t[c].major=!0);return t}function Ia(n,t,e){const s=[],o={},i=t.length;let a,l;for(a=0;a<i;++a)l=t[a],o[l]=a,s.push({value:l,major:!1});return i===0||!e?s:_u(n,s,o,e)}class nn extends ue{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),o=this._adapter=new Dd._date(t.adapters.date);o.init(e),Fe(s.displayFormats,o.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:$a(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:o,max:i,minDefined:a,maxDefined:l}=this.getUserBounds();function c(d){!a&&!isNaN(d.min)&&(o=Math.min(o,d.min)),!l&&!isNaN(d.max)&&(i=Math.max(i,d.max))}(!a||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),o=Z(o)&&!isNaN(o)?o:+e.startOf(Date.now(),s),i=Z(i)&&!isNaN(i)?i:+e.endOf(Date.now(),s)+1,this.min=Math.min(o,i-1),this.max=Math.max(o+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,o=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);const i=this.min,a=this.max,l=Jl(o,i,a);return this._unit=e.unit||(s.autoSkip?La(e.minUnit,this.min,this.max,this._getLabelCapacity(i)):bu(this,l.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:yu(this._unit),this.initOffsets(o),t.reverse&&l.reverse(),Ia(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,o,i;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?e=1-o:e=(this.getDecimalForValue(t[1])-o)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?s=i:s=(i-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=st(e,0,a),s=st(s,0,a),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,o=this.options,i=o.time,a=i.unit||La(i.minUnit,e,s,this._getLabelCapacity(e)),l=L(o.ticks.stepSize,1),c=a==="week"?i.isoWeekday:!1,d=ke(c)||c===!0,h={};let f=e,u,p;if(d&&(f=+t.startOf(f,"isoWeek",c)),f=+t.startOf(f,d?"day":a),t.diff(s,e,a)>1e5*l)throw new Error(e+" and "+s+" are too far apart with stepSize of "+l+" "+a);const m=o.ticks.source==="data"&&this.getDataTimestamps();for(u=f,p=0;u<s;u=+t.add(u,l,a),p++)Ra(h,u,m);return(u===s||o.bounds==="ticks"||p===1)&&Ra(h,u,m),Object.keys(h).sort(Na).map(g=>+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const o=this.options.time.displayFormats,i=this._unit,a=e||o[i];return this._adapter.format(t,a)}_tickFormatFunction(t,e,s,o){const i=this.options,a=i.ticks.callback;if(a)return H(a,[t,e,s],this);const l=i.time.displayFormats,c=this._unit,d=this._majorUnit,h=c&&l[c],f=d&&l[d],u=s[e],p=d&&f&&u&&u.major;return this._adapter.format(t,o||(p?f:h))}generateTickLabels(t){let e,s,o;for(e=0,s=t.length;e<s;++e)o=t[e],o.label=this._tickFormatFunction(o.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,o=Ct(this.isHorizontal()?e.maxRotation:e.minRotation),i=Math.cos(o),a=Math.sin(o),l=this._resolveTickFontOptions(0).size;return{w:s*i+l*a,h:s*a+l*i}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,o=s[e.unit]||s.millisecond,i=this._tickFormatFunction(t,0,Ia(this,[t],this._majorUnit),o),a=this._getLabelSize(i),l=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(e=0,s=o.length;e<s;++e)t=t.concat(o[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const o=this.getLabels();for(e=0,s=o.length;e<s;++e)t.push($a(this,o[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ro(t.sort(Na))}}P(nn,"id","time"),P(nn,"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 qn(n,t,e){let s=0,o=n.length-1,i,a,l,c;e?(t>=n[s].pos&&t<=n[o].pos&&({lo:s,hi:o}=At(n,"pos",t)),{pos:i,time:l}=n[s],{pos:a,time:c}=n[o]):(t>=n[s].time&&t<=n[o].time&&({lo:s,hi:o}=At(n,"time",t)),{time:i,pos:l}=n[s],{time:a,pos:c}=n[o]);const d=a-i;return d?l+(c-l)*(t-i)/d:l}class Zs extends nn{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=qn(e,this.min),this._tableRange=qn(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,o=[],i=[];let a,l,c,d,h;for(a=0,l=t.length;a<l;++a)d=t[a],d>=e&&d<=s&&o.push(d);if(o.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(a=0,l=o.length;a<l;++a)h=o[a+1],c=o[a-1],d=o[a],Math.round((h+c)/2)!==d&&i.push({time:d,pos:a/(l-1)});return i}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((o,i)=>o-i)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(qn(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return qn(this._table,s*this._tableRange+this._minPos,!0)}}P(Zs,"id","timeseries"),P(Zs,"defaults",nn.defaults);var xu=Object.freeze({__proto__:null,CategoryScale:qs,LinearScale:Xs,LogarithmicScale:Ks,RadialLinearScale:en,TimeScale:nn,TimeSeriesScale:Zs});const ku=[vd,nf,Zf,xu];$t.register(...ku);const wu={class:"px-24 py-16"},Cu={class:"flex flex-col gap-8"},Su={class:"fm-color-typo-primary fm-typo-body-lg-400"},Mu={class:"fm-color-typo-secondary fm-typo-body-md-400"},vu=r.defineComponent({__name:"FmLine",props:{name:{default:void 0},paragraph:{default:void 0},datasets:{},xAxis:{}},setup(n){const t=n,e=r.ref(null);let s=null;r.watch([()=>t.xAxis,()=>t.datasets],()=>{s&&(s.data.datasets=t.datasets,s.data.labels=t.xAxis.categories,s.update())});function o(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 i(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,o(h,.5)),p.addColorStop(1,o(h,0)),p}const l=r.computed(()=>({labels:t.xAxis.categories,datasets:t.datasets.map(d=>{const h=i(d.color)??"";return{...d,backgroundColor:h?f=>a({context:f,color:h}):"",borderColor:h,borderDash:d.dash?[5,5]:void 0,tension:.1}})}));function c(){e.value&&(s=new $t(e.value,{type:"line",data:l.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 r.onMounted(()=>{c()}),(d,h)=>(r.openBlock(),r.createElementBlock("div",wu,[r.createElementVNode("div",Cu,[r.createElementVNode("div",Su,r.toDisplayString(d.name),1),r.createElementVNode("div",Mu,r.toDisplayString(d.paragraph),1)]),r.createElementVNode("canvas",{ref_key:"canvas",ref:e},null,512)]))}});function Du(){var n;return(n=r.getCurrentInstance())==null?void 0:n.emit}function gt(n,t){const e=Du(),s=r.ref(n[t]);return r.watch(()=>n[t],()=>{s.value=n[t]}),r.computed({get(){return s.value},set(i){s.value=i,e==null||e(`update:${t}`,i)}})}function ft(n,t){return typeof n!="object"&&typeof t!="object"?n===t:Object.keys(n).length!==Object.keys(t).length?!1:Object.keys(n).every(e=>ft(n[e],t[e]))}const Bu={class:"fm-checkbox"},Eu={class:"fm-checkbox--wrapper"},Vu={class:"fm-checkbox__input--container"},Pu=["checked","disabled","indeterminate"],Ou={key:0,class:"fm-checkbox__label-container"},Au={class:"fm-typo-body-lg-400"},Fu={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},za=r.defineComponent({__name:"FmCheckbox",props:{modelValue:{type:[Boolean,Array]},label:{},sublabel:{default:""},disabled:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},value:{}},emits:["update:modelValue","update:indeterminate"],setup(n){const t=n,e=gt(t,"modelValue"),s=gt(t,"indeterminate"),o=Array.isArray(e.value),i=r.ref(o?e.value.some(c=>ft(c,t.value)):e.value),a=r.computed(()=>{const c=o?e.value.some(d=>ft(d,t.value)):e.value;return s.value&&!c?"remove":e.value?"check_small":""});function l(){if(t.disabled)return;s.value=!1,i.value=!i.value;let c=e.value;o?c=i.value?c.concat(t.value):c.filter(d=>!ft(d,t.value)):c=i.value,e.value=c}return r.watch(()=>e.value,()=>{i.value=o?e.value.some(c=>ft(c,t.value)):e.value}),(c,d)=>(r.openBlock(),r.createElementBlock("div",Bu,[r.createElementVNode("label",Eu,[r.createElementVNode("div",Vu,[r.createElementVNode("input",{class:r.normalizeClass({"fm-checkbox__input--btn":!0,"fm-checkbox__input--btn--checked":i.value}),type:"checkbox",checked:i.value,disabled:t.disabled,indeterminate:r.unref(s),onClick:l},null,10,Pu),r.unref(s)||i.value?(r.openBlock(),r.createBlock(R,{key:0,class:"fm-checkbox__input--checkmark",name:a.value,size:"md",color:"#FFFFFF"},null,8,["name"])):r.createCommentVNode("",!0)]),t.label?(r.openBlock(),r.createElementBlock("div",Ou,[r.renderSlot(c.$slots,"label"),r.createElementVNode("div",Au,r.toDisplayString(t.label),1),t.sublabel?(r.openBlock(),r.createElementBlock("div",Fu,r.toDisplayString(t.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)])]))}}),tb="";var Tu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Wa={exports:{}};(function(n,t){(function(e,s){n.exports=s()})(Tu,function(){var e=1e3,s=6e4,o=36e5,i="millisecond",a="second",l="minute",c="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{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var D=["th","st","nd","rd"],v=F%100;return"["+F+(D[(v-20)%10]||D[v]||D[0])+"]"}},k=function(F,D,v){var V=String(F);return!V||V.length>=D?F:""+Array(D+1-V.length).join(v)+F},w={s:k,z:function(F){var D=-F.utcOffset(),v=Math.abs(D),V=Math.floor(v/60),O=v%60;return(D<=0?"+":"-")+k(V,2,"0")+":"+k(O,2,"0")},m:function F(D,v){if(D.date()<v.date())return-F(v,D);var V=12*(v.year()-D.year())+(v.month()-D.month()),O=D.clone().add(V,f),T=v-O<0,$=D.clone().add(V+(T?-1:1),f);return+(-(V+(v-O)/(T?O-$:$-O))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:f,y:p,w:h,d,D:m,h:c,m:l,s:a,ms:i,Q:u}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},x="en",C={};C[x]=y;var M="$isDayjsObject",S=function(F){return F instanceof N||!(!F||!F[M])},B=function F(D,v,V){var O;if(!D)return x;if(typeof D=="string"){var T=D.toLowerCase();C[T]&&(O=T),v&&(C[T]=v,O=T);var $=D.split("-");if(!O&&$.length>1)return F($[0])}else{var W=D.name;C[W]=D,O=W}return!V&&O&&(x=O),O||!V&&x},E=function(F,D){if(S(F))return F.clone();var v=typeof D=="object"?D:{};return v.date=F,v.args=arguments,new N(v)},A=w;A.l=B,A.i=S,A.w=function(F,D){return E(F,{locale:D.$L,utc:D.$u,x:D.$x,$offset:D.$offset})};var N=function(){function F(v){this.$L=B(v.locale,null,!0),this.parse(v),this.$x=this.$x||v.x||{},this[M]=!0}var D=F.prototype;return D.parse=function(v){this.$d=function(V){var O=V.date,T=V.utc;if(O===null)return new Date(NaN);if(A.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var $=O.match(b);if($){var W=$[2]-1||0,Y=($[7]||"0").substring(0,3);return T?new Date(Date.UTC($[1],W,$[3]||1,$[4]||0,$[5]||0,$[6]||0,Y)):new Date($[1],W,$[3]||1,$[4]||0,$[5]||0,$[6]||0,Y)}}return new Date(O)}(v),this.init()},D.init=function(){var v=this.$d;this.$y=v.getFullYear(),this.$M=v.getMonth(),this.$D=v.getDate(),this.$W=v.getDay(),this.$H=v.getHours(),this.$m=v.getMinutes(),this.$s=v.getSeconds(),this.$ms=v.getMilliseconds()},D.$utils=function(){return A},D.isValid=function(){return this.$d.toString()!==g},D.isSame=function(v,V){var O=E(v);return this.startOf(V)<=O&&O<=this.endOf(V)},D.isAfter=function(v,V){return E(v)<this.startOf(V)},D.isBefore=function(v,V){return this.endOf(V)<E(v)},D.$g=function(v,V,O){return A.u(v)?this[V]:this.set(O,v)},D.unix=function(){return Math.floor(this.valueOf()/1e3)},D.valueOf=function(){return this.$d.getTime()},D.startOf=function(v,V){var O=this,T=!!A.u(V)||V,$=A.p(v),W=function(_e,ut){var ne=A.w(O.$u?Date.UTC(O.$y,ut,_e):new Date(O.$y,ut,_e),O);return T?ne:ne.endOf(d)},Y=function(_e,ut){return A.w(O.toDate()[_e].apply(O.toDate("s"),(T?[0,0,0,0]:[23,59,59,999]).slice(ut)),O)},G=this.$W,Q=this.$M,ot=this.$D,wt="set"+(this.$u?"UTC":"");switch($){case p:return T?W(1,0):W(31,11);case f:return T?W(1,Q):W(0,Q+1);case h:var ye=this.$locale().weekStart||0,ln=(G<ye?G+7:G)-ye;return W(T?ot-ln:ot+(6-ln),Q);case d:case m:return Y(wt+"Hours",0);case c:return Y(wt+"Minutes",1);case l:return Y(wt+"Seconds",2);case a:return Y(wt+"Milliseconds",3);default:return this.clone()}},D.endOf=function(v){return this.startOf(v,!1)},D.$set=function(v,V){var O,T=A.p(v),$="set"+(this.$u?"UTC":""),W=(O={},O[d]=$+"Date",O[m]=$+"Date",O[f]=$+"Month",O[p]=$+"FullYear",O[c]=$+"Hours",O[l]=$+"Minutes",O[a]=$+"Seconds",O[i]=$+"Milliseconds",O)[T],Y=T===d?this.$D+(V-this.$W):V;if(T===f||T===p){var G=this.clone().set(m,1);G.$d[W](Y),G.init(),this.$d=G.set(m,Math.min(this.$D,G.daysInMonth())).$d}else W&&this.$d[W](Y);return this.init(),this},D.set=function(v,V){return this.clone().$set(v,V)},D.get=function(v){return this[A.p(v)]()},D.add=function(v,V){var O,T=this;v=Number(v);var $=A.p(V),W=function(Q){var ot=E(T);return A.w(ot.date(ot.date()+Math.round(Q*v)),T)};if($===f)return this.set(f,this.$M+v);if($===p)return this.set(p,this.$y+v);if($===d)return W(1);if($===h)return W(7);var Y=(O={},O[l]=s,O[c]=o,O[a]=e,O)[$]||1,G=this.$d.getTime()+v*Y;return A.w(G,this)},D.subtract=function(v,V){return this.add(-1*v,V)},D.format=function(v){var V=this,O=this.$locale();if(!this.isValid())return O.invalidDate||g;var T=v||"YYYY-MM-DDTHH:mm:ssZ",$=A.z(this),W=this.$H,Y=this.$m,G=this.$M,Q=O.weekdays,ot=O.months,wt=O.meridiem,ye=function(ut,ne,cn,ss){return ut&&(ut[ne]||ut(V,T))||cn[ne].slice(0,ss)},ln=function(ut){return A.s(W%12||12,ut,"0")},_e=wt||function(ut,ne,cn){var ss=ut<12?"AM":"PM";return cn?ss.toLowerCase():ss};return T.replace(_,function(ut,ne){return ne||function(cn){switch(cn){case"YY":return String(V.$y).slice(-2);case"YYYY":return A.s(V.$y,4,"0");case"M":return G+1;case"MM":return A.s(G+1,2,"0");case"MMM":return ye(O.monthsShort,G,ot,3);case"MMMM":return ye(ot,G);case"D":return V.$D;case"DD":return A.s(V.$D,2,"0");case"d":return String(V.$W);case"dd":return ye(O.weekdaysMin,V.$W,Q,2);case"ddd":return ye(O.weekdaysShort,V.$W,Q,3);case"dddd":return Q[V.$W];case"H":return String(W);case"HH":return A.s(W,2,"0");case"h":return ln(1);case"hh":return ln(2);case"a":return _e(W,Y,!0);case"A":return _e(W,Y,!1);case"m":return String(Y);case"mm":return A.s(Y,2,"0");case"s":return String(V.$s);case"ss":return A.s(V.$s,2,"0");case"SSS":return A.s(V.$ms,3,"0");case"Z":return $}return null}(ut)||$.replace(":","")})},D.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},D.diff=function(v,V,O){var T,$=this,W=A.p(V),Y=E(v),G=(Y.utcOffset()-this.utcOffset())*s,Q=this-Y,ot=function(){return A.m($,Y)};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 c:T=Q/o;break;case l:T=Q/s;break;case a:T=Q/e;break;default:T=Q}return O?T:A.a(T)},D.daysInMonth=function(){return this.endOf(f).$D},D.$locale=function(){return C[this.$L]},D.locale=function(v,V){if(!v)return this.$L;var O=this.clone(),T=B(v,V,!0);return T&&(O.$L=T),O},D.clone=function(){return A.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()},F}(),U=N.prototype;return E.prototype=U,[["$ms",i],["$s",a],["$m",l],["$H",c],["$W",d],["$M",f],["$y",p],["$D",m]].forEach(function(F){U[F[1]]=function(D){return this.$g(D,F[0],F[1])}}),E.extend=function(F,D){return F.$i||(F(D,N,E),F.$i=!0),E},E.locale=B,E.isDayjs=S,E.unix=function(F){return E(1e3*F)},E.en=C[x],E.Ls=C,E.p={},E})})(Wa);var $u=Wa.exports;const ct=Nu($u),ve=Math.min,me=Math.max,Xn=Math.round,Kn=Math.floor,Jt=n=>({x:n,y:n}),Lu={left:"right",right:"left",bottom:"top",top:"bottom"},Ru={start:"end",end:"start"};function Js(n,t,e){return me(n,ve(t,e))}function sn(n,t){return typeof n=="function"?n(t):n}function ge(n){return n.split("-")[0]}function on(n){return n.split("-")[1]}function ja(n){return n==="x"?"y":"x"}function Qs(n){return n==="y"?"height":"width"}function Gn(n){return["top","bottom"].includes(ge(n))?"y":"x"}function to(n){return ja(Gn(n))}function Iu(n,t,e){e===void 0&&(e=!1);const s=on(n),o=to(n),i=Qs(o);let a=o==="x"?s===(e?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Zn(a)),[a,Zn(a)]}function zu(n){const t=Zn(n);return[eo(n),t,eo(t)]}function eo(n){return n.replace(/start|end/g,t=>Ru[t])}function Wu(n,t,e){const s=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(n){case"top":case"bottom":return e?t?o:s:t?s:o;case"left":case"right":return t?i:a;default:return[]}}function ju(n,t,e,s){const o=on(n);let i=Wu(ge(n),e==="start",s);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(eo)))),i}function Zn(n){return n.replace(/left|right|bottom|top/g,t=>Lu[t])}function Yu(n){return{top:0,right:0,bottom:0,left:0,...n}}function Ya(n){return typeof n!="number"?Yu(n):{top:n,right:n,bottom:n,left:n}}function Jn(n){return{...n,top:n.y,left:n.x,right:n.x+n.width,bottom:n.y+n.height}}function Ha(n,t,e){let{reference:s,floating:o}=n;const i=Gn(t),a=to(t),l=Qs(a),c=ge(t),d=i==="y",h=s.x+s.width/2-o.width/2,f=s.y+s.height/2-o.height/2,u=s[l]/2-o[l]/2;let p;switch(c){case"top":p={x:h,y:s.y-o.height};break;case"bottom":p={x:h,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:f};break;case"left":p={x:s.x-o.width,y:f};break;default:p={x:s.x,y:s.y}}switch(on(t)){case"start":p[a]-=u*(e&&d?-1:1);break;case"end":p[a]+=u*(e&&d?-1:1);break}return p}const Hu=async(n,t,e)=>{const{placement:s="bottom",strategy:o="absolute",middleware:i=[],platform:a}=e,l=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let d=await a.getElementRects({reference:n,floating:t,strategy:o}),{x:h,y:f}=Ha(d,s,c),u=s,p={},m=0;for(let g=0;g<l.length;g++){const{name:b,fn:_}=l[g],{x:y,y:k,data:w,reset:x}=await _({x:h,y:f,initialPlacement:s,placement:u,strategy:o,middlewareData:p,rects:d,platform:a,elements:{reference:n,floating:t}});if(h=y??h,f=k??f,p={...p,[b]:{...p[b],...w}},x&&m<=50){m++,typeof x=="object"&&(x.placement&&(u=x.placement),x.rects&&(d=x.rects===!0?await a.getElementRects({reference:n,floating:t,strategy:o}):x.rects),{x:h,y:f}=Ha(d,u,c)),g=-1;continue}}return{x:h,y:f,placement:u,strategy:o,middlewareData:p}};async function Ua(n,t){var e;t===void 0&&(t={});const{x:s,y:o,platform:i,rects:a,elements:l,strategy:c}=n,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:u=!1,padding:p=0}=sn(t,n),m=Ya(p),b=l[u?f==="floating"?"reference":"floating":f],_=Jn(await i.getClippingRect({element:(e=await(i.isElement==null?void 0:i.isElement(b)))==null||e?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:c})),y=f==="floating"?{...a.floating,x:s,y:o}:a.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),w=await(i.isElement==null?void 0:i.isElement(k))?await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1}:{x:1,y:1},x=Jn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:k,strategy:c}):y);return{top:(_.top-x.top+m.top)/w.y,bottom:(x.bottom-_.bottom+m.bottom)/w.y,left:(_.left-x.left+m.left)/w.x,right:(x.right-_.right+m.right)/w.x}}const Uu=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:s,placement:o,rects:i,platform:a,elements:l,middlewareData:c}=t,{element:d,padding:h=0}=sn(n,t)||{};if(d==null)return{};const f=Ya(h),u={x:e,y:s},p=to(o),m=Qs(p),g=await a.getDimensions(d),b=p==="y",_=b?"top":"left",y=b?"bottom":"right",k=b?"clientHeight":"clientWidth",w=i.reference[m]+i.reference[p]-u[p]-i.floating[m],x=u[p]-i.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=l.floating[k]||i.floating[m]);const S=w/2-x/2,B=M/2-g[m]/2-1,E=ve(f[_],B),A=ve(f[y],B),N=E,U=M-g[m]-A,F=M/2-g[m]/2+S,D=Js(N,F,U),v=!c.arrow&&on(o)!=null&&F!=D&&i.reference[m]/2-(F<N?E:A)-g[m]/2<0,V=v?F<N?F-N:F-U:0;return{[p]:u[p]+V,data:{[p]:D,centerOffset:F-D-V,...v&&{alignmentOffset:V}},reset:v}}}),qa=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,s;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...b}=sn(n,t);if((e=i.arrow)!=null&&e.alignmentOffset)return{};const _=ge(o),y=ge(l)===l,k=await(c.isRTL==null?void 0:c.isRTL(d.floating)),w=u||(y||!g?[Zn(l)]:zu(l));!u&&m!=="none"&&w.push(...ju(l,g,m,k));const x=[l,...w],C=await Ua(t,b),M=[];let S=((s=i.flip)==null?void 0:s.overflows)||[];if(h&&M.push(C[_]),f){const N=Iu(o,a,k);M.push(C[N[0]],C[N[1]])}if(S=[...S,{placement:o,overflows:M}],!M.every(N=>N<=0)){var B,E;const N=(((B=i.flip)==null?void 0:B.index)||0)+1,U=x[N];if(U)return{data:{index:N,overflows:S},reset:{placement:U}};let F=(E=S.filter(D=>D.overflows[0]<=0).sort((D,v)=>D.overflows[1]-v.overflows[1])[0])==null?void 0:E.placement;if(!F)switch(p){case"bestFit":{var A;const D=(A=S.map(v=>[v.placement,v.overflows.filter(V=>V>0).reduce((V,O)=>V+O,0)]).sort((v,V)=>v[1]-V[1])[0])==null?void 0:A[0];D&&(F=D);break}case"initialPlacement":F=l;break}if(o!==F)return{reset:{placement:F}}}return{}}}};async function qu(n,t){const{placement:e,platform:s,elements:o}=n,i=await(s.isRTL==null?void 0:s.isRTL(o.floating)),a=ge(e),l=on(e),c=Gn(e)==="y",d=["left","top"].includes(a)?-1:1,h=i&&c?-1:1,f=sn(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 l&&typeof m=="number"&&(p=l==="end"?m*-1:m),c?{x:p*h,y:u*d}:{x:u*d,y:p*h}}const Xa=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){const{x:e,y:s}=t,o=await qu(t,n);return{x:e+o.x,y:s+o.y,data:o}}}},Xu=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:s,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:b=>{let{x:_,y}=b;return{x:_,y}}},...c}=sn(n,t),d={x:e,y:s},h=await Ua(t,c),f=Gn(ge(o)),u=ja(f);let p=d[u],m=d[f];if(i){const b=u==="y"?"top":"left",_=u==="y"?"bottom":"right",y=p+h[b],k=p-h[_];p=Js(y,p,k)}if(a){const b=f==="y"?"top":"left",_=f==="y"?"bottom":"right",y=m+h[b],k=m-h[_];m=Js(y,m,k)}const g=l.fn({...t,[u]:p,[f]:m});return{...g,data:{x:g.x-e,y:g.y-s}}}}};function Qt(n){return Ka(n)?(n.nodeName||"").toLowerCase():"#document"}function bt(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function Rt(n){var t;return(t=(Ka(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function Ka(n){return n instanceof Node||n instanceof bt(n).Node}function It(n){return n instanceof Element||n instanceof bt(n).Element}function Bt(n){return n instanceof HTMLElement||n instanceof bt(n).HTMLElement}function Ga(n){return typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof bt(n).ShadowRoot}function an(n){const{overflow:t,overflowX:e,overflowY:s,display:o}=kt(n);return/auto|scroll|overlay|hidden|clip/.test(t+s+e)&&!["inline","contents"].includes(o)}function Ku(n){return["table","td","th"].includes(Qt(n))}function no(n){const t=so(),e=kt(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(s=>(e.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(e.contain||"").includes(s))}function Gu(n){let t=De(n);for(;Bt(t)&&!Qn(t);){if(no(t))return t;t=De(t)}return null}function so(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Qn(n){return["html","body","#document"].includes(Qt(n))}function kt(n){return bt(n).getComputedStyle(n)}function ts(n){return It(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.pageXOffset,scrollTop:n.pageYOffset}}function De(n){if(Qt(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Ga(n)&&n.host||Rt(n);return Ga(t)?t.host:t}function Za(n){const t=De(n);return Qn(t)?n.ownerDocument?n.ownerDocument.body:n.body:Bt(t)&&an(t)?t:Za(t)}function rn(n,t,e){var s;t===void 0&&(t=[]),e===void 0&&(e=!0);const o=Za(n),i=o===((s=n.ownerDocument)==null?void 0:s.body),a=bt(o);return i?t.concat(a,a.visualViewport||[],an(o)?o:[],a.frameElement&&e?rn(a.frameElement):[]):t.concat(o,rn(o,[],e))}function Ja(n){const t=kt(n);let e=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=Bt(n),i=o?n.offsetWidth:e,a=o?n.offsetHeight:s,l=Xn(e)!==i||Xn(s)!==a;return l&&(e=i,s=a),{width:e,height:s,$:l}}function oo(n){return It(n)?n:n.contextElement}function Be(n){const t=oo(n);if(!Bt(t))return Jt(1);const e=t.getBoundingClientRect(),{width:s,height:o,$:i}=Ja(t);let a=(i?Xn(e.width):e.width)/s,l=(i?Xn(e.height):e.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const Zu=Jt(0);function Qa(n){const t=bt(n);return!so()||!t.visualViewport?Zu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ju(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==bt(n)?!1:t}function be(n,t,e,s){t===void 0&&(t=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),i=oo(n);let a=Jt(1);t&&(s?It(s)&&(a=Be(s)):a=Be(n));const l=Ju(i,e,s)?Qa(i):Jt(0);let c=(o.left+l.x)/a.x,d=(o.top+l.y)/a.y,h=o.width/a.x,f=o.height/a.y;if(i){const u=bt(i),p=s&&It(s)?bt(s):s;let m=u.frameElement;for(;m&&s&&p!==u;){const g=Be(m),b=m.getBoundingClientRect(),_=kt(m),y=b.left+(m.clientLeft+parseFloat(_.paddingLeft))*g.x,k=b.top+(m.clientTop+parseFloat(_.paddingTop))*g.y;c*=g.x,d*=g.y,h*=g.x,f*=g.y,c+=y,d+=k,m=bt(m).frameElement}}return Jn({width:h,height:f,x:c,y:d})}function Qu(n){let{rect:t,offsetParent:e,strategy:s}=n;const o=Bt(e),i=Rt(e);if(e===i)return t;let a={scrollLeft:0,scrollTop:0},l=Jt(1);const c=Jt(0);if((o||!o&&s!=="fixed")&&((Qt(e)!=="body"||an(i))&&(a=ts(e)),Bt(e))){const d=be(e);l=Be(e),c.x=d.x+e.clientLeft,c.y=d.y+e.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-a.scrollLeft*l.x+c.x,y:t.y*l.y-a.scrollTop*l.y+c.y}}function tp(n){return Array.from(n.getClientRects())}function tr(n){return be(Rt(n)).left+ts(n).scrollLeft}function ep(n){const t=Rt(n),e=ts(n),s=n.ownerDocument.body,o=me(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),i=me(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let a=-e.scrollLeft+tr(n);const l=-e.scrollTop;return kt(s).direction==="rtl"&&(a+=me(t.clientWidth,s.clientWidth)-o),{width:o,height:i,x:a,y:l}}function np(n,t){const e=bt(n),s=Rt(n),o=e.visualViewport;let i=s.clientWidth,a=s.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;const d=so();(!d||d&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}function sp(n,t){const e=be(n,!0,t==="fixed"),s=e.top+n.clientTop,o=e.left+n.clientLeft,i=Bt(n)?Be(n):Jt(1),a=n.clientWidth*i.x,l=n.clientHeight*i.y,c=o*i.x,d=s*i.y;return{width:a,height:l,x:c,y:d}}function er(n,t,e){let s;if(t==="viewport")s=np(n,e);else if(t==="document")s=ep(Rt(n));else if(It(t))s=sp(t,e);else{const o=Qa(n);s={...t,x:t.x-o.x,y:t.y-o.y}}return Jn(s)}function nr(n,t){const e=De(n);return e===t||!It(e)||Qn(e)?!1:kt(e).position==="fixed"||nr(e,t)}function op(n,t){const e=t.get(n);if(e)return e;let s=rn(n,[],!1).filter(l=>It(l)&&Qt(l)!=="body"),o=null;const i=kt(n).position==="fixed";let a=i?De(n):n;for(;It(a)&&!Qn(a);){const l=kt(a),c=no(a);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||an(a)&&!c&&nr(n,a))?s=s.filter(h=>h!==a):o=l,a=De(a)}return t.set(n,s),s}function ip(n){let{element:t,boundary:e,rootBoundary:s,strategy:o}=n;const a=[...e==="clippingAncestors"?op(t,this._c):[].concat(e),s],l=a[0],c=a.reduce((d,h)=>{const f=er(t,h,o);return d.top=me(f.top,d.top),d.right=ve(f.right,d.right),d.bottom=ve(f.bottom,d.bottom),d.left=me(f.left,d.left),d},er(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function ap(n){return Ja(n)}function rp(n,t,e){const s=Bt(t),o=Rt(t),i=e==="fixed",a=be(n,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Jt(0);if(s||!s&&!i)if((Qt(t)!=="body"||an(o))&&(l=ts(t)),s){const d=be(t,!0,i,t);c.x=d.x+t.clientLeft,c.y=d.y+t.clientTop}else o&&(c.x=tr(o));return{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function sr(n,t){return!Bt(n)||kt(n).position==="fixed"?null:t?t(n):n.offsetParent}function or(n,t){const e=bt(n);if(!Bt(n))return e;let s=sr(n,t);for(;s&&Ku(s)&&kt(s).position==="static";)s=sr(s,t);return s&&(Qt(s)==="html"||Qt(s)==="body"&&kt(s).position==="static"&&!no(s))?e:s||Gu(n)||e}const lp=async function(n){let{reference:t,floating:e,strategy:s}=n;const o=this.getOffsetParent||or,i=this.getDimensions;return{reference:rp(t,await o(e),s),floating:{x:0,y:0,...await i(e)}}};function cp(n){return kt(n).direction==="rtl"}const dp={convertOffsetParentRelativeRectToViewportRelativeRect:Qu,getDocumentElement:Rt,getClippingRect:ip,getOffsetParent:or,getElementRects:lp,getClientRects:tp,getDimensions:ap,getScale:Be,isElement:It,isRTL:cp};function hp(n,t){let e=null,s;const o=Rt(n);function i(){clearTimeout(s),e&&e.disconnect(),e=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:d,top:h,width:f,height:u}=n.getBoundingClientRect();if(l||t(),!f||!u)return;const p=Kn(h),m=Kn(o.clientWidth-(d+f)),g=Kn(o.clientHeight-(h+u)),b=Kn(d),y={rootMargin:-p+"px "+-m+"px "+-g+"px "+-b+"px",threshold:me(0,ve(1,c))||1};let k=!0;function w(x){const C=x[0].intersectionRatio;if(C!==c){if(!k)return a();C?a(!1,C):s=setTimeout(()=>{a(!1,1e-7)},100)}k=!1}try{e=new IntersectionObserver(w,{...y,root:o.ownerDocument})}catch{e=new IntersectionObserver(w,y)}e.observe(n)}return a(!0),i}function fp(n,t,e,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,d=oo(n),h=o||i?[...d?rn(d):[],...rn(t)]:[];h.forEach(_=>{o&&_.addEventListener("scroll",e,{passive:!0}),i&&_.addEventListener("resize",e)});const f=d&&l?hp(d,e):null;let u=-1,p=null;a&&(p=new ResizeObserver(_=>{let[y]=_;y&&y.target===d&&p&&(p.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{p&&p.observe(t)})),e()}),d&&!c&&p.observe(d),p.observe(t));let m,g=c?be(n):null;c&&b();function b(){const _=be(n);g&&(_.x!==g.x||_.y!==g.y||_.width!==g.width||_.height!==g.height)&&e(),g=_,m=requestAnimationFrame(b)}return e(),()=>{h.forEach(_=>{o&&_.removeEventListener("scroll",e),i&&_.removeEventListener("resize",e)}),f&&f(),p&&p.disconnect(),p=null,c&&cancelAnimationFrame(m)}}const ir=(n,t,e)=>{const s=new Map,o={platform:dp,...e},i={...o.platform,_c:s};return Hu(n,t,{...o,platform:i})};function io(n){var t;return(t=n==null?void 0:n.$el)!=null?t:n}function up(n){return{name:"arrow",options:n,fn(t){const e=io(r.unref(n.element));return e==null?{}:Uu({element:e,padding:n.padding}).fn(t)}}}function ar(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function rr(n,t){const e=ar(n);return Math.round(t*e)/e}function pp(n,t,e){e===void 0&&(e={});const s=e.whileElementsMounted,o=r.computed(()=>{var M;return(M=r.unref(e.open))!=null?M:!0}),i=r.computed(()=>r.unref(e.middleware)),a=r.computed(()=>{var M;return(M=r.unref(e.placement))!=null?M:"bottom"}),l=r.computed(()=>{var M;return(M=r.unref(e.strategy))!=null?M:"absolute"}),c=r.computed(()=>{var M;return(M=r.unref(e.transform))!=null?M:!0}),d=r.computed(()=>io(n.value)),h=r.computed(()=>io(t.value)),f=r.ref(0),u=r.ref(0),p=r.ref(l.value),m=r.ref(a.value),g=r.shallowRef({}),b=r.ref(!1),_=r.computed(()=>{const M={position:p.value,left:"0",top:"0"};if(!h.value)return M;const S=rr(h.value,f.value),B=rr(h.value,u.value);return c.value?{...M,transform:"translate("+S+"px, "+B+"px)",...ar(h.value)>=1.5&&{willChange:"transform"}}:{position:p.value,left:S+"px",top:B+"px"}});let y;function k(){d.value==null||h.value==null||ir(d.value,h.value,{middleware:i.value,placement:a.value,strategy:l.value}).then(M=>{f.value=M.x,u.value=M.y,p.value=M.strategy,m.value=M.placement,g.value=M.middlewareData,b.value=!0})}function w(){typeof y=="function"&&(y(),y=void 0)}function x(){if(w(),s===void 0){k();return}if(d.value!=null&&h.value!=null){y=s(d.value,h.value,k);return}}function C(){o.value||(b.value=!1)}return r.watch([i,a,l],k,{flush:"sync"}),r.watch([d,h],x,{flush:"sync"}),r.watch(o,C,{flush:"sync"}),r.getCurrentScope()&&r.onScopeDispose(w),{x:r.shallowReadonly(f),y:r.shallowReadonly(u),strategy:r.shallowReadonly(p),placement:r.shallowReadonly(m),middlewareData:r.shallowReadonly(g),isPositioned:r.shallowReadonly(b),floatingStyles:_,update:k}}function mp(n){for(;n;){if(gp(n))return n;n=n.parentElement}return document.scrollingElement}function gp(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 bp{constructor(t,e){P(this,"onScroll");P(this,"scrollParent");this.onScroll=e,this.scrollParent=mp(t)}bindScroll(){this.scrollParent.addEventListener("scroll",this.onScroll)}unbindScroll(){this.scrollParent.removeEventListener("scroll",this.onScroll)}}const yp={class:"fm-menu__wrapper"},_p=r.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 s=n,o=r.ref(!1),i=r.ref(null),a=r.ref(null),{floatingStyles:l}=pp(i,a,{middleware:[Xa(4),qa()],placement:s.placement,whileElementsMounted:fp});let c;t({show:()=>{o.value||(o.value=!0,e("dropdown-changed",o.value))},hide:()=>{o.value&&(o.value=!1,e("dropdown-changed",o.value))}});const d=u=>{u.preventDefault(),u.stopPropagation(),!s.disabled&&(o.value=!o.value,e("dropdown-changed",o.value))},h=u=>{if(!o.value)return;const p=u.path||u.composedPath();for(const m of p)if(m==i.value||m==a.value)return;o.value=!1,e("dropdown-changed",o.value)},f=()=>{e("dropdown-changed",!1)};return r.watch(()=>s.showMenu,u=>o.value=u),r.onMounted(()=>{o.value=s.showMenu,window.addEventListener("click",h),c=new bp(i.value,f),c.bindScroll()}),r.onUnmounted(()=>{window.removeEventListener("click",h),c.unbindScroll()}),(u,p)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"anchorEl",ref:i,class:"fm-menu",onClick:d},[r.renderSlot(u.$slots,"menu-button",{},void 0,!0)],512),o.value?(r.openBlock(),r.createElementBlock("div",{key:0,ref_key:"menuEl",ref:a,class:r.normalizeClass({"fm-menu__content":!0,"fm-menu__content--opened":o.value}),style:r.normalizeStyle(r.unref(l))},[r.renderSlot(u.$slots,"menu-wrapper",{},()=>[r.createElementVNode("div",yp,[r.renderSlot(u.$slots,"menu-content",{},void 0,!0)])],!0)],6)):r.createCommentVNode("",!0)]))}}),eb="",yt=et(_p,[["__scopeId","data-v-6ad9d23d"]]),xp={class:"fm-menu-item--left"},kp={key:0,class:"fm-menu-item--right"},wp=r.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,s=r.ref(!1),o=l=>{l.preventDefault(),!e.disabled&&t("update:modelValue",!e.modelValue)},i=()=>{t("update:modelValue",e.modelValue)};function a(l){s.value=l}return(l,c)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{class:r.normalizeClass({"fm-menu-item":!0,"fm-menu-item--selected":l.modelValue&&!l.hasCheckbox,"fm-menu-item--disabled":l.disabled}),onClick:o,onMousedown:c[1]||(c[1]=()=>a(!0)),onMouseup:c[2]||(c[2]=()=>a(!1)),onMouseleave:c[3]||(c[3]=()=>a(!1))},[r.createElementVNode("div",xp,[!l.hasCheckbox&&l.icon?(r.openBlock(),r.createBlock(R,{key:0,name:l.icon,size:"md",outline:!s.value&&!l.modelValue,color:l.disabled?"#C7C7CC":l.modelValue?"#FF7823":"#1C1C1E"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),l.hasCheckbox?(r.openBlock(),r.createBlock(za,{key:1,"model-value":l.modelValue,name:"something",label:"",sublabel:"",value:"",indeterminate:!1,disabled:l.disabled,"onUpdate:modelValue":i,onClick:c[0]||(c[0]=d=>d.preventDefault())},null,8,["model-value","disabled"])):r.createCommentVNode("",!0),r.renderSlot(l.$slots,"label",{},()=>[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(`fm-typo-body-lg-400 ${l.disabled?"fm-color-typo-disabled":"fm-color-typo-primary"}`)},r.toDisplayString(l.label),3),l.sublabel?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`fm-typo-body-md-400 ${l.disabled?"fm-color-typo-disabled":"fm-color-typo-secondary"}`)},r.toDisplayString(l.sublabel),3)):r.createCommentVNode("",!0)])],!0)]),r.renderSlot(l.$slots,"append",{},void 0,!0),l.expandable?(r.openBlock(),r.createElementBlock("div",kp,[r.createVNode(R,{name:"chevron_right",size:"md",color:l.disabled?"#C7C7CC":"#AEAEB2"},null,8,["color"])])):r.createCommentVNode("",!0)],34)]))}}),nb="",Et=et(wp,[["__scopeId","data-v-a50682bb"]]),Cp={class:"w-full"},Sp=r.defineComponent({__name:"FmField",props:{tag:{default:"div"},prependIcon:{default:""},appendIcon:{default:""},invalid:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1}},setup(n){const t=n;return(e,s)=>(r.openBlock(),r.createBlock(t.tag,{class:r.normalizeClass({"fm-field":!0,"fm-field--focused":e.focused,"fm-field--invalid":e.invalid,"fm-field--valid":e.showValidBorder&&!e.invalid,"fm-field--disabled":e.disabled}),tabindex:"0"},{default:r.withCtx(()=>[r.renderSlot(e.$slots,"prepend",{},()=>[e.prependIcon?(r.openBlock(),r.createBlock(R,{key:0,name:e.prependIcon,size:"md",color:e.disabled?"disabled":"neutral-black"},null,8,["name","color"])):r.createCommentVNode("",!0)],!0),r.createElementVNode("div",Cp,[r.renderSlot(e.$slots,"default",{},void 0,!0)]),r.renderSlot(e.$slots,"append",{},()=>[e.appendIcon?(r.openBlock(),r.createBlock(R,{key:0,name:e.appendIcon,size:"md",color:e.disabled?"disabled":"neutral-black"},null,8,["name","color"])):r.createCommentVNode("",!0)],!0)]),_:3},8,["class"]))}}),sb="",te=et(Sp,[["__scopeId","data-v-177cd78a"]]),Mp={class:"flex gap-4"},lr=r.defineComponent({__name:"FmHelperText",props:{text:{default:""},disabled:{type:Boolean,default:!1},state:{default:"none"},errorMessages:{default:()=>[]}},setup(n){const t=n,e=r.computed(()=>t.state==="success"?"check_circle":t.state==="warning"?"warning":t.state==="error"?"error":""),s=r.computed(()=>t.state==="success"?"text-fm-color-system-success-300":t.state==="warning"?"text-fm-color-system-warning-300":t.state==="error"?"text-fm-color-system-error-300":"");return(o,i)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["fm-typo-body-sm-400",{"text-fm-color-typo-disabled":o.disabled,"text-fm-color-typo-secondary":o.state==="none"&&!o.disabled,"text-fm-color-typo-success":o.state==="success"&&!o.disabled,"text-fm-color-typo-warning":o.state==="warning"&&!o.disabled,"text-fm-color-typo-error":o.state==="error"&&!o.disabled}])},[o.errorMessages.length===0?r.renderSlot(o.$slots,"default",{key:0},()=>[r.createElementVNode("div",Mp,[e.value?(r.openBlock(),r.createBlock(R,{key:0,size:"sm",name:e.value,class:r.normalizeClass(["mt-[2px]",s.value])},null,8,["name","class"])):r.createCommentVNode("",!0),r.createElementVNode("span",null,r.toDisplayString(o.text),1)])]):r.renderSlot(o.$slots,"default",{key:1},()=>[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.errorMessages,a=>(r.openBlock(),r.createElementBlock("div",{key:a,class:"flex gap-4 text-fm-color-typo-error"},[r.createVNode(R,{size:"sm",name:"error",class:"mt-[2px] text-fm-color-system-error-300"}),r.createElementVNode("span",null,r.toDisplayString(a),1)]))),128))])],2))}}),vp={class:"px-2 py-0"},Dp={key:0,class:"fm-typo-body-xl-700"},Bp={key:0,class:"content-start flex gap-0 px-2 py-0 self-stretch"},cr=r.defineComponent({__name:"FmTooltip",props:{variant:{default:"plain"},beak:{default:"top"},hasArrow:{type:Boolean,default:!0},titleText:{default:"Title"},contentText:{},actionButtons:{default:null},disabled:{type:Boolean,default:!1}},setup(n){const t=n,e=r.ref(null),s=r.ref(null),o=r.ref(null),i=async()=>{var _,y,k,w;const{x:p,y:m,placement:g,middlewareData:b}=await ir(e.value,s.value,{placement:t.beak,middleware:[Xa(10),qa(),Xu({padding:5}),t.hasArrow?up({element:o.value,padding:10}):null]});if(Object.assign(s.value.style,{left:`${p}px`,top:`${m}px`}),t.hasArrow){const x={top:"bottom",right:"left",bottom:"top",left:"right"}[g.split("-")[0]];Object.assign(o.value.style,{left:((_=b.arrow)==null?void 0:_.x)!=null?`${(y=b.arrow)==null?void 0:y.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",[x]:"-4px"})}},a=r.ref(!1),l=r.ref(0),c=r.ref(0),d=r.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(c.value),l.value=window.setTimeout(()=>{a.value=!0},500)},f=()=>{clearTimeout(l.value),c.value=window.setTimeout(()=>a.value=!1,1500)},u=()=>{clearTimeout(c.value),a.value=!0};return r.watchEffect(()=>{a.value?(i(),window.addEventListener("resize",i)):window.removeEventListener("resize",i)}),(p,m)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("div",{ref_key:"tooltipContainer",ref:e,class:r.normalizeClass(["cursor-pointer flex items-center justify-center relative w-max",{"cursor-not-allowed pointer-events-none":p.disabled}]),onMouseenter:h,onMouseleave:f},[r.renderSlot(p.$slots,"default")],34),r.createElementVNode("div",{ref_key:"tooltip",ref:s,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:r.normalizeStyle(d.value),onMouseenter:u,onMouseleave:f},[r.createElementVNode("div",null,[r.createElementVNode("div",vp,[p.variant=="rich"?(r.openBlock(),r.createElementBlock("div",Dp,r.toDisplayString(p.titleText),1)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(p.variant=="plain"?"fm-typo-body-sm-400":"fm-typo-body-md-400")},r.toDisplayString(p.contentText),3)]),p.variant=="rich"?(r.openBlock(),r.createElementBlock("div",Bp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.actionButtons,(g,b)=>(r.openBlock(),r.createElementBlock("div",{key:b},[r.createVNode(_t,{variant:"tertiary",label:g.label,onClick:g.handler},null,8,["label","onClick"])]))),128))])):r.createCommentVNode("",!0)]),r.createElementVNode("div",{ref_key:"arrowEl",ref:o,class:"-rotate-45 absolute h-3 w-3"},null,512)],36)]))}}),dr=r.defineComponent({__name:"FmLabel",props:{label:{default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""}},setup(n){return(t,e)=>t.label?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-typo-body-lg-400 flex gap-4",t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary",{"items-center":t.info}])},[r.renderSlot(t.$slots,"default",{},()=>[r.createElementVNode("span",null,r.toDisplayString(t.label),1),t.required?(r.openBlock(),r.createElementBlock("span",{key:0,class:r.normalizeClass(["fm-typo-body-lg-700",t.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-error"])}," * ",2)):r.createCommentVNode("",!0),t.optional?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-md-400",t.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-tertiary"])}," (optional) ",2)):r.createCommentVNode("",!0),t.info?(r.openBlock(),r.createBlock(cr,{key:2,beak:"top","content-text":t.info,disabled:t.disabled},{default:r.withCtx(()=>[r.createVNode(R,{name:"info",size:"sm",class:r.normalizeClass(["fm-typo-body-md-400",t.disabled?"text-fm-color-typo-disabled":"text-fm-color-neutral-gray-300"])},null,8,["class"])]),_:1},8,["content-text","disabled"])):r.createCommentVNode("",!0)])],2)):r.createCommentVNode("",!0)}});function hr(n,t){const e=r.ref([]);function s(){const i=[];if(t.value&&t.value.length>0)for(const a of t.value){const c=(typeof a=="function"?a:()=>a)(n.value);c!==!0&&i.push(c)}return e.value=i,e.value}function o(){e.value=[]}return{validate:s,resetValidation:o,errorMessages:e}}function fr(n,t=null,e=null){let s=null;const o=gt(n,"modelValue"),i=r.ref(!0),a=r.inject(go,null),{validate:l,resetValidation:c,errorMessages:d}=hr(o,r.toRef(()=>n.rules)),h=(f=e)=>{i.value=!0,c(),f&&typeof f=="function"&&f(),o.value=t};return r.onMounted(()=>{a&&(s=a.register({validate:l,resetValidation:c,resetValue:h})),t=t??o.value}),r.onUnmounted(()=>{a&&a.unregister(s)}),r.watch(()=>o.value,()=>{i.value=!1,o.value!==t&&l()}),r.watch(()=>n.focused,f=>{i.value=!1,f||l()}),{validate:l,resetValidation:c,errorMessages:d,resetValue:h,isPristine:i}}function es(){const n=r.ref(!1);function t(){n.value=!0}function e(){n.value=!1}return{focus:t,blur:e,isFocused:n}}const Ep={key:1,class:"flex items-center justify-between"},zt=r.defineComponent({__name:"FmFormGroup",props:{modelValue:{},rules:{default:()=>[]},focused:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:{default:""},required:{type:Boolean,default:!1},optional:{type:Boolean,default:!1},info:{default:""},helperText:{default:""},helperState:{default:"none"},tag:{default:"label"}},setup(n){const t=n,{errorMessages:e,isPristine:s}=fr(t),{focus:o,blur:i}=es(),a=r.computed(()=>({label:t.label,disabled:t.disabled,required:t.required,optional:t.optional,info:t.info})),l=r.computed(()=>({text:t.helperText,disabled:t.disabled,state:t.helperState,errorMessages:e.value})),c=r.computed(()=>({isPristine:s,invalid:e.value.length>0}));return(d,h)=>(r.openBlock(),r.createBlock(t.tag,{class:"flex flex-col gap-4",onClick:r.unref(o),onBlur:r.unref(i)},{default:r.withCtx(()=>[d.label?(r.openBlock(),r.createBlock(dr,r.normalizeProps(r.mergeProps({key:0},a.value)),{default:r.withCtx(()=>[r.renderSlot(d.$slots,"label")]),_:3},16)):r.createCommentVNode("",!0),r.renderSlot(d.$slots,"default",r.normalizeProps(r.guardReactiveProps(c.value))),l.value.text||l.value.errorMessages.length>0||d.$slots["helper-append"]?(r.openBlock(),r.createElementBlock("div",Ep,[r.createVNode(lr,r.normalizeProps(r.guardReactiveProps(l.value)),{default:r.withCtx(()=>[r.renderSlot(d.$slots,"helper-text")]),_:3},16),r.renderSlot(d.$slots,"helper-append")])):r.createCommentVNode("",!0)]),_:3},8,["onClick","onBlur"]))}}),Vp={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[360px]"},Pp={class:"w-max"},Op={class:"flex h-40 justify-between px-4 py-8"},Ap={class:"flex gap-4 items-center"},Fp={class:"fm-typo-body-lg-700"},Tp={class:"h-[264px] w-[160px]"},Np={class:"fm-typo-body-lg-700"},$p={class:"h-[264px] w-[160px]"},Lp={class:"flex gap-4 items-center justify-center"},Rp={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},Ip=["onClick"],zp={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},Wp=r.defineComponent({__name:"FmDatePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=gt(t,"modelValue"),s=r.ref(ct(e.value,"YYYY-MM-DD")),o=r.ref(!1),i=r.ref(ct().startOf("month")),a=r.ref(!1),l=r.ref(!1),c=g=>{s.value=g},d=()=>{e.value=s.value.format("YYYY-MM-DD"),setTimeout(()=>{o.value=!1},0)},h=()=>{s.value=e.value?ct(e.value):null,o.value=!1},f=g=>{const b=[],_=g.endOf("month"),y=g.month();let k=g.startOf("week"),w=[];for(;k.isBefore(_.endOf("week"));)k.day()===0&&w.length>0&&(b.push(w),w=[]),w.push({date:k,isCurrentMonth:k.month()===y}),k=k.add(1,"day");return w.length>0&&b.push(w),b},u=g=>{a.value=!1,l.value=!1,i.value=g},p=r.computed(()=>Array.from(Array(7),(g,b)=>ct().day(b).format("ddd"))),m=r.computed(()=>{let g=-5;const b=[];for(;g!=5;)b.push(i.value.add(g,"year")),g++;return b});return(g,b)=>(r.openBlock(),r.createBlock(zt,{modelValue:r.unref(e),"onUpdate:modelValue":b[5]||(b[5]=_=>r.isRef(e)?e.value=_:null),label:g.label,disabled:g.disabled,required:g.labelMark==="required",optional:g.labelMark==="optional",info:g.labelInfo,rules:g.rules,focused:o.value,"helper-text":g.helperText,"helper-state":g.helperState,tag:"div"},{label:r.withCtx(()=>[r.renderSlot(g.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:_})=>[r.createVNode(yt,{"show-menu":o.value,disabled:g.disabled,onDropdownChanged:b[4]||(b[4]=y=>o.value=y)},{"menu-button":r.withCtx(()=>[r.createVNode(te,{class:"cursor-text",focused:o.value,invalid:_,"show-valid-border":g.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(g.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(g.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":r.unref(e)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString(r.unref(e)?r.unref(ct)(r.unref(e)).format("D MMM YYYY"):"DD MM YYYY"),3)]),_:2},1032,["focused","invalid","show-valid-border"])]),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",Vp,[r.createElementVNode("div",Pp,[r.createElementVNode("div",Op,[r.createElementVNode("div",Ap,[r.createVNode(yt,{"show-menu":a.value,onDropdownChanged:b[0]||(b[0]=y=>a.value=y)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",a.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",Fp,r.toDisplayString(i.value.format("MMMM")),1),r.createVNode(R,{name:a.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",Tp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Array.from(Array(12),(y,k)=>i.value.month(k)),y=>(r.openBlock(),r.createElementBlock("li",{key:y.format("MMMM")},[r.createVNode(Et,{"model-value":i.value.format("MMMM")===y.format("MMMM"),label:y.format("MMMM"),"onUpdate:modelValue":k=>u(y)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),r.createVNode(yt,{"show-menu":l.value,onDropdownChanged:b[1]||(b[1]=y=>l.value=y)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",l.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",Np,r.toDisplayString(i.value.format("YYYY")),1),r.createVNode(R,{name:l.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",$p,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,y=>(r.openBlock(),r.createElementBlock("li",{key:y.format("YYYY")},[r.createVNode(Et,{"model-value":i.value.format("YYYY")===y.format("YYYY"),label:y.format("YYYY"),"onUpdate:modelValue":k=>u(y)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),r.createElementVNode("div",Lp,[r.createVNode(R,{class:"cursor-pointer",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:b[2]||(b[2]=()=>u(i.value.subtract(1,"month")))}),r.createVNode(R,{class:"cursor-pointer",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:b[3]||(b[3]=()=>u(i.value.add(1,"month")))})])]),r.createElementVNode("div",null,[r.createElementVNode("div",Rp,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.value,y=>(r.openBlock(),r.createElementBlock("div",{key:y,class:"fm-calendar__cell"},r.toDisplayString(y),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f(i.value),(y,k)=>(r.openBlock(),r.createElementBlock("div",{key:k,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y,w=>(r.openBlock(),r.createElementBlock("div",{key:w.date.date(),class:"fm-calendar__cell"},[w.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["fm-calendar__cell__button",{"fm-calendar__cell__button--selected":w.date.isSame(s.value)}]),type:"button",onClick:()=>c(w.date)},r.toDisplayString(w.date.date()),11,Ip)):r.createCommentVNode("",!0)]))),128))]))),128))])])]),r.createElementVNode("div",zp,[r.createVNode(_t,{label:"Cancel",size:"md",variant:"tertiary",onClick:h}),r.createVNode(_t,{label:"Apply",size:"md",variant:"primary",disabled:!s.value,onClick:d},null,8,["disabled"])])])]),_:2},1032,["show-menu","disabled"])]),"helper-text":r.withCtx(()=>[r.renderSlot(g.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),ob="",jp=et(Wp,[["__scopeId","data-v-16edf7f9"]]),Yp=n=>(r.pushScopeId("data-v-431b8ad3"),n=n(),r.popScopeId(),n),Hp={class:"flex gap-1 items-center relative w-full"},Up={class:"flex flex-col gap-4 w-full"},qp=Yp(()=>r.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)),Xp={class:"flex flex-col gap-4 w-full"},Kp={class:"fm-calendar p-12 rounded-lg shadow-light-300 w-[720px]"},Gp={class:"flex gap-24"},Zp={class:"w-max"},Jp={class:"flex gap-16 h-40 items-center justify-start px-4 py-8"},Qp={class:"flex gap-4 items-center"},tm={class:"fm-typo-body-lg-700"},em={class:"h-[264px] w-[160px]"},nm={class:"fm-typo-body-lg-700"},sm={class:"h-[264px] w-[160px]"},om={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},im=["onClick","onMouseover"],am={class:"w-max"},rm={class:"flex gap-16 h-10 items-center justify-end px-4 py-8"},lm={class:"flex gap-4 items-center"},cm={class:"fm-typo-body-lg-700"},dm={class:"h-[264px] w-[160px]"},hm={class:"fm-typo-body-lg-700"},fm={class:"h-[264px] w-[160px]"},um={class:"fm-calendar__row fm-typo-body-lg-400 text-fm-color-typo-tertiary"},pm=["onClick","onMouseover"],mm={class:"flex gap-8 h-72 items-center justify-end py-16 w-full"},gm=r.defineComponent({__name:"FmDateRangePicker",props:{modelValue:{},startLabel:{default:"Start date"},endLabel:{default:"End date"},disabled:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},labelMark:{default:"none"},labelInfo:{default:""},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=gt(t,"modelValue"),s=r.ref({startDate:ct(e.value.startDate,"YYYY-MM-DD"),endDate:ct(e.value.endDate,"YYYY-MM-DD")}),o=r.ref(!1),i=r.ref(ct().startOf("month")),a=r.ref(ct().startOf("month").add(1,"month")),l=r.ref(null),c=r.ref(!1),d=r.ref(!1),h=r.ref(!1),f=r.ref(!1),u=x=>{if(s.value.startDate&&s.value.endDate){s.value={startDate:x,endDate:null};return}if(!s.value.startDate&&!s.value.endDate)s.value.startDate=x;else if(x.isBefore(s.value.startDate)){const C=s.value.startDate;s.value={startDate:x,endDate:C}}else s.value.endDate=x},p=()=>{e.value={startDate:s.value.startDate.format("YYYY-MM-DD"),endDate:s.value.endDate.format("YYYY-MM-DD")},setTimeout(()=>{o.value=!1})},m=()=>{var x,C;s.value={startDate:(x=e.value)!=null&&x.startDate?ct(e.value.startDate,"YYYY-MM-DD"):null,endDate:(C=e.value)!=null&&C.endDate?ct(e.value.endDate,"YYYY-MM-DD"):null},o.value=!1},g=x=>{const C=[],M=x.endOf("month"),S=x.month();let B=x.startOf("week"),E=[];for(;B.isBefore(M.endOf("week"));)B.day()===0&&E.length>0&&(C.push(E),E=[]),E.push({date:B,isCurrentMonth:B.month()===S}),B=B.add(1,"day");return E.length>0&&C.push(E),C},b=(x,C)=>{c.value=!1,h.value=!1,d.value=!1,f.value=!1,x==="left"?(i.value=C,a.value=C.add(1,"month")):x==="right"&&(a.value=C,i.value=C.subtract(1,"month"))},_=r.computed(()=>Array.from(Array(7),(x,C)=>ct().day(C).format("ddd"))),y=x=>{const C=s.value.startDate,M=s.value.endDate;l.value=C&&M?null:l.value;const S=l.value,B=C==null?void 0:C.isSame(x),E=M==null?void 0:M.isSame(x),A=S==null?void 0:S.isSame(x);return{"fm-calendar__cell__button--selected":B&&E||B&&!M,"fm-calendar__cell__button--selected-start":B&&M&&!(B&&E)||C&&!M&&B&&(S==null?void 0:S.isAfter(C))||C&&!M&&A&&(S==null?void 0:S.isBefore(C)),"fm-calendar__cell__button--selected-end":E&&C&&!(B&&E)||C&&!M&&B&&(S==null?void 0:S.isBefore(C))||C&&!M&&A&&(S==null?void 0:S.isAfter(C)),"fm-calendar__cell__button--selected-between":C&&(M||S)&&M?x.isAfter(C)&&x.isBefore(M):x.isAfter(S)&&x.isBefore(C)||x.isBefore(S)&&x.isAfter(C)}},k=x=>{l.value=x},w=r.computed(()=>{let x=-5;const C=[];for(;x!=5;)C.push(i.value.add(x,"year")),x++;return C});return r.watch(()=>e.value,()=>{var x,C;return s.value={startDate:(x=e.value)!=null&&x.startDate?ct(e.value.startDate,"YYYY-MM-DD"):null,endDate:(C=e.value)!=null&&C.endDate?ct(e.value.endDate,"YYYY-MM-DD"):null}}),(x,C)=>(r.openBlock(),r.createBlock(zt,{modelValue:r.unref(e),"onUpdate:modelValue":C[7]||(C[7]=M=>r.isRef(e)?e.value=M:null),disabled:x.disabled,rules:x.rules,focused:o.value,"helper-text":x.helperText,"helper-state":x.helperState,tag:"div"},{default:r.withCtx(({invalid:M})=>[r.createVNode(yt,{"show-menu":o.value,disabled:x.disabled,onDropdownChanged:C[6]||(C[6]=S=>o.value=S)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",Hp,[r.createElementVNode("label",Up,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(t.startLabel),3),r.createVNode(te,{class:r.normalizeClass(x.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.value,invalid:M,"show-valid-border":x.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(x.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(x.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>{var S,B;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":(S=r.unref(e))!=null&&S.startDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((B=r.unref(e))!=null&&B.startDate?r.unref(ct)(r.unref(e).startDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])]),qp,r.createElementVNode("label",Xp,[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled cursor-not-allowed":"text-fm-color-typo-primary cursor-pointer"]])},r.toDisplayString(t.endLabel),3),r.createVNode(te,{class:r.normalizeClass(x.disabled?"cursor-not-allowed":"cursor-pointer"),focused:o.value,invalid:M,"show-valid-border":x.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(x.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(x.$slots,"append",{},void 0,!0)]),default:r.withCtx(()=>{var S,B;return[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":(S=r.unref(e))!=null&&S.endDate?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString((B=r.unref(e))!=null&&B.endDate?r.unref(ct)(r.unref(e).endDate).format("D MMM YYYY"):"DD MM YYYY"),3)]}),_:2},1032,["class","focused","invalid","show-valid-border"])])])]),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",Kp,[r.createElementVNode("div",Gp,[r.createElementVNode("div",Zp,[r.createElementVNode("div",Jp,[r.createElementVNode("div",Qp,[r.createVNode(R,{class:"cursor-pointer select-none",name:"chevron_left",outline:!1,color:"#1C1C1E",onClick:C[0]||(C[0]=()=>b("left",i.value.subtract(1,"month")))}),r.createVNode(yt,{"show-menu":c.value,onDropdownChanged:C[1]||(C[1]=S=>c.value=S)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",c.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",tm,r.toDisplayString(i.value.format("MMMM")),1),r.createVNode(R,{name:c.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",em,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Array.from(Array(12),(S,B)=>i.value.month(B)),S=>(r.openBlock(),r.createElementBlock("li",{key:S.format("MMMM")},[r.createVNode(Et,{"model-value":i.value.format("MMMM")===S.format("MMMM"),label:S.format("MMMM"),"onUpdate:modelValue":B=>b("left",S)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),r.createVNode(yt,{"show-menu":h.value,onDropdownChanged:C[2]||(C[2]=S=>h.value=S)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",h.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",nm,r.toDisplayString(i.value.format("YYYY")),1),r.createVNode(R,{name:h.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",sm,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,S=>(r.openBlock(),r.createElementBlock("li",{key:S.format("YYYY")},[r.createVNode(Et,{"model-value":i.value.format("YYYY")===S.format("YYYY"),label:S.format("YYYY"),"onUpdate:modelValue":B=>b("left",S)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])])]),r.createElementVNode("div",null,[r.createElementVNode("div",om,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(_.value,S=>(r.openBlock(),r.createElementBlock("div",{key:S,class:"fm-calendar__cell"},r.toDisplayString(S),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g(i.value),(S,B)=>(r.openBlock(),r.createElementBlock("div",{key:B,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S,E=>(r.openBlock(),r.createElementBlock("div",{key:E.date.date(),class:"fm-calendar__cell"},[E.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["fm-calendar__cell__button",y(E.date)]),type:"button",onClick:()=>u(E.date),onMouseover:A=>k(E.date)},r.toDisplayString(E.date.date()),43,im)):r.createCommentVNode("",!0)]))),128))]))),128))])])]),r.createElementVNode("div",am,[r.createElementVNode("div",rm,[r.createElementVNode("div",lm,[r.createVNode(yt,{"show-menu":d.value,onDropdownChanged:C[3]||(C[3]=S=>d.value=S)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",d.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",cm,r.toDisplayString(a.value.format("MMMM")),1),r.createVNode(R,{name:d.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",dm,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(Array.from(Array(12),(S,B)=>a.value.month(B)),S=>(r.openBlock(),r.createElementBlock("li",{key:S.format("MMMM")},[r.createVNode(Et,{"model-value":a.value.format("MMMM")===S.format("MMMM"),label:S.format("MMMM"),"onUpdate:modelValue":B=>b("right",S)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"]),r.createVNode(yt,{"show-menu":f.value,onDropdownChanged:C[4]||(C[4]=S=>f.value=S)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-calendar__month-year__button",f.value?"fm-calendar__month-year__button--opened":""])},[r.createElementVNode("div",hm,r.toDisplayString(a.value.format("YYYY")),1),r.createVNode(R,{name:f.value?"expand_less":"expand_more",size:"md",color:"black"},null,8,["name"])],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("ul",fm,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(w.value,S=>(r.openBlock(),r.createElementBlock("li",{key:S.format("YYYY")},[r.createVNode(Et,{"model-value":a.value.format("YYYY")===S.format("YYYY"),label:S.format("YYYY"),"onUpdate:modelValue":B=>b("right",S)},null,8,["model-value","label","onUpdate:modelValue"])]))),128))])]),_:1},8,["show-menu"])]),r.createVNode(R,{class:"cursor-pointer select-none",name:"chevron_right",outline:!1,color:"#1C1C1E",onClick:C[5]||(C[5]=()=>b("left",i.value.add(1,"month")))})]),r.createElementVNode("div",null,[r.createElementVNode("div",um,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(_.value,S=>(r.openBlock(),r.createElementBlock("div",{key:S,class:"fm-calendar__cell"},r.toDisplayString(S),1))),128))]),r.createElementVNode("div",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g(a.value),(S,B)=>(r.openBlock(),r.createElementBlock("div",{key:B,class:"fm-calendar__row fm-typo-body-lg-400"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(S,E=>(r.openBlock(),r.createElementBlock("div",{key:E.date.date(),class:"fm-calendar__cell"},[E.isCurrentMonth?(r.openBlock(),r.createElementBlock("button",{key:0,class:r.normalizeClass(["fm-calendar__cell__button",y(E.date)]),type:"button",onClick:()=>u(E.date),onMouseover:A=>k(E.date)},r.toDisplayString(E.date.date()),43,pm)):r.createCommentVNode("",!0)]))),128))]))),128))])])])]),r.createElementVNode("div",mm,[r.createVNode(_t,{label:"Cancel",size:"md",variant:"tertiary",onClick:m}),r.createVNode(_t,{label:"OK",size:"md",variant:"primary",disabled:!s.value.startDate||!s.value.endDate,onClick:p},null,8,["disabled"])])])]),_:2},1032,["show-menu","disabled"])]),"helper-text":r.withCtx(()=>[r.renderSlot(x.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","disabled","rules","focused","helper-text","helper-state"]))}}),ib="",bm=et(gm,[["__scopeId","data-v-431b8ad3"]]),ym=["onSubmit","onReset"],_m=r.defineComponent({__name:"FmForm",emits:["validation-reset","validation-success","validation-failed","reset"],setup(n,{expose:t,emit:e}){const s=r.ref([]),o=r.ref(0),i=()=>{let c=[];for(let d=0;d<s.value.length;d++){const h=s.value[d];c=[...c,...h.validate()]}c.length?e("validation-failed",c):e("validation-success")},a=()=>{for(let c=0;c<s.value.length;c++)s.value[c].resetValue();e("reset")};return t({validateInputs:i,resetInputsValidation:()=>{for(let c=0;c<s.value.length;c++)s.value[c].resetValidation();e("validation-reset")},resetInputs:a}),r.provide(go,{register({validate:c,resetValidation:d,resetValue:h}){return s.value.push({componentId:o.value,validate:c,resetValidation:d,resetValue:h}),o.value++},unregister(c){s.value.filter(d=>d.componentId!==c)}}),(c,d)=>(r.openBlock(),r.createElementBlock("form",{onSubmit:r.withModifiers(i,["prevent"]),onReset:r.withModifiers(a,["prevent"])},[r.renderSlot(c.$slots,"default")],40,ym))}}),xm={class:"fm-radio-btn"},km={class:"fm-radio-btn__input--container"},wm=["value","disabled","checked"],Cm={class:"py-8"},Sm={class:"fm-typo-body-lg-400"},Mm={key:0,class:"fm-typo-body-md-400 text-fm-color-typo-secondary"},vm=r.defineComponent({__name:"FmRadio",props:{modelValue:{default:null},value:{},label:{default:""},sublabel:{default:""},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n){const t=n,e=gt(t,"modelValue"),s=r.ref(),o=r.inject(bo,null),i=()=>{a.value||(o?o.updateValue(t.value):e.value=t.value)},a=r.computed(()=>o?o.getDisabled():t.disabled),l=r.computed(()=>o?t.value===o.groupValue.value:e.value===t.value);return(c,d)=>{const h=r.resolveDirective("wave");return r.openBlock(),r.createElementBlock("div",xm,[r.createElementVNode("label",{class:r.normalizeClass({"fm-radio-btn--wrapper":!0,"cursor-not-allowed text-fm-color-typo-disabled":a.value,"cursor-pointer":!a.value}),onClick:i},[r.withDirectives((r.openBlock(),r.createElementBlock("div",km,[r.createElementVNode("input",{ref_key:"inputEl",ref:s,class:"fm-radio-btn__input--btn",type:"radio",value:c.value,disabled:a.value,checked:l.value},null,8,wm)])),[[h,!a.value]]),r.createElementVNode("div",Cm,[r.renderSlot(c.$slots,"label",{},()=>[r.createElementVNode("div",Sm,r.toDisplayString(c.label),1),c.sublabel?(r.openBlock(),r.createElementBlock("div",Mm,r.toDisplayString(c.sublabel),1)):r.createCommentVNode("",!0)],!0)])],2)])}}}),ab="",Dm=et(vm,[["__scopeId","data-v-24fa5bf9"]]),Bm=r.defineComponent({__name:"FmRadioGroup",props:{modelValue:{},inline:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[n=>!!n||"This field is required"]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=gt(t,"modelValue");return r.provide(bo,{groupValue:e,getDisabled:()=>t.disabled,updateValue(s){e.value=s}}),(s,o)=>(r.openBlock(),r.createBlock(zt,{modelValue:r.unref(e),"onUpdate:modelValue":o[0]||(o[0]=i=>r.isRef(e)?e.value=i:null),label:s.label,disabled:s.disabled,required:s.labelMark==="required",optional:s.labelMark==="optional",info:s.labelInfo,rules:s.rules,"helper-text":s.helperText,"helper-state":s.helperState},{label:r.withCtx(()=>[r.renderSlot(s.$slots,"label")]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass({"flex items-center gap-16 justify-start":s.inline})},[r.renderSlot(s.$slots,"default")],2)]),"helper-text":r.withCtx(()=>[r.renderSlot(s.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","helper-text","helper-state"]))}}),Em={class:"flex flex-col gap-4"},Vm={class:"w-[280px]"},Pm={class:"flex flex-col gap-4 justify-center"},Om=r.defineComponent({__name:"FmSelect",props:{modelValue:{},items:{},multiselect:{type:Boolean,default:!1},placement:{default:"bottom-start"},placeholder:{default:"Select item"},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=gt(t,"modelValue"),s=r.ref(!1),o=(d,h)=>{if(t.multiselect){let f=[];d?f=e.value.length===0?[h]:t.items.filter(u=>e.value.some(p=>ft(u.value,p)||ft(u.value,h.value))):f=t.items.filter(u=>e.value.some(p=>ft(u.value,p)&&!ft(u.value,h.value))),e.value=f.map(u=>u.value)}else e.value=h.value,setTimeout(()=>{s.value=!1},0)},i=d=>{const h=[...e.value].filter((f,u)=>u!==d);e.value=h},a=r.computed(()=>t.multiselect?t.items.filter(d=>r.toRaw(e.value).some(h=>ft(h,d.value))):t.items.filter(d=>ft(e.value,d.value))),l=r.computed(()=>t.items.filter(d=>e.value.some(h=>ft(d.value,h))).map(d=>({label:d.label}))),c=r.computed(()=>{var d;return t.multiselect?t.placeholder:((d=t.items.find(h=>ft(h.value,e.value)))==null?void 0:d.label)??t.placeholder});return(d,h)=>(r.openBlock(),r.createElementBlock("div",Em,[r.createVNode(zt,{modelValue:r.unref(e),"onUpdate:modelValue":h[1]||(h[1]=f=>r.isRef(e)?e.value=f:null),label:d.label,disabled:d.disabled,required:d.labelMark==="required",optional:d.labelMark==="optional",info:d.labelInfo,rules:d.rules,focused:s.value,"helper-text":d.helperText,"helper-state":d.helperState},{label:r.withCtx(()=>[r.renderSlot(d.$slots,"label")]),default:r.withCtx(({invalid:f})=>[r.createVNode(yt,{"show-menu":s.value,disabled:d.disabled,placement:d.placement,onDropdownChanged:h[0]||(h[0]=u=>s.value=u)},{"menu-button":r.withCtx(()=>[r.createVNode(te,{class:r.normalizeClass(d.disabled?"cursor-not-allowed":"cursor-pointer"),focused:s.value,invalid:f,"show-valid-border":d.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(d.$slots,"prepend")]),append:r.withCtx(()=>[r.createVNode(R,{name:s.value?"expand_less":"expand_more",size:"md",color:d.disabled?"#C7C7CC":"black"},null,8,["name","color"])]),default:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["fm-typo-body-lg-400",[t.disabled?"text-fm-color-typo-disabled":r.unref(e)?"text-fm-color-typo-primary":"text-fm-color-typo-tertiary"]])},r.toDisplayString(c.value),3)]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",Vm,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(d.items,u=>(r.openBlock(),r.createBlock(Et,{key:u.value,"has-checkbox":d.multiselect,label:u.label,value:u.value,"model-value":a.value.some(p=>r.unref(ft)(p.value,u.value)),"onUpdate:modelValue":p=>o(p,u)},null,8,["has-checkbox","label","value","model-value","onUpdate:modelValue"]))),128))])]),_:2},1032,["show-menu","disabled","placement"])]),"helper-text":r.withCtx(()=>[r.renderSlot(d.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]),r.createElementVNode("div",Pm,[d.multiselect&&a.value.length>0?(r.openBlock(),r.createBlock(po,{key:0,items:l.value,removable:"",disabled:d.disabled,onChipClosed:i},null,8,["items","disabled"])):r.createCommentVNode("",!0)])]))}}),Am=["inputMode","value","placeholder","readOnly"],Fm={key:0},Tm=r.defineComponent({__name:"FmStepperField",props:{modelValue:{},placeholder:{default:""},inputmode:{default:"numeric"},readonly:{type:Boolean},labelMark:{default:"none"},step:{default:1},min:{default:void 0},max:{default:void 0},prependIcon:{default:""},appendIcon:{default:""},useGrouping:{type:Boolean,default:!0},isCurrency:{type:Boolean,default:!1},showSteppers:{type:Boolean,default:!0},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},label:{default:""},disabled:{type:Boolean},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=gt(t,"modelValue"),{isFocused:s,blur:o,focus:i}=es(),a=r.ref(null);let l;const c=y=>{if(y!==""){const k=+y.replace(/,/g,"");return isNaN(k)?null:k}return null},d=y=>l.format(y),h=y=>{if(typeof e.value!="number"){e.value=+e.value;return}if(y>0&&g.value||y<0&&b.value)return;let k=_(e.value)?e.value+y:0;k=f(k),e.value=k},f=y=>t.max!==void 0&&y>t.max?t.max:t.min!==void 0&&y<t.min?t.min:y,u=()=>{var y;e.value=c(((y=a.value)==null?void 0:y.value)??"")},p=y=>{if(![...Array(10).keys()].map(k=>k.toString()).includes(y.key)&&!["Backspace","Tab","Enter",".","-","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(y.key)){y.preventDefault();return}},m=r.computed(()=>e.value!=null?d(e.value):""),g=r.computed(()=>{let y=!1;return t.max!==void 0&&(y=e.value>=t.max),t.min!==void 0&&(y=e.value<t.min),y}),b=r.computed(()=>{let y=!1;return t.max!==void 0&&(y=e.value>t.max),t.min!==void 0&&(y=e.value<=t.min),y});r.onMounted(()=>{l=new Intl.NumberFormat("en-MY",{useGrouping:t.useGrouping})});function _(y){return typeof y=="number"&&isFinite(y)}return(y,k)=>(r.openBlock(),r.createBlock(zt,{modelValue:r.unref(e),"onUpdate:modelValue":k[8]||(k[8]=w=>r.isRef(e)?e.value=w:null),label:y.label,disabled:y.disabled,required:y.labelMark==="required",optional:y.labelMark==="optional",info:y.labelInfo,rules:y.rules,focused:r.unref(s),"helper-text":y.helperText,"helper-state":y.helperState},{label:r.withCtx(()=>[r.renderSlot(y.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:w})=>[r.createVNode(te,{class:"cursor-text","append-icon":y.appendIcon,"prepend-icon":y.prependIcon,focused:r.unref(s),invalid:w,"show-valid-border":y.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(y.$slots,"prepend",{},void 0,!0)]),append:r.withCtx(()=>[r.renderSlot(y.$slots,"append",{},()=>[r.createElementVNode("div",{class:r.normalizeClass(["flex items-center justify-center",{"mr-32":y.showSteppers}])},[y.appendText?(r.openBlock(),r.createElementBlock("div",Fm,r.toDisplayString(y.appendText),1)):r.createCommentVNode("",!0),y.appendIcon?(r.openBlock(),r.createBlock(R,{key:1,name:y.appendIcon,size:"md",color:y.disabled?"#C7C7CC":"#1C1C1E"},null,8,["name","color"])):r.createCommentVNode("",!0)],2)],!0),y.showSteppers?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["fm-stepper-field__stepper__container",r.unref(s)?"right-[6px]":"right-[7px]"])},[r.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"0",onMousedown:k[2]||(k[2]=()=>h(y.step)),onFocus:k[3]||(k[3]=(...x)=>r.unref(i)&&r.unref(i)(...x)),onBlur:k[4]||(k[4]=(...x)=>r.unref(o)&&r.unref(o)(...x))},[r.createVNode(R,{name:"expand_less",size:"md",color:y.disabled||g.value?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32),r.createElementVNode("button",{class:"fm-stepper-field__stepper__item",tabindex:"1",onMousedown:k[5]||(k[5]=()=>h(-y.step)),onFocus:k[6]||(k[6]=(...x)=>r.unref(i)&&r.unref(i)(...x)),onBlur:k[7]||(k[7]=(...x)=>r.unref(o)&&r.unref(o)(...x))},[r.createVNode(R,{name:"expand_more",size:"md",color:y.disabled||b.value?"#C7C7CC":"#1C1C1E"},null,8,["color"])],32)],2)):r.createCommentVNode("",!0)]),default:r.withCtx(()=>[r.createElementVNode("input",{ref_key:"inputEl",ref:a,class:"fm-stepper-field--input",type:"text",inputMode:y.inputmode,value:m.value,placeholder:y.placeholder,readOnly:y.readonly,onInput:u,onFocus:k[0]||(k[0]=(...x)=>r.unref(i)&&r.unref(i)(...x)),onBlur:k[1]||(k[1]=(...x)=>r.unref(o)&&r.unref(o)(...x)),onKeydown:p},null,40,Am)]),_:2},1032,["append-icon","prepend-icon","focused","invalid","show-valid-border"])]),"helper-text":r.withCtx(()=>[r.renderSlot(y.$slots,"helper-text",{},void 0,!0)]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),rb="",Nm=et(Tm,[["__scopeId","data-v-46378d3b"]]),$m={class:"cursor-pointer fm-switch__container"},Lm={key:0},Rm={class:"fm-typo-body-lg-400"},Im={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},zm={class:"fm-switch__input--container"},Wm=["checked","value","disabled"],jm={key:1},Ym={class:"fm-typo-body-lg-400"},Hm={key:0,class:"fm-color-typo-secondary fm-typo-body-md-400"},Um=r.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){const t=n,e=gt(t,"modelValue"),s=()=>{t.disabled||(e.value=!e.value)};return(o,i)=>(r.openBlock(),r.createElementBlock("label",$m,[o.labelPlacement==="left"?(r.openBlock(),r.createElementBlock("div",Lm,[r.renderSlot(o.$slots,"label",{},void 0,!0),r.createElementVNode("div",Rm,r.toDisplayString(o.label),1),o.sublabel?(r.openBlock(),r.createElementBlock("div",Im,r.toDisplayString(o.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0),r.createElementVNode("div",zm,[r.createElementVNode("input",{checked:r.unref(e),class:"fm-switch__input--btn",type:"checkbox",value:o.value,disabled:o.disabled,onClick:s},null,8,Wm),r.createElementVNode("div",{class:r.normalizeClass({"fm-switch__input--knob":!0,"fm-switch__input--knob--show-icon":o.showIcon})},[o.showIcon?(r.openBlock(),r.createBlock(R,{key:0,name:r.unref(e)?"check":"close",size:"sm",color:o.disabled?"#C7C7CC":r.unref(e)?"#1C1C1E":"#FFFFFF"},null,8,["name","color"])):r.createCommentVNode("",!0)],2)]),o.labelPlacement==="right"?(r.openBlock(),r.createElementBlock("div",jm,[r.createElementVNode("div",Ym,r.toDisplayString(o.label),1),o.sublabel?(r.openBlock(),r.createElementBlock("div",Hm,r.toDisplayString(o.sublabel),1)):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]))}}),lb="",qm=et(Um,[["__scopeId","data-v-c967bf28"]]),Xm=["value","inputMode","type","placeholder","minlength","maxlength","disabled","readOnly"],Km=r.defineComponent({__name:"FmTextField",props:{placeholder:{default:""},minLength:{default:0},maxLength:{default:NaN},inputmode:{default:"text"},readonly:{type:Boolean,default:!1},labelMark:{default:"none"},prependIcon:{default:""},appendIcon:{default:""},showSuccess:{type:Boolean,default:!1},showValidBorder:{type:Boolean,default:!1},prependText:{default:""},appendText:{default:""},labelInfo:{default:""},showWordCount:{type:Boolean,default:!1},modelValue:{},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const t=n,e=r.ref(null),s=gt(t,"modelValue"),{isFocused:o,focus:i,blur:a}=es(),l=c=>{s.value=c.target.value};return(c,d)=>(r.openBlock(),r.createBlock(zt,{modelValue:r.unref(s),"onUpdate:modelValue":d[2]||(d[2]=h=>r.isRef(s)?s.value=h:null),label:c.label,disabled:c.disabled,required:c.labelMark==="required",optional:c.labelMark==="optional",info:c.labelInfo,rules:c.rules,focused:r.unref(o),"helper-text":c.helperText,"helper-state":c.helperState},r.createSlots({label:r.withCtx(()=>[r.renderSlot(c.$slots,"label")]),default:r.withCtx(({invalid:h})=>[r.createVNode(te,{class:"cursor-text","append-icon":c.appendIcon,"prepend-icon":c.prependIcon,focused:r.unref(o),invalid:h,"show-valid-border":c.showValidBorder},{prepend:r.withCtx(()=>[r.renderSlot(c.$slots,"prepend")]),append:r.withCtx(()=>[r.renderSlot(c.$slots,"append")]),default:r.withCtx(()=>[r.createElementVNode("input",{ref_key:"inputEl",ref:e,class:r.normalizeClass({"fm-text-field--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!c.disabled,"fm-color-typo-disabled":c.disabled}),value:r.unref(s),inputMode:c.inputmode,type:c.inputmode,placeholder:c.placeholder,minlength:c.minLength,maxlength:c.maxLength,disabled:c.disabled,readOnly:c.readonly,onInput:l,onFocus:d[0]||(d[0]=(...f)=>r.unref(i)&&r.unref(i)(...f)),onBlur:d[1]||(d[1]=(...f)=>r.unref(a)&&r.unref(a)(...f))},null,42,Xm)]),_:2},1032,["append-icon","prepend-icon","focused","invalid","show-valid-border"])]),"helper-text":r.withCtx(()=>[r.renderSlot(c.$slots,"helper-text")]),_:2},[c.showWordCount?{name:"helper-append",fn:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([c.disabled?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},r.toDisplayString(c.maxLength?`${r.unref(s).length} / ${c.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),cb="",Gm=["value","placeholder","minlength","maxlength","readOnly","disabled"],Zm=r.defineComponent({__name:"FmTextarea",props:{modelValue:{default:""},placeholder:{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},labelInfo:{default:""},helperText:{default:""},helperState:{default:"none"},showWordCount:{type:Boolean,default:!1},label:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]}},emits:["update:modelValue"],setup(n){const e=gt(n,"modelValue"),{isFocused:s,focus:o,blur:i}=es(),a=l=>{e.value=l.target.value};return(l,c)=>(r.openBlock(),r.createBlock(zt,{modelValue:r.unref(e),"onUpdate:modelValue":c[2]||(c[2]=d=>r.isRef(e)?e.value=d:null),label:l.label,disabled:l.disabled,required:l.labelMark==="required",optional:l.labelMark==="optional",info:l.labelInfo,rules:l.rules,focused:r.unref(s),"helper-text":l.helperText,"helper-state":l.helperState},r.createSlots({label:r.withCtx(()=>[r.renderSlot(l.$slots,"label",{},void 0,!0)]),default:r.withCtx(({invalid:d})=>[r.createElementVNode("div",{class:r.normalizeClass({"fm-textarea__container":!0,"fm-textarea__container--focused":r.unref(s),"fm-textarea__container--invalid":!!r.unref(e)&&d,"fm-textarea__container--valid":l.showValidBorder&&l.showSuccess&&!!r.unref(e)&&!d,"fm-textarea__container--disabled":l.disabled})},[r.createElementVNode("textarea",{class:r.normalizeClass({"fm-textarea--input fm-typo-body-lg-400":!0,"fm-color-typo-primary":!l.disabled,"fm-color-typo-disabled":l.disabled}),value:r.unref(e),placeholder:l.placeholder,minlength:l.minLength,maxlength:l.maxLength,readOnly:l.readonly,disabled:l.disabled,onInput:a,onFocus:c[0]||(c[0]=(...h)=>r.unref(o)&&r.unref(o)(...h)),onBlur:c[1]||(c[1]=(...h)=>r.unref(i)&&r.unref(i)(...h))},null,42,Gm)],2)]),"helper-text":r.withCtx(()=>[r.renderSlot(l.$slots,"helper-text",{},void 0,!0)]),_:2},[l.showWordCount?{name:"helper-append",fn:r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass([l.disabled?"fm-color-typo-disabled":"text-fm-color-typo-secondary","fm-typo-body-sm-400"])},r.toDisplayString(l.maxLength?`${r.unref(e).length} / ${l.maxLength}`:""),3)]),key:"0"}:void 0]),1032,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),db="",Jm=et(Zm,[["__scopeId","data-v-280a005d"]]),Qm={class:"flex flex-col fm-time-input items-center"},tg=["value"],eg=r.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,s=r.ref();function o(d){s.value&&(s.value.value=d)}r.watch(()=>e.modelValue,o);function i(){if(!s.value)return;const d=a(s.value.value);if(d==null||d>e.max||d<e.min){o(e.modelValue);return}t("update:model-value",d)}function a(d){return d&&/^\d+$/.test(d)?Number(d):null}function l(){t("update:model-value",a(e.modelValue)+1)}function c(){t("update:model-value",a(e.modelValue)-1)}return(d,h)=>(r.openBlock(),r.createElementBlock("div",Qm,[r.createElementVNode("div",{class:"fm-time-input__scroller",onClick:l},[r.createVNode(R,{name:"expand_less",size:"lg"})]),r.createElementVNode("input",{ref_key:"inputRef",ref:s,value:e.modelValue,onInput:i},null,40,tg),r.createElementVNode("div",{class:"fm-time-input__scroller",onClick:c},[r.createVNode(R,{name:"expand_more",size:"lg"})])]))}}),hb="",ur=et(eg,[["__scopeId","data-v-e8ddb125"]]);var Wt=(n=>(n.AM="AM",n.PM="PM",n))(Wt||{});function ee(n){return n.toString().padStart(2,"0")}const ng={class:"flex fm-time-input gap-16 items-center"},sg=r.createElementVNode("div",{class:"fm-typo-title-sm-700"}," : ",-1),og={class:"fm-time-input-periods"},ig=["onClick"],pr=r.defineComponent({__name:"FmTimeInput",props:{modelValue:{type:Object,required:!0}},emits:["update:model-value"],setup(n,{emit:t}){const e=n;function s(o){const i={hours:o.hours??e.modelValue.hours,minutes:o.minutes??e.modelValue.minutes,period:o.period??e.modelValue.period},a=e.modelValue.hours;(a===12&&i.hours===11||a===11&&i.hours===12)&&(i.period=e.modelValue.period===Wt.AM?Wt.PM:Wt.AM),i.hours>12?i.hours=1:i.hours<1&&(i.hours=12),i.minutes>59?i.minutes=0:i.minutes<0&&(i.minutes=59),t("update:model-value",i)}return(o,i)=>(r.openBlock(),r.createElementBlock("div",ng,[r.createVNode(ur,{"model-value":r.unref(ee)(n.modelValue.hours),min:1,max:12,"onUpdate:modelValue":i[0]||(i[0]=a=>s({hours:a}))},null,8,["model-value"]),sg,r.createVNode(ur,{"model-value":r.unref(ee)(n.modelValue.minutes),min:0,max:59,"onUpdate:modelValue":i[1]||(i[1]=a=>s({minutes:a}))},null,8,["model-value"]),r.createElementVNode("div",og,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(Wt),a=>(r.openBlock(),r.createElementBlock("div",{key:a,class:r.normalizeClass([{"fm-time-input-period__selected":a===n.modelValue.period},"bg-fm-color-neutral-gray-100 fm-time-input-period"]),onClick:()=>s({period:a})},r.toDisplayString(a),11,ig))),128))])]))}}),fb="",ag={class:"flex gap-8"},rg={class:"bg-fm-color-neutral-white flex flex-col p-12 rounded-lg shadow-light-300 w-[343px]"},lg=r.createElementVNode("div",{class:"fm-typo-body-xl-700"}," Enter time ",-1),cg={class:"flex justify-center w-full"},dg={class:"flex justify-end"},hg=r.defineComponent({__name:"FmTimePicker",props:{modelValue:{},showValidBorder:{type:Boolean,default:!1},label:{default:""},labelMark:{default:"none"},labelInfo:{default:""},disabled:{type:Boolean,default:!1},focused:{type:Boolean,default:!1},rules:{default:()=>[]},helperText:{default:""},helperState:{default:"none"}},emits:["update:modelValue"],setup(n){const e=gt(n,"modelValue"),s=r.ref(null),o=r.computed(()=>{if(!e.value)return null;const{hours:p,minutes:m,period:g}=l(e.value);return`${ee(p)}:${ee(m)} ${g}`});function i(){if(!s.value){e.value=null;return}const{hours:p,minutes:m,period:g}=s.value,b=a(p,m,g);e.value=b,h()}function a(p,m,g){let b=p;return g===Wt.PM?b=p===12?p:p+12:p===12&&(b=0),`${ee(b)}:${ee(m)}`}r.onMounted(()=>{e.value&&(s.value=l(e.value))}),r.watch(()=>e.value,p=>{p&&(s.value=l(p))});function l(p){const[m,g,b]=c(p).split(":");return{hours:Number(m),minutes:Number(g),period:b}}function c(p){const[m,g]=p.split(":"),b=Number(m),_=Number(g),y=b>11?Wt.PM:Wt.AM;let k=b;return k===0?k=12:k>12&&(k-=12),`${ee(k)}:${ee(_)}:${y}`}const d=r.ref();function h(){var p;(p=d.value)==null||p.hide()}const f=r.ref(!1);function u(p){p?s.value=l(e.value??"00:00"):s.value=e.value?l(e.value):null,f.value=p}return(p,m)=>(r.openBlock(),r.createBlock(zt,{modelValue:r.unref(e),"onUpdate:modelValue":m[1]||(m[1]=g=>r.isRef(e)?e.value=g:null),label:p.label,disabled:p.disabled,required:p.labelMark==="required",optional:p.labelMark==="optional",info:p.labelInfo,rules:p.rules,focused:f.value,"helper-text":p.helperText,"helper-state":p.helperState},{label:r.withCtx(()=>[r.renderSlot(p.$slots,"label")]),default:r.withCtx(({invalid:g})=>[r.createVNode(yt,{ref_key:"dropdownRef",ref:d,onDropdownChanged:u},{"menu-button":r.withCtx(()=>[r.createVNode(te,{class:r.normalizeClass(p.disabled?"cursor-not-allowed":"cursor-pointer"),focused:f.value,invalid:g,"show-valid-border":p.showValidBorder},{default:r.withCtx(()=>[r.createElementVNode("div",ag,[r.createVNode(R,{name:"schedule",outline:!f.value},null,8,["outline"]),r.createElementVNode("div",{class:r.normalizeClass(["grow",{"text-fm-color-typo-disabled":!o.value}])},r.toDisplayString(o.value??"HH:MM"),3)])]),_:2},1032,["class","focused","invalid","show-valid-border"])]),"menu-wrapper":r.withCtx(()=>[r.createElementVNode("div",rg,[lg,r.createElementVNode("div",cg,[r.createVNode(pr,{"model-value":s.value??{hours:0,minutes:0,period:r.unref(Wt).AM},class:"py-16","onUpdate:modelValue":m[0]||(m[0]=b=>s.value=b)},null,8,["model-value"])]),r.createElementVNode("div",dg,[r.createVNode(_t,{label:"Cancel",variant:"tertiary",onClick:h}),r.createVNode(_t,{label:"Confirm",variant:"tertiary",onClick:i})])])]),_:2},1536)]),"helper-text":r.withCtx(()=>[r.renderSlot(p.$slots,"helper-text")]),_:3},8,["modelValue","label","disabled","required","optional","info","rules","focused","helper-text","helper-state"]))}}),fg=r.defineComponent({__name:"FmList",props:{separator:{type:Boolean,default:!1},disabled:{type:Boolean},activeClass:{default:""}},setup(n){return(t,e)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass({"fm-list--separator":t.separator,activeClass:t.activeClass})},[r.renderSlot(t.$slots,"default",{},void 0,!0)],2))}}),ub="",ug=et(fg,[["__scopeId","data-v-884ba127"]]),pg=r.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,s)=>{const o=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createBlock(t.tag,{class:r.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:r.withCtx(()=>[r.renderSlot(e.$slots,"default",{},void 0,!0)]),_:3},8,["class"])),[[o,e.clickable&&!e.disabled]])}}}),pb="",mg=et(pg,[["__scopeId","data-v-f565b558"]]),gg={class:"fm-progress-indicator relative"},bg=["data-progress"],yg={class:"absolute flex fm-typo-body-sm-400 h-full inset-0 items-center justify-center w-full"},mr=r.defineComponent({__name:"FmProgressIndicator",props:{modelValue:{type:Number,required:!0}},setup(n){const t=n,e=r.ref(null),s=r.computed(()=>`${t.modelValue/100*360}deg`),o=i=>{e.value&&e.value.style.setProperty("--progress",i)};return r.onMounted(()=>{o(s.value)}),r.onUpdated(()=>{o(s.value)}),r.watch(s,async i=>{o(i)}),(i,a)=>(r.openBlock(),r.createElementBlock("div",gg,[r.createElementVNode("div",{ref_key:"progress",ref:e,class:"fm-progress-circular w-full","data-progress":s.value},null,8,bg),r.createElementVNode("div",yg,[r.renderSlot(i.$slots,"default")])]))}}),mb="",_g={class:"flex"},xg={key:0,class:"mt-8"},kg=r.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,s=r.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}`)}}),o=r.computed(()=>e.title?{text:e.title,classes:"fm-typo-body-lg-700"}:{text:e.description,classes:""}),i=r.computed(()=>e.bgColor?rs(e.bgColor)?{style:{backgroundColor:e.bgColor}}:{class:`bg-fm-color-${e.bgColor}`}:{class:`bg-fm-color-${s.value.bgColor}`}),a=r.computed(()=>e.color?rs(e.color)?{style:{color:e.color}}:{class:`text-fm-color-${e.color}`}:{class:`text-fm-color-${s.value.actionColor}`});return(l,c)=>(r.openBlock(),r.createElementBlock("div",r.mergeProps(i.value,{class:"fm-corner-radius-lg fm-snackbar px-24 py-16"}),[r.createElementVNode("div",_g,[s.value.icon?(r.openBlock(),r.createBlock(R,{key:0,name:s.value.icon.name,color:e.color??s.value.icon.color,class:"mr-12"},null,8,["name","color"])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:r.normalizeClass(`${o.value.classes} grow ellipsis`)},r.toDisplayString(o.value.text),3),e.dismissable?(r.openBlock(),r.createBlock(R,{key:1,style:{"{ flex":"none}"},name:"close",class:"cursor-pointer",onClick:c[0]||(c[0]=()=>t("onDismiss"))})):r.createCommentVNode("",!0)]),e.title&&e.description?(r.openBlock(),r.createElementBlock("div",xg,r.toDisplayString(e.description),1)):r.createCommentVNode("",!0),r.renderSlot(l.$slots,"actions",{},()=>[e.action?(r.openBlock(),r.createElementBlock("div",r.mergeProps({key:0},a.value,{class:"mt-16 fm-typo-body-lg-700"}),[r.createElementVNode("span",{class:"cursor-pointer",onClick:c[1]||(c[1]=()=>t("onAction"))},r.toDisplayString(e.action),1)],16)):r.createCommentVNode("",!0)],!0)],16))}}),gb="",wg=et(kg,[["__scopeId","data-v-b6db34bb"]]),Cg={key:0,class:"fm-step-description fm-typo-body-sm-400 line-clamp-1 mt-4"},gr=r.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)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex flex-col",n.disabled?"text-fm-color-typo-disabled":""])},[r.createElementVNode("div",{class:r.normalizeClass(["fm-step-title line-clamp-2",n.titleBold?"fm-typo-body-xl-700":"fm-typo-body-md-400"])},r.toDisplayString(n.title),3),n.description?(r.openBlock(),r.createElementBlock("div",Cg,r.toDisplayString(n.description),1)):r.createCommentVNode("",!0)],2))}}),Sg=["data-title","data-description","data-disabled","onClick"],Mg={class:"flex fm-step-container gap-12 grow"},vg=r.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:s}=r.inject(yo);function o(){i.value||s(t.value)}const i=r.computed(()=>t.disabled?t.disabled():!1),a=r.computed(()=>t.error?t.error():!1),l=r.computed(()=>e()===t.value),c=r.computed(()=>t.complete()),d=r.computed(()=>l.value||c.value||e()>t.value?"bg-fm-color-primary":"bg-fm-color-neutral-gray-300"),h=r.computed(()=>l.value?{className:"bg-fm-color-primary"}:a.value?{config:{name:"warning",color:"system-error-300"}}:i.value?{className:"border-2 border-fm-color-neutral-gray-200"}:c.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=r.resolveDirective("wave");return r.withDirectives((r.openBlock(),r.createElementBlock("div",{"data-title":n.title,"data-description":n.description,"data-disabled":i.value,class:r.normalizeClass(`fm-step gap-4 grow ${i.value?"cursor-not-allowed":"cursor-pointer"}`),onClick:r.withModifiers(o,["stop"])},[r.createElementVNode("div",null,[r.createElementVNode("div",{class:r.normalizeClass(`fm-step-indicator ${d.value}`)},null,2)]),r.createElementVNode("div",Mg,[r.createElementVNode("div",{class:r.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?(r.openBlock(),r.createBlock(R,{key:0,name:h.value.config.name,color:h.value.config.color,outline:"",class:"absolute"},null,8,["name","color"])):r.createCommentVNode("",!0)],2),r.createVNode(gr,{title:n.title,description:n.description,disabled:i.value,class:"grow"},null,8,["title","description","disabled"])])],10,Sg)),[[p,!i.value]])}}}),bb="",Dg=et(vg,[["__scopeId","data-v-ee172cad"]]),Bg={class:"hidden items-center xs:flex"},Eg={class:"flex gap-2 items-start justify-end mb-24 mt-40 p-0 self-stretch"},Vg=r.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,s=h=>{t("update:model-value",h)};r.provide(yo,{currentStep:()=>e.modelValue,goToStep:s});const o=r.ref(),i=r.ref([]),a=r.computed(()=>i.value[e.modelValue-1]),l=r.computed(()=>e.modelValue/i.value.length*100),c=r.computed(()=>`${e.modelValue} of ${i.value.length}`),d=()=>{var f;const h=Array.from(((f=o.value)==null?void 0:f.querySelectorAll(":scope > .fm-step"))??[]);i.value=h.map(u=>({title:u.dataset.title??"",description:u.dataset.description,disabled:u.dataset.disabled=="true"}))};return r.onMounted(()=>{d()}),(h,f)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(`fm-stepper fm-stepper__${n.orientation}`)},[r.createElementVNode("div",{ref_key:"stepperRef",ref:o,class:r.normalizeClass(`flex mx-24 mt-12 mb-24 xs:hidden ${n.orientation==="vertical"?"flex-col":""}`)},[r.renderSlot(h.$slots,"default")],2),r.createElementVNode("div",Bg,[r.createVNode(mr,{"model-value":l.value,class:"mr-12",style:{"min-width":"60px"}},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(c.value),1)]),_:1},8,["model-value"]),a.value?(r.openBlock(),r.createBlock(gr,{key:0,class:"grow","title-bold":"",title:a.value.title,description:a.value.description,disabled:a.value.disabled},null,8,["title","description","disabled"])):r.createCommentVNode("",!0)]),h.$slots.contents?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(`flex-col mx-24 mt-12 mb-24 ${n.orientation==="vertical"?"w-2/3":""}`)},[r.renderSlot(h.$slots,"contents"),r.createElementVNode("div",Eg,[r.renderSlot(h.$slots,"actions")])],2)):r.createCommentVNode("",!0)],2))}});let Pg=0;function Og(){return Pg++}const Ag=n=>(r.pushScopeId("data-v-fae3740e"),n=n(),r.popScopeId(),n),Fg=["disabled"],Tg=[Ag(()=>r.createElementVNode("div",{class:"fm-tab__indicator"},null,-1))],Ng={class:"max-w-[360px] min-w-[186px]"},$g=r.defineComponent({__name:"FmTab",props:{modelValue:{default:null},label:{default:""},vertical:{type:Boolean,default:!1},icon:{default:""},disabled:{type:Boolean,default:!1},badge:{default:0},value:{default:()=>Og()},children:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=r.ref(!1),o=r.ref(!1);function i(h){s.value=h}const a=()=>{e.disabled||e.children.length>0||t("update:modelValue",e.value)},l=h=>{e.children.length!==0&&(o.value=h)},c=r.computed(()=>e.children.length>0?e.children.some(h=>h.value===e.modelValue):e.modelValue===e.value),d=h=>{o.value=!1,t("update:modelValue",h)};return(h,f)=>(r.openBlock(),r.createBlock(yt,{"show-menu":o.value,disabled:h.children.length===0,class:r.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":h.vertical}]),placement:h.vertical?"right-start":"bottom-start",onDropdownChanged:l},{"menu-button":r.withCtx(()=>[r.createElementVNode("button",{class:r.normalizeClass(["fm-tab",`fm-tab--${h.vertical?"vertical":"horizontal"}`,h.disabled?"cursor-not-allowed":"cursor-pointer",{"fm-tab--selected":c.value}]),disabled:h.disabled,onMousedown:f[0]||(f[0]=()=>i(!0)),onMouseup:f[1]||(f[1]=()=>i(!1)),onMouseleave:f[2]||(f[2]=()=>i(!1)),onClick:a},[r.renderSlot(h.$slots,"prepend",{},void 0,!0),h.icon?(r.openBlock(),r.createBlock(R,{key:0,name:h.icon,outline:!s.value&&!c.value,color:h.disabled?"neutral-gray-200":c.value?"primary":"neutral-black",size:"md"},null,8,["name","outline","color"])):r.createCommentVNode("",!0),h.label?(r.openBlock(),r.createElementBlock("span",{key:1,class:r.normalizeClass(["fm-typo-body-lg-700 text-fm-color-typo-primary col-start-2 row-start-1",c.value?"visible":"invisible"])},r.toDisplayString(h.label),3)):r.createCommentVNode("",!0),h.label?(r.openBlock(),r.createElementBlock("span",{key:2,class:r.normalizeClass(["fm-typo-body-lg-400 col-start-2 row-start-1",h.disabled?"text-fm-color-typo-disabled":"text-fm-color-typo-secondary",!c.value||h.disabled?"visible":"invisible"])},r.toDisplayString(h.label),3)):r.createCommentVNode("",!0),h.badge?(r.openBlock(),r.createBlock(hn,{key:3,value:h.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0),h.children.length>0?(r.openBlock(),r.createBlock(R,{key:4,size:"md",name:o.value?"expand_less":"expand_more"},null,8,["name"])):r.createCommentVNode("",!0),r.renderSlot(h.$slots,"append",{},void 0,!0),c.value?(r.openBlock(),r.createElementBlock("div",{key:5,class:r.normalizeClass([`fm-tab__indicator__wrapper--${h.vertical?"vertical":"horizontal"}`])},Tg,2)):r.createCommentVNode("",!0)],42,Fg)]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",Ng,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.children,u=>r.renderSlot(h.$slots,"list-item",r.normalizeProps(r.guardReactiveProps(u)),()=>[r.createVNode(Et,{"model-value":e.modelValue===u.value,label:u.label,icon:u.icon,disabled:u.disabled,onClick:p=>d(u.value)},{append:r.withCtx(()=>[u.badge?(r.openBlock(),r.createBlock(hn,{key:0,value:u.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])],!0)),256))])]),_:3},8,["show-menu","disabled","class","placement"]))}}),_b="",br=et($g,[["__scopeId","data-v-fae3740e"]]),Lg=r.createElementVNode("span",{class:"fm-typo-body-lg-400 text-fm-color-typo-secondary"}," More ",-1),Rg={class:"max-w-[360px] min-w-[186px]"},Ig={FmBadge:hn,FmBreadcrumb:Fr,FmButton:_t,FmButtonGroup:Ur,FmCard:Kr,FmCardActions:Gr,FmCardSection:Zr,FmCardTitle:fo,FmChip:uo,FmChipGroup:po,FmDialog:el,FmDropField:il,FmDynamicDialog:xo,FmLineChart:vu,FmCheckbox:za,FmDatePicker:jp,FmDateRangePicker:bm,FmField:te,FmForm:_m,FmFormGroup:zt,FmHelperText:lr,FmLabel:dr,FmRadio:Dm,FmRadioGroup:Bm,FmSelect:Om,FmStepperField:Nm,FmSwitch:qm,FmTextField:Km,FmTextarea:Jm,FmTimeInput:pr,FmTimePicker:hg,FmIcon:R,FmList:ug,FmListItem:mg,FmMenu:yt,FmMenuItem:Et,FmProgressIndicator:mr,FmSnackbar:wg,FmSpacer:mo,FmStep:Dg,FmStepper:Vg,FmTab:br,FmTabs:r.defineComponent({__name:"FmTabs",props:{modelValue:{default:null},items:{},vertical:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showMoreAt:{default:6}},emits:["update:modelValue"],setup(n,{emit:t}){const e=n,s=r.ref(!1),o=r.computed(()=>({vertical:e.vertical,disabled:e.disabled})),i=r.computed(()=>e.items.slice(0,e.showMoreAt)),a=r.computed(()=>e.items.slice(e.showMoreAt)),l=c=>{s.value=!1,t("update:modelValue",c)};return(c,d)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["flex",c.vertical?"flex-col":"flex-row items-center"])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,h=>r.renderSlot(c.$slots,"default",r.normalizeProps(r.guardReactiveProps({...h,tabsProps:o.value})),()=>[r.createVNode(br,r.mergeProps({"model-value":e.modelValue},{children:h.children,label:h.label,icon:h.icon,disabled:h.disabled,badge:h.badge,value:h.value,tabsProps:o.value},{disabled:h.disabled===void 0?c.disabled:h.disabled,vertical:c.vertical,"onUpdate:modelValue":d[0]||(d[0]=f=>t("update:modelValue",f))}),null,16,["model-value","disabled","vertical"])])),256)),a.value.length>0?(r.openBlock(),r.createBlock(yt,{key:0,"show-menu":s.value,class:r.normalizeClass(["max-w-[360px] min-w-[90px] rounded-sm",{"w-full":c.vertical}]),placement:c.vertical?"right-start":"bottom-start",onDropdownChanged:d[1]||(d[1]=h=>s.value=h)},{"menu-button":r.withCtx(()=>[r.createElementVNode("div",{class:r.normalizeClass(["flex gap-8 hover:bg-fm-color-opacity-sm items-center px-16 rounded-sm",[c.vertical?"h-40":"h-[46px]"]])},[r.createVNode(R,{name:"more_vert"}),Lg],2)]),"menu-content":r.withCtx(()=>[r.createElementVNode("div",Rg,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.value,h=>r.renderSlot(c.$slots,"list-item",r.normalizeProps(r.guardReactiveProps(h)),()=>[r.createVNode(Et,{"model-value":e.modelValue===h.value,label:h.label,icon:h.icon,disabled:h.disabled,onClick:f=>l(h.value)},{append:r.withCtx(()=>[h.badge?(r.openBlock(),r.createBlock(hn,{key:0,value:h.badge,inline:"",variant:"numeric"},null,8,["value"])):r.createCommentVNode("",!0)]),_:2},1032,["model-value","label","icon","disabled","onClick"])])),256))])]),_:3},8,["show-menu","class","placement"])):r.createCommentVNode("",!0)],2))}}),FmTooltip:cr};function zg(){const n=r.inject(_o);if(!n)throw new Error("No provider");return n}const Wg=n=>{n.use(Dr,{duration:.3,color:"var(--fm-color-opacity-sm)",initialOpacity:1,finalOpacity:.1,dissolveDuration:.6}),n.use(cl),Object.entries(Ig).forEach(([t,e])=>{n.component(t,e)})};it.uiPlugin=Wg,it.useDialog=zg,it.useFormChild=fr,it.useValidation=hr,Object.defineProperty(it,Symbol.toStringTag,{value:"Module"})});