@silvestv/migration-planificator 7.1.0 → 7.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.bundle.js +200 -182
- package/dist/src/autofix/cli/fix-command.js +6 -4
- package/dist/src/autofix/generators/context-generator.js +71 -2
- package/dist/src/autofix/generators/file-prompt-generator.js +22 -3
- package/dist/src/autofix/prompts/constitution.js +23 -0
- package/dist/src/autofix/prompts/file-prompt-complex.js +129 -0
- package/dist/src/autofix/prompts/file-prompt-diagnostics.js +2 -98
- package/dist/src/autofix/prompts/file-prompt-phases.js +106 -44
- package/dist/src/autofix/prompts/file-prompt-reference.js +7 -25
- package/dist/src/autofix/prompts/file-prompt-routine.js +160 -0
- package/dist/src/autofix/prompts/file-prompt-shared.js +82 -0
- package/dist/src/data/rules/to18/rules-18-obligatoire.json +382 -368
- package/dist/src/data/rules/to18/rules-18-optionnelle.json +135 -131
- package/dist/src/data/rules/to18/rules-18-recommande.json +113 -110
- package/dist/src/data/rules/to19/rules-19-obligatoire.json +204 -15
- package/dist/src/data/rules/to19/rules-19-optionnelle.json +12 -6
- package/dist/src/data/rules/to19/rules-19-recommande.json +11 -5
- package/dist/src/data/rules/to20/rules-20-obligatoire.json +15 -3
- package/dist/src/data/rules/to20/rules-20-optionnelle.json +2 -2
- package/dist/src/data/rules/to20/rules-20-recommande.json +2 -0
- package/dist/src/data/rules/to21/rules-21-obligatoire.json +12 -2
- package/dist/src/data/rules/to21/rules-21-optionnelle.json +2 -1
- package/dist/src/data/rules/to21/rules-21-recommande.json +4 -0
- package/dist/src/models/constants/fix-ai-cli-permissions.js +35 -6
- package/dist/src/models/constants/nx-angular-compatibility.js +50 -0
- package/dist/src/models/interfaces/ai-specification.interface.js +18 -0
- package/dist/src/models/types/routine-type.type.js +2 -0
- package/dist/src/templates/workload/rule-modal.template.js +74 -0
- package/dist/src/utils/autofix/bash-commands-helpers.js +14 -0
- package/dist/src/utils/autofix/compatibility-helpers.js +35 -0
- package/dist/src/utils/core/rule-helpers.js +3 -2
- package/dist/src/utils/shared/rule-helpers.js +32 -0
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/client.bundle.js
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
"use strict";(()=>{var Ac=Object.defineProperty;var Dc=(e,t,i)=>t in e?Ac(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var C=(e,t)=>()=>(e&&(t=e(e=0)),t);var Pc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var M=(e,t,i)=>Dc(e,typeof t!="symbol"?t+"":t,i);function D(e,t){try{let i=JSON.stringify(t);localStorage.setItem(lo+e,i)}catch(i){console.warn(`Failed to save to localStorage: ${e}`,i)}}function P(e,t){try{let i=localStorage.getItem(lo+e);return i===null?t:JSON.parse(i)}catch(i){return console.warn(`Failed to load from localStorage: ${e}`,i),t}}var lo,Be=C(()=>{"use strict";lo="migration-planner-"});var co,uo,he,ho=C(()=>{"use strict";Be();co="custom-times",uo="custom-special-times",he=class{constructor(t){M(this,"state");M(this,"listeners",new Set);this.state={...t}}getState(){return{...this.state}}setState(t){this.state={...this.state,...t},this.notify()}setCustomTime(t,i){this.state.customTimes={...this.state.customTimes,[t]:i},this.saveCustomTimesToStorage(),this.notify()}setCustomSpecialTime(t,i){this.state.customSpecialTimes={...this.state.customSpecialTimes,[t]:i},this.saveCustomTimesToStorage(),this.notify()}resetCustomTime(t){let{[t]:i,...n}=this.state.customTimes;this.state.customTimes=n;let{[t]:s,...o}=this.state.customSpecialTimes;this.state.customSpecialTimes=o,this.saveCustomTimesToStorage(),this.notify()}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){let t=this.getState();this.listeners.forEach(i=>i(t))}static loadCustomTimesFromStorage(){return{customTimes:P(co,{}),customSpecialTimes:P(uo,{})}}saveCustomTimesToStorage(){D(co,this.state.customTimes),D(uo,this.state.customSpecialTimes)}resetAllCustomTimes(){this.state.customTimes={},this.state.customSpecialTimes={},this.saveCustomTimesToStorage(),this.notify()}}});function $(e,t=7){let i=Math.round(e/60*100)/100,n=Math.round(i/t*100)/100;return{minutes:e,hours:i,days:n}}function U(e,t=!1){return e.minutes<60?`${e.minutes}min`:e.minutes<420?t?`${e.hours}h (${e.minutes}min)`:`${e.hours}h`:t?`${e.days}j (${e.hours}h)`:`${e.days}j`}var fo=C(()=>{"use strict"});function Si(e,t){let i=new Date(e);return i.setDate(i.getDate()+Math.ceil(t)),i}function Tn(e,t){if(t===0)return new Date(e);let i=new Date(e),n=Math.ceil(t)-1,s=0;for(;s<n;){i.setDate(i.getDate()+1);let o=i.getDay();o!==0&&o!==6&&s++}return i}function wn(e,t="short"){let i=typeof e=="string"?new Date(e):e;if(t==="iso")return i.toISOString().split("T")[0];if(t==="short"){let n=String(i.getDate()).padStart(2,"0"),s=String(i.getMonth()+1).padStart(2,"0");return`${n}/${s}`}return t==="french"?i.toLocaleDateString("fr-FR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):i.toLocaleDateString("fr-FR",{year:"numeric",month:"long",day:"numeric"})}var go=C(()=>{"use strict"});function ft(e){let t={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,i=>t[i])}function We(e,t="blue"){return`<span class="inline-block px-2 py-1 text-xs font-semibold rounded bg-${t}-100 text-${t}-800">${ft(e)}</span>`}var po=C(()=>{"use strict"});function mo(e){return!!e.onFile}var bo=C(()=>{"use strict"});function yo(e,t){let i=new Map;for(let n of e){let s=t(n);s!=null&&(i.has(s)||i.set(s,[]),i.get(s).push(n))}return i}var xo=C(()=>{"use strict"});var Gt=C(()=>{"use strict";fo();go();po();bo();xo()});function _o(e,t,i){if(t<=1)return e;let n=Math.ceil(e.minutes/t);return $(n,i)}function Cn(e){return wn(e,"short")}function vo(e){return wn(e,"long")}var fe=C(()=>{"use strict";Gt();Gt()});async function En(e){try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(e),!0;let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",document.body.appendChild(t),t.select();let i=document.execCommand("copy");return document.body.removeChild(t),i}catch(t){return console.error("Failed to copy to clipboard:",t),!1}}function Ln(e,t=2e3){let i=e.textContent||"";e.textContent="\u2713 Copi\xE9 !",e.classList.add("bg-green-500","text-white"),setTimeout(()=>{e.textContent=i,e.classList.remove("bg-green-500","text-white")},t)}var Mo=C(()=>{"use strict"});function Rc(e,t,i,n,s){let o=t[e.ruleKey],r=o!==void 0?o:e.minutesPerOccurrence;if(e.type==="combined"||e.type==="special"){let c=r*(e.baseOccurrences||0),u=n.get(e.ruleKey)?.special_workload?.timePerOccurrence||0,h=i[e.ruleKey],f=h!==void 0?h:u,g=(e.specialWorkloadFiles||0)*f,p=c+g,m=$(p,s);return{...e,minutesPerOccurrence:r,specialTimePerFile:f,totalTime:m}}let a=r*e.occurrences,l=$(a,s);return{...e,minutesPerOccurrence:r,totalTime:l}}function Oc(e,t,i,n,s){return e.map(o=>{let r=o.rules.map(l=>Rc(l,t,i,n,s)),a=r.reduce((l,c)=>l+c.totalTime.minutes,0);return{priority:o.priority,totalTime:$(a,s),rules:r}})}function Ic(e,t,i,n,s){return e.map(o=>{let r=Oc(o.priorities,t,i,n,s),a=r.reduce((l,c)=>l+c.totalTime.minutes,0);return{migration:o.migration,totalTime:$(a,s),priorities:r}})}function Fc(e,t,i,n,s){return e.map(o=>{let r=Ic(o.migrations,t,i,n,s),a=r.reduce((l,c)=>l+c.totalTime.minutes,0);return{targetName:o.targetName,targetType:o.targetType,totalTime:$(a,s),migrations:r}})}function So(e,t,i=7,n=[],s={}){let o=new Map(n.map(l=>[l.key,l])),r=Fc(e.targets,t,s,o,i),a=r.reduce((l,c)=>l+c.totalTime.minutes,0);return{totalTime:$(a,i),projectInfo:e.projectInfo,targets:r,stats:e.stats}}function ko(e,t,i){return{original:e.totalTime,adjusted:_o(e.totalTime,t,i)}}var To=C(()=>{"use strict";fe()});function Co(e){$c(e),zc(e),Uc(e),jc(e),qc(e)}function $c(e){let t=e.targets.find(s=>s.targetType==="monorepo"),i=e.targets.filter(s=>s.targetType==="app"),n=e.targets.filter(s=>s.targetType==="lib");!t&&i.length===0&&n.length===0||(Hc(e.targets),wo("applications",i),wo("librairies",n))}function Hc(e){let t=e.reduce((n,s)=>n+s.totalTime.minutes,0),i=document.querySelectorAll("[data-monorepo-total-time]");if(i.length>0){let n=$(t,7),s=U(n);i.forEach(o=>{o.textContent=s})}}function wo(e,t){if(t.length===0)return;let i=t.reduce((s,o)=>s+o.totalTime.minutes,0),n=document.querySelectorAll(`[data-group-time$="-${e}"]`);if(n.length>0){let s=$(i,7),o=U(s);n.forEach(r=>{r.textContent=o})}}function zc(e){for(let t of e.targets){Bc(t);for(let i of t.migrations){Wc(t.targetName,i);for(let n of i.priorities){Nc(t.targetName,i.migration,n);for(let s of n.rules)Vc(s)}}}}function Bc(e){let t=document.querySelectorAll(`[data-target-time="${e.targetName}"]`);if(t.length>0){let i=U(e.totalTime);t.forEach(n=>{n.textContent=i})}}function Wc(e,t){let i=`${e}-${t.migration}`,n=document.querySelectorAll(`[data-migration-time="${i}"]`);if(n.length>0){let s=U(t.totalTime);n.forEach(o=>{o.textContent=s})}}function Nc(e,t,i){let n=`${e}-${t}-${i.priority}`,s=document.querySelectorAll(`[data-priority-time="${n}"]`);if(s.length>0){let o=U(i.totalTime);s.forEach(r=>{r.textContent=o})}}function Vc(e){document.querySelectorAll(`[data-calc-display="${e.ruleKey}"]`).forEach(i=>{let n=i,s=Yc(n),o=0;if(e.type==="combined"){let l=e.minutesPerOccurrence*s,c=(e.specialWorkloadFiles||0)*(e.specialTimePerFile||0);o=l+c}else e.type==="special"?o=s*(e.specialTimePerFile||0):o=e.minutesPerOccurrence*s;let r=n.querySelector(`[data-rule-time="${e.ruleKey}"]`);if(r){let l=$(o,7);r.textContent=U(l)}n.querySelectorAll(`[data-time-input="${e.ruleKey}"]`).forEach(l=>{let c=l,d=String(e.minutesPerOccurrence);c.value!==d&&(c.value=d,c.setAttribute("data-original-time",d))}),e.specialTimePerFile!==void 0&&n.querySelectorAll(`[data-special-time-input="${e.ruleKey}"]`).forEach(c=>{let d=c,u=String(e.specialTimePerFile||0);d.value!==u&&(d.value=u,d.setAttribute("data-original-special-time",u))})})}function jc(e){let t=new Map;e.targets.forEach(o=>t.set(o.targetName,o));let i=e.targets.filter(o=>o.targetType==="app"||o.targetType==="lib");document.querySelectorAll("[data-flat-priority-time]").forEach(o=>{let r=o.getAttribute("data-flat-priority-time");if(!r)return;let a=r.match(/^(.+)-flat-(.+)$/);if(!a)return;let[,l,c]=a,d=0;if(l==="merged-apps-libs")i.forEach(u=>{u.migrations.forEach(h=>{h.priorities.forEach(f=>{f.priority===c&&(d+=f.totalTime.minutes)})})});else{let u=t.get(l);u&&u.migrations.forEach(h=>{h.priorities.forEach(f=>{f.priority===c&&(d+=f.totalTime.minutes)})})}if(d>0){let u=$(d,7);o.textContent=U(u)}}),document.querySelectorAll("[data-flat-migration-time]").forEach(o=>{let r=o.getAttribute("data-flat-migration-time");if(!r)return;let a=r.match(/^(.+)-flat-(to\d+)$/);if(!a)return;let[,l,c]=a,d=0;if(l==="merged-apps-libs")i.forEach(u=>{let h=u.migrations.find(f=>f.migration===c);h&&(d+=h.totalTime.minutes)});else{let u=t.get(l);if(u){let h=u.migrations.find(f=>f.migration===c);h&&(d=h.totalTime.minutes)}}if(d>0){let u=$(d,7);o.textContent=U(u)}})}function qc(e){let t=e.targets.filter(r=>r.targetType==="app"||r.targetType==="lib");if(t.length===0)return;let i=t.reduce((r,a)=>r+a.totalTime.minutes,0),n=document.querySelectorAll("[data-merged-apps-libs-time]");if(n.length>0){let r=$(i,7),a=U(r);n.forEach(l=>{l.textContent=a})}let s=new Map,o=new Map;t.forEach(r=>{r.migrations.forEach(a=>{let l=a.migration,c=s.get(l)||0;s.set(l,c+a.totalTime.minutes),a.priorities.forEach(d=>{let u=`${a.migration}-${d.priority}`,h=o.get(u)||0;o.set(u,h+d.totalTime.minutes)})})}),s.forEach((r,a)=>{let l=`merged-apps-libs-${a}`,c=document.querySelectorAll(`[data-migration-time="${l}"]`);if(c.length>0){let d=$(r,7),u=U(d);c.forEach(h=>{h.textContent=u})}}),o.forEach((r,a)=>{let[l,c]=a.split("-"),d=`merged-apps-libs-${l}-${c}`,u=document.querySelectorAll(`[data-priority-time="${d}"]`);if(u.length>0){let h=$(r,7),f=U(h);u.forEach(g=>{g.textContent=f})}})}function Yc(e){let i=(e.textContent||"").match(/(\d+)\s*(occ|fichiers|×)/);return i?parseInt(i[1],10):1}function Uc(e){for(let t of e.targets){let i=new Map;for(let n of t.migrations)for(let s of n.priorities){let o=s.priority,r=i.get(o)||0;i.set(o,r+s.totalTime.minutes)}i.forEach((n,s)=>{let o=t.migrations.map(a=>`${t.targetName}-${a.migration}-${s}`);document.querySelectorAll("span[data-priority-time]").forEach(a=>{let l=o.every(d=>a.getAttribute("data-priority-time")?.includes(d)||Array.from(a.attributes).some(u=>u.name==="data-priority-time"&&u.value===d)),c=Array.from(a.attributes).filter(d=>d.name==="data-priority-time");if(c.length>1){let d=c[0]?.value;if(d&&d.includes(t.targetName)&&d.includes(s)){let u=$(n,7);a.textContent=U(u)}}})})}}var Eo=C(()=>{"use strict";fe()});function Lo(e,t,i,n){let s=new Map;e.targets.forEach(l=>{l.migrations.forEach(c=>{s.has(c.migration)||s.set(c.migration,[]),s.get(c.migration).push(c)})});let o=[],r=[],a=new Date(n);return Gc.forEach(l=>{let c=s.get(l);if(!c||c.length===0)return;let{sequentialMinutes:d,parallelizableMinutes:u}=Xc(c),h=d+u,f=d+Math.ceil(u/t),g=Jc(f,i),p=Tn(a,g),m={id:l,label:l.toUpperCase(),duration:g,color:Kc[l]||"#888",startDate:new Date(a),endDate:new Date(p)};o.push(m),r.push({migration:l.toUpperCase(),routineMinutes:d,parallelizableMinutes:u,totalMinutesBeforeDevs:h,totalDaysAfterDevs:g,devCount:t,hoursPerDay:i}),a=p}),{tasks:o,details:r}}function Xc(e){let t=0,i=0;return e.forEach(n=>{n.priorities.forEach(s=>{let o=s.priority==="obligatoire";s.rules.forEach(r=>{if(!r||!r.totalTime){console.warn("[calculateMigrationMinutes] Invalid rule:",r);return}let a=r.totalTime.minutes;o?t+=a:i+=a})})}),{sequentialMinutes:t,parallelizableMinutes:i}}function Jc(e,t){let i=e/60;return Math.round(i/t*100)/100}var Gc,Kc,Ao=C(()=>{"use strict";Gt();Gc=["to18","to19","to20","to21"],Kc={to18:"#2563eb",to19:"#4f46e5",to20:"#9333ea",to21:"#db2777"}});function Kt(e,t){let i=null;return function(...s){i!==null&&clearTimeout(i),i=setTimeout(()=>{e(...s),i=null},t)}}function ki(e,t){let{offset:i=20,behavior:n="smooth",highlight:s=!0}=t||{},o=document.querySelector("[data-filter-toggle]")?.parentElement,a=(o?o.offsetHeight:80)+i,c=e.getBoundingClientRect().top+window.scrollY-a;window.scrollTo({top:c,behavior:n}),s&&Zc(e)}function Zc(e){document.querySelectorAll(".filter-highlight").forEach(t=>{t.classList.remove("filter-highlight")}),e.classList.add("filter-highlight")}var An=C(()=>{"use strict"});var Dn,Ne,Do,Jm,Zm,Ti=C(()=>{"use strict";Dn=[{version:"to18",sourceVersion:17,targetVersion:18,label:"Angular 17 \u2192 18",color:"blue"},{version:"to19",sourceVersion:18,targetVersion:19,label:"Angular 18 \u2192 19",color:"indigo"},{version:"to20",sourceVersion:19,targetVersion:20,label:"Angular 19 \u2192 20",color:"purple"},{version:"to21",sourceVersion:20,targetVersion:21,label:"Angular 20 \u2192 21",color:"pink"}],Ne=Dn.map(e=>e.version),Do=[...Ne],Jm=Object.fromEntries(Dn.map(e=>[e.version,e.color])),Zm=Object.fromEntries(Dn.map(e=>[e.version,e.label]))});function Po(e,t){if(Ne.every(a=>t.includes(a))||t.length===0)return e;let n=Qc(e.targets,t),s=td(n),o=n.reduce((a,l)=>a+l.totalTime.minutes,0),r=$(o,7);return{...e,targets:n,stats:s,totalTime:r}}function Qc(e,t){return e.map(i=>{let n=i.migrations.filter(o=>t.includes(o.migration)),s=n.reduce((o,r)=>o+r.totalTime.minutes,0);return{...i,migrations:n,totalTime:$(s,7)}}).filter(i=>i.migrations.length>0)}function td(e){let t=new Set,i=0,n=0;for(let s of e)for(let o of s.migrations)for(let r of o.priorities)for(let a of r.rules)t.add(a.ruleKey),i+=a.occurrences,a.specialWorkloadFiles!==void 0&&(n+=a.specialWorkloadFiles);return{uniqueRules:t.size,totalOccurrences:i,totalSpecialWorkloadFiles:n}}var Pn=C(()=>{"use strict";fe();Ti()});function Rn(){let e=Ro();return e?Array.from(e.querySelectorAll("[data-rule-card]")):Array.from(document.querySelectorAll("[data-rule-card]"))}function wi(){let e=Ro();return e?Array.from(e.querySelectorAll("[data-rule-card].filter-match")):Array.from(document.querySelectorAll("[data-rule-card].filter-match"))}function Ro(){let e=document.querySelectorAll("[data-view-mode]");for(let t of e)if(!(t.style.display==="none"))return t;return null}var Oo=C(()=>{"use strict"});var tt=C(()=>{"use strict";fe();Be();Mo();To();Eo();Ao();An();Pn();Oo()});function On(){P(Xt,[]).forEach(t=>{let i=document.getElementById(t);if(i){let n=i.querySelector("[data-collapse-content]"),s=i.querySelector("[data-collapse-icon]");n&&n.classList.add("hidden"),s&&(s.textContent="\u25B6")}}),document.addEventListener("click",t=>{let i=t.target.closest("[data-collapse-trigger]");if(!i)return;let n=i.getAttribute("data-collapse-trigger");n&&ed(n)})}function ed(e){let t=document.getElementById(e);if(!t)return;let i=t.querySelector("[data-collapse-content]"),n=t.querySelector("[data-collapse-icon]");if(!i)return;let s=i.classList.contains("hidden"),o=P(Xt,[]);if(s){i.classList.remove("hidden"),n&&(n.textContent="\u25BC");let r=o.indexOf(e);r>-1&&o.splice(r,1)}else i.classList.add("hidden"),n&&(n.textContent="\u25B6"),o.includes(e)||o.push(e);D(Xt,o)}function Io(){document.querySelectorAll("[data-collapse-content]").forEach(e=>{e.classList.remove("hidden")}),document.querySelectorAll("[data-collapse-icon]").forEach(e=>{e.textContent="\u25BC"}),D(Xt,[])}function Fo(){let e=[];document.querySelectorAll("[data-collapse-content]").forEach(t=>{t.classList.add("hidden");let i=t.closest("[id]");i?.id&&e.push(i.id)}),document.querySelectorAll("[data-collapse-icon]").forEach(t=>{t.textContent="\u25B6"}),D(Xt,e)}function Ci(e){let t=P(Xt,[]),i=e;for(;i;){let n=i.closest("[data-collapse-content]");if(n){let s=n.closest("[id]");if(s?.id){let o=s.querySelector("[data-collapse-content]"),r=s.querySelector("[data-collapse-icon]");if(o?.classList.contains("hidden")){o.classList.remove("hidden"),r&&(r.textContent="\u25BC");let a=t.indexOf(s.id);a>-1&&t.splice(a,1)}}i=n.parentElement}else break}D(Xt,t)}var Xt,Ei=C(()=>{"use strict";tt();Xt="collapsed-sections"});function zo(){let e=P(Ho,"overview");$o(e),document.addEventListener("click",t=>{let i=t.target.closest("[data-tab-trigger]");if(!i)return;let n=i.getAttribute("data-tab-trigger");n&&$o(n)})}function $o(e){document.querySelectorAll("[data-tab-trigger]").forEach(n=>{n.classList.remove("border-blue-600","text-blue-600","bg-blue-50"),n.classList.add("border-transparent","text-gray-600")}),document.querySelectorAll("[data-tab-content]").forEach(n=>{n.classList.add("hidden")});let t=document.querySelector(`[data-tab-trigger="${e}"]`);t&&(t.classList.remove("border-transparent","text-gray-600"),t.classList.add("border-blue-600","text-blue-600","bg-blue-50"));let i=document.querySelector(`[data-tab-content="${e}"]`);i&&i.classList.remove("hidden"),D(Ho,e)}var Ho,Bo=C(()=>{"use strict";tt();Ho="active-tab"});function Wo(){document.addEventListener("click",e=>{let t=e.target.closest("[data-modal-trigger]");if(!t)return;let i=t.getAttribute("data-modal-trigger");i&&id(i)}),document.addEventListener("click",e=>{e.target.closest("[data-modal-close]")&&In()}),document.addEventListener("click",e=>{e.target.hasAttribute("data-modal-overlay")&&In()}),document.addEventListener("keydown",e=>{e.key==="Escape"&&Ve&&In()})}function id(e){let t=document.getElementById(e);t&&(t.classList.remove("hidden"),Ve=t,document.body.style.overflow="hidden")}function In(){Ve&&(Ve.classList.add("hidden"),Ve=null,document.body.style.overflow="")}function No(){document.addEventListener("click",e=>{let t=e.target.closest("[data-vscode-open]");if(!t)return;e.preventDefault();let i=t.getAttribute("data-relative-path"),n=t.getAttribute("data-line-number");if(!i)return;let o=window.__REPORT_DATA__?.workloadReport?.projectInfo?.path;if(!o){console.error("Project root not found in __REPORT_DATA__");return}let r=`${o}/${i}`.replace(/\\/g,"/"),l=`vscode://file/${nd(r)}${n?":"+n:""}`;window.location.href=l})}function nd(e){let t=e.replace(/\\/g,"/"),i=t.match(/^([A-Z]):/);return i&&(t=i[1].toLowerCase()+t.substring(1)),t}var Ve,Vo=C(()=>{"use strict";Ve=null});function jo(){let e=P(Fn,{isExpanded:!1});sd(e),od()}function sd(e){e.isExpanded?qo():Yo()}function od(){let e=document.querySelector("[data-filter-toggle]");e&&e.addEventListener("click",rd)}function rd(){let e=document.querySelector("[data-filter-content]");if(!e)return;e.style.maxHeight&&e.style.maxHeight!=="0px"?(Yo(),D(Fn,{isExpanded:!1})):(qo(),D(Fn,{isExpanded:!0}))}function qo(){let e=document.querySelector("[data-filter-content]"),t=document.querySelector("[data-filter-chevron]");e&&(e.style.maxHeight=e.scrollHeight+"px",t&&(t.style.transform="rotate(180deg)"))}function Yo(){let e=document.querySelector("[data-filter-content]"),t=document.querySelector("[data-filter-chevron]");e&&(e.style.maxHeight="0",t&&(t.style.transform="rotate(0deg)"))}var Fn,Uo=C(()=>{"use strict";tt();Fn="filters-accordion-state"});var Li,Ai,Go,je,$n=C(()=>{"use strict";Li={critical:{emoji:"\u{1F534}",color:"red",label:"Critical"},high:{emoji:"\u{1F7E0}",color:"orange",label:"High"},medium:{emoji:"\u{1F7E1}",color:"yellow",label:"Medium"},low:{emoji:"\u{1F7E2}",color:"green",label:"Low"}},Ai={environment:{emoji:"\u{1F30D}",color:"blue",label:"Environment"},imports:{emoji:"\u{1F4E6}",color:"indigo",label:"Imports"},api:{emoji:"\u{1F50C}",color:"purple",label:"API"},routing:{emoji:"\u{1F6E3}\uFE0F",color:"pink",label:"Routing"},template:{emoji:"\u{1F4C4}",color:"teal",label:"Template"},test:{emoji:"\u{1F9EA}",color:"cyan",label:"Test"},ssr:{emoji:"\u26A1",color:"amber",label:"SSR"}},Go={standard:{emoji:"\u{1F4CB}",color:"blue",label:"Standard"},routine:{emoji:"\u{1F527}",color:"teal",label:"Routine"},special:{emoji:"\u2B50",color:"pink",label:"Special"},combined:{emoji:"\u{1F500}",color:"purple",label:"Combined"}},je={emoji:"\u{1F3F7}\uFE0F",color:"gray",label:"Unknown"}});function qe(e){let t=document.querySelector("[data-active-chips-container]"),i=document.querySelector("[data-filter-active-count]");if(!t)return;let n=P(ad,{riskLevels:[],categories:[],autoFixable:null,ruleTypes:[],searchText:""});t.innerHTML="";let s=[];n.searchText&&s.push(ld(n.searchText)),n.riskLevels.forEach(r=>{s.push(Hn("risk",r,Li))}),n.categories.forEach(r=>{s.push(Hn("category",r,Ai))}),n.ruleTypes.forEach(r=>{s.push(Hn("type",r,Go))});let o=s.length;if(o<9)s.forEach(r=>t.appendChild(r)),i&&i.classList.add("hidden");else{i&&i.classList.remove("hidden");let r=s.slice(0,Ko),a=o-Ko;r.forEach(l=>t.appendChild(l)),a>0&&t.appendChild(cd(a))}dd(e)}function Hn(e,t,i){let n=i[t]||je,s=document.createElement("div");return s.className=`inline-flex items-center gap-1 px-2 py-1 text-xs font-medium rounded-full bg-${n.color}-100 text-${n.color}-700 hover:bg-${n.color}-200 transition-colors`,s.dataset.filterChip=e,s.dataset.filterValue=t,s.innerHTML=`
|
|
1
|
+
"use strict";(()=>{var Gc=Object.defineProperty;var Uc=(e,t,i)=>t in e?Gc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var C=(e,t)=>()=>(e&&(t=e(e=0)),t);var Kc=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var M=(e,t,i)=>Uc(e,typeof t!="symbol"?t+"":t,i);function D(e,t){try{let i=JSON.stringify(t);localStorage.setItem(yo+e,i)}catch(i){console.warn(`Failed to save to localStorage: ${e}`,i)}}function R(e,t){try{let i=localStorage.getItem(yo+e);return i===null?t:JSON.parse(i)}catch(i){return console.warn(`Failed to load from localStorage: ${e}`,i),t}}var yo,ze=C(()=>{"use strict";yo="migration-planner-"});var xo,_o,he,vo=C(()=>{"use strict";ze();xo="custom-times",_o="custom-special-times",he=class{constructor(t){M(this,"state");M(this,"listeners",new Set);this.state={...t}}getState(){return{...this.state}}setState(t){this.state={...this.state,...t},this.notify()}setCustomTime(t,i){this.state.customTimes={...this.state.customTimes,[t]:i},this.saveCustomTimesToStorage(),this.notify()}setCustomSpecialTime(t,i){this.state.customSpecialTimes={...this.state.customSpecialTimes,[t]:i},this.saveCustomTimesToStorage(),this.notify()}resetCustomTime(t){let{[t]:i,...n}=this.state.customTimes;this.state.customTimes=n;let{[t]:s,...o}=this.state.customSpecialTimes;this.state.customSpecialTimes=o,this.saveCustomTimesToStorage(),this.notify()}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){let t=this.getState();this.listeners.forEach(i=>i(t))}static loadCustomTimesFromStorage(){return{customTimes:R(xo,{}),customSpecialTimes:R(_o,{})}}saveCustomTimesToStorage(){D(xo,this.state.customTimes),D(_o,this.state.customSpecialTimes)}resetAllCustomTimes(){this.state.customTimes={},this.state.customSpecialTimes={},this.saveCustomTimesToStorage(),this.notify()}}});function $(e,t=7){let i=Math.round(e/60*100)/100,n=Math.round(i/t*100)/100;return{minutes:e,hours:i,days:n}}function G(e,t=!1){return e.minutes<60?`${e.minutes}min`:e.minutes<420?t?`${e.hours}h (${e.minutes}min)`:`${e.hours}h`:t?`${e.days}j (${e.hours}h)`:`${e.days}j`}var Mo=C(()=>{"use strict"});function ki(e,t){let i=new Date(e);return i.setDate(i.getDate()+Math.ceil(t)),i}function An(e,t){if(t===0)return new Date(e);let i=new Date(e),n=Math.ceil(t)-1,s=0;for(;s<n;){i.setDate(i.getDate()+1);let o=i.getDay();o!==0&&o!==6&&s++}return i}function Dn(e,t="short"){let i=typeof e=="string"?new Date(e):e;if(t==="iso")return i.toISOString().split("T")[0];if(t==="short"){let n=String(i.getDate()).padStart(2,"0"),s=String(i.getMonth()+1).padStart(2,"0");return`${n}/${s}`}return t==="french"?i.toLocaleDateString("fr-FR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}):i.toLocaleDateString("fr-FR",{year:"numeric",month:"long",day:"numeric"})}var So=C(()=>{"use strict"});function ft(e){let t={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,i=>t[i])}function Be(e,t="blue"){return`<span class="inline-block px-2 py-1 text-xs font-semibold rounded bg-${t}-100 text-${t}-800">${ft(e)}</span>`}var ko=C(()=>{"use strict"});function To(e){return!!e.onFile}var Rn=C(()=>{"use strict"});function wo(e,t){let i=new Map;for(let n of e){let s=t(n);s!=null&&(i.has(s)||i.set(s,[]),i.get(s).push(n))}return i}var Co=C(()=>{"use strict"});var Ut=C(()=>{"use strict";Mo();So();ko();Rn();Co()});function Eo(e,t,i){if(t<=1)return e;let n=Math.ceil(e.minutes/t);return $(n,i)}function Pn(e){return Dn(e,"short")}function Lo(e){return Dn(e,"long")}var fe=C(()=>{"use strict";Ut();Ut()});async function Ti(e){try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(e),!0;let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",document.body.appendChild(t),t.select();let i=document.execCommand("copy");return document.body.removeChild(t),i}catch(t){return console.error("Failed to copy to clipboard:",t),!1}}function wi(e,t=2e3){let i=e.textContent||"";e.textContent="\u2713 Copi\xE9 !",e.classList.add("bg-green-500","text-white"),setTimeout(()=>{e.textContent=i,e.classList.remove("bg-green-500","text-white")},t)}var Ao=C(()=>{"use strict"});function Xc(e,t,i,n,s){let o=t[e.ruleKey],r=o!==void 0?o:e.minutesPerOccurrence;if(e.type==="combined"||e.type==="special"){let c=r*(e.baseOccurrences||0),u=n.get(e.ruleKey)?.special_workload?.timePerOccurrence||0,h=i[e.ruleKey],f=h!==void 0?h:u,g=(e.specialWorkloadFiles||0)*f,p=c+g,m=$(p,s);return{...e,minutesPerOccurrence:r,specialTimePerFile:f,totalTime:m}}let a=r*e.occurrences,l=$(a,s);return{...e,minutesPerOccurrence:r,totalTime:l}}function Jc(e,t,i,n,s){return e.map(o=>{let r=o.rules.map(l=>Xc(l,t,i,n,s)),a=r.reduce((l,c)=>l+c.totalTime.minutes,0);return{priority:o.priority,totalTime:$(a,s),rules:r}})}function Zc(e,t,i,n,s){return e.map(o=>{let r=Jc(o.priorities,t,i,n,s),a=r.reduce((l,c)=>l+c.totalTime.minutes,0);return{migration:o.migration,totalTime:$(a,s),priorities:r}})}function Qc(e,t,i,n,s){return e.map(o=>{let r=Zc(o.migrations,t,i,n,s),a=r.reduce((l,c)=>l+c.totalTime.minutes,0);return{targetName:o.targetName,targetType:o.targetType,totalTime:$(a,s),migrations:r}})}function Do(e,t,i=7,n=[],s={}){let o=new Map(n.map(l=>[l.key,l])),r=Qc(e.targets,t,s,o,i),a=r.reduce((l,c)=>l+c.totalTime.minutes,0);return{totalTime:$(a,i),projectInfo:e.projectInfo,targets:r,stats:e.stats}}function Ro(e,t,i){return{original:e.totalTime,adjusted:Eo(e.totalTime,t,i)}}var Po=C(()=>{"use strict";fe()});function Io(e){td(e),id(e),dd(e),ad(e),ld(e)}function td(e){let t=e.targets.find(s=>s.targetType==="monorepo"),i=e.targets.filter(s=>s.targetType==="app"),n=e.targets.filter(s=>s.targetType==="lib");!t&&i.length===0&&n.length===0||(ed(e.targets),Oo("applications",i),Oo("librairies",n))}function ed(e){let t=e.reduce((n,s)=>n+s.totalTime.minutes,0),i=document.querySelectorAll("[data-monorepo-total-time]");if(i.length>0){let n=$(t,7),s=G(n);i.forEach(o=>{o.textContent=s})}}function Oo(e,t){if(t.length===0)return;let i=t.reduce((s,o)=>s+o.totalTime.minutes,0),n=document.querySelectorAll(`[data-group-time$="-${e}"]`);if(n.length>0){let s=$(i,7),o=G(s);n.forEach(r=>{r.textContent=o})}}function id(e){for(let t of e.targets){nd(t);for(let i of t.migrations){sd(t.targetName,i);for(let n of i.priorities){od(t.targetName,i.migration,n);for(let s of n.rules)rd(s)}}}}function nd(e){let t=document.querySelectorAll(`[data-target-time="${e.targetName}"]`);if(t.length>0){let i=G(e.totalTime);t.forEach(n=>{n.textContent=i})}}function sd(e,t){let i=`${e}-${t.migration}`,n=document.querySelectorAll(`[data-migration-time="${i}"]`);if(n.length>0){let s=G(t.totalTime);n.forEach(o=>{o.textContent=s})}}function od(e,t,i){let n=`${e}-${t}-${i.priority}`,s=document.querySelectorAll(`[data-priority-time="${n}"]`);if(s.length>0){let o=G(i.totalTime);s.forEach(r=>{r.textContent=o})}}function rd(e){document.querySelectorAll(`[data-calc-display="${e.ruleKey}"]`).forEach(i=>{let n=i,s=cd(n),o=0;if(e.type==="combined"){let l=e.minutesPerOccurrence*s,c=(e.specialWorkloadFiles||0)*(e.specialTimePerFile||0);o=l+c}else e.type==="special"?o=s*(e.specialTimePerFile||0):o=e.minutesPerOccurrence*s;let r=n.querySelector(`[data-rule-time="${e.ruleKey}"]`);if(r){let l=$(o,7);r.textContent=G(l)}n.querySelectorAll(`[data-time-input="${e.ruleKey}"]`).forEach(l=>{let c=l,d=String(e.minutesPerOccurrence);c.value!==d&&(c.value=d,c.setAttribute("data-original-time",d))}),e.specialTimePerFile!==void 0&&n.querySelectorAll(`[data-special-time-input="${e.ruleKey}"]`).forEach(c=>{let d=c,u=String(e.specialTimePerFile||0);d.value!==u&&(d.value=u,d.setAttribute("data-original-special-time",u))})})}function ad(e){let t=new Map;e.targets.forEach(o=>t.set(o.targetName,o));let i=e.targets.filter(o=>o.targetType==="app"||o.targetType==="lib");document.querySelectorAll("[data-flat-priority-time]").forEach(o=>{let r=o.getAttribute("data-flat-priority-time");if(!r)return;let a=r.match(/^(.+)-flat-(.+)$/);if(!a)return;let[,l,c]=a,d=0;if(l==="merged-apps-libs")i.forEach(u=>{u.migrations.forEach(h=>{h.priorities.forEach(f=>{f.priority===c&&(d+=f.totalTime.minutes)})})});else{let u=t.get(l);u&&u.migrations.forEach(h=>{h.priorities.forEach(f=>{f.priority===c&&(d+=f.totalTime.minutes)})})}if(d>0){let u=$(d,7);o.textContent=G(u)}}),document.querySelectorAll("[data-flat-migration-time]").forEach(o=>{let r=o.getAttribute("data-flat-migration-time");if(!r)return;let a=r.match(/^(.+)-flat-(to\d+)$/);if(!a)return;let[,l,c]=a,d=0;if(l==="merged-apps-libs")i.forEach(u=>{let h=u.migrations.find(f=>f.migration===c);h&&(d+=h.totalTime.minutes)});else{let u=t.get(l);if(u){let h=u.migrations.find(f=>f.migration===c);h&&(d=h.totalTime.minutes)}}if(d>0){let u=$(d,7);o.textContent=G(u)}})}function ld(e){let t=e.targets.filter(r=>r.targetType==="app"||r.targetType==="lib");if(t.length===0)return;let i=t.reduce((r,a)=>r+a.totalTime.minutes,0),n=document.querySelectorAll("[data-merged-apps-libs-time]");if(n.length>0){let r=$(i,7),a=G(r);n.forEach(l=>{l.textContent=a})}let s=new Map,o=new Map;t.forEach(r=>{r.migrations.forEach(a=>{let l=a.migration,c=s.get(l)||0;s.set(l,c+a.totalTime.minutes),a.priorities.forEach(d=>{let u=`${a.migration}-${d.priority}`,h=o.get(u)||0;o.set(u,h+d.totalTime.minutes)})})}),s.forEach((r,a)=>{let l=`merged-apps-libs-${a}`,c=document.querySelectorAll(`[data-migration-time="${l}"]`);if(c.length>0){let d=$(r,7),u=G(d);c.forEach(h=>{h.textContent=u})}}),o.forEach((r,a)=>{let[l,c]=a.split("-"),d=`merged-apps-libs-${l}-${c}`,u=document.querySelectorAll(`[data-priority-time="${d}"]`);if(u.length>0){let h=$(r,7),f=G(h);u.forEach(g=>{g.textContent=f})}})}function cd(e){let i=(e.textContent||"").match(/(\d+)\s*(occ|fichiers|×)/);return i?parseInt(i[1],10):1}function dd(e){for(let t of e.targets){let i=new Map;for(let n of t.migrations)for(let s of n.priorities){let o=s.priority,r=i.get(o)||0;i.set(o,r+s.totalTime.minutes)}i.forEach((n,s)=>{let o=t.migrations.map(a=>`${t.targetName}-${a.migration}-${s}`);document.querySelectorAll("span[data-priority-time]").forEach(a=>{let l=o.every(d=>a.getAttribute("data-priority-time")?.includes(d)||Array.from(a.attributes).some(u=>u.name==="data-priority-time"&&u.value===d)),c=Array.from(a.attributes).filter(d=>d.name==="data-priority-time");if(c.length>1){let d=c[0]?.value;if(d&&d.includes(t.targetName)&&d.includes(s)){let u=$(n,7);a.textContent=G(u)}}})})}}var Fo=C(()=>{"use strict";fe()});function $o(e,t,i,n){let s=new Map;e.targets.forEach(l=>{l.migrations.forEach(c=>{s.has(c.migration)||s.set(c.migration,[]),s.get(c.migration).push(c)})});let o=[],r=[],a=new Date(n);return ud.forEach(l=>{let c=s.get(l);if(!c||c.length===0)return;let{sequentialMinutes:d,parallelizableMinutes:u}=fd(c),h=d+u,f=d+Math.ceil(u/t),g=gd(f,i),p=An(a,g),m={id:l,label:l.toUpperCase(),duration:g,color:hd[l]||"#888",startDate:new Date(a),endDate:new Date(p)};o.push(m),r.push({migration:l.toUpperCase(),routineMinutes:d,parallelizableMinutes:u,totalMinutesBeforeDevs:h,totalDaysAfterDevs:g,devCount:t,hoursPerDay:i}),a=p}),{tasks:o,details:r}}function fd(e){let t=0,i=0;return e.forEach(n=>{n.priorities.forEach(s=>{let o=s.priority==="obligatoire";s.rules.forEach(r=>{if(!r||!r.totalTime){console.warn("[calculateMigrationMinutes] Invalid rule:",r);return}let a=r.totalTime.minutes;o?t+=a:i+=a})})}),{sequentialMinutes:t,parallelizableMinutes:i}}function gd(e,t){let i=e/60;return Math.round(i/t*100)/100}var ud,hd,Ho=C(()=>{"use strict";Ut();ud=["to18","to19","to20","to21"],hd={to18:"#2563eb",to19:"#4f46e5",to20:"#9333ea",to21:"#db2777"}});function Kt(e,t){let i=null;return function(...s){i!==null&&clearTimeout(i),i=setTimeout(()=>{e(...s),i=null},t)}}function Ci(e,t){let{offset:i=20,behavior:n="smooth",highlight:s=!0}=t||{},o=document.querySelector("[data-filter-toggle]")?.parentElement,a=(o?o.offsetHeight:80)+i,c=e.getBoundingClientRect().top+window.scrollY-a;window.scrollTo({top:c,behavior:n}),s&&pd(e)}function pd(e){document.querySelectorAll(".filter-highlight").forEach(t=>{t.classList.remove("filter-highlight")}),e.classList.add("filter-highlight")}var On=C(()=>{"use strict"});var In,Ve,Wo,Tb,wb,Ei=C(()=>{"use strict";In=[{version:"to18",sourceVersion:17,targetVersion:18,label:"Angular 17 \u2192 18",color:"blue"},{version:"to19",sourceVersion:18,targetVersion:19,label:"Angular 18 \u2192 19",color:"indigo"},{version:"to20",sourceVersion:19,targetVersion:20,label:"Angular 19 \u2192 20",color:"purple"},{version:"to21",sourceVersion:20,targetVersion:21,label:"Angular 20 \u2192 21",color:"pink"}],Ve=In.map(e=>e.version),Wo=[...Ve],Tb=Object.fromEntries(In.map(e=>[e.version,e.color])),wb=Object.fromEntries(In.map(e=>[e.version,e.label]))});function zo(e,t){if(Ve.every(a=>t.includes(a))||t.length===0)return e;let n=md(e.targets,t),s=bd(n),o=n.reduce((a,l)=>a+l.totalTime.minutes,0),r=$(o,7);return{...e,targets:n,stats:s,totalTime:r}}function md(e,t){return e.map(i=>{let n=i.migrations.filter(o=>t.includes(o.migration)),s=n.reduce((o,r)=>o+r.totalTime.minutes,0);return{...i,migrations:n,totalTime:$(s,7)}}).filter(i=>i.migrations.length>0)}function bd(e){let t=new Set,i=0,n=0;for(let s of e)for(let o of s.migrations)for(let r of o.priorities)for(let a of r.rules)t.add(a.ruleKey),i+=a.occurrences,a.specialWorkloadFiles!==void 0&&(n+=a.specialWorkloadFiles);return{uniqueRules:t.size,totalOccurrences:i,totalSpecialWorkloadFiles:n}}var Fn=C(()=>{"use strict";fe();Ei()});function $n(){let e=Bo();return e?Array.from(e.querySelectorAll("[data-rule-card]")):Array.from(document.querySelectorAll("[data-rule-card]"))}function Li(){let e=Bo();return e?Array.from(e.querySelectorAll("[data-rule-card].filter-match")):Array.from(document.querySelectorAll("[data-rule-card].filter-match"))}function Bo(){let e=document.querySelectorAll("[data-view-mode]");for(let t of e)if(!(t.style.display==="none"))return t;return null}var Vo=C(()=>{"use strict"});function Ai(e){let{id:t,theme:i="light",maxWidth:n=300}=e,s=document.getElementById(t);return s||(s=document.createElement("div"),s.id=t,s.style.cssText=`
|
|
2
|
+
position: fixed;
|
|
3
|
+
display: none;
|
|
4
|
+
border-radius: 6px;
|
|
5
|
+
padding: 8px 12px;
|
|
6
|
+
z-index: 9999;
|
|
7
|
+
pointer-events: none;
|
|
8
|
+
max-width: ${n}px;
|
|
9
|
+
font-size: 13px;
|
|
10
|
+
line-height: 1.4;
|
|
11
|
+
${yd[i]}
|
|
12
|
+
`,document.body.appendChild(s),s)}function Hn(e,t,i){let n=document.getElementById(e);n&&(n.innerHTML=t,n.style.display="block",No(n,i))}function Wn(e){let t=document.getElementById(e);t&&(t.style.display="none")}function zn(e,t){let i=document.getElementById(e);!i||i.style.display==="none"||No(i,t)}function No(e,t){let s=t.clientX+12,o=t.clientY+12,r=e.getBoundingClientRect(),a=window.innerWidth,l=window.innerHeight;s+r.width>a-10&&(s=t.clientX-r.width-12),o+r.height>l-10&&(o=t.clientY-r.height-12),e.style.left=`${s}px`,e.style.top=`${o}px`}function jo(e,t,i){let n=r=>{let a=i(e);a&&Hn(t,a,r)},s=r=>{zn(t,r)},o=()=>{Wn(t)};return e.addEventListener("mouseenter",n),e.addEventListener("mousemove",s),e.addEventListener("mouseleave",o),()=>{e.removeEventListener("mouseenter",n),e.removeEventListener("mousemove",s),e.removeEventListener("mouseleave",o)}}var yd,qo=C(()=>{"use strict";yd={light:`
|
|
13
|
+
background: white;
|
|
14
|
+
color: #1f2937;
|
|
15
|
+
border: 1px solid #e5e7eb;
|
|
16
|
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
|
17
|
+
`,dark:`
|
|
18
|
+
background: #1f2937;
|
|
19
|
+
color: white;
|
|
20
|
+
border: none;
|
|
21
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
22
|
+
`}});var J=C(()=>{"use strict";fe();ze();Ao();Po();Fo();Ho();On();Fn();Vo();qo()});function Bn(){R(Xt,[]).forEach(t=>{let i=document.getElementById(t);if(i){let n=i.querySelector("[data-collapse-content]"),s=i.querySelector("[data-collapse-icon]");n&&n.classList.add("hidden"),s&&(s.textContent="\u25B6")}}),document.addEventListener("click",t=>{let i=t.target.closest("[data-collapse-trigger]");if(!i)return;let n=i.getAttribute("data-collapse-trigger");n&&xd(n)})}function xd(e){let t=document.getElementById(e);if(!t)return;let i=t.querySelector("[data-collapse-content]"),n=t.querySelector("[data-collapse-icon]");if(!i)return;let s=i.classList.contains("hidden"),o=R(Xt,[]);if(s){i.classList.remove("hidden"),n&&(n.textContent="\u25BC");let r=o.indexOf(e);r>-1&&o.splice(r,1)}else i.classList.add("hidden"),n&&(n.textContent="\u25B6"),o.includes(e)||o.push(e);D(Xt,o)}function Yo(){document.querySelectorAll("[data-collapse-content]").forEach(e=>{e.classList.remove("hidden")}),document.querySelectorAll("[data-collapse-icon]").forEach(e=>{e.textContent="\u25BC"}),D(Xt,[])}function Go(){let e=[];document.querySelectorAll("[data-collapse-content]").forEach(t=>{t.classList.add("hidden");let i=t.closest("[id]");i?.id&&e.push(i.id)}),document.querySelectorAll("[data-collapse-icon]").forEach(t=>{t.textContent="\u25B6"}),D(Xt,e)}function Di(e){let t=R(Xt,[]),i=e;for(;i;){let n=i.closest("[data-collapse-content]");if(n){let s=n.closest("[id]");if(s?.id){let o=s.querySelector("[data-collapse-content]"),r=s.querySelector("[data-collapse-icon]");if(o?.classList.contains("hidden")){o.classList.remove("hidden"),r&&(r.textContent="\u25BC");let a=t.indexOf(s.id);a>-1&&t.splice(a,1)}}i=n.parentElement}else break}D(Xt,t)}var Xt,Ne=C(()=>{"use strict";J();Xt="collapsed-sections"});function Xo(){let e=R(Ko,"overview");Uo(e),document.addEventListener("click",t=>{let i=t.target.closest("[data-tab-trigger]");if(!i)return;let n=i.getAttribute("data-tab-trigger");n&&Uo(n)})}function Uo(e){document.querySelectorAll("[data-tab-trigger]").forEach(n=>{n.classList.remove("border-blue-600","text-blue-600","bg-blue-50"),n.classList.add("border-transparent","text-gray-600")}),document.querySelectorAll("[data-tab-content]").forEach(n=>{n.classList.add("hidden")});let t=document.querySelector(`[data-tab-trigger="${e}"]`);t&&(t.classList.remove("border-transparent","text-gray-600"),t.classList.add("border-blue-600","text-blue-600","bg-blue-50"));let i=document.querySelector(`[data-tab-content="${e}"]`);i&&i.classList.remove("hidden"),D(Ko,e)}var Ko,Jo=C(()=>{"use strict";J();Ko="active-tab"});function Zo(){document.addEventListener("click",e=>{let t=e.target.closest("[data-modal-trigger]");if(!t)return;let i=t.getAttribute("data-modal-trigger");i&&_d(i)}),document.addEventListener("click",e=>{e.target.closest("[data-modal-close]")&&Vn()}),document.addEventListener("click",e=>{e.target.hasAttribute("data-modal-overlay")&&Vn()}),document.addEventListener("keydown",e=>{e.key==="Escape"&&je&&Vn()})}function _d(e){let t=document.getElementById(e);t&&(t.classList.remove("hidden"),je=t,document.body.style.overflow="hidden")}function Vn(){je&&(je.classList.add("hidden"),je=null,document.body.style.overflow="")}function Qo(){document.addEventListener("click",e=>{let t=e.target.closest("[data-vscode-open]");if(!t)return;e.preventDefault();let i=t.getAttribute("data-relative-path"),n=t.getAttribute("data-line-number");if(!i)return;let o=window.__REPORT_DATA__?.workloadReport?.projectInfo?.path;if(!o){console.error("Project root not found in __REPORT_DATA__");return}let r=`${o}/${i}`.replace(/\\/g,"/"),l=`vscode://file/${vd(r)}${n?":"+n:""}`;window.location.href=l})}function vd(e){let t=e.replace(/\\/g,"/"),i=t.match(/^([A-Z]):/);return i&&(t=i[1].toLowerCase()+t.substring(1)),t}var je,tr=C(()=>{"use strict";je=null});function er(){let e=R(Nn,{isExpanded:!1});Md(e),Sd()}function Md(e){e.isExpanded?ir():nr()}function Sd(){let e=document.querySelector("[data-filter-toggle]");e&&e.addEventListener("click",kd)}function kd(){let e=document.querySelector("[data-filter-content]");if(!e)return;e.style.maxHeight&&e.style.maxHeight!=="0px"?(nr(),D(Nn,{isExpanded:!1})):(ir(),D(Nn,{isExpanded:!0}))}function ir(){let e=document.querySelector("[data-filter-content]"),t=document.querySelector("[data-filter-chevron]");e&&(e.style.maxHeight=e.scrollHeight+"px",t&&(t.style.transform="rotate(180deg)"))}function nr(){let e=document.querySelector("[data-filter-content]"),t=document.querySelector("[data-filter-chevron]");e&&(e.style.maxHeight="0",t&&(t.style.transform="rotate(0deg)"))}var Nn,sr=C(()=>{"use strict";J();Nn="filters-accordion-state"});var Ri,Pi,or,qe,jn=C(()=>{"use strict";Ri={critical:{emoji:"\u{1F534}",color:"red",label:"Critical"},high:{emoji:"\u{1F7E0}",color:"orange",label:"High"},medium:{emoji:"\u{1F7E1}",color:"yellow",label:"Medium"},low:{emoji:"\u{1F7E2}",color:"green",label:"Low"}},Pi={environment:{emoji:"\u{1F30D}",color:"blue",label:"Environment"},imports:{emoji:"\u{1F4E6}",color:"indigo",label:"Imports"},api:{emoji:"\u{1F50C}",color:"purple",label:"API"},routing:{emoji:"\u{1F6E3}\uFE0F",color:"pink",label:"Routing"},template:{emoji:"\u{1F4C4}",color:"teal",label:"Template"},test:{emoji:"\u{1F9EA}",color:"cyan",label:"Test"},ssr:{emoji:"\u26A1",color:"amber",label:"SSR"}},or={standard:{emoji:"\u{1F4CB}",color:"blue",label:"Standard"},routine:{emoji:"\u{1F527}",color:"teal",label:"Routine"},special:{emoji:"\u2B50",color:"pink",label:"Special"},combined:{emoji:"\u{1F500}",color:"purple",label:"Combined"}},qe={emoji:"\u{1F3F7}\uFE0F",color:"gray",label:"Unknown"}});function Ye(e){let t=document.querySelector("[data-active-chips-container]"),i=document.querySelector("[data-filter-active-count]");if(!t)return;let n=R(Td,{riskLevels:[],categories:[],autoFixable:null,ruleTypes:[],searchText:""});t.innerHTML="";let s=[];n.searchText&&s.push(wd(n.searchText)),n.riskLevels.forEach(r=>{s.push(qn("risk",r,Ri))}),n.categories.forEach(r=>{s.push(qn("category",r,Pi))}),n.ruleTypes.forEach(r=>{s.push(qn("type",r,or))});let o=s.length;if(o<9)s.forEach(r=>t.appendChild(r)),i&&i.classList.add("hidden");else{i&&i.classList.remove("hidden");let r=s.slice(0,rr),a=o-rr;r.forEach(l=>t.appendChild(l)),a>0&&t.appendChild(Cd(a))}Ed(e)}function qn(e,t,i){let n=i[t]||qe,s=document.createElement("div");return s.className=`inline-flex items-center gap-1 px-2 py-1 text-xs font-medium rounded-full bg-${n.color}-100 text-${n.color}-700 hover:bg-${n.color}-200 transition-colors`,s.dataset.filterChip=e,s.dataset.filterValue=t,s.innerHTML=`
|
|
2
23
|
<span>${n.emoji}</span>
|
|
3
24
|
<span>${n.label}</span>
|
|
4
25
|
<button
|
|
@@ -10,7 +31,7 @@
|
|
|
10
31
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
|
|
11
32
|
</svg>
|
|
12
33
|
</button>
|
|
13
|
-
`,s}function
|
|
34
|
+
`,s}function wd(e){let t=document.createElement("div");return t.className="inline-flex items-center gap-1 px-2 py-1 text-xs font-medium rounded-full bg-gray-100 text-gray-700 hover:bg-gray-200 transition-colors",t.dataset.filterChip="search",t.innerHTML=`
|
|
14
35
|
<span>\u{1F50E}</span>
|
|
15
36
|
<span class="max-w-32 truncate">"${e}"</span>
|
|
16
37
|
<button
|
|
@@ -22,175 +43,21 @@
|
|
|
22
43
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"/>
|
|
23
44
|
</svg>
|
|
24
45
|
</button>
|
|
25
|
-
`,t}function cd(e){let t=document.createElement("div");return t.className="inline-flex items-center px-2 py-1 text-xs font-semibold rounded-full bg-gray-200 text-gray-700",t.textContent=`+${e}`,t}function dd(e){document.querySelectorAll("[data-remove-filter]").forEach(t=>{t.addEventListener("click",i=>{i.stopPropagation();let n=t.dataset.removeFilter;n&&e(n)})})}var ad,Ko,Xo=C(()=>{"use strict";tt();$n();ad="active-filters",Ko=8});function Jo(){ud(),Di()}function ud(){let e=document.querySelector("[data-filter-prev]"),t=document.querySelector("[data-filter-next]");e&&e.addEventListener("click",()=>hd()),t&&t.addEventListener("click",()=>fd())}function hd(){let e=zn();e.length!==0&&(_t=(_t-1+e.length)%e.length,Zo(e[_t]),Di())}function fd(){let e=zn();e.length!==0&&(_t=(_t+1)%e.length,Zo(e[_t]),Di())}function zn(){return wi()}function Zo(e){Ci(e),setTimeout(()=>{ki(e,{offset:20,behavior:"smooth",highlight:!0})},50)}function Di(){let t=zn().length;_t>=t&&(_t=0);let i=document.querySelector("[data-filter-position]");i&&(t>0?i.textContent=`${_t+1} / ${t}`:i.textContent="0 / 0");let n=document.querySelector("[data-filter-prev]"),s=document.querySelector("[data-filter-next]");n&&(n.disabled=t===0),s&&(s.disabled=t===0)}function Qo(){_t=0,Di()}var _t,tr=C(()=>{"use strict";tt();Ei();_t=0});function er(){let e=P(Jt,ge);jo(),Jo(),pd(e),Ye(e),Ri(),qe(Oi),md()}function pd(e){e.riskLevels.forEach(i=>{let n=document.querySelector(`[data-filter-risk="${i}"]`);n&&(n.checked=!0)}),e.categories.forEach(i=>{let n=document.querySelector(`[data-filter-category="${i}"]`);n&&(n.checked=!0)}),e.ruleTypes.forEach(i=>{let n=document.querySelector(`[data-filter-type="${i}"]`);n&&(n.checked=!0)});let t=document.querySelector("[data-filter-search]");t&&(t.value=e.searchText)}function md(){document.querySelectorAll("[data-filter-risk]").forEach(i=>{i.addEventListener("change",Pi)}),document.querySelectorAll("[data-filter-category]").forEach(i=>{i.addEventListener("change",Pi)}),document.querySelectorAll("[data-filter-type]").forEach(i=>{i.addEventListener("change",Pi)});let e=document.querySelector("[data-filter-search]");e&&e.addEventListener("input",Pi);let t=document.querySelector("[data-filter-clear]");t&&t.addEventListener("click",yd)}function Pi(){let e={riskLevels:Bn("[data-filter-risk]"),categories:Bn("[data-filter-category]"),autoFixable:null,ruleTypes:Bn("[data-filter-type]"),searchText:document.querySelector("[data-filter-search]")?.value||""};D(Jt,e),Ye(e),Ri(),qe(Oi)}function Bn(e){let t=[];return document.querySelectorAll(e).forEach(i=>{let n=i;if(n.checked){let s=n.getAttribute(e.slice(1,-1));s&&t.push(s)}}),t}function Ye(e){let t=Rn(),i=null;t.forEach(n=>{let s=n,o=s.dataset.riskLevel,r=s.dataset.category,a=s.dataset.ruleType,l=s.dataset.title?.toLowerCase()||"",c=!0;e.riskLevels.length>0&&o&&(c=c&&e.riskLevels.includes(o)),e.categories.length>0&&r&&(c=c&&e.categories.includes(r)),e.ruleTypes.length>0&&a&&(c=c&&e.ruleTypes.includes(a)),e.searchText&&(c=c&&l.includes(e.searchText.toLowerCase())),c?(s.classList.remove("hidden","opacity-30","pointer-events-none"),s.classList.add("filter-match"),i||(i=s)):(s.classList.remove("hidden","filter-match"),s.classList.add("opacity-30","pointer-events-none"))}),bd(),Qo(),i&&_d(e)&&vd(i)}function bd(){let e=Rn().length,t=wi().length,i=document.querySelector("[data-filter-count]");i&&(i.textContent=`${t} / ${e} r\xE8gles`)}function yd(){document.querySelectorAll("[data-filter-risk], [data-filter-category], [data-filter-type]").forEach(t=>{t.checked=!1});let e=document.querySelector("[data-filter-search]");e&&(e.value=""),D(Jt,ge),Ye(ge),Ri(),qe(Oi)}function xd(){let e=P(Jt,ge);return e.riskLevels.length+e.categories.length+e.ruleTypes.length+(e.searchText?1:0)}function Ri(){let e=xd(),t=document.querySelector("[data-filter-active-count]");if(t){let i=e===0?"0 actif":e===1?"1 actif":`${e} actifs`;t.textContent=i,e===0?t.className="px-3 py-1 bg-gray-100 text-gray-600 text-sm font-semibold rounded-full transition-all":t.className="px-3 py-1 bg-blue-100 text-blue-700 text-sm font-semibold rounded-full transition-all"}}function _d(e){return e.riskLevels.length>0||e.categories.length>0||e.ruleTypes.length>0||e.searchText.length>0}function Oi(e){let t=P(Jt,ge);if(e==="search"){t.searchText="";let i=document.querySelector("[data-filter-search]");i&&(i.value="")}else{let[i,n]=e.split(":");({risk:()=>{t.riskLevels=t.riskLevels.filter(o=>o!==n),Wn(`[data-filter-risk="${n}"]`)},category:()=>{t.categories=t.categories.filter(o=>o!==n),Wn(`[data-filter-category="${n}"]`)},type:()=>{t.ruleTypes=t.ruleTypes.filter(o=>o!==n),Wn(`[data-filter-type="${n}"]`)}})[i]?.()}D(Jt,t),Ye(t),Ri(),qe(Oi)}function Wn(e){let t=document.querySelector(e);t&&(t.checked=!1)}function ir(){let e=P(Jt,ge);Ye(e)}var Jt,gd,ge,vd,Nn=C(()=>{"use strict";tt();tt();tt();Uo();Xo();tr();Ei();Jt="active-filters",gd=300,ge={riskLevels:[],categories:[],autoFixable:null,ruleTypes:[],searchText:""};vd=Kt(e=>{Ci(e),setTimeout(()=>{ki(e,{offset:20,behavior:"smooth",highlight:!0})},50)},gd)});function Md(e,t,i){document.querySelectorAll(`[${e}="${t}"]`).forEach(s=>{let o=s;o.value!==String(i)&&(o.value=String(i))})}function nr(e,t,i){let n=Kt((s,o)=>{t(i,s,o)},300);document.addEventListener("input",s=>{let o=s.target.closest(`[${e}]`);if(!o)return;let r=o.getAttribute(e),a=parseInt(o.value,10);!r||isNaN(a)||a<1||(Md(e,r,a),n(r,a))})}function sr(e){nr("data-time-input",(t,i,n)=>t.setCustomTime(i,n),e),nr("data-special-time-input",(t,i,n)=>t.setCustomSpecialTime(i,n),e),document.addEventListener("click",t=>{let i=t.target.closest("[data-time-reset]");if(!i)return;let n=i.getAttribute("data-time-reset");if(!n)return;e.resetCustomTime(n),document.querySelectorAll(`[data-time-input="${n}"]`).forEach(r=>{let a=r,l=a.getAttribute("data-original-time");l&&(a.value=l)}),document.querySelectorAll(`[data-special-time-input="${n}"]`).forEach(r=>{let a=r,l=a.getAttribute("data-original-special-time");l&&(a.value=l)})})}var or=C(()=>{"use strict";An()});function ar(){P(Vn,[]).forEach(t=>{let i=document.querySelector(`[data-checklist-item="${t}"]`);i&&(i.checked=!0,rr(i,!0))}),document.addEventListener("change",t=>{let i=t.target.closest("[data-checklist-item]");if(!i)return;let n=i.getAttribute("data-checklist-item");if(!n)return;let s=i.checked;Sd(n,s),rr(i,s)}),lr()}function Sd(e,t){let i=P(Vn,[]);if(t)i.includes(e)||i.push(e);else{let n=i.indexOf(e);n>-1&&i.splice(n,1)}D(Vn,i),lr()}function rr(e,t){let i=e.closest("[data-rule-card]");i&&(t?(i.classList.add("opacity-60","bg-green-50"),i.classList.remove("bg-white")):(i.classList.remove("opacity-60","bg-green-50"),i.classList.add("bg-white")))}function lr(){let e=document.querySelectorAll("[data-checklist-item]"),t=document.querySelectorAll("[data-checklist-item]:checked"),i=e.length,n=t.length,s=i>0?Math.round(n/i*100):0,o=document.querySelector("[data-progress-bar]");o&&(o.style.width=`${s}%`);let r=document.querySelector("[data-progress-text]");r&&(r.textContent=`${n} / ${i} (${s}%)`)}var Vn,cr=C(()=>{"use strict";tt();Vn="checklist-items"});function kd(e){let t=Li[e]||je,i=document.createElement("span");return i.className=`inline-flex items-center px-2 py-1 text-xs font-semibold rounded-full bg-${t.color}-100 text-${t.color}-800`,i.innerHTML=`<span class="mr-1">${t.emoji}</span>${t.label}`,i}function Td(e){let t=Ai[e]||{...je,label:e},i=document.createElement("span");return i.className=`inline-flex items-center px-2 py-1 text-xs font-medium rounded-full bg-${t.color}-100 text-${t.color}-700`,i.innerHTML=`<span class="mr-1">${t.emoji}</span>${t.label}`,i}function dr(){document.querySelectorAll("[data-rule-card]").forEach(t=>{let i=t,n=i.dataset.ruleKey,s=i.dataset.riskLevel,o=i.dataset.category;if(!n)return;let r=i.querySelector(`[data-chips-container="${n}"]`);if(r){if(r.innerHTML="",s){let a=kd(s);r.appendChild(a)}if(o){let a=Td(o);r.appendChild(a)}}})}var ur=C(()=>{"use strict";$n()});function Ke(e){return e+.5|0}function Ue(e){return Ft(Ke(e*2.55),0,255)}function $t(e){return Ft(Ke(e*255),0,255)}function Et(e){return Ft(Ke(e/2.55)/100,0,1)}function hr(e){return Ft(Ke(e*100),0,100)}function Ld(e){var t=e.length,i;return e[0]==="#"&&(t===4||t===5?i={r:255&mt[e[1]]*17,g:255&mt[e[2]]*17,b:255&mt[e[3]]*17,a:t===5?mt[e[4]]*17:255}:(t===7||t===9)&&(i={r:mt[e[1]]<<4|mt[e[2]],g:mt[e[3]]<<4|mt[e[4]],b:mt[e[5]]<<4|mt[e[6]],a:t===9?mt[e[7]]<<4|mt[e[8]]:255})),i}function Dd(e){var t=Ed(e)?wd:Cd;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Ad(e.a,t):void 0}function mr(e,t,i){let n=t*Math.min(i,1-i),s=(o,r=(o+e/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Rd(e,t,i){let n=(s,o=(s+e/60)%6)=>i-i*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function Od(e,t,i){let n=mr(e,1,.5),s;for(t+i>1&&(s=1/(t+i),t*=s,i*=s),s=0;s<3;s++)n[s]*=1-t-i,n[s]+=t;return n}function Id(e,t,i,n,s){return e===s?(t-i)/n+(t<i?6:0):t===s?(i-e)/n+2:(e-t)/n+4}function Yn(e){let i=e.r/255,n=e.g/255,s=e.b/255,o=Math.max(i,n,s),r=Math.min(i,n,s),a=(o+r)/2,l,c,d;return o!==r&&(d=o-r,c=a>.5?d/(2-o-r):d/(o+r),l=Id(i,n,s,d,o),l=l*60+.5),[l|0,c||0,a]}function Un(e,t,i,n){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,i,n)).map($t)}function Gn(e,t,i){return Un(mr,e,t,i)}function Fd(e,t,i){return Un(Od,e,t,i)}function $d(e,t,i){return Un(Rd,e,t,i)}function br(e){return(e%360+360)%360}function Hd(e){let t=Pd.exec(e),i=255,n;if(!t)return;t[5]!==n&&(i=t[6]?Ue(+t[5]):$t(+t[5]));let s=br(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=Fd(s,o,r):t[1]==="hsv"?n=$d(s,o,r):n=Gn(s,o,r),{r:n[0],g:n[1],b:n[2],a:i}}function zd(e,t){var i=Yn(e);i[0]=br(i[0]+t),i=Gn(i),e.r=i[0],e.g=i[1],e.b=i[2]}function Bd(e){if(!e)return;let t=Yn(e),i=t[0],n=hr(t[1]),s=hr(t[2]);return e.a<255?`hsla(${i}, ${n}%, ${s}%, ${Et(e.a)})`:`hsl(${i}, ${n}%, ${s}%)`}function Wd(){let e={},t=Object.keys(gr),i=Object.keys(fr),n,s,o,r,a;for(n=0;n<t.length;n++){for(r=a=t[n],s=0;s<i.length;s++)o=i[s],a=a.replace(o,fr[o]);o=parseInt(gr[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}function Nd(e){Fi||(Fi=Wd(),Fi.transparent=[0,0,0,0]);let t=Fi[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}function jd(e){let t=Vd.exec(e),i=255,n,s,o;if(t){if(t[7]!==n){let r=+t[7];i=t[8]?Ue(r):Ft(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?Ue(n):Ft(n,0,255)),s=255&(t[4]?Ue(s):Ft(s,0,255)),o=255&(t[6]?Ue(o):Ft(o,0,255)),{r:n,g:s,b:o,a:i}}}function qd(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Et(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}function Yd(e,t,i){let n=pe(Et(e.r)),s=pe(Et(e.g)),o=pe(Et(e.b));return{r:$t(jn(n+i*(pe(Et(t.r))-n))),g:$t(jn(s+i*(pe(Et(t.g))-s))),b:$t(jn(o+i*(pe(Et(t.b))-o))),a:e.a+i*(t.a-e.a)}}function $i(e,t,i){if(e){let n=Yn(e);n[t]=Math.max(0,Math.min(n[t]+n[t]*i,t===0?360:1)),n=Gn(n),e.r=n[0],e.g=n[1],e.b=n[2]}}function yr(e,t){return e&&Object.assign(t||{},e)}function pr(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=$t(e[3]))):(t=yr(e,{r:0,g:0,b:0,a:1}),t.a=$t(t.a)),t}function Ud(e){return e.charAt(0)==="r"?jd(e):Hd(e)}var Ft,mt,qn,wd,Cd,Ii,Ed,Ad,Pd,fr,gr,Fi,Vd,jn,pe,Ge,xr=C(()=>{Ft=(e,t,i)=>Math.max(Math.min(e,i),t);mt={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},qn=[..."0123456789ABCDEF"],wd=e=>qn[e&15],Cd=e=>qn[(e&240)>>4]+qn[e&15],Ii=e=>(e&240)>>4===(e&15),Ed=e=>Ii(e.r)&&Ii(e.g)&&Ii(e.b)&&Ii(e.a);Ad=(e,t)=>e<255?t(e):"";Pd=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;fr={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"},gr={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"};Vd=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;jn=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,pe=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);Ge=class e{constructor(t){if(t instanceof e)return t;let i=typeof t,n;i==="object"?n=pr(t):i==="string"&&(n=Ld(t)||Nd(t)||Ud(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=yr(this._rgb);return t&&(t.a=Et(t.a)),t}set rgb(t){this._rgb=pr(t)}rgbString(){return this._valid?qd(this._rgb):void 0}hexString(){return this._valid?Dd(this._rgb):void 0}hslString(){return this._valid?Bd(this._rgb):void 0}mix(t,i){if(t){let n=this.rgb,s=t.rgb,o,r=i===o?.5:i,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,i){return t&&(this._rgb=Yd(this._rgb,t._rgb,i)),this}clone(){return new e(this.rgb)}alpha(t){return this._rgb.a=$t(t),this}clearer(t){let i=this._rgb;return i.a*=1-t,this}greyscale(){let t=this._rgb,i=Ke(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=i,this}opaquer(t){let i=this._rgb;return i.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return $i(this._rgb,2,t),this}darken(t){return $i(this._rgb,2,-t),this}saturate(t){return $i(this._rgb,1,t),this}desaturate(t){return $i(this._rgb,1,-t),this}rotate(t){return zd(this._rgb,t),this}}});function St(){}function R(e){return e==null}function N(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function O(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Y(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function ct(e,t){return Y(e)?e:t}function E(e,t){return typeof e>"u"?t:e}function W(e,t,i){if(e&&typeof e.call=="function")return e.apply(i,t)}function H(e,t,i,n){let s,o,r;if(N(e))if(o=e.length,n)for(s=o-1;s>=0;s--)t.call(i,e[s],s);else for(s=0;s<o;s++)t.call(i,e[s],s);else if(O(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(i,e[r[s]],r[s])}function Ze(e,t){let i,n,s,o;if(!e||!t||e.length!==t.length)return!1;for(i=0,n=e.length;i<n;++i)if(s=e[i],o=t[i],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function Wi(e){if(N(e))return e.map(Wi);if(O(e)){let t=Object.create(null),i=Object.keys(e),n=i.length,s=0;for(;s<n;++s)t[i[s]]=Wi(e[i[s]]);return t}return e}function Pr(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function Gd(e,t,i,n){if(!Pr(e))return;let s=t[e],o=i[e];O(s)&&O(o)?be(s,o,n):t[e]=Wi(o)}function be(e,t,i){let n=N(t)?t:[t],s=n.length;if(!O(e))return e;i=i||{};let o=i.merger||Gd,r;for(let a=0;a<s;++a){if(r=n[a],!O(r))continue;let l=Object.keys(r);for(let c=0,d=l.length;c<d;++c)o(l[c],e,r,i)}return e}function xe(e,t){return be(e,t,{merger:Kd})}function Kd(e,t,i){if(!Pr(e))return;let n=t[e],s=i[e];O(n)&&O(s)?xe(n,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=Wi(s))}function Xd(e){let t=e.split("."),i=[],n="";for(let s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}function Jd(e){let t=Xd(e);return i=>{for(let n of t){if(n==="")break;i=i&&i[n]}return i}}function Dt(e,t){return(_r[t]||(_r[t]=Jd(t)))(e)}function qi(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Rr(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}function ve(e,t,i){return Math.abs(e-t)<i}function ts(e){let t=Math.round(e);e=ve(e,t,e/1e3)?t:e;let i=Math.pow(10,Math.floor(At(e))),n=e/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function Or(e){let t=[],i=Math.sqrt(e),n;for(n=1;n<i;n++)e%n===0&&(t.push(n),t.push(e/n));return i===(i|0)&&t.push(i),t.sort((s,o)=>s-o).pop(),t}function tu(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function ee(e){return!tu(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Ir(e,t){let i=Math.round(e);return i-t<=e&&i+t>=e}function es(e,t,i){let n,s,o;for(n=0,s=e.length;n<s;n++)o=e[n][i],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function bt(e){return e*(F/180)}function Yi(e){return e*(180/F)}function is(e){if(!Y(e))return;let t=1,i=0;for(;Math.round(e*t)/t!==e;)t*=10,i++;return i}function ns(e,t){let i=t.x-e.x,n=t.y-e.y,s=Math.sqrt(i*i+n*n),o=Math.atan2(n,i);return o<-.5*F&&(o+=V),{angle:o,distance:s}}function Vi(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function eu(e,t){return(e-t+Zd)%V-F}function et(e){return(e%V+V)%V}function Me(e,t,i,n){let s=et(e),o=et(t),r=et(i),a=et(o-s),l=et(r-s),c=et(s-o),d=et(s-r);return s===o||s===r||n&&o===r||a>l&&c<d}function Z(e,t,i){return Math.max(t,Math.min(i,e))}function Fr(e){return Z(e,-32768,32767)}function kt(e,t,i,n=1e-6){return e>=Math.min(t,i)-n&&e<=Math.max(t,i)+n}function Ui(e,t,i){i=i||(r=>e[r]<t);let n=e.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,i(o)?s=o:n=o;return{lo:s,hi:n}}function Hr(e,t,i){let n=0,s=e.length;for(;n<s&&e[n]<t;)n++;for(;s>n&&e[s-1]>i;)s--;return n>0||s<e.length?e.slice(n,s):e}function Br(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),zr.forEach(i=>{let n="_onData"+qi(i),s=e[i];Object.defineProperty(e,i,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...o)}),r}})})}function ss(e,t){let i=e._chartjs;if(!i)return;let n=i.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(zr.forEach(o=>{delete e[o]}),delete e._chartjs)}function os(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}function as(e,t){let i=[],n=!1;return function(...s){i=s,n||(n=!0,rs.call(window,()=>{n=!1,e.apply(t,i)}))}}function Wr(e,t){let i;return function(...n){return t?(clearTimeout(i),i=setTimeout(e,t,n)):e.apply(this,n),t}}function ls(e,t,i){let n=t.length,s=0,o=n;if(e._sorted){let{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,d=r.axis,{min:u,max:h,minDefined:f,maxDefined:g}=r.getUserBounds();if(f){if(s=Math.min(vt(l,d,u).lo,i?n:vt(t,d,r.getPixelForValue(u)).lo),c){let p=l.slice(0,s+1).reverse().findIndex(m=>!R(m[a.axis]));s-=Math.max(0,p)}s=Z(s,0,n-1)}if(g){let p=Math.max(vt(l,r.axis,h,!0).hi+1,i?0:vt(t,d,r.getPixelForValue(h),!0).hi+1);if(c){let m=l.slice(p-1).findIndex(b=>!R(b[a.axis]));p+=Math.max(0,m)}o=Z(p,s,n)-s}else o=n-s}return{start:s,count:o}}function cs(e){let{xScale:t,yScale:i,_scaleRanges:n}=e,s={xmin:t.min,xmax:t.max,ymin:i.min,ymax:i.max};if(!n)return e._scaleRanges=s,!0;let o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}function ds(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function us(e){return ds(e)?e:new Ge(e)}function Kn(e){return ds(e)?e:new Ge(e).saturate(.5).darken(.1).hexString()}function su(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:nu},numbers:{type:"number",properties:iu}}),e.describe("animations",{_fallback:"animation"}),e.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 ou(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}function ru(e,t){t=t||{};let i=e+JSON.stringify(t),n=kr.get(i);return n||(n=new Intl.NumberFormat(e,t),kr.set(i,n)),n}function Se(e,t,i){return ru(t,i).format(e)}function au(e,t){let i=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(i)>=1&&e!==Math.floor(e)&&(i=e-Math.floor(e)),i}function lu(e){e.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,i)=>i.lineWidth,tickColor:(t,i)=>i.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:Qe.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}function Xe(e,t){if(!t)return e;let i=t.split(".");for(let n=0,s=i.length;n<s;++n){let o=i[n];e=e[o]||(e[o]=Object.create(null))}return e}function Xn(e,t,i){return typeof t=="string"?be(Xe(e,t),i):be(Xe(e,""),t)}function cu(e){return!e||R(e.size)||R(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Je(e,t,i,n,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,i.push(s)),o>n&&(n=o),n}function jr(e,t,i,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),e.save(),e.font=t;let r=0,a=i.length,l,c,d,u,h;for(l=0;l<a;l++)if(u=i[l],u!=null&&!N(u))r=Je(e,s,o,r,u);else if(N(u))for(c=0,d=u.length;c<d;c++)h=u[c],h!=null&&!N(h)&&(r=Je(e,s,o,r,h));e.restore();let f=o.length/2;if(f>i.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return r}function Wt(e,t,i){let n=e.currentDevicePixelRatio,s=i!==0?Math.max(i/2,.5):0;return Math.round((t-s)*n)/n+s}function hs(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Xi(e,t,i,n){fs(e,t,i,n,null)}function fs(e,t,i,n,s){let o,r,a,l,c,d,u,h,f=t.pointStyle,g=t.rotation,p=t.radius,m=(g||0)*Qd;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(i,n),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!(isNaN(p)||p<=0)){switch(e.beginPath(),f){default:s?e.ellipse(i,n,s/2,p,0,0,V):e.arc(i,n,p,0,V),e.closePath();break;case"triangle":d=s?s/2:p,e.moveTo(i+Math.sin(m)*d,n-Math.cos(m)*p),m+=vr,e.lineTo(i+Math.sin(m)*d,n-Math.cos(m)*p),m+=vr,e.lineTo(i+Math.sin(m)*d,n-Math.cos(m)*p),e.closePath();break;case"rectRounded":c=p*.516,l=p-c,r=Math.cos(m+Zt)*l,u=Math.cos(m+Zt)*(s?s/2-c:l),a=Math.sin(m+Zt)*l,h=Math.sin(m+Zt)*(s?s/2-c:l),e.arc(i-u,n-a,c,m-F,m-G),e.arc(i+h,n-r,c,m-G,m),e.arc(i+u,n+a,c,m,m+G),e.arc(i-h,n+r,c,m+G,m+F),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,d=s?s/2:l,e.rect(i-d,n-l,2*d,2*l);break}m+=Zt;case"rectRot":u=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,h=Math.sin(m)*(s?s/2:p),e.moveTo(i-u,n-a),e.lineTo(i+h,n-r),e.lineTo(i+u,n+a),e.lineTo(i-h,n+r),e.closePath();break;case"crossRot":m+=Zt;case"cross":u=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,h=Math.sin(m)*(s?s/2:p),e.moveTo(i-u,n-a),e.lineTo(i+u,n+a),e.moveTo(i+h,n-r),e.lineTo(i-h,n+r);break;case"star":u=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,h=Math.sin(m)*(s?s/2:p),e.moveTo(i-u,n-a),e.lineTo(i+u,n+a),e.moveTo(i+h,n-r),e.lineTo(i-h,n+r),m+=Zt,u=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,h=Math.sin(m)*(s?s/2:p),e.moveTo(i-u,n-a),e.lineTo(i+u,n+a),e.moveTo(i+h,n-r),e.lineTo(i-h,n+r);break;case"line":r=s?s/2:Math.cos(m)*p,a=Math.sin(m)*p,e.moveTo(i-r,n-a),e.lineTo(i+r,n+a);break;case"dash":e.moveTo(i,n),e.lineTo(i+Math.cos(m)*(s?s/2:p),n+Math.sin(m)*p);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Mt(e,t,i){return i=i||.5,!t||e&&e.x>t.left-i&&e.x<t.right+i&&e.y>t.top-i&&e.y<t.bottom+i}function ti(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function ei(e){e.restore()}function qr(e,t,i,n,s){if(!t)return e.lineTo(i.x,i.y);if(s==="middle"){let o=(t.x+i.x)/2;e.lineTo(o,t.y),e.lineTo(o,i.y)}else s==="after"!=!!n?e.lineTo(t.x,i.y):e.lineTo(i.x,t.y);e.lineTo(i.x,i.y)}function Yr(e,t,i,n){if(!t)return e.lineTo(i.x,i.y);e.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function du(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),R(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function uu(e,t,i,n,s){if(s.strikethrough||s.underline){let o=e.measureText(n),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,c=i+o.actualBoundingBoxDescent,d=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,d),e.lineTo(a,d),e.stroke()}}function hu(e,t){let i=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=i}function Nt(e,t,i,n,s,o={}){let r=N(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=s.string,du(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&hu(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),R(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,i,n,o.maxWidth)),e.fillText(c,i,n,o.maxWidth),uu(e,i,n,c,o),n+=Number(s.lineHeight);e.restore()}function ke(e,t){let{x:i,y:n,w:s,h:o,radius:r}=t;e.arc(i+r.topLeft,n+r.topLeft,r.topLeft,1.5*F,F,!0),e.lineTo(i,n+o-r.bottomLeft),e.arc(i+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,F,G,!0),e.lineTo(i+s-r.bottomRight,n+o),e.arc(i+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,G,0,!0),e.lineTo(i+s,n+r.topRight),e.arc(i+s-r.topRight,n+r.topRight,r.topRight,0,-G,!0),e.lineTo(i+r.topLeft,n)}function pu(e,t){let i=(""+e).match(fu);if(!i||i[1]==="normal")return t*1.2;switch(e=+i[2],i[3]){case"px":return e;case"%":e/=100;break}return t*e}function Ji(e,t){let i={},n=O(t),s=n?Object.keys(t):t,o=O(e)?n?r=>E(e[r],e[t[r]]):r=>e[r]:()=>e;for(let r of s)i[r]=mu(o(r));return i}function gs(e){return Ji(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Vt(e){return Ji(e,["topLeft","topRight","bottomLeft","bottomRight"])}function nt(e){let t=gs(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function J(e,t){e=e||{},t=t||j.font;let i=E(e.size,t.size);typeof i=="string"&&(i=parseInt(i,10));let n=E(e.style,t.style);n&&!(""+n).match(gu)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);let s={family:E(e.family,t.family),lineHeight:pu(E(e.lineHeight,t.lineHeight),i),size:i,style:n,weight:E(e.weight,t.weight),string:""};return s.string=cu(s),s}function Te(e,t,i,n){let s=!0,o,r,a;for(o=0,r=e.length;o<r;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),i!==void 0&&N(a)&&(a=a[i%a.length],s=!1),a!==void 0))return n&&!s&&(n.cacheable=!1),a}function Ur(e,t,i){let{min:n,max:s}=e,o=Zn(t,(s-n)/2),r=(a,l)=>i&&a===0?0:a+l;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function Pt(e,t){return Object.assign(Object.create(e),t)}function Zi(e,t=[""],i,n,s=()=>e[0]){let o=i||e;typeof n>"u"&&(n=Xr("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:s,override:a=>Zi([a,...e],t,o,n)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return Gr(a,l,()=>ku(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return wr(a).includes(l)},ownKeys(a){return wr(a)},set(a,l,c){let d=a._storage||(a._storage=s());return a[l]=d[l]=c,delete a._keys,!0}})}function te(e,t,i,n){let s={_cacheable:!1,_proxy:e,_context:t,_subProxy:i,_stack:new Set,_descriptors:ps(e,n),setContext:o=>te(e,o,i,n),override:o=>te(e.override(o),t,i,n)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return Gr(o,r,()=>yu(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function ps(e,t={scriptable:!0,indexable:!0}){let{_scriptable:i=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:i,indexable:n,isScriptable:Lt(i)?i:()=>i,isIndexable:Lt(n)?n:()=>n}}function Gr(e,t,i){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];let n=i();return e[t]=n,n}function yu(e,t,i){let{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=e,a=n[t];return Lt(a)&&r.isScriptable(t)&&(a=xu(t,a,e,i)),N(a)&&a.length&&(a=_u(t,a,e,r.isIndexable)),ms(t,a)&&(a=te(a,s,o&&o[t],r)),a}function xu(e,t,i,n){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||n);return a.delete(e),ms(e,l)&&(l=bs(s._scopes,s,e,l)),l}function _u(e,t,i,n){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(typeof o.index<"u"&&n(e))return t[o.index%t.length];if(O(t[0])){let l=t,c=s._scopes.filter(d=>d!==l);t=[];for(let d of l){let u=bs(c,s,e,d);t.push(te(u,o,r&&r[e],a))}}return t}function Kr(e,t,i){return Lt(e)?e(t,i):e}function Mu(e,t,i,n,s){for(let o of t){let r=vu(i,o);if(r){e.add(r);let a=Kr(r._fallback,i,s);if(typeof a<"u"&&a!==i&&a!==n)return a}else if(r===!1&&typeof n<"u"&&i!==n)return null}return!1}function bs(e,t,i,n){let s=t._rootScopes,o=Kr(t._fallback,i,n),r=[...e,...s],a=new Set;a.add(n);let l=Tr(a,r,i,o||i,n);return l===null||typeof o<"u"&&o!==i&&(l=Tr(a,r,o,l,n),l===null)?!1:Zi(Array.from(a),[""],s,o,()=>Su(t,i,n))}function Tr(e,t,i,n,s){for(;i;)i=Mu(e,t,i,n,s);return i}function Su(e,t,i){let n=e._getTarget();t in n||(n[t]={});let s=n[t];return N(s)&&O(i)?i:s||{}}function ku(e,t,i,n){let s;for(let o of t)if(s=Xr(bu(o,e),i),typeof s<"u")return ms(e,s)?bs(i,n,e,s):s}function Xr(e,t){for(let i of t){if(!i)continue;let n=i[e];if(typeof n<"u")return n}}function wr(e){let t=e._keys;return t||(t=e._keys=Tu(e._scopes)),t}function Tu(e){let t=new Set;for(let i of e)for(let n of Object.keys(i).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function ys(e,t,i,n){let{iScale:s}=e,{key:o="r"}=this._parsing,r=new Array(n),a,l,c,d;for(a=0,l=n;a<l;++a)c=a+i,d=t[c],r[a]={r:s.parse(Dt(d,o),c)};return r}function Cu(e,t,i,n){let s=e.skip?t:e,o=t,r=i.skip?t:i,a=Vi(o,s),l=Vi(r,o),c=a/(a+l),d=l/(a+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;let u=n*c,h=n*d;return{previous:{x:o.x-u*(r.x-s.x),y:o.y-u*(r.y-s.y)},next:{x:o.x+h*(r.x-s.x),y:o.y+h*(r.y-s.y)}}}function Eu(e,t,i){let n=e.length,s,o,r,a,l,c=ye(e,0);for(let d=0;d<n-1;++d)if(l=c,c=ye(e,d+1),!(!l||!c)){if(ve(t[d],0,wu)){i[d]=i[d+1]=0;continue}s=i[d]/t[d],o=i[d+1]/t[d],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),i[d]=s*r*t[d],i[d+1]=o*r*t[d])}}function Lu(e,t,i="x"){let n=Jr(i),s=e.length,o,r,a,l=ye(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=ye(e,c+1),!a)continue;let d=a[i],u=a[n];r&&(o=(d-r[i])/3,a[`cp1${i}`]=d-o,a[`cp1${n}`]=u-o*t[c]),l&&(o=(l[i]-d)/3,a[`cp2${i}`]=d+o,a[`cp2${n}`]=u+o*t[c])}}function Au(e,t="x"){let i=Jr(t),n=e.length,s=Array(n).fill(0),o=Array(n),r,a,l,c=ye(e,0);for(r=0;r<n;++r)if(a=l,l=c,c=ye(e,r+1),!!l){if(c){let d=c[t]-l[t];s[r]=d!==0?(c[i]-l[i])/d:0}o[r]=a?c?xt(s[r-1])!==xt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Eu(e,s,o),Lu(e,o,t)}function zi(e,t,i){return Math.max(Math.min(e,i),t)}function Du(e,t){let i,n,s,o,r,a=Mt(e[0],t);for(i=0,n=e.length;i<n;++i)r=o,o=a,a=i<n-1&&Mt(e[i+1],t),o&&(s=e[i],r&&(s.cp1x=zi(s.cp1x,t.left,t.right),s.cp1y=zi(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=zi(s.cp2x,t.left,t.right),s.cp2y=zi(s.cp2y,t.top,t.bottom)))}function Zr(e,t,i,n,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Au(e,s);else{let c=n?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=Cu(c,a,e[Math.min(o+1,r-(n?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Du(e,i)}function Qi(){return typeof window<"u"&&typeof document<"u"}function tn(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function ji(e,t,i){let n;return typeof e=="string"?(n=parseInt(e,10),e.indexOf("%")!==-1&&(n=n/100*t.parentNode[i])):n=e,n}function Pu(e,t){return en(e).getPropertyValue(t)}function Qt(e,t,i){let n={};i=i?"-"+i:"";for(let s=0;s<4;s++){let o=Ru[s];n[o]=parseFloat(e[t+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Iu(e,t){let i=e.touches,n=i&&i.length?i[0]:e,{offsetX:s,offsetY:o}=n,r=!1,a,l;if(Ou(s,o,e.target))a=s,l=o;else{let c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function jt(e,t){if("native"in e)return e;let{canvas:i,currentDevicePixelRatio:n}=t,s=en(i),o=s.boxSizing==="border-box",r=Qt(s,"padding"),a=Qt(s,"border","width"),{x:l,y:c,box:d}=Iu(e,i),u=r.left+(d&&a.left),h=r.top+(d&&a.top),{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-u)/f*i.width/n),y:Math.round((c-h)/g*i.height/n)}}function Fu(e,t,i){let n,s;if(t===void 0||i===void 0){let o=e&&tn(e);if(!o)t=e.clientWidth,i=e.clientHeight;else{let r=o.getBoundingClientRect(),a=en(o),l=Qt(a,"border","width"),c=Qt(a,"padding");t=r.width-c.width-l.width,i=r.height-c.height-l.height,n=ji(a.maxWidth,o,"clientWidth"),s=ji(a.maxHeight,o,"clientHeight")}}return{width:t,height:i,maxWidth:n||Ni,maxHeight:s||Ni}}function Qr(e,t,i,n){let s=en(e),o=Qt(s,"margin"),r=ji(s.maxWidth,e,"clientWidth")||Ni,a=ji(s.maxHeight,e,"clientHeight")||Ni,l=Fu(e,t,i),{width:c,height:d}=l;if(s.boxSizing==="content-box"){let h=Qt(s,"border","width"),f=Qt(s,"padding");c-=f.width+h.width,d-=f.height+h.height}return c=Math.max(0,c-o.width),d=Math.max(0,n?c/n:d-o.height),c=zt(Math.min(c,r,l.maxWidth)),d=zt(Math.min(d,a,l.maxHeight)),c&&!d&&(d=zt(c/2)),(t!==void 0||i!==void 0)&&n&&l.height&&d>l.height&&(d=l.height,c=zt(Math.floor(d*n))),{width:c,height:d}}function xs(e,t,i){let n=t||1,s=zt(e.height*n),o=zt(e.width*n);e.height=zt(e.height),e.width=zt(e.width);let r=e.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==n||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=n,r.height=s,r.width=o,e.ctx.setTransform(n,0,0,n,0,0),!0):!1}function _s(e,t){let i=Pu(e,t),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Ht(e,t,i,n){return{x:e.x+i*(t.x-e.x),y:e.y+i*(t.y-e.y)}}function ea(e,t,i,n){return{x:e.x+i*(t.x-e.x),y:n==="middle"?i<.5?e.y:t.y:n==="after"?i<1?e.y:t.y:i>0?t.y:e.y}}function ia(e,t,i,n){let s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Ht(e,s,i),a=Ht(s,o,i),l=Ht(o,t,i),c=Ht(r,a,i),d=Ht(a,l,i);return Ht(c,d,i)}function ie(e,t,i){return e?$u(t,i):Hu()}function vs(e,t){let i,n;(t==="ltr"||t==="rtl")&&(i=e.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",t,"important"),e.prevTextDirection=n)}function Ms(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function na(e){return e==="angle"?{between:Me,compare:eu,normalize:et}:{between:kt,compare:(t,i)=>t-i,normalize:t=>t}}function Cr({start:e,end:t,count:i,loop:n,style:s}){return{start:e%i,end:t%i,loop:n&&(t-e+1)%i===0,style:s}}function zu(e,t,i){let{property:n,start:s,end:o}=i,{between:r,normalize:a}=na(n),l=t.length,{start:c,end:d,loop:u}=e,h,f;if(u){for(c+=l,d+=l,h=0,f=l;h<f&&r(a(t[c%l][n]),s,o);++h)c--,d--;c%=l,d%=l}return d<c&&(d+=l),{start:c,end:d,loop:u,style:e.style}}function Ss(e,t,i){if(!i)return[e];let{property:n,start:s,end:o}=i,r=t.length,{compare:a,between:l,normalize:c}=na(n),{start:d,end:u,loop:h,style:f}=zu(e,t,i),g=[],p=!1,m=null,b,y,_,v=()=>l(s,_,b)&&a(s,_)!==0,x=()=>a(o,b)===0||l(o,_,b),S=()=>p||v(),k=()=>!p||x();for(let T=d,w=d;T<=u;++T)y=t[T%r],!y.skip&&(b=c(y[n]),b!==_&&(p=l(b,s,o),m===null&&S()&&(m=a(b,s)===0?T:w),m!==null&&k()&&(g.push(Cr({start:m,end:T,loop:h,count:r,style:f})),m=null),w=T,_=b));return m!==null&&g.push(Cr({start:m,end:u,loop:h,count:r,style:f})),g}function ks(e,t){let i=[],n=e.segments;for(let s=0;s<n.length;s++){let o=Ss(n[s],e.points,t);o.length&&i.push(...o)}return i}function Bu(e,t,i,n){let s=0,o=t-1;if(i&&!n)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,i&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function Wu(e,t,i,n){let s=e.length,o=[],r=t,a=e[t],l;for(l=t+1;l<=i;++l){let c=e[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 sa(e,t){let i=e.points,n=e.options.spanGaps,s=i.length;if(!s)return[];let o=!!e._loop,{start:r,end:a}=Bu(i,s,o,n);if(n===!0)return Er(e,[{start:r,end:a,loop:o}],i,t);let l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Er(e,Wu(i,r,l,c),i,t)}function Er(e,t,i,n){return!n||!n.setContext||!i?t:Nu(e,t,i,n)}function Nu(e,t,i,n){let s=e._chart.getContext(),o=Lr(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=i.length,c=[],d=o,u=t[0].start,h=u;function f(g,p,m,b){let y=a?-1:1;if(g!==p){for(g+=l;i[g%l].skip;)g-=y;for(;i[p%l].skip;)p+=y;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:m,style:b}),d=b,u=p%l)}}for(let g of t){u=a?u:g.start;let p=i[u%l],m;for(h=u+1;h<=g.end;h++){let b=i[h%l];m=Lr(n.setContext(Pt(s,{type:"segment",p0:p,p1:b,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:r}))),Vu(m,d)&&f(u,h-1,g.loop,d),p=b,d=m}u<h-1&&f(u,h-1,g.loop,d)}return c}function Lr(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function Vu(e,t){if(!t)return!1;let i=[],n=function(s,o){return ds(o)?(i.includes(o)||i.push(o),i.indexOf(o)):o};return JSON.stringify(e,n)!==JSON.stringify(t,n)}function Bi(e,t,i){return e.options.clip?e[i]:t[i]}function ju(e,t){let{xScale:i,yScale:n}=e;return i&&n?{left:Bi(i,t,"left"),right:Bi(i,t,"right"),top:Bi(n,t,"top"),bottom:Bi(n,t,"bottom")}:t}function Ts(e,t){let i=t._clip;if(i.disabled)return!1;let n=ju(t,e.chartArea);return{left:i.left===!1?0:n.left-(i.left===!0?0:i.left),right:i.right===!1?e.width:n.right+(i.right===!0?0:i.right),top:i.top===!1?0:n.top-(i.top===!0?0:i.top),bottom:i.bottom===!1?e.height:n.bottom+(i.bottom===!0?0:i.bottom)}}var Ar,Dr,Zn,_r,_e,Lt,Qn,F,V,Zd,Ni,Qd,G,Zt,vr,At,xt,vt,$r,zr,rs,Gi,it,Nr,Hi,Mr,Sr,me,iu,nu,kr,Vr,Qe,Bt,Ki,Jn,j,fu,gu,mu,bu,ms,vu,wu,ye,Jr,en,Ru,Ou,zt,ta,$u,Hu,oa=C(()=>{xr();Ar=(()=>{let e=0;return()=>e++})();Dr=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Zn=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;_r={"":e=>e,x:e=>e.x,y:e=>e.y};_e=e=>typeof e<"u",Lt=e=>typeof e=="function",Qn=(e,t)=>{if(e.size!==t.size)return!1;for(let i of e)if(!t.has(i))return!1;return!0};F=Math.PI,V=2*F,Zd=V+F,Ni=Number.POSITIVE_INFINITY,Qd=F/180,G=F/2,Zt=F/4,vr=F*2/3,At=Math.log10,xt=Math.sign;vt=(e,t,i,n)=>Ui(e,i,n?s=>{let o=e[s][t];return o<i||o===i&&e[s+1][t]===i}:s=>e[s][t]<i),$r=(e,t,i)=>Ui(e,i,n=>e[n][t]>=i);zr=["push","pop","shift","splice","unshift"];rs=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();Gi=e=>e==="start"?"left":e==="end"?"right":"center",it=(e,t,i)=>e==="start"?t:e==="end"?i:(t+i)/2,Nr=(e,t,i,n)=>e===(n?"left":"right")?i:e==="center"?(t+i)/2:t;Hi=e=>e===0||e===1,Mr=(e,t,i)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*V/i)),Sr=(e,t,i)=>Math.pow(2,-10*e)*Math.sin((e-t)*V/i)+1,me={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*G)+1,easeOutSine:e=>Math.sin(e*G),easeInOutSine:e=>-.5*(Math.cos(F*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Hi(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Hi(e)?e:Mr(e,.075,.3),easeOutElastic:e=>Hi(e)?e:Sr(e,.075,.3),easeInOutElastic(e){return Hi(e)?e:e<.5?.5*Mr(e*2,.1125,.45):.5+.5*Sr(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-me.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?me.easeInBounce(e*2)*.5:me.easeOutBounce(e*2-1)*.5+.5};iu=["x","y","borderWidth","radius","tension"],nu=["color","borderColor","backgroundColor"];kr=new Map;Vr={values(e){return N(e)?e:""+e},numeric(e,t,i){if(e===0)return"0";let n=this.chart.options.locale,s,o=e;if(i.length>1){let c=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=au(e,i)}let r=At(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),Se(e,n,l)},logarithmic(e,t,i){if(e===0)return"0";let n=i[t].significand||e/Math.pow(10,Math.floor(At(e)));return[1,2,3,5,10,15].includes(n)||t>.8*i.length?Vr.numeric.call(this,e,t,i):""}};Qe={formatters:Vr};Bt=Object.create(null),Ki=Object.create(null);Jn=class{constructor(t,i){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=n=>n.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)=>Kn(s.backgroundColor),this.hoverBorderColor=(n,s)=>Kn(s.borderColor),this.hoverColor=(n,s)=>Kn(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(i)}set(t,i){return Xn(this,t,i)}get(t){return Xe(this,t)}describe(t,i){return Xn(Ki,t,i)}override(t,i){return Xn(Bt,t,i)}route(t,i,n,s){let o=Xe(this,t),r=Xe(this,n),a="_"+i;Object.defineProperties(o,{[a]:{value:o[i],writable:!0},[i]:{enumerable:!0,get(){let l=this[a],c=r[s];return O(l)?Object.assign({},c,l):E(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(i=>i(this))}},j=new Jn({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[su,ou,lu]);fu=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,gu=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;mu=e=>+e||0;bu=(e,t)=>e?e+qi(t):t,ms=(e,t)=>O(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);vu=(e,t)=>e===!0?t:typeof e=="string"?Dt(t,e):void 0;wu=Number.EPSILON||1e-14,ye=(e,t)=>t<e.length&&!e[t].skip&&e[t],Jr=e=>e==="x"?"y":"x";en=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);Ru=["top","right","bottom","left"];Ou=(e,t,i)=>(e>0||t>0)&&(!i||!i.shadowRoot);zt=e=>Math.round(e*10)/10;ta=(function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Qi()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();$u=function(e,t){return{x(i){return e+e+t-i},setWidth(i){t=i},textAlign(i){return i==="center"?i:i==="right"?"left":"right"},xPlus(i,n){return i-n},leftForLtr(i,n){return i-n}}},Hu=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}}});function Yu(e,t){let i=[],n=Object.keys(t);for(let s=0;s<n.length;s++){let o=e[n[s]];o&&o.active()&&i.push(o.wait())}return Promise.all(i)}function Uu(e,t){if(!t)return;let i=e.options;if(!i){e.options=t;return}return i.$shared&&(e.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}function aa(e,t){let i=e&&e.options||{},n=i.reverse,s=i.min===void 0?t:0,o=i.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function Gu(e,t,i){if(i===!1)return!1;let n=aa(e,i),s=aa(t,i);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function Ku(e){let t,i,n,s;return O(e)?(t=e.top,i=e.right,n=e.bottom,s=e.left):t=i=n=s=e,{top:t,right:i,bottom:n,left:s,disabled:e===!1}}function ol(e,t){let i=[],n=e._getSortedDatasetMetas(t),s,o;for(s=0,o=n.length;s<o;++s)i.push(n[s].index);return i}function la(e,t,i,n={}){let s=e.keys,o=n.mode==="single",r,a,l,c;if(t===null)return;let d=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===i){if(d=!0,n.all)continue;break}c=e.values[l],Y(c)&&(o||t===0||xt(t)===xt(c))&&(t+=c)}return!d&&!n.all?0:t}function Xu(e,t){let{iScale:i,vScale:n}=t,s=i.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length),l,c,d;for(l=0,c=r.length;l<c;++l)d=r[l],a[l]={[s]:d,[o]:e[d]};return a}function ws(e,t){let i=e&&e.options.stacked;return i||i===void 0&&t.stack!==void 0}function Ju(e,t,i){return`${e.id}.${t.id}.${i.stack||i.type}`}function Zu(e){let{min:t,max:i,minDefined:n,maxDefined:s}=e.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}function Qu(e,t,i){let n=e[t]||(e[t]={});return n[i]||(n[i]={})}function ca(e,t,i,n){for(let s of t.getMatchingVisibleMetas(n).reverse()){let o=e[s.index];if(i&&o>0||!i&&o<0)return s.index}return null}function da(e,t){let{chart:i,_cachedMeta:n}=e,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,d=Ju(o,r,n),u=t.length,h;for(let f=0;f<u;++f){let g=t[f],{[l]:p,[c]:m}=g,b=g._stacks||(g._stacks={});h=b[c]=Qu(s,d,p),h[a]=m,h._top=ca(h,r,!0,n.type),h._bottom=ca(h,r,!1,n.type);let y=h._visualValues||(h._visualValues={});y[a]=m}}function Cs(e,t){let i=e.scales;return Object.keys(i).filter(n=>i[n].axis===t).shift()}function th(e,t){return Pt(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function eh(e,t,i){return Pt(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:i,index:t,mode:"default",type:"data"})}function ii(e,t){let i=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){t=t||e._parsed;for(let s of t){let o=s._stacks;if(!o||o[n]===void 0||o[n][i]===void 0)return;delete o[n][i],o[n]._visualValues!==void 0&&o[n]._visualValues[i]!==void 0&&delete o[n]._visualValues[i]}}}function nh(e,t){if(!e._cache.$bar){let i=e.getMatchingVisibleMetas(t),n=[];for(let s=0,o=i.length;s<o;s++)n=n.concat(i[s].controller.getAllParsedValues(e));e._cache.$bar=os(n.sort((s,o)=>s-o))}return e._cache.$bar}function sh(e){let t=e.iScale,i=nh(t,e.type),n=t._length,s,o,r,a,l=()=>{r===32767||r===-32768||(_e(a)&&(n=Math.min(n,Math.abs(r-a)||n)),a=r)};for(s=0,o=i.length;s<o;++s)r=t.getPixelForValue(i[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return n}function oh(e,t,i,n){let s=i.barThickness,o,r;return R(s)?(o=t.min*i.categoryPercentage,r=i.barPercentage):(o=s*n,r=1),{chunk:o/n,ratio:r,start:t.pixels[e]-o/2}}function rh(e,t,i,n){let s=t.pixels,o=s[e],r=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null,l=i.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);let c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/n,ratio:i.barPercentage,start:c}}function ah(e,t,i,n){let s=i.parse(e[0],n),o=i.parse(e[1],n),r=Math.min(s,o),a=Math.max(s,o),l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[i.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function rl(e,t,i,n){return N(e)?ah(e,t,i,n):t[i.axis]=i.parse(e,n),t}function ha(e,t,i,n){let s=e.iScale,o=e.vScale,r=s.getLabels(),a=s===o,l=[],c,d,u,h;for(c=i,d=i+n;c<d;++c)h=t[c],u={},u[s.axis]=a||s.parse(r[c],c),l.push(rl(h,u,o,c));return l}function Ls(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function lh(e,t,i){return e!==0?xt(e):(t.isHorizontal()?1:-1)*(t.min>=i?1:-1)}function ch(e){let t,i,n,s,o;return e.horizontal?(t=e.base>e.x,i="left",n="right"):(t=e.base<e.y,i="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:i,end:n,reverse:t,top:s,bottom:o}}function dh(e,t,i,n){let s=t.borderSkipped,o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:r,end:a,reverse:l,top:c,bottom:d}=ch(e);s==="middle"&&i&&(e.enableBorderRadius=!0,(i._top||0)===n?s=c:(i._bottom||0)===n?s=d:(o[fa(d,r,a,l)]=!0,s=c)),o[fa(s,r,a,l)]=!0,e.borderSkipped=o}function fa(e,t,i,n){return n?(e=uh(e,t,i),e=ga(e,i,t)):e=ga(e,t,i),e}function uh(e,t,i){return e===t?i:e===i?t:e}function ga(e,t,i){return e==="start"?t:e==="end"?i:e}function hh(e,{inflateAmount:t},i){e.inflateAmount=t==="auto"?i===1?.33:0:t}function fh(e,t,i){let n=1,s=1,o=0,r=0;if(t<V){let a=e,l=a+t,c=Math.cos(a),d=Math.sin(a),u=Math.cos(l),h=Math.sin(l),f=(_,v,x)=>Me(_,a,l,!0)?1:Math.max(v,v*i,x,x*i),g=(_,v,x)=>Me(_,a,l,!0)?-1:Math.min(v,v*i,x,x*i),p=f(0,c,u),m=f(G,d,h),b=g(F,c,u),y=g(F+G,d,h);n=(p-b)/2,s=(m-y)/2,o=-(p+b)/2,r=-(m+y)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}function ne(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}function mh(e,t,i,n){let{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let c=a._reversePixels?$r:vt;if(n){if(s._sharedOptions){let d=o[0],u=typeof d.getRange=="function"&&d.getRange(t);if(u){let h=c(o,t,i-u),f=c(o,t,i+u);return{lo:h.lo,hi:f.hi}}}}else{let d=c(o,t,i);if(l){let{vScale:u}=s._cachedMeta,{_parsed:h}=e,f=h.slice(0,d.lo+1).reverse().findIndex(p=>!R(p[u.axis]));d.lo-=Math.max(0,f);let g=h.slice(d.hi).findIndex(p=>!R(p[u.axis]));d.hi+=Math.max(0,g)}return d}}return{lo:0,hi:o.length-1}}function yi(e,t,i,n,s){let o=e.getSortedVisibleDatasetMetas(),r=i[t];for(let a=0,l=o.length;a<l;++a){let{index:c,data:d}=o[a],{lo:u,hi:h}=mh(o[a],t,r,s);for(let f=u;f<=h;++f){let g=d[f];g.skip||n(g,c,f)}}}function bh(e){let t=e.indexOf("x")!==-1,i=e.indexOf("y")!==-1;return function(n,s){let o=t?Math.abs(n.x-s.x):0,r=i?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function As(e,t,i,n,s){let o=[];return!s&&!e.isPointInArea(t)||yi(e,i,t,function(a,l,c){!s&&!Mt(a,e.chartArea,0)||a.inRange(t.x,t.y,n)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function yh(e,t,i,n){let s=[];function o(r,a,l){let{startAngle:c,endAngle:d}=r.getProps(["startAngle","endAngle"],n),{angle:u}=ns(r,{x:t.x,y:t.y});Me(u,c,d)&&s.push({element:r,datasetIndex:a,index:l})}return yi(e,i,t,o),s}function xh(e,t,i,n,s,o){let r=[],a=bh(i),l=Number.POSITIVE_INFINITY;function c(d,u,h){let f=d.inRange(t.x,t.y,s);if(n&&!f)return;let g=d.getCenterPoint(s);if(!(!!o||e.isPointInArea(g))&&!f)return;let m=a(t,g);m<l?(r=[{element:d,datasetIndex:u,index:h}],l=m):m===l&&r.push({element:d,datasetIndex:u,index:h})}return yi(e,i,t,c),r}function Ds(e,t,i,n,s,o){return!o&&!e.isPointInArea(t)?[]:i==="r"&&!n?yh(e,t,i,s):xh(e,t,i,n,s,o)}function pa(e,t,i,n,s){let o=[],r=i==="x"?"inXRange":"inYRange",a=!1;return yi(e,i,t,(l,c,d)=>{l[r]&&l[r](t[i],s)&&(o.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:o}function ni(e,t){return e.filter(i=>i.pos===t)}function ma(e,t){return e.filter(i=>al.indexOf(i.pos)===-1&&i.box.axis===t)}function si(e,t){return e.sort((i,n)=>{let s=t?n:i,o=t?i:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function vh(e){let t=[],i,n,s,o,r,a;for(i=0,n=(e||[]).length;i<n;++i)s=e[i],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:i,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function Mh(e){let t={};for(let i of e){let{stack:n,pos:s,stackWeight:o}=i;if(!n||!al.includes(s))continue;let r=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Sh(e,t){let i=Mh(e),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];let{fullSize:l}=a.box,c=i[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*n:l&&t.availableWidth,a.height=s):(a.width=n,a.height=d?d*s:l&&t.availableHeight)}return i}function kh(e){let t=vh(e),i=si(t.filter(c=>c.box.fullSize),!0),n=si(ni(t,"left"),!0),s=si(ni(t,"right")),o=si(ni(t,"top"),!0),r=si(ni(t,"bottom")),a=ma(t,"x"),l=ma(t,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:ni(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function ba(e,t,i,n){return Math.max(e[i],t[i])+Math.max(e[n],t[n])}function ll(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Th(e,t,i,n){let{pos:s,box:o}=i,r=e.maxPadding;if(!O(s)){i.size&&(e[s]-=i.size);let u=n[i.stack]||{size:0,count:1};u.size=Math.max(u.size,i.horizontal?o.height:o.width),i.size=u.size/u.count,e[s]+=i.size}o.getPadding&&ll(r,o.getPadding());let a=Math.max(0,t.outerWidth-ba(r,e,"left","right")),l=Math.max(0,t.outerHeight-ba(r,e,"top","bottom")),c=a!==e.w,d=l!==e.h;return e.w=a,e.h=l,i.horizontal?{same:c,other:d}:{same:d,other:c}}function wh(e){let t=e.maxPadding;function i(n){let s=Math.max(t[n]-e[n],0);return e[n]+=s,s}e.y+=i("top"),e.x+=i("left"),i("right"),i("bottom")}function Ch(e,t){let i=t.maxPadding;function n(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],i[r])}),o}return n(e?["left","right"]:["top","bottom"])}function li(e,t,i,n){let s=[],o,r,a,l,c,d;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Ch(a.horizontal,t));let{same:u,other:h}=Th(t,i,a,n);c|=u&&s.length,d=d||h,l.fullSize||s.push(a)}return c&&li(s,t,i,n)||d}function nn(e,t,i,n,s){e.top=i,e.left=t,e.right=t+n,e.bottom=i+s,e.width=n,e.height=s}function ya(e,t,i,n){let s=i.padding,{x:o,y:r}=t;for(let a of e){let l=a.box,c=n[a.stack]||{count:1,placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){let u=t.w*d,h=c.size||l.height;_e(c.start)&&(r=c.start),l.fullSize?nn(l,s.left,r,i.outerWidth-s.right-s.left,h):nn(l,t.left+c.placed,r,u,h),c.start=r,c.placed+=u,r=l.bottom}else{let u=t.h*d,h=c.size||l.width;_e(c.start)&&(o=c.start),l.fullSize?nn(l,o,s.top,h,i.outerHeight-s.bottom-s.top):nn(l,o,t.top+c.placed,h,u),c.start=o,c.placed+=u,o=l.right}}t.x=o,t.y=r}function Lh(e,t){let i=e.style,n=e.getAttribute("height"),s=e.getAttribute("width");if(e[cn]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",xa(s)){let o=_s(e,"width");o!==void 0&&(e.width=o)}if(xa(n))if(e.style.height==="")e.height=e.width/(t||2);else{let o=_s(e,"height");o!==void 0&&(e.height=o)}return e}function Ah(e,t,i){e&&e.addEventListener(t,i,cl)}function Dh(e,t,i){e&&e.canvas&&e.canvas.removeEventListener(t,i,cl)}function Ph(e,t){let i=Eh[e.type]||e.type,{x:n,y:s}=jt(e,t);return{type:i,chart:t,native:e,x:n!==void 0?n:null,y:s!==void 0?s:null}}function fn(e,t){for(let i of e)if(i===t||i.contains(t))return!0}function Rh(e,t,i){let n=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||fn(a.addedNodes,n),r=r&&!fn(a.removedNodes,n);r&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function Oh(e,t,i){let n=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||fn(a.removedNodes,n),r=r&&!fn(a.addedNodes,n);r&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function dl(){let e=window.devicePixelRatio;e!==_a&&(_a=e,pi.forEach((t,i)=>{i.currentDevicePixelRatio!==e&&t()}))}function Ih(e,t){pi.size||window.addEventListener("resize",dl),pi.set(e,t)}function Fh(e){pi.delete(e),pi.size||window.removeEventListener("resize",dl)}function $h(e,t,i){let n=e.canvas,s=n&&tn(n);if(!s)return;let o=as((a,l)=>{let c=s.clientWidth;i(a,l),c<s.clientWidth&&i()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return r.observe(s),Ih(e,o),r}function Ps(e,t,i){i&&i.disconnect(),t==="resize"&&Fh(e)}function Hh(e,t,i){let n=e.canvas,s=as(o=>{e.ctx!==null&&i(Ph(o,e))},e);return Ah(n,t,s),s}function zh(e){return!Qi()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Bs:Ws}function Bh(e,t){let i=e.options.ticks,n=Wh(e),s=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?Vh(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return jh(t,c,o,r/s),c;let d=Nh(o,t,s);if(r>0){let u,h,f=r>1?Math.round((l-a)/(r-1)):null;for(sn(t,c,d,R(f)?0:a-f,a),u=0,h=r-1;u<h;u++)sn(t,c,d,o[u],o[u+1]);return sn(t,c,d,l,R(f)?t.length:l+f),c}return sn(t,c,d),c}function Wh(e){let t=e.options.offset,i=e._tickSize(),n=e._length/i+(t?0:1),s=e._maxLength/i;return Math.floor(Math.min(n,s))}function Nh(e,t,i){let n=qh(e),s=t.length/i;if(!n)return Math.max(s,1);let o=Or(n);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function Vh(e){let t=[],i,n;for(i=0,n=e.length;i<n;i++)e[i].major&&t.push(i);return t}function jh(e,t,i,n){let s=0,o=i[0],r;for(n=Math.ceil(n),r=0;r<e.length;r++)r===o&&(t.push(e[r]),s++,o=i[s*n])}function sn(e,t,i,n,s){let o=E(n,0),r=Math.min(E(s,e.length),e.length),a=0,l,c,d;for(i=Math.ceil(i),s&&(l=s-n,i=l/Math.floor(l/i)),d=o;d<0;)a++,d=Math.round(o+a*i);for(c=Math.max(o,0);c<r;c++)c===d&&(t.push(e[c]),a++,d=Math.round(o+a*i))}function qh(e){let t=e.length,i,n;if(t<2)return!1;for(n=e[0],i=1;i<t;++i)if(e[i]-e[i-1]!==n)return!1;return n}function Sa(e,t){let i=[],n=e.length/t,s=e.length,o=0;for(;o<s;o+=n)i.push(e[Math.floor(o)]);return i}function Uh(e,t,i){let n=e.ticks.length,s=Math.min(t,n-1),o=e._startPixel,r=e._endPixel,a=1e-6,l=e.getPixelForTick(s),c;if(!(i&&(n===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function Gh(e,t){H(e,i=>{let n=i.gc,s=n.length/2,o;if(s>t){for(o=0;o<s;++o)delete i.data[n[o]];n.splice(0,s)}})}function oi(e){return e.drawTicks?e.tickLength:0}function ka(e,t){if(!e.display)return 0;let i=J(e.font,t),n=nt(e.padding);return(N(e.text)?e.text.length:1)*i.lineHeight+n.height}function Kh(e,t){return Pt(e,{scale:t,type:"scale"})}function Xh(e,t,i){return Pt(e,{tick:i,index:t,type:"tick"})}function Jh(e,t,i){let n=Gi(e);return(i&&t!=="right"||!i&&t==="right")&&(n=Yh(n)),n}function Zh(e,t,i,n){let{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:d}=l,u=0,h,f,g,p=r-s,m=a-o;if(e.isHorizontal()){if(f=it(n,o,a),O(i)){let b=Object.keys(i)[0],y=i[b];g=d[b].getPixelForValue(y)+p-t}else i==="center"?g=(c.bottom+c.top)/2+p-t:g=va(e,i,t);h=a-o}else{if(O(i)){let b=Object.keys(i)[0],y=i[b];f=d[b].getPixelForValue(y)-m+t}else i==="center"?f=(c.left+c.right)/2-m+t:f=va(e,i,t);g=it(n,r,s),u=i==="left"?-G:G}return{titleX:f,titleY:g,maxWidth:h,rotation:u}}function Qh(e,t,i){let n=be(Object.create(null),[i?j.get(i):{},j.get(t),e.defaults]);j.set(t,n),e.defaultRoutes&&tf(t,e.defaultRoutes),e.descriptors&&j.describe(t,e.descriptors)}function tf(e,t){Object.keys(t).forEach(i=>{let n=i.split("."),s=n.pop(),o=[e].concat(n).join("."),r=t[i].split("."),a=r.pop(),l=r.join(".");j.route(o,s,l,a)})}function ef(e){return"id"in e&&"defaults"in e}function nf(e){let t={},i=[],n=Object.keys(wt.plugins.items);for(let o=0;o<n.length;o++)i.push(wt.getPlugin(n[o]));let s=e.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];i.indexOf(r)===-1&&(i.push(r),t[r.id]=!0)}return{plugins:i,localIds:t}}function sf(e,t){return!t&&e===!1?null:e===!0?{}:e}function of(e,{plugins:t,localIds:i},n,s){let o=[],r=e.getContext();for(let a of t){let l=a.id,c=sf(n[l],s);c!==null&&o.push({plugin:a,options:rf(e.config,{plugin:a,local:i[l]},c,r)})}return o}function rf(e,{plugin:t,local:i},n,s){let o=e.pluginScopeKeys(t),r=e.getOptionScopes(n,o);return i&&t.defaults&&r.push(t.defaults),e.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function js(e,t){let i=j.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||i.indexAxis||"x"}function af(e,t){let i=e;return e==="_index_"?i=t:e==="_value_"&&(i=t==="x"?"y":"x"),i}function lf(e,t){return e===t?"_index_":"_value_"}function Ta(e){if(e==="x"||e==="y"||e==="r")return e}function cf(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function qs(e,...t){if(Ta(e))return e;for(let i of t){let n=i.axis||cf(i.position)||e.length>1&&Ta(e[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function wa(e,t,i){if(i[t+"AxisID"]===e)return{axis:t}}function df(e,t){if(t.data&&t.data.datasets){let i=t.data.datasets.filter(n=>n.xAxisID===e||n.yAxisID===e);if(i.length)return wa(e,"x",i[0])||wa(e,"y",i[0])}return{}}function uf(e,t){let i=Bt[e.type]||{scales:{}},n=t.scales||{},s=js(e.type,t),o=Object.create(null);return Object.keys(n).forEach(r=>{let a=n[r];if(!O(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);let l=qs(r,a,df(r,e),j.scales[a.type]),c=lf(l,s),d=i.scales||{};o[r]=xe(Object.create(null),[{axis:l},a,d[l],d[c]])}),e.data.datasets.forEach(r=>{let a=r.type||e.type,l=r.indexAxis||js(a,t),d=(Bt[a]||{}).scales||{};Object.keys(d).forEach(u=>{let h=af(u,l),f=r[h+"AxisID"]||h;o[f]=o[f]||Object.create(null),xe(o[f],[{axis:h},n[f],d[u]])})}),Object.keys(o).forEach(r=>{let a=o[r];xe(a,[j.scales[a.type],j.scale])}),o}function ul(e){let t=e.options||(e.options={});t.plugins=E(t.plugins,{}),t.scales=uf(e,t)}function hl(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function hf(e){return e=e||{},e.data=hl(e.data),ul(e),e}function on(e,t){let i=Ca.get(e);return i||(i=t(),Ca.set(e,i),fl.add(i)),i}function Ea(e,t,i){let n=e.get(t);n||(n=new Map,e.set(t,n));let s=i.join(),o=n.get(s);return o||(o={resolver:Zi(t,i),subPrefixes:i.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}function gf(e,t){let{isScriptable:i,isIndexable:n}=ps(e);for(let s of t){let o=i(s),r=n(s),a=(r||o)&&e[s];if(o&&(Lt(a)||ff(a))||r&&N(a))return!0}return!1}function La(e,t){return e==="top"||e==="bottom"||mf.indexOf(e)===-1&&t==="x"}function Aa(e,t){return function(i,n){return i[e]===n[e]?i[t]-n[t]:i[e]-n[e]}}function Da(e){let t=e.chart,i=t.options.animation;t.notifyPlugins("afterRender"),W(i&&i.onComplete,[e],t)}function bf(e){let t=e.chart,i=t.options.animation;W(i&&i.onProgress,[e],t)}function gl(e){return Qi()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}function yf(e,t,i){let n=Object.keys(e);for(let s of n){let o=+s;if(o>=t){let r=e[s];delete e[s],(i>0||o>t)&&(e[o+i]=r)}}}function xf(e,t,i,n){return!i||e.type==="mouseout"?null:n?t:e}function Ra(){return H(lt.instances,e=>e._plugins.invalidate())}function _f(e,t,i){let{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:d}=l,u=Math.min(c/r,et(n-i));if(e.beginPath(),e.arc(s,o,r-c/2,n+u/2,i-u/2),a>0){let h=Math.min(c/a,et(n-i));e.arc(s,o,a+c/2,i-h/2,n+h/2,!0)}else{let h=Math.min(c/2,r*et(n-i));if(d==="round")e.arc(s,o,h,i-F/2,n+F/2,!0);else if(d==="bevel"){let f=2*h*h,g=-f*Math.cos(i+F/2)+s,p=-f*Math.sin(i+F/2)+o,m=f*Math.cos(n+F/2)+s,b=f*Math.sin(n+F/2)+o;e.lineTo(g,p),e.lineTo(m,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function vf(e,t,i){let{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t,c=s/a;e.beginPath(),e.arc(o,r,a,n-c,i+c),l>s?(c=s/l,e.arc(o,r,l,i+c,n-c,!0)):e.arc(o,r,s,i+G,n-G),e.closePath(),e.clip()}function Mf(e){return Ji(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Sf(e,t,i,n){let s=Mf(e.options.borderRadius),o=(i-t)/2,r=Math.min(o,n*t/2),a=l=>{let c=(i-Math.min(o,l))*n/2;return Z(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Z(s.innerStart,0,r),innerEnd:Z(s.innerEnd,0,r)}}function we(e,t,i,n){return{x:i+e*Math.cos(t),y:n+e*Math.sin(t)}}function gn(e,t,i,n,s,o){let{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=t,u=Math.max(t.outerRadius+n+i-c,0),h=d>0?d+n+i+c:0,f=0,g=s-l;if(n){let B=d>0?d-n:0,q=u>0?u-n:0,X=(B+q)/2,yt=X!==0?g*X/(X+n):g;f=(g-yt)/2}let p=Math.max(.001,g*u-i/F)/u,m=(g-p)/2,b=l+m+f,y=s-m-f,{outerStart:_,outerEnd:v,innerStart:x,innerEnd:S}=Sf(t,h,u,y-b),k=u-_,T=u-v,w=b+_/k,L=y-v/T,A=h+x,I=h+S,Q=b+x/A,ht=y-S/I;if(e.beginPath(),o){let B=(w+L)/2;if(e.arc(r,a,u,w,B),e.arc(r,a,u,B,L),v>0){let st=we(T,L,r,a);e.arc(st.x,st.y,v,L,y+G)}let q=we(I,y,r,a);if(e.lineTo(q.x,q.y),S>0){let st=we(I,ht,r,a);e.arc(st.x,st.y,S,y+G,ht+Math.PI)}let X=(y-S/h+(b+x/h))/2;if(e.arc(r,a,h,y-S/h,X,!0),e.arc(r,a,h,X,b+x/h,!0),x>0){let st=we(A,Q,r,a);e.arc(st.x,st.y,x,Q+Math.PI,b-G)}let yt=we(k,b,r,a);if(e.lineTo(yt.x,yt.y),_>0){let st=we(k,w,r,a);e.arc(st.x,st.y,_,b-G,w)}}else{e.moveTo(r,a);let B=Math.cos(w)*u+r,q=Math.sin(w)*u+a;e.lineTo(B,q);let X=Math.cos(L)*u+r,yt=Math.sin(L)*u+a;e.lineTo(X,yt)}e.closePath()}function kf(e,t,i,n,s){let{fullCircles:o,startAngle:r,circumference:a}=t,l=t.endAngle;if(o){gn(e,t,i,n,l,s);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=r+(a%V||V))}return gn(e,t,i,n,l,s),e.fill(),l}function Tf(e,t,i,n,s){let{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:u,borderDashOffset:h,borderRadius:f}=l,g=l.borderAlign==="inner";if(!c)return;e.setLineDash(u||[]),e.lineDashOffset=h,g?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let p=t.endAngle;if(o){gn(e,t,i,n,p,s);for(let m=0;m<o;++m)e.stroke();isNaN(a)||(p=r+(a%V||V))}g&&vf(e,t,p),l.selfJoin&&p-r>=F&&f===0&&d!=="miter"&&_f(e,t,p),o||(gn(e,t,i,n,p,s),e.stroke())}function pl(e,t,i=t){e.lineCap=E(i.borderCapStyle,t.borderCapStyle),e.setLineDash(E(i.borderDash,t.borderDash)),e.lineDashOffset=E(i.borderDashOffset,t.borderDashOffset),e.lineJoin=E(i.borderJoinStyle,t.borderJoinStyle),e.lineWidth=E(i.borderWidth,t.borderWidth),e.strokeStyle=E(i.borderColor,t.borderColor)}function wf(e,t,i){e.lineTo(i.x,i.y)}function Cf(e){return e.stepped?qr:e.tension||e.cubicInterpolationMode==="monotone"?Yr:wf}function ml(e,t,i={}){let n=e.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),d=s<r&&o<r||s>a&&o>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!d?n+c-l:c-l}}function Ef(e,t,i,n){let{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=ml(s,i,n),d=Cf(o),{move:u=!0,reverse:h}=n||{},f,g,p;for(f=0;f<=c;++f)g=s[(a+(h?c-f:f))%r],!g.skip&&(u?(e.moveTo(g.x,g.y),u=!1):d(e,p,g,h,o.stepped),p=g);return l&&(g=s[(a+(h?c:0))%r],d(e,p,g,h,o.stepped)),!!l}function Lf(e,t,i,n){let s=t.points,{count:o,start:r,ilen:a}=ml(s,i,n),{move:l=!0,reverse:c}=n||{},d=0,u=0,h,f,g,p,m,b,y=v=>(r+(c?a-v:v))%o,_=()=>{p!==m&&(e.lineTo(d,m),e.lineTo(d,p),e.lineTo(d,b))};for(l&&(f=s[y(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[y(h)],f.skip)continue;let v=f.x,x=f.y,S=v|0;S===g?(x<p?p=x:x>m&&(m=x),d=(u*d+v)/++u):(_(),e.lineTo(v,x),g=S,u=0,p=m=x),b=x}_()}function Us(e){let t=e.options,i=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!i?Lf:Ef}function Af(e){return e.stepped?ea:e.tension||e.cubicInterpolationMode==="monotone"?ia:Ht}function Df(e,t,i,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,i,n)&&s.closePath()),pl(e,t.options),e.stroke(s)}function Pf(e,t,i,n){let{segments:s,options:o}=t,r=Us(t);for(let a of s)pl(e,o,a.style),e.beginPath(),r(e,t,a,{start:i,end:i+n-1})&&e.closePath(),e.stroke()}function Of(e,t,i,n){Rf&&!t.options.segment?Df(e,t,i,n):Pf(e,t,i,n)}function Oa(e,t,i,n){let s=e.options,{[i]:o}=e.getProps([i],n);return Math.abs(t-o)<s.radius+s.hitRadius}function bl(e,t){let{x:i,y:n,base:s,width:o,height:r}=e.getProps(["x","y","base","width","height"],t),a,l,c,d,u;return e.horizontal?(u=r/2,a=Math.min(i,s),l=Math.max(i,s),c=n-u,d=n+u):(u=o/2,a=i-u,l=i+u,c=Math.min(n,s),d=Math.max(n,s)),{left:a,top:c,right:l,bottom:d}}function qt(e,t,i,n){return e?0:Z(t,i,n)}function If(e,t,i){let n=e.options.borderWidth,s=e.borderSkipped,o=gs(n);return{t:qt(s.top,o.top,0,i),r:qt(s.right,o.right,0,t),b:qt(s.bottom,o.bottom,0,i),l:qt(s.left,o.left,0,t)}}function Ff(e,t,i){let{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=Vt(s),r=Math.min(t,i),a=e.borderSkipped,l=n||O(s);return{topLeft:qt(!l||a.top||a.left,o.topLeft,0,r),topRight:qt(!l||a.top||a.right,o.topRight,0,r),bottomLeft:qt(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:qt(!l||a.bottom||a.right,o.bottomRight,0,r)}}function $f(e){let t=bl(e),i=t.right-t.left,n=t.bottom-t.top,s=If(e,i/2,n/2),o=Ff(e,i/2,n/2);return{outer:{x:t.left,y:t.top,w:i,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:i-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function Rs(e,t,i,n){let s=t===null,o=i===null,a=e&&!(s&&o)&&bl(e,n);return a&&(s||kt(t,a.left,a.right))&&(o||kt(i,a.top,a.bottom))}function Hf(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function zf(e,t){e.rect(t.x,t.y,t.w,t.h)}function Os(e,t,i={}){let n=e.x!==i.x?-t:0,s=e.y!==i.y?-t:0,o=(e.x+e.w!==i.x+i.w?t:0)-n,r=(e.y+e.h!==i.y+i.h?t:0)-s;return{x:e.x+n,y:e.y+s,w:e.w+o,h:e.h+r,radius:e.radius}}function yl(e){return Gs[e%Gs.length]}function xl(e){return Ia[e%Ia.length]}function Wf(e,t){return e.borderColor=yl(t),e.backgroundColor=xl(t),++t}function Nf(e,t){return e.backgroundColor=e.data.map(()=>yl(t++)),t}function Vf(e,t){return e.backgroundColor=e.data.map(()=>xl(t++)),t}function jf(e){let t=0;return(i,n)=>{let s=e.getDatasetMeta(n).controller;s instanceof It?t=Nf(i,t):s instanceof ae?t=Vf(i,t):s&&(t=Wf(i,t))}}function Fa(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function qf(e){return e&&(e.borderColor||e.backgroundColor)}function Yf(){return j.borderColor!=="rgba(0,0,0,0.1)"||j.backgroundColor!=="rgba(0,0,0,0.1)"}function Gf(e,t,i,n,s){let o=s.samples||n;if(o>=i)return e.slice(t,t+i);let r=[],a=(i-2)/(o-2),l=0,c=t+i-1,d=t,u,h,f,g,p;for(r[l++]=e[d],u=0;u<o-2;u++){let m=0,b=0,y,_=Math.floor((u+1)*a)+1+t,v=Math.min(Math.floor((u+2)*a)+1,i)+t,x=v-_;for(y=_;y<v;y++)m+=e[y].x,b+=e[y].y;m/=x,b/=x;let S=Math.floor(u*a)+1+t,k=Math.min(Math.floor((u+1)*a)+1,i)+t,{x:T,y:w}=e[d];for(f=g=-1,y=S;y<k;y++)g=.5*Math.abs((T-m)*(e[y].y-w)-(T-e[y].x)*(b-w)),g>f&&(f=g,h=e[y],p=y);r[l++]=h,d=p}return r[l++]=e[c],r}function Kf(e,t,i,n){let s=0,o=0,r,a,l,c,d,u,h,f,g,p,m=[],b=t+i-1,y=e[t].x,v=e[b].x-y;for(r=t;r<t+i;++r){a=e[r],l=(a.x-y)/v*n,c=a.y;let x=l|0;if(x===d)c<g?(g=c,u=r):c>p&&(p=c,h=r),s=(o*s+a.x)/++o;else{let S=r-1;if(!R(u)&&!R(h)){let k=Math.min(u,h),T=Math.max(u,h);k!==f&&k!==S&&m.push({...e[k],x:s}),T!==f&&T!==S&&m.push({...e[T],x:s})}r>0&&S!==f&&m.push(e[S]),m.push(a),d=x,o=0,g=p=c,u=h=f=r}}return m}function _l(e){if(e._decimated){let t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function $a(e){e.data.datasets.forEach(t=>{_l(t)})}function Xf(e,t){let i=t.length,n=0,s,{iScale:o}=e,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=Z(vt(t,o.axis,r).lo,0,i-1)),c?s=Z(vt(t,o.axis,a).hi+1,n,i)-n:s=i-n,{start:n,count:s}}function Zf(e,t,i){let n=e.segments,s=e.points,o=t.points,r=[];for(let a of n){let{start:l,end:c}=a;c=bn(l,c,s);let d=Ks(i,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:d,start:s[l],end:s[c]});continue}let u=ks(t,d);for(let h of u){let f=Ks(i,o[h.start],o[h.end],h.loop),g=Ss(a,s,f);for(let p of g)r.push({source:p,target:h,start:{[i]:Ha(d,f,"start",Math.max)},end:{[i]:Ha(d,f,"end",Math.min)}})}}return r}function Ks(e,t,i,n){if(n)return;let s=t[e],o=i[e];return e==="angle"&&(s=et(s),o=et(o)),{property:e,start:s,end:o}}function Qf(e,t){let{x:i=null,y:n=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=bn(r,a,s);let l=s[r],c=s[a];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):i!==null&&(o.push({x:i,y:l.y}),o.push({x:i,y:c.y}))}),o}function bn(e,t,i){for(;t>e;t--){let n=i[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function Ha(e,t,i,n){return e&&t?n(e[i],t[i]):e?e[i]:t?t[i]:0}function vl(e,t){let i=[],n=!1;return N(e)?(n=!0,i=e):i=Qf(e,t),i.length?new Ct({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function za(e){return e&&e.fill!==!1}function tg(e,t,i){let s=e[t].fill,o=[t],r;if(!i)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!Y(s))return s;if(r=e[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function eg(e,t,i){let n=og(e);if(O(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return Y(s)&&Math.floor(s)===s?ig(n[0],t,s,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function ig(e,t,i,n){return(e==="-"||e==="+")&&(i=t+i),i===t||i<0||i>=n?!1:i}function ng(e,t){let i=null;return e==="start"?i=t.bottom:e==="end"?i=t.top:O(e)?i=t.getPixelForValue(e.value):t.getBasePixel&&(i=t.getBasePixel()),i}function sg(e,t,i){let n;return e==="start"?n=i:e==="end"?n=t.options.reverse?t.min:t.max:O(e)?n=e.value:n=t.getBaseValue(),n}function og(e){let t=e.options,i=t.fill,n=E(i&&i.target,i);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function rg(e){let{scale:t,index:i,line:n}=e,s=[],o=n.segments,r=n.points,a=ag(t,i);a.push(vl({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){let c=o[l];for(let d=c.start;d<=c.end;d++)lg(s,r[d],a)}return new Ct({points:s,options:{}})}function ag(e,t){let i=[],n=e.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){let o=n[s];if(o.index===t)break;o.hidden||i.unshift(o.dataset)}return i}function lg(e,t,i){let n=[];for(let s=0;s<i.length;s++){let o=i[s],{first:r,last:a,point:l}=cg(o,t,"x");if(!(!l||r&&a)){if(r)n.unshift(l);else if(e.push(l),!a)break}}e.push(...n)}function cg(e,t,i){let n=e.interpolate(t,i);if(!n)return{};let s=n[i],o=e.segments,r=e.points,a=!1,l=!1;for(let c=0;c<o.length;c++){let d=o[c],u=r[d.start][i],h=r[d.end][i];if(kt(s,u,h)){a=s===u,l=s===h;break}}return{first:a,last:l,point:n}}function dg(e){let{chart:t,fill:i,line:n}=e;if(Y(i))return ug(t,i);if(i==="stack")return rg(e);if(i==="shape")return!0;let s=hg(e);return s instanceof pn?s:vl(s,n)}function ug(e,t){let i=e.getDatasetMeta(t);return i&&e.isDatasetVisible(t)?i.dataset:null}function hg(e){return(e.scale||{}).getPointPositionForValue?gg(e):fg(e)}function fg(e){let{scale:t={},fill:i}=e,n=ng(i,t);if(Y(n)){let s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function gg(e){let{scale:t,fill:i}=e,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,r=sg(i,t,o),a=[];if(n.grid.circular){let l=t.getPointPositionForValue(0,o);return new pn({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function Is(e,t,i){let n=dg(t),{chart:s,index:o,line:r,scale:a,axis:l}=t,c=r.options,d=c.fill,u=c.backgroundColor,{above:h=u,below:f=u}=d||{},g=s.getDatasetMeta(o),p=Ts(s,g);n&&r.points.length&&(ti(e,i),pg(e,{line:r,target:n,above:h,below:f,area:i,scale:a,axis:l,clip:p}),ei(e))}function pg(e,t){let{line:i,target:n,above:s,below:o,area:r,scale:a,clip:l}=t,c=i._loop?"angle":t.axis;e.save();let d=o;o!==s&&(c==="x"?(Ba(e,n,r.top),Fs(e,{line:i,target:n,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),Ba(e,n,r.bottom)):c==="y"&&(Wa(e,n,r.left),Fs(e,{line:i,target:n,color:o,scale:a,property:c,clip:l}),e.restore(),e.save(),Wa(e,n,r.right),d=s)),Fs(e,{line:i,target:n,color:d,scale:a,property:c,clip:l}),e.restore()}function Ba(e,t,i){let{segments:n,points:s}=t,o=!0,r=!1;e.beginPath();for(let a of n){let{start:l,end:c}=a,d=s[l],u=s[bn(l,c,s)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(d.x,i),e.lineTo(d.x,d.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(u.x,i)}e.lineTo(t.first().x,i),e.closePath(),e.clip()}function Wa(e,t,i){let{segments:n,points:s}=t,o=!0,r=!1;e.beginPath();for(let a of n){let{start:l,end:c}=a,d=s[l],u=s[bn(l,c,s)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(i,d.y),e.lineTo(d.x,d.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(i,u.y)}e.lineTo(i,t.first().y),e.closePath(),e.clip()}function Fs(e,t){let{line:i,target:n,property:s,color:o,scale:r,clip:a}=t,l=Zf(i,n,s);for(let{source:c,target:d,start:u,end:h}of l){let{style:{backgroundColor:f=o}={}}=c,g=n!==!0;e.save(),e.fillStyle=f,mg(e,r,a,g&&Ks(s,u,h)),e.beginPath();let p=!!i.pathSegment(e,c),m;if(g){p?e.closePath():Na(e,n,h,s);let b=!!n.pathSegment(e,d,{move:p,reverse:!0});m=p&&b,m||Na(e,n,u,s)}e.closePath(),e.fill(m?"evenodd":"nonzero"),e.restore()}}function mg(e,t,i,n){let s=t.chart.chartArea,{property:o,start:r,end:a}=n||{};if(o==="x"||o==="y"){let l,c,d,u;o==="x"?(l=r,c=s.top,d=a,u=s.bottom):(l=s.left,c=r,d=s.right,u=a),e.beginPath(),i&&(l=Math.max(l,i.left),d=Math.min(d,i.right),c=Math.max(c,i.top),u=Math.min(u,i.bottom)),e.rect(l,c,d-l,u-c),e.clip()}}function Na(e,t,i,n){let s=t.interpolate(i,n);s&&e.lineTo(s.x,s.y)}function xg(e,t,i,n,s){let o=_g(n,e,t,i),r=vg(s,n,t.lineHeight);return{itemWidth:o,itemHeight:r}}function _g(e,t,i,n){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+i.size/2+n.measureText(s).width}function vg(e,t,i){let n=e;return typeof t.text!="string"&&(n=Ml(t,i)),n}function Ml(e,t){let i=e.text?e.text.length:0;return t*i}function Mg(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}function kg(e,t){let i=new mi({ctx:e.ctx,options:t,chart:e});ot.configure(e,i,t),ot.addBox(e,i),e.titleBlock=i}function Tt(e,t){return t&&(N(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ot(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
46
|
+
`,t}function Cd(e){let t=document.createElement("div");return t.className="inline-flex items-center px-2 py-1 text-xs font-semibold rounded-full bg-gray-200 text-gray-700",t.textContent=`+${e}`,t}function Ed(e){document.querySelectorAll("[data-remove-filter]").forEach(t=>{t.addEventListener("click",i=>{i.stopPropagation();let n=t.dataset.removeFilter;n&&e(n)})})}var Td,rr,ar=C(()=>{"use strict";J();jn();Td="active-filters",rr=8});function lr(){Ld(),Oi()}function Ld(){let e=document.querySelector("[data-filter-prev]"),t=document.querySelector("[data-filter-next]");e&&e.addEventListener("click",()=>Ad()),t&&t.addEventListener("click",()=>Dd())}function Ad(){let e=Yn();e.length!==0&&(_t=(_t-1+e.length)%e.length,cr(e[_t]),Oi())}function Dd(){let e=Yn();e.length!==0&&(_t=(_t+1)%e.length,cr(e[_t]),Oi())}function Yn(){return Li()}function cr(e){Di(e),setTimeout(()=>{Ci(e,{offset:20,behavior:"smooth",highlight:!0})},50)}function Oi(){let t=Yn().length;_t>=t&&(_t=0);let i=document.querySelector("[data-filter-position]");i&&(t>0?i.textContent=`${_t+1} / ${t}`:i.textContent="0 / 0");let n=document.querySelector("[data-filter-prev]"),s=document.querySelector("[data-filter-next]");n&&(n.disabled=t===0),s&&(s.disabled=t===0)}function dr(){_t=0,Oi()}var _t,ur=C(()=>{"use strict";J();Ne();_t=0});function hr(){let e=R(Jt,ge);er(),lr(),Pd(e),Ge(e),Fi(),Ye($i),Od()}function Pd(e){e.riskLevels.forEach(i=>{let n=document.querySelector(`[data-filter-risk="${i}"]`);n&&(n.checked=!0)}),e.categories.forEach(i=>{let n=document.querySelector(`[data-filter-category="${i}"]`);n&&(n.checked=!0)}),e.ruleTypes.forEach(i=>{let n=document.querySelector(`[data-filter-type="${i}"]`);n&&(n.checked=!0)});let t=document.querySelector("[data-filter-search]");t&&(t.value=e.searchText)}function Od(){document.querySelectorAll("[data-filter-risk]").forEach(i=>{i.addEventListener("change",Ii)}),document.querySelectorAll("[data-filter-category]").forEach(i=>{i.addEventListener("change",Ii)}),document.querySelectorAll("[data-filter-type]").forEach(i=>{i.addEventListener("change",Ii)});let e=document.querySelector("[data-filter-search]");e&&e.addEventListener("input",Ii);let t=document.querySelector("[data-filter-clear]");t&&t.addEventListener("click",Fd)}function Ii(){let e={riskLevels:Gn("[data-filter-risk]"),categories:Gn("[data-filter-category]"),autoFixable:null,ruleTypes:Gn("[data-filter-type]"),searchText:document.querySelector("[data-filter-search]")?.value||""};D(Jt,e),Ge(e),Fi(),Ye($i)}function Gn(e){let t=[];return document.querySelectorAll(e).forEach(i=>{let n=i;if(n.checked){let s=n.getAttribute(e.slice(1,-1));s&&t.push(s)}}),t}function Ge(e){let t=$n(),i=null;t.forEach(n=>{let s=n,o=s.dataset.riskLevel,r=s.dataset.category,a=s.dataset.ruleType,l=s.dataset.title?.toLowerCase()||"",c=!0;e.riskLevels.length>0&&o&&(c=c&&e.riskLevels.includes(o)),e.categories.length>0&&r&&(c=c&&e.categories.includes(r)),e.ruleTypes.length>0&&a&&(c=c&&e.ruleTypes.includes(a)),e.searchText&&(c=c&&l.includes(e.searchText.toLowerCase())),c?(s.classList.remove("hidden","opacity-30","pointer-events-none"),s.classList.add("filter-match"),i||(i=s)):(s.classList.remove("hidden","filter-match"),s.classList.add("opacity-30","pointer-events-none"))}),Id(),dr(),i&&Hd(e)&&Wd(i)}function Id(){let e=$n().length,t=Li().length,i=document.querySelector("[data-filter-count]");i&&(i.textContent=`${t} / ${e} r\xE8gles`)}function Fd(){document.querySelectorAll("[data-filter-risk], [data-filter-category], [data-filter-type]").forEach(t=>{t.checked=!1});let e=document.querySelector("[data-filter-search]");e&&(e.value=""),D(Jt,ge),Ge(ge),Fi(),Ye($i)}function $d(){let e=R(Jt,ge);return e.riskLevels.length+e.categories.length+e.ruleTypes.length+(e.searchText?1:0)}function Fi(){let e=$d(),t=document.querySelector("[data-filter-active-count]");if(t){let i=e===0?"0 actif":e===1?"1 actif":`${e} actifs`;t.textContent=i,e===0?t.className="px-3 py-1 bg-gray-100 text-gray-600 text-sm font-semibold rounded-full transition-all":t.className="px-3 py-1 bg-blue-100 text-blue-700 text-sm font-semibold rounded-full transition-all"}}function Hd(e){return e.riskLevels.length>0||e.categories.length>0||e.ruleTypes.length>0||e.searchText.length>0}function $i(e){let t=R(Jt,ge);if(e==="search"){t.searchText="";let i=document.querySelector("[data-filter-search]");i&&(i.value="")}else{let[i,n]=e.split(":");({risk:()=>{t.riskLevels=t.riskLevels.filter(o=>o!==n),Un(`[data-filter-risk="${n}"]`)},category:()=>{t.categories=t.categories.filter(o=>o!==n),Un(`[data-filter-category="${n}"]`)},type:()=>{t.ruleTypes=t.ruleTypes.filter(o=>o!==n),Un(`[data-filter-type="${n}"]`)}})[i]?.()}D(Jt,t),Ge(t),Fi(),Ye($i)}function Un(e){let t=document.querySelector(e);t&&(t.checked=!1)}function fr(){let e=R(Jt,ge);Ge(e)}var Jt,Rd,ge,Wd,Kn=C(()=>{"use strict";J();J();J();sr();ar();ur();Ne();Jt="active-filters",Rd=300,ge={riskLevels:[],categories:[],autoFixable:null,ruleTypes:[],searchText:""};Wd=Kt(e=>{Di(e),setTimeout(()=>{Ci(e,{offset:20,behavior:"smooth",highlight:!0})},50)},Rd)});function zd(e,t,i){document.querySelectorAll(`[${e}="${t}"]`).forEach(s=>{let o=s;o.value!==String(i)&&(o.value=String(i))})}function gr(e,t,i){let n=Kt((s,o)=>{t(i,s,o)},300);document.addEventListener("input",s=>{let o=s.target.closest(`[${e}]`);if(!o)return;let r=o.getAttribute(e),a=parseInt(o.value,10);!r||isNaN(a)||a<1||(zd(e,r,a),n(r,a))})}function pr(e){gr("data-time-input",(t,i,n)=>t.setCustomTime(i,n),e),gr("data-special-time-input",(t,i,n)=>t.setCustomSpecialTime(i,n),e),document.addEventListener("click",t=>{let i=t.target.closest("[data-time-reset]");if(!i)return;let n=i.getAttribute("data-time-reset");if(!n)return;e.resetCustomTime(n),document.querySelectorAll(`[data-time-input="${n}"]`).forEach(r=>{let a=r,l=a.getAttribute("data-original-time");l&&(a.value=l)}),document.querySelectorAll(`[data-special-time-input="${n}"]`).forEach(r=>{let a=r,l=a.getAttribute("data-original-special-time");l&&(a.value=l)})})}var mr=C(()=>{"use strict";On()});function yr(){R(Xn,[]).forEach(t=>{let i=document.querySelector(`[data-checklist-item="${t}"]`);i&&(i.checked=!0,br(i,!0))}),document.addEventListener("change",t=>{let i=t.target.closest("[data-checklist-item]");if(!i)return;let n=i.getAttribute("data-checklist-item");if(!n)return;let s=i.checked;Bd(n,s),br(i,s)}),xr()}function Bd(e,t){let i=R(Xn,[]);if(t)i.includes(e)||i.push(e);else{let n=i.indexOf(e);n>-1&&i.splice(n,1)}D(Xn,i),xr()}function br(e,t){let i=e.closest("[data-rule-card]");i&&(t?(i.classList.add("opacity-60","bg-green-50"),i.classList.remove("bg-white")):(i.classList.remove("opacity-60","bg-green-50"),i.classList.add("bg-white")))}function xr(){let e=document.querySelectorAll("[data-checklist-item]"),t=document.querySelectorAll("[data-checklist-item]:checked"),i=e.length,n=t.length,s=i>0?Math.round(n/i*100):0,o=document.querySelector("[data-progress-bar]");o&&(o.style.width=`${s}%`);let r=document.querySelector("[data-progress-text]");r&&(r.textContent=`${n} / ${i} (${s}%)`)}var Xn,_r=C(()=>{"use strict";J();Xn="checklist-items"});function Vd(e){let t=Ri[e]||qe,i=document.createElement("span");return i.className=`inline-flex items-center px-2 py-1 text-xs font-semibold rounded-full bg-${t.color}-100 text-${t.color}-800`,i.innerHTML=`<span class="mr-1">${t.emoji}</span>${t.label}`,i}function Nd(e){let t=Pi[e]||{...qe,label:e},i=document.createElement("span");return i.className=`inline-flex items-center px-2 py-1 text-xs font-medium rounded-full bg-${t.color}-100 text-${t.color}-700`,i.innerHTML=`<span class="mr-1">${t.emoji}</span>${t.label}`,i}function vr(){document.querySelectorAll("[data-rule-card]").forEach(t=>{let i=t,n=i.dataset.ruleKey,s=i.dataset.riskLevel,o=i.dataset.category;if(!n)return;let r=i.querySelector(`[data-chips-container="${n}"]`);if(r){if(r.innerHTML="",s){let a=Vd(s);r.appendChild(a)}if(o){let a=Nd(o);r.appendChild(a)}}})}var Mr=C(()=>{"use strict";jn()});function Xe(e){return e+.5|0}function Ue(e){return Ft(Xe(e*2.55),0,255)}function $t(e){return Ft(Xe(e*255),0,255)}function Et(e){return Ft(Xe(e/2.55)/100,0,1)}function Sr(e){return Ft(Xe(e*100),0,100)}function Gd(e){var t=e.length,i;return e[0]==="#"&&(t===4||t===5?i={r:255&mt[e[1]]*17,g:255&mt[e[2]]*17,b:255&mt[e[3]]*17,a:t===5?mt[e[4]]*17:255}:(t===7||t===9)&&(i={r:mt[e[1]]<<4|mt[e[2]],g:mt[e[3]]<<4|mt[e[4]],b:mt[e[5]]<<4|mt[e[6]],a:t===9?mt[e[7]]<<4|mt[e[8]]:255})),i}function Kd(e){var t=Yd(e)?jd:qd;return e?"#"+t(e.r)+t(e.g)+t(e.b)+Ud(e.a,t):void 0}function Cr(e,t,i){let n=t*Math.min(i,1-i),s=(o,r=(o+e/30)%12)=>i-n*Math.max(Math.min(r-3,9-r,1),-1);return[s(0),s(8),s(4)]}function Jd(e,t,i){let n=(s,o=(s+e/60)%6)=>i-i*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function Zd(e,t,i){let n=Cr(e,1,.5),s;for(t+i>1&&(s=1/(t+i),t*=s,i*=s),s=0;s<3;s++)n[s]*=1-t-i,n[s]+=t;return n}function Qd(e,t,i,n,s){return e===s?(t-i)/n+(t<i?6:0):t===s?(i-e)/n+2:(e-t)/n+4}function Qn(e){let i=e.r/255,n=e.g/255,s=e.b/255,o=Math.max(i,n,s),r=Math.min(i,n,s),a=(o+r)/2,l,c,d;return o!==r&&(d=o-r,c=a>.5?d/(2-o-r):d/(o+r),l=Qd(i,n,s,d,o),l=l*60+.5),[l|0,c||0,a]}function ts(e,t,i,n){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,i,n)).map($t)}function es(e,t,i){return ts(Cr,e,t,i)}function tu(e,t,i){return ts(Zd,e,t,i)}function eu(e,t,i){return ts(Jd,e,t,i)}function Er(e){return(e%360+360)%360}function iu(e){let t=Xd.exec(e),i=255,n;if(!t)return;t[5]!==n&&(i=t[6]?Ue(+t[5]):$t(+t[5]));let s=Er(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=tu(s,o,r):t[1]==="hsv"?n=eu(s,o,r):n=es(s,o,r),{r:n[0],g:n[1],b:n[2],a:i}}function nu(e,t){var i=Qn(e);i[0]=Er(i[0]+t),i=es(i),e.r=i[0],e.g=i[1],e.b=i[2]}function su(e){if(!e)return;let t=Qn(e),i=t[0],n=Sr(t[1]),s=Sr(t[2]);return e.a<255?`hsla(${i}, ${n}%, ${s}%, ${Et(e.a)})`:`hsl(${i}, ${n}%, ${s}%)`}function ou(){let e={},t=Object.keys(Tr),i=Object.keys(kr),n,s,o,r,a;for(n=0;n<t.length;n++){for(r=a=t[n],s=0;s<i.length;s++)o=i[s],a=a.replace(o,kr[o]);o=parseInt(Tr[r],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}function ru(e){Wi||(Wi=ou(),Wi.transparent=[0,0,0,0]);let t=Wi[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}function lu(e){let t=au.exec(e),i=255,n,s,o;if(t){if(t[7]!==n){let r=+t[7];i=t[8]?Ue(r):Ft(r*255,0,255)}return n=+t[1],s=+t[3],o=+t[5],n=255&(t[2]?Ue(n):Ft(n,0,255)),s=255&(t[4]?Ue(s):Ft(s,0,255)),o=255&(t[6]?Ue(o):Ft(o,0,255)),{r:n,g:s,b:o,a:i}}}function cu(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Et(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}function du(e,t,i){let n=pe(Et(e.r)),s=pe(Et(e.g)),o=pe(Et(e.b));return{r:$t(Jn(n+i*(pe(Et(t.r))-n))),g:$t(Jn(s+i*(pe(Et(t.g))-s))),b:$t(Jn(o+i*(pe(Et(t.b))-o))),a:e.a+i*(t.a-e.a)}}function zi(e,t,i){if(e){let n=Qn(e);n[t]=Math.max(0,Math.min(n[t]+n[t]*i,t===0?360:1)),n=es(n),e.r=n[0],e.g=n[1],e.b=n[2]}}function Lr(e,t){return e&&Object.assign(t||{},e)}function wr(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=$t(e[3]))):(t=Lr(e,{r:0,g:0,b:0,a:1}),t.a=$t(t.a)),t}function uu(e){return e.charAt(0)==="r"?lu(e):iu(e)}var Ft,mt,Zn,jd,qd,Hi,Yd,Ud,Xd,kr,Tr,Wi,au,Jn,pe,Ke,Ar=C(()=>{Ft=(e,t,i)=>Math.max(Math.min(e,i),t);mt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Zn=[..."0123456789ABCDEF"],jd=e=>Zn[e&15],qd=e=>Zn[(e&240)>>4]+Zn[e&15],Hi=e=>(e&240)>>4===(e&15),Yd=e=>Hi(e.r)&&Hi(e.g)&&Hi(e.b)&&Hi(e.a);Ud=(e,t)=>e<255?t(e):"";Xd=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;kr={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"},Tr={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"};au=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;Jn=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,pe=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);Ke=class e{constructor(t){if(t instanceof e)return t;let i=typeof t,n;i==="object"?n=wr(t):i==="string"&&(n=Gd(t)||ru(t)||uu(t)),this._rgb=n,this._valid=!!n}get valid(){return this._valid}get rgb(){var t=Lr(this._rgb);return t&&(t.a=Et(t.a)),t}set rgb(t){this._rgb=wr(t)}rgbString(){return this._valid?cu(this._rgb):void 0}hexString(){return this._valid?Kd(this._rgb):void 0}hslString(){return this._valid?su(this._rgb):void 0}mix(t,i){if(t){let n=this.rgb,s=t.rgb,o,r=i===o?.5:i,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,i){return t&&(this._rgb=du(this._rgb,t._rgb,i)),this}clone(){return new e(this.rgb)}alpha(t){return this._rgb.a=$t(t),this}clearer(t){let i=this._rgb;return i.a*=1-t,this}greyscale(){let t=this._rgb,i=Xe(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=i,this}opaquer(t){let i=this._rgb;return i.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return zi(this._rgb,2,t),this}darken(t){return zi(this._rgb,2,-t),this}saturate(t){return zi(this._rgb,1,t),this}desaturate(t){return zi(this._rgb,1,-t),this}rotate(t){return nu(this._rgb,t),this}}});function St(){}function P(e){return e==null}function V(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function O(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Y(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function ct(e,t){return Y(e)?e:t}function E(e,t){return typeof e>"u"?t:e}function B(e,t,i){if(e&&typeof e.call=="function")return e.apply(i,t)}function H(e,t,i,n){let s,o,r;if(V(e))if(o=e.length,n)for(s=o-1;s>=0;s--)t.call(i,e[s],s);else for(s=0;s<o;s++)t.call(i,e[s],s);else if(O(e))for(r=Object.keys(e),o=r.length,s=0;s<o;s++)t.call(i,e[r[s]],r[s])}function Qe(e,t){let i,n,s,o;if(!e||!t||e.length!==t.length)return!1;for(i=0,n=e.length;i<n;++i)if(s=e[i],o=t[i],s.datasetIndex!==o.datasetIndex||s.index!==o.index)return!1;return!0}function ji(e){if(V(e))return e.map(ji);if(O(e)){let t=Object.create(null),i=Object.keys(e),n=i.length,s=0;for(;s<n;++s)t[i[s]]=ji(e[i[s]]);return t}return e}function Nr(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function hu(e,t,i,n){if(!Nr(e))return;let s=t[e],o=i[e];O(s)&&O(o)?be(s,o,n):t[e]=ji(o)}function be(e,t,i){let n=V(t)?t:[t],s=n.length;if(!O(e))return e;i=i||{};let o=i.merger||hu,r;for(let a=0;a<s;++a){if(r=n[a],!O(r))continue;let l=Object.keys(r);for(let c=0,d=l.length;c<d;++c)o(l[c],e,r,i)}return e}function xe(e,t){return be(e,t,{merger:fu})}function fu(e,t,i){if(!Nr(e))return;let n=t[e],s=i[e];O(n)&&O(s)?xe(n,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ji(s))}function gu(e){let t=e.split("."),i=[],n="";for(let s of t)n+=s,n.endsWith("\\")?n=n.slice(0,-1)+".":(i.push(n),n="");return i}function pu(e){let t=gu(e);return i=>{for(let n of t){if(n==="")break;i=i&&i[n]}return i}}function Dt(e,t){return(Dr[t]||(Dr[t]=pu(t)))(e)}function Ui(e){return e.charAt(0).toUpperCase()+e.slice(1)}function jr(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}function ve(e,t,i){return Math.abs(e-t)<i}function as(e){let t=Math.round(e);e=ve(e,t,e/1e3)?t:e;let i=Math.pow(10,Math.floor(At(e))),n=e/i;return(n<=1?1:n<=2?2:n<=5?5:10)*i}function qr(e){let t=[],i=Math.sqrt(e),n;for(n=1;n<i;n++)e%n===0&&(t.push(n),t.push(e/n));return i===(i|0)&&t.push(i),t.sort((s,o)=>s-o).pop(),t}function yu(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function ee(e){return!yu(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Yr(e,t){let i=Math.round(e);return i-t<=e&&i+t>=e}function ls(e,t,i){let n,s,o;for(n=0,s=e.length;n<s;n++)o=e[n][i],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function bt(e){return e*(F/180)}function Ki(e){return e*(180/F)}function cs(e){if(!Y(e))return;let t=1,i=0;for(;Math.round(e*t)/t!==e;)t*=10,i++;return i}function ds(e,t){let i=t.x-e.x,n=t.y-e.y,s=Math.sqrt(i*i+n*n),o=Math.atan2(n,i);return o<-.5*F&&(o+=N),{angle:o,distance:s}}function Yi(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function xu(e,t){return(e-t+mu)%N-F}function et(e){return(e%N+N)%N}function Me(e,t,i,n){let s=et(e),o=et(t),r=et(i),a=et(o-s),l=et(r-s),c=et(s-o),d=et(s-r);return s===o||s===r||n&&o===r||a>l&&c<d}function Q(e,t,i){return Math.max(t,Math.min(i,e))}function Gr(e){return Q(e,-32768,32767)}function kt(e,t,i,n=1e-6){return e>=Math.min(t,i)-n&&e<=Math.max(t,i)+n}function Xi(e,t,i){i=i||(r=>e[r]<t);let n=e.length-1,s=0,o;for(;n-s>1;)o=s+n>>1,i(o)?s=o:n=o;return{lo:s,hi:n}}function Kr(e,t,i){let n=0,s=e.length;for(;n<s&&e[n]<t;)n++;for(;s>n&&e[s-1]>i;)s--;return n>0||s<e.length?e.slice(n,s):e}function Jr(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Xr.forEach(i=>{let n="_onData"+Ui(i),s=e[i];Object.defineProperty(e,i,{configurable:!0,enumerable:!1,value(...o){let r=s.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[n]=="function"&&a[n](...o)}),r}})})}function us(e,t){let i=e._chartjs;if(!i)return;let n=i.listeners,s=n.indexOf(t);s!==-1&&n.splice(s,1),!(n.length>0)&&(Xr.forEach(o=>{delete e[o]}),delete e._chartjs)}function hs(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}function gs(e,t){let i=[],n=!1;return function(...s){i=s,n||(n=!0,fs.call(window,()=>{n=!1,e.apply(t,i)}))}}function Zr(e,t){let i;return function(...n){return t?(clearTimeout(i),i=setTimeout(e,t,n)):e.apply(this,n),t}}function ps(e,t,i){let n=t.length,s=0,o=n;if(e._sorted){let{iScale:r,vScale:a,_parsed:l}=e,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,d=r.axis,{min:u,max:h,minDefined:f,maxDefined:g}=r.getUserBounds();if(f){if(s=Math.min(vt(l,d,u).lo,i?n:vt(t,d,r.getPixelForValue(u)).lo),c){let p=l.slice(0,s+1).reverse().findIndex(m=>!P(m[a.axis]));s-=Math.max(0,p)}s=Q(s,0,n-1)}if(g){let p=Math.max(vt(l,r.axis,h,!0).hi+1,i?0:vt(t,d,r.getPixelForValue(h),!0).hi+1);if(c){let m=l.slice(p-1).findIndex(b=>!P(b[a.axis]));p+=Math.max(0,m)}o=Q(p,s,n)-s}else o=n-s}return{start:s,count:o}}function ms(e){let{xScale:t,yScale:i,_scaleRanges:n}=e,s={xmin:t.min,xmax:t.max,ymin:i.min,ymax:i.max};if(!n)return e._scaleRanges=s,!0;let o=n.xmin!==t.min||n.xmax!==t.max||n.ymin!==i.min||n.ymax!==i.max;return Object.assign(n,s),o}function bs(e){if(e&&typeof e=="object"){let t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ys(e){return bs(e)?e:new Ke(e)}function is(e){return bs(e)?e:new Ke(e).saturate(.5).darken(.1).hexString()}function Mu(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:vu},numbers:{type:"number",properties:_u}}),e.describe("animations",{_fallback:"animation"}),e.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 Su(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}function ku(e,t){t=t||{};let i=e+JSON.stringify(t),n=Ir.get(i);return n||(n=new Intl.NumberFormat(e,t),Ir.set(i,n)),n}function Se(e,t,i){return ku(t,i).format(e)}function Tu(e,t){let i=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(i)>=1&&e!==Math.floor(e)&&(i=e-Math.floor(e)),i}function wu(e){e.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,i)=>i.lineWidth,tickColor:(t,i)=>i.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ti.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}function Je(e,t){if(!t)return e;let i=t.split(".");for(let n=0,s=i.length;n<s;++n){let o=i[n];e=e[o]||(e[o]=Object.create(null))}return e}function ns(e,t,i){return typeof t=="string"?be(Je(e,t),i):be(Je(e,""),t)}function Cu(e){return!e||P(e.size)||P(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function Ze(e,t,i,n,s){let o=t[s];return o||(o=t[s]=e.measureText(s).width,i.push(s)),o>n&&(n=o),n}function ea(e,t,i,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),e.save(),e.font=t;let r=0,a=i.length,l,c,d,u,h;for(l=0;l<a;l++)if(u=i[l],u!=null&&!V(u))r=Ze(e,s,o,r,u);else if(V(u))for(c=0,d=u.length;c<d;c++)h=u[c],h!=null&&!V(h)&&(r=Ze(e,s,o,r,h));e.restore();let f=o.length/2;if(f>i.length){for(l=0;l<f;l++)delete s[o[l]];o.splice(0,f)}return r}function Bt(e,t,i){let n=e.currentDevicePixelRatio,s=i!==0?Math.max(i/2,.5):0;return Math.round((t-s)*n)/n+s}function xs(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Qi(e,t,i,n){_s(e,t,i,n,null)}function _s(e,t,i,n,s){let o,r,a,l,c,d,u,h,f=t.pointStyle,g=t.rotation,p=t.radius,m=(g||0)*bu;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(i,n),e.rotate(m),e.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),e.restore();return}if(!(isNaN(p)||p<=0)){switch(e.beginPath(),f){default:s?e.ellipse(i,n,s/2,p,0,0,N):e.arc(i,n,p,0,N),e.closePath();break;case"triangle":d=s?s/2:p,e.moveTo(i+Math.sin(m)*d,n-Math.cos(m)*p),m+=Rr,e.lineTo(i+Math.sin(m)*d,n-Math.cos(m)*p),m+=Rr,e.lineTo(i+Math.sin(m)*d,n-Math.cos(m)*p),e.closePath();break;case"rectRounded":c=p*.516,l=p-c,r=Math.cos(m+Zt)*l,u=Math.cos(m+Zt)*(s?s/2-c:l),a=Math.sin(m+Zt)*l,h=Math.sin(m+Zt)*(s?s/2-c:l),e.arc(i-u,n-a,c,m-F,m-U),e.arc(i+h,n-r,c,m-U,m),e.arc(i+u,n+a,c,m,m+U),e.arc(i-h,n+r,c,m+U,m+F),e.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,d=s?s/2:l,e.rect(i-d,n-l,2*d,2*l);break}m+=Zt;case"rectRot":u=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,h=Math.sin(m)*(s?s/2:p),e.moveTo(i-u,n-a),e.lineTo(i+h,n-r),e.lineTo(i+u,n+a),e.lineTo(i-h,n+r),e.closePath();break;case"crossRot":m+=Zt;case"cross":u=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,h=Math.sin(m)*(s?s/2:p),e.moveTo(i-u,n-a),e.lineTo(i+u,n+a),e.moveTo(i+h,n-r),e.lineTo(i-h,n+r);break;case"star":u=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,h=Math.sin(m)*(s?s/2:p),e.moveTo(i-u,n-a),e.lineTo(i+u,n+a),e.moveTo(i+h,n-r),e.lineTo(i-h,n+r),m+=Zt,u=Math.cos(m)*(s?s/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,h=Math.sin(m)*(s?s/2:p),e.moveTo(i-u,n-a),e.lineTo(i+u,n+a),e.moveTo(i+h,n-r),e.lineTo(i-h,n+r);break;case"line":r=s?s/2:Math.cos(m)*p,a=Math.sin(m)*p,e.moveTo(i-r,n-a),e.lineTo(i+r,n+a);break;case"dash":e.moveTo(i,n),e.lineTo(i+Math.cos(m)*(s?s/2:p),n+Math.sin(m)*p);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function Mt(e,t,i){return i=i||.5,!t||e&&e.x>t.left-i&&e.x<t.right+i&&e.y>t.top-i&&e.y<t.bottom+i}function ei(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function ii(e){e.restore()}function ia(e,t,i,n,s){if(!t)return e.lineTo(i.x,i.y);if(s==="middle"){let o=(t.x+i.x)/2;e.lineTo(o,t.y),e.lineTo(o,i.y)}else s==="after"!=!!n?e.lineTo(t.x,i.y):e.lineTo(i.x,t.y);e.lineTo(i.x,i.y)}function na(e,t,i,n){if(!t)return e.lineTo(i.x,i.y);e.bezierCurveTo(n?t.cp1x:t.cp2x,n?t.cp1y:t.cp2y,n?i.cp2x:i.cp1x,n?i.cp2y:i.cp1y,i.x,i.y)}function Eu(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),P(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function Lu(e,t,i,n,s){if(s.strikethrough||s.underline){let o=e.measureText(n),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,c=i+o.actualBoundingBoxDescent,d=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(r,d),e.lineTo(a,d),e.stroke()}}function Au(e,t){let i=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=i}function Vt(e,t,i,n,s,o={}){let r=V(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(e.save(),e.font=s.string,Eu(e,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Au(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),P(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(c,i,n,o.maxWidth)),e.fillText(c,i,n,o.maxWidth),Lu(e,i,n,c,o),n+=Number(s.lineHeight);e.restore()}function ke(e,t){let{x:i,y:n,w:s,h:o,radius:r}=t;e.arc(i+r.topLeft,n+r.topLeft,r.topLeft,1.5*F,F,!0),e.lineTo(i,n+o-r.bottomLeft),e.arc(i+r.bottomLeft,n+o-r.bottomLeft,r.bottomLeft,F,U,!0),e.lineTo(i+s-r.bottomRight,n+o),e.arc(i+s-r.bottomRight,n+o-r.bottomRight,r.bottomRight,U,0,!0),e.lineTo(i+s,n+r.topRight),e.arc(i+s-r.topRight,n+r.topRight,r.topRight,0,-U,!0),e.lineTo(i+r.topLeft,n)}function Pu(e,t){let i=(""+e).match(Du);if(!i||i[1]==="normal")return t*1.2;switch(e=+i[2],i[3]){case"px":return e;case"%":e/=100;break}return t*e}function tn(e,t){let i={},n=O(t),s=n?Object.keys(t):t,o=O(e)?n?r=>E(e[r],e[t[r]]):r=>e[r]:()=>e;for(let r of s)i[r]=Ou(o(r));return i}function vs(e){return tn(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Nt(e){return tn(e,["topLeft","topRight","bottomLeft","bottomRight"])}function nt(e){let t=vs(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Z(e,t){e=e||{},t=t||j.font;let i=E(e.size,t.size);typeof i=="string"&&(i=parseInt(i,10));let n=E(e.style,t.style);n&&!(""+n).match(Ru)&&(console.warn('Invalid font style specified: "'+n+'"'),n=void 0);let s={family:E(e.family,t.family),lineHeight:Pu(E(e.lineHeight,t.lineHeight),i),size:i,style:n,weight:E(e.weight,t.weight),string:""};return s.string=Cu(s),s}function Te(e,t,i,n){let s=!0,o,r,a;for(o=0,r=e.length;o<r;++o)if(a=e[o],a!==void 0&&(t!==void 0&&typeof a=="function"&&(a=a(t),s=!1),i!==void 0&&V(a)&&(a=a[i%a.length],s=!1),a!==void 0))return n&&!s&&(n.cacheable=!1),a}function sa(e,t,i){let{min:n,max:s}=e,o=os(t,(s-n)/2),r=(a,l)=>i&&a===0?0:a+l;return{min:r(n,-Math.abs(o)),max:r(s,o)}}function Rt(e,t){return Object.assign(Object.create(e),t)}function en(e,t=[""],i,n,s=()=>e[0]){let o=i||e;typeof n>"u"&&(n=aa("_fallback",e));let r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:n,_getTarget:s,override:a=>en([a,...e],t,o,n)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return oa(a,l,()=>Vu(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return $r(a).includes(l)},ownKeys(a){return $r(a)},set(a,l,c){let d=a._storage||(a._storage=s());return a[l]=d[l]=c,delete a._keys,!0}})}function te(e,t,i,n){let s={_cacheable:!1,_proxy:e,_context:t,_subProxy:i,_stack:new Set,_descriptors:Ms(e,n),setContext:o=>te(e,o,i,n),override:o=>te(e.override(o),t,i,n)};return new Proxy(s,{deleteProperty(o,r){return delete o[r],delete e[r],!0},get(o,r,a){return oa(o,r,()=>Fu(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(e,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,r)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,r){return Reflect.has(e,r)},ownKeys(){return Reflect.ownKeys(e)},set(o,r,a){return e[r]=a,delete o[r],!0}})}function Ms(e,t={scriptable:!0,indexable:!0}){let{_scriptable:i=t.scriptable,_indexable:n=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:i,indexable:n,isScriptable:Lt(i)?i:()=>i,isIndexable:Lt(n)?n:()=>n}}function oa(e,t,i){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];let n=i();return e[t]=n,n}function Fu(e,t,i){let{_proxy:n,_context:s,_subProxy:o,_descriptors:r}=e,a=n[t];return Lt(a)&&r.isScriptable(t)&&(a=$u(t,a,e,i)),V(a)&&a.length&&(a=Hu(t,a,e,r.isIndexable)),Ss(t,a)&&(a=te(a,s,o&&o[t],r)),a}function $u(e,t,i,n){let{_proxy:s,_context:o,_subProxy:r,_stack:a}=i;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,r||n);return a.delete(e),Ss(e,l)&&(l=ks(s._scopes,s,e,l)),l}function Hu(e,t,i,n){let{_proxy:s,_context:o,_subProxy:r,_descriptors:a}=i;if(typeof o.index<"u"&&n(e))return t[o.index%t.length];if(O(t[0])){let l=t,c=s._scopes.filter(d=>d!==l);t=[];for(let d of l){let u=ks(c,s,e,d);t.push(te(u,o,r&&r[e],a))}}return t}function ra(e,t,i){return Lt(e)?e(t,i):e}function zu(e,t,i,n,s){for(let o of t){let r=Wu(i,o);if(r){e.add(r);let a=ra(r._fallback,i,s);if(typeof a<"u"&&a!==i&&a!==n)return a}else if(r===!1&&typeof n<"u"&&i!==n)return null}return!1}function ks(e,t,i,n){let s=t._rootScopes,o=ra(t._fallback,i,n),r=[...e,...s],a=new Set;a.add(n);let l=Fr(a,r,i,o||i,n);return l===null||typeof o<"u"&&o!==i&&(l=Fr(a,r,o,l,n),l===null)?!1:en(Array.from(a),[""],s,o,()=>Bu(t,i,n))}function Fr(e,t,i,n,s){for(;i;)i=zu(e,t,i,n,s);return i}function Bu(e,t,i){let n=e._getTarget();t in n||(n[t]={});let s=n[t];return V(s)&&O(i)?i:s||{}}function Vu(e,t,i,n){let s;for(let o of t)if(s=aa(Iu(o,e),i),typeof s<"u")return Ss(e,s)?ks(i,n,e,s):s}function aa(e,t){for(let i of t){if(!i)continue;let n=i[e];if(typeof n<"u")return n}}function $r(e){let t=e._keys;return t||(t=e._keys=Nu(e._scopes)),t}function Nu(e){let t=new Set;for(let i of e)for(let n of Object.keys(i).filter(s=>!s.startsWith("_")))t.add(n);return Array.from(t)}function Ts(e,t,i,n){let{iScale:s}=e,{key:o="r"}=this._parsing,r=new Array(n),a,l,c,d;for(a=0,l=n;a<l;++a)c=a+i,d=t[c],r[a]={r:s.parse(Dt(d,o),c)};return r}function qu(e,t,i,n){let s=e.skip?t:e,o=t,r=i.skip?t:i,a=Yi(o,s),l=Yi(r,o),c=a/(a+l),d=l/(a+l);c=isNaN(c)?0:c,d=isNaN(d)?0:d;let u=n*c,h=n*d;return{previous:{x:o.x-u*(r.x-s.x),y:o.y-u*(r.y-s.y)},next:{x:o.x+h*(r.x-s.x),y:o.y+h*(r.y-s.y)}}}function Yu(e,t,i){let n=e.length,s,o,r,a,l,c=ye(e,0);for(let d=0;d<n-1;++d)if(l=c,c=ye(e,d+1),!(!l||!c)){if(ve(t[d],0,ju)){i[d]=i[d+1]=0;continue}s=i[d]/t[d],o=i[d+1]/t[d],a=Math.pow(s,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),i[d]=s*r*t[d],i[d+1]=o*r*t[d])}}function Gu(e,t,i="x"){let n=la(i),s=e.length,o,r,a,l=ye(e,0);for(let c=0;c<s;++c){if(r=a,a=l,l=ye(e,c+1),!a)continue;let d=a[i],u=a[n];r&&(o=(d-r[i])/3,a[`cp1${i}`]=d-o,a[`cp1${n}`]=u-o*t[c]),l&&(o=(l[i]-d)/3,a[`cp2${i}`]=d+o,a[`cp2${n}`]=u+o*t[c])}}function Uu(e,t="x"){let i=la(t),n=e.length,s=Array(n).fill(0),o=Array(n),r,a,l,c=ye(e,0);for(r=0;r<n;++r)if(a=l,l=c,c=ye(e,r+1),!!l){if(c){let d=c[t]-l[t];s[r]=d!==0?(c[i]-l[i])/d:0}o[r]=a?c?xt(s[r-1])!==xt(s[r])?0:(s[r-1]+s[r])/2:s[r-1]:s[r]}Yu(e,s,o),Gu(e,o,t)}function Vi(e,t,i){return Math.max(Math.min(e,i),t)}function Ku(e,t){let i,n,s,o,r,a=Mt(e[0],t);for(i=0,n=e.length;i<n;++i)r=o,o=a,a=i<n-1&&Mt(e[i+1],t),o&&(s=e[i],r&&(s.cp1x=Vi(s.cp1x,t.left,t.right),s.cp1y=Vi(s.cp1y,t.top,t.bottom)),a&&(s.cp2x=Vi(s.cp2x,t.left,t.right),s.cp2y=Vi(s.cp2y,t.top,t.bottom)))}function ca(e,t,i,n,s){let o,r,a,l;if(t.spanGaps&&(e=e.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Uu(e,s);else{let c=n?e[e.length-1]:e[0];for(o=0,r=e.length;o<r;++o)a=e[o],l=qu(c,a,e[Math.min(o+1,r-(n?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&Ku(e,i)}function nn(){return typeof window<"u"&&typeof document<"u"}function sn(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Gi(e,t,i){let n;return typeof e=="string"?(n=parseInt(e,10),e.indexOf("%")!==-1&&(n=n/100*t.parentNode[i])):n=e,n}function Xu(e,t){return on(e).getPropertyValue(t)}function Qt(e,t,i){let n={};i=i?"-"+i:"";for(let s=0;s<4;s++){let o=Ju[s];n[o]=parseFloat(e[t+"-"+o+i])||0}return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function Qu(e,t){let i=e.touches,n=i&&i.length?i[0]:e,{offsetX:s,offsetY:o}=n,r=!1,a,l;if(Zu(s,o,e.target))a=s,l=o;else{let c=t.getBoundingClientRect();a=n.clientX-c.left,l=n.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function jt(e,t){if("native"in e)return e;let{canvas:i,currentDevicePixelRatio:n}=t,s=on(i),o=s.boxSizing==="border-box",r=Qt(s,"padding"),a=Qt(s,"border","width"),{x:l,y:c,box:d}=Qu(e,i),u=r.left+(d&&a.left),h=r.top+(d&&a.top),{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-u)/f*i.width/n),y:Math.round((c-h)/g*i.height/n)}}function th(e,t,i){let n,s;if(t===void 0||i===void 0){let o=e&&sn(e);if(!o)t=e.clientWidth,i=e.clientHeight;else{let r=o.getBoundingClientRect(),a=on(o),l=Qt(a,"border","width"),c=Qt(a,"padding");t=r.width-c.width-l.width,i=r.height-c.height-l.height,n=Gi(a.maxWidth,o,"clientWidth"),s=Gi(a.maxHeight,o,"clientHeight")}}return{width:t,height:i,maxWidth:n||qi,maxHeight:s||qi}}function da(e,t,i,n){let s=on(e),o=Qt(s,"margin"),r=Gi(s.maxWidth,e,"clientWidth")||qi,a=Gi(s.maxHeight,e,"clientHeight")||qi,l=th(e,t,i),{width:c,height:d}=l;if(s.boxSizing==="content-box"){let h=Qt(s,"border","width"),f=Qt(s,"padding");c-=f.width+h.width,d-=f.height+h.height}return c=Math.max(0,c-o.width),d=Math.max(0,n?c/n:d-o.height),c=Wt(Math.min(c,r,l.maxWidth)),d=Wt(Math.min(d,a,l.maxHeight)),c&&!d&&(d=Wt(c/2)),(t!==void 0||i!==void 0)&&n&&l.height&&d>l.height&&(d=l.height,c=Wt(Math.floor(d*n))),{width:c,height:d}}function ws(e,t,i){let n=t||1,s=Wt(e.height*n),o=Wt(e.width*n);e.height=Wt(e.height),e.width=Wt(e.width);let r=e.canvas;return r.style&&(i||!r.style.height&&!r.style.width)&&(r.style.height=`${e.height}px`,r.style.width=`${e.width}px`),e.currentDevicePixelRatio!==n||r.height!==s||r.width!==o?(e.currentDevicePixelRatio=n,r.height=s,r.width=o,e.ctx.setTransform(n,0,0,n,0,0),!0):!1}function Cs(e,t){let i=Xu(e,t),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?+n[1]:void 0}function Ht(e,t,i,n){return{x:e.x+i*(t.x-e.x),y:e.y+i*(t.y-e.y)}}function ha(e,t,i,n){return{x:e.x+i*(t.x-e.x),y:n==="middle"?i<.5?e.y:t.y:n==="after"?i<1?e.y:t.y:i>0?t.y:e.y}}function fa(e,t,i,n){let s={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},r=Ht(e,s,i),a=Ht(s,o,i),l=Ht(o,t,i),c=Ht(r,a,i),d=Ht(a,l,i);return Ht(c,d,i)}function ie(e,t,i){return e?eh(t,i):ih()}function Es(e,t){let i,n;(t==="ltr"||t==="rtl")&&(i=e.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",t,"important"),e.prevTextDirection=n)}function Ls(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function ga(e){return e==="angle"?{between:Me,compare:xu,normalize:et}:{between:kt,compare:(t,i)=>t-i,normalize:t=>t}}function Hr({start:e,end:t,count:i,loop:n,style:s}){return{start:e%i,end:t%i,loop:n&&(t-e+1)%i===0,style:s}}function nh(e,t,i){let{property:n,start:s,end:o}=i,{between:r,normalize:a}=ga(n),l=t.length,{start:c,end:d,loop:u}=e,h,f;if(u){for(c+=l,d+=l,h=0,f=l;h<f&&r(a(t[c%l][n]),s,o);++h)c--,d--;c%=l,d%=l}return d<c&&(d+=l),{start:c,end:d,loop:u,style:e.style}}function As(e,t,i){if(!i)return[e];let{property:n,start:s,end:o}=i,r=t.length,{compare:a,between:l,normalize:c}=ga(n),{start:d,end:u,loop:h,style:f}=nh(e,t,i),g=[],p=!1,m=null,b,y,_,v=()=>l(s,_,b)&&a(s,_)!==0,x=()=>a(o,b)===0||l(o,_,b),S=()=>p||v(),k=()=>!p||x();for(let T=d,w=d;T<=u;++T)y=t[T%r],!y.skip&&(b=c(y[n]),b!==_&&(p=l(b,s,o),m===null&&S()&&(m=a(b,s)===0?T:w),m!==null&&k()&&(g.push(Hr({start:m,end:T,loop:h,count:r,style:f})),m=null),w=T,_=b));return m!==null&&g.push(Hr({start:m,end:u,loop:h,count:r,style:f})),g}function Ds(e,t){let i=[],n=e.segments;for(let s=0;s<n.length;s++){let o=As(n[s],e.points,t);o.length&&i.push(...o)}return i}function sh(e,t,i,n){let s=0,o=t-1;if(i&&!n)for(;s<t&&!e[s].skip;)s++;for(;s<t&&e[s].skip;)s++;for(s%=t,i&&(o+=s);o>s&&e[o%t].skip;)o--;return o%=t,{start:s,end:o}}function oh(e,t,i,n){let s=e.length,o=[],r=t,a=e[t],l;for(l=t+1;l<=i;++l){let c=e[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 pa(e,t){let i=e.points,n=e.options.spanGaps,s=i.length;if(!s)return[];let o=!!e._loop,{start:r,end:a}=sh(i,s,o,n);if(n===!0)return Wr(e,[{start:r,end:a,loop:o}],i,t);let l=a<r?a+s:a,c=!!e._fullLoop&&r===0&&a===s-1;return Wr(e,oh(i,r,l,c),i,t)}function Wr(e,t,i,n){return!n||!n.setContext||!i?t:rh(e,t,i,n)}function rh(e,t,i,n){let s=e._chart.getContext(),o=zr(e.options),{_datasetIndex:r,options:{spanGaps:a}}=e,l=i.length,c=[],d=o,u=t[0].start,h=u;function f(g,p,m,b){let y=a?-1:1;if(g!==p){for(g+=l;i[g%l].skip;)g-=y;for(;i[p%l].skip;)p+=y;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:m,style:b}),d=b,u=p%l)}}for(let g of t){u=a?u:g.start;let p=i[u%l],m;for(h=u+1;h<=g.end;h++){let b=i[h%l];m=zr(n.setContext(Rt(s,{type:"segment",p0:p,p1:b,p0DataIndex:(h-1)%l,p1DataIndex:h%l,datasetIndex:r}))),ah(m,d)&&f(u,h-1,g.loop,d),p=b,d=m}u<h-1&&f(u,h-1,g.loop,d)}return c}function zr(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function ah(e,t){if(!t)return!1;let i=[],n=function(s,o){return bs(o)?(i.includes(o)||i.push(o),i.indexOf(o)):o};return JSON.stringify(e,n)!==JSON.stringify(t,n)}function Ni(e,t,i){return e.options.clip?e[i]:t[i]}function lh(e,t){let{xScale:i,yScale:n}=e;return i&&n?{left:Ni(i,t,"left"),right:Ni(i,t,"right"),top:Ni(n,t,"top"),bottom:Ni(n,t,"bottom")}:t}function Rs(e,t){let i=t._clip;if(i.disabled)return!1;let n=lh(t,e.chartArea);return{left:i.left===!1?0:n.left-(i.left===!0?0:i.left),right:i.right===!1?e.width:n.right+(i.right===!0?0:i.right),top:i.top===!1?0:n.top-(i.top===!0?0:i.top),bottom:i.bottom===!1?e.height:n.bottom+(i.bottom===!0?0:i.bottom)}}var Br,Vr,os,Dr,_e,Lt,rs,F,N,mu,qi,bu,U,Zt,Rr,At,xt,vt,Ur,Xr,fs,Ji,it,Qr,Bi,Pr,Or,me,_u,vu,Ir,ta,ti,zt,Zi,ss,j,Du,Ru,Ou,Iu,Ss,Wu,ju,ye,la,on,Ju,Zu,Wt,ua,eh,ih,ma=C(()=>{Ar();Br=(()=>{let e=0;return()=>e++})();Vr=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,os=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;Dr={"":e=>e,x:e=>e.x,y:e=>e.y};_e=e=>typeof e<"u",Lt=e=>typeof e=="function",rs=(e,t)=>{if(e.size!==t.size)return!1;for(let i of e)if(!t.has(i))return!1;return!0};F=Math.PI,N=2*F,mu=N+F,qi=Number.POSITIVE_INFINITY,bu=F/180,U=F/2,Zt=F/4,Rr=F*2/3,At=Math.log10,xt=Math.sign;vt=(e,t,i,n)=>Xi(e,i,n?s=>{let o=e[s][t];return o<i||o===i&&e[s+1][t]===i}:s=>e[s][t]<i),Ur=(e,t,i)=>Xi(e,i,n=>e[n][t]>=i);Xr=["push","pop","shift","splice","unshift"];fs=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();Ji=e=>e==="start"?"left":e==="end"?"right":"center",it=(e,t,i)=>e==="start"?t:e==="end"?i:(t+i)/2,Qr=(e,t,i,n)=>e===(n?"left":"right")?i:e==="center"?(t+i)/2:t;Bi=e=>e===0||e===1,Pr=(e,t,i)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*N/i)),Or=(e,t,i)=>Math.pow(2,-10*e)*Math.sin((e-t)*N/i)+1,me={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*U)+1,easeOutSine:e=>Math.sin(e*U),easeInOutSine:e=>-.5*(Math.cos(F*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Bi(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Bi(e)?e:Pr(e,.075,.3),easeOutElastic:e=>Bi(e)?e:Or(e,.075,.3),easeInOutElastic(e){return Bi(e)?e:e<.5?.5*Pr(e*2,.1125,.45):.5+.5*Or(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-me.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?me.easeInBounce(e*2)*.5:me.easeOutBounce(e*2-1)*.5+.5};_u=["x","y","borderWidth","radius","tension"],vu=["color","borderColor","backgroundColor"];Ir=new Map;ta={values(e){return V(e)?e:""+e},numeric(e,t,i){if(e===0)return"0";let n=this.chart.options.locale,s,o=e;if(i.length>1){let c=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),o=Tu(e,i)}let r=At(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),Se(e,n,l)},logarithmic(e,t,i){if(e===0)return"0";let n=i[t].significand||e/Math.pow(10,Math.floor(At(e)));return[1,2,3,5,10,15].includes(n)||t>.8*i.length?ta.numeric.call(this,e,t,i):""}};ti={formatters:ta};zt=Object.create(null),Zi=Object.create(null);ss=class{constructor(t,i){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=n=>n.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)=>is(s.backgroundColor),this.hoverBorderColor=(n,s)=>is(s.borderColor),this.hoverColor=(n,s)=>is(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(i)}set(t,i){return ns(this,t,i)}get(t){return Je(this,t)}describe(t,i){return ns(Zi,t,i)}override(t,i){return ns(zt,t,i)}route(t,i,n,s){let o=Je(this,t),r=Je(this,n),a="_"+i;Object.defineProperties(o,{[a]:{value:o[i],writable:!0},[i]:{enumerable:!0,get(){let l=this[a],c=r[s];return O(l)?Object.assign({},c,l):E(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(i=>i(this))}},j=new ss({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Mu,Su,wu]);Du=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Ru=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;Ou=e=>+e||0;Iu=(e,t)=>e?e+Ui(t):t,Ss=(e,t)=>O(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);Wu=(e,t)=>e===!0?t:typeof e=="string"?Dt(t,e):void 0;ju=Number.EPSILON||1e-14,ye=(e,t)=>t<e.length&&!e[t].skip&&e[t],la=e=>e==="x"?"y":"x";on=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);Ju=["top","right","bottom","left"];Zu=(e,t,i)=>(e>0||t>0)&&(!i||!i.shadowRoot);Wt=e=>Math.round(e*10)/10;ua=(function(){let e=!1;try{let t={get passive(){return e=!0,!1}};nn()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();eh=function(e,t){return{x(i){return e+e+t-i},setWidth(i){t=i},textAlign(i){return i==="center"?i:i==="right"?"left":"right"},xPlus(i,n){return i-n},leftForLtr(i,n){return i-n}}},ih=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}}});function dh(e,t){let i=[],n=Object.keys(t);for(let s=0;s<n.length;s++){let o=e[n[s]];o&&o.active()&&i.push(o.wait())}return Promise.all(i)}function uh(e,t){if(!t)return;let i=e.options;if(!i){e.options=t;return}return i.$shared&&(e.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}function ya(e,t){let i=e&&e.options||{},n=i.reverse,s=i.min===void 0?t:0,o=i.max===void 0?t:0;return{start:n?o:s,end:n?s:o}}function hh(e,t,i){if(i===!1)return!1;let n=ya(e,i),s=ya(t,i);return{top:s.end,right:n.end,bottom:s.start,left:n.start}}function fh(e){let t,i,n,s;return O(e)?(t=e.top,i=e.right,n=e.bottom,s=e.left):t=i=n=s=e,{top:t,right:i,bottom:n,left:s,disabled:e===!1}}function ml(e,t){let i=[],n=e._getSortedDatasetMetas(t),s,o;for(s=0,o=n.length;s<o;++s)i.push(n[s].index);return i}function xa(e,t,i,n={}){let s=e.keys,o=n.mode==="single",r,a,l,c;if(t===null)return;let d=!1;for(r=0,a=s.length;r<a;++r){if(l=+s[r],l===i){if(d=!0,n.all)continue;break}c=e.values[l],Y(c)&&(o||t===0||xt(t)===xt(c))&&(t+=c)}return!d&&!n.all?0:t}function gh(e,t){let{iScale:i,vScale:n}=t,s=i.axis==="x"?"x":"y",o=n.axis==="x"?"x":"y",r=Object.keys(e),a=new Array(r.length),l,c,d;for(l=0,c=r.length;l<c;++l)d=r[l],a[l]={[s]:d,[o]:e[d]};return a}function Ps(e,t){let i=e&&e.options.stacked;return i||i===void 0&&t.stack!==void 0}function ph(e,t,i){return`${e.id}.${t.id}.${i.stack||i.type}`}function mh(e){let{min:t,max:i,minDefined:n,maxDefined:s}=e.getUserBounds();return{min:n?t:Number.NEGATIVE_INFINITY,max:s?i:Number.POSITIVE_INFINITY}}function bh(e,t,i){let n=e[t]||(e[t]={});return n[i]||(n[i]={})}function _a(e,t,i,n){for(let s of t.getMatchingVisibleMetas(n).reverse()){let o=e[s.index];if(i&&o>0||!i&&o<0)return s.index}return null}function va(e,t){let{chart:i,_cachedMeta:n}=e,s=i._stacks||(i._stacks={}),{iScale:o,vScale:r,index:a}=n,l=o.axis,c=r.axis,d=ph(o,r,n),u=t.length,h;for(let f=0;f<u;++f){let g=t[f],{[l]:p,[c]:m}=g,b=g._stacks||(g._stacks={});h=b[c]=bh(s,d,p),h[a]=m,h._top=_a(h,r,!0,n.type),h._bottom=_a(h,r,!1,n.type);let y=h._visualValues||(h._visualValues={});y[a]=m}}function Os(e,t){let i=e.scales;return Object.keys(i).filter(n=>i[n].axis===t).shift()}function yh(e,t){return Rt(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function xh(e,t,i){return Rt(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:i,index:t,mode:"default",type:"data"})}function ni(e,t){let i=e.controller.index,n=e.vScale&&e.vScale.axis;if(n){t=t||e._parsed;for(let s of t){let o=s._stacks;if(!o||o[n]===void 0||o[n][i]===void 0)return;delete o[n][i],o[n]._visualValues!==void 0&&o[n]._visualValues[i]!==void 0&&delete o[n]._visualValues[i]}}}function vh(e,t){if(!e._cache.$bar){let i=e.getMatchingVisibleMetas(t),n=[];for(let s=0,o=i.length;s<o;s++)n=n.concat(i[s].controller.getAllParsedValues(e));e._cache.$bar=hs(n.sort((s,o)=>s-o))}return e._cache.$bar}function Mh(e){let t=e.iScale,i=vh(t,e.type),n=t._length,s,o,r,a,l=()=>{r===32767||r===-32768||(_e(a)&&(n=Math.min(n,Math.abs(r-a)||n)),a=r)};for(s=0,o=i.length;s<o;++s)r=t.getPixelForValue(i[s]),l();for(a=void 0,s=0,o=t.ticks.length;s<o;++s)r=t.getPixelForTick(s),l();return n}function Sh(e,t,i,n){let s=i.barThickness,o,r;return P(s)?(o=t.min*i.categoryPercentage,r=i.barPercentage):(o=s*n,r=1),{chunk:o/n,ratio:r,start:t.pixels[e]-o/2}}function kh(e,t,i,n){let s=t.pixels,o=s[e],r=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null,l=i.categoryPercentage;r===null&&(r=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-r);let c=o-(o-Math.min(r,a))/2*l;return{chunk:Math.abs(a-r)/2*l/n,ratio:i.barPercentage,start:c}}function Th(e,t,i,n){let s=i.parse(e[0],n),o=i.parse(e[1],n),r=Math.min(s,o),a=Math.max(s,o),l=r,c=a;Math.abs(r)>Math.abs(a)&&(l=a,c=r),t[i.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:o,min:r,max:a}}function bl(e,t,i,n){return V(e)?Th(e,t,i,n):t[i.axis]=i.parse(e,n),t}function Sa(e,t,i,n){let s=e.iScale,o=e.vScale,r=s.getLabels(),a=s===o,l=[],c,d,u,h;for(c=i,d=i+n;c<d;++c)h=t[c],u={},u[s.axis]=a||s.parse(r[c],c),l.push(bl(h,u,o,c));return l}function Fs(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function wh(e,t,i){return e!==0?xt(e):(t.isHorizontal()?1:-1)*(t.min>=i?1:-1)}function Ch(e){let t,i,n,s,o;return e.horizontal?(t=e.base>e.x,i="left",n="right"):(t=e.base<e.y,i="bottom",n="top"),t?(s="end",o="start"):(s="start",o="end"),{start:i,end:n,reverse:t,top:s,bottom:o}}function Eh(e,t,i,n){let s=t.borderSkipped,o={};if(!s){e.borderSkipped=o;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:r,end:a,reverse:l,top:c,bottom:d}=Ch(e);s==="middle"&&i&&(e.enableBorderRadius=!0,(i._top||0)===n?s=c:(i._bottom||0)===n?s=d:(o[ka(d,r,a,l)]=!0,s=c)),o[ka(s,r,a,l)]=!0,e.borderSkipped=o}function ka(e,t,i,n){return n?(e=Lh(e,t,i),e=Ta(e,i,t)):e=Ta(e,t,i),e}function Lh(e,t,i){return e===t?i:e===i?t:e}function Ta(e,t,i){return e==="start"?t:e==="end"?i:e}function Ah(e,{inflateAmount:t},i){e.inflateAmount=t==="auto"?i===1?.33:0:t}function Dh(e,t,i){let n=1,s=1,o=0,r=0;if(t<N){let a=e,l=a+t,c=Math.cos(a),d=Math.sin(a),u=Math.cos(l),h=Math.sin(l),f=(_,v,x)=>Me(_,a,l,!0)?1:Math.max(v,v*i,x,x*i),g=(_,v,x)=>Me(_,a,l,!0)?-1:Math.min(v,v*i,x,x*i),p=f(0,c,u),m=f(U,d,h),b=g(F,c,u),y=g(F+U,d,h);n=(p-b)/2,s=(m-y)/2,o=-(p+b)/2,r=-(m+y)/2}return{ratioX:n,ratioY:s,offsetX:o,offsetY:r}}function ne(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}function Oh(e,t,i,n){let{controller:s,data:o,_sorted:r}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){let c=a._reversePixels?Ur:vt;if(n){if(s._sharedOptions){let d=o[0],u=typeof d.getRange=="function"&&d.getRange(t);if(u){let h=c(o,t,i-u),f=c(o,t,i+u);return{lo:h.lo,hi:f.hi}}}}else{let d=c(o,t,i);if(l){let{vScale:u}=s._cachedMeta,{_parsed:h}=e,f=h.slice(0,d.lo+1).reverse().findIndex(p=>!P(p[u.axis]));d.lo-=Math.max(0,f);let g=h.slice(d.hi).findIndex(p=>!P(p[u.axis]));d.hi+=Math.max(0,g)}return d}}return{lo:0,hi:o.length-1}}function xi(e,t,i,n,s){let o=e.getSortedVisibleDatasetMetas(),r=i[t];for(let a=0,l=o.length;a<l;++a){let{index:c,data:d}=o[a],{lo:u,hi:h}=Oh(o[a],t,r,s);for(let f=u;f<=h;++f){let g=d[f];g.skip||n(g,c,f)}}}function Ih(e){let t=e.indexOf("x")!==-1,i=e.indexOf("y")!==-1;return function(n,s){let o=t?Math.abs(n.x-s.x):0,r=i?Math.abs(n.y-s.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function $s(e,t,i,n,s){let o=[];return!s&&!e.isPointInArea(t)||xi(e,i,t,function(a,l,c){!s&&!Mt(a,e.chartArea,0)||a.inRange(t.x,t.y,n)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Fh(e,t,i,n){let s=[];function o(r,a,l){let{startAngle:c,endAngle:d}=r.getProps(["startAngle","endAngle"],n),{angle:u}=ds(r,{x:t.x,y:t.y});Me(u,c,d)&&s.push({element:r,datasetIndex:a,index:l})}return xi(e,i,t,o),s}function $h(e,t,i,n,s,o){let r=[],a=Ih(i),l=Number.POSITIVE_INFINITY;function c(d,u,h){let f=d.inRange(t.x,t.y,s);if(n&&!f)return;let g=d.getCenterPoint(s);if(!(!!o||e.isPointInArea(g))&&!f)return;let m=a(t,g);m<l?(r=[{element:d,datasetIndex:u,index:h}],l=m):m===l&&r.push({element:d,datasetIndex:u,index:h})}return xi(e,i,t,c),r}function Hs(e,t,i,n,s,o){return!o&&!e.isPointInArea(t)?[]:i==="r"&&!n?Fh(e,t,i,s):$h(e,t,i,n,s,o)}function wa(e,t,i,n,s){let o=[],r=i==="x"?"inXRange":"inYRange",a=!1;return xi(e,i,t,(l,c,d)=>{l[r]&&l[r](t[i],s)&&(o.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(t.x,t.y,s))}),n&&!a?[]:o}function si(e,t){return e.filter(i=>i.pos===t)}function Ca(e,t){return e.filter(i=>yl.indexOf(i.pos)===-1&&i.box.axis===t)}function oi(e,t){return e.sort((i,n)=>{let s=t?n:i,o=t?i:n;return s.weight===o.weight?s.index-o.index:s.weight-o.weight})}function Wh(e){let t=[],i,n,s,o,r,a;for(i=0,n=(e||[]).length;i<n;++i)s=e[i],{position:o,options:{stack:r,stackWeight:a=1}}=s,t.push({index:i,box:s,pos:o,horizontal:s.isHorizontal(),weight:s.weight,stack:r&&o+r,stackWeight:a});return t}function zh(e){let t={};for(let i of e){let{stack:n,pos:s,stackWeight:o}=i;if(!n||!yl.includes(s))continue;let r=t[n]||(t[n]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function Bh(e,t){let i=zh(e),{vBoxMaxWidth:n,hBoxMaxHeight:s}=t,o,r,a;for(o=0,r=e.length;o<r;++o){a=e[o];let{fullSize:l}=a.box,c=i[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*n:l&&t.availableWidth,a.height=s):(a.width=n,a.height=d?d*s:l&&t.availableHeight)}return i}function Vh(e){let t=Wh(e),i=oi(t.filter(c=>c.box.fullSize),!0),n=oi(si(t,"left"),!0),s=oi(si(t,"right")),o=oi(si(t,"top"),!0),r=oi(si(t,"bottom")),a=Ca(t,"x"),l=Ca(t,"y");return{fullSize:i,leftAndTop:n.concat(o),rightAndBottom:s.concat(l).concat(r).concat(a),chartArea:si(t,"chartArea"),vertical:n.concat(s).concat(l),horizontal:o.concat(r).concat(a)}}function Ea(e,t,i,n){return Math.max(e[i],t[i])+Math.max(e[n],t[n])}function xl(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Nh(e,t,i,n){let{pos:s,box:o}=i,r=e.maxPadding;if(!O(s)){i.size&&(e[s]-=i.size);let u=n[i.stack]||{size:0,count:1};u.size=Math.max(u.size,i.horizontal?o.height:o.width),i.size=u.size/u.count,e[s]+=i.size}o.getPadding&&xl(r,o.getPadding());let a=Math.max(0,t.outerWidth-Ea(r,e,"left","right")),l=Math.max(0,t.outerHeight-Ea(r,e,"top","bottom")),c=a!==e.w,d=l!==e.h;return e.w=a,e.h=l,i.horizontal?{same:c,other:d}:{same:d,other:c}}function jh(e){let t=e.maxPadding;function i(n){let s=Math.max(t[n]-e[n],0);return e[n]+=s,s}e.y+=i("top"),e.x+=i("left"),i("right"),i("bottom")}function qh(e,t){let i=t.maxPadding;function n(s){let o={left:0,top:0,right:0,bottom:0};return s.forEach(r=>{o[r]=Math.max(t[r],i[r])}),o}return n(e?["left","right"]:["top","bottom"])}function ci(e,t,i,n){let s=[],o,r,a,l,c,d;for(o=0,r=e.length,c=0;o<r;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,qh(a.horizontal,t));let{same:u,other:h}=Nh(t,i,a,n);c|=u&&s.length,d=d||h,l.fullSize||s.push(a)}return c&&ci(s,t,i,n)||d}function rn(e,t,i,n,s){e.top=i,e.left=t,e.right=t+n,e.bottom=i+s,e.width=n,e.height=s}function La(e,t,i,n){let s=i.padding,{x:o,y:r}=t;for(let a of e){let l=a.box,c=n[a.stack]||{count:1,placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){let u=t.w*d,h=c.size||l.height;_e(c.start)&&(r=c.start),l.fullSize?rn(l,s.left,r,i.outerWidth-s.right-s.left,h):rn(l,t.left+c.placed,r,u,h),c.start=r,c.placed+=u,r=l.bottom}else{let u=t.h*d,h=c.size||l.width;_e(c.start)&&(o=c.start),l.fullSize?rn(l,o,s.top,h,i.outerHeight-s.bottom-s.top):rn(l,o,t.top+c.placed,h,u),c.start=o,c.placed+=u,o=l.right}}t.x=o,t.y=r}function Gh(e,t){let i=e.style,n=e.getAttribute("height"),s=e.getAttribute("width");if(e[hn]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Aa(s)){let o=Cs(e,"width");o!==void 0&&(e.width=o)}if(Aa(n))if(e.style.height==="")e.height=e.width/(t||2);else{let o=Cs(e,"height");o!==void 0&&(e.height=o)}return e}function Uh(e,t,i){e&&e.addEventListener(t,i,_l)}function Kh(e,t,i){e&&e.canvas&&e.canvas.removeEventListener(t,i,_l)}function Xh(e,t){let i=Yh[e.type]||e.type,{x:n,y:s}=jt(e,t);return{type:i,chart:t,native:e,x:n!==void 0?n:null,y:s!==void 0?s:null}}function mn(e,t){for(let i of e)if(i===t||i.contains(t))return!0}function Jh(e,t,i){let n=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||mn(a.addedNodes,n),r=r&&!mn(a.removedNodes,n);r&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function Zh(e,t,i){let n=e.canvas,s=new MutationObserver(o=>{let r=!1;for(let a of o)r=r||mn(a.removedNodes,n),r=r&&!mn(a.addedNodes,n);r&&i()});return s.observe(document,{childList:!0,subtree:!0}),s}function vl(){let e=window.devicePixelRatio;e!==Da&&(Da=e,mi.forEach((t,i)=>{i.currentDevicePixelRatio!==e&&t()}))}function Qh(e,t){mi.size||window.addEventListener("resize",vl),mi.set(e,t)}function tf(e){mi.delete(e),mi.size||window.removeEventListener("resize",vl)}function ef(e,t,i){let n=e.canvas,s=n&&sn(n);if(!s)return;let o=gs((a,l)=>{let c=s.clientWidth;i(a,l),c<s.clientWidth&&i()},window),r=new ResizeObserver(a=>{let l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||o(c,d)});return r.observe(s),Qh(e,o),r}function Ws(e,t,i){i&&i.disconnect(),t==="resize"&&tf(e)}function nf(e,t,i){let n=e.canvas,s=gs(o=>{e.ctx!==null&&i(Xh(o,e))},e);return Uh(n,t,s),s}function sf(e){return!nn()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?Gs:Us}function of(e,t){let i=e.options.ticks,n=rf(e),s=Math.min(i.maxTicksLimit||n,n),o=i.major.enabled?lf(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>s)return cf(t,c,o,r/s),c;let d=af(o,t,s);if(r>0){let u,h,f=r>1?Math.round((l-a)/(r-1)):null;for(an(t,c,d,P(f)?0:a-f,a),u=0,h=r-1;u<h;u++)an(t,c,d,o[u],o[u+1]);return an(t,c,d,l,P(f)?t.length:l+f),c}return an(t,c,d),c}function rf(e){let t=e.options.offset,i=e._tickSize(),n=e._length/i+(t?0:1),s=e._maxLength/i;return Math.floor(Math.min(n,s))}function af(e,t,i){let n=df(e),s=t.length/i;if(!n)return Math.max(s,1);let o=qr(n);for(let r=0,a=o.length-1;r<a;r++){let l=o[r];if(l>s)return l}return Math.max(s,1)}function lf(e){let t=[],i,n;for(i=0,n=e.length;i<n;i++)e[i].major&&t.push(i);return t}function cf(e,t,i,n){let s=0,o=i[0],r;for(n=Math.ceil(n),r=0;r<e.length;r++)r===o&&(t.push(e[r]),s++,o=i[s*n])}function an(e,t,i,n,s){let o=E(n,0),r=Math.min(E(s,e.length),e.length),a=0,l,c,d;for(i=Math.ceil(i),s&&(l=s-n,i=l/Math.floor(l/i)),d=o;d<0;)a++,d=Math.round(o+a*i);for(c=Math.max(o,0);c<r;c++)c===d&&(t.push(e[c]),a++,d=Math.round(o+a*i))}function df(e){let t=e.length,i,n;if(t<2)return!1;for(n=e[0],i=1;i<t;++i)if(e[i]-e[i-1]!==n)return!1;return n}function Oa(e,t){let i=[],n=e.length/t,s=e.length,o=0;for(;o<s;o+=n)i.push(e[Math.floor(o)]);return i}function hf(e,t,i){let n=e.ticks.length,s=Math.min(t,n-1),o=e._startPixel,r=e._endPixel,a=1e-6,l=e.getPixelForTick(s),c;if(!(i&&(n===1?c=Math.max(l-o,r-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<o-a||l>r+a)))return l}function ff(e,t){H(e,i=>{let n=i.gc,s=n.length/2,o;if(s>t){for(o=0;o<s;++o)delete i.data[n[o]];n.splice(0,s)}})}function ri(e){return e.drawTicks?e.tickLength:0}function Ia(e,t){if(!e.display)return 0;let i=Z(e.font,t),n=nt(e.padding);return(V(e.text)?e.text.length:1)*i.lineHeight+n.height}function gf(e,t){return Rt(e,{scale:t,type:"scale"})}function pf(e,t,i){return Rt(e,{tick:i,index:t,type:"tick"})}function mf(e,t,i){let n=Ji(e);return(i&&t!=="right"||!i&&t==="right")&&(n=uf(n)),n}function bf(e,t,i,n){let{top:s,left:o,bottom:r,right:a,chart:l}=e,{chartArea:c,scales:d}=l,u=0,h,f,g,p=r-s,m=a-o;if(e.isHorizontal()){if(f=it(n,o,a),O(i)){let b=Object.keys(i)[0],y=i[b];g=d[b].getPixelForValue(y)+p-t}else i==="center"?g=(c.bottom+c.top)/2+p-t:g=Ra(e,i,t);h=a-o}else{if(O(i)){let b=Object.keys(i)[0],y=i[b];f=d[b].getPixelForValue(y)-m+t}else i==="center"?f=(c.left+c.right)/2-m+t:f=Ra(e,i,t);g=it(n,r,s),u=i==="left"?-U:U}return{titleX:f,titleY:g,maxWidth:h,rotation:u}}function yf(e,t,i){let n=be(Object.create(null),[i?j.get(i):{},j.get(t),e.defaults]);j.set(t,n),e.defaultRoutes&&xf(t,e.defaultRoutes),e.descriptors&&j.describe(t,e.descriptors)}function xf(e,t){Object.keys(t).forEach(i=>{let n=i.split("."),s=n.pop(),o=[e].concat(n).join("."),r=t[i].split("."),a=r.pop(),l=r.join(".");j.route(o,s,l,a)})}function _f(e){return"id"in e&&"defaults"in e}function vf(e){let t={},i=[],n=Object.keys(wt.plugins.items);for(let o=0;o<n.length;o++)i.push(wt.getPlugin(n[o]));let s=e.plugins||[];for(let o=0;o<s.length;o++){let r=s[o];i.indexOf(r)===-1&&(i.push(r),t[r.id]=!0)}return{plugins:i,localIds:t}}function Mf(e,t){return!t&&e===!1?null:e===!0?{}:e}function Sf(e,{plugins:t,localIds:i},n,s){let o=[],r=e.getContext();for(let a of t){let l=a.id,c=Mf(n[l],s);c!==null&&o.push({plugin:a,options:kf(e.config,{plugin:a,local:i[l]},c,r)})}return o}function kf(e,{plugin:t,local:i},n,s){let o=e.pluginScopeKeys(t),r=e.getOptionScopes(n,o);return i&&t.defaults&&r.push(t.defaults),e.createResolver(r,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Js(e,t){let i=j.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||i.indexAxis||"x"}function Tf(e,t){let i=e;return e==="_index_"?i=t:e==="_value_"&&(i=t==="x"?"y":"x"),i}function wf(e,t){return e===t?"_index_":"_value_"}function Fa(e){if(e==="x"||e==="y"||e==="r")return e}function Cf(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function Zs(e,...t){if(Fa(e))return e;for(let i of t){let n=i.axis||Cf(i.position)||e.length>1&&Fa(e[0].toLowerCase());if(n)return n}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function $a(e,t,i){if(i[t+"AxisID"]===e)return{axis:t}}function Ef(e,t){if(t.data&&t.data.datasets){let i=t.data.datasets.filter(n=>n.xAxisID===e||n.yAxisID===e);if(i.length)return $a(e,"x",i[0])||$a(e,"y",i[0])}return{}}function Lf(e,t){let i=zt[e.type]||{scales:{}},n=t.scales||{},s=Js(e.type,t),o=Object.create(null);return Object.keys(n).forEach(r=>{let a=n[r];if(!O(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);let l=Zs(r,a,Ef(r,e),j.scales[a.type]),c=wf(l,s),d=i.scales||{};o[r]=xe(Object.create(null),[{axis:l},a,d[l],d[c]])}),e.data.datasets.forEach(r=>{let a=r.type||e.type,l=r.indexAxis||Js(a,t),d=(zt[a]||{}).scales||{};Object.keys(d).forEach(u=>{let h=Tf(u,l),f=r[h+"AxisID"]||h;o[f]=o[f]||Object.create(null),xe(o[f],[{axis:h},n[f],d[u]])})}),Object.keys(o).forEach(r=>{let a=o[r];xe(a,[j.scales[a.type],j.scale])}),o}function Ml(e){let t=e.options||(e.options={});t.plugins=E(t.plugins,{}),t.scales=Lf(e,t)}function Sl(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function Af(e){return e=e||{},e.data=Sl(e.data),Ml(e),e}function ln(e,t){let i=Ha.get(e);return i||(i=t(),Ha.set(e,i),kl.add(i)),i}function Wa(e,t,i){let n=e.get(t);n||(n=new Map,e.set(t,n));let s=i.join(),o=n.get(s);return o||(o={resolver:en(t,i),subPrefixes:i.filter(a=>!a.toLowerCase().includes("hover"))},n.set(s,o)),o}function Rf(e,t){let{isScriptable:i,isIndexable:n}=Ms(e);for(let s of t){let o=i(s),r=n(s),a=(r||o)&&e[s];if(o&&(Lt(a)||Df(a))||r&&V(a))return!0}return!1}function za(e,t){return e==="top"||e==="bottom"||Of.indexOf(e)===-1&&t==="x"}function Ba(e,t){return function(i,n){return i[e]===n[e]?i[t]-n[t]:i[e]-n[e]}}function Va(e){let t=e.chart,i=t.options.animation;t.notifyPlugins("afterRender"),B(i&&i.onComplete,[e],t)}function If(e){let t=e.chart,i=t.options.animation;B(i&&i.onProgress,[e],t)}function Tl(e){return nn()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}function Ff(e,t,i){let n=Object.keys(e);for(let s of n){let o=+s;if(o>=t){let r=e[s];delete e[s],(i>0||o>t)&&(e[o+i]=r)}}}function $f(e,t,i,n){return!i||e.type==="mouseout"?null:n?t:e}function ja(){return H(lt.instances,e=>e._plugins.invalidate())}function Hf(e,t,i){let{startAngle:n,x:s,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:d}=l,u=Math.min(c/r,et(n-i));if(e.beginPath(),e.arc(s,o,r-c/2,n+u/2,i-u/2),a>0){let h=Math.min(c/a,et(n-i));e.arc(s,o,a+c/2,i-h/2,n+h/2,!0)}else{let h=Math.min(c/2,r*et(n-i));if(d==="round")e.arc(s,o,h,i-F/2,n+F/2,!0);else if(d==="bevel"){let f=2*h*h,g=-f*Math.cos(i+F/2)+s,p=-f*Math.sin(i+F/2)+o,m=f*Math.cos(n+F/2)+s,b=f*Math.sin(n+F/2)+o;e.lineTo(g,p),e.lineTo(m,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function Wf(e,t,i){let{startAngle:n,pixelMargin:s,x:o,y:r,outerRadius:a,innerRadius:l}=t,c=s/a;e.beginPath(),e.arc(o,r,a,n-c,i+c),l>s?(c=s/l,e.arc(o,r,l,i+c,n-c,!0)):e.arc(o,r,s,i+U,n-U),e.closePath(),e.clip()}function zf(e){return tn(e,["outerStart","outerEnd","innerStart","innerEnd"])}function Bf(e,t,i,n){let s=zf(e.options.borderRadius),o=(i-t)/2,r=Math.min(o,n*t/2),a=l=>{let c=(i-Math.min(o,l))*n/2;return Q(l,0,Math.min(o,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Q(s.innerStart,0,r),innerEnd:Q(s.innerEnd,0,r)}}function we(e,t,i,n){return{x:i+e*Math.cos(t),y:n+e*Math.sin(t)}}function bn(e,t,i,n,s,o){let{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=t,u=Math.max(t.outerRadius+n+i-c,0),h=d>0?d+n+i+c:0,f=0,g=s-l;if(n){let z=d>0?d-n:0,q=u>0?u-n:0,X=(z+q)/2,yt=X!==0?g*X/(X+n):g;f=(g-yt)/2}let p=Math.max(.001,g*u-i/F)/u,m=(g-p)/2,b=l+m+f,y=s-m-f,{outerStart:_,outerEnd:v,innerStart:x,innerEnd:S}=Bf(t,h,u,y-b),k=u-_,T=u-v,w=b+_/k,L=y-v/T,A=h+x,I=h+S,tt=b+x/A,ht=y-S/I;if(e.beginPath(),o){let z=(w+L)/2;if(e.arc(r,a,u,w,z),e.arc(r,a,u,z,L),v>0){let st=we(T,L,r,a);e.arc(st.x,st.y,v,L,y+U)}let q=we(I,y,r,a);if(e.lineTo(q.x,q.y),S>0){let st=we(I,ht,r,a);e.arc(st.x,st.y,S,y+U,ht+Math.PI)}let X=(y-S/h+(b+x/h))/2;if(e.arc(r,a,h,y-S/h,X,!0),e.arc(r,a,h,X,b+x/h,!0),x>0){let st=we(A,tt,r,a);e.arc(st.x,st.y,x,tt+Math.PI,b-U)}let yt=we(k,b,r,a);if(e.lineTo(yt.x,yt.y),_>0){let st=we(k,w,r,a);e.arc(st.x,st.y,_,b-U,w)}}else{e.moveTo(r,a);let z=Math.cos(w)*u+r,q=Math.sin(w)*u+a;e.lineTo(z,q);let X=Math.cos(L)*u+r,yt=Math.sin(L)*u+a;e.lineTo(X,yt)}e.closePath()}function Vf(e,t,i,n,s){let{fullCircles:o,startAngle:r,circumference:a}=t,l=t.endAngle;if(o){bn(e,t,i,n,l,s);for(let c=0;c<o;++c)e.fill();isNaN(a)||(l=r+(a%N||N))}return bn(e,t,i,n,l,s),e.fill(),l}function Nf(e,t,i,n,s){let{fullCircles:o,startAngle:r,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:u,borderDashOffset:h,borderRadius:f}=l,g=l.borderAlign==="inner";if(!c)return;e.setLineDash(u||[]),e.lineDashOffset=h,g?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let p=t.endAngle;if(o){bn(e,t,i,n,p,s);for(let m=0;m<o;++m)e.stroke();isNaN(a)||(p=r+(a%N||N))}g&&Wf(e,t,p),l.selfJoin&&p-r>=F&&f===0&&d!=="miter"&&Hf(e,t,p),o||(bn(e,t,i,n,p,s),e.stroke())}function wl(e,t,i=t){e.lineCap=E(i.borderCapStyle,t.borderCapStyle),e.setLineDash(E(i.borderDash,t.borderDash)),e.lineDashOffset=E(i.borderDashOffset,t.borderDashOffset),e.lineJoin=E(i.borderJoinStyle,t.borderJoinStyle),e.lineWidth=E(i.borderWidth,t.borderWidth),e.strokeStyle=E(i.borderColor,t.borderColor)}function jf(e,t,i){e.lineTo(i.x,i.y)}function qf(e){return e.stepped?ia:e.tension||e.cubicInterpolationMode==="monotone"?na:jf}function Cl(e,t,i={}){let n=e.length,{start:s=0,end:o=n-1}=i,{start:r,end:a}=t,l=Math.max(s,r),c=Math.min(o,a),d=s<r&&o<r||s>a&&o>a;return{count:n,start:l,loop:t.loop,ilen:c<l&&!d?n+c-l:c-l}}function Yf(e,t,i,n){let{points:s,options:o}=t,{count:r,start:a,loop:l,ilen:c}=Cl(s,i,n),d=qf(o),{move:u=!0,reverse:h}=n||{},f,g,p;for(f=0;f<=c;++f)g=s[(a+(h?c-f:f))%r],!g.skip&&(u?(e.moveTo(g.x,g.y),u=!1):d(e,p,g,h,o.stepped),p=g);return l&&(g=s[(a+(h?c:0))%r],d(e,p,g,h,o.stepped)),!!l}function Gf(e,t,i,n){let s=t.points,{count:o,start:r,ilen:a}=Cl(s,i,n),{move:l=!0,reverse:c}=n||{},d=0,u=0,h,f,g,p,m,b,y=v=>(r+(c?a-v:v))%o,_=()=>{p!==m&&(e.lineTo(d,m),e.lineTo(d,p),e.lineTo(d,b))};for(l&&(f=s[y(0)],e.moveTo(f.x,f.y)),h=0;h<=a;++h){if(f=s[y(h)],f.skip)continue;let v=f.x,x=f.y,S=v|0;S===g?(x<p?p=x:x>m&&(m=x),d=(u*d+v)/++u):(_(),e.lineTo(v,x),g=S,u=0,p=m=x),b=x}_()}function to(e){let t=e.options,i=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!i?Gf:Yf}function Uf(e){return e.stepped?ha:e.tension||e.cubicInterpolationMode==="monotone"?fa:Ht}function Kf(e,t,i,n){let s=t._path;s||(s=t._path=new Path2D,t.path(s,i,n)&&s.closePath()),wl(e,t.options),e.stroke(s)}function Xf(e,t,i,n){let{segments:s,options:o}=t,r=to(t);for(let a of s)wl(e,o,a.style),e.beginPath(),r(e,t,a,{start:i,end:i+n-1})&&e.closePath(),e.stroke()}function Zf(e,t,i,n){Jf&&!t.options.segment?Kf(e,t,i,n):Xf(e,t,i,n)}function qa(e,t,i,n){let s=e.options,{[i]:o}=e.getProps([i],n);return Math.abs(t-o)<s.radius+s.hitRadius}function El(e,t){let{x:i,y:n,base:s,width:o,height:r}=e.getProps(["x","y","base","width","height"],t),a,l,c,d,u;return e.horizontal?(u=r/2,a=Math.min(i,s),l=Math.max(i,s),c=n-u,d=n+u):(u=o/2,a=i-u,l=i+u,c=Math.min(n,s),d=Math.max(n,s)),{left:a,top:c,right:l,bottom:d}}function qt(e,t,i,n){return e?0:Q(t,i,n)}function Qf(e,t,i){let n=e.options.borderWidth,s=e.borderSkipped,o=vs(n);return{t:qt(s.top,o.top,0,i),r:qt(s.right,o.right,0,t),b:qt(s.bottom,o.bottom,0,i),l:qt(s.left,o.left,0,t)}}function tg(e,t,i){let{enableBorderRadius:n}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,o=Nt(s),r=Math.min(t,i),a=e.borderSkipped,l=n||O(s);return{topLeft:qt(!l||a.top||a.left,o.topLeft,0,r),topRight:qt(!l||a.top||a.right,o.topRight,0,r),bottomLeft:qt(!l||a.bottom||a.left,o.bottomLeft,0,r),bottomRight:qt(!l||a.bottom||a.right,o.bottomRight,0,r)}}function eg(e){let t=El(e),i=t.right-t.left,n=t.bottom-t.top,s=Qf(e,i/2,n/2),o=tg(e,i/2,n/2);return{outer:{x:t.left,y:t.top,w:i,h:n,radius:o},inner:{x:t.left+s.l,y:t.top+s.t,w:i-s.l-s.r,h:n-s.t-s.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,o.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(s.b,s.r))}}}}function zs(e,t,i,n){let s=t===null,o=i===null,a=e&&!(s&&o)&&El(e,n);return a&&(s||kt(t,a.left,a.right))&&(o||kt(i,a.top,a.bottom))}function ig(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function ng(e,t){e.rect(t.x,t.y,t.w,t.h)}function Bs(e,t,i={}){let n=e.x!==i.x?-t:0,s=e.y!==i.y?-t:0,o=(e.x+e.w!==i.x+i.w?t:0)-n,r=(e.y+e.h!==i.y+i.h?t:0)-s;return{x:e.x+n,y:e.y+s,w:e.w+o,h:e.h+r,radius:e.radius}}function Ll(e){return eo[e%eo.length]}function Al(e){return Ya[e%Ya.length]}function og(e,t){return e.borderColor=Ll(t),e.backgroundColor=Al(t),++t}function rg(e,t){return e.backgroundColor=e.data.map(()=>Ll(t++)),t}function ag(e,t){return e.backgroundColor=e.data.map(()=>Al(t++)),t}function lg(e){let t=0;return(i,n)=>{let s=e.getDatasetMeta(n).controller;s instanceof It?t=rg(i,t):s instanceof ae?t=ag(i,t):s&&(t=og(i,t))}}function Ga(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function cg(e){return e&&(e.borderColor||e.backgroundColor)}function dg(){return j.borderColor!=="rgba(0,0,0,0.1)"||j.backgroundColor!=="rgba(0,0,0,0.1)"}function hg(e,t,i,n,s){let o=s.samples||n;if(o>=i)return e.slice(t,t+i);let r=[],a=(i-2)/(o-2),l=0,c=t+i-1,d=t,u,h,f,g,p;for(r[l++]=e[d],u=0;u<o-2;u++){let m=0,b=0,y,_=Math.floor((u+1)*a)+1+t,v=Math.min(Math.floor((u+2)*a)+1,i)+t,x=v-_;for(y=_;y<v;y++)m+=e[y].x,b+=e[y].y;m/=x,b/=x;let S=Math.floor(u*a)+1+t,k=Math.min(Math.floor((u+1)*a)+1,i)+t,{x:T,y:w}=e[d];for(f=g=-1,y=S;y<k;y++)g=.5*Math.abs((T-m)*(e[y].y-w)-(T-e[y].x)*(b-w)),g>f&&(f=g,h=e[y],p=y);r[l++]=h,d=p}return r[l++]=e[c],r}function fg(e,t,i,n){let s=0,o=0,r,a,l,c,d,u,h,f,g,p,m=[],b=t+i-1,y=e[t].x,v=e[b].x-y;for(r=t;r<t+i;++r){a=e[r],l=(a.x-y)/v*n,c=a.y;let x=l|0;if(x===d)c<g?(g=c,u=r):c>p&&(p=c,h=r),s=(o*s+a.x)/++o;else{let S=r-1;if(!P(u)&&!P(h)){let k=Math.min(u,h),T=Math.max(u,h);k!==f&&k!==S&&m.push({...e[k],x:s}),T!==f&&T!==S&&m.push({...e[T],x:s})}r>0&&S!==f&&m.push(e[S]),m.push(a),d=x,o=0,g=p=c,u=h=f=r}}return m}function Dl(e){if(e._decimated){let t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ua(e){e.data.datasets.forEach(t=>{Dl(t)})}function gg(e,t){let i=t.length,n=0,s,{iScale:o}=e,{min:r,max:a,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(n=Q(vt(t,o.axis,r).lo,0,i-1)),c?s=Q(vt(t,o.axis,a).hi+1,n,i)-n:s=i-n,{start:n,count:s}}function mg(e,t,i){let n=e.segments,s=e.points,o=t.points,r=[];for(let a of n){let{start:l,end:c}=a;c=_n(l,c,s);let d=io(i,s[l],s[c],a.loop);if(!t.segments){r.push({source:a,target:d,start:s[l],end:s[c]});continue}let u=Ds(t,d);for(let h of u){let f=io(i,o[h.start],o[h.end],h.loop),g=As(a,s,f);for(let p of g)r.push({source:p,target:h,start:{[i]:Ka(d,f,"start",Math.max)},end:{[i]:Ka(d,f,"end",Math.min)}})}}return r}function io(e,t,i,n){if(n)return;let s=t[e],o=i[e];return e==="angle"&&(s=et(s),o=et(o)),{property:e,start:s,end:o}}function bg(e,t){let{x:i=null,y:n=null}=e||{},s=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=_n(r,a,s);let l=s[r],c=s[a];n!==null?(o.push({x:l.x,y:n}),o.push({x:c.x,y:n})):i!==null&&(o.push({x:i,y:l.y}),o.push({x:i,y:c.y}))}),o}function _n(e,t,i){for(;t>e;t--){let n=i[t];if(!isNaN(n.x)&&!isNaN(n.y))break}return t}function Ka(e,t,i,n){return e&&t?n(e[i],t[i]):e?e[i]:t?t[i]:0}function Rl(e,t){let i=[],n=!1;return V(e)?(n=!0,i=e):i=bg(e,t),i.length?new Ct({points:i,options:{tension:0},_loop:n,_fullLoop:n}):null}function Xa(e){return e&&e.fill!==!1}function yg(e,t,i){let s=e[t].fill,o=[t],r;if(!i)return s;for(;s!==!1&&o.indexOf(s)===-1;){if(!Y(s))return s;if(r=e[s],!r)return!1;if(r.visible)return s;o.push(s),s=r.fill}return!1}function xg(e,t,i){let n=Sg(e);if(O(n))return isNaN(n.value)?!1:n;let s=parseFloat(n);return Y(s)&&Math.floor(s)===s?_g(n[0],t,s,i):["origin","start","end","stack","shape"].indexOf(n)>=0&&n}function _g(e,t,i,n){return(e==="-"||e==="+")&&(i=t+i),i===t||i<0||i>=n?!1:i}function vg(e,t){let i=null;return e==="start"?i=t.bottom:e==="end"?i=t.top:O(e)?i=t.getPixelForValue(e.value):t.getBasePixel&&(i=t.getBasePixel()),i}function Mg(e,t,i){let n;return e==="start"?n=i:e==="end"?n=t.options.reverse?t.min:t.max:O(e)?n=e.value:n=t.getBaseValue(),n}function Sg(e){let t=e.options,i=t.fill,n=E(i&&i.target,i);return n===void 0&&(n=!!t.backgroundColor),n===!1||n===null?!1:n===!0?"origin":n}function kg(e){let{scale:t,index:i,line:n}=e,s=[],o=n.segments,r=n.points,a=Tg(t,i);a.push(Rl({x:null,y:t.bottom},n));for(let l=0;l<o.length;l++){let c=o[l];for(let d=c.start;d<=c.end;d++)wg(s,r[d],a)}return new Ct({points:s,options:{}})}function Tg(e,t){let i=[],n=e.getMatchingVisibleMetas("line");for(let s=0;s<n.length;s++){let o=n[s];if(o.index===t)break;o.hidden||i.unshift(o.dataset)}return i}function wg(e,t,i){let n=[];for(let s=0;s<i.length;s++){let o=i[s],{first:r,last:a,point:l}=Cg(o,t,"x");if(!(!l||r&&a)){if(r)n.unshift(l);else if(e.push(l),!a)break}}e.push(...n)}function Cg(e,t,i){let n=e.interpolate(t,i);if(!n)return{};let s=n[i],o=e.segments,r=e.points,a=!1,l=!1;for(let c=0;c<o.length;c++){let d=o[c],u=r[d.start][i],h=r[d.end][i];if(kt(s,u,h)){a=s===u,l=s===h;break}}return{first:a,last:l,point:n}}function Eg(e){let{chart:t,fill:i,line:n}=e;if(Y(i))return Lg(t,i);if(i==="stack")return kg(e);if(i==="shape")return!0;let s=Ag(e);return s instanceof yn?s:Rl(s,n)}function Lg(e,t){let i=e.getDatasetMeta(t);return i&&e.isDatasetVisible(t)?i.dataset:null}function Ag(e){return(e.scale||{}).getPointPositionForValue?Rg(e):Dg(e)}function Dg(e){let{scale:t={},fill:i}=e,n=vg(i,t);if(Y(n)){let s=t.isHorizontal();return{x:s?n:null,y:s?null:n}}return null}function Rg(e){let{scale:t,fill:i}=e,n=t.options,s=t.getLabels().length,o=n.reverse?t.max:t.min,r=Mg(i,t,o),a=[];if(n.grid.circular){let l=t.getPointPositionForValue(0,o);return new yn({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<s;++l)a.push(t.getPointPositionForValue(l,r));return a}function Vs(e,t,i){let n=Eg(t),{chart:s,index:o,line:r,scale:a,axis:l}=t,c=r.options,d=c.fill,u=c.backgroundColor,{above:h=u,below:f=u}=d||{},g=s.getDatasetMeta(o),p=Rs(s,g);n&&r.points.length&&(ei(e,i),Pg(e,{line:r,target:n,above:h,below:f,area:i,scale:a,axis:l,clip:p}),ii(e))}function Pg(e,t){let{line:i,target:n,above:s,below:o,area:r,scale:a,clip:l}=t,c=i._loop?"angle":t.axis;e.save();let d=o;o!==s&&(c==="x"?(Ja(e,n,r.top),Ns(e,{line:i,target:n,color:s,scale:a,property:c,clip:l}),e.restore(),e.save(),Ja(e,n,r.bottom)):c==="y"&&(Za(e,n,r.left),Ns(e,{line:i,target:n,color:o,scale:a,property:c,clip:l}),e.restore(),e.save(),Za(e,n,r.right),d=s)),Ns(e,{line:i,target:n,color:d,scale:a,property:c,clip:l}),e.restore()}function Ja(e,t,i){let{segments:n,points:s}=t,o=!0,r=!1;e.beginPath();for(let a of n){let{start:l,end:c}=a,d=s[l],u=s[_n(l,c,s)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(d.x,i),e.lineTo(d.x,d.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(u.x,i)}e.lineTo(t.first().x,i),e.closePath(),e.clip()}function Za(e,t,i){let{segments:n,points:s}=t,o=!0,r=!1;e.beginPath();for(let a of n){let{start:l,end:c}=a,d=s[l],u=s[_n(l,c,s)];o?(e.moveTo(d.x,d.y),o=!1):(e.lineTo(i,d.y),e.lineTo(d.x,d.y)),r=!!t.pathSegment(e,a,{move:r}),r?e.closePath():e.lineTo(i,u.y)}e.lineTo(i,t.first().y),e.closePath(),e.clip()}function Ns(e,t){let{line:i,target:n,property:s,color:o,scale:r,clip:a}=t,l=mg(i,n,s);for(let{source:c,target:d,start:u,end:h}of l){let{style:{backgroundColor:f=o}={}}=c,g=n!==!0;e.save(),e.fillStyle=f,Og(e,r,a,g&&io(s,u,h)),e.beginPath();let p=!!i.pathSegment(e,c),m;if(g){p?e.closePath():Qa(e,n,h,s);let b=!!n.pathSegment(e,d,{move:p,reverse:!0});m=p&&b,m||Qa(e,n,u,s)}e.closePath(),e.fill(m?"evenodd":"nonzero"),e.restore()}}function Og(e,t,i,n){let s=t.chart.chartArea,{property:o,start:r,end:a}=n||{};if(o==="x"||o==="y"){let l,c,d,u;o==="x"?(l=r,c=s.top,d=a,u=s.bottom):(l=s.left,c=r,d=s.right,u=a),e.beginPath(),i&&(l=Math.max(l,i.left),d=Math.min(d,i.right),c=Math.max(c,i.top),u=Math.min(u,i.bottom)),e.rect(l,c,d-l,u-c),e.clip()}}function Qa(e,t,i,n){let s=t.interpolate(i,n);s&&e.lineTo(s.x,s.y)}function $g(e,t,i,n,s){let o=Hg(n,e,t,i),r=Wg(s,n,t.lineHeight);return{itemWidth:o,itemHeight:r}}function Hg(e,t,i,n){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((o,r)=>o.length>r.length?o:r)),t+i.size/2+n.measureText(s).width}function Wg(e,t,i){let n=e;return typeof t.text!="string"&&(n=Pl(t,i)),n}function Pl(e,t){let i=e.text?e.text.length:0;return t*i}function zg(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}function Vg(e,t){let i=new bi({ctx:e.ctx,options:t,chart:e});ot.configure(e,i,t),ot.addBox(e,i),e.titleBlock=i}function Tt(e,t){return t&&(V(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Ot(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
|
|
26
47
|
`)>-1?e.split(`
|
|
27
|
-
`):e}function Cg(e,t){let{element:i,datasetIndex:n,index:s}=t,o=e.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function ja(e,t){let i=e.chart.ctx,{body:n,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=J(t.bodyFont),c=J(t.titleFont),d=J(t.footerFont),u=o.length,h=s.length,f=n.length,g=nt(t.padding),p=g.height,m=0,b=n.reduce((v,x)=>v+x.before.length+x.lines.length+x.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){let v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}h&&(p+=t.footerMarginTop+h*d.lineHeight+(h-1)*t.footerSpacing);let y=0,_=function(v){m=Math.max(m,i.measureText(v).width+y)};return i.save(),i.font=c.string,H(e.title,_),i.font=l.string,H(e.beforeBody.concat(e.afterBody),_),y=t.displayColors?r+2+t.boxPadding:0,H(n,v=>{H(v.before,_),H(v.lines,_),H(v.after,_)}),y=0,i.font=d.string,H(e.footer,_),i.restore(),m+=g.width,{width:m,height:p}}function Eg(e,t){let{y:i,height:n}=t;return i<n/2?"top":i>e.height-n/2?"bottom":"center"}function Lg(e,t,i,n){let{x:s,width:o}=n,r=i.caretSize+i.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function Ag(e,t,i,n){let{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=e,c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Lg(c,e,t,i)&&(c="center"),c}function qa(e,t,i){let n=i.yAlign||t.yAlign||Eg(e,i);return{xAlign:i.xAlign||t.xAlign||Ag(e,t,i,n),yAlign:n}}function Dg(e,t){let{x:i,width:n}=e;return t==="right"?i-=n:t==="center"&&(i-=n/2),i}function Pg(e,t,i){let{y:n,height:s}=e;return t==="top"?n+=i:t==="bottom"?n-=s+i:n-=s/2,n}function Ya(e,t,i,n){let{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=i,c=s+o,{topLeft:d,topRight:u,bottomLeft:h,bottomRight:f}=Vt(r),g=Dg(t,a),p=Pg(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(d,h)+s:a==="right"&&(g+=Math.max(u,f)+s),{x:Z(g,0,n.width-t.width),y:Z(p,0,n.height-t.height)}}function an(e,t,i){let n=nt(i.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-n.right:e.x+n.left}function Ua(e){return Tt([],Ot(e))}function Rg(e,t,i){return Pt(e,{tooltip:t,tooltipItems:i,type:"tooltip"})}function Ga(e,t){let i=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return i?e.override(i):e}function dt(e,t,i,n){let s=e[t].call(i,n);return typeof s>"u"?Sl[t].call(i,n):s}function $g(e,t,i,n){let s=e.indexOf(t);if(s===-1)return Fg(e,t,i,n);let o=e.lastIndexOf(t);return s!==o?i:s}function Ka(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}function zg(e,t){let i=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:h}=e,f=o||1,g=d-1,{min:p,max:m}=t,b=!R(r),y=!R(a),_=!R(c),v=(m-p)/(u+1),x=ts((m-p)/g/f)*f,S,k,T,w;if(x<1e-14&&!b&&!y)return[{value:p},{value:m}];w=Math.ceil(m/x)-Math.floor(p/x),w>g&&(x=ts(w*x/g/f)*f),R(l)||(S=Math.pow(10,l),x=Math.ceil(x*S)/S),s==="ticks"?(k=Math.floor(p/x)*x,T=Math.ceil(m/x)*x):(k=p,T=m),b&&y&&o&&Ir((a-r)/o,x/1e3)?(w=Math.round(Math.min((a-r)/x,d)),x=(a-r)/w,k=r,T=a):_?(k=b?r:k,T=y?a:T,w=c-1,x=(T-k)/w):(w=(T-k)/x,ve(w,Math.round(w),x/1e3)?w=Math.round(w):w=Math.ceil(w));let L=Math.max(is(x),is(k));S=Math.pow(10,R(l)?L:l),k=Math.round(k*S)/S,T=Math.round(T*S)/S;let A=0;for(b&&(h&&k!==r?(i.push({value:r}),k<r&&A++,ve(Math.round((k+A*x)*S)/S,r,Xa(r,v,e))&&A++):k<r&&A++);A<w;++A){let I=Math.round((k+A*x)*S)/S;if(y&&I>a)break;i.push({value:I})}return y&&h&&T!==a?i.length&&ve(i[i.length-1].value,a,Xa(a,v,e))?i[i.length-1].value=a:i.push({value:a}):(!y||T===a)&&i.push({value:T}),i}function Xa(e,t,{horizontal:i,minRotation:n}){let s=bt(n),o=(i?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}function Ja(e){return e/Math.pow(10,bi(e))===1}function Za(e,t,i){let n=Math.pow(10,i),s=Math.floor(e/n);return Math.ceil(t/n)-s}function Bg(e,t){let i=t-e,n=bi(i);for(;Za(e,t,n)>10;)n++;for(;Za(e,t,n)<10;)n--;return Math.min(n,bi(e))}function Wg(e,{min:t,max:i}){t=ct(e.min,t);let n=[],s=bi(t),o=Bg(t,i),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,d=Math.floor((t-l)/a/10)*a*10,u=Math.floor((c-d)/Math.pow(10,o)),h=ct(e.min,Math.round((l+d+u*Math.pow(10,o))*r)/r);for(;h<i;)n.push({value:h,major:Ja(h),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,r=o>=0?1:r),h=Math.round((l+d+u*Math.pow(10,o))*r)/r;let f=ct(e.max,h);return n.push({value:f,major:Ja(f),significand:u}),n}function Xs(e){let t=e.ticks;if(t.display&&e.display){let i=nt(t.backdropPadding);return E(t.font&&t.font.size,j.font.size)+i.height}return 0}function Ng(e,t,i){return i=N(i)?i:[i],{w:jr(e,t.string,i),h:i.length*t.lineHeight}}function Qa(e,t,i,n,s){return e===n||e===s?{start:t-i/2,end:t+i/2}:e<n||e>s?{start:t-i,end:t}:{start:t,end:t+i}}function Vg(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},i=Object.assign({},t),n=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?F/o:0;for(let l=0;l<o;l++){let c=r.setContext(e.getPointLabelContext(l));s[l]=c.padding;let d=e.getPointPosition(l,e.drawingArea+s[l],a),u=J(c.font),h=Ng(e.ctx,u,e._pointLabels[l]);n[l]=h;let f=et(e.getIndexAngle(l)+a),g=Math.round(Yi(f)),p=Qa(g,d.x,h.w,0,180),m=Qa(g,d.y,h.h,90,270);jg(i,t,f,p,m)}e.setCenterPoint(t.l-i.l,i.r-t.r,t.t-i.t,i.b-t.b),e._pointLabelItems=Ug(e,n,s)}function jg(e,t,i,n,s){let o=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i)),a=0,l=0;n.start<t.l?(a=(t.l-n.start)/o,e.l=Math.min(e.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function qg(e,t,i){let n=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=i,l=e.getPointPosition(t,n+s+r,o),c=Math.round(Yi(et(l.angle+G))),d=Xg(l.y,a.h,c),u=Gg(c),h=Kg(l.x,a.w,u);return{visible:!0,x:l.x,y:d,textAlign:u,left:h,top:d,right:h+a.w,bottom:d+a.h}}function Yg(e,t){if(!t)return!0;let{left:i,top:n,right:s,bottom:o}=e;return!(Mt({x:i,y:n},t)||Mt({x:i,y:o},t)||Mt({x:s,y:n},t)||Mt({x:s,y:o},t))}function Ug(e,t,i){let n=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:Xs(o)/2,additionalAngle:r?F/s:0},c;for(let d=0;d<s;d++){l.padding=i[d],l.size=t[d];let u=qg(e,d,l);n.push(u),a==="auto"&&(u.visible=Yg(u,c),u.visible&&(c=u))}return n}function Gg(e){return e===0||e===180?"center":e<180?"left":"right"}function Kg(e,t,i){return i==="right"?e-=t:i==="center"&&(e-=t/2),e}function Xg(e,t,i){return i===90||i===270?e-=t/2:(i>270||i<90)&&(e-=t),e}function Jg(e,t,i){let{left:n,top:s,right:o,bottom:r}=i,{backdropColor:a}=t;if(!R(a)){let l=Vt(t.borderRadius),c=nt(t.backdropPadding);e.fillStyle=a;let d=n-c.left,u=s-c.top,h=o-n+c.width,f=r-s+c.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),ke(e,{x:d,y:u,w:h,h:f,radius:l}),e.fill()):e.fillRect(d,u,h,f)}}function Zg(e,t){let{ctx:i,options:{pointLabels:n}}=e;for(let s=t-1;s>=0;s--){let o=e._pointLabelItems[s];if(!o.visible)continue;let r=n.setContext(e.getPointLabelContext(s));Jg(i,r,o);let a=J(r.font),{x:l,y:c,textAlign:d}=o;Nt(i,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:d,textBaseline:"middle"})}}function kl(e,t,i,n){let{ctx:s}=e;if(i)s.arc(e.xCenter,e.yCenter,t,0,V);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<n;r++)o=e.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function Qg(e,t,i,n,s){let o=e.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!n||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),kl(e,i,r,n),o.closePath(),o.stroke(),o.restore())}function tp(e,t,i){return Pt(e,{label:i,index:t,type:"pointLabel"})}function tl(e,t){return e-t}function el(e,t){if(R(t))return null;let i=e._adapter,{parser:n,round:s,isoWeekday:o}=e._parseOpts,r=t;return typeof n=="function"&&(r=n(r)),Y(r)||(r=typeof n=="string"?i.parse(r,n):i.parse(r)),r===null?null:(s&&(r=s==="week"&&(ee(o)||o===!0)?i.startOf(r,"isoWeek",o):i.startOf(r,s)),+r)}function il(e,t,i,n){let s=ut.length;for(let o=ut.indexOf(e);o<s-1;++o){let r=yn[ut[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((i-t)/(a*r.size))<=n)return ut[o]}return ut[s-1]}function ep(e,t,i,n,s){for(let o=ut.length-1;o>=ut.indexOf(i);o--){let r=ut[o];if(yn[r].common&&e._adapter.diff(s,n,r)>=t-1)return r}return ut[i?ut.indexOf(i):0]}function ip(e){for(let t=ut.indexOf(e)+1,i=ut.length;t<i;++t)if(yn[ut[t]].common)return ut[t]}function nl(e,t,i){if(!i)e[t]=!0;else if(i.length){let{lo:n,hi:s}=Ui(i,t),o=i[n]>=t?i[n]:i[s];e[o]=!0}}function np(e,t,i,n){let s=e._adapter,o=+s.startOf(t[0].value,n),r=t[t.length-1].value,a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=i[a],l>=0&&(t[l].major=!0);return t}function sl(e,t,i){let n=[],s={},o=t.length,r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,n.push({value:a,major:!1});return o===0||!i?n:np(e,n,s,i)}function ln(e,t,i){let n=0,s=e.length-1,o,r,a,l;i?(t>=e[n].pos&&t<=e[s].pos&&({lo:n,hi:s}=vt(e,"pos",t)),{pos:o,time:a}=e[n],{pos:r,time:l}=e[s]):(t>=e[n].time&&t<=e[s].time&&({lo:n,hi:s}=vt(e,"time",t)),{time:o,pos:a}=e[n],{time:r,pos:l}=e[s]);let c=r-o;return c?a+(l-a)*(t-o)/c:a}var $s,Rt,ra,qu,Hs,un,Es,ua,ih,gt,Ce,Ee,It,Le,ae,ai,Ae,De,gh,zs,ph,_h,al,ot,hn,Bs,cn,Eh,xa,cl,pi,_a,Ws,pt,Yh,va,Ma,ce,Oe,Ns,wt,Vs,Ca,fl,ri,Ys,ff,pf,mf,dn,Pa,lt,oe,Rf,Ct,Pe,Re,Bf,Gs,Ia,Uf,Jf,pn,bg,Va,yg,mn,Sg,mi,Tg,rn,wg,ci,Sl,gi,Og,Ig,Fg,Hg,di,Ie,ui,bi,se,hi,re,yn,ut,le,fi,sp,Tl,wl=C(()=>{oa();$s=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,i,n,s){let o=i.listeners[s],r=i.duration;o.forEach(a=>a({chart:t,initial:i.initial,numSteps:r,currentStep:Math.min(n-i.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=rs.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let i=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;let o=n.items,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),i+=o.length}),this._lastDate=t,i===0&&(this._running=!1)}_getAnims(t){let i=this._charts,n=i.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},i.set(t,n)),n}listen(t,i,n){this._getAnims(t).listeners[i].push(n)}add(t,i){!i||!i.length||this._getAnims(t).items.push(...i)}has(t){return this._getAnims(t).items.length>0}start(t){let i=this._charts.get(t);i&&(i.running=!0,i.start=Date.now(),i.duration=i.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let i=this._charts.get(t);return!(!i||!i.running||!i.items.length)}stop(t){let i=this._charts.get(t);if(!i||!i.items.length)return;let n=i.items,s=n.length-1;for(;s>=0;--s)n[s].cancel();i.items=[],this._notify(t,i,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},Rt=new $s,ra="transparent",qu={boolean(e,t,i){return i>.5?t:e},color(e,t,i){let n=us(e||ra),s=n.valid&&us(t||ra);return s&&s.valid?s.mix(n,i).hexString():t},number(e,t,i){return e+(t-e)*i}},Hs=class{constructor(t,i,n,s){let o=i[n];s=Te([t.to,s,o,t.from]);let r=Te([t.from,o,s]);this._active=!0,this._fn=t.fn||qu[t.type||typeof r],this._easing=me[t.easing]||me.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=i,this._prop=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,i,n){if(this._active){this._notify(!1);let 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=Te([t.to,i,s,t.from]),this._from=Te([t.from,s,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let i=t-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||i<n),!this._active){this._target[s]=a,this._notify(!0);return}if(i<0){this._target[s]=o;return}l=i/n%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((i,n)=>{t.push({res:i,rej:n})})}_notify(t){let i=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][i]()}},un=class{constructor(t,i){this._chart=t,this._properties=new Map,this.configure(i)}configure(t){if(!O(t))return;let i=Object.keys(j.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!O(o))return;let r={};for(let a of i)r[a]=o[a];(N(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,i){let n=i.options,s=Uu(t,n);if(!s)return[];let o=this._createAnimations(s,n);return n.$shared&&Yu(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,i){let n=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(i),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,i));continue}let d=i[c],u=o[c],h=n.get(c);if(u)if(h&&u.active()){u.update(h,d,a);continue}else u.cancel();if(!h||!h.duration){t[c]=d;continue}o[c]=u=new Hs(h,t,c,d),s.push(u)}return s}update(t,i){if(this._properties.size===0){Object.assign(t,i);return}let n=this._createAnimations(t,i);if(n.length)return Rt.add(this._chart,n),!0}};Es=e=>e==="reset"||e==="none",ua=(e,t)=>t?e:Object.assign({},e),ih=(e,t,i)=>e&&!t.hidden&&t._stacked&&{keys:ol(i,!0),values:null},gt=class{constructor(t,i){this.chart=t,this._ctx=t.ctx,this.index=i,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(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ws(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ii(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,i=this._cachedMeta,n=this.getDataset(),s=(u,h,f,g)=>u==="x"?h:u==="r"?g:f,o=i.xAxisID=E(n.xAxisID,Cs(t,"x")),r=i.yAxisID=E(n.yAxisID,Cs(t,"y")),a=i.rAxisID=E(n.rAxisID,Cs(t,"r")),l=i.indexAxis,c=i.iAxisID=s(l,o,r,a),d=i.vAxisID=s(l,r,o,a);i.xScale=this.getScaleForId(o),i.yScale=this.getScaleForId(r),i.rScale=this.getScaleForId(a),i.iScale=this.getScaleForId(c),i.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let i=this._cachedMeta;return t===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&ss(this._data,this),t._stacked&&ii(t)}_dataCheck(){let t=this.getDataset(),i=t.data||(t.data=[]),n=this._data;if(O(i)){let s=this._cachedMeta;this._data=Xu(i,s)}else if(n!==i){if(n){ss(n,this);let s=this._cachedMeta;ii(s),s._parsed=[]}i&&Object.isExtensible(i)&&Br(i,this),this._syncList=[],this._data=i}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let i=this._cachedMeta,n=this.getDataset(),s=!1;this._dataCheck();let o=i._stacked;i._stacked=ws(i.vScale,i),i.stack!==n.stack&&(s=!0,ii(i),i.stack=n.stack),this._resyncElements(t),(s||o!==i._stacked)&&(da(this,i._parsed),i._stacked=ws(i.vScale,i))}configure(){let t=this.chart.config,i=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),i,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){let{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:r}=n,a=o.axis,l=t===0&&i===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],d,u,h;if(this._parsing===!1)n._parsed=s,n._sorted=!0,h=s;else{N(s[t])?h=this.parseArrayData(n,s,t,i):O(s[t])?h=this.parseObjectData(n,s,t,i):h=this.parsePrimitiveData(n,s,t,i);let f=()=>u[a]===null||c&&u[a]<c[a];for(d=0;d<i;++d)n._parsed[d+t]=u=h[d],l&&(f()&&(l=!1),c=u);n._sorted=l}r&&da(this,h)}parsePrimitiveData(t,i,n,s){let{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),d=o===r,u=new Array(s),h,f,g;for(h=0,f=s;h<f;++h)g=h+n,u[h]={[a]:d||o.parse(c[g],g),[l]:r.parse(i[g],g)};return u}parseArrayData(t,i,n,s){let{xScale:o,yScale:r}=t,a=new Array(s),l,c,d,u;for(l=0,c=s;l<c;++l)d=l+n,u=i[d],a[l]={x:o.parse(u[0],d),y:r.parse(u[1],d)};return a}parseObjectData(t,i,n,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),d,u,h,f;for(d=0,u=s;d<u;++d)h=d+n,f=i[h],c[d]={x:o.parse(Dt(f,a),h),y:r.parse(Dt(f,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,i,n){let s=this.chart,o=this._cachedMeta,r=i[t.axis],a={keys:ol(s,!0),values:i._stacks[t.axis]._visualValues};return la(a,r,o.index,{mode:n})}updateRangeFromParsed(t,i,n,s){let o=n[i.axis],r=o===null?NaN:o,a=s&&n._stacks[i.axis];s&&a&&(s.values=a,r=la(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,i){let n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,r=s.length,a=this._getOtherScale(t),l=ih(i,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=Zu(a),h,f;function g(){f=s[h];let p=f[a.axis];return!Y(f[t.axis])||d>p||u<p}for(h=0;h<r&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),o));++h);if(o){for(h=r-1;h>=0;--h)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){let i=this._cachedMeta._parsed,n=[],s,o,r;for(s=0,o=i.length;s<o;++s)r=i[s][t.axis],Y(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){let i=this._cachedMeta,n=i.iScale,s=i.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let i=this._cachedMeta;this.update(t||"default"),i._clip=Ku(E(this.options.clip,Gu(i.xScale,i.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,i=this.chart,n=this._cachedMeta,s=n.data||[],o=i.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,d;for(n.dataset&&n.dataset.draw(t,o,a,l),d=a;d<a+l;++d){let u=s[d];u.hidden||(u.active&&c?r.push(u):u.draw(t,o))}for(d=0;d<r.length;++d)r[d].draw(t,o)}getStyle(t,i){let n=i?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,i,n){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=eh(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=th(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!i,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,i){return this._resolveElementOptions(this.dataElementType.id,i,t)}_resolveElementOptions(t,i="default",n){let s=i==="active",o=this._cachedDataOpts,r=t+"-"+i,a=o[r],l=this.enableOptionSharing&&_e(n);if(a)return ua(a,l);let c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),d),f=Object.keys(j.elements[t]),g=()=>this.getContext(n,s,i),p=c.resolveNamedOptions(h,f,g,u);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(ua(p,l))),p}_resolveAnimations(t,i,n){let s=this.chart,o=this._cachedDataOpts,r=`animation-${i}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){let d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,i),h=d.getOptionScopes(this.getDataset(),u);l=d.createResolver(h,this.getContext(t,n,i))}let c=new un(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,i){return!i||Es(t)||this.chart._animationsDisabled}_getSharedOptions(t,i){let n=this.resolveDataElementOptions(t,i),s=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(i,o)||o!==s;return this.updateSharedOptions(o,i,n),{sharedOptions:o,includeOptions:r}}updateElement(t,i,n,s){Es(s)?Object.assign(t,n):this._resolveAnimations(i,s).update(t,n)}updateSharedOptions(t,i,n){t&&!Es(i)&&this._resolveAnimations(void 0,i).update(t,n)}_setStyle(t,i,n,s){t.active=s;let o=this.getStyle(i,s);this._resolveAnimations(i,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,i,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,i,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let i=this._data,n=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let s=n.length,o=i.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,i,n=!0){let s=this._cachedMeta,o=s.data,r=t+i,a,l=c=>{for(c.length+=i,a=c.length-1;a>=r;a--)c[a]=c[a-i]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,i),n&&this.updateElements(o,t,i,"reset")}updateElements(t,i,n,s){}_removeElements(t,i){let n=this._cachedMeta;if(this._parsing){let s=n._parsed.splice(t,i);n._stacked&&ii(n,s)}n.data.splice(t,i)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[i,n,s]=t;this[i](n,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,i){i&&this._sync(["_removeElements",t,i]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};M(gt,"defaults",{}),M(gt,"datasetElementType",null),M(gt,"dataElementType",null);Ce=class extends gt{parsePrimitiveData(t,i,n,s){return ha(t,i,n,s)}parseArrayData(t,i,n,s){return ha(t,i,n,s)}parseObjectData(t,i,n,s){let{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,d=r.axis==="x"?a:l,u=[],h,f,g,p;for(h=n,f=n+s;h<f;++h)p=i[h],g={},g[o.axis]=o.parse(Dt(p,c),h),u.push(rl(Dt(p,d),g,r,h));return u}updateRangeFromParsed(t,i,n,s){super.updateRangeFromParsed(t,i,n,s);let o=n._custom;o&&i===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let i=this._cachedMeta,{iScale:n,vScale:s}=i,o=this.getParsed(t),r=o._custom,a=Ls(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let i=this._cachedMeta;this.updateElements(i.data,0,i.data.length,t)}updateElements(t,i,n,s){let o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:h}=this._getSharedOptions(i,s);for(let f=i;f<i+n;f++){let g=this.getParsed(f),p=o||R(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,d),b=(g._stacks||{})[a.axis],y={horizontal:c,base:p.base,enableBorderRadius:!b||Ls(g._custom)||r===b._top||r===b._bottom,x:c?p.head:m.center,y:c?m.center:p.head,height:c?m.size:Math.abs(p.size),width:c?Math.abs(p.size):m.size};h&&(y.options=u||this.resolveDataElementOptions(f,t[f].active?"active":s));let _=y.options||t[f].options;dh(y,_,b,r),hh(y,_,d.ratio),this.updateElement(t[f],f,y,s)}}_getStacks(t,i){let{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),o=n.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(i),l=a&&a[n.axis],c=d=>{let u=d._parsed.find(f=>f[n.axis]===l),h=u&&u[d.vScale.axis];if(R(h)||isNaN(h))return!0};for(let d of s)if(!(i!==void 0&&c(d))&&((o===!1||r.indexOf(d.stack)===-1||o===void 0&&d.stack===void 0)&&r.push(d.stack),d.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,i=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===i).shift()}_getAxis(){let t={},i=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)t[E(this.chart.options.indexAxis==="x"?n.xAxisID:n.yAxisID,i)]=!0;return Object.keys(t)}_getStackIndex(t,i,n){let s=this._getStacks(t,n),o=i!==void 0?s.indexOf(i):-1;return o===-1?s.length-1:o}_getRuler(){let t=this.options,i=this._cachedMeta,n=i.iScale,s=[],o,r;for(o=0,r=i.data.length;o<r;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));let a=t.barThickness;return{min:a||sh(i),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:i,_stacked:n,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,d=Ls(c),u=l[i.axis],h=0,f=n?this.applyStack(i,l,n):u,g,p;f!==u&&(h=f-u,f=u),d&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&xt(u)!==xt(c.barEnd)&&(h=0),h+=u);let m=!R(o)&&!d?o:h,b=i.getPixelForValue(m);if(this.chart.getDataVisibility(t)?g=i.getPixelForValue(h+f):g=b,p=g-b,Math.abs(p)<r){p=lh(p,i,a)*r,u===a&&(b-=p/2);let y=i.getPixelForDecimal(0),_=i.getPixelForDecimal(1),v=Math.min(y,_),x=Math.max(y,_);b=Math.max(Math.min(b,x),v),g=b+p,n&&!d&&(l._stacks[i.axis]._visualValues[s]=i.getValueForPixel(g)-i.getValueForPixel(b))}if(b===i.getPixelForValue(a)){let y=xt(p)*i.getLineWidthForValue(a)/2;b+=y,p-=y}return{size:p,base:b,head:g,center:g+p/2}}_calculateBarIndexPixels(t,i){let n=i.scale,s=this.options,o=s.skipNull,r=E(s.maxBarThickness,1/0),a,l,c=this._getAxisCount();if(i.grouped){let d=o?this._getStackCount(t):i.stackCount,u=s.barThickness==="flex"?rh(t,i,s,d*c):oh(t,i,s,d*c),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(E(h,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+f;a=u.start+u.chunk*g+u.chunk/2,l=Math.min(r,u.chunk*u.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(r,i.min*i.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){let t=this._cachedMeta,i=t.vScale,n=t.data,s=n.length,o=0;for(;o<s;++o)this.getParsed(o)[i.axis]!==null&&!n[o].hidden&&n[o].draw(this._ctx)}};M(Ce,"id","bar"),M(Ce,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),M(Ce,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});Ee=class extends gt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,i,n,s){let o=super.parsePrimitiveData(t,i,n,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+n).radius;return o}parseArrayData(t,i,n,s){let o=super.parseArrayData(t,i,n,s);for(let r=0;r<o.length;r++){let a=i[n+r];o[r]._custom=E(a[2],this.resolveDataElementOptions(r+n).radius)}return o}parseObjectData(t,i,n,s){let o=super.parseObjectData(t,i,n,s);for(let r=0;r<o.length;r++){let a=i[n+r];o[r]._custom=E(a&&a.r&&+a.r,this.resolveDataElementOptions(r+n).radius)}return o}getMaxOverflow(){let t=this._cachedMeta.data,i=0;for(let n=t.length-1;n>=0;--n)i=Math.max(i,t[n].size(this.resolveDataElementOptions(n))/2);return i>0&&i}getLabelAndValue(t){let i=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=i,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){let i=this._cachedMeta.data;this.updateElements(i,0,i.length,t)}updateElements(t,i,n,s){let o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(i,s),d=r.axis,u=a.axis;for(let h=i;h<i+n;h++){let f=t[h],g=!o&&this.getParsed(h),p={},m=p[d]=o?r.getPixelForDecimal(.5):r.getPixelForValue(g[d]),b=p[u]=o?a.getBasePixel():a.getPixelForValue(g[u]);p.skip=isNaN(m)||isNaN(b),c&&(p.options=l||this.resolveDataElementOptions(h,f.active?"active":s),o&&(p.options.radius=0)),this.updateElement(f,h,p,s)}}resolveDataElementOptions(t,i){let n=this.getParsed(t),s=super.resolveDataElementOptions(t,i);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let o=s.radius;return i!=="active"&&(s.radius=0),s.radius+=E(n&&n._custom,o),s}};M(Ee,"id","bubble"),M(Ee,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),M(Ee,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});It=class extends gt{constructor(t,i){super(t,i),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,i){let n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(O(n[t])){let{key:l="value"}=this._parsing;o=c=>+Dt(n[c],l)}let r,a;for(r=t,a=t+i;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return bt(this.options.rotation-90)}_getCircumference(){return bt(this.options.circumference)}_getRotationExtents(){let t=V,i=-V;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),i=Math.max(i,o+r)}return{rotation:t,circumference:i-t}}update(t){let i=this.chart,{chartArea:n}=i,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-r)/2,0),l=Math.min(Dr(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:h,ratioY:f,offsetX:g,offsetY:p}=fh(u,d,l),m=(n.width-r)/h,b=(n.height-r)/f,y=Math.max(Math.min(m,b)/2,0),_=Zn(this.options.radius,y),v=Math.max(_*l,0),x=(_-v)/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=p*_,s.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,i){let n=this.options,s=this._cachedMeta,o=this._getCircumference();return i&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/V)}updateElements(t,i,n,s){let o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,d=(a.left+a.right)/2,u=(a.top+a.bottom)/2,h=o&&c.animateScale,f=h?0:this.innerRadius,g=h?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(i,s),b=this._getRotation(),y;for(y=0;y<i;++y)b+=this._circumference(y,o);for(y=i;y<i+n;++y){let _=this._circumference(y,o),v=t[y],x={x:d+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:g,innerRadius:f};m&&(x.options=p||this.resolveDataElementOptions(y,v.active?"active":s)),b+=_,this.updateElement(v,y,x,s)}}calculateTotal(){let t=this._cachedMeta,i=t.data,n=0,s;for(s=0;s<i.length;s++){let o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!i[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){let i=this._cachedMeta.total;return i>0&&!isNaN(t)?V*(Math.abs(t)/i):0}getLabelAndValue(t){let i=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Se(i._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let i=0,n=this.chart,s,o,r,a,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){r=n.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(i=Math.max(i,l.borderWidth||0,l.hoverBorderWidth||0));return i}getMaxOffset(t){let i=0;for(let n=0,s=t.length;n<s;++n){let o=this.resolveDataElementOptions(n);i=Math.max(i,o.offset||0,o.hoverOffset||0)}return i}_getRingWeightOffset(t){let i=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(i+=this._getRingWeight(n));return i}_getRingWeight(t){return Math.max(E(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};M(It,"id","doughnut"),M(It,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),M(It,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),M(It,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let i=t.data,{labels:{pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return i.labels.length&&i.datasets.length?i.labels.map((l,c)=>{let u=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:u.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,textAlign:s,pointStyle:n,borderRadius:r&&(a||u.borderRadius),index:c}}):[]}},onClick(t,i,n){n.chart.toggleDataVisibility(i.index),n.chart.update()}}}});Le=class extends gt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let i=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=i,r=this.chart._animationsDisabled,{start:a,count:l}=ls(i,s,r);this._drawStart=a,this._drawCount=l,cs(i)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;let 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,i,n,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:u}=this._getSharedOptions(i,s),h=r.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=ee(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",y=i+n,_=t.length,v=i>0&&this.getParsed(i-1);for(let x=0;x<_;++x){let S=t[x],k=b?S:{};if(x<i||x>=y){k.skip=!0;continue}let T=this.getParsed(x),w=R(T[f]),L=k[h]=r.getPixelForValue(T[h],x),A=k[f]=o||w?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,T,l):T[f],x);k.skip=isNaN(L)||isNaN(A)||w,k.stop=x>0&&Math.abs(T[h]-v[h])>m,p&&(k.parsed=T,k.raw=c.data[x]),u&&(k.options=d||this.resolveDataElementOptions(x,S.active?"active":s)),b||this.updateElement(S,x,k,s),v=T}}getMaxOverflow(){let t=this._cachedMeta,i=t.dataset,n=i.options&&i.options.borderWidth||0,s=t.data||[];if(!s.length)return n;let 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(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};M(Le,"id","line"),M(Le,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),M(Le,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});ae=class extends gt{constructor(t,i){super(t,i),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let i=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Se(i._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,i,n,s){return ys.bind(this)(t,i,n,s)}update(t){let i=this._cachedMeta.data;this._updateRadius(),this.updateElements(i,0,i.length,t)}getMinMax(){let t=this._cachedMeta,i={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{let o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<i.min&&(i.min=o),o>i.max&&(i.max=o))}),i}_updateRadius(){let t=this.chart,i=t.chartArea,n=t.options,s=Math.min(i.right-i.left,i.bottom-i.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,i,n,s){let o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,u=c.yCenter,h=c.getIndexAngle(0)-.5*F,f=h,g,p=360/this.countVisibleElements();for(g=0;g<i;++g)f+=this._computeAngle(g,s,p);for(g=i;g<i+n;g++){let m=t[g],b=f,y=f+this._computeAngle(g,s,p),_=r.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=y,o&&(l.animateScale&&(_=0),l.animateRotate&&(b=y=h));let v={x:d,y:u,innerRadius:0,outerRadius:_,startAngle:b,endAngle:y,options:this.resolveDataElementOptions(g,m.active?"active":s)};this.updateElement(m,g,v,s)}}countVisibleElements(){let t=this._cachedMeta,i=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&i++}),i}_computeAngle(t,i,n){return this.chart.getDataVisibility(t)?bt(this.resolveDataElementOptions(t,i).angle||n):0}};M(ae,"id","polarArea"),M(ae,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),M(ae,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let i=t.data;if(i.labels.length&&i.datasets.length){let{labels:{pointStyle:n,color:s}}=t.legend.options;return i.labels.map((o,r)=>{let 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,i,n){n.chart.toggleDataVisibility(i.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});ai=class extends It{};M(ai,"id","pie"),M(ai,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});Ae=class extends gt{getLabelAndValue(t){let i=this._cachedMeta.vScale,n=this.getParsed(t);return{label:i.getLabels()[t],value:""+i.getLabelForValue(n[i.axis])}}parseObjectData(t,i,n,s){return ys.bind(this)(t,i,n,s)}update(t){let i=this._cachedMeta,n=i.dataset,s=i.data||[],o=i.iScale.getLabels();if(n.points=s,t!=="resize"){let r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);let 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,i,n,s){let o=this._cachedMeta.rScale,r=s==="reset";for(let a=i;a<i+n;a++){let l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),d=o.getPointPositionForValue(a,this.getParsed(a).r),u=r?o.xCenter:d.x,h=r?o.yCenter:d.y,f={x:u,y:h,angle:d.angle,skip:isNaN(u)||isNaN(h),options:c};this.updateElement(l,a,f,s)}}};M(Ae,"id","radar"),M(Ae,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),M(Ae,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});De=class extends gt{getLabelAndValue(t){let i=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=i,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:n[t]||"",value:"("+a+", "+l+")"}}update(t){let i=this._cachedMeta,{data:n=[]}=i,s=this.chart._animationsDisabled,{start:o,count:r}=ls(i,n,s);if(this._drawStart=o,this._drawCount=r,cs(i)&&(o=0,r=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:a,_dataset:l}=i;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=n;let c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete i.dataset,this.datasetElementType=!1);this.updateElements(n,o,r,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,i,n,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(i,s),u=this.getSharedOptions(d),h=this.includeOptions(s,u),f=r.axis,g=a.axis,{spanGaps:p,segment:m}=this.options,b=ee(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||s==="none",_=i>0&&this.getParsed(i-1);for(let v=i;v<i+n;++v){let x=t[v],S=this.getParsed(v),k=y?x:{},T=R(S[g]),w=k[f]=r.getPixelForValue(S[f],v),L=k[g]=o||T?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,S,l):S[g],v);k.skip=isNaN(w)||isNaN(L)||T,k.stop=v>0&&Math.abs(S[f]-_[f])>b,m&&(k.parsed=S,k.raw=c.data[v]),h&&(k.options=u||this.resolveDataElementOptions(v,x.active?"active":s)),y||this.updateElement(x,v,k,s),_=S}this.updateSharedOptions(u,s,d)}getMaxOverflow(){let t=this._cachedMeta,i=t.data||[];if(!this.options.showLine){let a=0;for(let l=i.length-1;l>=0;--l)a=Math.max(a,i[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}let n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!i.length)return s;let o=i[0].size(this.resolveDataElementOptions(0)),r=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(s,o,r)/2}};M(De,"id","scatter"),M(De,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),M(De,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});gh=Object.freeze({__proto__:null,BarController:Ce,BubbleController:Ee,DoughnutController:It,LineController:Le,PieController:ai,PolarAreaController:ae,RadarController:Ae,ScatterController:De});zs=class e{constructor(t){M(this,"options");this.options=t||{}}static override(t){Object.assign(e.prototype,t)}init(){}formats(){return ne()}parse(){return ne()}format(){return ne()}add(){return ne()}diff(){return ne()}startOf(){return ne()}endOf(){return ne()}},ph={_date:zs};_h={evaluateInteractionItems:yi,modes:{index(e,t,i,n){let s=jt(t,e),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?As(e,s,o,n,r):Ds(e,s,o,!1,n,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let d=a[0].index,u=c.data[d];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,i,n){let s=jt(t,e),o=i.axis||"xy",r=i.includeInvisible||!1,a=i.intersect?As(e,s,o,n,r):Ds(e,s,o,!1,n,r);if(a.length>0){let l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(e,t,i,n){let s=jt(t,e),o=i.axis||"xy",r=i.includeInvisible||!1;return As(e,s,o,n,r)},nearest(e,t,i,n){let s=jt(t,e),o=i.axis||"xy",r=i.includeInvisible||!1;return Ds(e,s,o,i.intersect,n,r)},x(e,t,i,n){let s=jt(t,e);return pa(e,s,"x",i.intersect,n)},y(e,t,i,n){let s=jt(t,e);return pa(e,s,"y",i.intersect,n)}}},al=["left","top","right","bottom"];ot={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(i){t.draw(i)}}]},e.boxes.push(t)},removeBox(e,t){let i=e.boxes?e.boxes.indexOf(t):-1;i!==-1&&e.boxes.splice(i,1)},configure(e,t,i){t.fullSize=i.fullSize,t.position=i.position,t.weight=i.weight},update(e,t,i,n){if(!e)return;let s=nt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(i-s.height,0),a=kh(e.boxes),l=a.vertical,c=a.horizontal;H(e.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});let d=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:i,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/d,hBoxMaxHeight:r/2}),h=Object.assign({},s);ll(h,nt(n));let f=Object.assign({maxPadding:h,w:o,h:r,x:s.left,y:s.top},s),g=Sh(l.concat(c),u);li(a.fullSize,f,u,g),li(l,f,u,g),li(c,f,u,g)&&li(l,f,u,g),wh(f),ya(a.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,ya(a.rightAndBottom,f,u,g),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},H(a.chartArea,p=>{let m=p.box;Object.assign(m,e.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},hn=class{acquireContext(t,i){}releaseContext(t){return!1}addEventListener(t,i,n){}removeEventListener(t,i,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,i,n,s){return i=Math.max(0,i||t.width),n=n||t.height,{width:i,height:Math.max(0,s?Math.floor(i/s):n)}}isAttached(t){return!0}updateConfig(t){}},Bs=class extends hn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},cn="$chartjs",Eh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xa=e=>e===null||e==="";cl=ta?{passive:!0}:!1;pi=new Map,_a=0;Ws=class extends hn{acquireContext(t,i){let n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Lh(t,i),n):null}releaseContext(t){let i=t.canvas;if(!i[cn])return!1;let n=i[cn].initial;["height","width"].forEach(o=>{let r=n[o];R(r)?i.removeAttribute(o):i.setAttribute(o,r)});let s=n.style||{};return Object.keys(s).forEach(o=>{i.style[o]=s[o]}),i.width=i.width,delete i[cn],!0}addEventListener(t,i,n){this.removeEventListener(t,i);let s=t.$proxies||(t.$proxies={}),r={attach:Rh,detach:Oh,resize:$h}[i]||Hh;s[i]=r(t,i,n)}removeEventListener(t,i){let n=t.$proxies||(t.$proxies={}),s=n[i];if(!s)return;({attach:Ps,detach:Ps,resize:Ps}[i]||Dh)(t,i,s),n[i]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,i,n,s){return Qr(t,i,n,s)}isAttached(t){let i=t&&tn(t);return!!(i&&i.isConnected)}};pt=class{constructor(){M(this,"x");M(this,"y");M(this,"active",!1);M(this,"options");M(this,"$animations")}tooltipPosition(t){let{x:i,y:n}=this.getProps(["x","y"],t);return{x:i,y:n}}hasValue(){return ee(this.x)&&ee(this.y)}getProps(t,i){let n=this.$animations;if(!i||!n)return this;let s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}};M(pt,"defaults",{}),M(pt,"defaultRoutes");Yh=e=>e==="left"?"right":e==="right"?"left":e,va=(e,t,i)=>t==="top"||t==="left"?e[t]+i:e[t]-i,Ma=(e,t)=>Math.min(t||e,e);ce=class e extends pt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,i){return t}getUserBounds(){let{_userMin:t,_userMax:i,_suggestedMin:n,_suggestedMax:s}=this;return t=ct(t,Number.POSITIVE_INFINITY),i=ct(i,Number.NEGATIVE_INFINITY),n=ct(n,Number.POSITIVE_INFINITY),s=ct(s,Number.NEGATIVE_INFINITY),{min:ct(t,n),max:ct(i,s),minDefined:Y(t),maxDefined:Y(i)}}getMinMax(t){let{min:i,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:i,max:n};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(i=Math.min(i,r.min)),o||(n=Math.max(n,r.max));return i=o&&i>n?n:i,n=s&&i>n?i:n,{min:ct(i,ct(n,i)),max:ct(n,ct(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let 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(){W(this.options.beforeUpdate,[this])}update(t,i,n){let{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=i,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=Ur(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Sa(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=Bh(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,i,n;this.isHorizontal()?(i=this.left,n=this.right):(i=this.top,n=this.bottom,t=!t),this._startPixel=i,this._endPixel=n,this._reversePixels=t,this._length=n-i,this._alignToPixels=this.options.alignToPixels}afterUpdate(){W(this.options.afterUpdate,[this])}beforeSetDimensions(){W(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){W(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),W(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){W(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let i=this.options.ticks,n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=W(i.callback,[o.value,n,t],this)}afterTickToLabelConversion(){W(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){W(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,i=t.ticks,n=Ma(this.ticks.length,t.ticks.maxTicksLimit),s=i.minRotation||0,o=i.maxRotation,r=s,a,l,c;if(!this._isVisible()||!i.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}let d=this._getLabelSizes(),u=d.widest.width,h=d.highest.height,f=Z(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/n:f/(n-1),u+6>a&&(a=f/(n-(t.offset?.5:1)),l=this.maxHeight-oi(t.grid)-i.padding-ka(t.title,this.chart.options.font),c=Math.sqrt(u*u+h*h),r=Yi(Math.min(Math.asin(Z((d.highest.height+6)/a,-1,1)),Math.asin(Z(l/c,-1,1))-Math.asin(Z(h/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){W(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){W(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:i,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=ka(s,i.options.font);if(a?(t.width=this.maxWidth,t.height=oi(o)+l):(t.height=this.maxHeight,t.width=oi(o)+l),n.display&&this.ticks.length){let{first:c,last:d,widest:u,highest:h}=this._getLabelSizes(),f=n.padding*2,g=bt(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){let b=n.mirror?0:m*u.width+p*h.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{let b=n.mirror?0:p*u.width+m*h.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,d,m,p)}}this._handleMargins(),a?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,i,n,s){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let d=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),h=0,f=0;l?c?(h=s*t.width,f=n*i.height):(h=n*t.height,f=s*i.width):o==="start"?f=i.width:o==="end"?h=t.width:o!=="inner"&&(h=t.width/2,f=i.width/2),this.paddingLeft=Math.max((h-d+r)*this.width/(this.width-d),0),this.paddingRight=Math.max((f-u+r)*this.width/(this.width-u),0)}else{let d=i.height/2,u=t.height/2;o==="start"?(d=0,u=t.height):o==="end"&&(d=i.height,u=0),this.paddingTop=d+r,this.paddingBottom=u+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(){W(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:i}=this.options;return i==="top"||i==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let i,n;for(i=0,n=t.length;i<n;i++)R(t[i].label)&&(t.splice(i,1),n--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let i=this.options.ticks.sampleSize,n=this.ticks;i<n.length&&(n=Sa(n,i)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,i,n){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(i/Ma(i,n)),c=0,d=0,u,h,f,g,p,m,b,y,_,v,x;for(u=0;u<i;u+=l){if(g=t[u].label,p=this._resolveTickFontOptions(u),s.font=m=p.string,b=o[m]=o[m]||{data:{},gc:[]},y=p.lineHeight,_=v=0,!R(g)&&!N(g))_=Je(s,b.data,b.gc,_,g),v=y;else if(N(g))for(h=0,f=g.length;h<f;++h)x=g[h],!R(x)&&!N(x)&&(_=Je(s,b.data,b.gc,_,x),v+=y);r.push(_),a.push(v),c=Math.max(_,c),d=Math.max(v,d)}Gh(o,i);let S=r.indexOf(c),k=a.indexOf(d),T=w=>({width:r[w]||0,height:a[w]||0});return{first:T(0),last:T(i-1),widest:T(S),highest:T(k),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,i){return NaN}getValueForPixel(t){}getPixelForTick(t){let i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let i=this._startPixel+t*this._length;return Fr(this._alignToPixels?Wt(this.chart,i,0):i)}getDecimalForPixel(t){let i=(t-this._startPixel)/this._length;return this._reversePixels?1-i:i}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:i}=this;return t<0&&i<0?i:t>0&&i>0?t:0}getContext(t){let i=this.ticks||[];if(t>=0&&t<i.length){let n=i[t];return n.$context||(n.$context=Xh(this.getContext(),t,n))}return this.$context||(this.$context=Kh(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,i=bt(this.labelRotation),n=Math.abs(Math.cos(i)),s=Math.abs(Math.sin(i)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*n>a*s?a/n:l/s:l*s<a*n?l/n:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let i=this.axis,n=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),h=oi(o),f=[],g=a.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,b=function(q){return Wt(n,q,p)},y,_,v,x,S,k,T,w,L,A,I,Q;if(r==="top")y=b(this.bottom),k=this.bottom-h,w=y-m,A=b(t.top)+m,Q=t.bottom;else if(r==="bottom")y=b(this.top),A=t.top,Q=b(t.bottom)-m,k=y+m,w=this.top+h;else if(r==="left")y=b(this.right),S=this.right-h,T=y-m,L=b(t.left)+m,I=t.right;else if(r==="right")y=b(this.left),L=t.left,I=b(t.right)-m,S=y+m,T=this.left+h;else if(i==="x"){if(r==="center")y=b((t.top+t.bottom)/2+.5);else if(O(r)){let q=Object.keys(r)[0],X=r[q];y=b(this.chart.scales[q].getPixelForValue(X))}A=t.top,Q=t.bottom,k=y+m,w=k+h}else if(i==="y"){if(r==="center")y=b((t.left+t.right)/2);else if(O(r)){let q=Object.keys(r)[0],X=r[q];y=b(this.chart.scales[q].getPixelForValue(X))}S=y-m,T=S-h,L=t.left,I=t.right}let ht=E(s.ticks.maxTicksLimit,u),B=Math.max(1,Math.ceil(u/ht));for(_=0;_<u;_+=B){let q=this.getContext(_),X=o.setContext(q),yt=a.setContext(q),st=X.lineWidth,de=X.color,Mi=yt.dash||[],ue=yt.dashOffset,He=X.tickWidth,Yt=X.tickColor,ze=X.tickBorderDash||[],Ut=X.tickBorderDashOffset;v=Uh(this,_,l),v!==void 0&&(x=Wt(n,v,st),c?S=T=L=I=x:k=w=A=Q=x,f.push({tx1:S,ty1:k,tx2:T,ty2:w,x1:L,y1:A,x2:I,y2:Q,width:st,color:de,borderDash:Mi,borderDashOffset:ue,tickWidth:He,tickColor:Yt,tickBorderDash:ze,tickBorderDashOffset:Ut}))}return this._ticksLength=u,this._borderValue=y,f}_computeLabelItems(t){let i=this.axis,n=this.options,{position:s,ticks:o}=n,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:u}=o,h=oi(n.grid),f=h+d,g=u?-d:f,p=-bt(this.labelRotation),m=[],b,y,_,v,x,S,k,T,w,L,A,I,Q="middle";if(s==="top")S=this.bottom-g,k=this._getXAxisLabelAlignment();else if(s==="bottom")S=this.top+g,k=this._getXAxisLabelAlignment();else if(s==="left"){let B=this._getYAxisLabelAlignment(h);k=B.textAlign,x=B.x}else if(s==="right"){let B=this._getYAxisLabelAlignment(h);k=B.textAlign,x=B.x}else if(i==="x"){if(s==="center")S=(t.top+t.bottom)/2+f;else if(O(s)){let B=Object.keys(s)[0],q=s[B];S=this.chart.scales[B].getPixelForValue(q)+f}k=this._getXAxisLabelAlignment()}else if(i==="y"){if(s==="center")x=(t.left+t.right)/2-f;else if(O(s)){let B=Object.keys(s)[0],q=s[B];x=this.chart.scales[B].getPixelForValue(q)}k=this._getYAxisLabelAlignment(h).textAlign}i==="y"&&(l==="start"?Q="top":l==="end"&&(Q="bottom"));let ht=this._getLabelSizes();for(b=0,y=a.length;b<y;++b){_=a[b],v=_.label;let B=o.setContext(this.getContext(b));T=this.getPixelForTick(b)+o.labelOffset,w=this._resolveTickFontOptions(b),L=w.lineHeight,A=N(v)?v.length:1;let q=A/2,X=B.color,yt=B.textStrokeColor,st=B.textStrokeWidth,de=k;r?(x=T,k==="inner"&&(b===y-1?de=this.options.reverse?"left":"right":b===0?de=this.options.reverse?"right":"left":de="center"),s==="top"?c==="near"||p!==0?I=-A*L+L/2:c==="center"?I=-ht.highest.height/2-q*L+L:I=-ht.highest.height+L/2:c==="near"||p!==0?I=L/2:c==="center"?I=ht.highest.height/2-q*L:I=ht.highest.height-A*L,u&&(I*=-1),p!==0&&!B.showLabelBackdrop&&(x+=L/2*Math.sin(p))):(S=T,I=(1-A)*L/2);let Mi;if(B.showLabelBackdrop){let ue=nt(B.backdropPadding),He=ht.heights[b],Yt=ht.widths[b],ze=I-ue.top,Ut=0-ue.left;switch(Q){case"middle":ze-=He/2;break;case"bottom":ze-=He;break}switch(k){case"center":Ut-=Yt/2;break;case"right":Ut-=Yt;break;case"inner":b===y-1?Ut-=Yt:b>0&&(Ut-=Yt/2);break}Mi={left:Ut,top:ze,width:Yt+ue.width,height:He+ue.height,color:B.backdropColor}}m.push({label:v,font:w,textOffset:I,options:{rotation:p,color:X,strokeColor:yt,strokeWidth:st,textAlign:de,textBaseline:Q,translation:[x,S],backdrop:Mi}})}return m}_getXAxisLabelAlignment(){let{position:t,ticks:i}=this.options;if(-bt(this.labelRotation))return t==="top"?"left":"right";let s="center";return i.align==="start"?s="left":i.align==="end"?s="right":i.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:i,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width,c,d;return i==="left"?s?(d=this.right+o,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d=this.left)):i==="right"?s?(d=this.left+o,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,i=this.options.position;if(i==="left"||i==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(i==="top"||i==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:i},left:n,top:s,width:o,height:r}=this;i&&(t.save(),t.fillStyle=i,t.fillRect(n,s,o,r),t.restore())}getLineWidthForValue(t){let i=this.options.grid;if(!this._isVisible()||!i.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?i.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let i=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,a=(l,c,d)=>{!d.width||!d.color||(n.save(),n.lineWidth=d.width,n.strokeStyle=d.color,n.setLineDash(d.borderDash||[]),n.lineDashOffset=d.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(i.display)for(o=0,r=s.length;o<r;++o){let l=s[o];i.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),i.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:i,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),r=n.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,d,u,h;this.isHorizontal()?(c=Wt(t,this.left,r)-r/2,d=Wt(t,this.right,a)+a/2,u=h=l):(u=Wt(t,this.top,r)-r/2,h=Wt(t,this.bottom,a)+a/2,c=d=l),i.save(),i.lineWidth=o.width,i.strokeStyle=o.color,i.beginPath(),i.moveTo(c,u),i.lineTo(d,h),i.stroke(),i.restore()}drawLabels(t){if(!this.options.ticks.display)return;let n=this.ctx,s=this._computeLabelArea();s&&ti(n,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,l=r.font,c=r.label,d=r.textOffset;Nt(n,c,0,d,l,a)}s&&ei(n)}drawTitle(){let{ctx:t,options:{position:i,title:n,reverse:s}}=this;if(!n.display)return;let o=J(n.font),r=nt(n.padding),a=n.align,l=o.lineHeight/2;i==="bottom"||i==="center"||O(i)?(l+=r.bottom,N(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=r.top;let{titleX:c,titleY:d,maxWidth:u,rotation:h}=Zh(this,l,i,a);Nt(t,n.text,0,0,o,{color:n.color,maxWidth:u,rotation:h,textAlign:Jh(a,i,s),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,i=t.ticks&&t.ticks.z||0,n=E(t.grid&&t.grid.z,-1),s=E(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:i,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:i,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){let i=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[],o,r;for(o=0,r=i.length;o<r;++o){let a=i[o];a[n]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let i=this.options.ticks.setContext(this.getContext(t));return J(i.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Oe=class{constructor(t,i,n){this.type=t,this.scope=i,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let i=Object.getPrototypeOf(t),n;ef(i)&&(n=this.register(i));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,Qh(t,r,n),this.override&&j.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let i=this.items,n=t.id,s=this.scope;n in i&&delete i[n],s&&n in j[s]&&(delete j[s][n],this.override&&delete Bt[n])}};Ns=class{constructor(){this.controllers=new Oe(gt,"datasets",!0),this.elements=new Oe(pt,"elements"),this.plugins=new Oe(Object,"plugins"),this.scales=new Oe(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,i,n){[...i].forEach(s=>{let o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):H(s,r=>{let a=n||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,i,n){let s=qi(t);W(n["before"+s],[],n),i[t](n),W(n["after"+s],[],n)}_getRegistryForType(t){for(let i=0;i<this._typedRegistries.length;i++){let n=this._typedRegistries[i];if(n.isForType(t))return n}return this.plugins}_get(t,i,n){let s=i.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}},wt=new Ns,Vs=class{constructor(){this._init=void 0}notify(t,i,n,s){if(i==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,i,n);return i==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,i,n,s){s=s||{};for(let o of t){let r=o.plugin,a=r[n],l=[i,s,o.options];if(W(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){R(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let i=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),i}_createDescriptors(t,i){let n=t&&t.config,s=E(n.options&&n.options.plugins,{}),o=nf(n);return s===!1&&!i?[]:of(t,o,s,i)}_notifyStateChanges(t){let i=this._oldCache||[],n=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(i,n),t,"stop"),this._notify(s(n,i),t,"start")}};Ca=new Map,fl=new Set;ri=(e,t,i)=>{let n=Dt(t,i);n!==void 0&&e.add(n)},Ys=class{constructor(t){this._config=hf(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=hl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),ul(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return on(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,i){return on(`${t}.transition.${i}`,()=>[[`datasets.${t}.transitions.${i}`,`transitions.${i}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,i){return on(`${t}-${i}`,()=>[[`datasets.${t}.elements.${i}`,`datasets.${t}`,`elements.${i}`,""]])}pluginScopeKeys(t){let i=t.id,n=this.type;return on(`${n}-plugin-${i}`,()=>[[`plugins.${i}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,i){let n=this._scopeCache,s=n.get(t);return(!s||i)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,i,n){let{options:s,type:o}=this,r=this._cachedScopes(t,n),a=r.get(i);if(a)return a;let l=new Set;i.forEach(d=>{t&&(l.add(t),d.forEach(u=>ri(l,t,u))),d.forEach(u=>ri(l,s,u)),d.forEach(u=>ri(l,Bt[o]||{},u)),d.forEach(u=>ri(l,j,u)),d.forEach(u=>ri(l,Ki,u))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),fl.has(i)&&r.set(i,c),c}chartOptionScopes(){let{options:t,type:i}=this;return[t,Bt[i]||{},j.datasets[i]||{},{type:i},j,Ki]}resolveNamedOptions(t,i,n,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=Ea(this._resolverCache,t,s),l=r;if(gf(r,i)){o.$shared=!1,n=Lt(n)?n():n;let c=this.createResolver(t,n,a);l=te(r,n,c)}for(let c of i)o[c]=l[c];return o}createResolver(t,i,n=[""],s){let{resolver:o}=Ea(this._resolverCache,t,n);return O(i)?te(o,i,void 0,s):o}};ff=e=>O(e)&&Object.getOwnPropertyNames(e).some(t=>Lt(e[t]));pf="4.5.1",mf=["top","bottom","left","right","chartArea"];dn={},Pa=e=>{let t=gl(e);return Object.values(dn).filter(i=>i.canvas===t).pop()};lt=class{static register(...t){wt.add(...t),Ra()}static unregister(...t){wt.remove(...t),Ra()}constructor(t,i){let n=this.config=new Ys(i),s=gl(t),o=Pa(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.");let r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||zh(s)),this.platform.updateConfig(n);let a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=Ar(),this.ctx=a,this.canvas=l,this.width=d,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 Vs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Wr(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],dn[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Rt.listen(this,"complete",Da),Rt.listen(this,"progress",bf),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:i},width:n,height:s,_aspectRatio:o}=this;return R(t)?i&&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 wt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():xs(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return hs(this.canvas,this.ctx),this}stop(){return Rt.stop(this),this}resize(t,i){Rt.running(this)?this._resizeBeforeDraw={width:t,height:i}:this._resize(t,i)}_resize(t,i){let n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,i,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,xs(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),W(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let i=this.options.scales||{};H(i,(n,s)=>{n.id=s})}buildOrUpdateScales(){let t=this.options,i=t.scales,n=this.scales,s=Object.keys(n).reduce((r,a)=>(r[a]=!1,r),{}),o=[];i&&(o=o.concat(Object.keys(i).map(r=>{let a=i[r],l=qs(r,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),H(o,r=>{let a=r.options,l=a.id,c=qs(l,a),d=E(a.type,r.dtype);(a.position===void 0||La(a.position,c)!==La(r.dposition))&&(a.position=r.dposition),s[l]=!0;let u=null;if(l in n&&n[l].type===d)u=n[l];else{let h=wt.getScale(d);u=new h({id:l,type:d,ctx:this.ctx,chart:this}),n[u.id]=u}u.init(a,t)}),H(s,(r,a)=>{r||delete n[a]}),H(n,r=>{ot.configure(this,r,r.options),ot.addBox(this,r)})}_updateMetasets(){let t=this._metasets,i=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>i){for(let s=i;s<n;++s)this._destroyDatasetMeta(s);t.splice(i,n-i)}this._sortedMetasets=t.slice(0).sort(Aa("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:i}}=this;t.length>i.length&&delete this._stacks,t.forEach((n,s)=>{i.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],i=this.data.datasets,n,s;for(this._removeUnreferencedMetasets(),n=0,s=i.length;n<s;n++){let o=i[n],r=this.getDatasetMeta(n),a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=a,r.indexAxis=o.indexAxis||js(a,this.options),r.order=o.order||0,r.index=n,r.label=""+o.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{let l=wt.getController(a),{datasetElementType:c,dataElementType:d}=j.datasets[a];Object.assign(l,{dataElementType:wt.getElement(d),datasetElementType:c&&wt.getElement(c)}),r.controller=new l(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){H(this.data.datasets,(t,i)=>{this.getDatasetMeta(i).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let i=this.config;i.update();let n=this._options=i.createResolver(i.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;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,d=this.data.datasets.length;c<d;c++){let{controller:u}=this.getDatasetMeta(c),h=!s&&o.indexOf(u)===-1;u.buildOrUpdateElements(h),r=Math.max(+u.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),s||H(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Aa("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){H(this.scales,t=>{ot.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,i=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Qn(i,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,i=this._getUniformDataChanges()||[];for(let{method:n,start:s,count:o}of i){let r=n==="_removeElements"?-o:o;yf(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let i=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;o<i;o++)if(!Qn(s,n(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ot.update(this,this.width,this.height,t);let i=this.chartArea,n=i.width<=0||i.height<=0;this._layers=[],H(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 i=0,n=this.data.datasets.length;i<n;++i)this.getDatasetMeta(i).controller.configure();for(let i=0,n=this.data.datasets.length;i<n;++i)this._updateDataset(i,Lt(t)?t({datasetIndex:i}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,i){let n=this.getDatasetMeta(t),s={meta:n,index:t,mode:i,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(i),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Rt.has(this)?this.attached&&!Rt.running(this)&&Rt.start(this):(this.draw(),Da({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let i=this._layers;for(t=0;t<i.length&&i[t].z<=0;++t)i[t].draw(this.chartArea);for(this._drawDatasets();t<i.length;++t)i[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let i=this._sortedMetasets,n=[],s,o;for(s=0,o=i.length;s<o;++s){let r=i[s];(!t||r.visible)&&n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let i=t.length-1;i>=0;--i)this._drawDataset(t[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let i=this.ctx,n={meta:t,index:t.index,cancelable:!0},s=Ts(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&ti(i,s),t.controller.draw(),s&&ei(i),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return Mt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,i,n,s){let o=_h.modes[i];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){let i=this.data.datasets[t],n=this._metasets,s=n.filter(o=>o&&o._dataset===i).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=Pt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let i=this.data.datasets[t];if(!i)return!1;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!i.hidden}setDatasetVisibility(t,i){let n=this.getDatasetMeta(t);n.hidden=!i}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,i,n){let s=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);_e(i)?(o.data[i].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,i){this._updateVisibility(t,i,!1)}show(t,i){this._updateVisibility(t,i,!0)}_destroyDatasetMeta(t){let i=this._metasets[t];i&&i.controller&&i.controller._destroy(),delete this._metasets[t]}_stop(){let t,i;for(this.stop(),Rt.remove(this),t=0,i=this.data.datasets.length;t<i;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:i}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),hs(t,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete dn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,i=this.platform,n=(o,r)=>{i.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};H(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,i=this.platform,n=(l,c)=>{i.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(i.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)},r,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)},i.isAttached(this.canvas)?a():r()}unbindEvents(){H(this._listeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._listeners={},H(this._responsiveListeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,i,n){let s=n?"set":"remove",o,r,a,l;for(i==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];let c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let i=this._active||[],n=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Ze(n,i)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,i))}notifyPlugins(t,i,n){return this._plugins.notify(this,t,i,n)}isPluginEnabled(t){return this._plugins._cache.filter(i=>i.plugin.id===t).length===1}_updateHoverStyles(t,i,n){let s=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),r=o(i,t),a=n?t:o(t,i);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,i){let n={event:t,replay:i,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;let o=this._handleEvent(t,i,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,i,n){let{_active:s=[],options:o}=this,r=i,a=this._getActiveElements(t,s,n,r),l=Rr(t),c=xf(t,this._lastEvent,n,l);n&&(this._lastEvent=null,W(o.onHover,[t,a,this],this),l&&W(o.onClick,[t,a,this],this));let d=!Ze(a,s);return(d||i)&&(this._active=a,this._updateHoverStyles(a,s,i)),this._lastEvent=c,d}_getActiveElements(t,i,n,s){if(t.type==="mouseout")return[];if(!n)return i;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};M(lt,"defaults",j),M(lt,"instances",dn),M(lt,"overrides",Bt),M(lt,"registry",wt),M(lt,"version",pf),M(lt,"getChart",Pa);oe=class extends pt{constructor(i){super();M(this,"circumference");M(this,"endAngle");M(this,"fullCircles");M(this,"innerRadius");M(this,"outerRadius");M(this,"pixelMargin");M(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,i&&Object.assign(this,i)}inRange(i,n,s){let o=this.getProps(["x","y"],s),{angle:r,distance:a}=ns(o,{x:i,y:n}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:u,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,g=E(h,c-l),p=Me(r,l,c)&&l!==c,m=g>=V||p,b=kt(a,d+f,u+f);return m&&b}getCenterPoint(i){let{x:n,y:s,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],i),{offset:c,spacing:d}=this.options,u=(o+r)/2,h=(a+l+d+c)/2;return{x:n+Math.cos(u)*h,y:s+Math.sin(u)*h}}tooltipPosition(i){return this.getCenterPoint(i)}draw(i){let{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>V?Math.floor(s/V):0,s===0||this.innerRadius<0||this.outerRadius<0)return;i.save();let l=(this.startAngle+this.endAngle)/2;i.translate(Math.cos(l)*o,Math.sin(l)*o);let c=1-Math.sin(Math.min(F,s||0)),d=o*c;i.fillStyle=n.backgroundColor,i.strokeStyle=n.borderColor,kf(i,this,d,r,a),Tf(i,this,d,r,a),i.restore()}};M(oe,"id","arc"),M(oe,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),M(oe,"defaultRoutes",{backgroundColor:"backgroundColor"}),M(oe,"descriptors",{_scriptable:!0,_indexable:i=>i!=="borderDash"});Rf=typeof Path2D=="function";Ct=class extends pt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,i){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let s=n.spanGaps?this._loop:this._fullLoop;Zr(this._points,n,t,s,i),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=sa(this,this.options.segment))}first(){let t=this.segments,i=this.points;return t.length&&i[t[0].start]}last(){let t=this.segments,i=this.points,n=t.length;return n&&i[t[n-1].end]}interpolate(t,i){let n=this.options,s=t[i],o=this.points,r=ks(this,{property:i,start:s,end:s});if(!r.length)return;let a=[],l=Af(n),c,d;for(c=0,d=r.length;c<d;++c){let{start:u,end:h}=r[c],f=o[u],g=o[h];if(f===g){a.push(f);continue}let p=Math.abs((s-f[i])/(g[i]-f[i])),m=l(f,g,p,n.stepped);m[i]=t[i],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,i,n){return Us(this)(t,this,i,n)}path(t,i,n){let s=this.segments,o=Us(this),r=this._loop;i=i||0,n=n||this.points.length-i;for(let a of s)r&=o(t,this,a,{start:i,end:i+n-1});return!!r}draw(t,i,n,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Of(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};M(Ct,"id","line"),M(Ct,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),M(Ct,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),M(Ct,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});Pe=class extends pt{constructor(i){super();M(this,"parsed");M(this,"skip");M(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,i&&Object.assign(this,i)}inRange(i,n,s){let o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(i-r,2)+Math.pow(n-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(i,n){return Oa(this,i,"x",n)}inYRange(i,n){return Oa(this,i,"y",n)}getCenterPoint(i){let{x:n,y:s}=this.getProps(["x","y"],i);return{x:n,y:s}}size(i){i=i||this.options||{};let n=i.radius||0;n=Math.max(n,n&&i.hoverRadius||0);let s=n&&i.borderWidth||0;return(n+s)*2}draw(i,n){let s=this.options;this.skip||s.radius<.1||!Mt(this,n,this.size(s)/2)||(i.strokeStyle=s.borderColor,i.lineWidth=s.borderWidth,i.fillStyle=s.backgroundColor,Xi(i,s,this.x,this.y))}getRange(){let i=this.options||{};return i.radius+i.hitRadius}};M(Pe,"id","point"),M(Pe,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),M(Pe,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});Re=class extends pt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){let{inflateAmount:i,options:{borderColor:n,backgroundColor:s}}=this,{inner:o,outer:r}=$f(this),a=Hf(r.radius)?ke:zf;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Os(r,i,o)),t.clip(),a(t,Os(o,-i,r)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,Os(o,i)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,i,n){return Rs(this,t,i,n)}inXRange(t,i){return Rs(this,t,null,i)}inYRange(t,i){return Rs(this,null,t,i)}getCenterPoint(t){let{x:i,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(i+s)/2:i,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}};M(Re,"id","bar"),M(Re,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),M(Re,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});Bf=Object.freeze({__proto__:null,ArcElement:oe,BarElement:Re,LineElement:Ct,PointElement:Pe}),Gs=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Ia=Gs.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));Uf={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,i){if(!i.enabled)return;let{data:{datasets:n},options:s}=e.config,{elements:o}=s,r=Fa(n)||qf(s)||o&&Fa(o)||Yf();if(!i.forceOverride&&r)return;let a=jf(e);n.forEach(a)}};Jf={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,i)=>{if(!i.enabled){$a(e);return}let n=e.width;e.data.datasets.forEach((s,o)=>{let{_data:r,indexAxis:a}=s,l=e.getDatasetMeta(o),c=r||s.data;if(Te([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let d=e.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:u,count:h}=Xf(l,c),f=i.threshold||4*n;if(h<=f){_l(s);return}R(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let g;switch(i.algorithm){case"lttb":g=Gf(c,u,h,n,i);break;case"min-max":g=Kf(c,u,h,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}s._decimated=g})},destroy(e){$a(e)}};pn=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,i,n){let{x:s,y:o,radius:r}=this;return i=i||{start:0,end:V},t.arc(s,o,r,i.end,i.start,!0),!n.bounds}interpolate(t){let{x:i,y:n,radius:s}=this,o=t.angle;return{x:i+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}};bg={id:"filler",afterDatasetsUpdate(e,t,i){let n=(e.data.datasets||[]).length,s=[],o,r,a,l;for(r=0;r<n;++r)o=e.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof Ct&&(l={visible:e.isDatasetVisible(r),index:r,fill:eg(a,r,n),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<n;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=tg(s,r,i.propagate))},beforeDraw(e,t,i){let n=i.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let r=s.length-1;r>=0;--r){let a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),n&&a.fill&&Is(e.ctx,a,o))}},beforeDatasetsDraw(e,t,i){if(i.drawTime!=="beforeDatasetsDraw")return;let n=e.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){let o=n[s].$filler;za(o)&&Is(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,i){let n=t.meta.$filler;!za(n)||i.drawTime!=="beforeDatasetDraw"||Is(e.ctx,n,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},Va=(e,t)=>{let{boxHeight:i=t,boxWidth:n=t}=e;return e.usePointStyle&&(i=Math.min(i,t),n=e.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(t,i)}},yg=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,mn=class extends pt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i,n){this.maxWidth=t,this.maxHeight=i,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(){let t=this.options.labels||{},i=W(t.generateLabels,[this.chart],this)||[];t.filter&&(i=i.filter(n=>t.filter(n,this.chart.data))),t.sort&&(i=i.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&i.reverse(),this.legendItems=i}fit(){let{options:t,ctx:i}=this;if(!t.display){this.width=this.height=0;return}let n=t.labels,s=J(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Va(n,o),c,d;i.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(r,o,a,l)+10):(d=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,i,n,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+a,u=t;o.textAlign="left",o.textBaseline="middle";let h=-1,f=-d;return this.legendItems.forEach((g,p)=>{let m=n+i/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>r)&&(u+=d,c[c.length-(p>0?0:1)]=0,f+=d,h++),l[p]={left:0,top:f,row:h,width:m,height:s},c[c.length-1]+=m+a}),u}_fitCols(t,i,n,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=r-t,u=a,h=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:y,itemHeight:_}=xg(n,i,o,m,s);b>0&&f+_+2*a>d&&(u+=h+a,c.push({width:h,height:f}),g+=h+a,p++,h=f=0),l[b]={left:g,top:f,col:p,width:y,height:_},h=Math.max(h,y),f+=_+a}),u+=h,c.push({width:h,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:i,options:{align:n,labels:{padding:s},rtl:o}}=this,r=ie(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=it(n,this.left+s,this.right-this.lineWidths[a]);for(let c of i)a!==c.row&&(a=c.row,l=it(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=it(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of i)c.col!==a&&(a=c.col,l=it(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){let t=this.ctx;ti(t,this),this._draw(),ei(t)}}_draw(){let{options:t,columnSizes:i,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,a=j.color,l=ie(t.rtl,this.left,this.width),c=J(r.font),{padding:d}=r,u=c.size,h=u/2,f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:g,boxHeight:p,itemHeight:m}=Va(r,u),b=function(S,k,T){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();let w=E(T.lineWidth,1);if(s.fillStyle=E(T.fillStyle,a),s.lineCap=E(T.lineCap,"butt"),s.lineDashOffset=E(T.lineDashOffset,0),s.lineJoin=E(T.lineJoin,"miter"),s.lineWidth=w,s.strokeStyle=E(T.strokeStyle,a),s.setLineDash(E(T.lineDash,[])),r.usePointStyle){let L={radius:p*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:w},A=l.xPlus(S,g/2),I=k+h;fs(s,L,A,I,r.pointStyleWidth&&g)}else{let L=k+Math.max((u-p)/2,0),A=l.leftForLtr(S,g),I=Vt(T.borderRadius);s.beginPath(),Object.values(I).some(Q=>Q!==0)?ke(s,{x:A,y:L,w:g,h:p,radius:I}):s.rect(A,L,g,p),s.fill(),w!==0&&s.stroke()}s.restore()},y=function(S,k,T){Nt(s,T.text,S,k+m/2,c,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},_=this.isHorizontal(),v=this._computeTitleHeight();_?f={x:it(o,this.left+d,this.right-n[0]),y:this.top+d+v,line:0}:f={x:this.left+d,y:it(o,this.top+v+d,this.bottom-i[0].height),line:0},vs(this.ctx,t.textDirection);let x=m+d;this.legendItems.forEach((S,k)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;let T=s.measureText(S.text).width,w=l.textAlign(S.textAlign||(S.textAlign=r.textAlign)),L=g+h+T,A=f.x,I=f.y;l.setWidth(this.width),_?k>0&&A+L+d>this.right&&(I=f.y+=x,f.line++,A=f.x=it(o,this.left+d,this.right-n[f.line])):k>0&&I+x>this.bottom&&(A=f.x=A+i[f.line].width+d,f.line++,I=f.y=it(o,this.top+v+d,this.bottom-i[f.line].height));let Q=l.x(A);if(b(Q,I,S),A=Nr(w,A+g+h,_?A+L:this.right,t.rtl),y(l.x(A),I,S),_)f.x+=L+d;else if(typeof S.text!="string"){let ht=c.lineHeight;f.y+=Ml(S,ht)+d}else f.y+=x}),Ms(this.ctx,t.textDirection)}drawTitle(){let t=this.options,i=t.title,n=J(i.font),s=nt(i.padding);if(!i.display)return;let o=ie(t.rtl,this.left,this.width),r=this.ctx,a=i.position,l=n.size/2,c=s.top+l,d,u=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),d=this.top+c,u=it(t.align,u,this.right-h);else{let g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);d=c+it(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}let f=it(a,u,u+h);r.textAlign=o.textAlign(Gi(a)),r.textBaseline="middle",r.strokeStyle=i.color,r.fillStyle=i.color,r.font=n.string,Nt(r,i.text,f,d,n)}_computeTitleHeight(){let t=this.options.title,i=J(t.font),n=nt(t.padding);return t.display?i.lineHeight+n.height:0}_getLegendItemAt(t,i){let n,s,o;if(kt(t,this.left,this.right)&&kt(i,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],kt(t,s.left,s.left+s.width)&&kt(i,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){let i=this.options;if(!Mg(t.type,i))return;let n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,o=yg(s,n);s&&!o&&W(i.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&W(i.onHover,[t,n,this],this)}else n&&W(i.onClick,[t,n,this],this)}};Sg={id:"legend",_element:mn,start(e,t,i){let n=e.legend=new mn({ctx:e.ctx,options:i,chart:e});ot.configure(e,n,i),ot.addBox(e,n)},stop(e){ot.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,i){let n=e.legend;ot.configure(e,n,i),n.options=i},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,i){let n=t.datasetIndex,s=i.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(i?0:void 0),d=nt(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:(d.width+d.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:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},mi=class extends pt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i){let 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=i;let s=N(n.text)?n.text.length:1;this._padding=nt(n.padding);let o=s*J(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:i,left:n,bottom:s,right:o,options:r}=this,a=r.align,l=0,c,d,u;return this.isHorizontal()?(d=it(a,n,o),u=i+t,c=o-n):(r.position==="left"?(d=n+t,u=it(a,s,i),l=F*-.5):(d=o-t,u=it(a,i,s),l=F*.5),c=s-i),{titleX:d,titleY:u,maxWidth:c,rotation:l}}draw(){let t=this.ctx,i=this.options;if(!i.display)return;let n=J(i.font),o=n.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Nt(t,i.text,0,0,n,{color:i.color,maxWidth:l,rotation:c,textAlign:Gi(i.align),textBaseline:"middle",translation:[r,a]})}};Tg={id:"title",_element:mi,start(e,t,i){kg(e,i)},stop(e){let t=e.titleBlock;ot.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,i){let n=e.titleBlock;ot.configure(e,n,i),n.options=i},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}},rn=new WeakMap,wg={id:"subtitle",start(e,t,i){let n=new mi({ctx:e.ctx,options:i,chart:e});ot.configure(e,n,i),ot.addBox(e,n),rn.set(e,n)},stop(e){ot.removeBox(e,rn.get(e)),rn.delete(e)},beforeUpdate(e,t,i){let n=rn.get(e);ot.configure(e,n,i),n.options=i},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}},ci={average(e){if(!e.length)return!1;let t,i,n=new Set,s=0,o=0;for(t=0,i=e.length;t<i;++t){let a=e[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((a,l)=>a+l)/n.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let i=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),d=Vi(t,c);d<s&&(s=d,a=l)}}if(a){let l=a.tooltipPosition();i=l.x,n=l.y}return{x:i,y:n}}};Sl={beforeTitle:St,title(e){if(e.length>0){let t=e[0],i=t.chart.data.labels,n=i?i.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<n)return i[t.dataIndex]}return""},afterTitle:St,beforeBody:St,beforeLabel:St,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let i=e.formattedValue;return R(i)||(t+=i),t},labelColor(e){let i=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let i=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:St,afterBody:St,beforeFooter:St,footer:St,afterFooter:St};gi=class extends pt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let i=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&i.options.animation&&n.animations,o=new un(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Rg(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,i){let{callbacks:n}=i,s=dt(n,"beforeTitle",this,t),o=dt(n,"title",this,t),r=dt(n,"afterTitle",this,t),a=[];return a=Tt(a,Ot(s)),a=Tt(a,Ot(o)),a=Tt(a,Ot(r)),a}getBeforeBody(t,i){return Ua(dt(i.callbacks,"beforeBody",this,t))}getBody(t,i){let{callbacks:n}=i,s=[];return H(t,o=>{let r={before:[],lines:[],after:[]},a=Ga(n,o);Tt(r.before,Ot(dt(a,"beforeLabel",this,o))),Tt(r.lines,dt(a,"label",this,o)),Tt(r.after,Ot(dt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,i){return Ua(dt(i.callbacks,"afterBody",this,t))}getFooter(t,i){let{callbacks:n}=i,s=dt(n,"beforeFooter",this,t),o=dt(n,"footer",this,t),r=dt(n,"afterFooter",this,t),a=[];return a=Tt(a,Ot(s)),a=Tt(a,Ot(o)),a=Tt(a,Ot(r)),a}_createItems(t){let i=this._active,n=this.chart.data,s=[],o=[],r=[],a=[],l,c;for(l=0,c=i.length;l<c;++l)a.push(Cg(this.chart,i[l]));return t.filter&&(a=a.filter((d,u,h)=>t.filter(d,u,h,n))),t.itemSort&&(a=a.sort((d,u)=>t.itemSort(d,u,n))),H(a,d=>{let u=Ga(t.callbacks,d);s.push(dt(u,"labelColor",this,d)),o.push(dt(u,"labelPointStyle",this,d)),r.push(dt(u,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,i){let n=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=ci[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);let l=this._size=ja(this,n),c=Object.assign({},a,l),d=qa(this.chart,n,c),u=Ya(n,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:u.x,y:u.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:i})}drawCaret(t,i,n,s){let o=this.getCaretPosition(t,n,s);i.lineTo(o.x1,o.y1),i.lineTo(o.x2,o.y2),i.lineTo(o.x3,o.y3)}getCaretPosition(t,i,n){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:u}=Vt(a),{x:h,y:f}=t,{width:g,height:p}=i,m,b,y,_,v,x;return o==="center"?(v=f+p/2,s==="left"?(m=h,b=m-r,_=v+r,x=v-r):(m=h+g,b=m+r,_=v-r,x=v+r),y=m):(s==="left"?b=h+Math.max(l,d)+r:s==="right"?b=h+g-Math.max(c,u)-r:b=this.caretX,o==="top"?(_=f,v=_-r,m=b-r,y=b+r):(_=f+p,v=_+r,m=b+r,y=b-r),x=_),{x1:m,x2:b,x3:y,y1:_,y2:v,y3:x}}drawTitle(t,i,n){let s=this.title,o=s.length,r,a,l;if(o){let c=ie(n.rtl,this.x,this.width);for(t.x=an(this,n.titleAlign,n),i.textAlign=c.textAlign(n.titleAlign),i.textBaseline="middle",r=J(n.titleFont),a=n.titleSpacing,i.fillStyle=n.titleColor,i.font=r.string,l=0;l<o;++l)i.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,i,n,s,o){let r=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c}=o,d=J(o.bodyFont),u=an(this,"left",o),h=s.x(u),f=l<d.lineHeight?(d.lineHeight-l)/2:0,g=i.y+f;if(o.usePointStyle){let p={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=s.leftForLtr(h,c)+c/2,b=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Xi(t,p,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Xi(t,p,m,b)}else{t.lineWidth=O(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let p=s.leftForLtr(h,c),m=s.leftForLtr(s.xPlus(h,1),c-2),b=Vt(r.borderRadius);Object.values(b).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ke(t,{x:p,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ke(t,{x:m,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,i,n){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:d}=n,u=J(n.bodyFont),h=u.lineHeight,f=0,g=ie(n.rtl,this.x,this.width),p=function(T){i.fillText(T,g.x(t.x+f),t.y+h/2),t.y+=h+o},m=g.textAlign(r),b,y,_,v,x,S,k;for(i.textAlign=r,i.textBaseline="middle",i.font=u.string,t.x=an(this,m,n),i.fillStyle=n.bodyColor,H(this.beforeBody,p),f=a&&m!=="right"?r==="center"?c/2+d:c+2+d:0,v=0,S=s.length;v<S;++v){for(b=s[v],y=this.labelTextColors[v],i.fillStyle=y,H(b.before,p),_=b.lines,a&&_.length&&(this._drawColorBox(i,t,v,g,n),h=Math.max(u.lineHeight,l)),x=0,k=_.length;x<k;++x)p(_[x]),h=u.lineHeight;H(b.after,p)}f=0,h=u.lineHeight,H(this.afterBody,p),t.y-=o}drawFooter(t,i,n){let s=this.footer,o=s.length,r,a;if(o){let l=ie(n.rtl,this.x,this.width);for(t.x=an(this,n.footerAlign,n),t.y+=n.footerMarginTop,i.textAlign=l.textAlign(n.footerAlign),i.textBaseline="middle",r=J(n.footerFont),i.fillStyle=n.footerColor,i.font=r.string,a=0;a<o;++a)i.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}drawBackground(t,i,n,s){let{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:d}=n,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:g}=Vt(s.cornerRadius);i.fillStyle=s.backgroundColor,i.strokeStyle=s.borderColor,i.lineWidth=s.borderWidth,i.beginPath(),i.moveTo(a+u,l),r==="top"&&this.drawCaret(t,i,n,s),i.lineTo(a+c-h,l),i.quadraticCurveTo(a+c,l,a+c,l+h),r==="center"&&o==="right"&&this.drawCaret(t,i,n,s),i.lineTo(a+c,l+d-g),i.quadraticCurveTo(a+c,l+d,a+c-g,l+d),r==="bottom"&&this.drawCaret(t,i,n,s),i.lineTo(a+f,l+d),i.quadraticCurveTo(a,l+d,a,l+d-f),r==="center"&&o==="left"&&this.drawCaret(t,i,n,s),i.lineTo(a,l+u),i.quadraticCurveTo(a,l,a+u,l),i.closePath(),i.fill(),s.borderWidth>0&&i.stroke()}_updateAnimationTarget(t){let i=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){let r=ci[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=ja(this,t),l=Object.assign({},r,this._size),c=qa(i,t,l),d=Ya(t,l,c,i);(s._to!==d.x||o._to!==d.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,d))}}_willRender(){return!!this.opacity}draw(t){let i=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(i);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let r=nt(i.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;i.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,i),vs(t,i.textDirection),o.y+=r.top,this.drawTitle(o,t,i),this.drawBody(o,t,i),this.drawFooter(o,t,i),Ms(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){let n=this._active,s=t.map(({datasetIndex:a,index:l})=>{let 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=!Ze(n,s),r=this._positionChanged(s,i);(o||r)&&(this._active=s,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,n=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,i,n),a=this._positionChanged(r,t),l=i||!Ze(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),l}_getActiveElements(t,i,n,s){let o=this.options;if(t.type==="mouseout")return[];if(!s)return i.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,i){let{caretX:n,caretY:s,options:o}=this,r=ci[o.position].call(this,t,i);return r!==!1&&(n!==r.x||s!==r.y)}};M(gi,"positioners",ci);Og={id:"tooltip",_element:gi,positioners:ci,afterInit(e,t,i){i&&(e.tooltip=new gi({chart:e,options:i}))},beforeUpdate(e,t,i){e.tooltip&&e.tooltip.initialize(i)},reset(e,t,i){e.tooltip&&e.tooltip.initialize(i)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let i={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",i)}},afterEvent(e,t){if(e.tooltip){let i=t.replay;e.tooltip.handleEvent(t.event,i,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:Sl},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Ig=Object.freeze({__proto__:null,Colors:Uf,Decimation:Jf,Filler:bg,Legend:Sg,SubTitle:wg,Title:Tg,Tooltip:Og}),Fg=(e,t,i,n)=>(typeof t=="string"?(i=e.push(t)-1,n.unshift({index:i,label:t})):isNaN(t)&&(i=null),i);Hg=(e,t)=>e===null?null:Z(Math.round(e),0,t);di=class extends ce{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let i=this._addedLabels;if(i.length){let n=this.getLabels();for(let{index:s,label:o}of i)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,i){if(R(t))return null;let n=this.getLabels();return i=isFinite(i)&&n[i]===t?i:$g(n,t,E(i,t),this._addedLabels),Hg(i,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:i}=this.getUserBounds(),{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),i||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){let t=this.min,i=this.max,n=this.options.offset,s=[],o=this.getLabels();o=t===0&&i===o.length-1?o:o.slice(t,i+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let r=t;r<=i;r++)s.push({value:r});return s}getLabelForValue(t){return Ka.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};M(di,"id","category"),M(di,"defaults",{ticks:{callback:Ka}});Ie=class 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,i){return R(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:i,maxDefined:n}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=i?s:l,a=l=>o=n?o:l;if(t){let l=xt(s),c=xt(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(){let t=this.options.ticks,{maxTicksLimit:i,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(),i=i||11),i&&(s=Math.min(i,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,i=t.ticks,n=this.getTickLimit();n=Math.max(2,n);let s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:i.includeBounds!==!1},o=this._range||this,r=zg(s,o);return t.bounds==="ticks"&&es(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(){let t=this.ticks,i=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){let s=(n-i)/Math.max(t.length-1,1)/2;i-=s,n+=s}this._startValue=i,this._endValue=n,this._valueRange=n-i}getLabelForValue(t){return Se(t,this.chart.options.locale,this.options.ticks.format)}},ui=class extends Ie{determineDataLimits(){let{min:t,max:i}=this.getMinMax(!0);this.min=Y(t)?t:0,this.max=Y(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),i=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(i/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}};M(ui,"id","linear"),M(ui,"defaults",{ticks:{callback:Qe.formatters.numeric}});bi=e=>Math.floor(At(e)),se=(e,t)=>Math.pow(10,bi(e)+t);hi=class extends ce{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,i){let n=Ie.prototype.parse.apply(this,[t,i]);if(n===0){this._zero=!0;return}return Y(n)&&n>0?n:null}determineDataLimits(){let{min:t,max:i}=this.getMinMax(!0);this.min=Y(t)?Math.max(0,t):null,this.max=Y(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Y(this._userMin)&&(this.min=t===se(this.min,0)?se(this.min,-1):se(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:i}=this.getUserBounds(),n=this.min,s=this.max,o=a=>n=t?n:a,r=a=>s=i?s:a;n===s&&(n<=0?(o(1),r(10)):(o(se(n,-1)),r(se(s,1)))),n<=0&&o(se(s,-1)),s<=0&&r(se(n,1)),this.min=n,this.max=s}buildTicks(){let t=this.options,i={min:this._userMin,max:this._userMax},n=Wg(i,this);return t.bounds==="ticks"&&es(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":Se(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=At(t),this._valueRange=At(this.max)-At(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(At(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let i=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+i*this._valueRange)}};M(hi,"id","logarithmic"),M(hi,"defaults",{ticks:{callback:Qe.formatters.logarithmic,major:{enabled:!0}}});re=class extends Ie{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=nt(Xs(this.options)/2),i=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+i/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(i,n)/2)}determineDataLimits(){let{min:t,max:i}=this.getMinMax(!1);this.min=Y(t)&&!isNaN(t)?t:0,this.max=Y(i)&&!isNaN(i)?i:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Xs(this.options))}generateTickLabels(t){Ie.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((i,n)=>{let s=W(this.options.pointLabels.callback,[i,n],this);return s||s===0?s:""}).filter((i,n)=>this.chart.getDataVisibility(n))}fit(){let t=this.options;t.display&&t.pointLabels.display?Vg(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,i,n,s){this.xCenter+=Math.floor((t-i)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,i,n,s))}getIndexAngle(t){let i=V/(this._pointLabels.length||1),n=this.options.startAngle||0;return et(t*i+bt(n))}getDistanceFromCenterForValue(t){if(R(t))return NaN;let i=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*i:(t-this.min)*i}getValueForDistanceFromCenter(t){if(R(t))return NaN;let i=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-i:this.min+i}getPointLabelContext(t){let i=this._pointLabels||[];if(t>=0&&t<i.length){let n=i[t];return tp(this.getContext(),t,n)}}getPointPosition(t,i,n=0){let s=this.getIndexAngle(t)-G+n;return{x:Math.cos(s)*i+this.xCenter,y:Math.sin(s)*i+this.yCenter,angle:s}}getPointPositionForValue(t,i){return this.getPointPosition(t,this.getDistanceFromCenterForValue(i))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:i,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:i,top:n,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:i}}=this.options;if(t){let n=this.ctx;n.save(),n.beginPath(),kl(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){let t=this.ctx,i=this.options,{angleLines:n,grid:s,border:o}=i,r=this._pointLabels.length,a,l,c;if(i.pointLabels.display&&Zg(this,r),s.display&&this.ticks.forEach((d,u)=>{if(u!==0||u===0&&this.min<0){l=this.getDistanceFromCenterForValue(d.value);let h=this.getContext(u),f=s.setContext(h),g=o.setContext(h);Qg(this,f,l,r,g)}}),n.display){for(t.save(),a=r-1;a>=0;a--){let d=n.setContext(this.getPointLabelContext(a)),{color:u,lineWidth:h}=d;!h||!u||(t.lineWidth=h,t.strokeStyle=u,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(i.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(){let t=this.ctx,i=this.options,n=i.ticks;if(!n.display)return;let s=this.getIndexAngle(0),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&&!i.reverse)return;let c=n.setContext(this.getContext(l)),d=J(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let u=nt(c.backdropPadding);t.fillRect(-r/2-u.left,-o-d.size/2-u.top,r+u.width,d.size+u.height)}Nt(t,a.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}};M(re,"id","radialLinear"),M(re,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Qe.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),M(re,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),M(re,"descriptors",{angleLines:{_fallback:"grid"}});yn={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}},ut=Object.keys(yn);le=class extends ce{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,i={}){let n=t.time||(t.time={}),s=this._adapter=new ph._date(t.adapters.date);s.init(i),xe(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=i.normalized}parse(t,i){return t===void 0?null:el(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,i=this._adapter,n=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Y(s)&&!isNaN(s)?s:+i.startOf(Date.now(),n),o=Y(o)&&!isNaN(o)?o:+i.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(i=t[0],n=t[t.length-1]),{min:i,max:n}}buildTicks(){let t=this.options,i=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,r=this.max,a=Hr(s,o,r);return this._unit=i.unit||(n.autoSkip?il(i.minUnit,this.min,this.max,this._getLabelCapacity(o)):ep(this,a.length,i.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:ip(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),sl(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let i=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?i=1-s:i=(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);let r=t.length<3?.5:.25;i=Z(i,0,r),n=Z(n,0,r),this._offsets={start:i,end:n,factor:1/(i+1+n)}}_generate(){let t=this._adapter,i=this.min,n=this.max,s=this.options,o=s.time,r=o.unit||il(o.minUnit,i,n,this._getLabelCapacity(i)),a=E(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=ee(l)||l===!0,d={},u=i,h,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":r),t.diff(n,i,r)>1e5*a)throw new Error(i+" and "+n+" are too far apart with stepSize of "+a+" "+r);let g=s.ticks.source==="data"&&this.getDataTimestamps();for(h=u,f=0;h<n;h=+t.add(h,a,r),f++)nl(d,h,g);return(h===n||s.bounds==="ticks"||f===1)&&nl(d,h,g),Object.keys(d).sort(tl).map(p=>+p)}getLabelForValue(t){let i=this._adapter,n=this.options.time;return n.tooltipFormat?i.format(t,n.tooltipFormat):i.format(t,n.displayFormats.datetime)}format(t,i){let s=this.options.time.displayFormats,o=this._unit,r=i||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,i,n,s){let o=this.options,r=o.ticks.callback;if(r)return W(r,[t,i,n],this);let a=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&a[l],u=c&&a[c],h=n[i],f=c&&u&&h&&h.major;return this._adapter.format(t,s||(f?u:d))}generateTickLabels(t){let i,n,s;for(i=0,n=t.length;i<n;++i)s=t[i],s.label=this._tickFormatFunction(s.value,i,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let i=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((i.start+n)*i.factor)}getValueForPixel(t){let i=this._offsets,n=this.getDecimalForPixel(t)/i.factor-i.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let i=this.options.ticks,n=this.ctx.measureText(t).width,s=bt(this.isHorizontal()?i.maxRotation:i.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*r,h:n*r+a*o}}_getLabelCapacity(t){let i=this.options.time,n=i.displayFormats,s=n[i.unit]||n.millisecond,o=this._tickFormatFunction(t,0,sl(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],i,n;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(i=0,n=s.length;i<n;++i)t=t.concat(s[i].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],i,n;if(t.length)return t;let s=this.getLabels();for(i=0,n=s.length;i<n;++i)t.push(el(this,s[i]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return os(t.sort(tl))}};M(le,"id","time"),M(le,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});fi=class extends le{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),i=this._table=this.buildLookupTable(t);this._minPos=ln(i,this.min),this._tableRange=ln(i,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:i,max:n}=this,s=[],o=[],r,a,l,c,d;for(r=0,a=t.length;r<a;++r)c=t[r],c>=i&&c<=n&&s.push(c);if(s.length<2)return[{time:i,pos:0},{time:n,pos:1}];for(r=0,a=s.length;r<a;++r)d=s[r+1],l=s[r-1],c=s[r],Math.round((d+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let t=this.min,i=this.max,n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(i)||n.length===1)&&n.push(i),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let i=this.getDataTimestamps(),n=this.getLabelTimestamps();return i.length&&n.length?t=this.normalize(i.concat(n)):t=i.length?i:n,t=this._cache.all=t,t}getDecimalForValue(t){return(ln(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let i=this._offsets,n=this.getDecimalForPixel(t)/i.factor-i.end;return ln(this._table,n*this._tableRange+this._minPos,!0)}};M(fi,"id","timeseries"),M(fi,"defaults",le.defaults);sp=Object.freeze({__proto__:null,CategoryScale:di,LinearScale:ui,LogarithmicScale:hi,RadialLinearScale:re,TimeScale:le,TimeSeriesScale:fi}),Tl=[gh,Bf,Ig,sp]});function Cl(e,t){let i=document.getElementById(e);if(!i)return null;let n={to18:"rgb(37, 99, 235)",to19:"rgb(79, 70, 229)",to20:"rgb(147, 51, 234)",to21:"rgb(219, 39, 119)"},s={type:"pie",data:{labels:t.map(o=>o.migration.toUpperCase()),datasets:[{data:t.map(o=>o.minutes),backgroundColor:t.map(o=>n[o.migration]||"#888"),borderWidth:2,borderColor:"#fff"}]},options:{responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"bottom",labels:{font:{size:12}}},tooltip:{callbacks:{label:o=>{let r=o.parsed,l=o.dataset.data.reduce((d,u)=>d+u,0),c=l>0?Math.round(r/l*100):0;return`${o.label}: ${xn(r)} (${c}%)`}}}}}};return new lt(i,s)}function Js(e,t,i=10,n=!1){let s=document.getElementById(e);if(!s)return null;let o=t.slice(0,i),r=o.map(d=>n?d.summary:d.summary.length>50?d.summary.substring(0,50)+"...":d.summary),a=Math.max(...o.map(d=>d.minutes)),l=op(a),c={type:"bar",data:{labels:r,datasets:[{label:`Temps (${l})`,data:o.map(d=>rp(d.minutes,l)),backgroundColor:"rgba(37, 99, 235, 0.8)",borderColor:"rgb(37, 99, 235)",borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!1,indexAxis:"y",plugins:{legend:{display:!1},tooltip:{callbacks:{label:d=>{let u=o[d.dataIndex],h=xn(u.minutes),f=u.occurrences>1?"occurrences":"occurrence";return`${h} \u2022 ${u.occurrences} ${f}`}}}},scales:{x:{beginAtZero:!0,title:{display:!0,text:`Temps (${l})`}}}}};return new lt(s,c)}function op(e){return e<60?"min":e<420?"h":"j"}function rp(e,t){if(t==="min")return e;if(t==="h")return Math.round(e/60*100)/100;let i=e/60;return Math.round(i/7*100)/100}function xn(e){if(e<60)return`${e}min`;let t=Math.round(e/60*100)/100;return e<420?`${t}h`:`${Math.round(t/7*100)/100}j`}function El(e,t){let i=document.getElementById(e);if(!i)return null;let n={obligatoire:"rgb(220, 38, 38)",recommande:"rgb(217, 119, 6)",optionnelle:"rgb(22, 163, 74)"},s={type:"doughnut",data:{labels:t.map(o=>o.priority.charAt(0).toUpperCase()+o.priority.slice(1)),datasets:[{data:t.map(o=>o.minutes),backgroundColor:t.map(o=>n[o.priority]||"#888"),borderWidth:2,borderColor:"#fff"}]},options:{responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"bottom",labels:{font:{size:12}}},tooltip:{callbacks:{label:o=>{let r=o.parsed,l=o.dataset.data.reduce((d,u)=>d+u,0),c=l>0?Math.round(r/l*100):0;return`${o.label}: ${xn(r)} (${c}%)`}}}}}};return new lt(i,s)}function Ll(e,t){let i=document.getElementById(e);if(!i)return null;let n=t.filter(r=>r.minutes>0),s=ap(n),o={type:"pie",data:{labels:n.map(r=>r.targetName),datasets:[{data:n.map(r=>r.minutes),backgroundColor:s,borderWidth:2,borderColor:"#fff"}]},options:{responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"bottom",labels:{font:{size:11},padding:8,boxWidth:12}},tooltip:{callbacks:{label:r=>{let a=r.dataIndex,l=n[a],c=r.parsed,u=r.dataset.data.reduce((g,p)=>g+p,0),h=u>0?Math.round(c/u*100):0;return`${l.targetType==="app"?"\u{1F4E6} App":"\u{1F4DA} Lib"} - ${l.targetName}: ${xn(c)} (${h}%)`}}}}}};return new lt(i,o)}function ap(e){let t=["rgb(249, 115, 22)","rgb(34, 197, 94)","rgb(220, 38, 38)","rgb(14, 165, 233)","rgb(234, 88, 12)","rgb(168, 85, 247)","rgb(251, 146, 60)","rgb(16, 185, 129)","rgb(236, 72, 153)","rgb(234, 179, 8)","rgb(59, 130, 246)","rgb(239, 68, 68)","rgb(20, 184, 166)","rgb(217, 70, 239)","rgb(132, 204, 22)"];return e.map((i,n)=>t[n%t.length])}var Al=C(()=>{"use strict";wl();lt.register(...Tl)});function Pl(e){if(!e)return;let t=Il(e);if(Zs=t.ruleData,K.migrations=Cl("chart-migrations",t.migrationData)||void 0,K.topRules=Js("chart-top-rules",t.ruleData,10,!1)||void 0,K.priorities=El("chart-priorities",t.priorityData)||void 0,e.projectInfo.type==="nx-monorepo"){let i=Fl(e);if(i.length>0){let n=document.getElementById("chart-targets-container");n&&(n.style.display="block",K.targets=Ll("chart-targets",i)||void 0)}}bp()}function Rl(e){let t=Il(e);Zs=t.ruleData,lp(t.migrationData),Ol(t.ruleData),hp(t.priorityData),mp(e)}function lp(e){K.migrations&&(K.migrations.data.labels=e.map(t=>t.migration.toUpperCase()),K.migrations.data.datasets[0].data=e.map(t=>t.minutes),K.migrations.update())}function Ol(e){if(!K.topRules)return;let t=Fe?20:10;if(t!==Dl){K.topRules.destroy(),K.topRules=Js("chart-top-rules",e,t,Fe)||void 0,Dl=t;return}let i=e.slice(0,t),n=Math.max(...i.map(o=>o.minutes),1),s=dp(n);K.topRules.data.labels=i.map(o=>Fe?o.summary:cp(o.summary,50)),K.topRules.data.datasets[0].data=i.map(o=>up(o.minutes,s)),K.topRules.update()}function cp(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}function dp(e){return e<60?"min":e<420?"h":"j"}function up(e,t){return t==="min"?e:t==="h"?Math.round(e/60*100)/100:Math.round(e/420*100)/100}function hp(e){K.priorities&&(K.priorities.data.labels=e.map(t=>t.priority.charAt(0).toUpperCase()+t.priority.slice(1)),K.priorities.data.datasets[0].data=e.map(t=>t.minutes),K.priorities.update())}function Il(e){return{migrationData:fp(e),ruleData:gp(e),priorityData:pp(e)}}function fp(e){let t={};return e.targets.forEach(i=>{i.migrations.forEach(n=>{t[n.migration]=(t[n.migration]||0)+n.totalTime.minutes})}),Do.filter(i=>t[i]!==void 0).map(i=>({migration:i,minutes:t[i]}))}function gp(e){let t=new Map;return e.targets.forEach(n=>{n.migrations.forEach(s=>{s.priorities.forEach(o=>{o.rules.forEach(r=>{let a=t.get(r.ruleKey);a?(a.minutes+=r.totalTime.minutes,a.occurrences+=r.occurrences):t.set(r.ruleKey,{summary:r.ruleSummary,minutes:r.totalTime.minutes,occurrences:r.occurrences})})})})}),Array.from(t.entries()).map(([n,s])=>({ruleKey:n,summary:s.summary,minutes:s.minutes,occurrences:s.occurrences})).sort((n,s)=>s.minutes-n.minutes)}function pp(e){let t={};return e.targets.forEach(n=>{n.migrations.forEach(s=>{s.priorities.forEach(o=>{t[o.priority]=(t[o.priority]||0)+o.totalTime.minutes})})}),["obligatoire","recommande","optionnelle"].filter(n=>t[n]!==void 0).map(n=>({priority:n,minutes:t[n]}))}function Fl(e){return e.targets.filter(t=>t.targetType!=="monorepo").map(t=>({targetName:t.targetName,targetType:t.targetType,minutes:t.totalTime.minutes}))}function mp(e){if(!K.targets||e.projectInfo.type!=="nx-monorepo")return;let t=Fl(e).filter(i=>i.minutes>0);K.targets.data.labels=t.map(i=>`${i.targetType==="app"?"\u{1F4E6}":"\u{1F4DA}"} ${i.targetName}`),K.targets.data.datasets[0].data=t.map(i=>i.minutes),K.targets.update()}function bp(){let e=document.getElementById("toggle-rules-details");e&&e.addEventListener("click",()=>{Fe=!Fe,e.textContent=Fe?"Voir r\xE9sum\xE9 (10 r\xE8gles)":"Voir d\xE9tails (20 r\xE8gles)",Ol(Zs)})}var K,Fe,Dl,Zs,$l=C(()=>{"use strict";Al();Ti();K={},Fe=!1,Dl=10,Zs=[]});function yp(e,t){let i=new Date(e);for(;i<=t;){let n=i.getDay();if(n===0||n===6)return!0;i=Si(i,1)}return!1}function Hl(e,t,i){let n=document.getElementById(e);if(!n)return;if(t.length===0){n.innerHTML='<p class="text-gray-500">Aucune migration \xE0 afficher</p>';return}let s=800,o=40,r=50,a=20,l=120,c=s-l-40,d=o+t.length*(r+a)+20,u=t.reduce((y,_)=>y+_.duration,0),h=t[0]?.startDate||new Date,f=t[t.length-1]?.endDate||new Date,g=xp(h,f,u,l,c,o,d),p=_p(t,u,l,c,o,r,a,i),m=Date.now(),b=`
|
|
28
|
-
<svg width="${s}" height="${d}" xmlns="http://www.w3.org/2000/svg" class="gantt-chart" data-render="${m}">
|
|
29
|
-
<style>
|
|
30
|
-
.gantt-chart { font-family: system-ui, -apple-system, sans-serif; }
|
|
31
|
-
.task-bar { cursor: pointer; transition: opacity 0.2s; }
|
|
32
|
-
.task-bar:hover { opacity: 0.9; }
|
|
33
|
-
</style>
|
|
34
|
-
${g}
|
|
35
|
-
${p}
|
|
36
|
-
</svg>
|
|
37
|
-
`;n.innerHTML=b}function xp(e,t,i,n,s,o,r){let a="";a+=`
|
|
38
|
-
<rect
|
|
39
|
-
x="${n}"
|
|
40
|
-
y="${o}"
|
|
41
|
-
width="${s}"
|
|
42
|
-
height="${r-o}"
|
|
43
|
-
fill="#f9fafb"
|
|
44
|
-
/>
|
|
45
|
-
`;let l=7;for(let c=0;c<=i;c+=l){let d=n+c/i*s;a+=`
|
|
46
|
-
<line
|
|
47
|
-
x1="${d}"
|
|
48
|
-
y1="${o}"
|
|
49
|
-
x2="${d}"
|
|
50
|
-
y2="${r}"
|
|
51
|
-
stroke="#e5e7eb"
|
|
52
|
-
stroke-width="1"
|
|
53
|
-
stroke-dasharray="4,4"
|
|
54
|
-
/>
|
|
55
|
-
`;let u=Si(e,c);a+=`
|
|
56
|
-
<text
|
|
57
|
-
x="${d}"
|
|
58
|
-
y="${o-10}"
|
|
59
|
-
fill="#6b7280"
|
|
60
|
-
font-size="12"
|
|
61
|
-
text-anchor="middle"
|
|
62
|
-
>
|
|
63
|
-
${vo(u)}
|
|
64
|
-
</text>
|
|
65
|
-
`}return a}function _p(e,t,i,n,s,o,r,a){let l="",c=0;return e.forEach((d,u)=>{let h=s+u*(o+r)+r,f=i+c/t*n,g=d.duration/t*n;l+=vp(d,f,h,g,o,a?.[u]),l+=Sp(d,f,h,g,o),l+=kp(d,h,o),c+=d.duration}),l}function vp(e,t,i,n,s,o){let r=o?Tp(o):"",a=e.startDate&&e.endDate?yp(e.startDate,e.endDate):!1;return`
|
|
66
|
-
<g class="task-bar" ${r}>
|
|
67
|
-
<rect
|
|
68
|
-
x="${t}"
|
|
69
|
-
y="${i}"
|
|
70
|
-
width="${n}"
|
|
71
|
-
height="${s}"
|
|
72
|
-
fill="${e.color}"
|
|
73
|
-
rx="6"
|
|
74
|
-
opacity="0.85"
|
|
75
|
-
/>
|
|
76
|
-
${a?Mp(t,i,n,e.color):""}
|
|
77
|
-
<text
|
|
78
|
-
x="${t+n/2}"
|
|
79
|
-
y="${i+s/2+5}"
|
|
80
|
-
text-anchor="middle"
|
|
81
|
-
fill="white"
|
|
82
|
-
font-size="14"
|
|
83
|
-
font-weight="600"
|
|
84
|
-
>
|
|
85
|
-
${e.duration.toFixed(1)}j
|
|
86
|
-
</text>
|
|
87
|
-
</g>
|
|
88
|
-
`}function Mp(e,t,i,n){return`
|
|
89
|
-
<rect
|
|
90
|
-
x="${e+i-20}"
|
|
91
|
-
y="${t+5}"
|
|
92
|
-
width="16"
|
|
93
|
-
height="16"
|
|
94
|
-
fill="white"
|
|
95
|
-
rx="3"
|
|
96
|
-
opacity="0.9"
|
|
97
|
-
/>
|
|
98
|
-
<text
|
|
99
|
-
x="${e+i-12}"
|
|
100
|
-
y="${t+16}"
|
|
101
|
-
text-anchor="middle"
|
|
102
|
-
fill="${n}"
|
|
103
|
-
font-size="10"
|
|
104
|
-
font-weight="700"
|
|
105
|
-
>
|
|
106
|
-
\u23F8
|
|
107
|
-
</text>
|
|
108
|
-
`}function Sp(e,t,i,n,s){if(!e.startDate||!e.endDate)return"";let o=Cn(e.startDate),r=Cn(e.endDate);return`
|
|
109
|
-
<text
|
|
110
|
-
x="${t}"
|
|
111
|
-
y="${i+s+15}"
|
|
112
|
-
fill="#6b7280"
|
|
113
|
-
font-size="11"
|
|
114
|
-
class="task-start-date"
|
|
115
|
-
>
|
|
116
|
-
${o}
|
|
117
|
-
</text>
|
|
118
|
-
<text
|
|
119
|
-
x="${t+n}"
|
|
120
|
-
y="${i+s+15}"
|
|
121
|
-
text-anchor="end"
|
|
122
|
-
fill="#6b7280"
|
|
123
|
-
font-size="11"
|
|
124
|
-
class="task-end-date"
|
|
125
|
-
>
|
|
126
|
-
${r}
|
|
127
|
-
</text>
|
|
128
|
-
`}function kp(e,t,i){return`
|
|
129
|
-
<text
|
|
130
|
-
x="10"
|
|
131
|
-
y="${t+i/2+5}"
|
|
132
|
-
fill="#374151"
|
|
133
|
-
font-size="14"
|
|
134
|
-
font-weight="500"
|
|
135
|
-
>
|
|
136
|
-
${e.label}
|
|
137
|
-
</text>
|
|
138
|
-
`}function Tp(e){return`
|
|
139
|
-
data-migration="${e.migration}"
|
|
140
|
-
data-routine-minutes="${e.routineMinutes}"
|
|
141
|
-
data-parallelizable-minutes="${e.parallelizableMinutes}"
|
|
142
|
-
data-total-minutes-before="${e.totalMinutesBeforeDevs}"
|
|
143
|
-
data-total-days-after="${e.totalDaysAfterDevs}"
|
|
144
|
-
data-dev-count="${e.devCount}"
|
|
145
|
-
data-hours-per-day="${e.hoursPerDay}"
|
|
146
|
-
`.trim()}var zl=C(()=>{"use strict";tt()});function Bl(){let e=document.getElementById("gantt-tooltip");e||(e=document.createElement("div"),e.id="gantt-tooltip",e.className="gantt-tooltip",e.style.cssText=`
|
|
147
|
-
position: fixed;
|
|
148
|
-
display: none;
|
|
149
|
-
background: white;
|
|
150
|
-
border: 1px solid #e5e7eb;
|
|
151
|
-
border-radius: 8px;
|
|
152
|
-
padding: 12px 16px;
|
|
153
|
-
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
|
|
154
|
-
z-index: 9999;
|
|
155
|
-
pointer-events: none;
|
|
156
|
-
max-width: 350px;
|
|
157
|
-
font-size: 13px;
|
|
158
|
-
line-height: 1.5;
|
|
159
|
-
`,document.body.appendChild(e)),wp()}function wp(){document.querySelectorAll(".task-bar").forEach(t=>{t.addEventListener("mouseenter",i=>Cp(i,t)),t.addEventListener("mousemove",Ep),t.addEventListener("mouseleave",Lp)})}function Cp(e,t){let i=document.getElementById("gantt-tooltip");if(!i)return;let n=t.dataset.migration||"N/A",s=parseFloat(t.dataset.routineMinutes||"0"),o=parseFloat(t.dataset.parallelizableMinutes||"0"),r=parseFloat(t.dataset.totalMinutesBefore||"0"),a=parseFloat(t.dataset.totalDaysAfter||"0"),l=parseInt(t.dataset.devCount||"1",10),c=parseFloat(t.dataset.hoursPerDay||"7"),d=$(s,c),u=$(o,c),h=$(r,c);i.innerHTML=`
|
|
160
|
-
<div style="margin-bottom: 8px;">
|
|
161
|
-
<strong style="color: #1f2937; font-size: 14px;">${n}</strong>
|
|
162
|
-
</div>
|
|
163
|
-
<div style="color: #6b7280; margin-bottom: 6px;">
|
|
164
|
-
<strong>Temps initial :</strong> ${U(h)}
|
|
165
|
-
</div>
|
|
166
|
-
<div style="margin: 8px 0; padding: 8px; background: #f9fafb; border-radius: 4px;">
|
|
167
|
-
<div style="margin-bottom: 4px;">
|
|
168
|
-
\u{1F512} <strong>S\xE9quentiel :</strong> ${U(d)}
|
|
169
|
-
<span style="color: #6b7280; font-size: 12px;">(obligatoires \u{1F534} uniquement)</span>
|
|
170
|
-
</div>
|
|
171
|
-
<div>
|
|
172
|
-
\u26A1 <strong>Parall\xE9lisable :</strong> ${U(u)}
|
|
173
|
-
<span style="color: #6b7280; font-size: 12px;">(routines + recommand\xE9es \u{1F7E1} + optionnelles \u{1F7E2})</span>
|
|
174
|
-
${l>1?`<br><span style="color: #6b7280; font-size: 12px;">\u2192 \xF7 ${l} dev${l>1?"s":""} = ${U($(o/l,c))}</span>`:""}
|
|
175
|
-
</div>
|
|
176
|
-
</div>
|
|
177
|
-
<div style="margin-top: 8px; padding-top: 8px; border-top: 1px solid #e5e7eb; color: #059669; font-weight: 600;">
|
|
178
|
-
\u{1F4C5} <strong>Dur\xE9e finale :</strong> ${a.toFixed(1)}j
|
|
179
|
-
${l>1?`<span style="color: #6b7280; font-weight: normal; font-size: 12px;">(${l} dev${l>1?"s":""})</span>`:""}
|
|
180
|
-
</div>
|
|
181
|
-
`,i.style.display="block",Wl(i,e)}function Ep(e){let t=document.getElementById("gantt-tooltip");if(!t||t.style.display==="none")return;Wl(t,e)}function Lp(){let e=document.getElementById("gantt-tooltip");e&&(e.style.display="none")}function Wl(e,t){let s=t.clientX+15,o=t.clientY+15,r=e.getBoundingClientRect(),a=window.innerWidth,l=window.innerHeight;s+r.width>a&&(s=t.clientX-r.width-15),o+r.height>l&&(o=t.clientY-r.height-15),e.style.left=`${s}px`,e.style.top=`${o}px`}var Nl=C(()=>{"use strict";tt()});function Vl(e){return`
|
|
48
|
+
`):e}function qg(e,t){let{element:i,datasetIndex:n,index:s}=t,o=e.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(s);return{chart:e,label:r,parsed:o.getParsed(s),raw:e.data.datasets[n].data[s],formattedValue:a,dataset:o.getDataset(),dataIndex:s,datasetIndex:n,element:i}}function el(e,t){let i=e.chart.ctx,{body:n,footer:s,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=Z(t.bodyFont),c=Z(t.titleFont),d=Z(t.footerFont),u=o.length,h=s.length,f=n.length,g=nt(t.padding),p=g.height,m=0,b=n.reduce((v,x)=>v+x.before.length+x.lines.length+x.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,u&&(p+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),b){let v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}h&&(p+=t.footerMarginTop+h*d.lineHeight+(h-1)*t.footerSpacing);let y=0,_=function(v){m=Math.max(m,i.measureText(v).width+y)};return i.save(),i.font=c.string,H(e.title,_),i.font=l.string,H(e.beforeBody.concat(e.afterBody),_),y=t.displayColors?r+2+t.boxPadding:0,H(n,v=>{H(v.before,_),H(v.lines,_),H(v.after,_)}),y=0,i.font=d.string,H(e.footer,_),i.restore(),m+=g.width,{width:m,height:p}}function Yg(e,t){let{y:i,height:n}=t;return i<n/2?"top":i>e.height-n/2?"bottom":"center"}function Gg(e,t,i,n){let{x:s,width:o}=n,r=i.caretSize+i.caretPadding;if(e==="left"&&s+o+r>t.width||e==="right"&&s-o-r<0)return!0}function Ug(e,t,i,n){let{x:s,width:o}=i,{width:r,chartArea:{left:a,right:l}}=e,c="center";return n==="center"?c=s<=(a+l)/2?"left":"right":s<=o/2?c="left":s>=r-o/2&&(c="right"),Gg(c,e,t,i)&&(c="center"),c}function il(e,t,i){let n=i.yAlign||t.yAlign||Yg(e,i);return{xAlign:i.xAlign||t.xAlign||Ug(e,t,i,n),yAlign:n}}function Kg(e,t){let{x:i,width:n}=e;return t==="right"?i-=n:t==="center"&&(i-=n/2),i}function Xg(e,t,i){let{y:n,height:s}=e;return t==="top"?n+=i:t==="bottom"?n-=s+i:n-=s/2,n}function nl(e,t,i,n){let{caretSize:s,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=i,c=s+o,{topLeft:d,topRight:u,bottomLeft:h,bottomRight:f}=Nt(r),g=Kg(t,a),p=Xg(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(d,h)+s:a==="right"&&(g+=Math.max(u,f)+s),{x:Q(g,0,n.width-t.width),y:Q(p,0,n.height-t.height)}}function dn(e,t,i){let n=nt(i.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-n.right:e.x+n.left}function sl(e){return Tt([],Ot(e))}function Jg(e,t,i){return Rt(e,{tooltip:t,tooltipItems:i,type:"tooltip"})}function ol(e,t){let i=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return i?e.override(i):e}function dt(e,t,i,n){let s=e[t].call(i,n);return typeof s>"u"?Ol[t].call(i,n):s}function ep(e,t,i,n){let s=e.indexOf(t);if(s===-1)return tp(e,t,i,n);let o=e.lastIndexOf(t);return s!==o?i:s}function rl(e){let t=this.getLabels();return e>=0&&e<t.length?t[e]:e}function np(e,t){let i=[],{bounds:s,step:o,min:r,max:a,precision:l,count:c,maxTicks:d,maxDigits:u,includeBounds:h}=e,f=o||1,g=d-1,{min:p,max:m}=t,b=!P(r),y=!P(a),_=!P(c),v=(m-p)/(u+1),x=as((m-p)/g/f)*f,S,k,T,w;if(x<1e-14&&!b&&!y)return[{value:p},{value:m}];w=Math.ceil(m/x)-Math.floor(p/x),w>g&&(x=as(w*x/g/f)*f),P(l)||(S=Math.pow(10,l),x=Math.ceil(x*S)/S),s==="ticks"?(k=Math.floor(p/x)*x,T=Math.ceil(m/x)*x):(k=p,T=m),b&&y&&o&&Yr((a-r)/o,x/1e3)?(w=Math.round(Math.min((a-r)/x,d)),x=(a-r)/w,k=r,T=a):_?(k=b?r:k,T=y?a:T,w=c-1,x=(T-k)/w):(w=(T-k)/x,ve(w,Math.round(w),x/1e3)?w=Math.round(w):w=Math.ceil(w));let L=Math.max(cs(x),cs(k));S=Math.pow(10,P(l)?L:l),k=Math.round(k*S)/S,T=Math.round(T*S)/S;let A=0;for(b&&(h&&k!==r?(i.push({value:r}),k<r&&A++,ve(Math.round((k+A*x)*S)/S,r,al(r,v,e))&&A++):k<r&&A++);A<w;++A){let I=Math.round((k+A*x)*S)/S;if(y&&I>a)break;i.push({value:I})}return y&&h&&T!==a?i.length&&ve(i[i.length-1].value,a,al(a,v,e))?i[i.length-1].value=a:i.push({value:a}):(!y||T===a)&&i.push({value:T}),i}function al(e,t,{horizontal:i,minRotation:n}){let s=bt(n),o=(i?Math.sin(s):Math.cos(s))||.001,r=.75*t*(""+e).length;return Math.min(t/o,r)}function ll(e){return e/Math.pow(10,yi(e))===1}function cl(e,t,i){let n=Math.pow(10,i),s=Math.floor(e/n);return Math.ceil(t/n)-s}function sp(e,t){let i=t-e,n=yi(i);for(;cl(e,t,n)>10;)n++;for(;cl(e,t,n)<10;)n--;return Math.min(n,yi(e))}function op(e,{min:t,max:i}){t=ct(e.min,t);let n=[],s=yi(t),o=sp(t,i),r=o<0?Math.pow(10,Math.abs(o)):1,a=Math.pow(10,o),l=s>o?Math.pow(10,s):0,c=Math.round((t-l)*r)/r,d=Math.floor((t-l)/a/10)*a*10,u=Math.floor((c-d)/Math.pow(10,o)),h=ct(e.min,Math.round((l+d+u*Math.pow(10,o))*r)/r);for(;h<i;)n.push({value:h,major:ll(h),significand:u}),u>=10?u=u<15?15:20:u++,u>=20&&(o++,u=2,r=o>=0?1:r),h=Math.round((l+d+u*Math.pow(10,o))*r)/r;let f=ct(e.max,h);return n.push({value:f,major:ll(f),significand:u}),n}function no(e){let t=e.ticks;if(t.display&&e.display){let i=nt(t.backdropPadding);return E(t.font&&t.font.size,j.font.size)+i.height}return 0}function rp(e,t,i){return i=V(i)?i:[i],{w:ea(e,t.string,i),h:i.length*t.lineHeight}}function dl(e,t,i,n,s){return e===n||e===s?{start:t-i/2,end:t+i/2}:e<n||e>s?{start:t-i,end:t}:{start:t,end:t+i}}function ap(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},i=Object.assign({},t),n=[],s=[],o=e._pointLabels.length,r=e.options.pointLabels,a=r.centerPointLabels?F/o:0;for(let l=0;l<o;l++){let c=r.setContext(e.getPointLabelContext(l));s[l]=c.padding;let d=e.getPointPosition(l,e.drawingArea+s[l],a),u=Z(c.font),h=rp(e.ctx,u,e._pointLabels[l]);n[l]=h;let f=et(e.getIndexAngle(l)+a),g=Math.round(Ki(f)),p=dl(g,d.x,h.w,0,180),m=dl(g,d.y,h.h,90,270);lp(i,t,f,p,m)}e.setCenterPoint(t.l-i.l,i.r-t.r,t.t-i.t,i.b-t.b),e._pointLabelItems=up(e,n,s)}function lp(e,t,i,n,s){let o=Math.abs(Math.sin(i)),r=Math.abs(Math.cos(i)),a=0,l=0;n.start<t.l?(a=(t.l-n.start)/o,e.l=Math.min(e.l,t.l-a)):n.end>t.r&&(a=(n.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),s.start<t.t?(l=(t.t-s.start)/r,e.t=Math.min(e.t,t.t-l)):s.end>t.b&&(l=(s.end-t.b)/r,e.b=Math.max(e.b,t.b+l))}function cp(e,t,i){let n=e.drawingArea,{extra:s,additionalAngle:o,padding:r,size:a}=i,l=e.getPointPosition(t,n+s+r,o),c=Math.round(Ki(et(l.angle+U))),d=gp(l.y,a.h,c),u=hp(c),h=fp(l.x,a.w,u);return{visible:!0,x:l.x,y:d,textAlign:u,left:h,top:d,right:h+a.w,bottom:d+a.h}}function dp(e,t){if(!t)return!0;let{left:i,top:n,right:s,bottom:o}=e;return!(Mt({x:i,y:n},t)||Mt({x:i,y:o},t)||Mt({x:s,y:n},t)||Mt({x:s,y:o},t))}function up(e,t,i){let n=[],s=e._pointLabels.length,o=e.options,{centerPointLabels:r,display:a}=o.pointLabels,l={extra:no(o)/2,additionalAngle:r?F/s:0},c;for(let d=0;d<s;d++){l.padding=i[d],l.size=t[d];let u=cp(e,d,l);n.push(u),a==="auto"&&(u.visible=dp(u,c),u.visible&&(c=u))}return n}function hp(e){return e===0||e===180?"center":e<180?"left":"right"}function fp(e,t,i){return i==="right"?e-=t:i==="center"&&(e-=t/2),e}function gp(e,t,i){return i===90||i===270?e-=t/2:(i>270||i<90)&&(e-=t),e}function pp(e,t,i){let{left:n,top:s,right:o,bottom:r}=i,{backdropColor:a}=t;if(!P(a)){let l=Nt(t.borderRadius),c=nt(t.backdropPadding);e.fillStyle=a;let d=n-c.left,u=s-c.top,h=o-n+c.width,f=r-s+c.height;Object.values(l).some(g=>g!==0)?(e.beginPath(),ke(e,{x:d,y:u,w:h,h:f,radius:l}),e.fill()):e.fillRect(d,u,h,f)}}function mp(e,t){let{ctx:i,options:{pointLabels:n}}=e;for(let s=t-1;s>=0;s--){let o=e._pointLabelItems[s];if(!o.visible)continue;let r=n.setContext(e.getPointLabelContext(s));pp(i,r,o);let a=Z(r.font),{x:l,y:c,textAlign:d}=o;Vt(i,e._pointLabels[s],l,c+a.lineHeight/2,a,{color:r.color,textAlign:d,textBaseline:"middle"})}}function Il(e,t,i,n){let{ctx:s}=e;if(i)s.arc(e.xCenter,e.yCenter,t,0,N);else{let o=e.getPointPosition(0,t);s.moveTo(o.x,o.y);for(let r=1;r<n;r++)o=e.getPointPosition(r,t),s.lineTo(o.x,o.y)}}function bp(e,t,i,n,s){let o=e.ctx,r=t.circular,{color:a,lineWidth:l}=t;!r&&!n||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(s.dash||[]),o.lineDashOffset=s.dashOffset,o.beginPath(),Il(e,i,r,n),o.closePath(),o.stroke(),o.restore())}function yp(e,t,i){return Rt(e,{label:i,index:t,type:"pointLabel"})}function ul(e,t){return e-t}function hl(e,t){if(P(t))return null;let i=e._adapter,{parser:n,round:s,isoWeekday:o}=e._parseOpts,r=t;return typeof n=="function"&&(r=n(r)),Y(r)||(r=typeof n=="string"?i.parse(r,n):i.parse(r)),r===null?null:(s&&(r=s==="week"&&(ee(o)||o===!0)?i.startOf(r,"isoWeek",o):i.startOf(r,s)),+r)}function fl(e,t,i,n){let s=ut.length;for(let o=ut.indexOf(e);o<s-1;++o){let r=vn[ut[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((i-t)/(a*r.size))<=n)return ut[o]}return ut[s-1]}function xp(e,t,i,n,s){for(let o=ut.length-1;o>=ut.indexOf(i);o--){let r=ut[o];if(vn[r].common&&e._adapter.diff(s,n,r)>=t-1)return r}return ut[i?ut.indexOf(i):0]}function _p(e){for(let t=ut.indexOf(e)+1,i=ut.length;t<i;++t)if(vn[ut[t]].common)return ut[t]}function gl(e,t,i){if(!i)e[t]=!0;else if(i.length){let{lo:n,hi:s}=Xi(i,t),o=i[n]>=t?i[n]:i[s];e[o]=!0}}function vp(e,t,i,n){let s=e._adapter,o=+s.startOf(t[0].value,n),r=t[t.length-1].value,a,l;for(a=o;a<=r;a=+s.add(a,1,n))l=i[a],l>=0&&(t[l].major=!0);return t}function pl(e,t,i){let n=[],s={},o=t.length,r,a;for(r=0;r<o;++r)a=t[r],s[a]=r,n.push({value:a,major:!1});return o===0||!i?n:vp(e,n,s,i)}function un(e,t,i){let n=0,s=e.length-1,o,r,a,l;i?(t>=e[n].pos&&t<=e[s].pos&&({lo:n,hi:s}=vt(e,"pos",t)),{pos:o,time:a}=e[n],{pos:r,time:l}=e[s]):(t>=e[n].time&&t<=e[s].time&&({lo:n,hi:s}=vt(e,"time",t)),{time:o,pos:a}=e[n],{time:r,pos:l}=e[s]);let c=r-o;return c?a+(l-a)*(t-o)/c:a}var js,Pt,ba,ch,qs,gn,Is,Ma,_h,gt,Ce,Ee,It,Le,ae,li,Ae,De,Rh,Ys,Ph,Hh,yl,ot,pn,Gs,hn,Yh,Aa,_l,mi,Da,Us,pt,uf,Ra,Pa,ce,Oe,Ks,wt,Xs,Ha,kl,ai,Qs,Df,Pf,Of,fn,Na,lt,oe,Jf,Ct,Re,Pe,sg,eo,Ya,ug,pg,yn,Ig,tl,Fg,xn,Bg,bi,Ng,cn,jg,di,Ol,pi,Zg,Qg,tp,ip,ui,Ie,hi,yi,se,fi,re,vn,ut,le,gi,Mp,Fl,$l=C(()=>{ma();js=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,i,n,s){let o=i.listeners[s],r=i.duration;o.forEach(a=>a({chart:t,initial:i.initial,numSteps:r,currentStep:Math.min(n-i.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=fs.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let i=0;this._charts.forEach((n,s)=>{if(!n.running||!n.items.length)return;let o=n.items,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),i+=o.length}),this._lastDate=t,i===0&&(this._running=!1)}_getAnims(t){let i=this._charts,n=i.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},i.set(t,n)),n}listen(t,i,n){this._getAnims(t).listeners[i].push(n)}add(t,i){!i||!i.length||this._getAnims(t).items.push(...i)}has(t){return this._getAnims(t).items.length>0}start(t){let i=this._charts.get(t);i&&(i.running=!0,i.start=Date.now(),i.duration=i.items.reduce((n,s)=>Math.max(n,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;let i=this._charts.get(t);return!(!i||!i.running||!i.items.length)}stop(t){let i=this._charts.get(t);if(!i||!i.items.length)return;let n=i.items,s=n.length-1;for(;s>=0;--s)n[s].cancel();i.items=[],this._notify(t,i,Date.now(),"complete")}remove(t){return this._charts.delete(t)}},Pt=new js,ba="transparent",ch={boolean(e,t,i){return i>.5?t:e},color(e,t,i){let n=ys(e||ba),s=n.valid&&ys(t||ba);return s&&s.valid?s.mix(n,i).hexString():t},number(e,t,i){return e+(t-e)*i}},qs=class{constructor(t,i,n,s){let o=i[n];s=Te([t.to,s,o,t.from]);let r=Te([t.from,o,s]);this._active=!0,this._fn=t.fn||ch[t.type||typeof r],this._easing=me[t.easing]||me.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=i,this._prop=n,this._from=r,this._to=s,this._promises=void 0}active(){return this._active}update(t,i,n){if(this._active){this._notify(!1);let 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=Te([t.to,i,s,t.from]),this._from=Te([t.from,s,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let i=t-this._start,n=this._duration,s=this._prop,o=this._from,r=this._loop,a=this._to,l;if(this._active=o!==a&&(r||i<n),!this._active){this._target[s]=a,this._notify(!0);return}if(i<0){this._target[s]=o;return}l=i/n%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(o,a,l)}wait(){let t=this._promises||(this._promises=[]);return new Promise((i,n)=>{t.push({res:i,rej:n})})}_notify(t){let i=t?"res":"rej",n=this._promises||[];for(let s=0;s<n.length;s++)n[s][i]()}},gn=class{constructor(t,i){this._chart=t,this._properties=new Map,this.configure(i)}configure(t){if(!O(t))return;let i=Object.keys(j.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{let o=t[s];if(!O(o))return;let r={};for(let a of i)r[a]=o[a];(V(o.properties)&&o.properties||[s]).forEach(a=>{(a===s||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,i){let n=i.options,s=uh(t,n);if(!s)return[];let o=this._createAnimations(s,n);return n.$shared&&dh(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,i){let n=this._properties,s=[],o=t.$animations||(t.$animations={}),r=Object.keys(i),a=Date.now(),l;for(l=r.length-1;l>=0;--l){let c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,i));continue}let d=i[c],u=o[c],h=n.get(c);if(u)if(h&&u.active()){u.update(h,d,a);continue}else u.cancel();if(!h||!h.duration){t[c]=d;continue}o[c]=u=new qs(h,t,c,d),s.push(u)}return s}update(t,i){if(this._properties.size===0){Object.assign(t,i);return}let n=this._createAnimations(t,i);if(n.length)return Pt.add(this._chart,n),!0}};Is=e=>e==="reset"||e==="none",Ma=(e,t)=>t?e:Object.assign({},e),_h=(e,t,i)=>e&&!t.hidden&&t._stacked&&{keys:ml(i,!0),values:null},gt=class{constructor(t,i){this.chart=t,this._ctx=t.ctx,this.index=i,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(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ps(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&&ni(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,i=this._cachedMeta,n=this.getDataset(),s=(u,h,f,g)=>u==="x"?h:u==="r"?g:f,o=i.xAxisID=E(n.xAxisID,Os(t,"x")),r=i.yAxisID=E(n.yAxisID,Os(t,"y")),a=i.rAxisID=E(n.rAxisID,Os(t,"r")),l=i.indexAxis,c=i.iAxisID=s(l,o,r,a),d=i.vAxisID=s(l,r,o,a);i.xScale=this.getScaleForId(o),i.yScale=this.getScaleForId(r),i.rScale=this.getScaleForId(a),i.iScale=this.getScaleForId(c),i.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let i=this._cachedMeta;return t===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&us(this._data,this),t._stacked&&ni(t)}_dataCheck(){let t=this.getDataset(),i=t.data||(t.data=[]),n=this._data;if(O(i)){let s=this._cachedMeta;this._data=gh(i,s)}else if(n!==i){if(n){us(n,this);let s=this._cachedMeta;ni(s),s._parsed=[]}i&&Object.isExtensible(i)&&Jr(i,this),this._syncList=[],this._data=i}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let i=this._cachedMeta,n=this.getDataset(),s=!1;this._dataCheck();let o=i._stacked;i._stacked=Ps(i.vScale,i),i.stack!==n.stack&&(s=!0,ni(i),i.stack=n.stack),this._resyncElements(t),(s||o!==i._stacked)&&(va(this,i._parsed),i._stacked=Ps(i.vScale,i))}configure(){let t=this.chart.config,i=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),i,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){let{_cachedMeta:n,_data:s}=this,{iScale:o,_stacked:r}=n,a=o.axis,l=t===0&&i===s.length?!0:n._sorted,c=t>0&&n._parsed[t-1],d,u,h;if(this._parsing===!1)n._parsed=s,n._sorted=!0,h=s;else{V(s[t])?h=this.parseArrayData(n,s,t,i):O(s[t])?h=this.parseObjectData(n,s,t,i):h=this.parsePrimitiveData(n,s,t,i);let f=()=>u[a]===null||c&&u[a]<c[a];for(d=0;d<i;++d)n._parsed[d+t]=u=h[d],l&&(f()&&(l=!1),c=u);n._sorted=l}r&&va(this,h)}parsePrimitiveData(t,i,n,s){let{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),d=o===r,u=new Array(s),h,f,g;for(h=0,f=s;h<f;++h)g=h+n,u[h]={[a]:d||o.parse(c[g],g),[l]:r.parse(i[g],g)};return u}parseArrayData(t,i,n,s){let{xScale:o,yScale:r}=t,a=new Array(s),l,c,d,u;for(l=0,c=s;l<c;++l)d=l+n,u=i[d],a[l]={x:o.parse(u[0],d),y:r.parse(u[1],d)};return a}parseObjectData(t,i,n,s){let{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s),d,u,h,f;for(d=0,u=s;d<u;++d)h=d+n,f=i[h],c[d]={x:o.parse(Dt(f,a),h),y:r.parse(Dt(f,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,i,n){let s=this.chart,o=this._cachedMeta,r=i[t.axis],a={keys:ml(s,!0),values:i._stacks[t.axis]._visualValues};return xa(a,r,o.index,{mode:n})}updateRangeFromParsed(t,i,n,s){let o=n[i.axis],r=o===null?NaN:o,a=s&&n._stacks[i.axis];s&&a&&(s.values=a,r=xa(s,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,i){let n=this._cachedMeta,s=n._parsed,o=n._sorted&&t===n.iScale,r=s.length,a=this._getOtherScale(t),l=_h(i,n,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=mh(a),h,f;function g(){f=s[h];let p=f[a.axis];return!Y(f[t.axis])||d>p||u<p}for(h=0;h<r&&!(!g()&&(this.updateRangeFromParsed(c,t,f,l),o));++h);if(o){for(h=r-1;h>=0;--h)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){let i=this._cachedMeta._parsed,n=[],s,o,r;for(s=0,o=i.length;s<o;++s)r=i[s][t.axis],Y(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){let i=this._cachedMeta,n=i.iScale,s=i.vScale,o=this.getParsed(t);return{label:n?""+n.getLabelForValue(o[n.axis]):"",value:s?""+s.getLabelForValue(o[s.axis]):""}}_update(t){let i=this._cachedMeta;this.update(t||"default"),i._clip=fh(E(this.options.clip,hh(i.xScale,i.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,i=this.chart,n=this._cachedMeta,s=n.data||[],o=i.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop,d;for(n.dataset&&n.dataset.draw(t,o,a,l),d=a;d<a+l;++d){let u=s[d];u.hidden||(u.active&&c?r.push(u):u.draw(t,o))}for(d=0;d<r.length;++d)r[d].draw(t,o)}getStyle(t,i){let n=i?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,i,n){let s=this.getDataset(),o;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];o=r.$context||(r.$context=xh(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=s.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=yh(this.chart.getContext(),this.index)),o.dataset=s,o.index=o.datasetIndex=this.index;return o.active=!!i,o.mode=n,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,i){return this._resolveElementOptions(this.dataElementType.id,i,t)}_resolveElementOptions(t,i="default",n){let s=i==="active",o=this._cachedDataOpts,r=t+"-"+i,a=o[r],l=this.enableOptionSharing&&_e(n);if(a)return Ma(a,l);let c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),u=s?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),d),f=Object.keys(j.elements[t]),g=()=>this.getContext(n,s,i),p=c.resolveNamedOptions(h,f,g,u);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(Ma(p,l))),p}_resolveAnimations(t,i,n){let s=this.chart,o=this._cachedDataOpts,r=`animation-${i}`,a=o[r];if(a)return a;let l;if(s.options.animation!==!1){let d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,i),h=d.getOptionScopes(this.getDataset(),u);l=d.createResolver(h,this.getContext(t,n,i))}let c=new gn(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,i){return!i||Is(t)||this.chart._animationsDisabled}_getSharedOptions(t,i){let n=this.resolveDataElementOptions(t,i),s=this._sharedOptions,o=this.getSharedOptions(n),r=this.includeOptions(i,o)||o!==s;return this.updateSharedOptions(o,i,n),{sharedOptions:o,includeOptions:r}}updateElement(t,i,n,s){Is(s)?Object.assign(t,n):this._resolveAnimations(i,s).update(t,n)}updateSharedOptions(t,i,n){t&&!Is(i)&&this._resolveAnimations(void 0,i).update(t,n)}_setStyle(t,i,n,s){t.active=s;let o=this.getStyle(i,s);this._resolveAnimations(i,n,s).update(t,{options:!s&&this.getSharedOptions(o)||o})}removeHoverStyle(t,i,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,i,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let i=this._data,n=this._cachedMeta.data;for(let[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];let s=n.length,o=i.length,r=Math.min(o,s);r&&this.parse(0,r),o>s?this._insertElements(s,o-s,t):o<s&&this._removeElements(o,s-o)}_insertElements(t,i,n=!0){let s=this._cachedMeta,o=s.data,r=t+i,a,l=c=>{for(c.length+=i,a=c.length-1;a>=r;a--)c[a]=c[a-i]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,i),n&&this.updateElements(o,t,i,"reset")}updateElements(t,i,n,s){}_removeElements(t,i){let n=this._cachedMeta;if(this._parsing){let s=n._parsed.splice(t,i);n._stacked&&ni(n,s)}n.data.splice(t,i)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[i,n,s]=t;this[i](n,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,i){i&&this._sync(["_removeElements",t,i]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}};M(gt,"defaults",{}),M(gt,"datasetElementType",null),M(gt,"dataElementType",null);Ce=class extends gt{parsePrimitiveData(t,i,n,s){return Sa(t,i,n,s)}parseArrayData(t,i,n,s){return Sa(t,i,n,s)}parseObjectData(t,i,n,s){let{iScale:o,vScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?a:l,d=r.axis==="x"?a:l,u=[],h,f,g,p;for(h=n,f=n+s;h<f;++h)p=i[h],g={},g[o.axis]=o.parse(Dt(p,c),h),u.push(bl(Dt(p,d),g,r,h));return u}updateRangeFromParsed(t,i,n,s){super.updateRangeFromParsed(t,i,n,s);let o=n._custom;o&&i===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let i=this._cachedMeta,{iScale:n,vScale:s}=i,o=this.getParsed(t),r=o._custom,a=Fs(r)?"["+r.start+", "+r.end+"]":""+s.getLabelForValue(o[s.axis]);return{label:""+n.getLabelForValue(o[n.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let i=this._cachedMeta;this.updateElements(i.data,0,i.data.length,t)}updateElements(t,i,n,s){let o=s==="reset",{index:r,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:h}=this._getSharedOptions(i,s);for(let f=i;f<i+n;f++){let g=this.getParsed(f),p=o||P(g[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),m=this._calculateBarIndexPixels(f,d),b=(g._stacks||{})[a.axis],y={horizontal:c,base:p.base,enableBorderRadius:!b||Fs(g._custom)||r===b._top||r===b._bottom,x:c?p.head:m.center,y:c?m.center:p.head,height:c?m.size:Math.abs(p.size),width:c?Math.abs(p.size):m.size};h&&(y.options=u||this.resolveDataElementOptions(f,t[f].active?"active":s));let _=y.options||t[f].options;Eh(y,_,b,r),Ah(y,_,d.ratio),this.updateElement(t[f],f,y,s)}}_getStacks(t,i){let{iScale:n}=this._cachedMeta,s=n.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),o=n.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(i),l=a&&a[n.axis],c=d=>{let u=d._parsed.find(f=>f[n.axis]===l),h=u&&u[d.vScale.axis];if(P(h)||isNaN(h))return!0};for(let d of s)if(!(i!==void 0&&c(d))&&((o===!1||r.indexOf(d.stack)===-1||o===void 0&&d.stack===void 0)&&r.push(d.stack),d.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,i=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===i).shift()}_getAxis(){let t={},i=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)t[E(this.chart.options.indexAxis==="x"?n.xAxisID:n.yAxisID,i)]=!0;return Object.keys(t)}_getStackIndex(t,i,n){let s=this._getStacks(t,n),o=i!==void 0?s.indexOf(i):-1;return o===-1?s.length-1:o}_getRuler(){let t=this.options,i=this._cachedMeta,n=i.iScale,s=[],o,r;for(o=0,r=i.data.length;o<r;++o)s.push(n.getPixelForValue(this.getParsed(o)[n.axis],o));let a=t.barThickness;return{min:a||Mh(i),pixels:s,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:i,_stacked:n,index:s},options:{base:o,minBarLength:r}}=this,a=o||0,l=this.getParsed(t),c=l._custom,d=Fs(c),u=l[i.axis],h=0,f=n?this.applyStack(i,l,n):u,g,p;f!==u&&(h=f-u,f=u),d&&(u=c.barStart,f=c.barEnd-c.barStart,u!==0&&xt(u)!==xt(c.barEnd)&&(h=0),h+=u);let m=!P(o)&&!d?o:h,b=i.getPixelForValue(m);if(this.chart.getDataVisibility(t)?g=i.getPixelForValue(h+f):g=b,p=g-b,Math.abs(p)<r){p=wh(p,i,a)*r,u===a&&(b-=p/2);let y=i.getPixelForDecimal(0),_=i.getPixelForDecimal(1),v=Math.min(y,_),x=Math.max(y,_);b=Math.max(Math.min(b,x),v),g=b+p,n&&!d&&(l._stacks[i.axis]._visualValues[s]=i.getValueForPixel(g)-i.getValueForPixel(b))}if(b===i.getPixelForValue(a)){let y=xt(p)*i.getLineWidthForValue(a)/2;b+=y,p-=y}return{size:p,base:b,head:g,center:g+p/2}}_calculateBarIndexPixels(t,i){let n=i.scale,s=this.options,o=s.skipNull,r=E(s.maxBarThickness,1/0),a,l,c=this._getAxisCount();if(i.grouped){let d=o?this._getStackCount(t):i.stackCount,u=s.barThickness==="flex"?kh(t,i,s,d*c):Sh(t,i,s,d*c),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(E(h,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+f;a=u.start+u.chunk*g+u.chunk/2,l=Math.min(r,u.chunk*u.ratio)}else a=n.getPixelForValue(this.getParsed(t)[n.axis],t),l=Math.min(r,i.min*i.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){let t=this._cachedMeta,i=t.vScale,n=t.data,s=n.length,o=0;for(;o<s;++o)this.getParsed(o)[i.axis]!==null&&!n[o].hidden&&n[o].draw(this._ctx)}};M(Ce,"id","bar"),M(Ce,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),M(Ce,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});Ee=class extends gt{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,i,n,s){let o=super.parsePrimitiveData(t,i,n,s);for(let r=0;r<o.length;r++)o[r]._custom=this.resolveDataElementOptions(r+n).radius;return o}parseArrayData(t,i,n,s){let o=super.parseArrayData(t,i,n,s);for(let r=0;r<o.length;r++){let a=i[n+r];o[r]._custom=E(a[2],this.resolveDataElementOptions(r+n).radius)}return o}parseObjectData(t,i,n,s){let o=super.parseObjectData(t,i,n,s);for(let r=0;r<o.length;r++){let a=i[n+r];o[r]._custom=E(a&&a.r&&+a.r,this.resolveDataElementOptions(r+n).radius)}return o}getMaxOverflow(){let t=this._cachedMeta.data,i=0;for(let n=t.length-1;n>=0;--n)i=Math.max(i,t[n].size(this.resolveDataElementOptions(n))/2);return i>0&&i}getLabelAndValue(t){let i=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=i,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){let i=this._cachedMeta.data;this.updateElements(i,0,i.length,t)}updateElements(t,i,n,s){let o=s==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(i,s),d=r.axis,u=a.axis;for(let h=i;h<i+n;h++){let f=t[h],g=!o&&this.getParsed(h),p={},m=p[d]=o?r.getPixelForDecimal(.5):r.getPixelForValue(g[d]),b=p[u]=o?a.getBasePixel():a.getPixelForValue(g[u]);p.skip=isNaN(m)||isNaN(b),c&&(p.options=l||this.resolveDataElementOptions(h,f.active?"active":s),o&&(p.options.radius=0)),this.updateElement(f,h,p,s)}}resolveDataElementOptions(t,i){let n=this.getParsed(t),s=super.resolveDataElementOptions(t,i);s.$shared&&(s=Object.assign({},s,{$shared:!1}));let o=s.radius;return i!=="active"&&(s.radius=0),s.radius+=E(n&&n._custom,o),s}};M(Ee,"id","bubble"),M(Ee,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),M(Ee,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});It=class extends gt{constructor(t,i){super(t,i),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,i){let n=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=n;else{let o=l=>+n[l];if(O(n[t])){let{key:l="value"}=this._parsing;o=c=>+Dt(n[c],l)}let r,a;for(r=t,a=t+i;r<a;++r)s._parsed[r]=o(r)}}_getRotation(){return bt(this.options.rotation-90)}_getCircumference(){return bt(this.options.circumference)}_getRotationExtents(){let t=N,i=-N;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let s=this.chart.getDatasetMeta(n).controller,o=s._getRotation(),r=s._getCircumference();t=Math.min(t,o),i=Math.max(i,o+r)}return{rotation:t,circumference:i-t}}update(t){let i=this.chart,{chartArea:n}=i,s=this._cachedMeta,o=s.data,r=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(n.width,n.height)-r)/2,0),l=Math.min(Vr(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:h,ratioY:f,offsetX:g,offsetY:p}=Dh(u,d,l),m=(n.width-r)/h,b=(n.height-r)/f,y=Math.max(Math.min(m,b)/2,0),_=os(this.options.radius,y),v=Math.max(_*l,0),x=(_-v)/this._getVisibleDatasetWeightTotal();this.offsetX=g*_,this.offsetY=p*_,s.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,i){let n=this.options,s=this._cachedMeta,o=this._getCircumference();return i&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*o/N)}updateElements(t,i,n,s){let o=s==="reset",r=this.chart,a=r.chartArea,c=r.options.animation,d=(a.left+a.right)/2,u=(a.top+a.bottom)/2,h=o&&c.animateScale,f=h?0:this.innerRadius,g=h?0:this.outerRadius,{sharedOptions:p,includeOptions:m}=this._getSharedOptions(i,s),b=this._getRotation(),y;for(y=0;y<i;++y)b+=this._circumference(y,o);for(y=i;y<i+n;++y){let _=this._circumference(y,o),v=t[y],x={x:d+this.offsetX,y:u+this.offsetY,startAngle:b,endAngle:b+_,circumference:_,outerRadius:g,innerRadius:f};m&&(x.options=p||this.resolveDataElementOptions(y,v.active?"active":s)),b+=_,this.updateElement(v,y,x,s)}}calculateTotal(){let t=this._cachedMeta,i=t.data,n=0,s;for(s=0;s<i.length;s++){let o=t._parsed[s];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(s)&&!i[s].hidden&&(n+=Math.abs(o))}return n}calculateCircumference(t){let i=this._cachedMeta.total;return i>0&&!isNaN(t)?N*(Math.abs(t)/i):0}getLabelAndValue(t){let i=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Se(i._parsed[t],n.options.locale);return{label:s[t]||"",value:o}}getMaxBorderWidth(t){let i=0,n=this.chart,s,o,r,a,l;if(!t){for(s=0,o=n.data.datasets.length;s<o;++s)if(n.isDatasetVisible(s)){r=n.getDatasetMeta(s),t=r.data,a=r.controller;break}}if(!t)return 0;for(s=0,o=t.length;s<o;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(i=Math.max(i,l.borderWidth||0,l.hoverBorderWidth||0));return i}getMaxOffset(t){let i=0;for(let n=0,s=t.length;n<s;++n){let o=this.resolveDataElementOptions(n);i=Math.max(i,o.offset||0,o.hoverOffset||0)}return i}_getRingWeightOffset(t){let i=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(i+=this._getRingWeight(n));return i}_getRingWeight(t){return Math.max(E(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}};M(It,"id","doughnut"),M(It,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),M(It,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),M(It,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let i=t.data,{labels:{pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return i.labels.length&&i.datasets.length?i.labels.map((l,c)=>{let u=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:u.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:u.borderWidth,strokeStyle:u.borderColor,textAlign:s,pointStyle:n,borderRadius:r&&(a||u.borderRadius),index:c}}):[]}},onClick(t,i,n){n.chart.toggleDataVisibility(i.index),n.chart.update()}}}});Le=class extends gt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let i=this._cachedMeta,{dataset:n,data:s=[],_dataset:o}=i,r=this.chart._animationsDisabled,{start:a,count:l}=ps(i,s,r);this._drawStart=a,this._drawCount=l,ms(i)&&(a=0,l=s.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!o._decimated,n.points=s;let 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,i,n,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:d,includeOptions:u}=this._getSharedOptions(i,s),h=r.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=ee(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||s==="none",y=i+n,_=t.length,v=i>0&&this.getParsed(i-1);for(let x=0;x<_;++x){let S=t[x],k=b?S:{};if(x<i||x>=y){k.skip=!0;continue}let T=this.getParsed(x),w=P(T[f]),L=k[h]=r.getPixelForValue(T[h],x),A=k[f]=o||w?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,T,l):T[f],x);k.skip=isNaN(L)||isNaN(A)||w,k.stop=x>0&&Math.abs(T[h]-v[h])>m,p&&(k.parsed=T,k.raw=c.data[x]),u&&(k.options=d||this.resolveDataElementOptions(x,S.active?"active":s)),b||this.updateElement(S,x,k,s),v=T}}getMaxOverflow(){let t=this._cachedMeta,i=t.dataset,n=i.options&&i.options.borderWidth||0,s=t.data||[];if(!s.length)return n;let 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(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}};M(Le,"id","line"),M(Le,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),M(Le,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});ae=class extends gt{constructor(t,i){super(t,i),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let i=this._cachedMeta,n=this.chart,s=n.data.labels||[],o=Se(i._parsed[t].r,n.options.locale);return{label:s[t]||"",value:o}}parseObjectData(t,i,n,s){return Ts.bind(this)(t,i,n,s)}update(t){let i=this._cachedMeta.data;this._updateRadius(),this.updateElements(i,0,i.length,t)}getMinMax(){let t=this._cachedMeta,i={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,s)=>{let o=this.getParsed(s).r;!isNaN(o)&&this.chart.getDataVisibility(s)&&(o<i.min&&(i.min=o),o>i.max&&(i.max=o))}),i}_updateRadius(){let t=this.chart,i=t.chartArea,n=t.options,s=Math.min(i.right-i.left,i.bottom-i.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,i,n,s){let o=s==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,d=c.xCenter,u=c.yCenter,h=c.getIndexAngle(0)-.5*F,f=h,g,p=360/this.countVisibleElements();for(g=0;g<i;++g)f+=this._computeAngle(g,s,p);for(g=i;g<i+n;g++){let m=t[g],b=f,y=f+this._computeAngle(g,s,p),_=r.getDataVisibility(g)?c.getDistanceFromCenterForValue(this.getParsed(g).r):0;f=y,o&&(l.animateScale&&(_=0),l.animateRotate&&(b=y=h));let v={x:d,y:u,innerRadius:0,outerRadius:_,startAngle:b,endAngle:y,options:this.resolveDataElementOptions(g,m.active?"active":s)};this.updateElement(m,g,v,s)}}countVisibleElements(){let t=this._cachedMeta,i=0;return t.data.forEach((n,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&i++}),i}_computeAngle(t,i,n){return this.chart.getDataVisibility(t)?bt(this.resolveDataElementOptions(t,i).angle||n):0}};M(ae,"id","polarArea"),M(ae,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),M(ae,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let i=t.data;if(i.labels.length&&i.datasets.length){let{labels:{pointStyle:n,color:s}}=t.legend.options;return i.labels.map((o,r)=>{let 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,i,n){n.chart.toggleDataVisibility(i.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});li=class extends It{};M(li,"id","pie"),M(li,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});Ae=class extends gt{getLabelAndValue(t){let i=this._cachedMeta.vScale,n=this.getParsed(t);return{label:i.getLabels()[t],value:""+i.getLabelForValue(n[i.axis])}}parseObjectData(t,i,n,s){return Ts.bind(this)(t,i,n,s)}update(t){let i=this._cachedMeta,n=i.dataset,s=i.data||[],o=i.iScale.getLabels();if(n.points=s,t!=="resize"){let r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);let 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,i,n,s){let o=this._cachedMeta.rScale,r=s==="reset";for(let a=i;a<i+n;a++){let l=t[a],c=this.resolveDataElementOptions(a,l.active?"active":s),d=o.getPointPositionForValue(a,this.getParsed(a).r),u=r?o.xCenter:d.x,h=r?o.yCenter:d.y,f={x:u,y:h,angle:d.angle,skip:isNaN(u)||isNaN(h),options:c};this.updateElement(l,a,f,s)}}};M(Ae,"id","radar"),M(Ae,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),M(Ae,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});De=class extends gt{getLabelAndValue(t){let i=this._cachedMeta,n=this.chart.data.labels||[],{xScale:s,yScale:o}=i,r=this.getParsed(t),a=s.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:n[t]||"",value:"("+a+", "+l+")"}}update(t){let i=this._cachedMeta,{data:n=[]}=i,s=this.chart._animationsDisabled,{start:o,count:r}=ps(i,n,s);if(this._drawStart=o,this._drawCount=r,ms(i)&&(o=0,r=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:a,_dataset:l}=i;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=n;let c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!s,options:c},t)}else this.datasetElementType&&(delete i.dataset,this.datasetElementType=!1);this.updateElements(n,o,r,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,i,n,s){let o=s==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,d=this.resolveDataElementOptions(i,s),u=this.getSharedOptions(d),h=this.includeOptions(s,u),f=r.axis,g=a.axis,{spanGaps:p,segment:m}=this.options,b=ee(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||s==="none",_=i>0&&this.getParsed(i-1);for(let v=i;v<i+n;++v){let x=t[v],S=this.getParsed(v),k=y?x:{},T=P(S[g]),w=k[f]=r.getPixelForValue(S[f],v),L=k[g]=o||T?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,S,l):S[g],v);k.skip=isNaN(w)||isNaN(L)||T,k.stop=v>0&&Math.abs(S[f]-_[f])>b,m&&(k.parsed=S,k.raw=c.data[v]),h&&(k.options=u||this.resolveDataElementOptions(v,x.active?"active":s)),y||this.updateElement(x,v,k,s),_=S}this.updateSharedOptions(u,s,d)}getMaxOverflow(){let t=this._cachedMeta,i=t.data||[];if(!this.options.showLine){let a=0;for(let l=i.length-1;l>=0;--l)a=Math.max(a,i[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}let n=t.dataset,s=n.options&&n.options.borderWidth||0;if(!i.length)return s;let o=i[0].size(this.resolveDataElementOptions(0)),r=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(s,o,r)/2}};M(De,"id","scatter"),M(De,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),M(De,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});Rh=Object.freeze({__proto__:null,BarController:Ce,BubbleController:Ee,DoughnutController:It,LineController:Le,PieController:li,PolarAreaController:ae,RadarController:Ae,ScatterController:De});Ys=class e{constructor(t){M(this,"options");this.options=t||{}}static override(t){Object.assign(e.prototype,t)}init(){}formats(){return ne()}parse(){return ne()}format(){return ne()}add(){return ne()}diff(){return ne()}startOf(){return ne()}endOf(){return ne()}},Ph={_date:Ys};Hh={evaluateInteractionItems:xi,modes:{index(e,t,i,n){let s=jt(t,e),o=i.axis||"x",r=i.includeInvisible||!1,a=i.intersect?$s(e,s,o,n,r):Hs(e,s,o,!1,n,r),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{let d=a[0].index,u=c.data[d];u&&!u.skip&&l.push({element:u,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,i,n){let s=jt(t,e),o=i.axis||"xy",r=i.includeInvisible||!1,a=i.intersect?$s(e,s,o,n,r):Hs(e,s,o,!1,n,r);if(a.length>0){let l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(e,t,i,n){let s=jt(t,e),o=i.axis||"xy",r=i.includeInvisible||!1;return $s(e,s,o,n,r)},nearest(e,t,i,n){let s=jt(t,e),o=i.axis||"xy",r=i.includeInvisible||!1;return Hs(e,s,o,i.intersect,n,r)},x(e,t,i,n){let s=jt(t,e);return wa(e,s,"x",i.intersect,n)},y(e,t,i,n){let s=jt(t,e);return wa(e,s,"y",i.intersect,n)}}},yl=["left","top","right","bottom"];ot={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(i){t.draw(i)}}]},e.boxes.push(t)},removeBox(e,t){let i=e.boxes?e.boxes.indexOf(t):-1;i!==-1&&e.boxes.splice(i,1)},configure(e,t,i){t.fullSize=i.fullSize,t.position=i.position,t.weight=i.weight},update(e,t,i,n){if(!e)return;let s=nt(e.options.layout.padding),o=Math.max(t-s.width,0),r=Math.max(i-s.height,0),a=Vh(e.boxes),l=a.vertical,c=a.horizontal;H(e.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});let d=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,u=Object.freeze({outerWidth:t,outerHeight:i,padding:s,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/d,hBoxMaxHeight:r/2}),h=Object.assign({},s);xl(h,nt(n));let f=Object.assign({maxPadding:h,w:o,h:r,x:s.left,y:s.top},s),g=Bh(l.concat(c),u);ci(a.fullSize,f,u,g),ci(l,f,u,g),ci(c,f,u,g)&&ci(l,f,u,g),jh(f),La(a.leftAndTop,f,u,g),f.x+=f.w,f.y+=f.h,La(a.rightAndBottom,f,u,g),e.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},H(a.chartArea,p=>{let m=p.box;Object.assign(m,e.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},pn=class{acquireContext(t,i){}releaseContext(t){return!1}addEventListener(t,i,n){}removeEventListener(t,i,n){}getDevicePixelRatio(){return 1}getMaximumSize(t,i,n,s){return i=Math.max(0,i||t.width),n=n||t.height,{width:i,height:Math.max(0,s?Math.floor(i/s):n)}}isAttached(t){return!0}updateConfig(t){}},Gs=class extends pn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}},hn="$chartjs",Yh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Aa=e=>e===null||e==="";_l=ua?{passive:!0}:!1;mi=new Map,Da=0;Us=class extends pn{acquireContext(t,i){let n=t&&t.getContext&&t.getContext("2d");return n&&n.canvas===t?(Gh(t,i),n):null}releaseContext(t){let i=t.canvas;if(!i[hn])return!1;let n=i[hn].initial;["height","width"].forEach(o=>{let r=n[o];P(r)?i.removeAttribute(o):i.setAttribute(o,r)});let s=n.style||{};return Object.keys(s).forEach(o=>{i.style[o]=s[o]}),i.width=i.width,delete i[hn],!0}addEventListener(t,i,n){this.removeEventListener(t,i);let s=t.$proxies||(t.$proxies={}),r={attach:Jh,detach:Zh,resize:ef}[i]||nf;s[i]=r(t,i,n)}removeEventListener(t,i){let n=t.$proxies||(t.$proxies={}),s=n[i];if(!s)return;({attach:Ws,detach:Ws,resize:Ws}[i]||Kh)(t,i,s),n[i]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,i,n,s){return da(t,i,n,s)}isAttached(t){let i=t&&sn(t);return!!(i&&i.isConnected)}};pt=class{constructor(){M(this,"x");M(this,"y");M(this,"active",!1);M(this,"options");M(this,"$animations")}tooltipPosition(t){let{x:i,y:n}=this.getProps(["x","y"],t);return{x:i,y:n}}hasValue(){return ee(this.x)&&ee(this.y)}getProps(t,i){let n=this.$animations;if(!i||!n)return this;let s={};return t.forEach(o=>{s[o]=n[o]&&n[o].active()?n[o]._to:this[o]}),s}};M(pt,"defaults",{}),M(pt,"defaultRoutes");uf=e=>e==="left"?"right":e==="right"?"left":e,Ra=(e,t,i)=>t==="top"||t==="left"?e[t]+i:e[t]-i,Pa=(e,t)=>Math.min(t||e,e);ce=class e extends pt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,i){return t}getUserBounds(){let{_userMin:t,_userMax:i,_suggestedMin:n,_suggestedMax:s}=this;return t=ct(t,Number.POSITIVE_INFINITY),i=ct(i,Number.NEGATIVE_INFINITY),n=ct(n,Number.POSITIVE_INFINITY),s=ct(s,Number.NEGATIVE_INFINITY),{min:ct(t,n),max:ct(i,s),minDefined:Y(t),maxDefined:Y(i)}}getMinMax(t){let{min:i,max:n,minDefined:s,maxDefined:o}=this.getUserBounds(),r;if(s&&o)return{min:i,max:n};let a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),s||(i=Math.min(i,r.min)),o||(n=Math.max(n,r.max));return i=o&&i>n?n:i,n=s&&i>n?i:n,{min:ct(i,ct(n,i)),max:ct(n,ct(i,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let 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(){B(this.options.beforeUpdate,[this])}update(t,i,n){let{beginAtZero:s,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=i,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=sa(this,o,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=a<this.ticks.length;this._convertTicksToLabels(l?Oa(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=of(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,i,n;this.isHorizontal()?(i=this.left,n=this.right):(i=this.top,n=this.bottom,t=!t),this._startPixel=i,this._endPixel=n,this._reversePixels=t,this._length=n-i,this._alignToPixels=this.options.alignToPixels}afterUpdate(){B(this.options.afterUpdate,[this])}beforeSetDimensions(){B(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){B(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),B(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){B(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){let i=this.options.ticks,n,s,o;for(n=0,s=t.length;n<s;n++)o=t[n],o.label=B(i.callback,[o.value,n,t],this)}afterTickToLabelConversion(){B(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){B(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let t=this.options,i=t.ticks,n=Pa(this.ticks.length,t.ticks.maxTicksLimit),s=i.minRotation||0,o=i.maxRotation,r=s,a,l,c;if(!this._isVisible()||!i.display||s>=o||n<=1||!this.isHorizontal()){this.labelRotation=s;return}let d=this._getLabelSizes(),u=d.widest.width,h=d.highest.height,f=Q(this.chart.width-u,0,this.maxWidth);a=t.offset?this.maxWidth/n:f/(n-1),u+6>a&&(a=f/(n-(t.offset?.5:1)),l=this.maxHeight-ri(t.grid)-i.padding-Ia(t.title,this.chart.options.font),c=Math.sqrt(u*u+h*h),r=Ki(Math.min(Math.asin(Q((d.highest.height+6)/a,-1,1)),Math.asin(Q(l/c,-1,1))-Math.asin(Q(h/c,-1,1)))),r=Math.max(s,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){B(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){B(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:i,options:{ticks:n,title:s,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){let l=Ia(s,i.options.font);if(a?(t.width=this.maxWidth,t.height=ri(o)+l):(t.height=this.maxHeight,t.width=ri(o)+l),n.display&&this.ticks.length){let{first:c,last:d,widest:u,highest:h}=this._getLabelSizes(),f=n.padding*2,g=bt(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){let b=n.mirror?0:m*u.width+p*h.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{let b=n.mirror?0:p*u.width+m*h.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,d,m,p)}}this._handleMargins(),a?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,i,n,s){let{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){let d=this.getPixelForTick(0)-this.left,u=this.right-this.getPixelForTick(this.ticks.length-1),h=0,f=0;l?c?(h=s*t.width,f=n*i.height):(h=n*t.height,f=s*i.width):o==="start"?f=i.width:o==="end"?h=t.width:o!=="inner"&&(h=t.width/2,f=i.width/2),this.paddingLeft=Math.max((h-d+r)*this.width/(this.width-d),0),this.paddingRight=Math.max((f-u+r)*this.width/(this.width-u),0)}else{let d=i.height/2,u=t.height/2;o==="start"?(d=0,u=t.height):o==="end"&&(d=i.height,u=0),this.paddingTop=d+r,this.paddingBottom=u+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(){B(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:i}=this.options;return i==="top"||i==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let i,n;for(i=0,n=t.length;i<n;i++)P(t[i].label)&&(t.splice(i,1),n--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){let i=this.options.ticks.sampleSize,n=this.ticks;i<n.length&&(n=Oa(n,i)),this._labelSizes=t=this._computeLabelSizes(n,n.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,i,n){let{ctx:s,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(i/Pa(i,n)),c=0,d=0,u,h,f,g,p,m,b,y,_,v,x;for(u=0;u<i;u+=l){if(g=t[u].label,p=this._resolveTickFontOptions(u),s.font=m=p.string,b=o[m]=o[m]||{data:{},gc:[]},y=p.lineHeight,_=v=0,!P(g)&&!V(g))_=Ze(s,b.data,b.gc,_,g),v=y;else if(V(g))for(h=0,f=g.length;h<f;++h)x=g[h],!P(x)&&!V(x)&&(_=Ze(s,b.data,b.gc,_,x),v+=y);r.push(_),a.push(v),c=Math.max(_,c),d=Math.max(v,d)}ff(o,i);let S=r.indexOf(c),k=a.indexOf(d),T=w=>({width:r[w]||0,height:a[w]||0});return{first:T(0),last:T(i-1),widest:T(S),highest:T(k),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,i){return NaN}getValueForPixel(t){}getPixelForTick(t){let i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let i=this._startPixel+t*this._length;return Gr(this._alignToPixels?Bt(this.chart,i,0):i)}getDecimalForPixel(t){let i=(t-this._startPixel)/this._length;return this._reversePixels?1-i:i}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:i}=this;return t<0&&i<0?i:t>0&&i>0?t:0}getContext(t){let i=this.ticks||[];if(t>=0&&t<i.length){let n=i[t];return n.$context||(n.$context=pf(this.getContext(),t,n))}return this.$context||(this.$context=gf(this.chart.getContext(),this))}_tickSize(){let t=this.options.ticks,i=bt(this.labelRotation),n=Math.abs(Math.cos(i)),s=Math.abs(Math.sin(i)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*n>a*s?a/n:l/s:l*s<a*n?l/n:a/s}_isVisible(){let t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){let i=this.axis,n=this.chart,s=this.options,{grid:o,position:r,border:a}=s,l=o.offset,c=this.isHorizontal(),u=this.ticks.length+(l?1:0),h=ri(o),f=[],g=a.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,b=function(q){return Bt(n,q,p)},y,_,v,x,S,k,T,w,L,A,I,tt;if(r==="top")y=b(this.bottom),k=this.bottom-h,w=y-m,A=b(t.top)+m,tt=t.bottom;else if(r==="bottom")y=b(this.top),A=t.top,tt=b(t.bottom)-m,k=y+m,w=this.top+h;else if(r==="left")y=b(this.right),S=this.right-h,T=y-m,L=b(t.left)+m,I=t.right;else if(r==="right")y=b(this.left),L=t.left,I=b(t.right)-m,S=y+m,T=this.left+h;else if(i==="x"){if(r==="center")y=b((t.top+t.bottom)/2+.5);else if(O(r)){let q=Object.keys(r)[0],X=r[q];y=b(this.chart.scales[q].getPixelForValue(X))}A=t.top,tt=t.bottom,k=y+m,w=k+h}else if(i==="y"){if(r==="center")y=b((t.left+t.right)/2);else if(O(r)){let q=Object.keys(r)[0],X=r[q];y=b(this.chart.scales[q].getPixelForValue(X))}S=y-m,T=S-h,L=t.left,I=t.right}let ht=E(s.ticks.maxTicksLimit,u),z=Math.max(1,Math.ceil(u/ht));for(_=0;_<u;_+=z){let q=this.getContext(_),X=o.setContext(q),yt=a.setContext(q),st=X.lineWidth,de=X.color,Si=yt.dash||[],ue=yt.dashOffset,He=X.tickWidth,Yt=X.tickColor,We=X.tickBorderDash||[],Gt=X.tickBorderDashOffset;v=hf(this,_,l),v!==void 0&&(x=Bt(n,v,st),c?S=T=L=I=x:k=w=A=tt=x,f.push({tx1:S,ty1:k,tx2:T,ty2:w,x1:L,y1:A,x2:I,y2:tt,width:st,color:de,borderDash:Si,borderDashOffset:ue,tickWidth:He,tickColor:Yt,tickBorderDash:We,tickBorderDashOffset:Gt}))}return this._ticksLength=u,this._borderValue=y,f}_computeLabelItems(t){let i=this.axis,n=this.options,{position:s,ticks:o}=n,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:u}=o,h=ri(n.grid),f=h+d,g=u?-d:f,p=-bt(this.labelRotation),m=[],b,y,_,v,x,S,k,T,w,L,A,I,tt="middle";if(s==="top")S=this.bottom-g,k=this._getXAxisLabelAlignment();else if(s==="bottom")S=this.top+g,k=this._getXAxisLabelAlignment();else if(s==="left"){let z=this._getYAxisLabelAlignment(h);k=z.textAlign,x=z.x}else if(s==="right"){let z=this._getYAxisLabelAlignment(h);k=z.textAlign,x=z.x}else if(i==="x"){if(s==="center")S=(t.top+t.bottom)/2+f;else if(O(s)){let z=Object.keys(s)[0],q=s[z];S=this.chart.scales[z].getPixelForValue(q)+f}k=this._getXAxisLabelAlignment()}else if(i==="y"){if(s==="center")x=(t.left+t.right)/2-f;else if(O(s)){let z=Object.keys(s)[0],q=s[z];x=this.chart.scales[z].getPixelForValue(q)}k=this._getYAxisLabelAlignment(h).textAlign}i==="y"&&(l==="start"?tt="top":l==="end"&&(tt="bottom"));let ht=this._getLabelSizes();for(b=0,y=a.length;b<y;++b){_=a[b],v=_.label;let z=o.setContext(this.getContext(b));T=this.getPixelForTick(b)+o.labelOffset,w=this._resolveTickFontOptions(b),L=w.lineHeight,A=V(v)?v.length:1;let q=A/2,X=z.color,yt=z.textStrokeColor,st=z.textStrokeWidth,de=k;r?(x=T,k==="inner"&&(b===y-1?de=this.options.reverse?"left":"right":b===0?de=this.options.reverse?"right":"left":de="center"),s==="top"?c==="near"||p!==0?I=-A*L+L/2:c==="center"?I=-ht.highest.height/2-q*L+L:I=-ht.highest.height+L/2:c==="near"||p!==0?I=L/2:c==="center"?I=ht.highest.height/2-q*L:I=ht.highest.height-A*L,u&&(I*=-1),p!==0&&!z.showLabelBackdrop&&(x+=L/2*Math.sin(p))):(S=T,I=(1-A)*L/2);let Si;if(z.showLabelBackdrop){let ue=nt(z.backdropPadding),He=ht.heights[b],Yt=ht.widths[b],We=I-ue.top,Gt=0-ue.left;switch(tt){case"middle":We-=He/2;break;case"bottom":We-=He;break}switch(k){case"center":Gt-=Yt/2;break;case"right":Gt-=Yt;break;case"inner":b===y-1?Gt-=Yt:b>0&&(Gt-=Yt/2);break}Si={left:Gt,top:We,width:Yt+ue.width,height:He+ue.height,color:z.backdropColor}}m.push({label:v,font:w,textOffset:I,options:{rotation:p,color:X,strokeColor:yt,strokeWidth:st,textAlign:de,textBaseline:tt,translation:[x,S],backdrop:Si}})}return m}_getXAxisLabelAlignment(){let{position:t,ticks:i}=this.options;if(-bt(this.labelRotation))return t==="top"?"left":"right";let s="center";return i.align==="start"?s="left":i.align==="end"?s="right":i.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:i,ticks:{crossAlign:n,mirror:s,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width,c,d;return i==="left"?s?(d=this.right+o,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d=this.left)):i==="right"?s?(d=this.left+o,n==="near"?c="right":n==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,n==="near"?c="left":n==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,i=this.options.position;if(i==="left"||i==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(i==="top"||i==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){let{ctx:t,options:{backgroundColor:i},left:n,top:s,width:o,height:r}=this;i&&(t.save(),t.fillStyle=i,t.fillRect(n,s,o,r),t.restore())}getLineWidthForValue(t){let i=this.options.grid;if(!this._isVisible()||!i.display)return 0;let s=this.ticks.findIndex(o=>o.value===t);return s>=0?i.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let i=this.options.grid,n=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,r,a=(l,c,d)=>{!d.width||!d.color||(n.save(),n.lineWidth=d.width,n.strokeStyle=d.color,n.setLineDash(d.borderDash||[]),n.lineDashOffset=d.borderDashOffset,n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(c.x,c.y),n.stroke(),n.restore())};if(i.display)for(o=0,r=s.length;o<r;++o){let l=s[o];i.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),i.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){let{chart:t,ctx:i,options:{border:n,grid:s}}=this,o=n.setContext(this.getContext()),r=n.display?o.width:0;if(!r)return;let a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,d,u,h;this.isHorizontal()?(c=Bt(t,this.left,r)-r/2,d=Bt(t,this.right,a)+a/2,u=h=l):(u=Bt(t,this.top,r)-r/2,h=Bt(t,this.bottom,a)+a/2,c=d=l),i.save(),i.lineWidth=o.width,i.strokeStyle=o.color,i.beginPath(),i.moveTo(c,u),i.lineTo(d,h),i.stroke(),i.restore()}drawLabels(t){if(!this.options.ticks.display)return;let n=this.ctx,s=this._computeLabelArea();s&&ei(n,s);let o=this.getLabelItems(t);for(let r of o){let a=r.options,l=r.font,c=r.label,d=r.textOffset;Vt(n,c,0,d,l,a)}s&&ii(n)}drawTitle(){let{ctx:t,options:{position:i,title:n,reverse:s}}=this;if(!n.display)return;let o=Z(n.font),r=nt(n.padding),a=n.align,l=o.lineHeight/2;i==="bottom"||i==="center"||O(i)?(l+=r.bottom,V(n.text)&&(l+=o.lineHeight*(n.text.length-1))):l+=r.top;let{titleX:c,titleY:d,maxWidth:u,rotation:h}=bf(this,l,i,a);Vt(t,n.text,0,0,o,{color:n.color,maxWidth:u,rotation:h,textAlign:mf(a,i,s),textBaseline:"middle",translation:[c,d]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){let t=this.options,i=t.ticks&&t.ticks.z||0,n=E(t.grid&&t.grid.z,-1),s=E(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==e.prototype.draw?[{z:i,draw:o=>{this.draw(o)}}]:[{z:n,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:i,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){let i=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+"AxisID",s=[],o,r;for(o=0,r=i.length;o<r;++o){let a=i[o];a[n]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){let i=this.options.ticks.setContext(this.getContext(t));return Z(i.font)}_maxDigits(){let t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}},Oe=class{constructor(t,i,n){this.type=t,this.scope=i,this.override=n,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){let i=Object.getPrototypeOf(t),n;_f(i)&&(n=this.register(i));let s=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in s||(s[o]=t,yf(t,r,n),this.override&&j.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){let i=this.items,n=t.id,s=this.scope;n in i&&delete i[n],s&&n in j[s]&&(delete j[s][n],this.override&&delete zt[n])}};Ks=class{constructor(){this.controllers=new Oe(gt,"datasets",!0),this.elements=new Oe(pt,"elements"),this.plugins=new Oe(Object,"plugins"),this.scales=new Oe(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,i,n){[...i].forEach(s=>{let o=n||this._getRegistryForType(s);n||o.isForType(s)||o===this.plugins&&s.id?this._exec(t,o,s):H(s,r=>{let a=n||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,i,n){let s=Ui(t);B(n["before"+s],[],n),i[t](n),B(n["after"+s],[],n)}_getRegistryForType(t){for(let i=0;i<this._typedRegistries.length;i++){let n=this._typedRegistries[i];if(n.isForType(t))return n}return this.plugins}_get(t,i,n){let s=i.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+n+".");return s}},wt=new Ks,Xs=class{constructor(){this._init=void 0}notify(t,i,n,s){if(i==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;let o=s?this._descriptors(t).filter(s):this._descriptors(t),r=this._notify(o,t,i,n);return i==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,i,n,s){s=s||{};for(let o of t){let r=o.plugin,a=r[n],l=[i,s,o.options];if(B(a,l,r)===!1&&s.cancelable)return!1}return!0}invalidate(){P(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;let i=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),i}_createDescriptors(t,i){let n=t&&t.config,s=E(n.options&&n.options.plugins,{}),o=vf(n);return s===!1&&!i?[]:Sf(t,o,s,i)}_notifyStateChanges(t){let i=this._oldCache||[],n=this._cache,s=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(s(i,n),t,"stop"),this._notify(s(n,i),t,"start")}};Ha=new Map,kl=new Set;ai=(e,t,i)=>{let n=Dt(t,i);n!==void 0&&e.add(n)},Qs=class{constructor(t){this._config=Af(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=Sl(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),Ml(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ln(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,i){return ln(`${t}.transition.${i}`,()=>[[`datasets.${t}.transitions.${i}`,`transitions.${i}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,i){return ln(`${t}-${i}`,()=>[[`datasets.${t}.elements.${i}`,`datasets.${t}`,`elements.${i}`,""]])}pluginScopeKeys(t){let i=t.id,n=this.type;return ln(`${n}-plugin-${i}`,()=>[[`plugins.${i}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,i){let n=this._scopeCache,s=n.get(t);return(!s||i)&&(s=new Map,n.set(t,s)),s}getOptionScopes(t,i,n){let{options:s,type:o}=this,r=this._cachedScopes(t,n),a=r.get(i);if(a)return a;let l=new Set;i.forEach(d=>{t&&(l.add(t),d.forEach(u=>ai(l,t,u))),d.forEach(u=>ai(l,s,u)),d.forEach(u=>ai(l,zt[o]||{},u)),d.forEach(u=>ai(l,j,u)),d.forEach(u=>ai(l,Zi,u))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),kl.has(i)&&r.set(i,c),c}chartOptionScopes(){let{options:t,type:i}=this;return[t,zt[i]||{},j.datasets[i]||{},{type:i},j,Zi]}resolveNamedOptions(t,i,n,s=[""]){let o={$shared:!0},{resolver:r,subPrefixes:a}=Wa(this._resolverCache,t,s),l=r;if(Rf(r,i)){o.$shared=!1,n=Lt(n)?n():n;let c=this.createResolver(t,n,a);l=te(r,n,c)}for(let c of i)o[c]=l[c];return o}createResolver(t,i,n=[""],s){let{resolver:o}=Wa(this._resolverCache,t,n);return O(i)?te(o,i,void 0,s):o}};Df=e=>O(e)&&Object.getOwnPropertyNames(e).some(t=>Lt(e[t]));Pf="4.5.1",Of=["top","bottom","left","right","chartArea"];fn={},Na=e=>{let t=Tl(e);return Object.values(fn).filter(i=>i.canvas===t).pop()};lt=class{static register(...t){wt.add(...t),ja()}static unregister(...t){wt.remove(...t),ja()}constructor(t,i){let n=this.config=new Qs(i),s=Tl(t),o=Na(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.");let r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||sf(s)),this.platform.updateConfig(n);let a=this.platform.acquireContext(s,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=Br(),this.ctx=a,this.canvas=l,this.width=d,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 Xs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Zr(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],fn[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Pt.listen(this,"complete",Va),Pt.listen(this,"progress",If),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:i},width:n,height:s,_aspectRatio:o}=this;return P(t)?i&&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 wt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ws(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return xs(this.canvas,this.ctx),this}stop(){return Pt.stop(this),this}resize(t,i){Pt.running(this)?this._resizeBeforeDraw={width:t,height:i}:this._resize(t,i)}_resize(t,i){let n=this.options,s=this.canvas,o=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(s,t,i,o),a=n.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,ws(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),B(n.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){let i=this.options.scales||{};H(i,(n,s)=>{n.id=s})}buildOrUpdateScales(){let t=this.options,i=t.scales,n=this.scales,s=Object.keys(n).reduce((r,a)=>(r[a]=!1,r),{}),o=[];i&&(o=o.concat(Object.keys(i).map(r=>{let a=i[r],l=Zs(r,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),H(o,r=>{let a=r.options,l=a.id,c=Zs(l,a),d=E(a.type,r.dtype);(a.position===void 0||za(a.position,c)!==za(r.dposition))&&(a.position=r.dposition),s[l]=!0;let u=null;if(l in n&&n[l].type===d)u=n[l];else{let h=wt.getScale(d);u=new h({id:l,type:d,ctx:this.ctx,chart:this}),n[u.id]=u}u.init(a,t)}),H(s,(r,a)=>{r||delete n[a]}),H(n,r=>{ot.configure(this,r,r.options),ot.addBox(this,r)})}_updateMetasets(){let t=this._metasets,i=this.data.datasets.length,n=t.length;if(t.sort((s,o)=>s.index-o.index),n>i){for(let s=i;s<n;++s)this._destroyDatasetMeta(s);t.splice(i,n-i)}this._sortedMetasets=t.slice(0).sort(Ba("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:i}}=this;t.length>i.length&&delete this._stacks,t.forEach((n,s)=>{i.filter(o=>o===n._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){let t=[],i=this.data.datasets,n,s;for(this._removeUnreferencedMetasets(),n=0,s=i.length;n<s;n++){let o=i[n],r=this.getDatasetMeta(n),a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=a,r.indexAxis=o.indexAxis||Js(a,this.options),r.order=o.order||0,r.index=n,r.label=""+o.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{let l=wt.getController(a),{datasetElementType:c,dataElementType:d}=j.datasets[a];Object.assign(l,{dataElementType:wt.getElement(d),datasetElementType:c&&wt.getElement(c)}),r.controller=new l(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){H(this.data.datasets,(t,i)=>{this.getDatasetMeta(i).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let i=this.config;i.update();let n=this._options=i.createResolver(i.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;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,d=this.data.datasets.length;c<d;c++){let{controller:u}=this.getDatasetMeta(c),h=!s&&o.indexOf(u)===-1;u.buildOrUpdateElements(h),r=Math.max(+u.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),s||H(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ba("z","_idx"));let{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){H(this.scales,t=>{ot.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,i=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!rs(i,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,i=this._getUniformDataChanges()||[];for(let{method:n,start:s,count:o}of i){let r=n==="_removeElements"?-o:o;Ff(t,s,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let i=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;o<i;o++)if(!rs(s,n(o)))return;return Array.from(s).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ot.update(this,this.width,this.height,t);let i=this.chartArea,n=i.width<=0||i.height<=0;this._layers=[],H(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 i=0,n=this.data.datasets.length;i<n;++i)this.getDatasetMeta(i).controller.configure();for(let i=0,n=this.data.datasets.length;i<n;++i)this._updateDataset(i,Lt(t)?t({datasetIndex:i}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,i){let n=this.getDatasetMeta(t),s={meta:n,index:t,mode:i,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(n.controller._update(i),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Pt.has(this)?this.attached&&!Pt.running(this)&&Pt.start(this):(this.draw(),Va({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let i=this._layers;for(t=0;t<i.length&&i[t].z<=0;++t)i[t].draw(this.chartArea);for(this._drawDatasets();t<i.length;++t)i[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let i=this._sortedMetasets,n=[],s,o;for(s=0,o=i.length;s<o;++s){let r=i[s];(!t||r.visible)&&n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let i=t.length-1;i>=0;--i)this._drawDataset(t[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let i=this.ctx,n={meta:t,index:t.index,cancelable:!0},s=Rs(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(s&&ei(i,s),t.controller.draw(),s&&ii(i),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return Mt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,i,n,s){let o=Hh.modes[i];return typeof o=="function"?o(this,t,n,s):[]}getDatasetMeta(t){let i=this.data.datasets[t],n=this._metasets,s=n.filter(o=>o&&o._dataset===i).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1},n.push(s)),s}getContext(){return this.$context||(this.$context=Rt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let i=this.data.datasets[t];if(!i)return!1;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!i.hidden}setDatasetVisibility(t,i){let n=this.getDatasetMeta(t);n.hidden=!i}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,i,n){let s=n?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,s);_e(i)?(o.data[i].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(o,{visible:n}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,i){this._updateVisibility(t,i,!1)}show(t,i){this._updateVisibility(t,i,!0)}_destroyDatasetMeta(t){let i=this._metasets[t];i&&i.controller&&i.controller._destroy(),delete this._metasets[t]}_stop(){let t,i;for(this.stop(),Pt.remove(this),t=0,i=this.data.datasets.length;t<i;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:i}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),xs(t,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete fn[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,i=this.platform,n=(o,r)=>{i.addEventListener(this,o,r),t[o]=r},s=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};H(this.options.events,o=>n(o,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,i=this.platform,n=(l,c)=>{i.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(i.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)},r,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)},i.isAttached(this.canvas)?a():r()}unbindEvents(){H(this._listeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._listeners={},H(this._responsiveListeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,i,n){let s=n?"set":"remove",o,r,a,l;for(i==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];let c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[s+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let i=this._active||[],n=t.map(({datasetIndex:o,index:r})=>{let a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Qe(n,i)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,i))}notifyPlugins(t,i,n){return this._plugins.notify(this,t,i,n)}isPluginEnabled(t){return this._plugins._cache.filter(i=>i.plugin.id===t).length===1}_updateHoverStyles(t,i,n){let s=this.options.hover,o=(l,c)=>l.filter(d=>!c.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),r=o(i,t),a=n?t:o(t,i);r.length&&this.updateHoverStyle(r,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,i){let n={event:t,replay:i,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;let o=this._handleEvent(t,i,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,s),(o||n.changed)&&this.render(),this}_handleEvent(t,i,n){let{_active:s=[],options:o}=this,r=i,a=this._getActiveElements(t,s,n,r),l=jr(t),c=$f(t,this._lastEvent,n,l);n&&(this._lastEvent=null,B(o.onHover,[t,a,this],this),l&&B(o.onClick,[t,a,this],this));let d=!Qe(a,s);return(d||i)&&(this._active=a,this._updateHoverStyles(a,s,i)),this._lastEvent=c,d}_getActiveElements(t,i,n,s){if(t.type==="mouseout")return[];if(!n)return i;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,s)}};M(lt,"defaults",j),M(lt,"instances",fn),M(lt,"overrides",zt),M(lt,"registry",wt),M(lt,"version",Pf),M(lt,"getChart",Na);oe=class extends pt{constructor(i){super();M(this,"circumference");M(this,"endAngle");M(this,"fullCircles");M(this,"innerRadius");M(this,"outerRadius");M(this,"pixelMargin");M(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,i&&Object.assign(this,i)}inRange(i,n,s){let o=this.getProps(["x","y"],s),{angle:r,distance:a}=ds(o,{x:i,y:n}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:u,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,g=E(h,c-l),p=Me(r,l,c)&&l!==c,m=g>=N||p,b=kt(a,d+f,u+f);return m&&b}getCenterPoint(i){let{x:n,y:s,startAngle:o,endAngle:r,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],i),{offset:c,spacing:d}=this.options,u=(o+r)/2,h=(a+l+d+c)/2;return{x:n+Math.cos(u)*h,y:s+Math.sin(u)*h}}tooltipPosition(i){return this.getCenterPoint(i)}draw(i){let{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>N?Math.floor(s/N):0,s===0||this.innerRadius<0||this.outerRadius<0)return;i.save();let l=(this.startAngle+this.endAngle)/2;i.translate(Math.cos(l)*o,Math.sin(l)*o);let c=1-Math.sin(Math.min(F,s||0)),d=o*c;i.fillStyle=n.backgroundColor,i.strokeStyle=n.borderColor,Vf(i,this,d,r,a),Nf(i,this,d,r,a),i.restore()}};M(oe,"id","arc"),M(oe,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),M(oe,"defaultRoutes",{backgroundColor:"backgroundColor"}),M(oe,"descriptors",{_scriptable:!0,_indexable:i=>i!=="borderDash"});Jf=typeof Path2D=="function";Ct=class extends pt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,i){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let s=n.spanGaps?this._loop:this._fullLoop;ca(this._points,n,t,s,i),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=pa(this,this.options.segment))}first(){let t=this.segments,i=this.points;return t.length&&i[t[0].start]}last(){let t=this.segments,i=this.points,n=t.length;return n&&i[t[n-1].end]}interpolate(t,i){let n=this.options,s=t[i],o=this.points,r=Ds(this,{property:i,start:s,end:s});if(!r.length)return;let a=[],l=Uf(n),c,d;for(c=0,d=r.length;c<d;++c){let{start:u,end:h}=r[c],f=o[u],g=o[h];if(f===g){a.push(f);continue}let p=Math.abs((s-f[i])/(g[i]-f[i])),m=l(f,g,p,n.stepped);m[i]=t[i],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,i,n){return to(this)(t,this,i,n)}path(t,i,n){let s=this.segments,o=to(this),r=this._loop;i=i||0,n=n||this.points.length-i;for(let a of s)r&=o(t,this,a,{start:i,end:i+n-1});return!!r}draw(t,i,n,s){let o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Zf(t,this,n,s),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}};M(Ct,"id","line"),M(Ct,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),M(Ct,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),M(Ct,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});Re=class extends pt{constructor(i){super();M(this,"parsed");M(this,"skip");M(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,i&&Object.assign(this,i)}inRange(i,n,s){let o=this.options,{x:r,y:a}=this.getProps(["x","y"],s);return Math.pow(i-r,2)+Math.pow(n-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(i,n){return qa(this,i,"x",n)}inYRange(i,n){return qa(this,i,"y",n)}getCenterPoint(i){let{x:n,y:s}=this.getProps(["x","y"],i);return{x:n,y:s}}size(i){i=i||this.options||{};let n=i.radius||0;n=Math.max(n,n&&i.hoverRadius||0);let s=n&&i.borderWidth||0;return(n+s)*2}draw(i,n){let s=this.options;this.skip||s.radius<.1||!Mt(this,n,this.size(s)/2)||(i.strokeStyle=s.borderColor,i.lineWidth=s.borderWidth,i.fillStyle=s.backgroundColor,Qi(i,s,this.x,this.y))}getRange(){let i=this.options||{};return i.radius+i.hitRadius}};M(Re,"id","point"),M(Re,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),M(Re,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});Pe=class extends pt{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){let{inflateAmount:i,options:{borderColor:n,backgroundColor:s}}=this,{inner:o,outer:r}=eg(this),a=ig(r.radius)?ke:ng;t.save(),(r.w!==o.w||r.h!==o.h)&&(t.beginPath(),a(t,Bs(r,i,o)),t.clip(),a(t,Bs(o,-i,r)),t.fillStyle=n,t.fill("evenodd")),t.beginPath(),a(t,Bs(o,i)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,i,n){return zs(this,t,i,n)}inXRange(t,i){return zs(this,t,null,i)}inYRange(t,i){return zs(this,null,t,i)}getCenterPoint(t){let{x:i,y:n,base:s,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(i+s)/2:i,y:o?n:(n+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}};M(Pe,"id","bar"),M(Pe,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),M(Pe,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});sg=Object.freeze({__proto__:null,ArcElement:oe,BarElement:Pe,LineElement:Ct,PointElement:Re}),eo=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Ya=eo.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));ug={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,i){if(!i.enabled)return;let{data:{datasets:n},options:s}=e.config,{elements:o}=s,r=Ga(n)||cg(s)||o&&Ga(o)||dg();if(!i.forceOverride&&r)return;let a=lg(e);n.forEach(a)}};pg={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,i)=>{if(!i.enabled){Ua(e);return}let n=e.width;e.data.datasets.forEach((s,o)=>{let{_data:r,indexAxis:a}=s,l=e.getDatasetMeta(o),c=r||s.data;if(Te([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let d=e.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||e.options.parsing)return;let{start:u,count:h}=gg(l,c),f=i.threshold||4*n;if(h<=f){Dl(s);return}P(r)&&(s._data=c,delete s.data,Object.defineProperty(s,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let g;switch(i.algorithm){case"lttb":g=hg(c,u,h,n,i);break;case"min-max":g=fg(c,u,h,n);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}s._decimated=g})},destroy(e){Ua(e)}};yn=class{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,i,n){let{x:s,y:o,radius:r}=this;return i=i||{start:0,end:N},t.arc(s,o,r,i.end,i.start,!0),!n.bounds}interpolate(t){let{x:i,y:n,radius:s}=this,o=t.angle;return{x:i+Math.cos(o)*s,y:n+Math.sin(o)*s,angle:o}}};Ig={id:"filler",afterDatasetsUpdate(e,t,i){let n=(e.data.datasets||[]).length,s=[],o,r,a,l;for(r=0;r<n;++r)o=e.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof Ct&&(l={visible:e.isDatasetVisible(r),index:r,fill:xg(a,r,n),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,s.push(l);for(r=0;r<n;++r)l=s[r],!(!l||l.fill===!1)&&(l.fill=yg(s,r,i.propagate))},beforeDraw(e,t,i){let n=i.drawTime==="beforeDraw",s=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let r=s.length-1;r>=0;--r){let a=s[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),n&&a.fill&&Vs(e.ctx,a,o))}},beforeDatasetsDraw(e,t,i){if(i.drawTime!=="beforeDatasetsDraw")return;let n=e.getSortedVisibleDatasetMetas();for(let s=n.length-1;s>=0;--s){let o=n[s].$filler;Xa(o)&&Vs(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,i){let n=t.meta.$filler;!Xa(n)||i.drawTime!=="beforeDatasetDraw"||Vs(e.ctx,n,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},tl=(e,t)=>{let{boxHeight:i=t,boxWidth:n=t}=e;return e.usePointStyle&&(i=Math.min(i,t),n=e.pointStyleWidth||Math.min(n,t)),{boxWidth:n,boxHeight:i,itemHeight:Math.max(t,i)}},Fg=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,xn=class extends pt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i,n){this.maxWidth=t,this.maxHeight=i,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(){let t=this.options.labels||{},i=B(t.generateLabels,[this.chart],this)||[];t.filter&&(i=i.filter(n=>t.filter(n,this.chart.data))),t.sort&&(i=i.sort((n,s)=>t.sort(n,s,this.chart.data))),this.options.reverse&&i.reverse(),this.legendItems=i}fit(){let{options:t,ctx:i}=this;if(!t.display){this.width=this.height=0;return}let n=t.labels,s=Z(n.font),o=s.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=tl(n,o),c,d;i.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(r,o,a,l)+10):(d=this.maxHeight,c=this._fitCols(r,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,i,n,s){let{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+a,u=t;o.textAlign="left",o.textBaseline="middle";let h=-1,f=-d;return this.legendItems.forEach((g,p)=>{let m=n+i/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>r)&&(u+=d,c[c.length-(p>0?0:1)]=0,f+=d,h++),l[p]={left:0,top:f,row:h,width:m,height:s},c[c.length-1]+=m+a}),u}_fitCols(t,i,n,s){let{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=r-t,u=a,h=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:y,itemHeight:_}=$g(n,i,o,m,s);b>0&&f+_+2*a>d&&(u+=h+a,c.push({width:h,height:f}),g+=h+a,p++,h=f=0),l[b]={left:g,top:f,col:p,width:y,height:_},h=Math.max(h,y),f+=_+a}),u+=h,c.push({width:h,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:i,options:{align:n,labels:{padding:s},rtl:o}}=this,r=ie(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=it(n,this.left+s,this.right-this.lineWidths[a]);for(let c of i)a!==c.row&&(a=c.row,l=it(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=it(n,this.top+t+s,this.bottom-this.columnSizes[a].height);for(let c of i)c.col!==a&&(a=c.col,l=it(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){let t=this.ctx;ei(t,this),this._draw(),ii(t)}}_draw(){let{options:t,columnSizes:i,lineWidths:n,ctx:s}=this,{align:o,labels:r}=t,a=j.color,l=ie(t.rtl,this.left,this.width),c=Z(r.font),{padding:d}=r,u=c.size,h=u/2,f;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;let{boxWidth:g,boxHeight:p,itemHeight:m}=tl(r,u),b=function(S,k,T){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;s.save();let w=E(T.lineWidth,1);if(s.fillStyle=E(T.fillStyle,a),s.lineCap=E(T.lineCap,"butt"),s.lineDashOffset=E(T.lineDashOffset,0),s.lineJoin=E(T.lineJoin,"miter"),s.lineWidth=w,s.strokeStyle=E(T.strokeStyle,a),s.setLineDash(E(T.lineDash,[])),r.usePointStyle){let L={radius:p*Math.SQRT2/2,pointStyle:T.pointStyle,rotation:T.rotation,borderWidth:w},A=l.xPlus(S,g/2),I=k+h;_s(s,L,A,I,r.pointStyleWidth&&g)}else{let L=k+Math.max((u-p)/2,0),A=l.leftForLtr(S,g),I=Nt(T.borderRadius);s.beginPath(),Object.values(I).some(tt=>tt!==0)?ke(s,{x:A,y:L,w:g,h:p,radius:I}):s.rect(A,L,g,p),s.fill(),w!==0&&s.stroke()}s.restore()},y=function(S,k,T){Vt(s,T.text,S,k+m/2,c,{strikethrough:T.hidden,textAlign:l.textAlign(T.textAlign)})},_=this.isHorizontal(),v=this._computeTitleHeight();_?f={x:it(o,this.left+d,this.right-n[0]),y:this.top+d+v,line:0}:f={x:this.left+d,y:it(o,this.top+v+d,this.bottom-i[0].height),line:0},Es(this.ctx,t.textDirection);let x=m+d;this.legendItems.forEach((S,k)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;let T=s.measureText(S.text).width,w=l.textAlign(S.textAlign||(S.textAlign=r.textAlign)),L=g+h+T,A=f.x,I=f.y;l.setWidth(this.width),_?k>0&&A+L+d>this.right&&(I=f.y+=x,f.line++,A=f.x=it(o,this.left+d,this.right-n[f.line])):k>0&&I+x>this.bottom&&(A=f.x=A+i[f.line].width+d,f.line++,I=f.y=it(o,this.top+v+d,this.bottom-i[f.line].height));let tt=l.x(A);if(b(tt,I,S),A=Qr(w,A+g+h,_?A+L:this.right,t.rtl),y(l.x(A),I,S),_)f.x+=L+d;else if(typeof S.text!="string"){let ht=c.lineHeight;f.y+=Pl(S,ht)+d}else f.y+=x}),Ls(this.ctx,t.textDirection)}drawTitle(){let t=this.options,i=t.title,n=Z(i.font),s=nt(i.padding);if(!i.display)return;let o=ie(t.rtl,this.left,this.width),r=this.ctx,a=i.position,l=n.size/2,c=s.top+l,d,u=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),d=this.top+c,u=it(t.align,u,this.right-h);else{let g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);d=c+it(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}let f=it(a,u,u+h);r.textAlign=o.textAlign(Ji(a)),r.textBaseline="middle",r.strokeStyle=i.color,r.fillStyle=i.color,r.font=n.string,Vt(r,i.text,f,d,n)}_computeTitleHeight(){let t=this.options.title,i=Z(t.font),n=nt(t.padding);return t.display?i.lineHeight+n.height:0}_getLegendItemAt(t,i){let n,s,o;if(kt(t,this.left,this.right)&&kt(i,this.top,this.bottom)){for(o=this.legendHitBoxes,n=0;n<o.length;++n)if(s=o[n],kt(t,s.left,s.left+s.width)&&kt(i,s.top,s.top+s.height))return this.legendItems[n]}return null}handleEvent(t){let i=this.options;if(!zg(t.type,i))return;let n=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){let s=this._hoveredItem,o=Fg(s,n);s&&!o&&B(i.onLeave,[t,s,this],this),this._hoveredItem=n,n&&!o&&B(i.onHover,[t,n,this],this)}else n&&B(i.onClick,[t,n,this],this)}};Bg={id:"legend",_element:xn,start(e,t,i){let n=e.legend=new xn({ctx:e.ctx,options:i,chart:e});ot.configure(e,n,i),ot.addBox(e,n)},stop(e){ot.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,i){let n=e.legend;ot.configure(e,n,i),n.options=i},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,i){let n=t.datasetIndex,s=i.chart;s.isDatasetVisible(n)?(s.hide(n),t.hidden=!0):(s.show(n),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:i,pointStyle:n,textAlign:s,color:o,useBorderRadius:r,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(i?0:void 0),d=nt(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:(d.width+d.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:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}},bi=class extends pt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i){let 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=i;let s=V(n.text)?n.text.length:1;this._padding=nt(n.padding);let o=s*Z(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:i,left:n,bottom:s,right:o,options:r}=this,a=r.align,l=0,c,d,u;return this.isHorizontal()?(d=it(a,n,o),u=i+t,c=o-n):(r.position==="left"?(d=n+t,u=it(a,s,i),l=F*-.5):(d=o-t,u=it(a,i,s),l=F*.5),c=s-i),{titleX:d,titleY:u,maxWidth:c,rotation:l}}draw(){let t=this.ctx,i=this.options;if(!i.display)return;let n=Z(i.font),o=n.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Vt(t,i.text,0,0,n,{color:i.color,maxWidth:l,rotation:c,textAlign:Ji(i.align),textBaseline:"middle",translation:[r,a]})}};Ng={id:"title",_element:bi,start(e,t,i){Vg(e,i)},stop(e){let t=e.titleBlock;ot.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,i){let n=e.titleBlock;ot.configure(e,n,i),n.options=i},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}},cn=new WeakMap,jg={id:"subtitle",start(e,t,i){let n=new bi({ctx:e.ctx,options:i,chart:e});ot.configure(e,n,i),ot.addBox(e,n),cn.set(e,n)},stop(e){ot.removeBox(e,cn.get(e)),cn.delete(e)},beforeUpdate(e,t,i){let n=cn.get(e);ot.configure(e,n,i),n.options=i},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}},di={average(e){if(!e.length)return!1;let t,i,n=new Set,s=0,o=0;for(t=0,i=e.length;t<i;++t){let a=e[t].element;if(a&&a.hasValue()){let l=a.tooltipPosition();n.add(l.x),s+=l.y,++o}}return o===0||n.size===0?!1:{x:[...n].reduce((a,l)=>a+l)/n.size,y:s/o}},nearest(e,t){if(!e.length)return!1;let i=t.x,n=t.y,s=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=e.length;o<r;++o){let l=e[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),d=Yi(t,c);d<s&&(s=d,a=l)}}if(a){let l=a.tooltipPosition();i=l.x,n=l.y}return{x:i,y:n}}};Ol={beforeTitle:St,title(e){if(e.length>0){let t=e[0],i=t.chart.data.labels,n=i?i.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<n)return i[t.dataIndex]}return""},afterTitle:St,beforeBody:St,beforeLabel:St,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");let i=e.formattedValue;return P(i)||(t+=i),t},labelColor(e){let i=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){let i=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:St,afterBody:St,beforeFooter:St,footer:St,afterFooter:St};pi=class extends pt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let i=this.chart,n=this.options.setContext(this.getContext()),s=n.enabled&&i.options.animation&&n.animations,o=new gn(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Jg(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,i){let{callbacks:n}=i,s=dt(n,"beforeTitle",this,t),o=dt(n,"title",this,t),r=dt(n,"afterTitle",this,t),a=[];return a=Tt(a,Ot(s)),a=Tt(a,Ot(o)),a=Tt(a,Ot(r)),a}getBeforeBody(t,i){return sl(dt(i.callbacks,"beforeBody",this,t))}getBody(t,i){let{callbacks:n}=i,s=[];return H(t,o=>{let r={before:[],lines:[],after:[]},a=ol(n,o);Tt(r.before,Ot(dt(a,"beforeLabel",this,o))),Tt(r.lines,dt(a,"label",this,o)),Tt(r.after,Ot(dt(a,"afterLabel",this,o))),s.push(r)}),s}getAfterBody(t,i){return sl(dt(i.callbacks,"afterBody",this,t))}getFooter(t,i){let{callbacks:n}=i,s=dt(n,"beforeFooter",this,t),o=dt(n,"footer",this,t),r=dt(n,"afterFooter",this,t),a=[];return a=Tt(a,Ot(s)),a=Tt(a,Ot(o)),a=Tt(a,Ot(r)),a}_createItems(t){let i=this._active,n=this.chart.data,s=[],o=[],r=[],a=[],l,c;for(l=0,c=i.length;l<c;++l)a.push(qg(this.chart,i[l]));return t.filter&&(a=a.filter((d,u,h)=>t.filter(d,u,h,n))),t.itemSort&&(a=a.sort((d,u)=>t.itemSort(d,u,n))),H(a,d=>{let u=ol(t.callbacks,d);s.push(dt(u,"labelColor",this,d)),o.push(dt(u,"labelPointStyle",this,d)),r.push(dt(u,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,i){let n=this.options.setContext(this.getContext()),s=this._active,o,r=[];if(!s.length)this.opacity!==0&&(o={opacity:0});else{let a=di[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);let l=this._size=el(this,n),c=Object.assign({},a,l),d=il(this.chart,n,c),u=nl(n,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:u.x,y:u.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:i})}drawCaret(t,i,n,s){let o=this.getCaretPosition(t,n,s);i.lineTo(o.x1,o.y1),i.lineTo(o.x2,o.y2),i.lineTo(o.x3,o.y3)}getCaretPosition(t,i,n){let{xAlign:s,yAlign:o}=this,{caretSize:r,cornerRadius:a}=n,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:u}=Nt(a),{x:h,y:f}=t,{width:g,height:p}=i,m,b,y,_,v,x;return o==="center"?(v=f+p/2,s==="left"?(m=h,b=m-r,_=v+r,x=v-r):(m=h+g,b=m+r,_=v-r,x=v+r),y=m):(s==="left"?b=h+Math.max(l,d)+r:s==="right"?b=h+g-Math.max(c,u)-r:b=this.caretX,o==="top"?(_=f,v=_-r,m=b-r,y=b+r):(_=f+p,v=_+r,m=b+r,y=b-r),x=_),{x1:m,x2:b,x3:y,y1:_,y2:v,y3:x}}drawTitle(t,i,n){let s=this.title,o=s.length,r,a,l;if(o){let c=ie(n.rtl,this.x,this.width);for(t.x=dn(this,n.titleAlign,n),i.textAlign=c.textAlign(n.titleAlign),i.textBaseline="middle",r=Z(n.titleFont),a=n.titleSpacing,i.fillStyle=n.titleColor,i.font=r.string,l=0;l<o;++l)i.fillText(s[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=n.titleMarginBottom-a)}}_drawColorBox(t,i,n,s,o){let r=this.labelColors[n],a=this.labelPointStyles[n],{boxHeight:l,boxWidth:c}=o,d=Z(o.bodyFont),u=dn(this,"left",o),h=s.x(u),f=l<d.lineHeight?(d.lineHeight-l)/2:0,g=i.y+f;if(o.usePointStyle){let p={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=s.leftForLtr(h,c)+c/2,b=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Qi(t,p,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Qi(t,p,m,b)}else{t.lineWidth=O(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let p=s.leftForLtr(h,c),m=s.leftForLtr(s.xPlus(h,1),c-2),b=Nt(r.borderRadius);Object.values(b).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ke(t,{x:p,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ke(t,{x:m,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,i,n){let{body:s}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:d}=n,u=Z(n.bodyFont),h=u.lineHeight,f=0,g=ie(n.rtl,this.x,this.width),p=function(T){i.fillText(T,g.x(t.x+f),t.y+h/2),t.y+=h+o},m=g.textAlign(r),b,y,_,v,x,S,k;for(i.textAlign=r,i.textBaseline="middle",i.font=u.string,t.x=dn(this,m,n),i.fillStyle=n.bodyColor,H(this.beforeBody,p),f=a&&m!=="right"?r==="center"?c/2+d:c+2+d:0,v=0,S=s.length;v<S;++v){for(b=s[v],y=this.labelTextColors[v],i.fillStyle=y,H(b.before,p),_=b.lines,a&&_.length&&(this._drawColorBox(i,t,v,g,n),h=Math.max(u.lineHeight,l)),x=0,k=_.length;x<k;++x)p(_[x]),h=u.lineHeight;H(b.after,p)}f=0,h=u.lineHeight,H(this.afterBody,p),t.y-=o}drawFooter(t,i,n){let s=this.footer,o=s.length,r,a;if(o){let l=ie(n.rtl,this.x,this.width);for(t.x=dn(this,n.footerAlign,n),t.y+=n.footerMarginTop,i.textAlign=l.textAlign(n.footerAlign),i.textBaseline="middle",r=Z(n.footerFont),i.fillStyle=n.footerColor,i.font=r.string,a=0;a<o;++a)i.fillText(s[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}drawBackground(t,i,n,s){let{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:d}=n,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:g}=Nt(s.cornerRadius);i.fillStyle=s.backgroundColor,i.strokeStyle=s.borderColor,i.lineWidth=s.borderWidth,i.beginPath(),i.moveTo(a+u,l),r==="top"&&this.drawCaret(t,i,n,s),i.lineTo(a+c-h,l),i.quadraticCurveTo(a+c,l,a+c,l+h),r==="center"&&o==="right"&&this.drawCaret(t,i,n,s),i.lineTo(a+c,l+d-g),i.quadraticCurveTo(a+c,l+d,a+c-g,l+d),r==="bottom"&&this.drawCaret(t,i,n,s),i.lineTo(a+f,l+d),i.quadraticCurveTo(a,l+d,a,l+d-f),r==="center"&&o==="left"&&this.drawCaret(t,i,n,s),i.lineTo(a,l+u),i.quadraticCurveTo(a,l,a+u,l),i.closePath(),i.fill(),s.borderWidth>0&&i.stroke()}_updateAnimationTarget(t){let i=this.chart,n=this.$animations,s=n&&n.x,o=n&&n.y;if(s||o){let r=di[t.position].call(this,this._active,this._eventPosition);if(!r)return;let a=this._size=el(this,t),l=Object.assign({},r,this._size),c=il(i,t,l),d=nl(t,l,c,i);(s._to!==d.x||o._to!==d.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,d))}}_willRender(){return!!this.opacity}draw(t){let i=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(i);let s={width:this.width,height:this.height},o={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let r=nt(i.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;i.enabled&&a&&(t.save(),t.globalAlpha=n,this.drawBackground(o,t,s,i),Es(t,i.textDirection),o.y+=r.top,this.drawTitle(o,t,i),this.drawBody(o,t,i),this.drawFooter(o,t,i),Ls(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){let n=this._active,s=t.map(({datasetIndex:a,index:l})=>{let 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=!Qe(n,s),r=this._positionChanged(s,i);(o||r)&&(this._active=s,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,n=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let s=this.options,o=this._active||[],r=this._getActiveElements(t,o,i,n),a=this._positionChanged(r,t),l=i||!Qe(r,o)||a;return l&&(this._active=r,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),l}_getActiveElements(t,i,n,s){let o=this.options;if(t.type==="mouseout")return[];if(!s)return i.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,o.mode,o,n);return o.reverse&&r.reverse(),r}_positionChanged(t,i){let{caretX:n,caretY:s,options:o}=this,r=di[o.position].call(this,t,i);return r!==!1&&(n!==r.x||s!==r.y)}};M(pi,"positioners",di);Zg={id:"tooltip",_element:pi,positioners:di,afterInit(e,t,i){i&&(e.tooltip=new pi({chart:e,options:i}))},beforeUpdate(e,t,i){e.tooltip&&e.tooltip.initialize(i)},reset(e,t,i){e.tooltip&&e.tooltip.initialize(i)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let i={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",i)}},afterEvent(e,t){if(e.tooltip){let i=t.replay;e.tooltip.handleEvent(t.event,i,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:(e,t)=>t.bodyFont.size,boxWidth:(e,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:Ol},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Qg=Object.freeze({__proto__:null,Colors:ug,Decimation:pg,Filler:Ig,Legend:Bg,SubTitle:jg,Title:Ng,Tooltip:Zg}),tp=(e,t,i,n)=>(typeof t=="string"?(i=e.push(t)-1,n.unshift({index:i,label:t})):isNaN(t)&&(i=null),i);ip=(e,t)=>e===null?null:Q(Math.round(e),0,t);ui=class extends ce{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let i=this._addedLabels;if(i.length){let n=this.getLabels();for(let{index:s,label:o}of i)n[s]===o&&n.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,i){if(P(t))return null;let n=this.getLabels();return i=isFinite(i)&&n[i]===t?i:ep(n,t,E(i,t),this._addedLabels),ip(i,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:i}=this.getUserBounds(),{min:n,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),i||(s=this.getLabels().length-1)),this.min=n,this.max=s}buildTicks(){let t=this.min,i=this.max,n=this.options.offset,s=[],o=this.getLabels();o=t===0&&i===o.length-1?o:o.slice(t,i+1),this._valueRange=Math.max(o.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let r=t;r<=i;r++)s.push({value:r});return s}getLabelForValue(t){return rl.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}};M(ui,"id","category"),M(ui,"defaults",{ticks:{callback:rl}});Ie=class 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,i){return P(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){let{beginAtZero:t}=this.options,{minDefined:i,maxDefined:n}=this.getUserBounds(),{min:s,max:o}=this,r=l=>s=i?s:l,a=l=>o=n?o:l;if(t){let l=xt(s),c=xt(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(){let t=this.options.ticks,{maxTicksLimit:i,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(),i=i||11),i&&(s=Math.min(i,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,i=t.ticks,n=this.getTickLimit();n=Math.max(2,n);let s={maxTicks:n,bounds:t.bounds,min:t.min,max:t.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:i.includeBounds!==!1},o=this._range||this,r=np(s,o);return t.bounds==="ticks"&&ls(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(){let t=this.ticks,i=this.min,n=this.max;if(super.configure(),this.options.offset&&t.length){let s=(n-i)/Math.max(t.length-1,1)/2;i-=s,n+=s}this._startValue=i,this._endValue=n,this._valueRange=n-i}getLabelForValue(t){return Se(t,this.chart.options.locale,this.options.ticks.format)}},hi=class extends Ie{determineDataLimits(){let{min:t,max:i}=this.getMinMax(!0);this.min=Y(t)?t:0,this.max=Y(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),i=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(i/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}};M(hi,"id","linear"),M(hi,"defaults",{ticks:{callback:ti.formatters.numeric}});yi=e=>Math.floor(At(e)),se=(e,t)=>Math.pow(10,yi(e)+t);fi=class extends ce{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,i){let n=Ie.prototype.parse.apply(this,[t,i]);if(n===0){this._zero=!0;return}return Y(n)&&n>0?n:null}determineDataLimits(){let{min:t,max:i}=this.getMinMax(!0);this.min=Y(t)?Math.max(0,t):null,this.max=Y(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Y(this._userMin)&&(this.min=t===se(this.min,0)?se(this.min,-1):se(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:i}=this.getUserBounds(),n=this.min,s=this.max,o=a=>n=t?n:a,r=a=>s=i?s:a;n===s&&(n<=0?(o(1),r(10)):(o(se(n,-1)),r(se(s,1)))),n<=0&&o(se(s,-1)),s<=0&&r(se(n,1)),this.min=n,this.max=s}buildTicks(){let t=this.options,i={min:this._userMin,max:this._userMax},n=op(i,this);return t.bounds==="ticks"&&ls(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":Se(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=At(t),this._valueRange=At(this.max)-At(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(At(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let i=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+i*this._valueRange)}};M(fi,"id","logarithmic"),M(fi,"defaults",{ticks:{callback:ti.formatters.logarithmic,major:{enabled:!0}}});re=class extends Ie{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=nt(no(this.options)/2),i=this.width=this.maxWidth-t.width,n=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+i/2+t.left),this.yCenter=Math.floor(this.top+n/2+t.top),this.drawingArea=Math.floor(Math.min(i,n)/2)}determineDataLimits(){let{min:t,max:i}=this.getMinMax(!1);this.min=Y(t)&&!isNaN(t)?t:0,this.max=Y(i)&&!isNaN(i)?i:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/no(this.options))}generateTickLabels(t){Ie.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((i,n)=>{let s=B(this.options.pointLabels.callback,[i,n],this);return s||s===0?s:""}).filter((i,n)=>this.chart.getDataVisibility(n))}fit(){let t=this.options;t.display&&t.pointLabels.display?ap(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,i,n,s){this.xCenter+=Math.floor((t-i)/2),this.yCenter+=Math.floor((n-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,i,n,s))}getIndexAngle(t){let i=N/(this._pointLabels.length||1),n=this.options.startAngle||0;return et(t*i+bt(n))}getDistanceFromCenterForValue(t){if(P(t))return NaN;let i=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*i:(t-this.min)*i}getValueForDistanceFromCenter(t){if(P(t))return NaN;let i=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-i:this.min+i}getPointLabelContext(t){let i=this._pointLabels||[];if(t>=0&&t<i.length){let n=i[t];return yp(this.getContext(),t,n)}}getPointPosition(t,i,n=0){let s=this.getIndexAngle(t)-U+n;return{x:Math.cos(s)*i+this.xCenter,y:Math.sin(s)*i+this.yCenter,angle:s}}getPointPositionForValue(t,i){return this.getPointPosition(t,this.getDistanceFromCenterForValue(i))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){let{left:i,top:n,right:s,bottom:o}=this._pointLabelItems[t];return{left:i,top:n,right:s,bottom:o}}drawBackground(){let{backgroundColor:t,grid:{circular:i}}=this.options;if(t){let n=this.ctx;n.save(),n.beginPath(),Il(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),n.closePath(),n.fillStyle=t,n.fill(),n.restore()}}drawGrid(){let t=this.ctx,i=this.options,{angleLines:n,grid:s,border:o}=i,r=this._pointLabels.length,a,l,c;if(i.pointLabels.display&&mp(this,r),s.display&&this.ticks.forEach((d,u)=>{if(u!==0||u===0&&this.min<0){l=this.getDistanceFromCenterForValue(d.value);let h=this.getContext(u),f=s.setContext(h),g=o.setContext(h);bp(this,f,l,r,g)}}),n.display){for(t.save(),a=r-1;a>=0;a--){let d=n.setContext(this.getPointLabelContext(a)),{color:u,lineWidth:h}=d;!h||!u||(t.lineWidth=h,t.strokeStyle=u,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(i.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(){let t=this.ctx,i=this.options,n=i.ticks;if(!n.display)return;let s=this.getIndexAngle(0),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&&!i.reverse)return;let c=n.setContext(this.getContext(l)),d=Z(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=d.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;let u=nt(c.backdropPadding);t.fillRect(-r/2-u.left,-o-d.size/2-u.top,r+u.width,d.size+u.height)}Vt(t,a.label,0,-o,d,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),t.restore()}drawTitle(){}};M(re,"id","radialLinear"),M(re,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ti.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),M(re,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),M(re,"descriptors",{angleLines:{_fallback:"grid"}});vn={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}},ut=Object.keys(vn);le=class extends ce{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,i={}){let n=t.time||(t.time={}),s=this._adapter=new Ph._date(t.adapters.date);s.init(i),xe(n.displayFormats,s.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=i.normalized}parse(t,i){return t===void 0?null:hl(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,i=this._adapter,n=t.time.unit||"day",{min:s,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=Y(s)&&!isNaN(s)?s:+i.startOf(Date.now(),n),o=Y(o)&&!isNaN(o)?o:+i.endOf(Date.now(),n)+1,this.min=Math.min(s,o-1),this.max=Math.max(s+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(i=t[0],n=t[t.length-1]),{min:i,max:n}}buildTicks(){let t=this.options,i=t.time,n=t.ticks,s=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);let o=this.min,r=this.max,a=Kr(s,o,r);return this._unit=i.unit||(n.autoSkip?fl(i.minUnit,this.min,this.max,this._getLabelCapacity(o)):xp(this,a.length,i.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:_p(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),pl(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let i=0,n=0,s,o;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?i=1-s:i=(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);let r=t.length<3?.5:.25;i=Q(i,0,r),n=Q(n,0,r),this._offsets={start:i,end:n,factor:1/(i+1+n)}}_generate(){let t=this._adapter,i=this.min,n=this.max,s=this.options,o=s.time,r=o.unit||fl(o.minUnit,i,n,this._getLabelCapacity(i)),a=E(s.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=ee(l)||l===!0,d={},u=i,h,f;if(c&&(u=+t.startOf(u,"isoWeek",l)),u=+t.startOf(u,c?"day":r),t.diff(n,i,r)>1e5*a)throw new Error(i+" and "+n+" are too far apart with stepSize of "+a+" "+r);let g=s.ticks.source==="data"&&this.getDataTimestamps();for(h=u,f=0;h<n;h=+t.add(h,a,r),f++)gl(d,h,g);return(h===n||s.bounds==="ticks"||f===1)&&gl(d,h,g),Object.keys(d).sort(ul).map(p=>+p)}getLabelForValue(t){let i=this._adapter,n=this.options.time;return n.tooltipFormat?i.format(t,n.tooltipFormat):i.format(t,n.displayFormats.datetime)}format(t,i){let s=this.options.time.displayFormats,o=this._unit,r=i||s[o];return this._adapter.format(t,r)}_tickFormatFunction(t,i,n,s){let o=this.options,r=o.ticks.callback;if(r)return B(r,[t,i,n],this);let a=o.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&a[l],u=c&&a[c],h=n[i],f=c&&u&&h&&h.major;return this._adapter.format(t,s||(f?u:d))}generateTickLabels(t){let i,n,s;for(i=0,n=t.length;i<n;++i)s=t[i],s.label=this._tickFormatFunction(s.value,i,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let i=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((i.start+n)*i.factor)}getValueForPixel(t){let i=this._offsets,n=this.getDecimalForPixel(t)/i.factor-i.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let i=this.options.ticks,n=this.ctx.measureText(t).width,s=bt(this.isHorizontal()?i.maxRotation:i.minRotation),o=Math.cos(s),r=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:n*o+a*r,h:n*r+a*o}}_getLabelCapacity(t){let i=this.options.time,n=i.displayFormats,s=n[i.unit]||n.millisecond,o=this._tickFormatFunction(t,0,pl(this,[t],this._majorUnit),s),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],i,n;if(t.length)return t;let s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(i=0,n=s.length;i<n;++i)t=t.concat(s[i].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],i,n;if(t.length)return t;let s=this.getLabels();for(i=0,n=s.length;i<n;++i)t.push(hl(this,s[i]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return hs(t.sort(ul))}};M(le,"id","time"),M(le,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});gi=class extends le{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let t=this._getTimestampsForTable(),i=this._table=this.buildLookupTable(t);this._minPos=un(i,this.min),this._tableRange=un(i,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){let{min:i,max:n}=this,s=[],o=[],r,a,l,c,d;for(r=0,a=t.length;r<a;++r)c=t[r],c>=i&&c<=n&&s.push(c);if(s.length<2)return[{time:i,pos:0},{time:n,pos:1}];for(r=0,a=s.length;r<a;++r)d=s[r+1],l=s[r-1],c=s[r],Math.round((d+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){let t=this.min,i=this.max,n=super.getDataTimestamps();return(!n.includes(t)||!n.length)&&n.splice(0,0,t),(!n.includes(i)||n.length===1)&&n.push(i),n.sort((s,o)=>s-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;let i=this.getDataTimestamps(),n=this.getLabelTimestamps();return i.length&&n.length?t=this.normalize(i.concat(n)):t=i.length?i:n,t=this._cache.all=t,t}getDecimalForValue(t){return(un(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){let i=this._offsets,n=this.getDecimalForPixel(t)/i.factor-i.end;return un(this._table,n*this._tableRange+this._minPos,!0)}};M(gi,"id","timeseries"),M(gi,"defaults",le.defaults);Mp=Object.freeze({__proto__:null,CategoryScale:ui,LinearScale:hi,LogarithmicScale:fi,RadialLinearScale:re,TimeScale:le,TimeSeriesScale:gi}),Fl=[Rh,sg,Qg,Mp]});function Hl(e,t){let i=document.getElementById(e);if(!i)return null;let n={to18:"rgb(37, 99, 235)",to19:"rgb(79, 70, 229)",to20:"rgb(147, 51, 234)",to21:"rgb(219, 39, 119)"},s={type:"pie",data:{labels:t.map(o=>o.migration.toUpperCase()),datasets:[{data:t.map(o=>o.minutes),backgroundColor:t.map(o=>n[o.migration]||"#888"),borderWidth:2,borderColor:"#fff"}]},options:{responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"bottom",labels:{font:{size:12}}},tooltip:{callbacks:{label:o=>{let r=o.parsed,l=o.dataset.data.reduce((d,u)=>d+u,0),c=l>0?Math.round(r/l*100):0;return`${o.label}: ${Mn(r)} (${c}%)`}}}}}};return new lt(i,s)}function so(e,t,i=10,n=!1){let s=document.getElementById(e);if(!s)return null;let o=t.slice(0,i),r=o.map(d=>n?d.summary:d.summary.length>50?d.summary.substring(0,50)+"...":d.summary),a=Math.max(...o.map(d=>d.minutes)),l=Sp(a),c={type:"bar",data:{labels:r,datasets:[{label:`Temps (${l})`,data:o.map(d=>kp(d.minutes,l)),backgroundColor:"rgba(37, 99, 235, 0.8)",borderColor:"rgb(37, 99, 235)",borderWidth:1}]},options:{responsive:!0,maintainAspectRatio:!1,indexAxis:"y",plugins:{legend:{display:!1},tooltip:{callbacks:{label:d=>{let u=o[d.dataIndex],h=Mn(u.minutes),f=u.occurrences>1?"occurrences":"occurrence";return`${h} \u2022 ${u.occurrences} ${f}`}}}},scales:{x:{beginAtZero:!0,title:{display:!0,text:`Temps (${l})`}}}}};return new lt(s,c)}function Sp(e){return e<60?"min":e<420?"h":"j"}function kp(e,t){if(t==="min")return e;if(t==="h")return Math.round(e/60*100)/100;let i=e/60;return Math.round(i/7*100)/100}function Mn(e){if(e<60)return`${e}min`;let t=Math.round(e/60*100)/100;return e<420?`${t}h`:`${Math.round(t/7*100)/100}j`}function Wl(e,t){let i=document.getElementById(e);if(!i)return null;let n={obligatoire:"rgb(220, 38, 38)",recommande:"rgb(217, 119, 6)",optionnelle:"rgb(22, 163, 74)"},s={type:"doughnut",data:{labels:t.map(o=>o.priority.charAt(0).toUpperCase()+o.priority.slice(1)),datasets:[{data:t.map(o=>o.minutes),backgroundColor:t.map(o=>n[o.priority]||"#888"),borderWidth:2,borderColor:"#fff"}]},options:{responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"bottom",labels:{font:{size:12}}},tooltip:{callbacks:{label:o=>{let r=o.parsed,l=o.dataset.data.reduce((d,u)=>d+u,0),c=l>0?Math.round(r/l*100):0;return`${o.label}: ${Mn(r)} (${c}%)`}}}}}};return new lt(i,s)}function zl(e,t){let i=document.getElementById(e);if(!i)return null;let n=t.filter(r=>r.minutes>0),s=Tp(n),o={type:"pie",data:{labels:n.map(r=>r.targetName),datasets:[{data:n.map(r=>r.minutes),backgroundColor:s,borderWidth:2,borderColor:"#fff"}]},options:{responsive:!0,maintainAspectRatio:!0,plugins:{legend:{position:"bottom",labels:{font:{size:11},padding:8,boxWidth:12}},tooltip:{callbacks:{label:r=>{let a=r.dataIndex,l=n[a],c=r.parsed,u=r.dataset.data.reduce((g,p)=>g+p,0),h=u>0?Math.round(c/u*100):0;return`${l.targetType==="app"?"\u{1F4E6} App":"\u{1F4DA} Lib"} - ${l.targetName}: ${Mn(c)} (${h}%)`}}}}}};return new lt(i,o)}function Tp(e){let t=["rgb(249, 115, 22)","rgb(34, 197, 94)","rgb(220, 38, 38)","rgb(14, 165, 233)","rgb(234, 88, 12)","rgb(168, 85, 247)","rgb(251, 146, 60)","rgb(16, 185, 129)","rgb(236, 72, 153)","rgb(234, 179, 8)","rgb(59, 130, 246)","rgb(239, 68, 68)","rgb(20, 184, 166)","rgb(217, 70, 239)","rgb(132, 204, 22)"];return e.map((i,n)=>t[n%t.length])}var Bl=C(()=>{"use strict";$l();lt.register(...Fl)});function Nl(e){if(!e)return;let t=Yl(e);if(oo=t.ruleData,K.migrations=Hl("chart-migrations",t.migrationData)||void 0,K.topRules=so("chart-top-rules",t.ruleData,10,!1)||void 0,K.priorities=Wl("chart-priorities",t.priorityData)||void 0,e.projectInfo.type==="nx-monorepo"){let i=Gl(e);if(i.length>0){let n=document.getElementById("chart-targets-container");n&&(n.style.display="block",K.targets=zl("chart-targets",i)||void 0)}}Ip()}function jl(e){let t=Yl(e);oo=t.ruleData,wp(t.migrationData),ql(t.ruleData),Ap(t.priorityData),Op(e)}function wp(e){K.migrations&&(K.migrations.data.labels=e.map(t=>t.migration.toUpperCase()),K.migrations.data.datasets[0].data=e.map(t=>t.minutes),K.migrations.update())}function ql(e){if(!K.topRules)return;let t=Fe?20:10;if(t!==Vl){K.topRules.destroy(),K.topRules=so("chart-top-rules",e,t,Fe)||void 0,Vl=t;return}let i=e.slice(0,t),n=Math.max(...i.map(o=>o.minutes),1),s=Ep(n);K.topRules.data.labels=i.map(o=>Fe?o.summary:Cp(o.summary,50)),K.topRules.data.datasets[0].data=i.map(o=>Lp(o.minutes,s)),K.topRules.update()}function Cp(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}function Ep(e){return e<60?"min":e<420?"h":"j"}function Lp(e,t){return t==="min"?e:t==="h"?Math.round(e/60*100)/100:Math.round(e/420*100)/100}function Ap(e){K.priorities&&(K.priorities.data.labels=e.map(t=>t.priority.charAt(0).toUpperCase()+t.priority.slice(1)),K.priorities.data.datasets[0].data=e.map(t=>t.minutes),K.priorities.update())}function Yl(e){return{migrationData:Dp(e),ruleData:Rp(e),priorityData:Pp(e)}}function Dp(e){let t={};return e.targets.forEach(i=>{i.migrations.forEach(n=>{t[n.migration]=(t[n.migration]||0)+n.totalTime.minutes})}),Wo.filter(i=>t[i]!==void 0).map(i=>({migration:i,minutes:t[i]}))}function Rp(e){let t=new Map;return e.targets.forEach(n=>{n.migrations.forEach(s=>{s.priorities.forEach(o=>{o.rules.forEach(r=>{let a=t.get(r.ruleKey);a?(a.minutes+=r.totalTime.minutes,a.occurrences+=r.occurrences):t.set(r.ruleKey,{summary:r.ruleSummary,minutes:r.totalTime.minutes,occurrences:r.occurrences})})})})}),Array.from(t.entries()).map(([n,s])=>({ruleKey:n,summary:s.summary,minutes:s.minutes,occurrences:s.occurrences})).sort((n,s)=>s.minutes-n.minutes)}function Pp(e){let t={};return e.targets.forEach(n=>{n.migrations.forEach(s=>{s.priorities.forEach(o=>{t[o.priority]=(t[o.priority]||0)+o.totalTime.minutes})})}),["obligatoire","recommande","optionnelle"].filter(n=>t[n]!==void 0).map(n=>({priority:n,minutes:t[n]}))}function Gl(e){return e.targets.filter(t=>t.targetType!=="monorepo").map(t=>({targetName:t.targetName,targetType:t.targetType,minutes:t.totalTime.minutes}))}function Op(e){if(!K.targets||e.projectInfo.type!=="nx-monorepo")return;let t=Gl(e).filter(i=>i.minutes>0);K.targets.data.labels=t.map(i=>`${i.targetType==="app"?"\u{1F4E6}":"\u{1F4DA}"} ${i.targetName}`),K.targets.data.datasets[0].data=t.map(i=>i.minutes),K.targets.update()}function Ip(){let e=document.getElementById("toggle-rules-details");e&&e.addEventListener("click",()=>{Fe=!Fe,e.textContent=Fe?"Voir r\xE9sum\xE9 (10 r\xE8gles)":"Voir d\xE9tails (20 r\xE8gles)",ql(oo)})}var K,Fe,Vl,oo,ro=C(()=>{"use strict";Bl();Ei();K={},Fe=!1,Vl=10,oo=[]});function Ul(e){return`
|
|
182
49
|
<section>
|
|
183
50
|
<h3 class="text-lg font-bold text-gray-800 mb-2">\u{1F4CB} Description</h3>
|
|
184
51
|
<p class="text-gray-700 whitespace-pre-line">${ft(e.description)}</p>
|
|
185
52
|
</section>
|
|
186
|
-
`}function
|
|
53
|
+
`}function Kl(e){return e.code_description?`
|
|
187
54
|
<section>
|
|
188
55
|
<h3 class="text-lg font-bold text-gray-800 mb-2">\u{1F4BB} Exemples de Code</h3>
|
|
189
56
|
<div class="bg-gray-50 p-4 rounded-lg">
|
|
190
57
|
<pre class="text-sm text-gray-800 overflow-x-auto whitespace-pre-wrap">${ft(e.code_description)}</pre>
|
|
191
58
|
</div>
|
|
192
59
|
</section>
|
|
193
|
-
`:""}function
|
|
60
|
+
`:""}function ao(e){return e==="nx-monorepo"}function Fp(e,t){return ao(t)&&e.nxMigrationCommand?e.nxMigrationCommand:e.migration_command}function Xl(e,t="angular-standalone"){let i=Fp(e,t);if(!i)return"";let n=i.replace(/'/g,"\\'"),s=ao(t)?"Nx":"Angular CLI",o=ao(t)?"purple":"blue";return`
|
|
194
61
|
<section>
|
|
195
62
|
<h3 class="text-lg font-bold text-gray-800 mb-2">
|
|
196
63
|
\u26A1 Commande de Migration
|
|
@@ -207,7 +74,7 @@
|
|
|
207
74
|
</button>
|
|
208
75
|
</div>
|
|
209
76
|
</section>
|
|
210
|
-
`}function
|
|
77
|
+
`}function Jl(e){return e.doc_url?`
|
|
211
78
|
<section>
|
|
212
79
|
<h3 class="text-lg font-bold text-gray-800 mb-2">\u{1F4DA} Documentation</h3>
|
|
213
80
|
<a
|
|
@@ -222,7 +89,7 @@
|
|
|
222
89
|
</svg>
|
|
223
90
|
</a>
|
|
224
91
|
</section>
|
|
225
|
-
`:""}function
|
|
92
|
+
`:""}function Zl(e){return e.length===0?`
|
|
226
93
|
<section>
|
|
227
94
|
<h3 class="text-lg font-bold text-gray-800 mb-2">\u{1F4C2} Fichiers Impact\xE9s</h3>
|
|
228
95
|
<p class="text-gray-500 italic">Aucune occurrence d\xE9tect\xE9e dans le projet.</p>
|
|
@@ -232,11 +99,11 @@
|
|
|
232
99
|
<h3 class="text-lg font-bold text-gray-800 mb-2">\u{1F4C2} Fichiers Impact\xE9s (${e.length})</h3>
|
|
233
100
|
<div class="bg-gray-50 rounded-lg p-4 max-h-64 overflow-y-auto">
|
|
234
101
|
<ul class="space-y-2">
|
|
235
|
-
${e.map(t
|
|
102
|
+
${e.map(t=>$p(t)).join("")}
|
|
236
103
|
</ul>
|
|
237
104
|
</div>
|
|
238
105
|
</section>
|
|
239
|
-
`}function
|
|
106
|
+
`}function $p(e){let t=e.matchedText.substring(0,100),i=e.matchedText.length>100?`${t}...`:t;return`
|
|
240
107
|
<li class="text-sm">
|
|
241
108
|
<div class="flex items-start justify-between">
|
|
242
109
|
<div class="flex-1">
|
|
@@ -255,7 +122,7 @@
|
|
|
255
122
|
</a>
|
|
256
123
|
</div>
|
|
257
124
|
</li>
|
|
258
|
-
`}function
|
|
125
|
+
`}function Ql(e){return`
|
|
259
126
|
<section class="border-t border-gray-200 pt-4">
|
|
260
127
|
<h3 class="text-lg font-bold text-gray-800 mb-2">\u{1F50D} M\xE9tadonn\xE9es</h3>
|
|
261
128
|
<div class="grid grid-cols-2 gap-3 text-sm">
|
|
@@ -277,12 +144,12 @@
|
|
|
277
144
|
</div>
|
|
278
145
|
</div>
|
|
279
146
|
</section>
|
|
280
|
-
`}var
|
|
147
|
+
`}var tc=C(()=>{"use strict";Ut();Rn()});function Hp(e){return{critical:"red",high:"orange",medium:"yellow",low:"green"}[e]||"gray"}function Wp(e,t,i="angular-standalone"){let n=`guide-card-${e.key}`,s=Hp(e.risk_level);return`
|
|
281
148
|
<div id="${n}"
|
|
282
149
|
class="bg-white border-2 border-gray-200 rounded-xl shadow-lg mb-6 overflow-hidden"
|
|
283
150
|
data-rule-card
|
|
284
151
|
data-rule-key="${e.key}"
|
|
285
|
-
data-migration="${
|
|
152
|
+
data-migration="${zp(e.key)}">
|
|
286
153
|
|
|
287
154
|
<!-- Header avec checkbox et badges -->
|
|
288
155
|
<div class="bg-gradient-to-r from-${s}-50 to-${s}-100 p-4 border-b border-gray-200">
|
|
@@ -299,9 +166,9 @@
|
|
|
299
166
|
<div class="flex-1">
|
|
300
167
|
<h3 class="text-xl font-bold text-gray-800 mb-2">${ft(e.summary)}</h3>
|
|
301
168
|
<div class="flex items-center flex-wrap gap-2">
|
|
302
|
-
${
|
|
303
|
-
${
|
|
304
|
-
${e.isAutoFixable?
|
|
169
|
+
${Be(e.risk_level.toUpperCase(),s)}
|
|
170
|
+
${Be(e.category,"blue")}
|
|
171
|
+
${e.isAutoFixable?Be("Auto-fixable","green"):""}
|
|
305
172
|
</div>
|
|
306
173
|
</div>
|
|
307
174
|
</div>
|
|
@@ -319,15 +186,15 @@
|
|
|
319
186
|
|
|
320
187
|
<!-- Contenu de la card (collapsible) - REPLI\xC9 PAR D\xC9FAUT -->
|
|
321
188
|
<div data-collapse-content class="hidden p-6 space-y-6">
|
|
322
|
-
${
|
|
323
|
-
${
|
|
324
|
-
${
|
|
325
|
-
${
|
|
326
|
-
${
|
|
327
|
-
${
|
|
189
|
+
${Ul(e)}
|
|
190
|
+
${Kl(e)}
|
|
191
|
+
${Xl(e,i)}
|
|
192
|
+
${Jl(e)}
|
|
193
|
+
${Zl(t)}
|
|
194
|
+
${Ql(e)}
|
|
328
195
|
</div>
|
|
329
196
|
</div>
|
|
330
|
-
`}function
|
|
197
|
+
`}function zp(e){return e.includes("_18_")?"to18":e.includes("_19_")?"to19":e.includes("_20_")?"to20":e.includes("_21_")?"to21":"unknown"}function ec(e,t,i="angular-standalone"){let n=new Map;return t.forEach(s=>{n.has(s.ruleKey)||n.set(s.ruleKey,[]),n.get(s.ruleKey).push(s)}),e.map(s=>Wp(s,n.get(s.key)||[],i)).join("")}var ic=C(()=>{"use strict";Ut();tc()});function Bp(e,t){return t[e]||"unknown"}function Vp(e,t){return t[e.key]||"obligatoire"}function Np(e,t,i,n){let s=new Map;return s.set("routine-obligatoire",[]),s.set("obligatoire",[]),s.set("recommande",[]),s.set("optionnelle",[]),e.filter(o=>Bp(o.key,n)===t).forEach(o=>{if(To(o))s.get("routine-obligatoire").push(o);else{let r=Vp(o,i);r==="obligatoire"?s.get("obligatoire").push(o):r==="recommande"?s.get("recommande").push(o):r==="optionnelle"&&s.get("optionnelle").push(o)}}),s}function nc(e,t){let{rules:i,matches:n,rulePriorityMap:s,ruleMigrationMap:o,projectInfo:r}=t,a=wo(n,d=>d.ruleKey),l=Np(i,e,s,o);["routine-obligatoire","obligatoire","recommande","optionnelle"].forEach(d=>{let u=document.getElementById(`cards-${d}`),h=document.getElementById(`count-${d}`),f=l.get(d)||[];u&&(f.length===0?u.innerHTML='<p class="text-gray-500 italic">Aucune r\xE8gle dans cette cat\xE9gorie pour cette migration.</p>':u.innerHTML=ec(f,n,r.type)),h&&(h.textContent=f.length.toString())}),jp()}function jp(){let e=R(_i,{});Object.keys(e).forEach(t=>{let i=document.querySelector(`[data-rule-checkbox="${t}"]`);i&&(i.checked=e[t])}),Sn()}function qp(e,t){let i=R(_i,{});i[e]=t,D(_i,i),Sn()}function Sn(){let e=R(_i,{}),i=document.querySelectorAll("[data-rule-checkbox]").length,n=Object.values(e).filter(Boolean).length,s=document.getElementById("progress-bar"),o=document.getElementById("progress-text");if(s&&o){let r=i>0?n/i*100:0;s.style.width=`${r}%`,o.textContent=`${n} / ${i} r\xE8gles compl\xE9t\xE9es`}}function Yp(){confirm("\xCAtes-vous s\xFBr de vouloir r\xE9initialiser toutes les r\xE8gles compl\xE9t\xE9es ?")&&(D(_i,{}),document.querySelectorAll("[data-rule-checkbox]").forEach(e=>{e.checked=!1}),Sn())}function sc(){let e=window.__MIGRATION_GUIDE_DATA__;if(!e){console.error("Migration Guide data not found");return}let t=document.getElementById("migration-selector"),i=t?.value||"to18";nc(i,e),t?.addEventListener("change",s=>{let o=s.target;nc(o.value,e)}),document.addEventListener("change",s=>{let o=s.target;if(o.matches("[data-rule-checkbox]")){let r=o.getAttribute("data-rule-checkbox");r&&qp(r,o.checked)}}),document.getElementById("reset-checklist-btn")?.addEventListener("click",Yp),Sn()}var _i,oc=C(()=>{"use strict";J();Ut();ic();_i="migration-guide-checklist"});function lo(e){let t=R(kn,rt),i=Gp(t);e.setState({selectedMigrations:i}),co(i),Up(e),Tn(i)}function Gp(e){if(!Array.isArray(e)||e.length===0)return rt;let t=e.filter(i=>rt.includes(i));return t.length>0?t:rt}function co(e){rt.forEach(t=>{let i=document.querySelector(`[data-migration-select="${t}"]`);i&&(i.checked=e.includes(t))}),ac(e)}function Up(e){rt.forEach(i=>{let n=document.querySelector(`[data-migration-select="${i}"]`);n&&n.addEventListener("change",()=>{Kp(e)})});let t=document.querySelector("[data-migration-select-all]");t&&t.addEventListener("click",()=>{Xp(e)})}function Kp(e){let t=rc();if(t.length===0){co(rt),D(kn,rt),e.setState({selectedMigrations:rt}),Tn(rt);return}D(kn,t),e.setState({selectedMigrations:t}),ac(t),Tn(t)}function Xp(e){let n=rc().length===rt.length?[rt[0]]:rt;co(n),D(kn,n),e.setState({selectedMigrations:n}),Tn(n)}function rc(){let e=[];return rt.forEach(t=>{document.querySelector(`[data-migration-select="${t}"]`)?.checked&&e.push(t)}),e}function ac(e){let t=document.querySelector("[data-migration-select-all]");if(!t)return;e.length===rt.length?(t.classList.remove("bg-gray-100","text-gray-600"),t.classList.add("bg-blue-100","text-blue-700","font-semibold")):(t.classList.remove("bg-blue-100","text-blue-700","font-semibold"),t.classList.add("bg-gray-100","text-gray-600"))}function Tn(e){let t=document.querySelector("[data-migration-count]");if(!t)return;let i=e.length,n=rt.length;i===n?t.textContent="Toutes":t.textContent=`${i}/${n}`,i===n?t.className="ml-2 px-2 py-1 bg-green-100 text-green-700 text-xs font-semibold rounded-full":t.className="ml-2 px-2 py-1 bg-blue-100 text-blue-700 text-xs font-semibold rounded-full"}var kn,rt,lc=C(()=>{"use strict";J();Ei();kn="selected-migrations",rt=Ve});function uo(e){let t=R(wn,at),i=Jp(t);e.setState({selectedPriorities:i}),ho(i),Zp(e),Cn(i)}function Jp(e){if(!Array.isArray(e)||e.length===0)return at;let t=e.filter(i=>at.includes(i));return t.length>0?t:at}function ho(e){at.forEach(t=>{let i=document.querySelector(`[data-priority-select="${t}"]`);i&&(i.checked=e.includes(t))}),dc(e)}function Zp(e){at.forEach(i=>{let n=document.querySelector(`[data-priority-select="${i}"]`);n&&n.addEventListener("change",()=>{Qp(e)})});let t=document.querySelector("[data-priority-select-all]");t&&t.addEventListener("click",()=>{tm(e)})}function Qp(e){let t=cc();if(t.length===0){ho(at),D(wn,at),e.setState({selectedPriorities:at}),Cn(at);return}D(wn,t),e.setState({selectedPriorities:t}),dc(t),Cn(t)}function tm(e){let n=cc().length===at.length?[at[0]]:at;ho(n),D(wn,n),e.setState({selectedPriorities:n}),Cn(n)}function cc(){let e=[];return at.forEach(t=>{document.querySelector(`[data-priority-select="${t}"]`)?.checked&&e.push(t)}),e}function dc(e){let t=document.querySelector("[data-priority-select-all]");if(!t)return;e.length===at.length?(t.classList.remove("bg-gray-100","text-gray-600"),t.classList.add("bg-purple-100","text-purple-700","font-semibold")):(t.classList.remove("bg-purple-100","text-purple-700","font-semibold"),t.classList.add("bg-gray-100","text-gray-600"))}function Cn(e){let t=document.querySelector("[data-priority-count]");if(!t)return;let i=e.length,n=at.length;i===n?t.textContent="Toutes":t.textContent=`${i}/${n}`,i===n?t.className="ml-2 px-2 py-1 bg-green-100 text-green-700 text-xs font-semibold rounded-full":t.className="ml-2 px-2 py-1 bg-purple-100 text-purple-700 text-xs font-semibold rounded-full"}var wn,at,uc=C(()=>{"use strict";J();wn="selected-priorities",at=["obligatoire","recommande","optionnelle"]});function fc(e){hc(e.getState()),e.subscribe(t=>{hc(t)})}function hc(e){let t=document.querySelector("[data-total-filters-count]");if(!t)return;let i=(e.selectedMigrations||[]).length,n=(e.selectedPriorities||[]).length,s=i+n,o=7;t.textContent=`${s}/${o} actifs`,s===o?t.className="ml-3 px-3 py-1.5 bg-green-100 text-green-700 text-sm font-semibold rounded-full":t.className="ml-3 px-3 py-1.5 bg-orange-100 text-orange-700 text-sm font-semibold rounded-full"}var gc=C(()=>{"use strict"});function xc(e,t,i,n,s,o){W={organizationMode:R(mc,"priority"),activeTab:R(bc,""),selectedMigrations:s,selectedPriorities:o,rules:e,matches:t,rulePriorityMap:i,ruleMigrationMap:n,sortState:R(yc,{column:"occurrences",direction:"desc"})},em(),vi()}function _c(e,t){W.selectedMigrations=e,W.selectedPriorities=t,vi()}function em(){document.querySelectorAll("[data-org-mode]").forEach(t=>{t.addEventListener("change",()=>{t.checked&&(W.organizationMode=t.value,D(mc,W.organizationMode),pc(),vi())})}),pc()}function pc(){document.querySelectorAll("[data-org-mode]").forEach(t=>{let i=t.closest("label");i&&(t.value===W.organizationMode?(t.checked=!0,i.classList.remove("bg-gray-50","border-gray-300"),i.classList.add("bg-purple-50","border-purple-500"),i.querySelector("span")?.classList.remove("text-gray-700","font-medium"),i.querySelector("span")?.classList.add("text-purple-700","font-semibold")):(i.classList.remove("bg-purple-50","border-purple-500"),i.classList.add("bg-gray-50","border-gray-300"),i.querySelector("span")?.classList.remove("text-purple-700","font-semibold"),i.querySelector("span")?.classList.add("text-gray-700","font-medium")))})}function vi(){im(),rm()}function im(){let e=document.getElementById("table-tabs");if(!e)return;let t=W.organizationMode==="priority"?[{key:"obligatoire",label:"Obligatoire",color:"red"},{key:"recommande",label:"Recommand\xE9",color:"yellow"},{key:"optionnelle",label:"Optionnel",color:"green"}]:[{key:"to18",label:"Angular 17 \u2192 18",color:"blue"},{key:"to19",label:"Angular 18 \u2192 19",color:"indigo"},{key:"to20",label:"Angular 19 \u2192 20",color:"purple"},{key:"to21",label:"Angular 20 \u2192 21",color:"pink"}];(!W.activeTab||!t.some(i=>i.key===W.activeTab))&&(W.activeTab=t[0].key),e.innerHTML=t.map(i=>{let n=i.key===W.activeTab,s=sm(i.key);return`
|
|
331
198
|
<button
|
|
332
199
|
data-tab="${i.key}"
|
|
333
200
|
class="flex-1 px-6 py-4 text-center font-semibold transition-all ${n?`bg-white text-${i.color}-700 border-b-2 border-${i.color}-500`:"bg-gray-50 text-gray-600 hover:bg-gray-100"}"
|
|
@@ -337,7 +204,7 @@
|
|
|
337
204
|
${s}
|
|
338
205
|
</span>
|
|
339
206
|
</button>
|
|
340
|
-
`}).join(""),
|
|
207
|
+
`}).join(""),nm()}function nm(){document.querySelectorAll("[data-tab]").forEach(t=>{t.addEventListener("click",()=>{let i=t.dataset.tab;i&&(W.activeTab=i,D(bc,W.activeTab),vi())})})}function sm(e){return vc(e).length}function vc(e){let t=W.rules.filter(i=>{let n=W.ruleMigrationMap[i.key],s=W.rulePriorityMap[i.key];if(W.organizationMode==="priority"){if(s!==e)return!1}else if(n!==e)return!1;return!(!W.selectedMigrations.includes(n)||!W.selectedPriorities.includes(s))});return om(t)}function om(e){let{column:t,direction:i}=W.sortState,n=i==="asc"?1:-1;return[...e].sort((s,o)=>{let r=0;switch(t){case"risk_level":{let a={critical:4,high:3,medium:2,low:1};r=(a[s.risk_level]||0)-(a[o.risk_level]||0);break}case"key":r=s.key.localeCompare(o.key);break;case"summary":r=s.summary.localeCompare(o.summary);break;case"occurrences":{let a=fo(s.key),l=fo(o.key);r=a-l;break}case"time":r=s.estimated_time_per_occurrence-o.estimated_time_per_occurrence;break;case"schematics":{let a=s.migration_command?1:0,l=o.migration_command?1:0;r=a-l;break}}return r*n})}function rm(){let e=document.getElementById("table-content");if(!e)return;let t=vc(W.activeTab);if(t.length===0){e.innerHTML=`
|
|
341
208
|
<div class="text-center py-12 text-gray-500">
|
|
342
209
|
<svg class="w-16 h-16 mx-auto mb-4 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
343
210
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"/>
|
|
@@ -367,11 +234,11 @@
|
|
|
367
234
|
</tr>
|
|
368
235
|
</thead>
|
|
369
236
|
<tbody class="divide-y divide-gray-200">
|
|
370
|
-
${t.map(i=>
|
|
237
|
+
${t.map(i=>cm(i)).join("")}
|
|
371
238
|
</tbody>
|
|
372
239
|
</table>
|
|
373
240
|
</div>
|
|
374
|
-
`,
|
|
241
|
+
`,am()}function $e(e,t,i){let n=W.sortState.column===e,s=W.sortState.direction;return`
|
|
375
242
|
<th
|
|
376
243
|
class="px-4 py-3 ${i} text-xs font-semibold text-gray-600 uppercase tracking-wider cursor-pointer hover:bg-gray-100 transition-colors select-none"
|
|
377
244
|
data-sort-column="${e}"
|
|
@@ -382,7 +249,7 @@
|
|
|
382
249
|
<span class="${n?"text-blue-600":"text-gray-400"}">${n?s==="asc"?"\u25B2":"\u25BC":"\u21C5"}</span>
|
|
383
250
|
</div>
|
|
384
251
|
</th>
|
|
385
|
-
`}function
|
|
252
|
+
`}function am(){document.querySelectorAll("[data-sort-column]").forEach(t=>{t.addEventListener("click",()=>{let i=t.dataset.sortColumn;i&&lm(i)})})}function lm(e){W.sortState.column===e?W.sortState.direction=W.sortState.direction==="asc"?"desc":"asc":(W.sortState.column=e,W.sortState.direction="desc"),D(yc,W.sortState),vi()}function cm(e){let t=fo(e.key),i=t>0,n={critical:{bg:"bg-red-100",text:"text-red-700"},high:{bg:"bg-orange-100",text:"text-orange-700"},medium:{bg:"bg-yellow-100",text:"text-yellow-700"},low:{bg:"bg-green-100",text:"text-green-700"}},s=n[e.risk_level]||n.low;return`
|
|
386
253
|
<tr class="${i?"bg-white":"bg-gray-50"} hover:bg-blue-50 transition-colors">
|
|
387
254
|
<td class="px-4 py-4 whitespace-nowrap">
|
|
388
255
|
<span class="px-3 py-1 ${s.bg} ${s.text} text-xs font-semibold rounded-full">
|
|
@@ -407,7 +274,158 @@
|
|
|
407
274
|
${e.migration_command?'<span class="px-3 py-1 bg-green-100 text-green-700 text-xs font-semibold rounded-full">\u2713 Oui</span>':'<span class="px-3 py-1 bg-gray-200 text-gray-500 text-xs rounded-full">Manuel</span>'}
|
|
408
275
|
</td>
|
|
409
276
|
</tr>
|
|
410
|
-
`}function
|
|
277
|
+
`}function fo(e){return W.matches.filter(t=>t.ruleKey===e).length}var mc,bc,yc,W,Mc=C(()=>{"use strict";J();mc="rules-table-organization",bc="rules-table-active-tab",yc="rules-table-sort"});function kc(e){let t=document.querySelector("[data-layer-selector]");if(!t)return;let i=R(go,[]);e.setState({hiddenLayers:i});let n=t.querySelectorAll('input[type="checkbox"]');n.forEach(s=>{let o=s.value;s.checked=!i.includes(o)}),Tc(t),po(i),dm(t),n.forEach(s=>{s.addEventListener("change",()=>{let o=um(t);hm(o,e,t)})})}function dm(e){let t=e.querySelector("[data-layer-dropdown-trigger]"),i=e.querySelector("[data-layer-dropdown-content]");!t||!i||(t.addEventListener("click",n=>{n.stopPropagation(),i.classList.toggle("hidden")}),document.addEventListener("click",n=>{e.contains(n.target)||i.classList.add("hidden")}))}function Tc(e){let t=e.querySelector("[data-layer-badge]");if(!t)return;let i=e.querySelectorAll('input[type="checkbox"]'),n=i.length,s=Array.from(i).filter(o=>o.checked).length;t.textContent=`${s}/${n}`}function um(e){let t=e.querySelectorAll('input[type="checkbox"]'),i=[];return t.forEach(n=>{n.checked||i.push(n.value)}),i}function hm(e,t,i){t.setState({hiddenLayers:e}),D(go,e),Tc(i),po(e)}function po(e){let t=fm(e);if(document.querySelectorAll("[data-view-mode]").forEach(s=>{s.style.display="none"}),document.querySelectorAll(`[data-view-mode="${t}"]`).forEach(s=>{s.style.display=""}),!t.startsWith("merged-")){let s=e.includes("apps-libs");document.querySelectorAll('[data-layer="apps-libs"]').forEach(a=>{Sc(a,s)}),document.querySelectorAll('[data-layer="sub-target"]').forEach(a=>{Sc(a,s)})}fr()}function fm(e){let t=e.includes("apps-libs"),i=e.includes("migration"),n=e.includes("priority"),o=document.querySelector("[data-hierarchy-view-select]")?.value==="by-priority",r=t?"merged-":"";return i&&n?`${r}flat-rules`:i?`${r}flat-priority`:n?`${r}flat-migration`:o?`${r}by-priority`:`${r}by-migration`}function Sc(e,t){if(t){let i=e.querySelector("[data-collapse-trigger]");i&&(i.style.display="none");let n=e.querySelector("[data-collapse-content]");n&&(n.classList.remove("hidden"),n.style.marginTop="0"),e.classList.remove("ml-8","ml-6"),e.classList.add("ml-0"),e.style.borderLeft="none",e.style.paddingLeft="0"}else{let i=e.querySelector("[data-collapse-trigger]");i&&(i.style.display="");let n=e.querySelector("[data-collapse-content]");n&&(n.style.marginTop=""),e.classList.remove("ml-0"),e.getAttribute("data-layer")==="apps-libs"?e.classList.add("ml-6"):e.classList.add("ml-8"),e.style.borderLeft="",e.style.paddingLeft=""}}function gm(){return R(go,[])}function wc(){let e=gm();po(e)}var go,mo=C(()=>{"use strict";ze();Kn();go="hidden-layers"});function Ec(e){let t=document.querySelector("[data-hierarchy-view-select]");if(!t)return;let i=R(Cc,"by-migration");e.setState({hierarchyViewMode:i}),t.value=i,Lc(i),t.addEventListener("change",()=>{let n=t.value;(n==="by-migration"||n==="by-priority")&&pm(n,e)})}function pm(e,t){t.setState({hierarchyViewMode:e}),D(Cc,e),Lc(e)}function Lc(e){wc()}var Cc,Ac=C(()=>{"use strict";ze();mo();Cc="hierarchy-view-mode"});function Dc(e,t){if(["obligatoire","recommande","optionnelle"].every(l=>t.includes(l))||t.length===0)return e;let s=mm(e.targets,t),o=ym(s),r=s.reduce((l,c)=>l+c.totalTime.minutes,0),a=$(r,7);return{...e,targets:s,stats:o,totalTime:a}}function mm(e,t){return e.map(i=>{let n=bm(i.migrations,t),s=n.reduce((o,r)=>o+r.totalTime.minutes,0);return{...i,migrations:n,totalTime:$(s,7)}}).filter(i=>i.migrations.length>0)}function bm(e,t){return e.map(i=>{let n=i.priorities.filter(o=>t.includes(o.priority)),s=n.reduce((o,r)=>o+r.totalTime.minutes,0);return{...i,priorities:n,totalTime:$(s,7)}}).filter(i=>i.priorities.length>0)}function ym(e){let t=new Set,i=0,n=0;for(let s of e)for(let o of s.migrations)for(let r of o.priorities)for(let a of r.rules)t.add(a.ruleKey),i+=a.occurrences,a.specialWorkloadFiles!==void 0&&(n+=a.specialWorkloadFiles);return{uniqueRules:t.size,totalOccurrences:i,totalSpecialWorkloadFiles:n}}var Rc=C(()=>{"use strict";fe()});function bo(e,t,i){let n=zo(t.workloadReport,e.selectedMigrations||["to18","to19","to20","to21"]),s=Dc(n,e.selectedPriorities||["obligatoire","recommande","optionnelle"]),o=Do(s,e.customTimes,e.hoursPerDay,t.rules||[],e.customSpecialTimes),r=Ro(o,e.devCount,e.hoursPerDay);xm(r.original,r.adjusted,e.devCount),_m(o.stats),vm(e.selectedMigrations||["to18","to19","to20","to21"]),Mm(e.selectedPriorities||["obligatoire","recommande","optionnelle"]),Io(o),jl(o),i(o,e)}function xm(e,t,i){let n=document.querySelector("[data-global-time]");n&&(n.textContent=G(e));let s=document.querySelector("[data-adjusted-time]");s&&(s.textContent=G(t));let o=document.querySelector("[data-dev-info]");o&&(o.textContent=`(${i} d\xE9veloppeur${i>1?"s":""})`)}function _m(e){let t=document.querySelectorAll(".bg-gradient-to-br");if(t.length>=4){let i=t[1].querySelector(".text-indigo-600");i&&(i.textContent=String(e.uniqueRules));let n=t[2].querySelector(".text-purple-600");n&&(n.textContent=String(e.totalOccurrences));let s=t[3].querySelector(".text-pink-600");s&&(s.textContent=String(e.totalSpecialWorkloadFiles))}}function vm(e){document.querySelectorAll("[data-migration]").forEach(i=>{let n=i,s=n.dataset.migration;s&&!e.includes(s)?n.style.display="none":n.style.display=""})}function Mm(e){document.querySelectorAll("[data-priority]").forEach(i=>{let n=i,s=n.dataset.priority;s&&!e.includes(s)?n.style.display="none":n.style.display=""})}var Pc=C(()=>{"use strict";ro();J();Fn();Rc()});function Sm(e,t){let i=new Date(e);for(;i<=t;){let n=i.getDay();if(n===0||n===6)return!0;i=ki(i,1)}return!1}function Oc(e,t,i){let n=document.getElementById(e);if(!n)return;if(t.length===0){n.innerHTML='<p class="text-gray-500">Aucune migration \xE0 afficher</p>';return}let s=800,o=40,r=50,a=20,l=120,c=s-l-40,d=o+t.length*(r+a)+20,u=t.reduce((y,_)=>y+_.duration,0),h=t[0]?.startDate||new Date,f=t[t.length-1]?.endDate||new Date,g=km(h,f,u,l,c,o,d),p=Tm(t,u,l,c,o,r,a,i),m=Date.now(),b=`
|
|
278
|
+
<svg width="${s}" height="${d}" xmlns="http://www.w3.org/2000/svg" class="gantt-chart" data-render="${m}">
|
|
279
|
+
<style>
|
|
280
|
+
.gantt-chart { font-family: system-ui, -apple-system, sans-serif; }
|
|
281
|
+
.task-bar { cursor: pointer; transition: opacity 0.2s; }
|
|
282
|
+
.task-bar:hover { opacity: 0.9; }
|
|
283
|
+
</style>
|
|
284
|
+
${g}
|
|
285
|
+
${p}
|
|
286
|
+
</svg>
|
|
287
|
+
`;n.innerHTML=b}function km(e,t,i,n,s,o,r){let a="";a+=`
|
|
288
|
+
<rect
|
|
289
|
+
x="${n}"
|
|
290
|
+
y="${o}"
|
|
291
|
+
width="${s}"
|
|
292
|
+
height="${r-o}"
|
|
293
|
+
fill="#f9fafb"
|
|
294
|
+
/>
|
|
295
|
+
`;let l=7;for(let c=0;c<=i;c+=l){let d=n+c/i*s;a+=`
|
|
296
|
+
<line
|
|
297
|
+
x1="${d}"
|
|
298
|
+
y1="${o}"
|
|
299
|
+
x2="${d}"
|
|
300
|
+
y2="${r}"
|
|
301
|
+
stroke="#e5e7eb"
|
|
302
|
+
stroke-width="1"
|
|
303
|
+
stroke-dasharray="4,4"
|
|
304
|
+
/>
|
|
305
|
+
`;let u=ki(e,c);a+=`
|
|
306
|
+
<text
|
|
307
|
+
x="${d}"
|
|
308
|
+
y="${o-10}"
|
|
309
|
+
fill="#6b7280"
|
|
310
|
+
font-size="12"
|
|
311
|
+
text-anchor="middle"
|
|
312
|
+
>
|
|
313
|
+
${Lo(u)}
|
|
314
|
+
</text>
|
|
315
|
+
`}return a}function Tm(e,t,i,n,s,o,r,a){let l="",c=0;return e.forEach((d,u)=>{let h=s+u*(o+r)+r,f=i+c/t*n,g=d.duration/t*n;l+=wm(d,f,h,g,o,a?.[u]),l+=Em(d,f,h,g,o),l+=Lm(d,h,o),c+=d.duration}),l}function wm(e,t,i,n,s,o){let r=o?Am(o):"",a=e.startDate&&e.endDate?Sm(e.startDate,e.endDate):!1;return`
|
|
316
|
+
<g class="task-bar" ${r}>
|
|
317
|
+
<rect
|
|
318
|
+
x="${t}"
|
|
319
|
+
y="${i}"
|
|
320
|
+
width="${n}"
|
|
321
|
+
height="${s}"
|
|
322
|
+
fill="${e.color}"
|
|
323
|
+
rx="6"
|
|
324
|
+
opacity="0.85"
|
|
325
|
+
/>
|
|
326
|
+
${a?Cm(t,i,n,e.color):""}
|
|
327
|
+
<text
|
|
328
|
+
x="${t+n/2}"
|
|
329
|
+
y="${i+s/2+5}"
|
|
330
|
+
text-anchor="middle"
|
|
331
|
+
fill="white"
|
|
332
|
+
font-size="14"
|
|
333
|
+
font-weight="600"
|
|
334
|
+
>
|
|
335
|
+
${e.duration.toFixed(1)}j
|
|
336
|
+
</text>
|
|
337
|
+
</g>
|
|
338
|
+
`}function Cm(e,t,i,n){return`
|
|
339
|
+
<rect
|
|
340
|
+
x="${e+i-20}"
|
|
341
|
+
y="${t+5}"
|
|
342
|
+
width="16"
|
|
343
|
+
height="16"
|
|
344
|
+
fill="white"
|
|
345
|
+
rx="3"
|
|
346
|
+
opacity="0.9"
|
|
347
|
+
/>
|
|
348
|
+
<text
|
|
349
|
+
x="${e+i-12}"
|
|
350
|
+
y="${t+16}"
|
|
351
|
+
text-anchor="middle"
|
|
352
|
+
fill="${n}"
|
|
353
|
+
font-size="10"
|
|
354
|
+
font-weight="700"
|
|
355
|
+
>
|
|
356
|
+
\u23F8
|
|
357
|
+
</text>
|
|
358
|
+
`}function Em(e,t,i,n,s){if(!e.startDate||!e.endDate)return"";let o=Pn(e.startDate),r=Pn(e.endDate);return`
|
|
359
|
+
<text
|
|
360
|
+
x="${t}"
|
|
361
|
+
y="${i+s+15}"
|
|
362
|
+
fill="#6b7280"
|
|
363
|
+
font-size="11"
|
|
364
|
+
class="task-start-date"
|
|
365
|
+
>
|
|
366
|
+
${o}
|
|
367
|
+
</text>
|
|
368
|
+
<text
|
|
369
|
+
x="${t+n}"
|
|
370
|
+
y="${i+s+15}"
|
|
371
|
+
text-anchor="end"
|
|
372
|
+
fill="#6b7280"
|
|
373
|
+
font-size="11"
|
|
374
|
+
class="task-end-date"
|
|
375
|
+
>
|
|
376
|
+
${r}
|
|
377
|
+
</text>
|
|
378
|
+
`}function Lm(e,t,i){return`
|
|
379
|
+
<text
|
|
380
|
+
x="10"
|
|
381
|
+
y="${t+i/2+5}"
|
|
382
|
+
fill="#374151"
|
|
383
|
+
font-size="14"
|
|
384
|
+
font-weight="500"
|
|
385
|
+
>
|
|
386
|
+
${e.label}
|
|
387
|
+
</text>
|
|
388
|
+
`}function Am(e){return`
|
|
389
|
+
data-migration="${e.migration}"
|
|
390
|
+
data-routine-minutes="${e.routineMinutes}"
|
|
391
|
+
data-parallelizable-minutes="${e.parallelizableMinutes}"
|
|
392
|
+
data-total-minutes-before="${e.totalMinutesBeforeDevs}"
|
|
393
|
+
data-total-days-after="${e.totalDaysAfterDevs}"
|
|
394
|
+
data-dev-count="${e.devCount}"
|
|
395
|
+
data-hours-per-day="${e.hoursPerDay}"
|
|
396
|
+
`.trim()}var Ic=C(()=>{"use strict";J()});function Fc(){Ai({id:En,theme:"light",maxWidth:350}),Dm()}function Dm(){document.querySelectorAll(".task-bar").forEach(t=>{t.addEventListener("mouseenter",i=>Rm(i,t)),t.addEventListener("mousemove",Pm),t.addEventListener("mouseleave",Om)})}function Rm(e,t){let i=Im(t);Hn(En,i,e)}function Pm(e){zn(En,e)}function Om(){Wn(En)}function Im(e){let t=e.dataset.migration||"N/A",i=parseFloat(e.dataset.routineMinutes||"0"),n=parseFloat(e.dataset.parallelizableMinutes||"0"),s=parseFloat(e.dataset.totalMinutesBefore||"0"),o=parseFloat(e.dataset.totalDaysAfter||"0"),r=parseInt(e.dataset.devCount||"1",10),a=parseFloat(e.dataset.hoursPerDay||"7"),l=$(i,a),c=$(n,a),d=$(s,a),u=r>1?G($(n/r,a)):"";return`
|
|
397
|
+
<div style="margin-bottom: 8px;">
|
|
398
|
+
<strong style="color: #1f2937; font-size: 14px;">${t}</strong>
|
|
399
|
+
</div>
|
|
400
|
+
<div style="color: #6b7280; margin-bottom: 6px;">
|
|
401
|
+
<strong>Temps initial :</strong> ${G(d)}
|
|
402
|
+
</div>
|
|
403
|
+
<div style="margin: 8px 0; padding: 8px; background: #f9fafb; border-radius: 4px;">
|
|
404
|
+
<div style="margin-bottom: 4px;">
|
|
405
|
+
\u{1F512} <strong>S\xE9quentiel :</strong> ${G(l)}
|
|
406
|
+
<span style="color: #6b7280; font-size: 12px;">(obligatoires \u{1F534} uniquement)</span>
|
|
407
|
+
</div>
|
|
408
|
+
<div>
|
|
409
|
+
\u26A1 <strong>Parall\xE9lisable :</strong> ${G(c)}
|
|
410
|
+
<span style="color: #6b7280; font-size: 12px;">(routines + recommand\xE9es \u{1F7E1} + optionnelles \u{1F7E2})</span>
|
|
411
|
+
${r>1?`<br><span style="color: #6b7280; font-size: 12px;">\u2192 \xF7 ${r} devs = ${u}</span>`:""}
|
|
412
|
+
</div>
|
|
413
|
+
</div>
|
|
414
|
+
<div style="margin-top: 8px; padding-top: 8px; border-top: 1px solid #e5e7eb; color: #059669; font-weight: 600;">
|
|
415
|
+
\u{1F4C5} <strong>Dur\xE9e finale :</strong> ${o.toFixed(1)}j
|
|
416
|
+
${r>1?`<span style="color: #6b7280; font-weight: normal; font-size: 12px;">(${r} devs)</span>`:""}
|
|
417
|
+
</div>
|
|
418
|
+
`}var En,$c=C(()=>{"use strict";J();En="gantt-tooltip"});function Hc(e,t){document.getElementById("gantt-timeline")&&Ln(e,t)}function Ln(e,t){if(!e)return;let i=new Date(t.startDate),{tasks:n,details:s}=$o(e,t.devCount,t.hoursPerDay,i);Oc("gantt-timeline",n,s),setTimeout(()=>Fc(),100)}var Wc=C(()=>{"use strict";J();Ic();$c()});function Bc(e){if(!e||e.length===0)return;let t=new Map(e.map(n=>[n.key,n]));document.querySelectorAll("[data-rule-card]").forEach(n=>{let s=n,o=s.dataset.ruleKey;if(!o)return;let r=t.get(o);r&&(s.dataset.riskLevel=r.risk_level,s.dataset.category=r.category,s.dataset.autofixable=r.isAutoFixable?"true":"false")})}function Vc(){let t=window.__REPORT_DATA__,i=parseInt(t?.workloadReport?.projectInfo?.angularVersion||"0",10),n=new Map((t?.rules||[]).map(o=>[o.key,o]));Ai({id:zc,theme:"dark",maxWidth:280}),document.querySelectorAll('[data-rule-card][data-autofixable="true"]').forEach(o=>{let r=o,a=r.dataset.ruleKey;if(!a)return;let l=r.querySelector(`[data-ai-fix-btn="${a}"]`);if(!l)return;let d=n.get(a)?.minAngularVersion||0,u=i===0||d===0||i>=d;l.classList.remove("hidden"),u?$m(l,a):Fm(l,d,i)})}function Fm(e,t,i){e.classList.add("opacity-50","cursor-not-allowed"),e.classList.remove("hover:bg-purple-600"),e.dataset.disabled="true",e.dataset.minVersion=String(t),e.dataset.projectVersion=String(i),jo(e,zc,Hm)}function $m(e,t){e.addEventListener("click",async()=>{let i=`npx migration-planificator fix --rule=${t}`;await Ti(i)&&wi(e)})}function Hm(e){let t=e.dataset.minVersion||"?",i=e.dataset.projectVersion||"?";return`
|
|
419
|
+
<div style="margin-bottom: 4px; font-weight: 600;">
|
|
420
|
+
<span style="color: #fbbf24;">\u26A0</span> Version Angular incompatible
|
|
421
|
+
</div>
|
|
422
|
+
<div style="color: #d1d5db;">
|
|
423
|
+
Cette migration requiert <strong style="color: #a78bfa;">Angular ${t}+</strong>
|
|
424
|
+
</div>
|
|
425
|
+
<div style="color: #9ca3af; margin-top: 4px; font-size: 12px;">
|
|
426
|
+
Version du projet : Angular ${i}
|
|
427
|
+
</div>
|
|
428
|
+
`}var zc,Nc=C(()=>{"use strict";J();zc="aifix-tooltip"});function jc(e){Mi=e}function qc(){let e=window;e.expandAll=Yo,e.collapseAll=Go,e.resetAllCustomTimes=Wm,e.resetTeamConfig=zm,e.copyRuleCommand=Bm}function Wm(){if(!Mi){console.warn("State not initialized");return}confirm("Etes-vous sur de vouloir reinitialiser tous les temps personnalises ?")&&Mi.resetAllCustomTimes()}function zm(){if(!Mi){console.warn("State not initialized");return}if(confirm("Etes-vous sur de vouloir reinitialiser la configuration d'equipe ?")){let e=new Date().toISOString().split("T")[0];Mi.setState({devCount:1,hoursPerDay:7,startDate:e});let t=document.querySelector("[data-start-date]"),i=document.querySelector("[data-dev-count]"),n=document.querySelector("[data-hours-per-day]");t&&(t.value=e),i&&(i.value="1"),n&&(n.value="7")}}async function Bm(e,t){if(await Ti(t))wi(e);else{let n=e.textContent||"";e.textContent="Erreur",setTimeout(()=>{e.textContent=n},2e3)}}var Mi,Yc=C(()=>{"use strict";Ne();J();Mi=null});var Um=Kc(()=>{vo();Ne();Jo();tr();Kn();mr();_r();Mr();ro();oc();lc();uc();gc();Mc();Ac();mo();Pc();Wc();Nc();Yc();J();document.addEventListener("DOMContentLoaded",()=>{let e=window;Vm(e)||Nm(e)||jm(e)});function Vm(e){return e.__MIGRATION_GUIDE_DATA__?(Bn(),sc(),!0):!1}function Nm(e){let t=e.__RULES_OVERVIEW_DATA__;if(!t)return!1;let i=new he({devCount:1,hoursPerDay:7,customTimes:{},customSpecialTimes:{},startDate:new Date().toISOString().split("T")[0],selectedMigrations:["to18","to19","to20","to21"],selectedPriorities:["obligatoire","recommande","optionnelle"],hierarchyViewMode:"by-migration",hiddenLayers:[]});return lo(i),uo(i),xc(t.rules,t.matches,t.rulePriorityMap,t.ruleMigrationMap,i.getState().selectedMigrations,i.getState().selectedPriorities),i.subscribe(n=>{_c(n.selectedMigrations,n.selectedPriorities)}),!0}function jm(e){let t=e.__REPORT_DATA__;if(!t){console.warn("No report data found");return}let i=qm();jc(i),Ym(i,t),Hc(t.workloadReport,i.getState()),i.subscribe(n=>{bo(n,t,(s,o)=>{Ln(s,o)})}),bo(i.getState(),t,(n,s)=>{Ln(n,s)}),Gm(i)}function qm(){let e=new Date().toISOString().split("T")[0],t=he.loadCustomTimesFromStorage();return new he({devCount:1,hoursPerDay:7,customTimes:t.customTimes,customSpecialTimes:t.customSpecialTimes,startDate:e,selectedMigrations:["to18","to19","to20","to21"],selectedPriorities:["obligatoire","recommande","optionnelle"],hierarchyViewMode:"by-migration",hiddenLayers:[]})}function Ym(e,t){Bn(),Xo(),Zo(),Qo(),Bc(t.rules),vr(),Vc(),hr(),pr(e),yr(),lo(e),uo(e),fc(e),Ec(e),kc(e),Nl(t.workloadReport),qc()}function Gm(e){let t=document.querySelector("[data-start-date]"),i=document.querySelector("[data-dev-count]"),n=document.querySelector("[data-hours-per-day]");if(t&&t.addEventListener("change",()=>{let s=t.value;s&&e.setState({startDate:s})}),i){let s=Kt(o=>{e.setState({devCount:o})},300);i.addEventListener("input",()=>{let o=parseInt(i.value,10);!isNaN(o)&&o>=1&&o<=20&&s(o)})}if(n){let s=Kt(o=>{e.setState({hoursPerDay:o})},300);n.addEventListener("input",()=>{let o=parseFloat(n.value);!isNaN(o)&&o>=1&&o<=10&&s(o)})}}});Um();})();
|
|
411
429
|
/*! Bundled license information:
|
|
412
430
|
|
|
413
431
|
@kurkle/color/dist/color.esm.js:
|