diff --git a/assets/index-GSuNDu8-.css b/assets/index-B9AZDeTj.css similarity index 64% rename from assets/index-GSuNDu8-.css rename to assets/index-B9AZDeTj.css index 688d30f6..667334fa 100644 --- a/assets/index-GSuNDu8-.css +++ b/assets/index-B9AZDeTj.css @@ -1 +1 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Work Sans,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.collapse{visibility:collapse}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.flex{display:flex}.table{display:table}.grid{display:grid}.h-full{height:100%}.w-1\/6{width:16.666667%}.w-2\/6{width:33.333333%}.w-full{width:100%}.max-w-2xl{max-width:42rem}.max-w-xl{max-width:36rem}.table-auto{table-layout:auto}.border-collapse{border-collapse:collapse}.border-spacing-0{--tw-border-spacing-x: 0px;--tw-border-spacing-y: 0px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-bl-lg{border-bottom-left-radius:.5rem}.rounded-tl-lg{border-top-left-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.p-2{padding:.5rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.text-left{text-align:left}.text-5xl{font-size:3rem;line-height:1}.font-bold{font-weight:700}.font-semibold{font-weight:600}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}@font-face{font-family:Work Sans;src:url(/governance-experiment/assets/WorkSans-Regular-DqDqAD3Z.woff2) format("woff2"),url(/governance-experiment/assets/WorkSans-Regular-BAH984E1.woff) format("woff");font-weight:400;font-style:normal;font-display:swap}:root{font-family:Work Sans,sans-serif;line-height:1.5;font-weight:400;color:#000;background-color:#dadada;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:2.2em;line-height:1.1}.card{padding:2em}#app{max-width:100vw;margin:0 auto;padding:2rem;text-align:center}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#9900fc}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}div.component{color:#000;border-radius:1.5rem;padding:2.2rem 3.3rem;margin-bottom:1.5rem;border:1px solid #000000}.border-purple{border-color:#9900fc}.purple{color:#9900fc}@media (max-width: 640px){#app{padding:.5rem}h1{font-size:1.5em}div.component{padding:1rem 2rem;border-radius:3rem}}@media (min-width: 1024px){.lg\:flex-row{flex-direction:row}.lg\:space-x-7>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.75rem * var(--tw-space-x-reverse));margin-left:calc(1.75rem * calc(1 - var(--tw-space-x-reverse)))}}div.svelte-1yk4q9m p span.svelte-1yk4q9m{color:#000;text-decoration:underline;text-decoration-color:#9900fc;text-decoration-thickness:5px}.thead.svelte-5m5lvp.svelte-5m5lvp{background-color:#d9d9d9;color:#000}thead.svelte-5m5lvp tr th.svelte-5m5lvp{font-weight:700}summary.svelte-ol7h74.svelte-ol7h74{cursor:pointer}details[open].svelte-ol7h74 summary.svelte-ol7h74{font-weight:700}table.svelte-ol7h74.svelte-ol7h74{border-collapse:collapse;width:100%}td.svelte-ol7h74.svelte-ol7h74{border-bottom:1px solid #000}tbody.svelte-ol7h74 tr:last-child td.svelte-ol7h74{border-bottom:none}.font-semibold.svelte-ol7h74.svelte-ol7h74{font-weight:600}.description.svelte-ol7h74.svelte-ol7h74{max-width:345px}h1.svelte-10lgg3m{text-align:left;margin-top:1rem;margin-bottom:2rem} +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Work Sans,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.collapse{visibility:collapse}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.flex{display:flex}.table{display:table}.grid{display:grid}.h-full{height:100%}.w-1\/6{width:16.666667%}.w-2\/6{width:33.333333%}.w-full{width:100%}.max-w-2xl{max-width:42rem}.max-w-xl{max-width:36rem}.table-auto{table-layout:auto}.border-collapse{border-collapse:collapse}.border-spacing-0{--tw-border-spacing-x: 0px;--tw-border-spacing-y: 0px;border-spacing:var(--tw-border-spacing-x) var(--tw-border-spacing-y)}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.content-start{align-content:flex-start}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-center{justify-content:center}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-bl-lg{border-bottom-left-radius:.5rem}.rounded-tl-lg{border-top-left-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.p-2{padding:.5rem}.p-6{padding:1.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.text-left{text-align:left}.text-5xl{font-size:3rem;line-height:1}.font-bold{font-weight:700}.font-semibold{font-weight:600}.lowercase{text-transform:lowercase}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}@font-face{font-family:Work Sans;src:url(/governance-experiment/assets/WorkSans-Regular-DqDqAD3Z.woff2) format("woff2"),url(/governance-experiment/assets/WorkSans-Regular-BAH984E1.woff) format("woff");font-weight:400;font-style:normal;font-display:swap}:root{font-family:Work Sans,sans-serif;line-height:1.5;font-weight:400;color:#000;background-color:#dadada;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:2.2em;line-height:1.1}.card{padding:2em}#app{max-width:100vw;margin:0 auto;padding:2rem;text-align:center}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#9900fc}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}div.component{color:#000;border-radius:1.5rem;padding:2.2rem 3.3rem;margin-bottom:1.5rem;border:1px solid #000000}.border-purple{border-color:#9900fc}.purple{color:#9900fc}@media (max-width: 640px){#app{padding:.5rem}h1{font-size:1.5em}div.component{padding:1rem 2rem;border-radius:3rem}}@media (min-width: 1024px){.lg\:flex-row{flex-direction:row}.lg\:space-x-7>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.75rem * var(--tw-space-x-reverse));margin-left:calc(1.75rem * calc(1 - var(--tw-space-x-reverse)))}}div.svelte-1yk4q9m p span.svelte-1yk4q9m{color:#000;text-decoration:underline;text-decoration-color:#9900fc;text-decoration-thickness:5px}.thead.svelte-5m5lvp.svelte-5m5lvp{background-color:#d9d9d9;color:#000}thead.svelte-5m5lvp tr th.svelte-5m5lvp{font-weight:700}button.svelte-181uvzo{padding:10px 20px;font-size:16px;cursor:pointer;border-radius:0;border:1px solid #000;background-color:#f5f5f5;margin:2rem 0}button.svelte-181uvzo:hover{background-color:#000;color:#fff}summary.svelte-1hsaqri.svelte-1hsaqri{cursor:pointer}details[open].svelte-1hsaqri summary.svelte-1hsaqri{font-weight:700}table.svelte-1hsaqri.svelte-1hsaqri{border-collapse:collapse;width:100%}td.svelte-1hsaqri.svelte-1hsaqri{border-bottom:1px solid #000}tbody.svelte-1hsaqri tr:last-child td.svelte-1hsaqri{border-bottom:none}.font-semibold.svelte-1hsaqri.svelte-1hsaqri{font-weight:600}.description.svelte-1hsaqri.svelte-1hsaqri{max-width:345px}.component.svelte-1hsaqri.svelte-1hsaqri{border-style:dotted;border:2px dotted #000}h1.svelte-10lgg3m{text-align:left;margin-top:1rem;margin-bottom:2rem} diff --git a/assets/index-CBD7SdGX.js b/assets/index-CBD7SdGX.js new file mode 100644 index 00000000..0c3fba15 --- /dev/null +++ b/assets/index-CBD7SdGX.js @@ -0,0 +1,34 @@ +var Wr=Object.defineProperty;var Vr=(i,t,e)=>t in i?Wr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var O=(i,t,e)=>Vr(i,typeof t!="symbol"?t+"":t,e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function e(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=e(s);fetch(s.href,o)}})();function Pt(){}function Wo(i){return i()}function ls(){return Object.create(null)}function di(i){i.forEach(Wo)}function Vo(i){return typeof i=="function"}function ui(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}function Hr(i){return Object.keys(i).length===0}function I(i,t){i.appendChild(t)}function ce(i,t,e){i.insertBefore(t,e||null)}function Gt(i){i.parentNode&&i.parentNode.removeChild(i)}function jr(i,t){for(let e=0;ei.removeEventListener(t,e,n)}function K(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function $r(i){return Array.from(i.childNodes)}function xe(i,t){t=""+t,i.data!==t&&(i.data=t)}let Vn;function Ge(i){Vn=i}const Le=[],cs=[];let Ee=[];const hs=[],Yr=Promise.resolve();let kn=!1;function Ur(){kn||(kn=!0,Yr.then(Ho))}function wn(i){Ee.push(i)}const ln=new Set;let De=0;function Ho(){if(De!==0)return;const i=Vn;do{try{for(;Dei.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),Ee=t}const Li=new Set;let ye;function Kr(){ye={r:0,c:[],p:ye}}function Gr(){ye.r||di(ye.c),ye=ye.p}function Ie(i,t){i&&i.i&&(Li.delete(i),i.i(t))}function ii(i,t,e,n){if(i&&i.o){if(Li.has(i))return;Li.add(i),ye.c.push(()=>{Li.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}function ds(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function Hn(i){i&&i.c()}function Gi(i,t,e){const{fragment:n,after_update:s}=i.$$;n&&n.m(t,e),wn(()=>{const o=i.$$.on_mount.map(Wo).filter(Vo);i.$$.on_destroy?i.$$.on_destroy.push(...o):di(o),i.$$.on_mount=[]}),s.forEach(wn)}function Zi(i,t){const e=i.$$;e.fragment!==null&&(qr(e.after_update),di(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Zr(i,t){i.$$.dirty[0]===-1&&(Le.push(i),Ur(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<{const g=f.length?f[0]:u;return c.ctx&&s(c.ctx[d],c.ctx[d]=g)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](g),h&&Zr(i,d)),u}):[],c.update(),h=!0,di(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const d=$r(t.target);c.fragment&&c.fragment.l(d),d.forEach(Gt)}else c.fragment&&c.fragment.c();t.intro&&Ie(i.$$.fragment),Gi(i,t.target,t.anchor),Ho()}Ge(l)}class Ji{constructor(){O(this,"$$");O(this,"$$set")}$destroy(){Zi(this,1),this.$destroy=Pt}$on(t,e){if(!Vo(e))return Pt;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const s=n.indexOf(e);s!==-1&&n.splice(s,1)}}$set(t){this.$$set&&!Hr(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Qr="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Qr);const Oe=[];function jn(i,t=Pt){let e;const n=new Set;function s(a){if(ui(i,a)&&(i=a,e)){const l=!Oe.length;for(const c of n)c[1](),Oe.push(c,i);if(l){for(let c=0;c{n.delete(c),n.size===0&&e&&(e(),e=null)}}return{set:s,update:o,subscribe:r}}var Jr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ta(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var jo={exports:{}};/* @license +Papa Parse +v5.4.1 +https://github.com/mholt/PapaParse +License: MIT +*/(function(i,t){(function(e,n){i.exports=n()})(Jr,function e(){var n=typeof self<"u"?self:typeof window<"u"?window:n!==void 0?n:{},s=!n.document&&!!n.postMessage,o=n.IS_PAPA_WORKER||!1,r={},a=0,l={parse:function(p,b){var v=(b=b||{}).dynamicTyping||!1;if(w(v)&&(b.dynamicTypingFunction=v,v={}),b.dynamicTyping=v,b.transform=!!w(b.transform)&&b.transform,b.worker&&l.WORKERS_SUPPORTED){var M=function(){if(!l.WORKERS_SUPPORTED)return!1;var E=(F=n.URL||n.webkitURL||null,z=e.toString(),l.BLOB_URL||(l.BLOB_URL=F.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",z,")();"],{type:"text/javascript"})))),R=new n.Worker(E),F,z;return R.onmessage=y,R.id=a++,r[R.id]=R}();return M.userStep=b.step,M.userChunk=b.chunk,M.userComplete=b.complete,M.userError=b.error,b.step=w(b.step),b.chunk=w(b.chunk),b.complete=w(b.complete),b.error=w(b.error),delete b.worker,void M.postMessage({input:p,config:b,workerId:M.id})}var P=null;return l.NODE_STREAM_INPUT,typeof p=="string"?(p=function(E){return E.charCodeAt(0)===65279?E.slice(1):E}(p),P=b.download?new d(b):new f(b)):p.readable===!0&&w(p.read)&&w(p.on)?P=new g(b):(n.File&&p instanceof File||p instanceof Object)&&(P=new u(b)),P.stream(p)},unparse:function(p,b){var v=!1,M=!0,P=",",E=`\r +`,R='"',F=R+R,z=!1,A=null,j=!1;(function(){if(typeof b=="object"){if(typeof b.delimiter!="string"||l.BAD_DELIMITERS.filter(function(T){return b.delimiter.indexOf(T)!==-1}).length||(P=b.delimiter),(typeof b.quotes=="boolean"||typeof b.quotes=="function"||Array.isArray(b.quotes))&&(v=b.quotes),typeof b.skipEmptyLines!="boolean"&&typeof b.skipEmptyLines!="string"||(z=b.skipEmptyLines),typeof b.newline=="string"&&(E=b.newline),typeof b.quoteChar=="string"&&(R=b.quoteChar),typeof b.header=="boolean"&&(M=b.header),Array.isArray(b.columns)){if(b.columns.length===0)throw new Error("Option columns is empty");A=b.columns}b.escapeChar!==void 0&&(F=b.escapeChar+R),(typeof b.escapeFormulae=="boolean"||b.escapeFormulae instanceof RegExp)&&(j=b.escapeFormulae instanceof RegExp?b.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var L=new RegExp(_(R),"g");if(typeof p=="string"&&(p=JSON.parse(p)),Array.isArray(p)){if(!p.length||Array.isArray(p[0]))return ct(null,p,z);if(typeof p[0]=="object")return ct(A||Object.keys(p[0]),p,z)}else if(typeof p=="object")return typeof p.data=="string"&&(p.data=JSON.parse(p.data)),Array.isArray(p.data)&&(p.fields||(p.fields=p.meta&&p.meta.fields||A),p.fields||(p.fields=Array.isArray(p.data[0])?p.fields:typeof p.data[0]=="object"?Object.keys(p.data[0]):[]),Array.isArray(p.data[0])||typeof p.data[0]=="object"||(p.data=[p.data])),ct(p.fields||[],p.data||[],z);throw new Error("Unable to serialize unrecognized input");function ct(T,N,H){var W="";typeof T=="string"&&(T=JSON.parse(T)),typeof N=="string"&&(N=JSON.parse(N));var U=Array.isArray(T)&&0=this._config.preview;if(o)n.postMessage({results:E,workerId:l.WORKER_ID,finished:F});else if(w(this._config.chunk)&&!v){if(this._config.chunk(E,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);E=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(E.data),this._completeResults.errors=this._completeResults.errors.concat(E.errors),this._completeResults.meta=E.meta),this._completed||!F||!w(this._config.complete)||E&&E.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),F||E&&E.meta.paused||this._nextChunk(),E}this._halted=!0},this._sendError=function(b){w(this._config.error)?this._config.error(b):o&&this._config.error&&n.postMessage({workerId:l.WORKER_ID,error:b,finished:!1})}}function d(p){var b;(p=p||{}).chunkSize||(p.chunkSize=l.RemoteChunkSize),h.call(this,p),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(v){this._input=v,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(b=new XMLHttpRequest,this._config.withCredentials&&(b.withCredentials=this._config.withCredentials),s||(b.onload=D(this._chunkLoaded,this),b.onerror=D(this._chunkError,this)),b.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var v=this._config.downloadRequestHeaders;for(var M in v)b.setRequestHeader(M,v[M])}if(this._config.chunkSize){var P=this._start+this._config.chunkSize-1;b.setRequestHeader("Range","bytes="+this._start+"-"+P)}try{b.send(this._config.downloadRequestBody)}catch(E){this._chunkError(E.message)}s&&b.status===0&&this._chunkError()}},this._chunkLoaded=function(){b.readyState===4&&(b.status<200||400<=b.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:b.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(v){var M=v.getResponseHeader("Content-Range");return M===null?-1:parseInt(M.substring(M.lastIndexOf("/")+1))}(b),this.parseChunk(b.responseText)))},this._chunkError=function(v){var M=b.statusText||v;this._sendError(new Error(M))}}function u(p){var b,v;(p=p||{}).chunkSize||(p.chunkSize=l.LocalChunkSize),h.call(this,p);var M=typeof FileReader<"u";this.stream=function(P){this._input=P,v=P.slice||P.webkitSlice||P.mozSlice,M?((b=new FileReader).onload=D(this._chunkLoaded,this),b.onerror=D(this._chunkError,this)):b=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(P.target.result)},this._chunkError=function(){this._sendError(b.error)}}function f(p){var b;h.call(this,p=p||{}),this.stream=function(v){return b=v,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var v,M=this._config.chunkSize;return M?(v=b.substring(0,M),b=b.substring(M)):(v=b,b=""),this._finished=!b,this.parseChunk(v)}}}function g(p){h.call(this,p=p||{});var b=[],v=!0,M=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(P){this._input=P,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){M&&b.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),b.length?this.parseChunk(b.shift()):v=!0},this._streamData=D(function(P){try{b.push(typeof P=="string"?P:P.toString(this._config.encoding)),v&&(v=!1,this._checkIsFinished(),this.parseChunk(b.shift()))}catch(E){this._streamError(E)}},this),this._streamError=D(function(P){this._streamCleanUp(),this._sendError(P)},this),this._streamEnd=D(function(){this._streamCleanUp(),M=!0,this._streamData("")},this),this._streamCleanUp=D(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function m(p){var b,v,M,P=Math.pow(2,53),E=-P,R=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,F=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,z=this,A=0,j=0,L=!1,ct=!1,tt=[],T={data:[],errors:[],meta:{}};if(w(p.step)){var N=p.step;p.step=function(B){if(T=B,U())W();else{if(W(),T.data.length===0)return;A+=B.data.length,p.preview&&A>p.preview?v.abort():(T.data=T.data[0],N(T,z))}}}function H(B){return p.skipEmptyLines==="greedy"?B.join("").trim()==="":B.length===1&&B[0].length===0}function W(){return T&&M&&(bt("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),M=!1),p.skipEmptyLines&&(T.data=T.data.filter(function(B){return!H(B)})),U()&&function(){if(!T)return;function B(rt,ft){w(p.transformHeader)&&(rt=p.transformHeader(rt,ft)),tt.push(rt)}if(Array.isArray(T.data[0])){for(var q=0;U()&&q=tt.length?"__parsed_extra":tt[Q]),p.transform&&(et=p.transform(et,ht)),et=mt(ht,et),ht==="__parsed_extra"?(xt[ht]=xt[ht]||[],xt[ht].push(et)):xt[ht]=et}return p.header&&(Q>tt.length?bt("FieldMismatch","TooManyFields","Too many fields: expected "+tt.length+" fields but parsed "+Q,j+ft):Q=Dt.length/2?`\r +`:"\r"}(B,ft)),M=!1,p.delimiter)w(p.delimiter)&&(p.delimiter=p.delimiter(B),T.meta.delimiter=p.delimiter);else{var Q=function(ht,et,Et,Dt,zt){var Vt,Ot,at,ut;zt=zt||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var de=0;de=R)return At(!0)}else for(Z=A,A++;;){if((Z=L.indexOf(b,Z+1))===-1)return tt||bt.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:mt.length,index:A}),Qt();if(Z===T-1)return Qt(L.substring(A,Z).replace(de,b));if(b!==z||L[Z+1]!==z){if(b===z||Z===0||L[Z-1]!==z){at!==-1&&at=R)return At(!0);break}bt.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:mt.length,index:A}),Z++}}else Z++}return Qt();function ue(Tt){mt.push(Tt),q=A}function Zt(Tt){var as=0;if(Tt!==-1){var an=L.substring(Z+1,Tt);an&&an.trim()===""&&(as=an.length)}return as}function Qt(Tt){return tt||(Tt===void 0&&(Tt=L.substring(A)),B.push(Tt),A=T,ue(B),U&&bi()),At()}function Jt(Tt){A=Tt,ue(B),B=[],ut=L.indexOf(M,A)}function At(Tt){return{data:mt,errors:bt,meta:{delimiter:v,linebreak:M,aborted:j,truncated:!!Tt,cursor:q+(ct||0)}}}function bi(){E(At()),mt=[],bt=[]}},this.abort=function(){j=!0},this.getCharIndex=function(){return A}}function y(p){var b=p.data,v=r[b.workerId],M=!1;if(b.error)v.userError(b.error,b.file);else if(b.results&&b.results.data){var P={abort:function(){M=!0,C(b.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:S,resume:S};if(w(v.userStep)){for(var E=0;Enew Promise((t,e)=>{const n=new FileReader;n.onload=s=>{const r=s.target.result.split(` +`).slice(3).join(` +`);ia.parse(r,{header:!0,complete:a=>{tn.set(a.data),fi.set(!0),t(a.data)},error:a=>e(a)})},n.onerror=s=>e(s),n.readAsText(i)}),oa=i=>new Promise((t,e)=>{try{if(!i||!i.values||i.values.length<4)throw new Error("Invalid or insufficient data in API response.");const n=i.values[3];if(!n||n.length===0)throw new Error("No headers found in the specified row.");const s=n.map((a,l)=>!a||typeof a!="string"?(console.warn(`Header at index ${l} is invalid:`,a),`column_${l}`):a.trim().toLowerCase().replace(/\s+/g,"_").replace(/[^a-z0-9_]/g,"")),r=i.values.slice(4).filter(a=>a&&a.some(l=>l&&l.trim()!=="")&&a[s.indexOf("date")]&&a[s.indexOf("short_title")]).map(a=>s.reduce((l,c,h)=>(l[c]=a[h]||"",l),{}));tn.set(r),fi.set(!0),console.log("Decision log updated:",r),t(r)}catch(n){console.error("Error loading decision log from API response:",n),e(n)}}),ra=()=>{tn.set([]),fi.set(!1)};/*! + * @kurkle/color v0.3.2 + * https://github.com/kurkle/color#readme + * (c) 2023 Jukka Kurkela + * Released under the MIT License + */function gi(i){return i+.5|0}const ie=(i,t,e)=>Math.max(Math.min(i,e),t);function $e(i){return ie(gi(i*2.55),0,255)}function re(i){return ie(gi(i*255),0,255)}function Ut(i){return ie(gi(i/2.55)/100,0,1)}function us(i){return ie(gi(i*100),0,100)}const Lt={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},Mn=[..."0123456789ABCDEF"],aa=i=>Mn[i&15],la=i=>Mn[(i&240)>>4]+Mn[i&15],_i=i=>(i&240)>>4===(i&15),ca=i=>_i(i.r)&&_i(i.g)&&_i(i.b)&&_i(i.a);function ha(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&Lt[i[1]]*17,g:255&Lt[i[2]]*17,b:255&Lt[i[3]]*17,a:t===5?Lt[i[4]]*17:255}:(t===7||t===9)&&(e={r:Lt[i[1]]<<4|Lt[i[2]],g:Lt[i[3]]<<4|Lt[i[4]],b:Lt[i[5]]<<4|Lt[i[6]],a:t===9?Lt[i[7]]<<4|Lt[i[8]]:255})),e}const da=(i,t)=>i<255?t(i):"";function ua(i){var t=ca(i)?aa:la;return i?"#"+t(i.r)+t(i.g)+t(i.b)+da(i.a,t):void 0}const fa=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function $o(i,t,e){const n=t*Math.min(e,1-e),s=(o,r=(o+i/30)%12)=>e-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function ga(i,t,e){const n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function pa(i,t,e){const n=$o(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function ma(i,t,e,n,s){return i===s?(t-e)/n+(t.5?h/(2-o-r):h/(o+r),l=ma(e,n,s,h,o),l=l*60+.5),[l|0,c||0,a]}function Yn(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(re)}function Un(i,t,e){return Yn($o,i,t,e)}function ba(i,t,e){return Yn(pa,i,t,e)}function _a(i,t,e){return Yn(ga,i,t,e)}function Yo(i){return(i%360+360)%360}function xa(i){const t=fa.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?$e(+t[5]):re(+t[5]));const s=Yo(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=ba(s,o,r):t[1]==="hsv"?n=_a(s,o,r):n=Un(s,o,r),{r:n[0],g:n[1],b:n[2],a:e}}function ya(i,t){var e=$n(i);e[0]=Yo(e[0]+t),e=Un(e),i.r=e[0],i.g=e[1],i.b=e[2]}function va(i){if(!i)return;const t=$n(i),e=t[0],n=us(t[1]),s=us(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${Ut(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const fs={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"},gs={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 ka(){const i={},t=Object.keys(gs),e=Object.keys(fs);let n,s,o,r,a;for(n=0;n>16&255,o>>8&255,o&255]}return i}let xi;function wa(i){xi||(xi=ka(),xi.transparent=[0,0,0,0]);const t=xi[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Ma=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Sa(i){const t=Ma.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const r=+t[7];e=t[8]?$e(r):ie(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?$e(n):ie(n,0,255)),s=255&(t[4]?$e(s):ie(s,0,255)),o=255&(t[6]?$e(o):ie(o,0,255)),{r:n,g:s,b:o,a:e}}}function Ca(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Ut(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const cn=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Ae=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Pa(i,t,e){const n=Ae(Ut(i.r)),s=Ae(Ut(i.g)),o=Ae(Ut(i.b));return{r:re(cn(n+e*(Ae(Ut(t.r))-n))),g:re(cn(s+e*(Ae(Ut(t.g))-s))),b:re(cn(o+e*(Ae(Ut(t.b))-o))),a:i.a+e*(t.a-i.a)}}function yi(i,t,e){if(i){let n=$n(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=Un(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function Uo(i,t){return i&&Object.assign(t||{},i)}function ps(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=re(i[3]))):(t=Uo(i,{r:0,g:0,b:0,a:1}),t.a=re(t.a)),t}function Da(i){return i.charAt(0)==="r"?Sa(i):xa(i)}class ni{constructor(t){if(t instanceof ni)return t;const e=typeof t;let n;e==="object"?n=ps(t):e==="string"&&(n=ha(t)||wa(t)||Da(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Uo(this._rgb);return t&&(t.a=Ut(t.a)),t}set rgb(t){this._rgb=ps(t)}rgbString(){return this._valid?Ca(this._rgb):void 0}hexString(){return this._valid?ua(this._rgb):void 0}hslString(){return this._valid?va(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=r*n.a+(1-r)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=Pa(this._rgb,t._rgb,e)),this}clone(){return new ni(this.rgb)}alpha(t){return this._rgb.a=re(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=gi(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 yi(this._rgb,2,t),this}darken(t){return yi(this._rgb,2,-t),this}saturate(t){return yi(this._rgb,1,t),this}desaturate(t){return yi(this._rgb,1,-t),this}rotate(t){return ya(this._rgb,t),this}}/*! + * Chart.js v4.4.5 + * https://www.chartjs.org + * (c) 2024 Chart.js Contributors + * Released under the MIT License + */function jt(){}const Oa=(()=>{let i=0;return()=>i++})();function X(i){return i===null||typeof i>"u"}function st(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Y(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function lt(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function St(i,t){return lt(i)?i:t}function V(i,t){return typeof i>"u"?t:i}const Aa=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Xo=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function J(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function G(i,t,e,n){let s,o,r;if(st(i))for(o=i.length,s=0;si,x:i=>i.x,y:i=>i.y};function Ea(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function Ra(i){const t=Ea(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function ae(i,t){return(ms[t]||(ms[t]=Ra(t)))(i)}function Xn(i){return i.charAt(0).toUpperCase()+i.slice(1)}const oi=i=>typeof i<"u",le=i=>typeof i=="function",bs=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Ia(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const nt=Math.PI,it=2*nt,Fa=it+nt,$i=Number.POSITIVE_INFINITY,za=nt/180,dt=nt/2,fe=nt/4,_s=nt*2/3,ne=Math.log10,Wt=Math.sign;function Qe(i,t,e){return Math.abs(i-t)s-o).pop(),t}function Fe(i){return!isNaN(parseFloat(i))&&isFinite(i)}function Na(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Ko(i,t,e){let n,s,o;for(n=0,s=i.length;nl&&c=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function Kn(i,t,e){e=e||(r=>i[r]1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const qt=(i,t,e,n)=>Kn(i,e,n?s=>{const o=i[s][t];return oi[s][t]Kn(i,e,n=>i[n][t]>=e);function ja(i,t,e){let n=0,s=i.length;for(;nn&&i[s-1]>e;)s--;return n>0||s{const n="_onData"+Xn(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...o)}),r}})})}function vs(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(Zo.forEach(o=>{delete i[o]}),delete i._chartjs)}function Qo(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Jo=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function tr(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,Jo.call(window,()=>{n=!1,i.apply(t,e)}))}}function Ya(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const Gn=i=>i==="start"?"left":i==="end"?"right":"center",yt=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Ua=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function er(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:r,_parsed:a}=i,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(s=_t(Math.min(qt(a,l,c).lo,e?n:qt(t,l,r.getPixelForValue(c)).lo),0,n-1)),u?o=_t(Math.max(qt(a,r.axis,h,!0).hi+1,e?0:qt(t,l,r.getPixelForValue(h),!0).hi+1),s,n)-s:o=n-s}return{start:s,count:o}}function ir(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const vi=i=>i===0||i===1,ks=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*it/e)),ws=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*it/e)+1,Je={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*dt)+1,easeOutSine:i=>Math.sin(i*dt),easeInOutSine:i=>-.5*(Math.cos(nt*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>vi(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>vi(i)?i:ks(i,.075,.3),easeOutElastic:i=>vi(i)?i:ws(i,.075,.3),easeInOutElastic(i){return vi(i)?i:i<.5?.5*ks(i*2,.1125,.45):.5+.5*ws(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Je.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Je.easeInBounce(i*2)*.5:Je.easeOutBounce(i*2-1)*.5+.5};function Zn(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ms(i){return Zn(i)?i:new ni(i)}function hn(i){return Zn(i)?i:new ni(i).saturate(.5).darken(.1).hexString()}const Xa=["x","y","borderWidth","radius","tension"],qa=["color","borderColor","backgroundColor"];function Ka(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:qa},numbers:{type:"number",properties:Xa}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Ga(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ss=new Map;function Za(i,t){t=t||{};const e=i+JSON.stringify(t);let n=Ss.get(e);return n||(n=new Intl.NumberFormat(i,t),Ss.set(e,n)),n}function pi(i,t,e){return Za(t,e).format(i)}const nr={values(i){return st(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Qa(i,e)}const r=ne(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),pi(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(ne(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?nr.numeric.call(this,i,t,e):""}};function Qa(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var en={formatters:nr};function Ja(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:en.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Me=Object.create(null),Cn=Object.create(null);function ti(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;nn.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=(n,s)=>hn(s.backgroundColor),this.hoverBorderColor=(n,s)=>hn(s.borderColor),this.hoverColor=(n,s)=>hn(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return dn(this,t,e)}get(t){return ti(this,t)}describe(t,e){return dn(Cn,t,e)}override(t,e){return dn(Me,t,e)}route(t,e,n,s){const o=ti(this,t),r=ti(this,n),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[s];return Y(l)?Object.assign({},c,l):V(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var ot=new tl({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ka,Ga,Ja]);function el(i){return!i||X(i.size)||X(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Yi(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function il(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let r=0;const a=e.length;let l,c,h,d,u;for(l=0;le.length){for(l=0;l0&&i.stroke()}}function Kt(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,ol(i,o),l=0;l+i||0;function Qn(i,t){const e={},n=Y(t),s=n?Object.keys(t):t,o=Y(i)?n?r=>V(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of s)e[r]=dl(o(r));return e}function or(i){return Qn(i,{top:"y",right:"x",bottom:"y",left:"x"})}function ke(i){return Qn(i,["topLeft","topRight","bottomLeft","bottomRight"])}function kt(i){const t=or(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function pt(i,t){i=i||{},t=t||ot.font;let e=V(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=V(i.style,t.style);n&&!(""+n).match(cl)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:V(i.family,t.family),lineHeight:hl(V(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:V(i.weight,t.weight),string:""};return s.string=el(s),s}function Ye(i,t,e,n){let s,o,r;for(s=0,o=i.length;se&&a===0?0:a+l;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function he(i,t){return Object.assign(Object.create(i),t)}function Jn(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=cr("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:a=>Jn([a,...i],t,o,n)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return ar(a,l,()=>yl(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Ds(a).includes(l)},ownKeys(a){return Ds(a)},set(a,l,c){const h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function ze(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:rr(i,n),setContext:o=>ze(i,o,e,n),override:o=>ze(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return ar(o,r,()=>gl(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function rr(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:le(e)?e:()=>e,isIndexable:le(n)?n:()=>n}}const fl=(i,t)=>i?i+Xn(t):t,ts=(i,t)=>Y(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function ar(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const n=e();return i[t]=n,n}function gl(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=i;let a=n[t];return le(a)&&r.isScriptable(t)&&(a=pl(t,a,i,e)),st(a)&&a.length&&(a=ml(t,a,i,r.isIndexable)),ts(t,a)&&(a=ze(a,s,o&&o[t],r)),a}function pl(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||n);return a.delete(i),ts(i,l)&&(l=es(s._scopes,s,i,l)),l}function ml(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(Y(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=es(c,s,i,h);t.push(ze(d,o,r&&r[i],a))}}return t}function lr(i,t,e){return le(i)?i(t,e):i}const bl=(i,t)=>i===!0?t:typeof i=="string"?ae(t,i):void 0;function _l(i,t,e,n,s){for(const o of t){const r=bl(e,o);if(r){i.add(r);const a=lr(r._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==n)return a}else if(r===!1&&typeof n<"u"&&e!==n)return null}return!1}function es(i,t,e,n){const s=t._rootScopes,o=lr(t._fallback,e,n),r=[...i,...s],a=new Set;a.add(n);let l=Ps(a,r,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=Ps(a,r,o,l,n),l===null)?!1:Jn(Array.from(a),[""],s,o,()=>xl(t,e,n))}function Ps(i,t,e,n,s){for(;e;)e=_l(i,t,e,n,s);return e}function xl(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return st(s)&&Y(e)?e:s||{}}function yl(i,t,e,n){let s;for(const o of t)if(s=cr(fl(o,i),e),typeof s<"u")return ts(i,s)?es(e,n,i,s):s}function cr(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function Ds(i){let t=i._keys;return t||(t=i._keys=vl(i._scopes)),t}function vl(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function hr(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;ati==="x"?"y":"x";function wl(i,t,e,n){const s=i.skip?t:i,o=t,r=e.skip?t:e,a=Sn(o,s),l=Sn(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Ml(i,t,e){const n=i.length;let s,o,r,a,l,c=Be(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")Cl(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,r=i.length;oi.ownerDocument.defaultView.getComputedStyle(i,null);function Ol(i,t){return on(i).getPropertyValue(t)}const Al=["top","right","bottom","left"];function we(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Al[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Tl=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Ll(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let r=!1,a,l;if(Tl(s,o,i.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function be(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=on(e),o=s.boxSizing==="border-box",r=we(s,"padding"),a=we(s,"border","width"),{x:l,y:c,box:h}=Ll(i,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/f*e.width/n),y:Math.round((c-u)/g*e.height/n)}}function El(i,t,e){let n,s;if(t===void 0||e===void 0){const o=i&&ns(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=on(o),l=we(a,"border","width"),c=we(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,n=Ui(a.maxWidth,o,"clientWidth"),s=Ui(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||$i,maxHeight:s||$i}}const wi=i=>Math.round(i*10)/10;function Rl(i,t,e,n){const s=on(i),o=we(s,"margin"),r=Ui(s.maxWidth,i,"clientWidth")||$i,a=Ui(s.maxHeight,i,"clientHeight")||$i,l=El(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const u=we(s,"border","width"),f=we(s,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=wi(Math.min(c,r,l.maxWidth)),h=wi(Math.min(h,a,l.maxHeight)),c&&!h&&(h=wi(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=wi(Math.floor(h*n))),{width:c,height:h}}function Os(i,t,e){const n=t||1,s=Math.floor(i.height*n),o=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||r.height!==s||r.width!==o?(i.currentDevicePixelRatio=n,r.height=s,r.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const Il=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};is()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function As(i,t){const e=Ol(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function _e(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Fl(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function zl(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=_e(i,s,e),a=_e(s,o,e),l=_e(o,t,e),c=_e(r,a,e),h=_e(a,l,e);return _e(c,h,e)}const Bl=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},Nl=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Re(i,t,e){return i?Bl(t,e):Nl()}function ur(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function fr(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function gr(i){return i==="angle"?{between:ri,compare:Wa,normalize:Ct}:{between:Xt,compare:(t,e)=>t-e,normalize:t=>t}}function Ts({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function Wl(i,t,e){const{property:n,start:s,end:o}=e,{between:r,normalize:a}=gr(n),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;ul(s,C,x)&&a(s,C)!==0,k=()=>a(o,x)===0||l(o,C,x),D=()=>m||S(),w=()=>!m||k();for(let p=h,b=h;p<=d;++p)y=t[p%r],!y.skip&&(x=c(y[n]),x!==C&&(m=l(x,s,o),_===null&&D()&&(_=a(x,s)===0?p:b),_!==null&&w()&&(g.push(Ts({start:_,end:p,loop:u,count:r,style:f})),_=null),b=p,C=x));return _!==null&&g.push(Ts({start:_,end:d,loop:u,count:r,style:f})),g}function mr(i,t){const e=[],n=i.segments;for(let s=0;ss&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Hl(i,t,e,n){const s=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?a.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:n}),o}function jl(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:r,end:a}=Vl(e,s,o,n);if(n===!0)return Ls(i,[{start:r,end:a,loop:o}],e,t);const l=aa({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(n-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Jo.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}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((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var $t=new Ul;const Rs="transparent",Xl={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=Ms(i||Rs),s=n.valid&&Ms(t||Rs);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class ql{constructor(t,e,n,s){const o=e[n];s=Ye([t.to,s,o,t.from]);const r=Ye([t.from,o,s]);this._active=!0,this._fn=t.fn||Xl[t.type||typeof r],this._easing=Je[t.easing]||Je.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=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Ye([t.to,e,s,t.from]),this._from=Ye([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s{const o=t[s];if(!Y(o))return;const r={};for(const a of e)r[a]=o[a];(st(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,e){const n=e.options,s=Gl(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&Kl(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=n.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new ql(u,t,c,h),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return $t.add(this._chart,n),!0}}function Kl(i,t){const e=[],n=Object.keys(t);for(let s=0;s0||!e&&o<0)return s.index}return null}function Bs(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=tc(o,r,n),d=t.length;let u;for(let f=0;fe[n].axis===t).shift()}function nc(i,t){return he(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function sc(i,t,e){return he(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ne(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const gn=i=>i==="reset"||i==="none",Ns=(i,t)=>t?i:Object.assign({},i),oc=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:_r(e,!0),values:null};class It{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=un(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&&Ne(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(d,u,f,g)=>d==="x"?u:d==="r"?g:f,o=e.xAxisID=V(n.xAxisID,fn(t,"x")),r=e.yAxisID=V(n.yAxisID,fn(t,"y")),a=e.rAxisID=V(n.rAxisID,fn(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,r,a),h=e.vAxisID=s(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&vs(this._data,this),t._stacked&&Ne(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(Y(e)){const s=this._cachedMeta;this._data=Jl(e,s)}else if(n!==e){if(n){vs(n,this);const s=this._cachedMeta;Ne(s),s._parsed=[]}e&&Object.isExtensible(e)&&$a(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,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=un(e.vScale,e),e.stack!==n.stack&&(s=!0,Ne(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&(Bs(this,e._parsed),e._stacked=un(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:r}=n,a=o.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,d,u;if(this._parsing===!1)n._parsed=s,n._sorted=!0,u=s;else{st(s[t])?u=this.parseArrayData(n,s,t,e):Y(s[t])?u=this.parseObjectData(n,s,t,e):u=this.parsePrimitiveData(n,s,t,e);const f=()=>d[a]===null||c&&d[a]m||d=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,r;for(s=0,o=e.length;s=0&&tthis.getContext(n,s,e),m=c.resolveNamedOptions(u,f,g,d);return m.$shared&&(m.$shared=l,o[r]=Object.freeze(Ns(m,l))),m}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,n,e))}const c=new br(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||gn(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:r}}updateElement(t,e,n,s){gn(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!gn(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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,n=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=n.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;as-o))}return i._cache.$bar}function ac(i){const t=i.iScale,e=rc(t,i.type);let n=t._length,s,o,r,a;const l=()=>{r===32767||r===-32768||(oi(a)&&(n=Math.min(n,Math.abs(r-a)||n)),a=r)};for(s=0,o=e.length;s0?s[i-1]:null,a=iMath.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function xr(i,t,e,n){return st(i)?hc(i,t,e,n):t[e.axis]=e.parse(i,n),t}function Ws(i,t,e,n){const s=i.iScale,o=i.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,d,u;for(c=e,h=e+n;c=e?1:-1)}function uc(i){let t,e,n,s,o;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.baseh.controller.options.grouped),o=n.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[n.axis],c=h=>{const d=h._parsed.find(f=>f[n.axis]===l),u=d&&d[h.vScale.axis];if(X(u)||isNaN(u))return!0};for(const h of s)if(!(e!==void 0&&c(h))&&((o===!1||r.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&r.push(h.stack),h.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const s=this._getStacks(t,n),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let o,r;for(o=0,r=e.data.length;o=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:n[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=r.axis,d=a.axis;for(let u=e;uri(C,a,l,!0)?1:Math.max(S,S*e,k,k*e),g=(C,S,k)=>ri(C,a,l,!0)?-1:Math.min(S,S*e,k,k*e),m=f(0,c,d),_=f(dt,h,u),x=g(nt,c,d),y=g(nt+dt,h,u);n=(m-x)/2,s=(_-y)/2,o=-(m+x)/2,r=-(_+y)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}class ve extends It{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 n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(Y(n[t])){const{key:l="value"}=this._parsing;o=c=>+ae(n[c],l)}let r,a;for(r=t,a=t+e;r0&&!isNaN(t)?it*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=pi(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=n.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),O(ve,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}});class Ii extends It{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=er(e,s,r);this._drawStart=a,this._drawCount=l,ir(e)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s),u=r.axis,f=a.axis,{spanGaps:g,segment:m}=this.options,_=Fe(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none",y=e+n,C=t.length;let S=e>0&&this.getParsed(e-1);for(let k=0;k=y){w.skip=!0;continue}const p=this.getParsed(k),b=X(p[f]),v=w[u]=r.getPixelForValue(p[u],k),M=w[f]=o||b?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,p,l):p[f],k);w.skip=isNaN(v)||isNaN(M)||b,w.stop=k>0&&Math.abs(p[u]-S[u])>_,m&&(w.parsed=p,w.raw=c.data[k]),d&&(w.options=h||this.resolveDataElementOptions(k,D.active?"active":s)),x||this.updateElement(D,k,w,s),S=p}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}O(Ii,"id","line"),O(Ii,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),O(Ii,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ei extends It{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=pi(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return hr.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(oe.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,n,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*nt;let f=u,g;const m=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?Rt(this.resolveDataElementOptions(t,e).angle||n):0}}O(ei,"id","polarArea"),O(ei,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),O(ei,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Dn extends ve{}O(Dn,"id","pie"),O(Dn,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Fi extends It{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return hr.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(n.points=s,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(n,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const o=this._cachedMeta.rScale,r=s==="reset";for(let a=e;a0&&this.getParsed(e-1);for(let S=e;S0&&Math.abs(D[f]-C[f])>x,_&&(w.parsed=D,w.raw=c.data[S]),u&&(w.options=d||this.resolveDataElementOptions(S,k.active?"active":s)),y||this.updateElement(k,S,w,s),C=D}this.updateSharedOptions(d,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,r)/2}}O(zi,"id","scatter"),O(zi,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),O(zi,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var bc=Object.freeze({__proto__:null,BarController:Ei,BubbleController:Ri,DoughnutController:ve,LineController:Ii,PieController:Dn,PolarAreaController:ei,RadarController:Fi,ScatterController:zi});function pe(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ss{constructor(t){O(this,"options");this.options=t||{}}static override(t){Object.assign(ss.prototype,t)}init(){}formats(){return pe()}parse(){return pe()}format(){return pe()}add(){return pe()}diff(){return pe()}startOf(){return pe()}endOf(){return pe()}}var _c={_date:ss};function xc(i,t,e,n){const{controller:s,data:o,_sorted:r}=i,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Ha:qt;if(n){if(s._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,e-h),u=l(o,t,e+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function mi(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a{l[r]&&l[r](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:o}var wc={evaluateInteractionItems:mi,modes:{index(i,t,e,n){const s=be(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?mn(i,s,o,n,r):bn(i,s,o,!1,n,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=be(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?mn(i,s,o,n,r):bn(i,s,o,!1,n,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function $s(i,t){return i.filter(e=>yr.indexOf(e.pos)===-1&&e.box.axis===t)}function Ve(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Mc(i){const t=[];let e,n,s,o,r,a;for(e=0,n=(i||[]).length;ec.box.fullSize),!0),n=Ve(We(t,"left"),!0),s=Ve(We(t,"right")),o=Ve(We(t,"top"),!0),r=Ve(We(t,"bottom")),a=$s(t,"x"),l=$s(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:We(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Ys(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function vr(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Dc(i,t,e,n){const{pos:s,box:o}=e,r=i.maxPadding;if(!Y(s)){e.size&&(i[s]-=e.size);const d=n[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[s]+=e.size}o.getPadding&&vr(r,o.getPadding());const a=Math.max(0,t.outerWidth-Ys(r,i,"left","right")),l=Math.max(0,t.outerHeight-Ys(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Oc(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Ac(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return n(i?["left","right"]:["top","bottom"])}function Ue(i,t,e,n){const s=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=l.reduce((m,_)=>_.box.options&&_.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);vr(u,kt(n));const f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),g=Cc(l.concat(c),d);Ue(a.fullSize,f,d,g),Ue(l,f,d,g),Ue(c,f,d,g)&&Ue(l,f,d,g),Oc(f),Us(a.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,Us(a.rightAndBottom,f,d,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},G(a.chartArea,m=>{const _=m.box;Object.assign(_,i.chartArea),_.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class kr{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Tc extends kr{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Bi="$chartjs",Lc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Xs=i=>i===null||i==="";function Ec(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[Bi]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Xs(s)){const o=As(i,"width");o!==void 0&&(i.width=o)}if(Xs(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=As(i,"height");o!==void 0&&(i.height=o)}return i}const wr=Il?{passive:!0}:!1;function Rc(i,t,e){i&&i.addEventListener(t,e,wr)}function Ic(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,wr)}function Fc(i,t){const e=Lc[i.type]||i.type,{x:n,y:s}=be(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function Xi(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function zc(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Xi(a.addedNodes,n),r=r&&!Xi(a.removedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Bc(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Xi(a.removedNodes,n),r=r&&!Xi(a.addedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const li=new Map;let qs=0;function Mr(){const i=window.devicePixelRatio;i!==qs&&(qs=i,li.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Nc(i,t){li.size||window.addEventListener("resize",Mr),li.set(i,t)}function Wc(i){li.delete(i),li.size||window.removeEventListener("resize",Mr)}function Vc(i,t,e){const n=i.canvas,s=n&&ns(n);if(!s)return;const o=tr((a,l)=>{const c=s.clientWidth;e(a,l),c{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(s),Nc(i,o),r}function _n(i,t,e){e&&e.disconnect(),t==="resize"&&Wc(i)}function Hc(i,t,e){const n=i.canvas,s=tr(o=>{i.ctx!==null&&e(Fc(o,i))},i);return Rc(n,t,s),s}class jc extends kr{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Ec(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[Bi])return!1;const n=e[Bi].initial;["height","width"].forEach(o=>{const r=n[o];X(r)?e.removeAttribute(o):e.setAttribute(o,r)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[Bi],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:zc,detach:Bc,resize:Vc}[e]||Hc;s[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:_n,detach:_n,resize:_n}[e]||Ic)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return Rl(t,e,n,s)}isAttached(t){const e=t&&ns(t);return!!(e&&e.isConnected)}}function $c(i){return!is()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Tc:jc}class Ft{constructor(){O(this,"x");O(this,"y");O(this,"active",!1);O(this,"options");O(this,"$animations")}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Fe(this.x)&&Fe(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}O(Ft,"defaults",{}),O(Ft,"defaultRoutes");function Yc(i,t){const e=i.options.ticks,n=Uc(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?qc(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return Kc(t,c,o,r/s),c;const h=Xc(o,t,s);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(Si(t,c,h,X(f)?0:a-f,a),d=0,u=r-1;ds)return l}return Math.max(s,1)}function qc(i){const t=[];let e,n;for(e=0,n=i.length;ei==="left"?"right":i==="right"?"left":i,Ks=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Gs=(i,t)=>Math.min(t||i,i);function Zs(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;or+a)))return l}function Jc(i,t){G(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;on?n:e,n=s&&e>n?e:n,{min:St(e,St(n,e)),max:St(n,St(e,n))}}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(){J(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=ul(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=_t(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/n:f/(n-1),d+6>a&&(a=f/(n-(t.offset?.5:1)),l=this.maxHeight-He(t.grid)-e.padding-Qs(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=qn(Math.min(Math.asin(_t((h.highest.height+6)/a,-1,1)),Math.asin(_t(l/c,-1,1))-Math.asin(_t(u/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){J(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){J(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Qs(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=He(o)+l):(t.height=this.maxHeight,t.width=He(o)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=n.padding*2,g=Rt(this.labelRotation),m=Math.cos(g),_=Math.sin(g);if(a){const x=n.mirror?0:_*d.width+m*u.height;t.height=Math.min(this.maxHeight,t.height+x+f)}else{const x=n.mirror?0:m*d.width+_*u.height;t.width=Math.min(this.maxWidth,t.width+x+f)}this._calculatePadding(c,h,_,m)}}this._handleMargins(),a?(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,n,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=s*t.width,f=n*e.height):(u=n*t.height,f=s*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_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(){J(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,n;for(e=0,n=t.length;e({width:r[b]||0,height:a[b]||0});return{first:p(0),last:p(e-1),widest:p(D),highest:p(w),widths:r,heights:a}}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 Va(this._alignToPixels?ge(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&&ta*s?a/n:l/s:l*s0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=He(o),f=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,_=m/2,x=function(z){return ge(n,z,m)};let y,C,S,k,D,w,p,b,v,M,P,E;if(r==="top")y=x(this.bottom),w=this.bottom-u,b=y-_,M=x(t.top)+_,E=t.bottom;else if(r==="bottom")y=x(this.top),M=t.top,E=x(t.bottom)-_,w=y+_,b=this.top+u;else if(r==="left")y=x(this.right),D=this.right-u,p=y-_,v=x(t.left)+_,P=t.right;else if(r==="right")y=x(this.left),v=t.left,P=x(t.right)-_,D=y+_,p=this.left+u;else if(e==="x"){if(r==="center")y=x((t.top+t.bottom)/2+.5);else if(Y(r)){const z=Object.keys(r)[0],A=r[z];y=x(this.chart.scales[z].getPixelForValue(A))}M=t.top,E=t.bottom,w=y+_,b=w+u}else if(e==="y"){if(r==="center")y=x((t.left+t.right)/2);else if(Y(r)){const z=Object.keys(r)[0],A=r[z];y=x(this.chart.scales[z].getPixelForValue(A))}D=y-_,p=D-u,v=t.left,P=t.right}const R=V(s.ticks.maxTicksLimit,d),F=Math.max(1,Math.ceil(d/R));for(C=0;C0&&(U-=H/2);break}tt={left:U,top:W,width:H+T.width,height:N+T.height,color:F.backdropColor}}_.push({label:S,font:b,textOffset:P,options:{rotation:m,color:A,strokeColor:j,strokeWidth:L,textAlign:ct,textBaseline:E,translation:[k,D],backdrop:tt}})}return _}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Rt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,r=s.length;o{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,r;for(o=0,r=e.length;o{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");ot.route(o,s,l,a)})}function rh(i){return"id"in i&&"defaults"in i}class ah{constructor(){this.controllers=new Ci(It,"datasets",!0),this.elements=new Ci(Ft,"elements"),this.plugins=new Ci(Object,"plugins"),this.scales=new Ci(Ce,"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,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):G(s,r=>{const a=n||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,n){const s=Xn(t);J(n["before"+s],[],n),e[t](n),J(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;eo.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function ch(i){const t={},e=[],n=Object.keys(Nt.plugins.items);for(let o=0;o1&&Js(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function to(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function mh(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return to(i,"x",e[0])||to(i,"y",e[0])}return{}}function bh(i,t){const e=Me[i.type]||{scales:{}},n=t.scales||{},s=On(i.type,t),o=Object.create(null);return Object.keys(n).forEach(r=>{const a=n[r];if(!Y(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=An(r,a,mh(r,i),ot.scales[a.type]),c=gh(l,s),h=e.scales||{};o[r]=Ze(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||On(a,t),h=(Me[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=fh(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),Ze(o[f],[{axis:u},n[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Ze(a,[ot.scales[a.type],ot.scale])}),o}function Sr(i){const t=i.options||(i.options={});t.plugins=V(t.plugins,{}),t.scales=bh(i,t)}function Cr(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function _h(i){return i=i||{},i.data=Cr(i.data),Sr(i),i}const eo=new Map,Pr=new Set;function Pi(i,t){let e=eo.get(i);return e||(e=t(),eo.set(i,e),Pr.add(e)),e}const je=(i,t,e)=>{const n=ae(t,e);n!==void 0&&i.add(n)};class xh{constructor(t){this._config=_h(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=Cr(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(),Sr(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Pi(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Pi(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Pi(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return Pi(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,r=this._cachedScopes(t,n),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>je(l,t,d))),h.forEach(d=>je(l,s,d)),h.forEach(d=>je(l,Me[o]||{},d)),h.forEach(d=>je(l,ot,d)),h.forEach(d=>je(l,Cn,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Pr.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Me[e]||{},ot.datasets[e]||{},{type:e},ot,Cn]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=io(this._resolverCache,t,s);let l=r;if(vh(r,e)){o.$shared=!1,n=le(n)?n():n;const c=this.createResolver(t,n,a);l=ze(r,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=io(this._resolverCache,t,n);return Y(e)?ze(o,e,void 0,s):o}}function io(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:Jn(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}const yh=i=>Y(i)&&Object.getOwnPropertyNames(i).some(t=>le(i[t]));function vh(i,t){const{isScriptable:e,isIndexable:n}=rr(i);for(const s of t){const o=e(s),r=n(s),a=(r||o)&&i[s];if(o&&(le(a)||yh(a))||r&&st(a))return!0}return!1}var kh="4.4.5";const wh=["top","bottom","left","right","chartArea"];function no(i,t){return i==="top"||i==="bottom"||wh.indexOf(i)===-1&&t==="x"}function so(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function oo(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),J(e&&e.onComplete,[i],t)}function Mh(i){const t=i.chart,e=t.options.animation;J(e&&e.onProgress,[i],t)}function Dr(i){return is()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ni={},ro=i=>{const t=Dr(i);return Object.values(Ni).filter(e=>e.canvas===t).pop()};function Sh(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const r=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=r)}}}function Ch(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}function Di(i,t,e){return i.options.clip?i[e]:t[e]}function Ph(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:Di(e,t,"left"),right:Di(e,t,"right"),top:Di(n,t,"top"),bottom:Di(n,t,"bottom")}:t}class te{static register(...t){Nt.add(...t),ao()}static unregister(...t){Nt.remove(...t),ao()}constructor(t,e){const n=this.config=new xh(e),s=Dr(t),o=ro(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||$c(s)),this.platform.updateConfig(n);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Oa(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,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 lh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Ya(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Ni[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}$t.listen(this,"complete",oo),$t.listen(this,"progress",Mh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return X(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Nt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Os(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Cs(this.canvas,this.ctx),this}stop(){return $t.stop(this),this}resize(t,e){$t.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Os(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),J(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};G(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=An(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),G(o,r=>{const a=r.options,l=a.id,c=An(l,a),h=V(a.type,r.dtype);(a.position===void 0||no(a.position,c)!==no(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;if(l in n&&n[l].type===h)d=n[l];else{const u=Nt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(a,t)}),G(s,(r,a)=>{r||delete n[a]}),G(n,r=>{vt.configure(this,r,r.options),vt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;se.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(so("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){G(this.scales,t=>{vt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!bs(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const r=n==="_removeElements"?-o:o;Sh(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=n(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;vt.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],G(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,s=!n.disabled,o=Ph(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&nn(e,{left:n.left===!1?0:o.left-n.left,right:n.right===!1?this.width:o.right+n.right,top:n.top===!1?0:o.top-n.top,bottom:n.bottom===!1?this.height:o.bottom+n.bottom}),t.controller.draw(),s&&sn(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Kt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=wc.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=he(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);oi(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),$t.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};G(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){G(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},G(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Hi(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=n?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,n,r),l=Ia(t),c=Ch(t,this._lastEvent,n,l);n&&(this._lastEvent=null,J(o.onHover,[t,a,this],this),l&&J(o.onClick,[t,a,this],this));const h=!Hi(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}O(te,"defaults",ot),O(te,"instances",Ni),O(te,"overrides",Me),O(te,"registry",Nt),O(te,"version",kh),O(te,"getChart",ro);function ao(){return G(te.instances,i=>i._plugins.invalidate())}function Dh(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;i.beginPath(),i.arc(o,r,a,n-c,e+c),l>s?(c=s/l,i.arc(o,r,l,e+c,n-c,!0)):i.arc(o,r,s,e+dt,n-dt),i.closePath(),i.clip()}function Oh(i){return Qn(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Ah(i,t,e,n){const s=Oh(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,n*t/2),a=l=>{const c=(e-Math.min(o,l))*n/2;return _t(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:_t(s.innerStart,0,r),innerEnd:_t(s.innerEnd,0,r)}}function Te(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function qi(i,t,e,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+n+e-c,0),u=h>0?h+n+e+c:0;let f=0;const g=s-l;if(n){const F=h>0?h-n:0,z=d>0?d-n:0,A=(F+z)/2,j=A!==0?g*A/(A+n):g;f=(g-j)/2}const m=Math.max(.001,g*d-e/nt)/d,_=(g-m)/2,x=l+_+f,y=s-_-f,{outerStart:C,outerEnd:S,innerStart:k,innerEnd:D}=Ah(t,u,d,y-x),w=d-C,p=d-S,b=x+C/w,v=y-S/p,M=u+k,P=u+D,E=x+k/M,R=y-D/P;if(i.beginPath(),o){const F=(b+v)/2;if(i.arc(r,a,d,b,F),i.arc(r,a,d,F,v),S>0){const L=Te(p,v,r,a);i.arc(L.x,L.y,S,v,y+dt)}const z=Te(P,y,r,a);if(i.lineTo(z.x,z.y),D>0){const L=Te(P,R,r,a);i.arc(L.x,L.y,D,y+dt,R+Math.PI)}const A=(y-D/u+(x+k/u))/2;if(i.arc(r,a,u,y-D/u,A,!0),i.arc(r,a,u,A,x+k/u,!0),k>0){const L=Te(M,E,r,a);i.arc(L.x,L.y,k,E+Math.PI,x-dt)}const j=Te(w,x,r,a);if(i.lineTo(j.x,j.y),C>0){const L=Te(w,b,r,a);i.arc(L.x,L.y,C,x-dt,b)}}else{i.moveTo(r,a);const F=Math.cos(b)*d+r,z=Math.sin(b)*d+a;i.lineTo(F,z);const A=Math.cos(v)*d+r,j=Math.sin(v)*d+a;i.lineTo(A,j)}i.closePath()}function Th(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){qi(i,t,e,n,l,s);for(let c=0;c=it||m,x=Xt(a,h+f,d+f);return _&&x}getCenterPoint(e){const{x:n,y:s,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,d=(o+r)/2,u=(a+l+h+c)/2;return{x:n+Math.cos(d)*u,y:s+Math.sin(d)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:s}=this,o=(n.offset||0)/4,r=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>it?Math.floor(s/it):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(nt,s||0)),h=o*c;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,Th(e,this,h,r,a),Lh(e,this,h,r,a),e.restore()}}O(Xe,"id","arc"),O(Xe,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),O(Xe,"defaultRoutes",{backgroundColor:"backgroundColor"}),O(Xe,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Or(i,t,e=t){i.lineCap=V(e.borderCapStyle,t.borderCapStyle),i.setLineDash(V(e.borderDash,t.borderDash)),i.lineDashOffset=V(e.borderDashOffset,t.borderDashOffset),i.lineJoin=V(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=V(e.borderWidth,t.borderWidth),i.strokeStyle=V(e.borderColor,t.borderColor)}function Eh(i,t,e){i.lineTo(e.x,e.y)}function Rh(i){return i.stepped?nl:i.tension||i.cubicInterpolationMode==="monotone"?sl:Eh}function Ar(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),h=sa&&o>a;return{count:n,start:l,loop:t.loop,ilen:c(r+(c?a-S:S))%o,C=()=>{m!==_&&(i.lineTo(h,_),i.lineTo(h,m),i.lineTo(h,x))};for(l&&(f=s[y(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=s[y(u)],f.skip)continue;const S=f.x,k=f.y,D=S|0;D===g?(k_&&(_=k),h=(d*h+S)/++d):(C(),i.lineTo(S,k),g=D,d=0,m=_=k),x=k}C()}function Tn(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Fh:Ih}function zh(i){return i.stepped?Fl:i.tension||i.cubicInterpolationMode==="monotone"?zl:_e}function Bh(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),Or(i,t.options),i.stroke(s)}function Nh(i,t,e,n){const{segments:s,options:o}=t,r=Tn(t);for(const a of s)Or(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const Wh=typeof Path2D=="function";function Vh(i,t,e,n){Wh&&!t.options.segment?Bh(i,t,e,n):Nh(i,t,e,n)}class se extends Ft{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 n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;Dl(this._points,n,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=jl(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,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,r=mr(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],l=zh(n);let c,h;for(c=0,h=r.length;ct!=="borderDash"&&t!=="fill"});function lo(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)i.replace("rgb(","rgba(").replace(")",", 0.5)"));function Lr(i){return Ln[i%Ln.length]}function Er(i){return co[i%co.length]}function qh(i,t){return i.borderColor=Lr(t),i.backgroundColor=Er(t),++t}function Kh(i,t){return i.backgroundColor=i.data.map(()=>Lr(t++)),t}function Gh(i,t){return i.backgroundColor=i.data.map(()=>Er(t++)),t}function Zh(i){let t=0;return(e,n)=>{const s=i.getDatasetMeta(n).controller;s instanceof ve?t=Kh(e,t):s instanceof ei?t=Gh(e,t):s&&(t=qh(e,t))}}function ho(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function Qh(i){return i&&(i.borderColor||i.backgroundColor)}function Jh(){return ot.borderColor!=="rgba(0,0,0,0.1)"||ot.backgroundColor!=="rgba(0,0,0,0.1)"}var td={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;const{data:{datasets:n},options:s}=i.config,{elements:o}=s,r=ho(n)||Qh(s)||o&&ho(o)||Jh();if(!e.forceOverride&&r)return;const a=Zh(i);n.forEach(a)}};function ed(i,t,e,n,s){const o=s.samples||n;if(o>=e)return i.slice(t,t+e);const r=[],a=(e-2)/(o-2);let l=0;const c=t+e-1;let h=t,d,u,f,g,m;for(r[l++]=i[h],d=0;df&&(f=g,u=i[y],m=y);r[l++]=u,h=m}return r[l++]=i[c],r}function id(i,t,e,n){let s=0,o=0,r,a,l,c,h,d,u,f,g,m;const _=[],x=t+e-1,y=i[t].x,S=i[x].x-y;for(r=t;rm&&(m=c,u=r),s=(o*s+a.x)/++o;else{const D=r-1;if(!X(d)&&!X(u)){const w=Math.min(d,u),p=Math.max(d,u);w!==f&&w!==D&&_.push({...i[w],x:s}),p!==f&&p!==D&&_.push({...i[p],x:s})}r>0&&D!==f&&_.push(i[D]),_.push(a),h=k,o=0,g=m=c,d=u=f=r}}return _}function Rr(i){if(i._decimated){const t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function uo(i){i.data.datasets.forEach(t=>{Rr(t)})}function nd(i,t){const e=t.length;let n=0,s;const{iScale:o}=i,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=_t(qt(t,o.axis,r).lo,0,e-1)),c?s=_t(qt(t,o.axis,a).hi+1,n,e)-n:s=e-n,{start:n,count:s}}var sd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){uo(i);return}const n=i.width;i.data.datasets.forEach((s,o)=>{const{_data:r,indexAxis:a}=s,l=i.getDatasetMeta(o),c=r||s.data;if(Ye([a,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const h=i.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||i.options.parsing)return;let{start:d,count:u}=nd(l,c);const f=e.threshold||4*n;if(u<=f){Rr(s);return}X(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(m){this._data=m}}));let g;switch(e.algorithm){case"lttb":g=ed(c,d,u,n,e);break;case"min-max":g=id(c,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(i){uo(i)}};function od(i,t,e){const n=i.segments,s=i.points,o=t.points,r=[];for(const a of n){let{start:l,end:c}=a;c=os(l,c,s);const h=En(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:s[l],end:s[c]});continue}const d=mr(t,h);for(const u of d){const f=En(e,o[u.start],o[u.end],u.loop),g=pr(a,s,f);for(const m of g)r.push({source:m,target:u,start:{[e]:fo(h,f,"start",Math.max)},end:{[e]:fo(h,f,"end",Math.min)}})}}return r}function En(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=Ct(s),o=Ct(o)),{property:i,start:s,end:o}}function rd(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=os(r,a,s);const l=s[r],c=s[a];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function os(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function fo(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function Ir(i,t){let e=[],n=!1;return st(i)?(n=!0,e=i):e=rd(i,t),e.length?new se({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function go(i){return i&&i.fill!==!1}function ad(i,t,e){let s=i[t].fill;const o=[t];let r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!lt(s))return s;if(r=i[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function ld(i,t,e){const n=ud(i);if(Y(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return lt(s)&&Math.floor(s)===s?cd(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function cd(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function hd(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:Y(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function dd(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:Y(i)?n=i.value:n=t.getBaseValue(),n}function ud(i){const t=i.options,e=t.fill;let n=V(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function fd(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,r=n.points,a=gd(t,e);a.push(Ir({x:null,y:t.bottom},n));for(let l=0;l=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),n&&a.fill&&vn(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;go(o)&&vn(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!go(n)||e.drawTime!=="beforeDatasetDraw"||vn(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const _o=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},Sd=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class xo extends Ft{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,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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=J(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=pt(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=_o(n,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,m)=>{const _=n+e/2+o.measureText(g.text).width;(m===0||c[c.length-1]+_+2*a>r)&&(d+=h,c[c.length-(m>0?0:1)]=0,f+=h,u++),l[m]={left:0,top:f,row:u,width:_,height:s},c[c.length-1]+=_+a}),d}_fitCols(t,e,n,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,g=0,m=0;return this.legendItems.forEach((_,x)=>{const{itemWidth:y,itemHeight:C}=Cd(n,e,o,_,s);x>0&&f+C+2*a>h&&(d+=u+a,c.push({width:u,height:f}),g+=u+a,m++,u=f=0),l[x]={left:g,top:f,col:m,width:y,height:C},u=Math.max(u,y),f+=C+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,r=Re(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=yt(n,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=yt(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=yt(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=yt(n,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;nn(t,this),this._draw(),sn(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,a=ot.color,l=Re(t.rtl,this.left,this.width),c=pt(r.font),{padding:h}=r,d=c.size,u=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:_}=_o(r,d),x=function(D,w,p){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;s.save();const b=V(p.lineWidth,1);if(s.fillStyle=V(p.fillStyle,a),s.lineCap=V(p.lineCap,"butt"),s.lineDashOffset=V(p.lineDashOffset,0),s.lineJoin=V(p.lineJoin,"miter"),s.lineWidth=b,s.strokeStyle=V(p.strokeStyle,a),s.setLineDash(V(p.lineDash,[])),r.usePointStyle){const v={radius:m*Math.SQRT2/2,pointStyle:p.pointStyle,rotation:p.rotation,borderWidth:b},M=l.xPlus(D,g/2),P=w+u;sr(s,v,M,P,r.pointStyleWidth&&g)}else{const v=w+Math.max((d-m)/2,0),M=l.leftForLtr(D,g),P=ke(p.borderRadius);s.beginPath(),Object.values(P).some(E=>E!==0)?ai(s,{x:M,y:v,w:g,h:m,radius:P}):s.rect(M,v,g,m),s.fill(),b!==0&&s.stroke()}s.restore()},y=function(D,w,p){Se(s,p.text,D,w+_/2,c,{strikethrough:p.hidden,textAlign:l.textAlign(p.textAlign)})},C=this.isHorizontal(),S=this._computeTitleHeight();C?f={x:yt(o,this.left+h,this.right-n[0]),y:this.top+h+S,line:0}:f={x:this.left+h,y:yt(o,this.top+S+h,this.bottom-e[0].height),line:0},ur(this.ctx,t.textDirection);const k=_+h;this.legendItems.forEach((D,w)=>{s.strokeStyle=D.fontColor,s.fillStyle=D.fontColor;const p=s.measureText(D.text).width,b=l.textAlign(D.textAlign||(D.textAlign=r.textAlign)),v=g+u+p;let M=f.x,P=f.y;l.setWidth(this.width),C?w>0&&M+v+h>this.right&&(P=f.y+=k,f.line++,M=f.x=yt(o,this.left+h,this.right-n[f.line])):w>0&&P+k>this.bottom&&(M=f.x=M+e[f.line].width+h,f.line++,P=f.y=yt(o,this.top+S+h,this.bottom-e[f.line].height));const E=l.x(M);if(x(E,P,D),M=Ua(b,M+g+u,C?M+v:this.right,t.rtl),y(l.x(M),P,D),C)f.x+=v+h;else if(typeof D.text!="string"){const R=c.lineHeight;f.y+=zr(D,R)+h}else f.y+=k}),fr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=pt(e.font),s=kt(e.padding);if(!e.display)return;const o=Re(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=n.size/2,c=s.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=yt(t.align,d,this.right-u);else{const g=this.columnSizes.reduce((m,_)=>Math.max(m,_.height),0);h=c+yt(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=yt(a,d,d+u);r.textAlign=o.textAlign(Gn(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=n.string,Se(r,e.text,f,h,n)}_computeTitleHeight(){const t=this.options.title,e=pt(t.font),n=kt(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(Xt(t,this.left,this.right)&&Xt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;no.length>r.length?o:r)),t+e.size/2+n.measureText(s).width}function Dd(i,t,e){let n=i;return typeof t.text!="string"&&(n=zr(t,e)),n}function zr(i,t){const e=i.text?i.text.length:0;return t*e}function Od(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Ad={id:"legend",_element:xo,start(i,t,e){const n=i.legend=new xo({ctx:i.ctx,options:e,chart:i});vt.configure(i,n,e),vt.addBox(i,n)},stop(i){vt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;vt.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=kt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class rs extends Ft{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 n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=st(n.text)?n.text.length:1;this._padding=kt(n.padding);const o=s*pt(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:n,bottom:s,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=yt(a,n,o),d=e+t,c=o-n):(r.position==="left"?(h=n+t,d=yt(a,s,e),l=nt*-.5):(h=o-t,d=yt(a,e,s),l=nt*.5),c=s-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=pt(e.font),o=n.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Se(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:Gn(e.align),textBaseline:"middle",translation:[r,a]})}}function Td(i,t){const e=new rs({ctx:i.ctx,options:t,chart:i});vt.configure(i,e,t),vt.addBox(i,e),i.titleBlock=e}var Ld={id:"title",_element:rs,start(i,t,e){Td(i,e)},stop(i){const t=i.titleBlock;vt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;vt.configure(i,n,e),n.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 Oi=new WeakMap;var Ed={id:"subtitle",start(i,t,e){const n=new rs({ctx:i.ctx,options:e,chart:i});vt.configure(i,n,e),vt.addBox(i,n),Oi.set(i,n)},stop(i){vt.removeBox(i,Oi.get(i)),Oi.delete(i)},beforeUpdate(i,t,e){const n=Oi.get(i);vt.configure(i,n,e),n.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(i){if(!i.length)return!1;let t,e,n=new Set,s=0,o=0;for(t=0,e=i.length;ta+l)/n.size,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o-1?i.split(` +`):i}function Rd(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:i,label:r,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function yo(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=pt(t.bodyFont),c=pt(t.titleFont),h=pt(t.footerFont),d=o.length,u=s.length,f=n.length,g=kt(t.padding);let m=g.height,_=0,x=n.reduce((S,k)=>S+k.before.length+k.lines.length+k.after.length,0);if(x+=i.beforeBody.length+i.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const S=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*S+(x-f)*l.lineHeight+(x-1)*t.bodySpacing}u&&(m+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const C=function(S){_=Math.max(_,e.measureText(S).width+y)};return e.save(),e.font=c.string,G(i.title,C),e.font=l.string,G(i.beforeBody.concat(i.afterBody),C),y=t.displayColors?r+2+t.boxPadding:0,G(n,S=>{G(S.before,C),G(S.lines,C),G(S.after,C)}),y=0,e.font=h.string,G(i.footer,C),e.restore(),_+=g.width,{width:_,height:m}}function Id(i,t){const{y:e,height:n}=t;return ei.height-n/2?"bottom":"center"}function Fd(i,t,e,n){const{x:s,width:o}=n,r=e.caretSize+e.caretPadding;if(i==="left"&&s+o+r>t.width||i==="right"&&s-o-r<0)return!0}function zd(i,t,e,n){const{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Fd(c,i,t,e)&&(c="center"),c}function vo(i,t,e){const n=e.yAlign||t.yAlign||Id(i,e);return{xAlign:e.xAlign||t.xAlign||zd(i,t,e,n),yAlign:n}}function Bd(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function Nd(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function ko(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=ke(r);let g=Bd(t,a);const m=Nd(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,u)+s:a==="right"&&(g+=Math.max(d,f)+s),{x:_t(g,0,n.width-t.width),y:_t(m,0,n.height-t.height)}}function Ai(i,t,e){const n=kt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function wo(i){return Bt([],Yt(i))}function Wd(i,t,e){return he(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Mo(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Br={beforeTitle:jt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex"u"?Br[t].call(e,n):s}class Rn extends Ft{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,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new br(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Wd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=wt(n,"beforeTitle",this,t),o=wt(n,"title",this,t),r=wt(n,"afterTitle",this,t);let a=[];return a=Bt(a,Yt(s)),a=Bt(a,Yt(o)),a=Bt(a,Yt(r)),a}getBeforeBody(t,e){return wo(wt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return G(t,o=>{const r={before:[],lines:[],after:[]},a=Mo(n,o);Bt(r.before,Yt(wt(a,"beforeLabel",this,o))),Bt(r.lines,wt(a,"label",this,o)),Bt(r.after,Yt(wt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return wo(wt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=wt(n,"beforeFooter",this,t),o=wt(n,"footer",this,t),r=wt(n,"afterFooter",this,t);let a=[];return a=Bt(a,Yt(s)),a=Bt(a,Yt(o)),a=Bt(a,Yt(r)),a}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,d,u,n))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,n))),G(a,h=>{const d=Mo(t.callbacks,h);s.push(wt(d,"labelColor",this,h)),o.push(wt(d,"labelPointStyle",this,h)),r.push(wt(d,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=qe[n.position].call(this,s,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);const l=this._size=yo(this,n),c=Object.assign({},a,l),h=vo(this.chart,n,c),d=ko(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=ke(a),{x:u,y:f}=t,{width:g,height:m}=e;let _,x,y,C,S,k;return o==="center"?(S=f+m/2,s==="left"?(_=u,x=_-r,C=S+r,k=S-r):(_=u+g,x=_+r,C=S-r,k=S+r),y=_):(s==="left"?x=u+Math.max(l,h)+r:s==="right"?x=u+g-Math.max(c,d)-r:x=this.caretX,o==="top"?(C=f,S=C-r,_=x-r,y=x+r):(C=f+m,S=C+r,_=x+r,y=x-r),k=C),{x1:_,x2:x,x3:y,y1:C,y2:S,y3:k}}drawTitle(t,e,n){const s=this.title,o=s.length;let r,a,l;if(o){const c=Re(n.rtl,this.x,this.width);for(t.x=Ai(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",r=pt(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ai(t,{x:m,y:g,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ai(t,{x:_,y:g+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(_,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=n,d=pt(n.bodyFont);let u=d.lineHeight,f=0;const g=Re(n.rtl,this.x,this.width),m=function(p){e.fillText(p,g.x(t.x+f),t.y+u/2),t.y+=u+o},_=g.textAlign(r);let x,y,C,S,k,D,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Ai(this,_,n),e.fillStyle=n.bodyColor,G(this.beforeBody,m),f=a&&_!=="right"?r==="center"?c/2+h:c+2+h:0,S=0,D=s.length;S0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const r=qe[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=yo(this,t),l=Object.assign({},r,this._size),c=vo(e,t,l),h=ko(t,l,c,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const r=kt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,e),ur(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),fr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Hi(n,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,n),a=this._positionChanged(r,t),l=e||!Hi(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,r=qe[o.position].call(this,t,e);return r!==!1&&(n!==r.x||s!==r.y)}}O(Rn,"positioners",qe);var Vd={id:"tooltip",_element:Rn,positioners:qe,afterInit(i,t,e){e&&(i.tooltip=new Rn({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Br},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Hd=Object.freeze({__proto__:null,Colors:td,Decimation:sd,Filler:Md,Legend:Ad,SubTitle:Ed,Title:Ld,Tooltip:Vd});const jd=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function $d(i,t,e,n){const s=i.indexOf(t);if(s===-1)return jd(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const Yd=(i,t)=>i===null?null:_t(Math.round(i),0,t);function So(i){const t=this.getLabels();return i>=0&&ie.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}O(In,"id","category"),O(In,"defaults",{ticks:{callback:So}});function Ud(i,t){const e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,g=h-1,{min:m,max:_}=t,x=!X(r),y=!X(a),C=!X(c),S=(_-m)/(d+1);let k=xs((_-m)/g/f)*f,D,w,p,b;if(k<1e-14&&!x&&!y)return[{value:m},{value:_}];b=Math.ceil(_/k)-Math.floor(m/k),b>g&&(k=xs(b*k/g/f)*f),X(l)||(D=Math.pow(10,l),k=Math.ceil(k*D)/D),s==="ticks"?(w=Math.floor(m/k)*k,p=Math.ceil(_/k)*k):(w=m,p=_),x&&y&&o&&Na((a-r)/o,k/1e3)?(b=Math.round(Math.min((a-r)/k,h)),k=(a-r)/b,w=r,p=a):C?(w=x?r:w,p=y?a:p,b=c-1,k=(p-w)/b):(b=(p-w)/k,Qe(b,Math.round(b),k/1e3)?b=Math.round(b):b=Math.ceil(b));const v=Math.max(ys(k),ys(w));D=Math.pow(10,X(l)?v:l),w=Math.round(w*D)/D,p=Math.round(p*D)/D;let M=0;for(x&&(u&&w!==r?(e.push({value:r}),wa)break;e.push({value:P})}return y&&u&&p!==a?e.length&&Qe(e[e.length-1].value,a,Co(a,S,i))?e[e.length-1].value=a:e.push({value:a}):(!y||p===a)&&e.push({value:p}),e}function Co(i,t,{horizontal:e,minRotation:n}){const s=Rt(n),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class Ki extends Ce{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 X(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=e?s:l,a=l=>o=n?o:l;if(t){const l=Wt(s),c=Wt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=Ud(s,o);return t.bounds==="ticks"&&Ko(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return pi(t,this.chart.options.locale,this.options.ticks.format)}}class Fn extends Ki{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=lt(t)?t:0,this.max=lt(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=Rt(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}O(Fn,"id","linear"),O(Fn,"defaults",{ticks:{callback:en.formatters.numeric}});const ci=i=>Math.floor(ne(i)),me=(i,t)=>Math.pow(10,ci(i)+t);function Po(i){return i/Math.pow(10,ci(i))===1}function Do(i,t,e){const n=Math.pow(10,e),s=Math.floor(i/n);return Math.ceil(t/n)-s}function Xd(i,t){const e=t-i;let n=ci(e);for(;Do(i,t,n)>10;)n++;for(;Do(i,t,n)<10;)n--;return Math.min(n,ci(i))}function qd(i,{min:t,max:e}){t=St(i.min,t);const n=[],s=ci(t);let o=Xd(t,e),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,h=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-h)/Math.pow(10,o)),u=St(i.min,Math.round((l+h+d*Math.pow(10,o))*r)/r);for(;u=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),u=Math.round((l+h+d*Math.pow(10,o))*r)/r;const f=St(i.max,u);return n.push({value:f,major:Po(f),significand:d}),n}class zn extends Ce{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=Ki.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return lt(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=lt(t)?Math.max(0,t):null,this.max=lt(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!lt(this._userMin)&&(this.min=t===me(this.min,0)?me(this.min,-1):me(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,s=this.max;const o=a=>n=t?n:a,r=a=>s=e?s:a;n===s&&(n<=0?(o(1),r(10)):(o(me(n,-1)),r(me(s,1)))),n<=0&&o(me(s,-1)),s<=0&&r(me(n,1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=qd(e,this);return t.bounds==="ticks"&&Ko(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":pi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ne(t),this._valueRange=ne(this.max)-ne(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ne(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}O(zn,"id","logarithmic"),O(zn,"defaults",{ticks:{callback:en.formatters.logarithmic,major:{enabled:!0}}});function Bn(i){const t=i.ticks;if(t.display&&i.display){const e=kt(t.backdropPadding);return V(t.font&&t.font.size,ot.font.size)+e.height}return 0}function Kd(i,t,e){return e=st(e)?e:[e],{w:il(i,t.string,e),h:e.length*t.lineHeight}}function Oo(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:is?{start:t-e,end:t}:{start:t,end:t+e}}function Gd(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?nt/o:0;for(let l=0;lt.r&&(a=(n.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function Qd(i,t,e){const n=i.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,l=i.getPointPosition(t,n+s+r,o),c=Math.round(qn(Ct(l.angle+dt))),h=nu(l.y,a.h,c),d=eu(c),u=iu(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+a.w,bottom:h+a.h}}function Jd(i,t){if(!t)return!0;const{left:e,top:n,right:s,bottom:o}=i;return!(Kt({x:e,y:n},t)||Kt({x:e,y:o},t)||Kt({x:s,y:n},t)||Kt({x:s,y:o},t))}function tu(i,t,e){const n=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Bn(o)/2,additionalAngle:r?nt/s:0};let c;for(let h=0;h270||e<90)&&(i-=t),i}function su(i,t,e){const{left:n,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!X(a)){const l=ke(t.borderRadius),c=kt(t.backdropPadding);i.fillStyle=a;const h=n-c.left,d=s-c.top,u=o-n+c.width,f=r-s+c.height;Object.values(l).some(g=>g!==0)?(i.beginPath(),ai(i,{x:h,y:d,w:u,h:f,radius:l}),i.fill()):i.fillRect(h,d,u,f)}}function ou(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const o=i._pointLabelItems[s];if(!o.visible)continue;const r=n.setContext(i.getPointLabelContext(s));su(e,r,o);const a=pt(r.font),{x:l,y:c,textAlign:h}=o;Se(e,i._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Nr(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,it);else{let o=i.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r{const s=J(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?Gd(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=it/(this._pointLabels.length||1),n=this.options.startAngle||0;return Ct(t*e+Rt(n))}getDistanceFromCenterForValue(t){if(X(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(X(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{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(d),f=s.setContext(u),g=o.setContext(u);ru(this,f,l,r,g)}}),n.display){for(t.save(),a=r-1;a>=0;a--){const h=n.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:u}=h;!u||!d||(t.lineWidth=u,t.strokeStyle=d,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=n.setContext(this.getContext(l)),h=pt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=kt(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}Se(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}O(Ke,"id","radialLinear"),O(Ke,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:en.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),O(Ke,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),O(Ke,"descriptors",{angleLines:{_fallback:"grid"}});const rn={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}},Mt=Object.keys(rn);function Ao(i,t){return i-t}function To(i,t){if(X(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let r=t;return typeof n=="function"&&(r=n(r)),lt(r)||(r=typeof n=="string"?e.parse(r,n):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(Fe(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function Lo(i,t,e,n){const s=Mt.length;for(let o=Mt.indexOf(i);o=Mt.indexOf(e);o--){const r=Mt[o];if(rn[r].common&&i._adapter.diff(s,n,r)>=t-1)return r}return Mt[e?Mt.indexOf(e):0]}function cu(i){for(let t=Mt.indexOf(i)+1,e=Mt.length;t=t?e[n]:e[s];i[o]=!0}}function hu(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=e[a],l>=0&&(t[l].major=!0);return t}function Ro(i,t,e){const n=[],s={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=_t(e,0,r),n=_t(n,0,r),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,r=o.unit||Lo(o.minUnit,e,n,this._getLabelCapacity(e)),a=V(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Fe(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(n,e,r)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+r);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u+m)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,n,s){const o=this.options,r=o.ticks.callback;if(r)return J(r,[t,e,n],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=n[e],f=c&&d&&u&&u.major;return this._adapter.format(t,s||(f?d:h))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=qt(i,"pos",t)),{pos:o,time:a}=i[n],{pos:r,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=qt(i,"time",t)),{time:o,pos:a}=i[n],{time:r,pos:l}=i[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Nn extends hi{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=Ti(e,this.min),this._tableRange=Ti(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(r=0,a=s.length;rs-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(Ti(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return Ti(this._table,n*this._tableRange+this._minPos,!0)}}O(Nn,"id","timeseries"),O(Nn,"defaults",hi.defaults);var du=Object.freeze({__proto__:null,CategoryScale:In,LinearScale:Fn,LogarithmicScale:zn,RadialLinearScale:Ke,TimeScale:hi,TimeSeriesScale:Nn});const uu=[bc,Xh,Hd,du];te.register(...uu);function fu(i){let t,e,n;return{c(){t=$("button"),t.textContent="Sign in to Google",K(t,"id","googleSignInButton"),K(t,"class","svelte-181uvzo")},m(s,o){ce(s,t,o),e||(n=Wn(t,"click",i[0]),e=!0)},p:Pt,i:Pt,o:Pt,d(s){s&&Gt(t),e=!1,n()}}}function gu(i){let t=null;function e(){window.google.accounts.oauth2.initTokenClient({client_id:"1096961214518-mdhk0kl57rs9k11d4cm1c5scahtrr02u.apps.googleusercontent.com",scope:"https://www.googleapis.com/auth/spreadsheets.readonly",callback:n}).requestAccessToken()}function n(o){if(o.error){console.error("Error fetching access token:",o.error);return}t=o.access_token,console.log("Access Token:",t),s()}async function s(){const o="1kTE9S8nNdkYsmKyQSwLj4pc9xR7jqouDHD43Rij5BMo",a="Member + WG resolutions!A1:Z1000";try{const l=await fetch(`https://sheets.googleapis.com/v4/spreadsheets/${o}/values/${encodeURIComponent(a)}`,{headers:{Authorization:`Bearer ${t}`}}),c=await l.json();if(console.log("Full API Response:",c),!l.ok)throw new Error(`Failed to fetch spreadsheet data: ${l.status} - ${c.error.message}`);if(!c.values){console.error("No data found in spreadsheet.");return}await oa(c)}catch(l){console.error("Error fetching spreadsheet data:",l)}}return[e]}class pu extends Ji{constructor(t){super(),Qi(this,t,gu,fu,ui,{})}}function mu(i){let t,e,n,s,o,r,a,l,c,h,d,u,f;return o=new pu({}),{c(){t=$("div"),e=$("h2"),e.textContent="Decision Log",n=gt(),s=$("div"),Hn(o.$$.fragment),r=gt(),a=$("label"),l=$("p"),l.textContent="Or load CSV",c=gt(),h=$("input"),K(e,"class","text-left"),K(l,"class","text-left purple"),K(h,"type","file"),K(h,"accept",".csv"),K(s,"class","flex flex-col items-start"),K(t,"class","file-upload my-4 flex flex-col border-2 border-purple rounded p-2 items-baseline")},m(g,m){ce(g,t,m),I(t,e),I(t,n),I(t,s),Gi(o,s,null),I(s,r),I(s,a),I(a,l),I(a,c),I(a,h),d=!0,u||(f=Wn(h,"change",i[0]),u=!0)},p:Pt,i(g){d||(Ie(o.$$.fragment,g),d=!0)},o(g){ii(o.$$.fragment,g),d=!1},d(g){g&&Gt(t),Zi(o),u=!1,f()}}}function bu(i){return[async e=>{const n=e.target.files[0];n&&await sa(n)}]}class _u extends Ji{constructor(t){super(),Qi(this,t,bu,mu,ui,{})}}function Io(i,t,e){const n=i.slice();return n[3]=t[e],n}function Fo(i){let t,e,n,s,o=i[3].supplemental_materials+"",r;return{c(){t=$("tr"),e=$("td"),e.textContent="Supplemental Materials",n=gt(),s=$("td"),r=ee(o),K(e,"class","font-semibold px-2 py-1 svelte-1hsaqri"),K(s,"class","px-2 py-1 svelte-1hsaqri")},m(a,l){ce(a,t,l),I(t,e),I(t,n),I(t,s),I(s,r)},p(a,l){l&1&&o!==(o=a[3].supplemental_materials+"")&&xe(r,o)},d(a){a&&Gt(t)}}}function zo(i){let t,e,n,s,o=i[3].other_notes+"",r;return{c(){t=$("tr"),e=$("td"),e.textContent="Other Notes",n=gt(),s=$("td"),r=ee(o),K(e,"class","font-semibold px-2 py-1 svelte-1hsaqri"),K(s,"class","px-2 py-1 svelte-1hsaqri")},m(a,l){ce(a,t,l),I(t,e),I(t,n),I(t,s),I(s,r)},p(a,l){l&1&&o!==(o=a[3].other_notes+"")&&xe(r,o)},d(a){a&&Gt(t)}}}function Bo(i){let t,e,n=i[3].short_title+"",s,o,r,a,l,c,h,d,u,f=i[3].date+"",g,m,_,x,y,C,S=i[3].description+"",k,D,w,p,b,v,M=i[3].deciding_groups+"",P,E,R,F,z,A,j=i[3].resolution+"",L,ct,tt,T,N=i[3].supplemental_materials&&Fo(i),H=i[3].other_notes&&zo(i);return{c(){t=$("details"),e=$("summary"),s=ee(n),o=gt(),r=$("div"),a=$("table"),l=$("tbody"),c=$("tr"),h=$("td"),h.textContent="Date",d=gt(),u=$("td"),g=ee(f),m=gt(),_=$("tr"),x=$("td"),x.textContent="Description",y=gt(),C=$("td"),k=ee(S),D=gt(),w=$("tr"),p=$("td"),p.textContent="Deciding Group(s)",b=gt(),v=$("td"),P=ee(M),E=gt(),R=$("tr"),F=$("td"),F.textContent="Resolution",z=gt(),A=$("td"),L=ee(j),ct=gt(),N&&N.c(),tt=gt(),H&&H.c(),T=gt(),K(e,"class","font-semibold text-md text-left svelte-1hsaqri"),K(h,"class","font-semibold px-2 py-1 svelte-1hsaqri"),K(u,"class","px-2 py-1 svelte-1hsaqri"),K(x,"class","font-semibold px-2 py-1 svelte-1hsaqri"),K(C,"class","px-2 py-1 description svelte-1hsaqri"),K(p,"class","font-semibold px-2 py-1 svelte-1hsaqri"),K(v,"class","px-2 py-1 svelte-1hsaqri"),K(F,"class","font-semibold px-2 py-1 svelte-1hsaqri"),K(A,"class","px-2 py-1 svelte-1hsaqri"),K(l,"class","svelte-1hsaqri"),K(a,"class","table-auto text-left max-w-xl svelte-1hsaqri"),K(r,"class","mt-2"),K(t,"class","my-2 p-2 border border-purple rounded-lg max-w-2xl svelte-1hsaqri")},m(W,U){ce(W,t,U),I(t,e),I(e,s),I(t,o),I(t,r),I(r,a),I(a,l),I(l,c),I(c,h),I(c,d),I(c,u),I(u,g),I(l,m),I(l,_),I(_,x),I(_,y),I(_,C),I(C,k),I(l,D),I(l,w),I(w,p),I(w,b),I(w,v),I(v,P),I(l,E),I(l,R),I(R,F),I(R,z),I(R,A),I(A,L),I(l,ct),N&&N.m(l,null),I(l,tt),H&&H.m(l,null),I(t,T)},p(W,U){U&1&&n!==(n=W[3].short_title+"")&&xe(s,n),U&1&&f!==(f=W[3].date+"")&&xe(g,f),U&1&&S!==(S=W[3].description+"")&&xe(k,S),U&1&&M!==(M=W[3].deciding_groups+"")&&xe(P,M),U&1&&j!==(j=W[3].resolution+"")&&xe(L,j),W[3].supplemental_materials?N?N.p(W,U):(N=Fo(W),N.c(),N.m(l,tt)):N&&(N.d(1),N=null),W[3].other_notes?H?H.p(W,U):(H=zo(W),H.c(),H.m(l,null)):H&&(H.d(1),H=null)},d(W){W&&Gt(t),N&&N.d(),H&&H.d()}}}function No(i){let t,e,n;return{c(){t=$("button"),t.textContent="Clear data",K(t,"class","text-white px-4 py-2 rounded mt-4")},m(s,o){ce(s,t,o),e||(n=Wn(t,"click",i[2]),e=!0)},p:Pt,d(s){s&&Gt(t),e=!1,n()}}}function xu(i){let t,e,n,s,o,r=ds(i[0]),a=[];for(let c=0;c{ra()};return tn.subscribe(r=>{e(0,n=r)}),fi.subscribe(r=>{e(1,s=r)}),[n,s,o]}class vu extends Ji{constructor(t){super(),Qi(this,t,yu,xu,ui,{})}}function ku(i){let t,e;return t=new _u({}),{c(){Hn(t.$$.fragment)},m(n,s){Gi(t,n,s),e=!0},i(n){e||(Ie(t.$$.fragment,n),e=!0)},o(n){ii(t.$$.fragment,n),e=!1},d(n){Zi(t,n)}}}function wu(i){let t,e;return t=new vu({}),{c(){Hn(t.$$.fragment)},m(n,s){Gi(t,n,s),e=!0},i(n){e||(Ie(t.$$.fragment,n),e=!0)},o(n){ii(t.$$.fragment,n),e=!1},d(n){Zi(t,n)}}}function Mu(i){let t,e,n,s,o,r;const a=[wu,ku],l=[];function c(h,d){return h[0]?0:1}return s=c(i),o=l[s]=a[s](i),{c(){t=$("main"),e=$("h1"),e.textContent="Governance Dashboard",n=gt(),o.c(),K(e,"class","svelte-10lgg3m")},m(h,d){ce(h,t,d),I(t,e),I(t,n),l[s].m(t,null),r=!0},p(h,[d]){let u=s;s=c(h),s!==u&&(Kr(),ii(l[u],1,1,()=>{l[u]=null}),Gr(),o=l[s],o||(o=l[s]=a[s](h),o.c()),Ie(o,1),o.m(t,null))},i(h){r||(Ie(o),r=!0)},o(h){ii(o),r=!1},d(h){h&&Gt(t),l[s].d()}}}function Su(i,t,e){let n;return na.subscribe(s=>s),fi.subscribe(s=>e(0,n=s)),[n]}class Cu extends Ji{constructor(t){super(),Qi(this,t,Su,Mu,ui,{})}}new Cu({target:document.getElementById("app")}); diff --git a/assets/index-ZS2Oi91l.js b/assets/index-ZS2Oi91l.js deleted file mode 100644 index 42cea1a2..00000000 --- a/assets/index-ZS2Oi91l.js +++ /dev/null @@ -1,35 +0,0 @@ -var Zr=Object.defineProperty;var Qr=(i,t,e)=>t in i?Zr(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var A=(i,t,e)=>Qr(i,typeof t!="symbol"?t+"":t,e);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function e(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=e(s);fetch(s.href,o)}})();function ct(){}function qo(i){return i()}function fs(){return Object.create(null)}function xi(i){i.forEach(qo)}function Ko(i){return typeof i=="function"}function De(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}function Jr(i){return Object.keys(i).length===0}function O(i,t){i.appendChild(t)}function Pt(i,t,e){i.insertBefore(t,e||null)}function Mt(i){i.parentNode&&i.parentNode.removeChild(i)}function Go(i,t){for(let e=0;ei.removeEventListener(t,e,n)}function W(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function ta(i){return Array.from(i.childNodes)}function zt(i,t){t=""+t,i.data!==t&&(i.data=t)}let hi;function ni(i){hi=i}function ea(){if(!hi)throw new Error("Function called outside component initialization");return hi}function ia(i){ea().$$.on_mount.push(i)}const Ie=[],gs=[];let ze=[];const ps=[],na=Promise.resolve();let Cn=!1;function sa(){Cn||(Cn=!0,na.then(Zo))}function Pn(i){ze.push(i)}const un=new Set;let Te=0;function Zo(){if(Te!==0)return;const i=hi;do{try{for(;Tei.indexOf(n)===-1?t.push(n):e.push(n)),e.forEach(n=>n()),ze=t}const Bi=new Set;let ke;function ms(){ke={r:0,c:[],p:ke}}function bs(){ke.r||xi(ke.c),ke=ke.p}function jt(i,t){i&&i.i&&(Bi.delete(i),i.i(t))}function Jt(i,t,e,n){if(i&&i.o){if(Bi.has(i))return;Bi.add(i),ke.c.push(()=>{Bi.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}function qi(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function si(i){i&&i.c()}function Be(i,t,e){const{fragment:n,after_update:s}=i.$$;n&&n.m(t,e),Pn(()=>{const o=i.$$.on_mount.map(qo).filter(Ko);i.$$.on_destroy?i.$$.on_destroy.push(...o):xi(o),i.$$.on_mount=[]}),s.forEach(Pn)}function Ve(i,t){const e=i.$$;e.fragment!==null&&(ra(e.after_update),xi(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function aa(i,t){i.$$.dirty[0]===-1&&(Ie.push(i),sa(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<{const g=f.length?f[0]:u;return c.ctx&&s(c.ctx[d],c.ctx[d]=g)&&(!c.skip_bound&&c.bound[d]&&c.bound[d](g),h&&aa(i,d)),u}):[],c.update(),h=!0,xi(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const d=ta(t.target);c.fragment&&c.fragment.l(d),d.forEach(Mt)}else c.fragment&&c.fragment.c();t.intro&&jt(i.$$.fragment),Be(i,t.target,t.anchor),Zo()}ni(l)}class Ue{constructor(){A(this,"$$");A(this,"$$set")}$destroy(){Ve(this,1),this.$destroy=ct}$on(t,e){if(!Ko(e))return ct;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const s=n.indexOf(e);s!==-1&&n.splice(s,1)}}$set(t){this.$$set&&!Jr(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const la="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(la);const Re=[];function Oe(i,t=ct){let e;const n=new Set;function s(a){if(De(i,a)&&(i=a,e)){const l=!Re.length;for(const c of n)c[1](),Re.push(c,i);if(l){for(let c=0;c{n.delete(c),n.size===0&&e&&(e(),e=null)}}return{set:s,update:o,subscribe:r}}var ca=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ha(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Qo={exports:{}};/* @license -Papa Parse -v5.4.1 -https://github.com/mholt/PapaParse -License: MIT -*/(function(i,t){(function(e,n){i.exports=n()})(ca,function e(){var n=typeof self<"u"?self:typeof window<"u"?window:n!==void 0?n:{},s=!n.document&&!!n.postMessage,o=n.IS_PAPA_WORKER||!1,r={},a=0,l={parse:function(m,_){var v=(_=_||{}).dynamicTyping||!1;if(w(v)&&(_.dynamicTypingFunction=v,v={}),_.dynamicTyping=v,_.transform=!!w(_.transform)&&_.transform,_.worker&&l.WORKERS_SUPPORTED){var S=function(){if(!l.WORKERS_SUPPORTED)return!1;var E=(z=n.URL||n.webkitURL||null,B=e.toString(),l.BLOB_URL||(l.BLOB_URL=z.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",B,")();"],{type:"text/javascript"})))),I=new n.Worker(E),z,B;return I.onmessage=y,I.id=a++,r[I.id]=I}();return S.userStep=_.step,S.userChunk=_.chunk,S.userComplete=_.complete,S.userError=_.error,_.step=w(_.step),_.chunk=w(_.chunk),_.complete=w(_.complete),_.error=w(_.error),delete _.worker,void S.postMessage({input:m,config:_,workerId:S.id})}var P=null;return l.NODE_STREAM_INPUT,typeof m=="string"?(m=function(E){return E.charCodeAt(0)===65279?E.slice(1):E}(m),P=_.download?new d(_):new f(_)):m.readable===!0&&w(m.read)&&w(m.on)?P=new g(_):(n.File&&m instanceof File||m instanceof Object)&&(P=new u(_)),P.stream(m)},unparse:function(m,_){var v=!1,S=!0,P=",",E=`\r -`,I='"',z=I+I,B=!1,L=null,U=!1;(function(){if(typeof _=="object"){if(typeof _.delimiter!="string"||l.BAD_DELIMITERS.filter(function(T){return _.delimiter.indexOf(T)!==-1}).length||(P=_.delimiter),(typeof _.quotes=="boolean"||typeof _.quotes=="function"||Array.isArray(_.quotes))&&(v=_.quotes),typeof _.skipEmptyLines!="boolean"&&typeof _.skipEmptyLines!="string"||(B=_.skipEmptyLines),typeof _.newline=="string"&&(E=_.newline),typeof _.quoteChar=="string"&&(I=_.quoteChar),typeof _.header=="boolean"&&(S=_.header),Array.isArray(_.columns)){if(_.columns.length===0)throw new Error("Option columns is empty");L=_.columns}_.escapeChar!==void 0&&(z=_.escapeChar+I),(typeof _.escapeFormulae=="boolean"||_.escapeFormulae instanceof RegExp)&&(U=_.escapeFormulae instanceof RegExp?_.escapeFormulae:/^[=+\-@\t\r].*$/)}})();var R=new RegExp(p(I),"g");if(typeof m=="string"&&(m=JSON.parse(m)),Array.isArray(m)){if(!m.length||Array.isArray(m[0]))return dt(null,m,B);if(typeof m[0]=="object")return dt(L||Object.keys(m[0]),m,B)}else if(typeof m=="object")return typeof m.data=="string"&&(m.data=JSON.parse(m.data)),Array.isArray(m.data)&&(m.fields||(m.fields=m.meta&&m.meta.fields||L),m.fields||(m.fields=Array.isArray(m.data[0])?m.fields:typeof m.data[0]=="object"?Object.keys(m.data[0]):[]),Array.isArray(m.data[0])||typeof m.data[0]=="object"||(m.data=[m.data])),dt(m.fields||[],m.data||[],B);throw new Error("Unable to serialize unrecognized input");function dt(T,N,j){var H="";typeof T=="string"&&(T=JSON.parse(T)),typeof N=="string"&&(N=JSON.parse(N));var X=Array.isArray(T)&&0=this._config.preview;if(o)n.postMessage({results:E,workerId:l.WORKER_ID,finished:z});else if(w(this._config.chunk)&&!v){if(this._config.chunk(E,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);E=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(E.data),this._completeResults.errors=this._completeResults.errors.concat(E.errors),this._completeResults.meta=E.meta),this._completed||!z||!w(this._config.complete)||E&&E.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),z||E&&E.meta.paused||this._nextChunk(),E}this._halted=!0},this._sendError=function(_){w(this._config.error)?this._config.error(_):o&&this._config.error&&n.postMessage({workerId:l.WORKER_ID,error:_,finished:!1})}}function d(m){var _;(m=m||{}).chunkSize||(m.chunkSize=l.RemoteChunkSize),h.call(this,m),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(v){this._input=v,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(_=new XMLHttpRequest,this._config.withCredentials&&(_.withCredentials=this._config.withCredentials),s||(_.onload=D(this._chunkLoaded,this),_.onerror=D(this._chunkError,this)),_.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var v=this._config.downloadRequestHeaders;for(var S in v)_.setRequestHeader(S,v[S])}if(this._config.chunkSize){var P=this._start+this._config.chunkSize-1;_.setRequestHeader("Range","bytes="+this._start+"-"+P)}try{_.send(this._config.downloadRequestBody)}catch(E){this._chunkError(E.message)}s&&_.status===0&&this._chunkError()}},this._chunkLoaded=function(){_.readyState===4&&(_.status<200||400<=_.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:_.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(v){var S=v.getResponseHeader("Content-Range");return S===null?-1:parseInt(S.substring(S.lastIndexOf("/")+1))}(_),this.parseChunk(_.responseText)))},this._chunkError=function(v){var S=_.statusText||v;this._sendError(new Error(S))}}function u(m){var _,v;(m=m||{}).chunkSize||(m.chunkSize=l.LocalChunkSize),h.call(this,m);var S=typeof FileReader<"u";this.stream=function(P){this._input=P,v=P.slice||P.webkitSlice||P.mozSlice,S?((_=new FileReader).onload=D(this._chunkLoaded,this),_.onerror=D(this._chunkError,this)):_=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount=this._input.size,this.parseChunk(P.target.result)},this._chunkError=function(){this._sendError(_.error)}}function f(m){var _;h.call(this,m=m||{}),this.stream=function(v){return _=v,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var v,S=this._config.chunkSize;return S?(v=_.substring(0,S),_=_.substring(S)):(v=_,_=""),this._finished=!_,this.parseChunk(v)}}}function g(m){h.call(this,m=m||{});var _=[],v=!0,S=!1;this.pause=function(){h.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){h.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(P){this._input=P,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){S&&_.length===1&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),_.length?this.parseChunk(_.shift()):v=!0},this._streamData=D(function(P){try{_.push(typeof P=="string"?P:P.toString(this._config.encoding)),v&&(v=!1,this._checkIsFinished(),this.parseChunk(_.shift()))}catch(E){this._streamError(E)}},this),this._streamError=D(function(P){this._streamCleanUp(),this._sendError(P)},this),this._streamEnd=D(function(){this._streamCleanUp(),S=!0,this._streamData("")},this),this._streamCleanUp=D(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function b(m){var _,v,S,P=Math.pow(2,53),E=-P,I=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,z=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,B=this,L=0,U=0,R=!1,dt=!1,et=[],T={data:[],errors:[],meta:{}};if(w(m.step)){var N=m.step;m.step=function(V){if(T=V,X())H();else{if(H(),T.data.length===0)return;L+=V.data.length,m.preview&&L>m.preview?v.abort():(T.data=T.data[0],N(T,B))}}}function j(V){return m.skipEmptyLines==="greedy"?V.join("").trim()==="":V.length===1&&V[0].length===0}function H(){return T&&S&&(_t("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+l.DefaultDelimiter+"'"),S=!1),m.skipEmptyLines&&(T.data=T.data.filter(function(V){return!j(V)})),X()&&function(){if(!T)return;function V(at,pt){w(m.transformHeader)&&(at=m.transformHeader(at,pt)),et.push(at)}if(Array.isArray(T.data[0])){for(var G=0;X()&&G=et.length?"__parsed_extra":et[J]),m.transform&&(it=m.transform(it,ut)),it=bt(ut,it),ut==="__parsed_extra"?(yt[ut]=yt[ut]||[],yt[ut].push(it)):yt[ut]=it}return m.header&&(J>et.length?_t("FieldMismatch","TooManyFields","Too many fields: expected "+et.length+" fields but parsed "+J,U+pt):J=Lt.length/2?`\r -`:"\r"}(V,pt)),S=!1,m.delimiter)w(m.delimiter)&&(m.delimiter=m.delimiter(V),T.meta.delimiter=m.delimiter);else{var J=function(ut,it,It,Lt,Nt){var Yt,Tt,lt,gt;Nt=Nt||[","," ","|",";",l.RECORD_SEP,l.UNIT_SEP];for(var ge=0;ge=I)return Rt(!0)}else for(Q=L,L++;;){if((Q=R.indexOf(_,Q+1))===-1)return et||_t.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:bt.length,index:L}),se();if(Q===T-1)return se(R.substring(L,Q).replace(ge,_));if(_!==B||R[Q+1]!==B){if(_===B||Q===0||R[Q-1]!==B){lt!==-1&<=I)return Rt(!0);break}_t.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:bt.length,index:L}),Q++}}else Q++}return se();function pe(Et){bt.push(Et),G=L}function ne(Et){var us=0;if(Et!==-1){var dn=R.substring(Q+1,Et);dn&&dn.trim()===""&&(us=dn.length)}return us}function se(Et){return et||(Et===void 0&&(Et=R.substring(L)),V.push(Et),L=T,pe(V),X&&wi()),Rt()}function oe(Et){L=Et,pe(V),V=[],gt=R.indexOf(S,L)}function Rt(Et){return{data:bt,errors:_t,meta:{delimiter:v,linebreak:S,aborted:U,truncated:!!Et,cursor:G+(dt||0)}}}function wi(){E(Rt()),bt=[],_t=[]}},this.abort=function(){U=!0},this.getCharIndex=function(){return L}}function y(m){var _=m.data,v=r[_.workerId],S=!1;if(_.error)v.userError(_.error,_.file);else if(_.results&&_.results.data){var P={abort:function(){S=!0,M(_.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:C,resume:C};if(w(v.userStep)){for(var E=0;E<_.results.data.length&&(v.userStep({data:_.results.data[E],errors:_.results.errors,meta:_.results.meta},P),!S);E++);delete _.results}else w(v.userChunk)&&(v.userChunk(_.results,P,_.file),delete _.results)}_.finished&&!S&&M(_.workerId,_.results)}function M(m,_){var v=r[m];w(v.userComplete)&&v.userComplete(_),v.terminate(),delete r[m]}function C(){throw new Error("Not implemented.")}function k(m){if(typeof m!="object"||m===null)return m;var _=Array.isArray(m)?[]:{};for(var v in m)_[v]=k(m[v]);return _}function D(m,_){return function(){m.apply(_,arguments)}}function w(m){return typeof m=="function"}return o&&(n.onmessage=function(m){var _=m.data;if(l.WORKER_ID===void 0&&_&&(l.WORKER_ID=_.workerId),typeof _.input=="string")n.postMessage({workerId:l.WORKER_ID,results:l.parse(_.input,_.config),finished:!0});else if(n.File&&_.input instanceof File||_.input instanceof Object){var v=l.parse(_.input,_.config);v&&n.postMessage({workerId:l.WORKER_ID,results:v,finished:!0})}}),(d.prototype=Object.create(h.prototype)).constructor=d,(u.prototype=Object.create(h.prototype)).constructor=u,(f.prototype=Object.create(f.prototype)).constructor=f,(g.prototype=Object.create(h.prototype)).constructor=g,l})})(Qo);var da=Qo.exports;const Jo=ha(da),jn=Oe([]),on=Oe(!1),Un=Oe(!1),Yn=Oe(0),tr=Oe({labels:["A","B","C","D","E"],values:[3,4,2,5,6]}),Xn=Oe({labels:["Proposal A","Proposal B","Proposal C"],values:[7,6,4]}),qn=Oe([{vote:"-",proposal:"-",title:"Placeholder Proposal 1",count:0},{vote:"-",proposal:"-",title:"Placeholder Proposal 2",count:0}]),ua=async i=>new Promise((t,e)=>{const n=new FileReader;n.onload=s=>{const r=s.target.result.split(` -`).slice(3).join(` -`);Jo.parse(r,{header:!0,complete:a=>{jn.set(a.data),on.set(!0),t(a.data)},error:a=>e(a)})},n.onerror=s=>e(s),n.readAsText(i)}),fa=()=>{jn.set([]),on.set(!1)},ga=async i=>new Promise((t,e)=>{Jo.parse(i,{header:!0,complete:n=>{console.log("Raw CSV Data:",n.data);const s=n.data.filter(d=>d.Response&&d.Response.trim()!=="");console.log("Filtered Responses (Non-empty):",s);const o=Array.from(new Set(s.map(d=>d.Response)));console.log("Unique Responses:",o);const r={};o.forEach((d,u)=>{r[d]=String.fromCharCode(65+u)}),console.log("Label Mapping:",r);let a=0;const l=s.filter(d=>d.Response==="Voted"?(a=parseInt(d.Count,10)||0,!1):!0);console.log("Filtered Proposal Data (Excluding 'Voted'):",l),Yn.set(a),console.log("Total 'Voted' Count:",a);const c=l.map(d=>r[d.Response]),h=l.map(d=>parseInt(d.Count,10)||0);console.log("Graph Labels:",c),console.log("Graph Values:",h),tr.set({labels:c,values:h}),Xn.set({labels:c,values:h}),qn.set(l.map(d=>({vote:r[d.Response],proposal:r[d.Response],title:d.Response,count:parseInt(d.Count,10)||0}))),console.log("Final Proposals Data:",l),Un.set(!0),t()},error:n=>{console.error("Error Parsing CSV:",n),e(n)}})}),pa=()=>{tr.set({labels:["Placeholder 1","Placeholder 2","Placeholder 3"],values:[0,0,0]}),Xn.set({labels:["Placeholder A","Placeholder B"],values:[0,0]}),qn.set([{vote:"-",proposal:"-",title:"Placeholder Proposal 1",count:0},{vote:"-",proposal:"-",title:"Placeholder Proposal 2",count:0}]),Yn.set(0),Un.set(!1)};/*! - * @kurkle/color v0.3.2 - * https://github.com/kurkle/color#readme - * (c) 2023 Jukka Kurkela - * Released under the MIT License - */function yi(i){return i+.5|0}const re=(i,t,e)=>Math.max(Math.min(i,e),t);function Ze(i){return re(yi(i*2.55),0,255)}function he(i){return re(yi(i*255),0,255)}function Zt(i){return re(yi(i/2.55)/100,0,1)}function _s(i){return re(yi(i*100),0,100)}const Ft={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},Dn=[..."0123456789ABCDEF"],ma=i=>Dn[i&15],ba=i=>Dn[(i&240)>>4]+Dn[i&15],Mi=i=>(i&240)>>4===(i&15),_a=i=>Mi(i.r)&&Mi(i.g)&&Mi(i.b)&&Mi(i.a);function xa(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&Ft[i[1]]*17,g:255&Ft[i[2]]*17,b:255&Ft[i[3]]*17,a:t===5?Ft[i[4]]*17:255}:(t===7||t===9)&&(e={r:Ft[i[1]]<<4|Ft[i[2]],g:Ft[i[3]]<<4|Ft[i[4]],b:Ft[i[5]]<<4|Ft[i[6]],a:t===9?Ft[i[7]]<<4|Ft[i[8]]:255})),e}const ya=(i,t)=>i<255?t(i):"";function va(i){var t=_a(i)?ma:ba;return i?"#"+t(i.r)+t(i.g)+t(i.b)+ya(i.a,t):void 0}const ka=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function er(i,t,e){const n=t*Math.min(e,1-e),s=(o,r=(o+i/30)%12)=>e-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function wa(i,t,e){const n=(s,o=(s+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function Ma(i,t,e){const n=er(i,1,.5);let s;for(t+e>1&&(s=1/(t+e),t*=s,e*=s),s=0;s<3;s++)n[s]*=1-t-e,n[s]+=t;return n}function Sa(i,t,e,n,s){return i===s?(t-e)/n+(t.5?h/(2-o-r):h/(o+r),l=Sa(e,n,s,h,o),l=l*60+.5),[l|0,c||0,a]}function Gn(i,t,e,n){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,n)).map(he)}function Zn(i,t,e){return Gn(er,i,t,e)}function Ca(i,t,e){return Gn(Ma,i,t,e)}function Pa(i,t,e){return Gn(wa,i,t,e)}function ir(i){return(i%360+360)%360}function Da(i){const t=ka.exec(i);let e=255,n;if(!t)return;t[5]!==n&&(e=t[6]?Ze(+t[5]):he(+t[5]));const s=ir(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=Ca(s,o,r):t[1]==="hsv"?n=Pa(s,o,r):n=Zn(s,o,r),{r:n[0],g:n[1],b:n[2],a:e}}function Oa(i,t){var e=Kn(i);e[0]=ir(e[0]+t),e=Zn(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Aa(i){if(!i)return;const t=Kn(i),e=t[0],n=_s(t[1]),s=_s(t[2]);return i.a<255?`hsla(${e}, ${n}%, ${s}%, ${Zt(i.a)})`:`hsl(${e}, ${n}%, ${s}%)`}const xs={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"},ys={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 La(){const i={},t=Object.keys(ys),e=Object.keys(xs);let n,s,o,r,a;for(n=0;n>16&255,o>>8&255,o&255]}return i}let Si;function Ta(i){Si||(Si=La(),Si.transparent=[0,0,0,0]);const t=Si[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Ra=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ea(i){const t=Ra.exec(i);let e=255,n,s,o;if(t){if(t[7]!==n){const r=+t[7];e=t[8]?Ze(r):re(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?Ze(n):re(n,0,255)),s=255&(t[4]?Ze(s):re(s,0,255)),o=255&(t[6]?Ze(o):re(o,0,255)),{r:n,g:s,b:o,a:e}}}function Fa(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${Zt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const fn=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Ee=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Ia(i,t,e){const n=Ee(Zt(i.r)),s=Ee(Zt(i.g)),o=Ee(Zt(i.b));return{r:he(fn(n+e*(Ee(Zt(t.r))-n))),g:he(fn(s+e*(Ee(Zt(t.g))-s))),b:he(fn(o+e*(Ee(Zt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function Ci(i,t,e){if(i){let n=Kn(i);n[t]=Math.max(0,Math.min(n[t]+n[t]*e,t===0?360:1)),n=Zn(n),i.r=n[0],i.g=n[1],i.b=n[2]}}function nr(i,t){return i&&Object.assign(t||{},i)}function vs(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=he(i[3]))):(t=nr(i,{r:0,g:0,b:0,a:1}),t.a=he(t.a)),t}function za(i){return i.charAt(0)==="r"?Ea(i):Da(i)}class di{constructor(t){if(t instanceof di)return t;const e=typeof t;let n;e==="object"?n=vs(t):e==="string"&&(n=xa(t)||Ta(t)||za(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=nr(this._rgb);return t&&(t.a=Zt(t.a)),t}set rgb(t){this._rgb=vs(t)}rgbString(){return this._valid?Fa(this._rgb):void 0}hexString(){return this._valid?va(this._rgb):void 0}hslString(){return this._valid?Aa(this._rgb):void 0}mix(t,e){if(t){const n=this.rgb,s=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=n.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,n.r=255&c*n.r+o*s.r+.5,n.g=255&c*n.g+o*s.g+.5,n.b=255&c*n.b+o*s.b+.5,n.a=r*n.a+(1-r)*s.a,this.rgb=n}return this}interpolate(t,e){return t&&(this._rgb=Ia(this._rgb,t._rgb,e)),this}clone(){return new di(this.rgb)}alpha(t){return this._rgb.a=he(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=yi(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 Ci(this._rgb,2,t),this}darken(t){return Ci(this._rgb,2,-t),this}saturate(t){return Ci(this._rgb,1,t),this}desaturate(t){return Ci(this._rgb,1,-t),this}rotate(t){return Oa(this._rgb,t),this}}/*! - * Chart.js v4.4.5 - * https://www.chartjs.org - * (c) 2024 Chart.js Contributors - * Released under the MIT License - */function qt(){}const Ba=(()=>{let i=0;return()=>i++})();function q(i){return i===null||typeof i>"u"}function ot(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Y(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function ht(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function Dt(i,t){return ht(i)?i:t}function $(i,t){return typeof i>"u"?t:i}const Va=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,sr=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function tt(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function Z(i,t,e,n){let s,o,r;if(ot(i))for(o=i.length,s=0;si,x:i=>i.x,y:i=>i.y};function Ha(i){const t=i.split("."),e=[];let n="";for(const s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(e.push(n),n="");return e}function $a(i){const t=Ha(i);return e=>{for(const n of t){if(n==="")break;e=e&&e[n]}return e}}function de(i,t){return(ks[t]||(ks[t]=$a(t)))(i)}function Qn(i){return i.charAt(0).toUpperCase()+i.slice(1)}const fi=i=>typeof i<"u",ue=i=>typeof i=="function",ws=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function ja(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const st=Math.PI,nt=2*st,Ua=nt+st,Zi=Number.POSITIVE_INFINITY,Ya=st/180,ft=st/2,me=st/4,Ms=st*2/3,ae=Math.log10,Ut=Math.sign;function ri(i,t,e){return Math.abs(i-t)s-o).pop(),t}function Ne(i){return!isNaN(parseFloat(i))&&isFinite(i)}function qa(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function rr(i,t,e){let n,s,o;for(n=0,s=i.length;nl&&c=Math.min(t,e)-n&&i<=Math.max(t,e)+n}function ts(i,t,e){e=e||(r=>i[r]1;)o=s+n>>1,e(o)?s=o:n=o;return{lo:s,hi:n}}const ee=(i,t,e,n)=>ts(i,e,n?s=>{const o=i[s][t];return oi[s][t]ts(i,e,n=>i[n][t]>=e);function Qa(i,t,e){let n=0,s=i.length;for(;nn&&i[s-1]>e;)s--;return n>0||s{const n="_onData"+Qn(e),s=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=s.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...o)}),r}})})}function Ps(i,t){const e=i._chartjs;if(!e)return;const n=e.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(lr.forEach(o=>{delete i[o]}),delete i._chartjs)}function cr(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const hr=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function dr(i,t){let e=[],n=!1;return function(...s){e=s,n||(n=!0,hr.call(window,()=>{n=!1,i.apply(t,e)}))}}function tl(i,t){let e;return function(...n){return t?(clearTimeout(e),e=setTimeout(i,t,n)):i.apply(this,n),t}}const es=i=>i==="start"?"left":i==="end"?"right":"center",vt=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,el=(i,t,e,n)=>i===(n?"left":"right")?e:i==="center"?(t+e)/2:t;function ur(i,t,e){const n=t.length;let s=0,o=n;if(i._sorted){const{iScale:r,_parsed:a}=i,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(s=xt(Math.min(ee(a,l,c).lo,e?n:ee(t,l,r.getPixelForValue(c)).lo),0,n-1)),u?o=xt(Math.max(ee(a,r.axis,h,!0).hi+1,e?0:ee(t,l,r.getPixelForValue(h),!0).hi+1),s,n)-s:o=n-s}return{start:s,count:o}}function fr(i){const{xScale:t,yScale:e,_scaleRanges:n}=i,s={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!n)return i._scaleRanges=s,!0;const o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==e.min||n.ymax!==e.max;return Object.assign(n,s),o}const Pi=i=>i===0||i===1,Ds=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*nt/e)),Os=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*nt/e)+1,ai={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*ft)+1,easeOutSine:i=>Math.sin(i*ft),easeInOutSine:i=>-.5*(Math.cos(st*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Pi(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Pi(i)?i:Ds(i,.075,.3),easeOutElastic:i=>Pi(i)?i:Os(i,.075,.3),easeInOutElastic(i){return Pi(i)?i:i<.5?.5*Ds(i*2,.1125,.45):.5+.5*Os(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-ai.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?ai.easeInBounce(i*2)*.5:ai.easeOutBounce(i*2-1)*.5+.5};function is(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function As(i){return is(i)?i:new di(i)}function gn(i){return is(i)?i:new di(i).saturate(.5).darken(.1).hexString()}const il=["x","y","borderWidth","radius","tension"],nl=["color","borderColor","backgroundColor"];function sl(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:nl},numbers:{type:"number",properties:il}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function ol(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ls=new Map;function rl(i,t){t=t||{};const e=i+JSON.stringify(t);let n=Ls.get(e);return n||(n=new Intl.NumberFormat(i,t),Ls.set(e,n)),n}function vi(i,t,e){return rl(t,e).format(i)}const gr={values(i){return ot(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const n=this.chart.options.locale;let s,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=al(i,e)}const r=ae(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),vi(i,n,l)},logarithmic(i,t,e){if(i===0)return"0";const n=e[t].significand||i/Math.pow(10,Math.floor(ae(i)));return[1,2,3,5,10,15].includes(n)||t>.8*e.length?gr.numeric.call(this,i,t,e):""}};function al(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var rn={formatters:gr};function ll(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:rn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ce=Object.create(null),An=Object.create(null);function li(i,t){if(!t)return i;const e=t.split(".");for(let n=0,s=e.length;nn.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=(n,s)=>gn(s.backgroundColor),this.hoverBorderColor=(n,s)=>gn(s.borderColor),this.hoverColor=(n,s)=>gn(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return pn(this,t,e)}get(t){return li(this,t)}describe(t,e){return pn(An,t,e)}override(t,e){return pn(Ce,t,e)}route(t,e,n,s){const o=li(this,t),r=li(this,n),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[s];return Y(l)?Object.assign({},c,l):$(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var rt=new cl({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[sl,ol,ll]);function hl(i){return!i||q(i.size)||q(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Qi(i,t,e,n,s){let o=t[s];return o||(o=t[s]=i.measureText(s).width,e.push(s)),o>n&&(n=o),n}function dl(i,t,e,n){n=n||{};let s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==t&&(s=n.data={},o=n.garbageCollect=[],n.font=t),i.save(),i.font=t;let r=0;const a=e.length;let l,c,h,d,u;for(l=0;le.length){for(l=0;l0&&i.stroke()}}function ie(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=s.string,gl(i,o),l=0;l+i||0;function ns(i,t){const e={},n=Y(t),s=n?Object.keys(t):t,o=Y(i)?n?r=>$(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of s)e[r]=yl(o(r));return e}function mr(i){return ns(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Me(i){return ns(i,["topLeft","topRight","bottomLeft","bottomRight"])}function wt(i){const t=mr(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function mt(i,t){i=i||{},t=t||rt.font;let e=$(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let n=$(i.style,t.style);n&&!(""+n).match(_l)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);const s={family:$(i.family,t.family),lineHeight:xl($(i.lineHeight,t.lineHeight),e),size:e,style:n,weight:$(i.weight,t.weight),string:""};return s.string=hl(s),s}function Qe(i,t,e,n){let s,o,r;for(s=0,o=i.length;se&&a===0?0:a+l;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function fe(i,t){return Object.assign(Object.create(i),t)}function ss(i,t=[""],e,n,s=()=>i[0]){const o=e||i;typeof n>"u"&&(n=yr("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:n,_getTarget:s,override:a=>ss([a,...i],t,o,n)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return _r(a,l,()=>Ol(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Es(a).includes(l)},ownKeys(a){return Es(a)},set(a,l,c){const h=a._storage||(a._storage=s());return a[l]=h[l]=c,delete a._keys,!0}})}function He(i,t,e,n){const s={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:br(i,n),setContext:o=>He(i,o,e,n),override:o=>He(i.override(o),t,e,n)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return _r(o,r,()=>wl(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function br(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=i;return{allKeys:s,scriptable:e,indexable:n,isScriptable:ue(e)?e:()=>e,isIndexable:ue(n)?n:()=>n}}const kl=(i,t)=>i?i+Qn(t):t,os=(i,t)=>Y(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function _r(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const n=e();return i[t]=n,n}function wl(i,t,e){const{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=i;let a=n[t];return ue(a)&&r.isScriptable(t)&&(a=Ml(t,a,i,e)),ot(a)&&a.length&&(a=Sl(t,a,i,r.isIndexable)),os(t,a)&&(a=He(a,s,o&&o[t],r)),a}function Ml(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||n);return a.delete(i),os(i,l)&&(l=rs(s._scopes,s,i,l)),l}function Sl(i,t,e,n){const{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&n(i))return t[o.index%t.length];if(Y(t[0])){const l=t,c=s._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=rs(c,s,i,h);t.push(He(d,o,r&&r[i],a))}}return t}function xr(i,t,e){return ue(i)?i(t,e):i}const Cl=(i,t)=>i===!0?t:typeof i=="string"?de(t,i):void 0;function Pl(i,t,e,n,s){for(const o of t){const r=Cl(e,o);if(r){i.add(r);const a=xr(r._fallback,e,s);if(typeof a<"u"&&a!==e&&a!==n)return a}else if(r===!1&&typeof n<"u"&&e!==n)return null}return!1}function rs(i,t,e,n){const s=t._rootScopes,o=xr(t._fallback,e,n),r=[...i,...s],a=new Set;a.add(n);let l=Rs(a,r,e,o||e,n);return l===null||typeof o<"u"&&o!==e&&(l=Rs(a,r,o,l,n),l===null)?!1:ss(Array.from(a),[""],s,o,()=>Dl(t,e,n))}function Rs(i,t,e,n,s){for(;e;)e=Pl(i,t,e,n,s);return e}function Dl(i,t,e){const n=i._getTarget();t in n||(n[t]={});const s=n[t];return ot(s)&&Y(e)?e:s||{}}function Ol(i,t,e,n){let s;for(const o of t)if(s=yr(kl(o,i),e),typeof s<"u")return os(i,s)?rs(e,n,i,s):s}function yr(i,t){for(const e of t){if(!e)continue;const n=e[i];if(typeof n<"u")return n}}function Es(i){let t=i._keys;return t||(t=i._keys=Al(i._scopes)),t}function Al(i){const t=new Set;for(const e of i)for(const n of Object.keys(e).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function vr(i,t,e,n){const{iScale:s}=i,{key:o="r"}=this._parsing,r=new Array(n);let a,l,c,h;for(a=0,l=n;ati==="x"?"y":"x";function Tl(i,t,e,n){const s=i.skip?t:i,o=t,r=e.skip?t:e,a=On(o,s),l=On(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=n*c,u=n*h;return{previous:{x:o.x-d*(r.x-s.x),y:o.y-d*(r.y-s.y)},next:{x:o.x+u*(r.x-s.x),y:o.y+u*(r.y-s.y)}}}function Rl(i,t,e){const n=i.length;let s,o,r,a,l,c=$e(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")Fl(i,s);else{let c=n?i[i.length-1]:i[0];for(o=0,r=i.length;oi.ownerDocument.defaultView.getComputedStyle(i,null);function Bl(i,t){return cn(i).getPropertyValue(t)}const Vl=["top","right","bottom","left"];function Se(i,t,e){const n={};e=e?"-"+e:"";for(let s=0;s<4;s++){const o=Vl[s];n[o]=parseFloat(i[t+"-"+o+e])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}const Wl=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Nl(i,t){const e=i.touches,n=e&&e.length?e[0]:i,{offsetX:s,offsetY:o}=n;let r=!1,a,l;if(Wl(s,o,i.target))a=s,l=o;else{const c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function ye(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:n}=t,s=cn(e),o=s.boxSizing==="border-box",r=Se(s,"padding"),a=Se(s,"border","width"),{x:l,y:c,box:h}=Nl(i,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/f*e.width/n),y:Math.round((c-u)/g*e.height/n)}}function Hl(i,t,e){let n,s;if(t===void 0||e===void 0){const o=i&&ls(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=cn(o),l=Se(a,"border","width"),c=Se(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,n=Ji(a.maxWidth,o,"clientWidth"),s=Ji(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:n||Zi,maxHeight:s||Zi}}const Oi=i=>Math.round(i*10)/10;function $l(i,t,e,n){const s=cn(i),o=Se(s,"margin"),r=Ji(s.maxWidth,i,"clientWidth")||Zi,a=Ji(s.maxHeight,i,"clientHeight")||Zi,l=Hl(i,t,e);let{width:c,height:h}=l;if(s.boxSizing==="content-box"){const u=Se(s,"border","width"),f=Se(s,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,n?c/n:h-o.height),c=Oi(Math.min(c,r,l.maxWidth)),h=Oi(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Oi(c/2)),(t!==void 0||e!==void 0)&&n&&l.height&&h>l.height&&(h=l.height,c=Oi(Math.floor(h*n))),{width:c,height:h}}function Fs(i,t,e){const n=t||1,s=Math.floor(i.height*n),o=Math.floor(i.width*n);i.height=Math.floor(i.height),i.width=Math.floor(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==n||r.height!==s||r.width!==o?(i.currentDevicePixelRatio=n,r.height=s,r.width=o,i.ctx.setTransform(n,0,0,n,0,0),!0):!1}const jl=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};as()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function Is(i,t){const e=Bl(i,t),n=e&&e.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function ve(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Ul(i,t,e,n){return{x:i.x+e*(t.x-i.x),y:n==="middle"?e<.5?i.y:t.y:n==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Yl(i,t,e,n){const s={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=ve(i,s,e),a=ve(s,o,e),l=ve(o,t,e),c=ve(r,a,e),h=ve(a,l,e);return ve(c,h,e)}const Xl=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,n){return e-n},leftForLtr(e,n){return e-n}}},ql=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function We(i,t,e){return i?Xl(t,e):ql()}function wr(i,t){let e,n;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,n=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=n)}function Mr(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Sr(i){return i==="angle"?{between:gi,compare:Ka,normalize:Ot}:{between:te,compare:(t,e)=>t-e,normalize:t=>t}}function zs({start:i,end:t,count:e,loop:n,style:s}){return{start:i%e,end:t%e,loop:n&&(t-i+1)%e===0,style:s}}function Kl(i,t,e){const{property:n,start:s,end:o}=e,{between:r,normalize:a}=Sr(n),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;ul(s,M,x)&&a(s,M)!==0,k=()=>a(o,x)===0||l(o,M,x),D=()=>b||C(),w=()=>!b||k();for(let m=h,_=h;m<=d;++m)y=t[m%r],!y.skip&&(x=c(y[n]),x!==M&&(b=l(x,s,o),p===null&&D()&&(p=a(x,s)===0?m:_),p!==null&&w()&&(g.push(zs({start:p,end:m,loop:u,count:r,style:f})),p=null),_=m,M=x));return p!==null&&g.push(zs({start:p,end:d,loop:u,count:r,style:f})),g}function Pr(i,t){const e=[],n=i.segments;for(let s=0;ss&&i[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Zl(i,t,e,n){const s=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%s];c.skip||c.stop?a.skip||(n=!1,o.push({start:t%s,end:(l-1)%s,loop:n}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%s,end:r%s,loop:n}),o}function Ql(i,t){const e=i.points,n=i.options.spanGaps,s=e.length;if(!s)return[];const o=!!i._loop,{start:r,end:a}=Gl(e,s,o,n);if(n===!0)return Bs(i,[{start:r,end:a,loop:o}],e,t);const l=aa({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(n-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=hr.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;const o=n.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(s.draw(),this._notify(s,n,t,"progress")),o.length||(n.running=!1,this._notify(s,n,t,"complete"),n.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let n=e.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,n)),n}listen(t,e,n){this._getAnims(t).listeners[e].push(n)}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((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const n=e.items;let s=n.length-1;for(;s>=0;--s)n[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Kt=new ec;const Ws="transparent",ic={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const n=As(i||Ws),s=n.valid&&As(t||Ws);return s&&s.valid?s.mix(n,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class nc{constructor(t,e,n,s){const o=e[n];s=Qe([t.to,s,o,t.from]);const r=Qe([t.from,o,s]);this._active=!0,this._fn=t.fn||ic[t.type||typeof r],this._easing=ai[t.easing]||ai.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=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,n){if(this._active){this._notify(!1);const s=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Qe([t.to,e,s,t.from]),this._from=Qe([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,n)=>{t.push({res:e,rej:n})})}_notify(t){const e=t?"res":"rej",n=this._promises||[];for(let s=0;s{const o=t[s];if(!Y(o))return;const r={};for(const a of e)r[a]=o[a];(ot(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,e){const n=e.options,s=oc(t,n);if(!s)return[];const o=this._createAnimations(s,n);return n.$shared&&sc(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,e){const n=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=n.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new nc(u,t,c,h),s.push(d)}return s}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const n=this._createAnimations(t,e);if(n.length)return Kt.add(this._chart,n),!0}}function sc(i,t){const e=[],n=Object.keys(t);for(let s=0;s0||!e&&o<0)return s.index}return null}function js(i,t){const{chart:e,_cachedMeta:n}=i,s=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,h=cc(o,r,n),d=t.length;let u;for(let f=0;fe[n].axis===t).shift()}function uc(i,t){return fe(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function fc(i,t,e){return fe(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Ye(i,t){const e=i.controller.index,n=i.vScale&&i.vScale.axis;if(n){t=t||i._parsed;for(const s of t){const o=s._stacks;if(!o||o[n]===void 0||o[n][e]===void 0)return;delete o[n][e],o[n]._visualValues!==void 0&&o[n]._visualValues[e]!==void 0&&delete o[n]._visualValues[e]}}}const _n=i=>i==="reset"||i==="none",Us=(i,t)=>t?i:Object.assign({},i),gc=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Or(e,!0),values:null};class Vt{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=mn(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Ye(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,n=this.getDataset(),s=(d,u,f,g)=>d==="x"?u:d==="r"?g:f,o=e.xAxisID=$(n.xAxisID,bn(t,"x")),r=e.yAxisID=$(n.yAxisID,bn(t,"y")),a=e.rAxisID=$(n.rAxisID,bn(t,"r")),l=e.indexAxis,c=e.iAxisID=s(l,o,r,a),h=e.vAxisID=s(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ps(this._data,this),t._stacked&&Ye(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),n=this._data;if(Y(e)){const s=this._cachedMeta;this._data=lc(e,s)}else if(n!==e){if(n){Ps(n,this);const s=this._cachedMeta;Ye(s),s._parsed=[]}e&&Object.isExtensible(e)&&Ja(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,n=this.getDataset();let s=!1;this._dataCheck();const o=e._stacked;e._stacked=mn(e.vScale,e),e.stack!==n.stack&&(s=!0,Ye(e),e.stack=n.stack),this._resyncElements(t),(s||o!==e._stacked)&&(js(this,e._parsed),e._stacked=mn(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:r}=n,a=o.axis;let l=t===0&&e===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],h,d,u;if(this._parsing===!1)n._parsed=s,n._sorted=!0,u=s;else{ot(s[t])?u=this.parseArrayData(n,s,t,e):Y(s[t])?u=this.parseObjectData(n,s,t,e):u=this.parsePrimitiveData(n,s,t,e);const f=()=>d[a]===null||c&&d[a]b||d=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,n=[];let s,o,r;for(s=0,o=e.length;s=0&&tthis.getContext(n,s,e),b=c.resolveNamedOptions(u,f,g,d);return b.$shared&&(b.$shared=l,o[r]=Object.freeze(Us(b,l))),b}_resolveAnimations(t,e,n){const s=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,n,e))}const c=new Dr(s,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||_n(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const n=this.resolveDataElementOptions(t,e),s=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(e,o)||o!==s;return this.updateSharedOptions(o,e,n),{sharedOptions:o,includeOptions:r}}updateElement(t,e,n,s){_n(s)?Object.assign(t,n):this._resolveAnimations(e,s).update(t,n)}updateSharedOptions(t,e,n){t&&!_n(e)&&this._resolveAnimations(void 0,e).update(t,n)}_setStyle(t,e,n,s){t.active=s;const o=this.getStyle(e,s);this._resolveAnimations(e,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,e,n){this._setStyle(t,n,"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,n=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=n.length,o=e.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;as-o))}return i._cache.$bar}function mc(i){const t=i.iScale,e=pc(t,i.type);let n=t._length,s,o,r,a;const l=()=>{r===32767||r===-32768||(fi(a)&&(n=Math.min(n,Math.abs(r-a)||n)),a=r)};for(s=0,o=e.length;s0?s[i-1]:null,a=iMath.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function Ar(i,t,e,n){return ot(i)?xc(i,t,e,n):t[e.axis]=e.parse(i,n),t}function Ys(i,t,e,n){const s=i.iScale,o=i.vScale,r=s.getLabels(),a=s===o,l=[];let c,h,d,u;for(c=e,h=e+n;c=e?1:-1)}function vc(i){let t,e,n,s,o;return i.horizontal?(t=i.base>i.x,e="left",n="right"):(t=i.baseh.controller.options.grouped),o=n.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[n.axis],c=h=>{const d=h._parsed.find(f=>f[n.axis]===l),u=d&&d[h.vScale.axis];if(q(u)||isNaN(u))return!0};for(const h of s)if(!(e!==void 0&&c(h))&&((o===!1||r.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&r.push(h.stack),h.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,n){const s=this._getStacks(t,n),o=e!==void 0?s.indexOf(e):-1;return o===-1?s.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,n=e.iScale,s=[];let o,r;for(o=0,r=e.data.length;o=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=e,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y),c=r._custom;return{label:n[t]||"",value:"("+a+", "+l+(c?", "+c:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,s),h=r.axis,d=a.axis;for(let u=e;ugi(M,a,l,!0)?1:Math.max(C,C*e,k,k*e),g=(M,C,k)=>gi(M,a,l,!0)?-1:Math.min(C,C*e,k,k*e),b=f(0,c,d),p=f(ft,h,u),x=g(st,c,d),y=g(st+ft,h,u);n=(b-x)/2,s=(p-y)/2,o=-(b+x)/2,r=-(p+y)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}class we extends Vt{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 n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(Y(n[t])){const{key:l="value"}=this._parsing;o=c=>+de(n[c],l)}let r,a;for(r=t,a=t+e;r0&&!isNaN(t)?nt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=vi(e._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const n=this.chart;let s,o,r,a,l;if(!t){for(s=0,o=n.data.datasets.length;st!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),A(we,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}}});class Ni extends Vt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=ur(e,s,r);this._drawStart=a,this._drawCount=l,fr(e)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:c},t),this.updateElements(s,a,l,t)}updateElements(t,e,n,s){const o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,s),u=r.axis,f=a.axis,{spanGaps:g,segment:b}=this.options,p=Ne(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||s==="none",y=e+n,M=t.length;let C=e>0&&this.getParsed(e-1);for(let k=0;k=y){w.skip=!0;continue}const m=this.getParsed(k),_=q(m[f]),v=w[u]=r.getPixelForValue(m[u],k),S=w[f]=o||_?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,m,l):m[f],k);w.skip=isNaN(v)||isNaN(S)||_,w.stop=k>0&&Math.abs(m[u]-C[u])>p,b&&(w.parsed=m,w.raw=c.data[k]),d&&(w.options=h||this.resolveDataElementOptions(k,D.active?"active":s)),x||this.updateElement(D,k,w,s),C=m}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,n=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return n;const o=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(n,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}A(Ni,"id","line"),A(Ni,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),A(Ni,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ci extends Vt{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=vi(e._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,e,n,s){return vr.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{const o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(oe.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,n=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(s/2,0),r=Math.max(n.cutoutPercentage?o/100*n.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,n,s){const o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*st;let f=u,g;const b=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&e++}),e}_computeAngle(t,e,n){return this.chart.getDataVisibility(t)?Bt(this.resolveDataElementOptions(t,e).angle||n):0}}A(ci,"id","polarArea"),A(ci,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),A(ci,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:n,color:s}}=t.legend.options;return e.labels.map((o,r)=>{const l=t.getDatasetMeta(0).controller.getStyle(r);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:s,lineWidth:l.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,e,n){n.chart.toggleDataVisibility(e.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Tn extends we{}A(Tn,"id","pie"),A(Tn,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Hi extends Vt{getLabelAndValue(t){const e=this._cachedMeta.vScale,n=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(n[e.axis])}}parseObjectData(t,e,n,s){return vr.bind(this)(t,e,n,s)}update(t){const e=this._cachedMeta,n=e.dataset,s=e.data||[],o=e.iScale.getLabels();if(n.points=s,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===s.length,options:r};this.updateElement(n,void 0,a,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,n,s){const o=this._cachedMeta.rScale,r=s==="reset";for(let a=e;a0&&this.getParsed(e-1);for(let C=e;C0&&Math.abs(D[f]-M[f])>x,p&&(w.parsed=D,w.raw=c.data[C]),u&&(w.options=d||this.resolveDataElementOptions(C,k.active?"active":s)),y||this.updateElement(k,C,w,s),M=D}this.updateSharedOptions(d,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!e.length)return s;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(s,o,r)/2}}A($i,"id","scatter"),A($i,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),A($i,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Cc=Object.freeze({__proto__:null,BarController:Vi,BubbleController:Wi,DoughnutController:we,LineController:Ni,PieController:Tn,PolarAreaController:ci,RadarController:Hi,ScatterController:$i});function _e(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class cs{constructor(t){A(this,"options");this.options=t||{}}static override(t){Object.assign(cs.prototype,t)}init(){}formats(){return _e()}parse(){return _e()}format(){return _e()}add(){return _e()}diff(){return _e()}startOf(){return _e()}endOf(){return _e()}}var Pc={_date:cs};function Dc(i,t,e,n){const{controller:s,data:o,_sorted:r}=i,a=s._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Za:ee;if(n){if(s._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,e-h),u=l(o,t,e+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function ki(i,t,e,n,s){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a{l[r]&&l[r](t[e],s)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:o}var Tc={evaluateInteractionItems:ki,modes:{index(i,t,e,n){const s=ye(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?yn(i,s,o,n,r):vn(i,s,o,!1,n,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,n){const s=ye(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?yn(i,s,o,n,r):vn(i,s,o,!1,n,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function Gs(i,t){return i.filter(e=>Lr.indexOf(e.pos)===-1&&e.box.axis===t)}function qe(i,t){return i.sort((e,n)=>{const s=t?n:e,o=t?e:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Rc(i){const t=[];let e,n,s,o,r,a;for(e=0,n=(i||[]).length;ec.box.fullSize),!0),n=qe(Xe(t,"left"),!0),s=qe(Xe(t,"right")),o=qe(Xe(t,"top"),!0),r=qe(Xe(t,"bottom")),a=Gs(t,"x"),l=Gs(t,"y");return{fullSize:e,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:Xe(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Zs(i,t,e,n){return Math.max(i[e],t[e])+Math.max(i[n],t[n])}function Tr(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function zc(i,t,e,n){const{pos:s,box:o}=e,r=i.maxPadding;if(!Y(s)){e.size&&(i[s]-=e.size);const d=n[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[s]+=e.size}o.getPadding&&Tr(r,o.getPadding());const a=Math.max(0,t.outerWidth-Zs(r,i,"left","right")),l=Math.max(0,t.outerHeight-Zs(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Bc(i){const t=i.maxPadding;function e(n){const s=Math.max(t[n]-i[n],0);return i[n]+=s,s}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Vc(i,t){const e=t.maxPadding;function n(s){const o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return n(i?["left","right"]:["top","bottom"])}function Je(i,t,e,n){const s=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o{typeof b.beforeLayout=="function"&&b.beforeLayout()});const h=l.reduce((b,p)=>p.box.options&&p.box.options.display===!1?b:b+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},s);Tr(u,wt(n));const f=Object.assign({maxPadding:u,w:o,h:r,x:s.left,y:s.top},s),g=Fc(l.concat(c),d);Je(a.fullSize,f,d,g),Je(l,f,d,g),Je(c,f,d,g)&&Je(l,f,d,g),Bc(f),Qs(a.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,Qs(a.rightAndBottom,f,d,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Z(a.chartArea,b=>{const p=b.box;Object.assign(p,i.chartArea),p.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Rr{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,n){}removeEventListener(t,e,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,n,s){return e=Math.max(0,e||t.width),n=n||t.height,{width:e,height:Math.max(0,s?Math.floor(e/s):n)}}isAttached(t){return!0}updateConfig(t){}}class Wc extends Rr{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ji="$chartjs",Nc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Js=i=>i===null||i==="";function Hc(i,t){const e=i.style,n=i.getAttribute("height"),s=i.getAttribute("width");if(i[ji]={initial:{height:n,width:s,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Js(s)){const o=Is(i,"width");o!==void 0&&(i.width=o)}if(Js(n))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Is(i,"height");o!==void 0&&(i.height=o)}return i}const Er=jl?{passive:!0}:!1;function $c(i,t,e){i&&i.addEventListener(t,e,Er)}function jc(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,Er)}function Uc(i,t){const e=Nc[i.type]||i.type,{x:n,y:s}=ye(i,t);return{type:e,chart:t,native:i,x:n!==void 0?n:null,y:s!==void 0?s:null}}function tn(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Yc(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||tn(a.addedNodes,n),r=r&&!tn(a.removedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}function Xc(i,t,e){const n=i.canvas,s=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||tn(a.removedNodes,n),r=r&&!tn(a.addedNodes,n);r&&e()});return s.observe(document,{childList:!0,subtree:!0}),s}const mi=new Map;let to=0;function Fr(){const i=window.devicePixelRatio;i!==to&&(to=i,mi.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function qc(i,t){mi.size||window.addEventListener("resize",Fr),mi.set(i,t)}function Kc(i){mi.delete(i),mi.size||window.removeEventListener("resize",Fr)}function Gc(i,t,e){const n=i.canvas,s=n&&ls(n);if(!s)return;const o=dr((a,l)=>{const c=s.clientWidth;e(a,l),c{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(s),qc(i,o),r}function kn(i,t,e){e&&e.disconnect(),t==="resize"&&Kc(i)}function Zc(i,t,e){const n=i.canvas,s=dr(o=>{i.ctx!==null&&e(Uc(o,i))},i);return $c(n,t,s),s}class Qc extends Rr{acquireContext(t,e){const n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Hc(t,e),n):null}releaseContext(t){const e=t.canvas;if(!e[ji])return!1;const n=e[ji].initial;["height","width"].forEach(o=>{const r=n[o];q(r)?e.removeAttribute(o):e.setAttribute(o,r)});const s=n.style||{};return Object.keys(s).forEach(o=>{e.style[o]=s[o]}),e.width=e.width,delete e[ji],!0}addEventListener(t,e,n){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),r={attach:Yc,detach:Xc,resize:Gc}[e]||Zc;s[e]=r(t,e,n)}removeEventListener(t,e){const n=t.$proxies||(t.$proxies={}),s=n[e];if(!s)return;({attach:kn,detach:kn,resize:kn}[e]||jc)(t,e,s),n[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,n,s){return $l(t,e,n,s)}isAttached(t){const e=t&&ls(t);return!!(e&&e.isConnected)}}function Jc(i){return!as()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Wc:Qc}class Wt{constructor(){A(this,"x");A(this,"y");A(this,"active",!1);A(this,"options");A(this,"$animations")}tooltipPosition(t){const{x:e,y:n}=this.getProps(["x","y"],t);return{x:e,y:n}}hasValue(){return Ne(this.x)&&Ne(this.y)}getProps(t,e){const n=this.$animations;if(!e||!n)return this;const s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}}A(Wt,"defaults",{}),A(Wt,"defaultRoutes");function th(i,t){const e=i.options.ticks,n=eh(i),s=Math.min(e.maxTicksLimit||n,n),o=e.major.enabled?nh(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return sh(t,c,o,r/s),c;const h=ih(o,t,s);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(Li(t,c,h,q(f)?0:a-f,a),d=0,u=r-1;ds)return l}return Math.max(s,1)}function nh(i){const t=[];let e,n;for(e=0,n=i.length;ei==="left"?"right":i==="right"?"left":i,eo=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,io=(i,t)=>Math.min(t||i,i);function no(i,t){const e=[],n=i.length/t,s=i.length;let o=0;for(;or+a)))return l}function lh(i,t){Z(i,e=>{const n=e.gc,s=n.length/2;let o;if(s>t){for(o=0;on?n:e,n=s&&e>n?e:n,{min:Dt(e,Dt(n,e)),max:Dt(n,Dt(e,n))}}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(){tt(this.options.beforeUpdate,[this])}update(t,e,n){const{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=vl(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=xt(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/n:f/(n-1),d+6>a&&(a=f/(n-(t.offset?.5:1)),l=this.maxHeight-Ke(t.grid)-e.padding-so(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=Jn(Math.min(Math.asin(xt((h.highest.height+6)/a,-1,1)),Math.asin(xt(l/c,-1,1))-Math.asin(xt(u/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){tt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){tt(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=so(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ke(o)+l):(t.height=this.maxHeight,t.width=Ke(o)+l),n.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=n.padding*2,g=Bt(this.labelRotation),b=Math.cos(g),p=Math.sin(g);if(a){const x=n.mirror?0:p*d.width+b*u.height;t.height=Math.min(this.maxHeight,t.height+x+f)}else{const x=n.mirror?0:b*d.width+p*u.height;t.width=Math.min(this.maxWidth,t.width+x+f)}this._calculatePadding(c,h,p,b)}}this._handleMargins(),a?(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,n,s){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=s*t.width,f=n*e.height):(u=n*t.height,f=s*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_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(){tt(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,n;for(e=0,n=t.length;e({width:r[_]||0,height:a[_]||0});return{first:m(0),last:m(e-1),widest:m(D),highest:m(w),widths:r,heights:a}}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 Ga(this._alignToPixels?be(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&&ta*s?a/n:l/s:l*s0}_computeGridLineItems(t){const e=this.axis,n=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=Ke(o),f=[],g=a.setContext(this.getContext()),b=g.display?g.width:0,p=b/2,x=function(B){return be(n,B,b)};let y,M,C,k,D,w,m,_,v,S,P,E;if(r==="top")y=x(this.bottom),w=this.bottom-u,_=y-p,S=x(t.top)+p,E=t.bottom;else if(r==="bottom")y=x(this.top),S=t.top,E=x(t.bottom)-p,w=y+p,_=this.top+u;else if(r==="left")y=x(this.right),D=this.right-u,m=y-p,v=x(t.left)+p,P=t.right;else if(r==="right")y=x(this.left),v=t.left,P=x(t.right)-p,D=y+p,m=this.left+u;else if(e==="x"){if(r==="center")y=x((t.top+t.bottom)/2+.5);else if(Y(r)){const B=Object.keys(r)[0],L=r[B];y=x(this.chart.scales[B].getPixelForValue(L))}S=t.top,E=t.bottom,w=y+p,_=w+u}else if(e==="y"){if(r==="center")y=x((t.left+t.right)/2);else if(Y(r)){const B=Object.keys(r)[0],L=r[B];y=x(this.chart.scales[B].getPixelForValue(L))}D=y-p,m=D-u,v=t.left,P=t.right}const I=$(s.ticks.maxTicksLimit,d),z=Math.max(1,Math.ceil(d/I));for(M=0;M0&&(X-=j/2);break}et={left:X,top:H,width:j+T.width,height:N+T.height,color:z.backdropColor}}p.push({label:C,font:_,textOffset:P,options:{rotation:b,color:L,strokeColor:U,strokeWidth:R,textAlign:dt,textBaseline:E,translation:[k,D],backdrop:et}})}return p}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-Bt(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?s?(h=this.right+o,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?s?(h=this.left+o,n==="near"?c="right":n==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,n==="near"?c="left":n==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:n,top:s,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(n,s,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const s=this.ticks.findIndex(o=>o.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const e=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(n.save(),n.lineWidth=h.width,n.strokeStyle=h.color,n.setLineDash(h.borderDash||[]),n.lineDashOffset=h.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(e.display)for(o=0,r=s.length;o{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[];let o,r;for(o=0,r=e.length;o{const n=e.split("."),s=n.pop(),o=[i].concat(n).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");rt.route(o,s,l,a)})}function ph(i){return"id"in i&&"defaults"in i}class mh{constructor(){this.controllers=new Ti(Vt,"datasets",!0),this.elements=new Ti(Wt,"elements"),this.plugins=new Ti(Object,"plugins"),this.scales=new Ti(Ae,"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,n){[...e].forEach(s=>{const o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):Z(s,r=>{const a=n||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,n){const s=Qn(t);tt(n["before"+s],[],n),e[t](n),tt(n["after"+s],[],n)}_getRegistryForType(t){for(let e=0;eo.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(e,n),t,"stop"),this._notify(s(n,e),t,"start")}}function _h(i){const t={},e=[],n=Object.keys($t.plugins.items);for(let o=0;o1&&oo(i[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function ro(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Sh(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(n=>n.xAxisID===i||n.yAxisID===i);if(e.length)return ro(i,"x",e[0])||ro(i,"y",e[0])}return{}}function Ch(i,t){const e=Ce[i.type]||{scales:{}},n=t.scales||{},s=Rn(i.type,t),o=Object.create(null);return Object.keys(n).forEach(r=>{const a=n[r];if(!Y(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=En(r,a,Sh(r,i),rt.scales[a.type]),c=wh(l,s),h=e.scales||{};o[r]=oi(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||Rn(a,t),h=(Ce[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=kh(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),oi(o[f],[{axis:u},n[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];oi(a,[rt.scales[a.type],rt.scale])}),o}function Ir(i){const t=i.options||(i.options={});t.plugins=$(t.plugins,{}),t.scales=Ch(i,t)}function zr(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Ph(i){return i=i||{},i.data=zr(i.data),Ir(i),i}const ao=new Map,Br=new Set;function Ri(i,t){let e=ao.get(i);return e||(e=t(),ao.set(i,e),Br.add(e)),e}const Ge=(i,t,e)=>{const n=de(t,e);n!==void 0&&i.add(n)};class Dh{constructor(t){this._config=Ph(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=zr(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(),Ir(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Ri(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return Ri(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return Ri(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,n=this.type;return Ri(`${n}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const n=this._scopeCache;let s=n.get(t);return(!s||e)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,e,n){const{options:s,type:o}=this,r=this._cachedScopes(t,n),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Ge(l,t,d))),h.forEach(d=>Ge(l,s,d)),h.forEach(d=>Ge(l,Ce[o]||{},d)),h.forEach(d=>Ge(l,rt,d)),h.forEach(d=>Ge(l,An,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Br.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ce[e]||{},rt.datasets[e]||{},{type:e},rt,An]}resolveNamedOptions(t,e,n,s=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=lo(this._resolverCache,t,s);let l=r;if(Ah(r,e)){o.$shared=!1,n=ue(n)?n():n;const c=this.createResolver(t,n,a);l=He(r,n,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,n=[""],s){const{resolver:o}=lo(this._resolverCache,t,n);return Y(e)?He(o,e,void 0,s):o}}function lo(i,t,e){let n=i.get(t);n||(n=new Map,i.set(t,n));const s=e.join();let o=n.get(s);return o||(o={resolver:ss(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}const Oh=i=>Y(i)&&Object.getOwnPropertyNames(i).some(t=>ue(i[t]));function Ah(i,t){const{isScriptable:e,isIndexable:n}=br(i);for(const s of t){const o=e(s),r=n(s),a=(r||o)&&i[s];if(o&&(ue(a)||Oh(a))||r&&ot(a))return!0}return!1}var Lh="4.4.5";const Th=["top","bottom","left","right","chartArea"];function co(i,t){return i==="top"||i==="bottom"||Th.indexOf(i)===-1&&t==="x"}function ho(i,t){return function(e,n){return e[i]===n[i]?e[t]-n[t]:e[i]-n[i]}}function uo(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),tt(e&&e.onComplete,[i],t)}function Rh(i){const t=i.chart,e=t.options.animation;tt(e&&e.onProgress,[i],t)}function Vr(i){return as()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Ui={},fo=i=>{const t=Vr(i);return Object.values(Ui).filter(e=>e.canvas===t).pop()};function Eh(i,t,e){const n=Object.keys(i);for(const s of n){const o=+s;if(o>=t){const r=i[s];delete i[s],(e>0||o>t)&&(i[o+e]=r)}}}function Fh(i,t,e,n){return!e||i.type==="mouseout"?null:n?t:i}function Ei(i,t,e){return i.options.clip?i[e]:t[e]}function Ih(i,t){const{xScale:e,yScale:n}=i;return e&&n?{left:Ei(e,t,"left"),right:Ei(e,t,"right"),top:Ei(n,t,"top"),bottom:Ei(n,t,"bottom")}:t}class Qt{static register(...t){$t.add(...t),go()}static unregister(...t){$t.remove(...t),go()}constructor(t,e){const n=this.config=new Dh(e),s=Vr(t),o=fo(s);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||Jc(s)),this.platform.updateConfig(n);const a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Ba(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,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=tl(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Ui[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Kt.listen(this,"complete",uo),Kt.listen(this,"progress",Rh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:n,height:s,_aspectRatio:o}=this;return q(t)?e&&o?o:s?n/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return $t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Fs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ts(this.canvas,this.ctx),this}stop(){return Kt.stop(this),this}resize(t,e){Kt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,e,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Fs(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),tt(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};Z(e,(n,s)=>{n.id=s})}buildOrUpdateScales(){const t=this.options,e=t.scales,n=this.scales,s=Object.keys(n).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=En(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),Z(o,r=>{const a=r.options,l=a.id,c=En(l,a),h=$(a.type,r.dtype);(a.position===void 0||co(a.position,c)!==co(r.dposition))&&(a.position=r.dposition),s[l]=!0;let d=null;if(l in n&&n[l].type===h)d=n[l];else{const u=$t.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),n[d.id]=d}d.init(a,t)}),Z(s,(r,a)=>{r||delete n[a]}),Z(n,r=>{kt.configure(this,r,r.options),kt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>e){for(let s=e;se.length&&delete this._stacks,t.forEach((n,s)=>{e.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let n,s;for(this._removeUnreferencedMetasets(),n=0,s=e.length;n{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const n=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ho("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Z(this.scales,t=>{kt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!ws(e,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:n,start:s,count:o}of e){const r=n==="_removeElements"?-o:o;Eh(t,s,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,n=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),s=n(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;kt.update(this,this.width,this.height,t);const e=this.chartArea,n=e.width<=0||e.height<=0;this._layers=[],Z(this.boxes,s=>{n&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,o)=>{s._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,n=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,n=t._clip,s=!n.disabled,o=Ih(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&an(e,{left:n.left===!1?0:o.left-n.left,right:n.right===!1?this.width:o.right+n.right,top:n.top===!1?0:o.top-n.top,bottom:n.bottom===!1?this.height:o.bottom+n.bottom}),t.controller.draw(),s&&ln(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ie(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,n,s){const o=Tc.modes[e];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],n=this._metasets;let s=n.filter(o=>o&&o._dataset===e).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=fe(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!e.hidden}setDatasetVisibility(t,e){const n=this.getDatasetMeta(t);n.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,n){const s=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);fi(e)?(o.data[e].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),Kt.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};Z(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,n=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{s("attach",a),this.attached=!0,this.resize(),n("resize",o),n("detach",r)};r=()=>{this.attached=!1,s("resize",o),this._stop(),this._resize(0,0),n("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){Z(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},Z(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,n){const s=n?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Ki(n,e)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,e))}notifyPlugins(t,e,n){return this._plugins.notify(this,t,e,n)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,n){const s=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=n?t:o(t,e);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const n={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},s=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,s)===!1)return;const o=this._handleEvent(t,e,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,e,n){const{_active:s=[],options:o}=this,r=e,a=this._getActiveElements(t,s,n,r),l=ja(t),c=Fh(t,this._lastEvent,n,l);n&&(this._lastEvent=null,tt(o.onHover,[t,a,this],this),l&&tt(o.onClick,[t,a,this],this));const h=!Ki(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=c,h}_getActiveElements(t,e,n,s){if(t.type==="mouseout")return[];if(!n)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}}A(Qt,"defaults",rt),A(Qt,"instances",Ui),A(Qt,"overrides",Ce),A(Qt,"registry",$t),A(Qt,"version",Lh),A(Qt,"getChart",fo);function go(){return Z(Qt.instances,i=>i._plugins.invalidate())}function zh(i,t,e){const{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=s/a;i.beginPath(),i.arc(o,r,a,n-c,e+c),l>s?(c=s/l,i.arc(o,r,l,e+c,n-c,!0)):i.arc(o,r,s,e+ft,n-ft),i.closePath(),i.clip()}function Bh(i){return ns(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Vh(i,t,e,n){const s=Bh(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,n*t/2),a=l=>{const c=(e-Math.min(o,l))*n/2;return xt(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:xt(s.innerStart,0,r),innerEnd:xt(s.innerEnd,0,r)}}function Fe(i,t,e,n){return{x:e+i*Math.cos(t),y:n+i*Math.sin(t)}}function en(i,t,e,n,s,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+n+e-c,0),u=h>0?h+n+e+c:0;let f=0;const g=s-l;if(n){const z=h>0?h-n:0,B=d>0?d-n:0,L=(z+B)/2,U=L!==0?g*L/(L+n):g;f=(g-U)/2}const b=Math.max(.001,g*d-e/st)/d,p=(g-b)/2,x=l+p+f,y=s-p-f,{outerStart:M,outerEnd:C,innerStart:k,innerEnd:D}=Vh(t,u,d,y-x),w=d-M,m=d-C,_=x+M/w,v=y-C/m,S=u+k,P=u+D,E=x+k/S,I=y-D/P;if(i.beginPath(),o){const z=(_+v)/2;if(i.arc(r,a,d,_,z),i.arc(r,a,d,z,v),C>0){const R=Fe(m,v,r,a);i.arc(R.x,R.y,C,v,y+ft)}const B=Fe(P,y,r,a);if(i.lineTo(B.x,B.y),D>0){const R=Fe(P,I,r,a);i.arc(R.x,R.y,D,y+ft,I+Math.PI)}const L=(y-D/u+(x+k/u))/2;if(i.arc(r,a,u,y-D/u,L,!0),i.arc(r,a,u,L,x+k/u,!0),k>0){const R=Fe(S,E,r,a);i.arc(R.x,R.y,k,E+Math.PI,x-ft)}const U=Fe(w,x,r,a);if(i.lineTo(U.x,U.y),M>0){const R=Fe(w,_,r,a);i.arc(R.x,R.y,M,x-ft,_)}}else{i.moveTo(r,a);const z=Math.cos(_)*d+r,B=Math.sin(_)*d+a;i.lineTo(z,B);const L=Math.cos(v)*d+r,U=Math.sin(v)*d+a;i.lineTo(L,U)}i.closePath()}function Wh(i,t,e,n,s){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){en(i,t,e,n,l,s);for(let c=0;c=nt||b,x=te(a,h+f,d+f);return p&&x}getCenterPoint(e){const{x:n,y:s,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,d=(o+r)/2,u=(a+l+h+c)/2;return{x:n+Math.cos(d)*u,y:s+Math.sin(d)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:n,circumference:s}=this,o=(n.offset||0)/4,r=(n.spacing||0)/2,a=n.circular;if(this.pixelMargin=n.borderAlign==="inner"?.33:0,this.fullCircles=s>nt?Math.floor(s/nt):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(st,s||0)),h=o*c;e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,Wh(e,this,h,r,a),Nh(e,this,h,r,a),e.restore()}}A(ti,"id","arc"),A(ti,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0}),A(ti,"defaultRoutes",{backgroundColor:"backgroundColor"}),A(ti,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Wr(i,t,e=t){i.lineCap=$(e.borderCapStyle,t.borderCapStyle),i.setLineDash($(e.borderDash,t.borderDash)),i.lineDashOffset=$(e.borderDashOffset,t.borderDashOffset),i.lineJoin=$(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=$(e.borderWidth,t.borderWidth),i.strokeStyle=$(e.borderColor,t.borderColor)}function Hh(i,t,e){i.lineTo(e.x,e.y)}function $h(i){return i.stepped?ul:i.tension||i.cubicInterpolationMode==="monotone"?fl:Hh}function Nr(i,t,e={}){const n=i.length,{start:s=0,end:o=n-1}=e,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),h=sa&&o>a;return{count:n,start:l,loop:t.loop,ilen:c(r+(c?a-C:C))%o,M=()=>{b!==p&&(i.lineTo(h,p),i.lineTo(h,b),i.lineTo(h,x))};for(l&&(f=s[y(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=s[y(u)],f.skip)continue;const C=f.x,k=f.y,D=C|0;D===g?(kp&&(p=k),h=(d*h+C)/++d):(M(),i.lineTo(C,k),g=D,d=0,b=p=k),x=k}M()}function Fn(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Uh:jh}function Yh(i){return i.stepped?Ul:i.tension||i.cubicInterpolationMode==="monotone"?Yl:ve}function Xh(i,t,e,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,e,n)&&s.closePath()),Wr(i,t.options),i.stroke(s)}function qh(i,t,e,n){const{segments:s,options:o}=t,r=Fn(t);for(const a of s)Wr(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+n-1})&&i.closePath(),i.stroke()}const Kh=typeof Path2D=="function";function Gh(i,t,e,n){Kh&&!t.options.segment?Xh(i,t,e,n):qh(i,t,e,n)}class le extends Wt{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 n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){const s=n.spanGaps?this._loop:this._fullLoop;zl(this._points,n,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ql(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,n=t.length;return n&&e[t[n-1].end]}interpolate(t,e){const n=this.options,s=t[e],o=this.points,r=Pr(this,{property:e,start:s,end:s});if(!r.length)return;const a=[],l=Yh(n);let c,h;for(c=0,h=r.length;ct!=="borderDash"&&t!=="fill"});function po(i,t,e,n){const s=i.options,{[e]:o}=i.getProps([e],n);return Math.abs(t-o)i.replace("rgb(","rgba(").replace(")",", 0.5)"));function $r(i){return In[i%In.length]}function jr(i){return mo[i%mo.length]}function nd(i,t){return i.borderColor=$r(t),i.backgroundColor=jr(t),++t}function sd(i,t){return i.backgroundColor=i.data.map(()=>$r(t++)),t}function od(i,t){return i.backgroundColor=i.data.map(()=>jr(t++)),t}function rd(i){let t=0;return(e,n)=>{const s=i.getDatasetMeta(n).controller;s instanceof we?t=sd(e,t):s instanceof ci?t=od(e,t):s&&(t=nd(e,t))}}function bo(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}function ad(i){return i&&(i.borderColor||i.backgroundColor)}function ld(){return rt.borderColor!=="rgba(0,0,0,0.1)"||rt.backgroundColor!=="rgba(0,0,0,0.1)"}var cd={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;const{data:{datasets:n},options:s}=i.config,{elements:o}=s,r=bo(n)||ad(s)||o&&bo(o)||ld();if(!e.forceOverride&&r)return;const a=rd(i);n.forEach(a)}};function hd(i,t,e,n,s){const o=s.samples||n;if(o>=e)return i.slice(t,t+e);const r=[],a=(e-2)/(o-2);let l=0;const c=t+e-1;let h=t,d,u,f,g,b;for(r[l++]=i[h],d=0;df&&(f=g,u=i[y],b=y);r[l++]=u,h=b}return r[l++]=i[c],r}function dd(i,t,e,n){let s=0,o=0,r,a,l,c,h,d,u,f,g,b;const p=[],x=t+e-1,y=i[t].x,C=i[x].x-y;for(r=t;rb&&(b=c,u=r),s=(o*s+a.x)/++o;else{const D=r-1;if(!q(d)&&!q(u)){const w=Math.min(d,u),m=Math.max(d,u);w!==f&&w!==D&&p.push({...i[w],x:s}),m!==f&&m!==D&&p.push({...i[m],x:s})}r>0&&D!==f&&p.push(i[D]),p.push(a),h=k,o=0,g=b=c,d=u=f=r}}return p}function Ur(i){if(i._decimated){const t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function _o(i){i.data.datasets.forEach(t=>{Ur(t)})}function ud(i,t){const e=t.length;let n=0,s;const{iScale:o}=i,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=xt(ee(t,o.axis,r).lo,0,e-1)),c?s=xt(ee(t,o.axis,a).hi+1,n,e)-n:s=e-n,{start:n,count:s}}var fd={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled){_o(i);return}const n=i.width;i.data.datasets.forEach((s,o)=>{const{_data:r,indexAxis:a}=s,l=i.getDatasetMeta(o),c=r||s.data;if(Qe([a,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const h=i.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||i.options.parsing)return;let{start:d,count:u}=ud(l,c);const f=e.threshold||4*n;if(u<=f){Ur(s);return}q(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(b){this._data=b}}));let g;switch(e.algorithm){case"lttb":g=hd(c,d,u,n,e);break;case"min-max":g=dd(c,d,u,n);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}s._decimated=g})},destroy(i){_o(i)}};function gd(i,t,e){const n=i.segments,s=i.points,o=t.points,r=[];for(const a of n){let{start:l,end:c}=a;c=hs(l,c,s);const h=zn(e,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:s[l],end:s[c]});continue}const d=Pr(t,h);for(const u of d){const f=zn(e,o[u.start],o[u.end],u.loop),g=Cr(a,s,f);for(const b of g)r.push({source:b,target:u,start:{[e]:xo(h,f,"start",Math.max)},end:{[e]:xo(h,f,"end",Math.min)}})}}return r}function zn(i,t,e,n){if(n)return;let s=t[i],o=e[i];return i==="angle"&&(s=Ot(s),o=Ot(o)),{property:i,start:s,end:o}}function pd(i,t){const{x:e=null,y:n=null}=i||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=hs(r,a,s);const l=s[r],c=s[a];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function hs(i,t,e){for(;t>i;t--){const n=e[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function xo(i,t,e,n){return i&&t?n(i[e],t[e]):i?i[e]:t?t[e]:0}function Yr(i,t){let e=[],n=!1;return ot(i)?(n=!0,e=i):e=pd(i,t),e.length?new le({points:e,options:{tension:0},_loop:n,_fullLoop:n}):null}function yo(i){return i&&i.fill!==!1}function md(i,t,e){let s=i[t].fill;const o=[t];let r;if(!e)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!ht(s))return s;if(r=i[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function bd(i,t,e){const n=vd(i);if(Y(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return ht(s)&&Math.floor(s)===s?_d(n[0],t,s,e):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function _d(i,t,e,n){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=n?!1:e}function xd(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:Y(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function yd(i,t,e){let n;return i==="start"?n=e:i==="end"?n=t.options.reverse?t.min:t.max:Y(i)?n=i.value:n=t.getBaseValue(),n}function vd(i){const t=i.options,e=t.fill;let n=$(e&&e.target,e);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function kd(i){const{scale:t,index:e,line:n}=i,s=[],o=n.segments,r=n.points,a=wd(t,e);a.push(Yr({x:null,y:t.bottom},n));for(let l=0;l=0;--r){const a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),n&&a.fill&&Sn(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const n=i.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){const o=n[s].$filler;yo(o)&&Sn(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const n=t.meta.$filler;!yo(n)||e.drawTime!=="beforeDatasetDraw"||Sn(i.ctx,n,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Mo=(i,t)=>{let{boxHeight:e=t,boxWidth:n=t}=i;return i.usePointStyle&&(e=Math.min(e,t),n=i.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:e,itemHeight:Math.max(t,e)}},Ed=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class So extends Wt{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,n){this.maxWidth=t,this.maxHeight=e,this._margins=n,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=tt(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(n=>t.filter(n,this.chart.data))),t.sort&&(e=e.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const n=t.labels,s=mt(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Mo(n,o);let c,h;e.font=s.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,n,s){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=s+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,b)=>{const p=n+e/2+o.measureText(g.text).width;(b===0||c[c.length-1]+p+2*a>r)&&(d+=h,c[c.length-(b>0?0:1)]=0,f+=h,u++),l[b]={left:0,top:f,row:u,width:p,height:s},c[c.length-1]+=p+a}),d}_fitCols(t,e,n,s){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,g=0,b=0;return this.legendItems.forEach((p,x)=>{const{itemWidth:y,itemHeight:M}=Fd(n,e,o,p,s);x>0&&f+M+2*a>h&&(d+=u+a,c.push({width:u,height:f}),g+=u+a,b++,u=f=0),l[x]={left:g,top:f,col:b,width:y,height:M},u=Math.max(u,y),f+=M+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:n,labels:{padding:s},rtl:o}}=this,r=We(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=vt(n,this.left+s,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=vt(n,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+s}else{let a=0,l=vt(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=vt(n,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;an(t,this),this._draw(),ln(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,a=rt.color,l=We(t.rtl,this.left,this.width),c=mt(r.font),{padding:h}=r,d=c.size,u=d/2;let f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:g,boxHeight:b,itemHeight:p}=Mo(r,d),x=function(D,w,m){if(isNaN(g)||g<=0||isNaN(b)||b<0)return;s.save();const _=$(m.lineWidth,1);if(s.fillStyle=$(m.fillStyle,a),s.lineCap=$(m.lineCap,"butt"),s.lineDashOffset=$(m.lineDashOffset,0),s.lineJoin=$(m.lineJoin,"miter"),s.lineWidth=_,s.strokeStyle=$(m.strokeStyle,a),s.setLineDash($(m.lineDash,[])),r.usePointStyle){const v={radius:b*Math.SQRT2/2,pointStyle:m.pointStyle,rotation:m.rotation,borderWidth:_},S=l.xPlus(D,g/2),P=w+u;pr(s,v,S,P,r.pointStyleWidth&&g)}else{const v=w+Math.max((d-b)/2,0),S=l.leftForLtr(D,g),P=Me(m.borderRadius);s.beginPath(),Object.values(P).some(E=>E!==0)?pi(s,{x:S,y:v,w:g,h:b,radius:P}):s.rect(S,v,g,b),s.fill(),_!==0&&s.stroke()}s.restore()},y=function(D,w,m){Pe(s,m.text,D,w+p/2,c,{strikethrough:m.hidden,textAlign:l.textAlign(m.textAlign)})},M=this.isHorizontal(),C=this._computeTitleHeight();M?f={x:vt(o,this.left+h,this.right-n[0]),y:this.top+h+C,line:0}:f={x:this.left+h,y:vt(o,this.top+C+h,this.bottom-e[0].height),line:0},wr(this.ctx,t.textDirection);const k=p+h;this.legendItems.forEach((D,w)=>{s.strokeStyle=D.fontColor,s.fillStyle=D.fontColor;const m=s.measureText(D.text).width,_=l.textAlign(D.textAlign||(D.textAlign=r.textAlign)),v=g+u+m;let S=f.x,P=f.y;l.setWidth(this.width),M?w>0&&S+v+h>this.right&&(P=f.y+=k,f.line++,S=f.x=vt(o,this.left+h,this.right-n[f.line])):w>0&&P+k>this.bottom&&(S=f.x=S+e[f.line].width+h,f.line++,P=f.y=vt(o,this.top+C+h,this.bottom-e[f.line].height));const E=l.x(S);if(x(E,P,D),S=el(_,S+g+u,M?S+v:this.right,t.rtl),y(l.x(S),P,D),M)f.x+=v+h;else if(typeof D.text!="string"){const I=c.lineHeight;f.y+=qr(D,I)+h}else f.y+=k}),Mr(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,n=mt(e.font),s=wt(e.padding);if(!e.display)return;const o=We(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=n.size/2,c=s.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=vt(t.align,d,this.right-u);else{const g=this.columnSizes.reduce((b,p)=>Math.max(b,p.height),0);h=c+vt(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=vt(a,d,d+u);r.textAlign=o.textAlign(es(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=n.string,Pe(r,e.text,f,h,n)}_computeTitleHeight(){const t=this.options.title,e=mt(t.font),n=wt(t.padding);return t.display?e.lineHeight+n.height:0}_getLegendItemAt(t,e){let n,s,o;if(te(t,this.left,this.right)&&te(e,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;no.length>r.length?o:r)),t+e.size/2+n.measureText(s).width}function zd(i,t,e){let n=i;return typeof t.text!="string"&&(n=qr(t,e)),n}function qr(i,t){const e=i.text?i.text.length:0;return t*e}function Bd(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var Vd={id:"legend",_element:So,start(i,t,e){const n=i.legend=new So({ctx:i.ctx,options:e,chart:i});kt.configure(i,n,e),kt.addBox(i,n)},stop(i){kt.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const n=i.legend;kt.configure(i,n,e),n.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const n=t.datasetIndex,s=e.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=wt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:n||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class ds extends Wt{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 n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const s=ot(n.text)?n.text.length:1;this._padding=wt(n.padding);const o=s*mt(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:n,bottom:s,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=vt(a,n,o),d=e+t,c=o-n):(r.position==="left"?(h=n+t,d=vt(a,s,e),l=st*-.5):(h=o-t,d=vt(a,e,s),l=st*.5),c=s-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const n=mt(e.font),o=n.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Pe(t,e.text,0,0,n,{color:e.color,maxWidth:l,rotation:c,textAlign:es(e.align),textBaseline:"middle",translation:[r,a]})}}function Wd(i,t){const e=new ds({ctx:i.ctx,options:t,chart:i});kt.configure(i,e,t),kt.addBox(i,e),i.titleBlock=e}var Nd={id:"title",_element:ds,start(i,t,e){Wd(i,e)},stop(i){const t=i.titleBlock;kt.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const n=i.titleBlock;kt.configure(i,n,e),n.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 Fi=new WeakMap;var Hd={id:"subtitle",start(i,t,e){const n=new ds({ctx:i.ctx,options:e,chart:i});kt.configure(i,n,e),kt.addBox(i,n),Fi.set(i,n)},stop(i){kt.removeBox(i,Fi.get(i)),Fi.delete(i)},beforeUpdate(i,t,e){const n=Fi.get(i);kt.configure(i,n,e),n.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 ei={average(i){if(!i.length)return!1;let t,e,n=new Set,s=0,o=0;for(t=0,e=i.length;ta+l)/n.size,y:s/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o-1?i.split(` -`):i}function $d(i,t){const{element:e,datasetIndex:n,index:s}=t,o=i.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:i,label:r,parsed:o.getParsed(s),raw:i.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:e}}function Co(i,t){const e=i.chart.ctx,{body:n,footer:s,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=mt(t.bodyFont),c=mt(t.titleFont),h=mt(t.footerFont),d=o.length,u=s.length,f=n.length,g=wt(t.padding);let b=g.height,p=0,x=n.reduce((C,k)=>C+k.before.length+k.lines.length+k.after.length,0);if(x+=i.beforeBody.length+i.afterBody.length,d&&(b+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const C=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=f*C+(x-f)*l.lineHeight+(x-1)*t.bodySpacing}u&&(b+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const M=function(C){p=Math.max(p,e.measureText(C).width+y)};return e.save(),e.font=c.string,Z(i.title,M),e.font=l.string,Z(i.beforeBody.concat(i.afterBody),M),y=t.displayColors?r+2+t.boxPadding:0,Z(n,C=>{Z(C.before,M),Z(C.lines,M),Z(C.after,M)}),y=0,e.font=h.string,Z(i.footer,M),e.restore(),p+=g.width,{width:p,height:b}}function jd(i,t){const{y:e,height:n}=t;return ei.height-n/2?"bottom":"center"}function Ud(i,t,e,n){const{x:s,width:o}=n,r=e.caretSize+e.caretPadding;if(i==="left"&&s+o+r>t.width||i==="right"&&s-o-r<0)return!0}function Yd(i,t,e,n){const{x:s,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Ud(c,i,t,e)&&(c="center"),c}function Po(i,t,e){const n=e.yAlign||t.yAlign||jd(i,e);return{xAlign:e.xAlign||t.xAlign||Yd(i,t,e,n),yAlign:n}}function Xd(i,t){let{x:e,width:n}=i;return t==="right"?e-=n:t==="center"&&(e-=n/2),e}function qd(i,t,e){let{y:n,height:s}=i;return t==="top"?n+=e:t==="bottom"?n-=s+e:n-=s/2,n}function Do(i,t,e,n){const{caretSize:s,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=s+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Me(r);let g=Xd(t,a);const b=qd(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,u)+s:a==="right"&&(g+=Math.max(d,f)+s),{x:xt(g,0,n.width-t.width),y:xt(b,0,n.height-t.height)}}function Ii(i,t,e){const n=wt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-n.right:i.x+n.left}function Oo(i){return Ht([],Gt(i))}function Kd(i,t,e){return fe(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ao(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const Kr={beforeTitle:qt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,n=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex"u"?Kr[t].call(e,n):s}class Bn extends Wt{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,n=this.options.setContext(this.getContext()),s=n.enabled&&e.options.animation&&n.animations,o=new Dr(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Kd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:n}=e,s=St(n,"beforeTitle",this,t),o=St(n,"title",this,t),r=St(n,"afterTitle",this,t);let a=[];return a=Ht(a,Gt(s)),a=Ht(a,Gt(o)),a=Ht(a,Gt(r)),a}getBeforeBody(t,e){return Oo(St(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:n}=e,s=[];return Z(t,o=>{const r={before:[],lines:[],after:[]},a=Ao(n,o);Ht(r.before,Gt(St(a,"beforeLabel",this,o))),Ht(r.lines,St(a,"label",this,o)),Ht(r.after,Gt(St(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,e){return Oo(St(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:n}=e,s=St(n,"beforeFooter",this,t),o=St(n,"footer",this,t),r=St(n,"afterFooter",this,t);let a=[];return a=Ht(a,Gt(s)),a=Ht(a,Gt(o)),a=Ht(a,Gt(r)),a}_createItems(t){const e=this._active,n=this.chart.data,s=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,d,u,n))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,n))),Z(a,h=>{const d=Ao(t.callbacks,h);s.push(St(d,"labelColor",this,h)),o.push(St(d,"labelPointStyle",this,h)),r.push(St(d,"labelTextColor",this,h))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const n=this.options.setContext(this.getContext()),s=this._active;let o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{const a=ei[n.position].call(this,s,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);const l=this._size=Co(this,n),c=Object.assign({},a,l),h=Po(this.chart,n,c),d=Do(n,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,n,s){const o=this.getCaretPosition(t,n,s);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,n){const{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Me(a),{x:u,y:f}=t,{width:g,height:b}=e;let p,x,y,M,C,k;return o==="center"?(C=f+b/2,s==="left"?(p=u,x=p-r,M=C+r,k=C-r):(p=u+g,x=p+r,M=C-r,k=C+r),y=p):(s==="left"?x=u+Math.max(l,h)+r:s==="right"?x=u+g-Math.max(c,d)-r:x=this.caretX,o==="top"?(M=f,C=M-r,p=x-r,y=x+r):(M=f+b,C=M+r,p=x+r,y=x-r),k=M),{x1:p,x2:x,x3:y,y1:M,y2:C,y3:k}}drawTitle(t,e,n){const s=this.title,o=s.length;let r,a,l;if(o){const c=We(n.rtl,this.x,this.width);for(t.x=Ii(this,n.titleAlign,n),e.textAlign=c.textAlign(n.titleAlign),e.textBaseline="middle",r=mt(n.titleFont),a=n.titleSpacing,e.fillStyle=n.titleColor,e.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,pi(t,{x:b,y:g,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),pi(t,{x:p,y:g+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(b,g,c,l),t.strokeRect(b,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(p,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,e,n){const{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=n,d=mt(n.bodyFont);let u=d.lineHeight,f=0;const g=We(n.rtl,this.x,this.width),b=function(m){e.fillText(m,g.x(t.x+f),t.y+u/2),t.y+=u+o},p=g.textAlign(r);let x,y,M,C,k,D,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Ii(this,p,n),e.fillStyle=n.bodyColor,Z(this.beforeBody,b),f=a&&p!=="right"?r==="center"?c/2+h:c+2+h:0,C=0,D=s.length;C0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){const r=ei[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Co(this,t),l=Object.assign({},r,this._size),c=Po(e,t,l),h=Do(t,l,c,e);(s._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let n=this.opacity;if(!n)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;const r=wt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,e),wr(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Mr(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const n=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Ki(n,s),r=this._positionChanged(s,e);(o||r)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,n=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,n),a=this._positionChanged(r,t),l=e||!Ki(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,n,s){const o=this.options;if(t.type==="mouseout")return[];if(!s)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:n,caretY:s,options:o}=this,r=ei[o.position].call(this,t,e);return r!==!1&&(n!==r.x||s!==r.y)}}A(Bn,"positioners",ei);var Gd={id:"tooltip",_element:Bn,positioners:ei,afterInit(i,t,e){e&&(i.tooltip=new Bn({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Kr},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Zd=Object.freeze({__proto__:null,Colors:cd,Decimation:fd,Filler:Rd,Legend:Vd,SubTitle:Hd,Title:Nd,Tooltip:Gd});const Qd=(i,t,e,n)=>(typeof t=="string"?(e=i.push(t)-1,n.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Jd(i,t,e,n){const s=i.indexOf(t);if(s===-1)return Qd(i,t,e,n);const o=i.lastIndexOf(t);return s!==o?e:s}const tu=(i,t)=>i===null?null:xt(Math.round(i),0,t);function Lo(i){const t=this.getLabels();return i>=0&&ie.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}A(Vn,"id","category"),A(Vn,"defaults",{ticks:{callback:Lo}});function eu(i,t){const e=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,g=h-1,{min:b,max:p}=t,x=!q(r),y=!q(a),M=!q(c),C=(p-b)/(d+1);let k=Ss((p-b)/g/f)*f,D,w,m,_;if(k<1e-14&&!x&&!y)return[{value:b},{value:p}];_=Math.ceil(p/k)-Math.floor(b/k),_>g&&(k=Ss(_*k/g/f)*f),q(l)||(D=Math.pow(10,l),k=Math.ceil(k*D)/D),s==="ticks"?(w=Math.floor(b/k)*k,m=Math.ceil(p/k)*k):(w=b,m=p),x&&y&&o&&qa((a-r)/o,k/1e3)?(_=Math.round(Math.min((a-r)/k,h)),k=(a-r)/_,w=r,m=a):M?(w=x?r:w,m=y?a:m,_=c-1,k=(m-w)/_):(_=(m-w)/k,ri(_,Math.round(_),k/1e3)?_=Math.round(_):_=Math.ceil(_));const v=Math.max(Cs(k),Cs(w));D=Math.pow(10,q(l)?v:l),w=Math.round(w*D)/D,m=Math.round(m*D)/D;let S=0;for(x&&(u&&w!==r?(e.push({value:r}),wa)break;e.push({value:P})}return y&&u&&m!==a?e.length&&ri(e[e.length-1].value,a,To(a,C,i))?e[e.length-1].value=a:e.push({value:a}):(!y||m===a)&&e.push({value:m}),e}function To(i,t,{horizontal:e,minRotation:n}){const s=Bt(n),o=(e?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class nn extends Ae{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 q(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:n}=this.getUserBounds();let{min:s,max:o}=this;const r=l=>s=e?s:l,a=l=>o=n?o:l;if(t){const l=Ut(s),c=Ut(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(s===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(s-l)}this.min=s,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:n}=t,s;return n?(s=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),e=e||11),e&&(s=Math.min(e,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let n=this.getTickLimit();n=Math.max(2,n);const s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=eu(s,o);return t.bounds==="ticks"&&rr(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){const s=(n-e)/Math.max(t.length-1,1)/2;e-=s,n+=s}this._startValue=e,this._endValue=n,this._valueRange=n-e}getLabelForValue(t){return vi(t,this.chart.options.locale,this.options.ticks.format)}}class Wn extends nn{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ht(t)?t:0,this.max=ht(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,n=Bt(this.options.ticks.minRotation),s=(t?Math.sin(n):Math.cos(n))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}A(Wn,"id","linear"),A(Wn,"defaults",{ticks:{callback:rn.formatters.numeric}});const bi=i=>Math.floor(ae(i)),xe=(i,t)=>Math.pow(10,bi(i)+t);function Ro(i){return i/Math.pow(10,bi(i))===1}function Eo(i,t,e){const n=Math.pow(10,e),s=Math.floor(i/n);return Math.ceil(t/n)-s}function iu(i,t){const e=t-i;let n=bi(e);for(;Eo(i,t,n)>10;)n++;for(;Eo(i,t,n)<10;)n--;return Math.min(n,bi(i))}function nu(i,{min:t,max:e}){t=Dt(i.min,t);const n=[],s=bi(t);let o=iu(t,e),r=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,h=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((c-h)/Math.pow(10,o)),u=Dt(i.min,Math.round((l+h+d*Math.pow(10,o))*r)/r);for(;u=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,r=o>=0?1:r),u=Math.round((l+h+d*Math.pow(10,o))*r)/r;const f=Dt(i.max,u);return n.push({value:f,major:Ro(f),significand:d}),n}class Nn extends Ae{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){const n=nn.prototype.parse.apply(this,[t,e]);if(n===0){this._zero=!0;return}return ht(n)&&n>0?n:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ht(t)?Math.max(0,t):null,this.max=ht(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ht(this._userMin)&&(this.min=t===xe(this.min,0)?xe(this.min,-1):xe(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let n=this.min,s=this.max;const o=a=>n=t?n:a,r=a=>s=e?s:a;n===s&&(n<=0?(o(1),r(10)):(o(xe(n,-1)),r(xe(s,1)))),n<=0&&o(xe(s,-1)),s<=0&&r(xe(n,1)),this.min=n,this.max=s}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},n=nu(e,this);return t.bounds==="ticks"&&rr(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}getLabelForValue(t){return t===void 0?"0":vi(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=ae(t),this._valueRange=ae(this.max)-ae(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(ae(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}A(Nn,"id","logarithmic"),A(Nn,"defaults",{ticks:{callback:rn.formatters.logarithmic,major:{enabled:!0}}});function Hn(i){const t=i.ticks;if(t.display&&i.display){const e=wt(t.backdropPadding);return $(t.font&&t.font.size,rt.font.size)+e.height}return 0}function su(i,t,e){return e=ot(e)?e:[e],{w:dl(i,t.string,e),h:e.length*t.lineHeight}}function Fo(i,t,e,n,s){return i===n||i===s?{start:t-e/2,end:t+e/2}:is?{start:t-e,end:t}:{start:t,end:t+e}}function ou(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),n=[],s=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?st/o:0;for(let l=0;lt.r&&(a=(n.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),s.startt.b&&(l=(s.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function au(i,t,e){const n=i.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=e,l=i.getPointPosition(t,n+s+r,o),c=Math.round(Jn(Ot(l.angle+ft))),h=uu(l.y,a.h,c),d=hu(c),u=du(l.x,a.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+a.w,bottom:h+a.h}}function lu(i,t){if(!t)return!0;const{left:e,top:n,right:s,bottom:o}=i;return!(ie({x:e,y:n},t)||ie({x:e,y:o},t)||ie({x:s,y:n},t)||ie({x:s,y:o},t))}function cu(i,t,e){const n=[],s=i._pointLabels.length,o=i.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Hn(o)/2,additionalAngle:r?st/s:0};let c;for(let h=0;h270||e<90)&&(i-=t),i}function fu(i,t,e){const{left:n,top:s,right:o,bottom:r}=e,{backdropColor:a}=t;if(!q(a)){const l=Me(t.borderRadius),c=wt(t.backdropPadding);i.fillStyle=a;const h=n-c.left,d=s-c.top,u=o-n+c.width,f=r-s+c.height;Object.values(l).some(g=>g!==0)?(i.beginPath(),pi(i,{x:h,y:d,w:u,h:f,radius:l}),i.fill()):i.fillRect(h,d,u,f)}}function gu(i,t){const{ctx:e,options:{pointLabels:n}}=i;for(let s=t-1;s>=0;s--){const o=i._pointLabelItems[s];if(!o.visible)continue;const r=n.setContext(i.getPointLabelContext(s));fu(e,r,o);const a=mt(r.font),{x:l,y:c,textAlign:h}=o;Pe(e,i._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:h,textBaseline:"middle"})}}function Gr(i,t,e,n){const{ctx:s}=i;if(e)s.arc(i.xCenter,i.yCenter,t,0,nt);else{let o=i.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r{const s=tt(this.options.pointLabels.callback,[e,n],this);return s||s===0?s:""}).filter((e,n)=>this.chart.getDataVisibility(n))}fit(){const t=this.options;t.display&&t.pointLabels.display?ou(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,n,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,n,s))}getIndexAngle(t){const e=nt/(this._pointLabels.length||1),n=this.options.startAngle||0;return Ot(t*e+Bt(n))}getDistanceFromCenterForValue(t){if(q(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(q(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{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);const u=this.getContext(d),f=s.setContext(u),g=o.setContext(u);pu(this,f,l,r,g)}}),n.display){for(t.save(),a=r-1;a>=0;a--){const h=n.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:u}=h;!u||!d||(t.lineWidth=u,t.strokeStyle=d,t.setLineDash(h.borderDash),t.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),c=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(c.x,c.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,n=e.ticks;if(!n.display)return;const s=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;const c=n.setContext(this.getContext(l)),h=mt(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=wt(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}Pe(t,a.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}}A(ii,"id","radialLinear"),A(ii,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:rn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),A(ii,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),A(ii,"descriptors",{angleLines:{_fallback:"grid"}});const hn={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ct=Object.keys(hn);function Io(i,t){return i-t}function zo(i,t){if(q(t))return null;const e=i._adapter,{parser:n,round:s,isoWeekday:o}=i._parseOpts;let r=t;return typeof n=="function"&&(r=n(r)),ht(r)||(r=typeof n=="string"?e.parse(r,n):e.parse(r)),r===null?null:(s&&(r=s==="week"&&(Ne(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,s)),+r)}function Bo(i,t,e,n){const s=Ct.length;for(let o=Ct.indexOf(i);o=Ct.indexOf(e);o--){const r=Ct[o];if(hn[r].common&&i._adapter.diff(s,n,r)>=t-1)return r}return Ct[e?Ct.indexOf(e):0]}function _u(i){for(let t=Ct.indexOf(i)+1,e=Ct.length;t=t?e[n]:e[s];i[o]=!0}}function xu(i,t,e,n){const s=i._adapter,o=+s.startOf(t[0].value,n),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=e[a],l>=0&&(t[l].major=!0);return t}function Wo(i,t,e){const n=[],s={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let e=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?e=1-s:e=(this.getDecimalForValue(t[1])-s)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?n=o:n=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=xt(e,0,r),n=xt(n,0,r),this._offsets={start:e,end:n,factor:1/(e+1+n)}}_generate(){const t=this._adapter,e=this.min,n=this.max,s=this.options,o=s.time,r=o.unit||Bo(o.minUnit,e,n,this._getLabelCapacity(e)),a=$(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Ne(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(n,e,r)>1e5*a)throw new Error(e+" and "+n+" are too far apart with stepSize of "+a+" "+r);const g=s.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u+b)}getLabelForValue(t){const e=this._adapter,n=this.options.time;return n.tooltipFormat?e.format(t,n.tooltipFormat):e.format(t,n.displayFormats.datetime)}format(t,e){const s=this.options.time.displayFormats,o=this._unit,r=e||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,n,s){const o=this.options,r=o.ticks.callback;if(r)return tt(r,[t,e,n],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=n[e],f=c&&d&&u&&u.major;return this._adapter.format(t,s||(f?d:h))}generateTickLabels(t){let e,n,s;for(e=0,n=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,n;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(e=0,n=s.length;e=i[n].pos&&t<=i[s].pos&&({lo:n,hi:s}=ee(i,"pos",t)),{pos:o,time:a}=i[n],{pos:r,time:l}=i[s]):(t>=i[n].time&&t<=i[s].time&&({lo:n,hi:s}=ee(i,"time",t)),{time:o,pos:a}=i[n],{time:r,pos:l}=i[s]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class $n extends _i{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=zi(e,this.min),this._tableRange=zi(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:n}=this,s=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=n&&s.push(c);if(s.length<2)return[{time:e,pos:0},{time:n,pos:1}];for(r=0,a=s.length;rs-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),n=this.getLabelTimestamps();return e.length&&n.length?t=this.normalize(e.concat(n)):t=e.length?e:n,t=this._cache.all=t,t}getDecimalForValue(t){return(zi(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,n=this.getDecimalForPixel(t)/e.factor-e.end;return zi(this._table,n*this._tableRange+this._minPos,!0)}}A($n,"id","timeseries"),A($n,"defaults",_i.defaults);var yu=Object.freeze({__proto__:null,CategoryScale:Vn,LinearScale:Wn,LogarithmicScale:Nn,RadialLinearScale:ii,TimeScale:_i,TimeSeriesScale:$n});const vu=[Cc,id,Zd,yu];Qt.register(...vu);function ku(i){let t,e,n,s,o,r,a,l;return{c(){t=F("div"),e=F("h2"),e.textContent="Participants",n=K(),s=F("div"),o=F("p"),r=F("span"),a=At(i[0]),l=At(` - / 12`),W(e,"class","font-semibold text-left"),W(r,"class","svelte-1yk4q9m"),W(o,"class","text-5xl font-bold my-4 text-left"),W(s,"class","flex flex-row justify-center items-center h-full svelte-1yk4q9m"),W(t,"class","w-full flex flex-col component rounded-lg p-6 shadow-lg svelte-1yk4q9m")},m(c,h){Pt(c,t,h),O(t,e),O(t,n),O(t,s),O(s,o),O(o,r),O(r,a),O(o,l)},p(c,[h]){h&1&&zt(a,c[0])},i:ct,o:ct,d(c){c&&Mt(t)}}}function wu(i,t,e){let n;return Yn.subscribe(s=>{e(0,n=s)}),[n]}class Mu extends Ue{constructor(t){super(),je(this,t,wu,ku,De,{})}}function Su(i){let t;return{c(){t=F("div"),t.innerHTML='

Results

',W(t,"class","flex flex-col items-start component")},m(e,n){Pt(e,t,n)},p:ct,i:ct,o:ct,d(e){e&&Mt(t)}}}function Cu(i){let t,e;return ia(()=>{const n=document.getElementById("votesChart");if(n instanceof HTMLCanvasElement){const s=n.getContext("2d");new Qt(s,{type:"bar",data:{labels:t,datasets:[{label:"Votes",data:e,backgroundColor:["#9900FC","#9900FC","#9900FC"],borderWidth:1}]},options:{scales:{x:{grid:{color:"black",lineWidth:1},ticks:{color:"black",font:{family:"Work Sans",size:12}},title:{display:!0,text:"",color:"black",font:{family:"Work Sans",size:14,weight:"bold"}}},y:{min:0,max:12,grid:{color:"black",lineWidth:.1},ticks:{color:"black",font:{family:"Work Sans",size:12}},title:{display:!0,text:"",color:"black",font:{family:"Work Sans",size:14,weight:"bold"}}}},plugins:{legend:{display:!1,labels:{color:"black",font:{family:"Work Sans",size:14,weight:"bold"}}},tooltip:{titleFont:{family:"Work Sans",size:14,weight:"bold"},bodyFont:{family:"Work Sans",size:12}}}}})}else console.error("votesChart element is not a canvas element.")}),Xn.subscribe(n=>{t=n.labels,e=n.values}),[]}class Pu extends Ue{constructor(t){super(),je(this,t,Cu,Su,De,{})}}function No(i,t,e){const n=i.slice();return n[2]=t[e],n}function Ho(i){let t,e,n=i[2].proposal+"",s,o,r,a=i[2].title+"",l,c,h,d=i[2].count+"",u,f;return{c(){t=F("tr"),e=F("td"),s=At(n),o=K(),r=F("td"),l=At(a),c=K(),h=F("td"),u=At(d),f=K(),W(e,"class","px-4 py-2 text-left"),W(r,"class","px-4 py-2 text-left"),W(h,"class","px-4 py-2 text-left"),W(t,"class","border-b border-purple")},m(g,b){Pt(g,t,b),O(t,e),O(e,s),O(t,o),O(t,r),O(r,l),O(t,c),O(t,h),O(h,u),O(t,f)},p(g,b){b&1&&n!==(n=g[2].proposal+"")&&zt(s,n),b&1&&a!==(a=g[2].title+"")&&zt(l,a),b&1&&d!==(d=g[2].count+"")&&zt(u,d)},d(g){g&&Mt(t)}}}function Du(i){let t,e,n,s,o,r,a,l,c,h,d,u=qi(i[0]),f=[];for(let g=0;gLabel Proposal Votes',r=K(),a=F("tbody");for(let g=0;gpa();return qn.subscribe(o=>{e(0,n=o)}),[n,s]}class Au extends Ue{constructor(t){super(),je(this,t,Ou,Du,De,{})}}function Lu(i){let t,e,n,s,o,r,a,l,c;return{c(){t=F("div"),e=F("h2"),e.textContent="Decision Log",n=K(),s=F("label"),o=F("p"),o.textContent="Load CSV",r=K(),a=F("input"),W(e,"class","text-left"),W(o,"class","text-left purple"),W(a,"type","file"),W(a,"accept",".csv"),W(t,"class","file-upload my-4 flex flex-col border-2 border-purple rounded p-2 items-baseline")},m(h,d){Pt(h,t,d),O(t,e),O(t,n),O(t,s),O(s,o),O(s,r),O(s,a),l||(c=sn(a,"change",i[0]),l=!0)},p:ct,i:ct,o:ct,d(h){h&&Mt(t),l=!1,c()}}}function Tu(i){return[async e=>{const n=e.target.files[0];n&&await ua(n)}]}class Ru extends Ue{constructor(t){super(),je(this,t,Tu,Lu,De,{})}}function $o(i,t,e){const n=i.slice();return n[3]=t[e],n}function jo(i){let t,e,n,s,o=i[3]["Supplemental materials"]+"",r;return{c(){t=F("tr"),e=F("td"),e.textContent="Supplemental Materials",n=K(),s=F("td"),r=At(o),W(e,"class","font-semibold px-2 py-1 svelte-ol7h74"),W(s,"class","px-2 py-1 svelte-ol7h74")},m(a,l){Pt(a,t,l),O(t,e),O(t,n),O(t,s),O(s,r)},p(a,l){l&1&&o!==(o=a[3]["Supplemental materials"]+"")&&zt(r,o)},d(a){a&&Mt(t)}}}function Uo(i){let t,e,n,s,o=i[3]["Other notes"]+"",r;return{c(){t=F("tr"),e=F("td"),e.textContent="Other Notes",n=K(),s=F("td"),r=At(o),W(e,"class","font-semibold px-2 py-1 svelte-ol7h74"),W(s,"class","px-2 py-1 svelte-ol7h74")},m(a,l){Pt(a,t,l),O(t,e),O(t,n),O(t,s),O(s,r)},p(a,l){l&1&&o!==(o=a[3]["Other notes"]+"")&&zt(r,o)},d(a){a&&Mt(t)}}}function Yo(i){let t,e,n=i[3]["Short title"]+"",s,o,r,a,l,c,h,d,u,f=i[3].Date+"",g,b,p,x,y,M,C=i[3].Description+"",k,D,w,m,_,v,S=i[3]["Deciding group"]+"",P,E,I,z,B,L,U=i[3].Resolution+"",R,dt,et,T,N=i[3]["Supplemental materials"]&&jo(i),j=i[3]["Other notes"]&&Uo(i);return{c(){t=F("details"),e=F("summary"),s=At(n),o=K(),r=F("div"),a=F("table"),l=F("tbody"),c=F("tr"),h=F("td"),h.textContent="Date",d=K(),u=F("td"),g=At(f),b=K(),p=F("tr"),x=F("td"),x.textContent="Description",y=K(),M=F("td"),k=At(C),D=K(),w=F("tr"),m=F("td"),m.textContent="Deciding Group",_=K(),v=F("td"),P=At(S),E=K(),I=F("tr"),z=F("td"),z.textContent="Resolution",B=K(),L=F("td"),R=At(U),dt=K(),N&&N.c(),et=K(),j&&j.c(),T=K(),W(e,"class","font-semibold text-md text-left svelte-ol7h74"),W(h,"class","font-semibold px-2 py-1 svelte-ol7h74"),W(u,"class","px-2 py-1 svelte-ol7h74"),W(x,"class","font-semibold px-2 py-1 svelte-ol7h74"),W(M,"class","px-2 py-1 description svelte-ol7h74"),W(m,"class","font-semibold px-2 py-1 svelte-ol7h74"),W(v,"class","px-2 py-1 svelte-ol7h74"),W(z,"class","font-semibold px-2 py-1 svelte-ol7h74"),W(L,"class","px-2 py-1 svelte-ol7h74"),W(l,"class","svelte-ol7h74"),W(a,"class","table-auto text-left max-w-xl svelte-ol7h74"),W(r,"class","mt-2"),W(t,"class","my-2 p-2 border border-purple rounded-lg max-w-2xl svelte-ol7h74")},m(H,X){Pt(H,t,X),O(t,e),O(e,s),O(t,o),O(t,r),O(r,a),O(a,l),O(l,c),O(c,h),O(c,d),O(c,u),O(u,g),O(l,b),O(l,p),O(p,x),O(p,y),O(p,M),O(M,k),O(l,D),O(l,w),O(w,m),O(w,_),O(w,v),O(v,P),O(l,E),O(l,I),O(I,z),O(I,B),O(I,L),O(L,R),O(l,dt),N&&N.m(l,null),O(l,et),j&&j.m(l,null),O(t,T)},p(H,X){X&1&&n!==(n=H[3]["Short title"]+"")&&zt(s,n),X&1&&f!==(f=H[3].Date+"")&&zt(g,f),X&1&&C!==(C=H[3].Description+"")&&zt(k,C),X&1&&S!==(S=H[3]["Deciding group"]+"")&&zt(P,S),X&1&&U!==(U=H[3].Resolution+"")&&zt(R,U),H[3]["Supplemental materials"]?N?N.p(H,X):(N=jo(H),N.c(),N.m(l,et)):N&&(N.d(1),N=null),H[3]["Other notes"]?j?j.p(H,X):(j=Uo(H),j.c(),j.m(l,null)):j&&(j.d(1),j=null)},d(H){H&&Mt(t),N&&N.d(),j&&j.d()}}}function Xo(i){let t,e,n;return{c(){t=F("button"),t.textContent="Clear data",W(t,"class","text-white px-4 py-2 rounded mt-4")},m(s,o){Pt(s,t,o),e||(n=sn(t,"click",i[2]),e=!0)},p:ct,d(s){s&&Mt(t),e=!1,n()}}}function Eu(i){let t,e,n,s,o,r=qi(i[0]),a=[];for(let c=0;c{fa()};return jn.subscribe(r=>{e(0,n=r)}),on.subscribe(r=>{e(1,s=r)}),[n,s,o]}class Iu extends Ue{constructor(t){super(),je(this,t,Fu,Eu,De,{})}}function zu(i){let t,e;return t=new Iu({}),{c(){si(t.$$.fragment)},m(n,s){Be(t,n,s),e=!0},i(n){e||(jt(t.$$.fragment,n),e=!0)},o(n){Jt(t.$$.fragment,n),e=!1},d(n){Ve(t,n)}}}function Bu(i){let t,e;return t=new Ru({}),{c(){si(t.$$.fragment)},m(n,s){Be(t,n,s),e=!0},i(n){e||(jt(t.$$.fragment,n),e=!0)},o(n){Jt(t.$$.fragment,n),e=!1},d(n){Ve(t,n)}}}function Vu(i){let t,e,n,s,o,r,a,l,c,h,d;return{c(){t=F("div"),e=F("h2"),e.textContent="Vote Results",n=K(),s=F("br"),o=K(),r=F("label"),a=F("p"),a.textContent="Load CSV",l=K(),c=F("input"),W(e,"class","text-left"),W(a,"class","text-left purple"),W(c,"type","file"),W(c,"accept",".csv"),W(t,"class","my-4 flex flex-col border-2 border-purple rounded p-2 items-baseline")},m(u,f){Pt(u,t,f),O(t,e),O(t,n),O(t,s),O(t,o),O(t,r),O(r,a),O(r,l),O(r,c),h||(d=sn(c,"change",i[2]),h=!0)},p:ct,i:ct,o:ct,d(u){u&&Mt(t),h=!1,d()}}}function Wu(i){let t,e,n,s,o,r,a;return e=new Pu({}),s=new Mu({}),r=new Au({}),{c(){t=F("div"),si(e.$$.fragment),n=K(),si(s.$$.fragment),o=K(),si(r.$$.fragment),W(t,"class","flex flex-col lg:flex-row lg:space-x-7")},m(l,c){Pt(l,t,c),Be(e,t,null),O(t,n),Be(s,t,null),Pt(l,o,c),Be(r,l,c),a=!0},p:ct,i(l){a||(jt(e.$$.fragment,l),jt(s.$$.fragment,l),jt(r.$$.fragment,l),a=!0)},o(l){Jt(e.$$.fragment,l),Jt(s.$$.fragment,l),Jt(r.$$.fragment,l),a=!1},d(l){l&&(Mt(t),Mt(o)),Ve(e),Ve(s),Ve(r,l)}}}function Nu(i){let t,e,n,s,o,r,a,l,c;const h=[Bu,zu],d=[];function u(p,x){return p[1]?1:0}s=u(i),o=d[s]=h[s](i);const f=[Wu,Vu],g=[];function b(p,x){return p[0]?0:1}return a=b(i),l=g[a]=f[a](i),{c(){t=F("main"),e=F("h1"),e.textContent="Governance Dashboard",n=K(),o.c(),r=K(),l.c(),W(e,"class","svelte-10lgg3m")},m(p,x){Pt(p,t,x),O(t,e),O(t,n),d[s].m(t,null),O(t,r),g[a].m(t,null),c=!0},p(p,[x]){let y=s;s=u(p),s!==y&&(ms(),Jt(d[y],1,1,()=>{d[y]=null}),bs(),o=d[s],o||(o=d[s]=h[s](p),o.c()),jt(o,1),o.m(t,r));let M=a;a=b(p),a===M?g[a].p(p,x):(ms(),Jt(g[M],1,1,()=>{g[M]=null}),bs(),l=g[a],l?l.p(p,x):(l=g[a]=f[a](p),l.c()),jt(l,1),l.m(t,null))},i(p){c||(jt(o),jt(l),c=!0)},o(p){Jt(o),Jt(l),c=!1},d(p){p&&Mt(t),d[s].d(),g[a].d()}}}function Hu(i,t,e){let n,s;const o=async r=>{const a=r.target.files[0];a&&await ga(a)};return Un.subscribe(r=>e(0,n=r)),on.subscribe(r=>e(1,s=r)),[n,s,o]}class $u extends Ue{constructor(t){super(),je(this,t,Hu,Nu,De,{})}}new $u({target:document.getElementById("app")}); diff --git a/index.html b/index.html index 7970783c..cf775b39 100644 --- a/index.html +++ b/index.html @@ -1,14 +1,16 @@ - + + Dashboard - - + +
+