(()=>{let l=(e,t)=>{t=document.getElementById(t);let l=t.querySelector("ul");return l||((l=document.createElement("ul")).classList.add("custom-legend-ul"),t.appendChild(l)),l};window.LegendUtils={getOrCreateLegendList:l,htmlLegendPlugin:{id:"htmlLegend",afterUpdate(n,e,t){let a=l(0,t.containerID);for(;a.firstChild;)a.firstChild.remove();n.options.plugins.legend.labels.generateLabels(n).forEach(e=>{var t=document.createElement("li"),l=(t.classList.add("custom-legend-li"),t.onclick=()=>{n.setDatasetVisibility(e.datasetIndex,!n.isDatasetVisible(e.datasetIndex)),n.update()},document.createElement("span")),d=(l.classList.add("legend-box"),l.style.backgroundColor=e.fillStyle,document.createElement("span"));d.textContent=e.text,d.style.textDecoration=e.hidden?"line-through":"",t.appendChild(l),t.appendChild(d),a.appendChild(t)})}}}})();