PageSourceSearch

https://snew.ai/assets/InsightChatPage-DDDwZe1q.js

js snew.ai collected 2026-10-05 15:08:38 UTC 243,957 bytes, 21 lines download raw bytes

1var no=Object.defineProperty;var oo=(i,t,e)=>t in i?no(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var P=(i,t,e)=>oo(i,typeof t!="symbol"?t+"":t,e);import{r as y,j as g,av as ao,u as ro}from"./index-L9AYrVUw.js";import{p as Me,C as _,m as S,R as z,aC as q,a7 as ln,b0 as ge,s as lo,a6 as co,a3 as cn,aE as ho,a4 as uo,b as fo}from"./PlanAccessModal-P_W2GThH.js";import{s as go}from"./CaretDoubleLeft.es-C52M4NEJ.js";import{g as po}from"./catalog-CfClaC1r.js";import{c as mo}from"./CalendarBlank.es-Bgk8atoI.js";import{n as bo}from"./ChartBar.es-DrVdFqT3.js";import{h as Vi}from"./App-DyVHSnY3.js";import{C as xo}from"./ChatAvatar-w6xrLrWn.js";import{U as yo}from"./UserBubble-CxEIzIZr.js";import{M as _o}from"./index-BFnbqzYg.js";import{r as vo}from"./index-C7qqVJo6.js";import{s as So}from"./CheckCircle.es-PkF6a2W-.js";import{c as Mo}from"./Warning.es-rGCmkxYb.js";import{s as ko}from"./CaretLeft.es-CVEVfjVi.js";import{s as wo,V as Ao,A as Co}from"./FloatingTopMenu-CIhwk2RR.js";import{s as Do}from"./ChatCircle.es-ys8V5LKI.js";import{n as Po}from"./Target.es-Ds7XP-fd.js";import{n as Ro}from"./Users.es-CZggLr1m.js";import{c as To}from"./ArrowDown.es-BZtv_81U.js";import{s as Oo}from"./ArrowUp.es-sg_sCqx1.js";import{m as jo}from"./Minus.es-Dn8w88Wl.js";import{C as Fo}from"./ChatInput-AHNVbRXo.js";import"./productFunnel-DiJFcMU2.js";import"./locale-Cctu0V3Y.js";import"./index-p7aFGi8o.js";import"./Trash.es-D2Zs5Rpt.js";import"./dissolve-CQo8GAUH.js";import"./SnewLogo-Cg53XTnQ.js";import"./boardChromeCopy-DnmOEM-I.js";import"./welcomeBoard-4xJYHWeA.js";const Eo=new Map([["bold",y.createElement(y.Fragment,null,y.createElement("path",{d:"M128,84a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,84Zm0,64a20,20,0,1,1,20-20A20,20,0,0,1,128,148Zm77.39,12.7A83.94,83.94,0,0,1,190.61,184a12,12,0,0,1-17.89-16,59.92,59.92,0,0,0,0-80,12,12,0,0,1,17.89-16,84.07,84.07,0,0,1,14.78,88.7ZM83.28,168a12,12,0,0,1-17.89,16,83.94,83.94,0,0,1,0-112A12,12,0,0,1,83.28,88a59.92,59.92,0,0,0,0,80ZM252,128a123.63,123.63,0,0,1-35.43,86.78A12,12,0,1,1,199.43,198a99.88,99.88,0,0,0,0-140,12,12,0,0,1,17.14-16.8A123.63,123.63,0,0,1,252,128ZM56.57,198a12,12,0,0,1-17.14,16.8,123.89,123.89,0,0,1,0-173.56A12,12,0,0,1,56.57,58a99.88,99.88,0,0,0,0,140Z"}))],["duotone",y.createElement(y.Fragment,null,y.createElement("path",{d:"M160,128a32,32,0,1,1-32-32A32,32,0,0,1,160,128Z",opacity:"0.2"}),y.createElement("path",{d:"M128,88a40,40,0,1,0,40,40A40,40,0,0,0,128,88Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,152Zm73.71,7.14a80,80,0,0,1-14.08,22.2,8,8,0,0,1-11.92-10.67,63.95,63.95,0,0,0,0-85.33,8,8,0,1,1,11.92-10.67,80.08,80.08,0,0,1,14.08,84.47ZM69,103.09a64,64,0,0,0,11.26,67.58,8,8,0,0,1-11.92,10.67,79.93,79.93,0,0,1,0-106.67A8,8,0,1,1,80.29,85.34,63.77,63.77,0,0,0,69,103.09ZM248,128a119.58,119.58,0,0,1-34.29,84,8,8,0,1,1-11.42-11.2,103.9,103.9,0,0,0,0-145.56A8,8,0,1,1,213.71,44,119.58,119.58,0,0,1,248,128ZM53.71,200.78A8,8,0,1,1,42.29,212a119.87,119.87,0,0,1,0-168,8,8,0,1,1,11.42,11.2,103.9,103.9,0,0,0,0,145.56Z"}))],["fill",y.createElement(y.Fragment,null,y.createElement("path",{d:"M168,128a40,40,0,1,1-40-40A40,40,0,0,1,168,128Zm40,0a79.74,79.74,0,0,0-20.37-53.33,8,8,0,1,0-11.92,10.67,64,64,0,0,1,0,85.33,8,8,0,0,0,11.92,10.67A79.79,79.79,0,0,0,208,128ZM80.29,85.34A8,8,0,1,0,68.37,74.67a79.94,79.94,0,0,0,0,106.67,8,8,0,0,0,11.92-10.67,63.95,63.95,0,0,1,0-85.33Zm158.28-4A119.48,119.48,0,0,0,213.71,44a8,8,0,1,0-11.42,11.2,103.9,103.9,0,0,1,0,145.56A8,8,0,1,0,213.71,212,120.12,120.12,0,0,0,238.57,81.29ZM32.17,168.48A103.9,103.9,0,0,1,53.71,55.22,8,8,0,1,0,42.29,44a119.87,119.87,0,0,0,0,168,8,8,0,1,0,11.42-11.2A103.61,103.61,0,0,1,32.17,168.48Z"}))],["light",y.createElement(y.Fragment,null,y.createElement("path",{d:"M128,90a38,38,0,1,0,38,38A38,38,0,0,0,128,90Zm0,64a26,26,0,1,1,26-26A26,26,0,0,1,128,154Zm78-26a77.74,77.74,0,0,1-19.86,52,6,6,0,0,1-8.94-8,65.93,65.93,0,0,0,0-88,6,6,0,1,1,8.94-8A77.74,77.74,0,0,1,206,128ZM67.18,102.31A65.93,65.93,0,0,0,78.8,172a6,6,0,0,1-.47,8.47,6,6,0,0,1-8.47-.47,77.93,77.93,0,0,1,0-104,6,6,0,1,1,8.94,8A66.21,66.21,0,0,0,67.18,102.31ZM246,128a117.71,117.71,0,0,1-33.71,82.58,6,6,0,0,1-8.58-8.4,105.88,105.88,0,0,0,0-148.36,6,6,0,0,1,8.58-8.4A117.71,117.71,0,0,1,246,128ZM52.29,202.18a6,6,0,0,1-8.58,8.4,117.92,117.92,0,0,1,0-165.16,6,6,0,1,1,8.58,8.4,105.88,105.88,0,0,0,0,148.36Z"}))],["regular",y.createElement(y.Fragment,null,y.createElement("path",{d:"M128,88a40,40,0,1,0,40,40A40,40,0,0,0,128,88Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,152Zm73.71,7.14a80,80,0,0,1-14.08,22.2,8,8,0,0,1-11.92-10.67,63.95,63.95,0,0,0,0-85.33,8,8,0,1,1,11.92-10.67,80.08,80.08,0,0,1,14.08,84.47ZM69,103.09a64,64,0,0,0,11.26,67.58,8,8,0,0,1-11.92,10.67,79.93,79.93,0,0,1,0-106.67A8,8,0,1,1,80.29,85.34,63.77,63.77,0,0,0,69,103.09ZM248,128a119.58,119.58,0,0,1-34.29,84,8,8,0,1,1-11.42-11.2,103.9,103.9,0,0,0,0-145.56A8,8,0,1,1,213.71,44,119.58,119.58,0,0,1,248,128ZM53.71,200.78A8,8,0,1,1,42.29,212a119.87,119.87,0,0,1,0-168,8,8,0,1,1,11.42,11.2,103.9,103.9,0,0,0,0,145.56Z"}))],["thin",y.createElement(y.Fragment,null,y.createElement("path",{d:"M128,92a36,36,0,1,0,36,36A36,36,0,0,0,128,92Zm0,64a28,28,0,1,1,28-28A28,28,0,0,1,128,156Zm76-28a75.74,75.74,0,0,1-19.35,50.67,4,4,0,0,1-6-5.34,67.92,67.92,0,0,0,0-90.66,4,4,0,0,1,6-5.34A75.74,75.74,0,0,1,204,128ZM65.34,101.53a67.92,67.92,0,0,0,12,71.8,4,4,0,0,1-6,5.34,75.93,75.93,0,0,1,0-101.34,4,4,0,1,1,6,5.34A68,68,0,0,0,65.34,101.53ZM244,128a115.68,115.68,0,0,1-33.14,81.18,4,4,0,0,1-5.72-5.6,107.89,107.89,0,0,0,0-151.16,4,4,0,0,1,5.72-5.6A115.68,115.68,0,0,1,244,128ZM50.86,203.58a4,4,0,0,1-5.72,5.6,115.91,115.91,0,0,1,0-162.36,4,4,0,1,1,5.72,5.6,107.89,107.89,0,0,0,0,151.16Z"}))]]),zo=new Map([["bold",y.createElement(y.Fragment,null,y.createElement("path",{d:"M144.49,136.49l-80,80a12,12,0,0,1-17-17L119,128,47.51,56.49a12,12,0,0,1,17-17l80,80A12,12,0,0,1,144.49,136.49Zm80-17-80-80a12,12,0,1,0-17,17L199,128l-71.52,71.51a12,12,0,0,0,17,17l80-80A12,12,0,0,0,224.49,119.51Z"}))],["duotone",y.createElement(y.Fragment,null,y.createElement("path",{d:"M136,128,56,208V48Z",opacity:"0.2"}),y.createElement("path",{d:"M141.66,122.34l-80-80A8,8,0,0,0,48,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,141.66,122.34ZM64,188.69V67.31L124.69,128Zm157.66-55-80,80a8,8,0,0,1-11.32-11.32L204.69,128,130.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,221.66,133.66Z"}))],["fill",y.createElement(y.Fragment,null,y.createElement("path",{d:"M221.66,133.66l-80,80A8,8,0,0,1,128,208V147.31L61.66,213.66A8,8,0,0,1,48,208V48a8,8,0,0,1,13.66-5.66L128,108.69V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,221.66,133.66Z"}))],["light",y.createElement(y.Fragment,null,y.createElement("path",{d:"M140.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L127.51,128,51.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,140.24,132.24Zm80-8.48-80-80a6,6,0,0,0-8.48,8.48L207.51,128l-75.75,75.76a6,6,0,1,0,8.48,8.48l80-80A6,6,0,0,0,220.24,123.76Z"}))],["regular",y.createElement(y.Fragment,null,y.createElement("path",{d:"M141.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L124.69,128,50.34,53.66A8,8,0,0,1,61.66,42.34l80,80A8,8,0,0,1,141.66,133.66Zm80-11.32-80-80a8,8,0,0,0-11.32,11.32L204.69,128l-74.35,74.34a8,8,0,0,0,11.32,11.32l80-80A8,8,0,0,0,221.66,122.34Z"}))],["thin",y.createElement(y.Fragment,null,y.createElement("path",{d:"M138.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L130.34,128,53.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,138.83,130.83Zm80-5.66-80-80a4,4,0,0,0-5.66,5.66L210.34,128l-77.17,77.17a4,4,0,0,0,5.66,5.66l80-80A4,4,0,0,0,218.83,125.17Z"}))]]),Lo=new Map([["bold",y.createElement(y.Fragment,null,y.createElement("path",{d:"M172,164a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,164Zm-12-52H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24Zm60-64V216a20,20,0,0,1-20,20H56a20,20,0,0,1-20-20V48A20,20,0,0,1,56,28H90.53a51.88,51.88,0,0,1,74.94,0H200A20,20,0,0,1,220,48ZM100.29,60h55.42a28,28,0,0,0-55.42,0ZM196,52H178.59A52.13,52.13,0,0,1,180,64v8a12,12,0,0,1-12,12H88A12,12,0,0,1,76,72V64a52.13,52.13,0,0,1,1.41-12H60V212H196Z"}))],["duotone",y.createElement(y.Fragment,null,y.createElement("path",{d:"M208,48V216a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V48a8,8,0,0,1,8-8H96a39.83,39.83,0,0,0-8,24v8h80V64a39.83,39.83,0,0,0-8-24h40A8,8,0,0,1,208,48Z",opacity:"0.2"}),y.createElement("path",{d:"M168,152a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,152Zm-8-40H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm56-64V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V48A16,16,0,0,1,56,32H92.26a47.92,47.92,0,0,1,71.48,0H200A16,16,0,0,1,216,48ZM96,64h64a32,32,0,0,0-64,0ZM200,48H173.25A47.93,47.93,0,0,1,176,64v8a8,8,0,0,1-8,8H88a8,8,0,0,1-8-8V64a47.93,47.93,0,0,1,2.75-16H56V216H200Z"}))],["fill",y.createElement(y.Fragment,null,y.createElement("path",{d:"M200,32H163.74a47.92,47.92,0,0,0-71.48,0H56A16,16,0,0,0,40,48V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm-72,0a32,32,0,0,1,32,32H96A32,32,0,0,1,128,32Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"}))],["light",y.createElement(y.Fragment,null,y.createElement("path",{d:"M166,152a6,6,0,0,1-6,6H96a6,
16,0,0,1,0-12h64A6,6,0,0,1,166,152Zm-6-38H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm54-66V216a14,14,0,0,1-14,14H56a14,14,0,0,1-14-14V48A14,14,0,0,1,56,34H93.17a45.91,45.91,0,0,1,69.66,0H200A14,14,0,0,1,214,48ZM94,64v2h68V64a34,34,0,0,0-68,0ZM202,48a2,2,0,0,0-2-2H170.33A45.77,45.77,0,0,1,174,64v8a6,6,0,0,1-6,6H88a6,6,0,0,1-6-6V64a45.77,45.77,0,0,1,3.67-18H56a2,2,0,0,0-2,2V216a2,2,0,0,0,2,2H200a2,2,0,0,0,2-2Z"}))],["regular",y.createElement(y.Fragment,null,y.createElement("path",{d:"M168,152a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,152Zm-8-40H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm56-64V216a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V48A16,16,0,0,1,56,32H92.26a47.92,47.92,0,0,1,71.48,0H200A16,16,0,0,1,216,48ZM96,64h64a32,32,0,0,0-64,0ZM200,48H173.25A47.93,47.93,0,0,1,176,64v8a8,8,0,0,1-8,8H88a8,8,0,0,1-8-8V64a47.93,47.93,0,0,1,2.75-16H56V216H200Z"}))],["thin",y.createElement(y.Fragment,null,y.createElement("path",{d:"M164,152a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,152Zm-4-36H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm52-68V216a12,12,0,0,1-12,12H56a12,12,0,0,1-12-12V48A12,12,0,0,1,56,36H94.08a44,44,0,0,1,67.84,0H200A12,12,0,0,1,212,48ZM92,64v4h72V64a36,36,0,0,0-72,0ZM204,48a4,4,0,0,0-4-4H167.17A43.71,43.71,0,0,1,172,64v8a4,4,0,0,1-4,4H88a4,4,0,0,1-4-4V64a43.71,43.71,0,0,1,4.83-20H56a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H200a4,4,0,0,0,4-4Z"}))]]),Io=new Map([["bold",y.createElement(y.Fragment,null,y.createElement("path",{d:"M152,116H140V60h4a28,28,0,0,1,28,28,12,12,0,0,0,24,0,52.06,52.06,0,0,0-52-52h-4V24a12,12,0,0,0-24,0V36h-4a52,52,0,0,0,0,104h4v56H104a28,28,0,0,1-28-28,12,12,0,0,0-24,0,52.06,52.06,0,0,0,52,52h12v12a12,12,0,0,0,24,0V220h12a52,52,0,0,0,0-104Zm-40,0a28,28,0,0,1,0-56h4v56Zm40,80H140V140h12a28,28,0,0,1,0,56Z"}))],["duotone",y.createElement(y.Fragment,null,y.createElement("path",{d:"M192,168a40,40,0,0,1-40,40H128V128h24A40,40,0,0,1,192,168ZM112,48a40,40,0,0,0,0,80h16V48Z",opacity:"0.2"}),y.createElement("path",{d:"M152,120H136V56h8a32,32,0,0,1,32,32,8,8,0,0,0,16,0,48.05,48.05,0,0,0-48-48h-8V24a8,8,0,0,0-16,0V40h-8a48,48,0,0,0,0,96h8v64H104a32,32,0,0,1-32-32,8,8,0,0,0-16,0,48.05,48.05,0,0,0,48,48h16v16a8,8,0,0,0,16,0V216h16a48,48,0,0,0,0-96Zm-40,0a32,32,0,0,1,0-64h8v64Zm40,80H136V136h16a32,32,0,0,1,0,64Z"}))],["fill",y.createElement(y.Fragment,null,y.createElement("path",{d:"M160,152a16,16,0,0,1-16,16h-8V136h8A16,16,0,0,1,160,152Zm72-24A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-56,24a32,32,0,0,0-32-32h-8V88h4a16,16,0,0,1,16,16,8,8,0,0,0,16,0,32,32,0,0,0-32-32h-4V64a8,8,0,0,0-16,0v8h-4a32,32,0,0,0,0,64h4v32h-8a16,16,0,0,1-16-16,8,8,0,0,0-16,0,32,32,0,0,0,32,32h8v8a8,8,0,0,0,16,0v-8h8A32,32,0,0,0,176,152Zm-76-48a16,16,0,0,0,16,16h4V88h-4A16,16,0,0,0,100,104Z"}))],["light",y.createElement(y.Fragment,null,y.createElement("path",{d:"M152,122H134V54h10a34,34,0,0,1,34,34,6,6,0,0,0,12,0,46.06,46.06,0,0,0-46-46H134V24a6,6,0,0,0-12,0V42H112a46,46,0,0,0,0,92h10v68H104a34,34,0,0,1-34-34,6,6,0,0,0-12,0,46.06,46.06,0,0,0,46,46h18v18a6,6,0,0,0,12,0V214h18a46,46,0,0,0,0-92Zm-40,0a34,34,0,0,1,0-68h10v68Zm40,80H134V134h18a34,34,0,0,1,0,68Z"}))],["regular",y.createElement(y.Fragment,null,y.createElement("path",{d:"M152,120H136V56h8a32,32,0,0,1,32,32,8,8,0,0,0,16,0,48.05,48.05,0,0,0-48-48h-8V24a8,8,0,0,0-16,0V40h-8a48,48,0,0,0,0,96h8v64H104a32,32,0,0,1-32-32,8,8,0,0,0-16,0,48.05,48.05,0,0,0,48,48h16v16a8,8,0,0,0,16,0V216h16a48,48,0,0,0,0-96Zm-40,0a32,32,0,0,1,0-64h8v64Zm40,80H136V136h16a32,32,0,0,1,0,64Z"}))],["thin",y.createElement(y.Fragment,null,y.createElement("path",{d:"M152,124H132V52h12a36,36,0,0,1,36,36,4,4,0,0,0,8,0,44.05,44.05,0,0,0-44-44H132V24a4,4,0,0,0-8,0V44H112a44,44,0,0,0,0,88h12v72H104a36,36,0,0,1-36-36,4,4,0,0,0-8,0,44.05,44.05,0,0,0,44,44h20v20a4,4,0,0,0,8,0V212h20a44,44,0,0,0,0-88Zm-40,0a36,36,0,0,1,0-72h12v72Zm40,80H132V132h20a36,36,0,0,1,0,72Z"}))]]),Ho=new Map([["bold",y.createElement(y.Fragment,null,y.createElement("path",{d:"M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z"}))],["duotone",y.createElement(y.Fragment,null,y.createElement("path",{d:"M216,
164V192H88V64Z",opacity:"0.2"}),y.createElement("path",{d:"M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"}))],["fill",y.createElement(y.Fragment,null,y.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM68,188a12,12,0,1,1,12-12A12,12,0,0,1,68,188Zm0-48a12,12,0,1,1,12-12A12,12,0,0,1,68,140Zm0-48A12,12,0,1,1,80,80,12,12,0,0,1,68,92Zm124,92H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Z"}))],["light",y.createElement(y.Fragment,null,y.createElement("path",{d:"M82,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H88A6,6,0,0,1,82,64Zm134,58H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Zm0,64H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12ZM44,54A10,10,0,1,0,54,64,10,10,0,0,0,44,54Zm0,128a10,10,0,1,0,10,10A10,10,0,0,0,44,182Zm0-64a10,10,0,1,0,10,10A10,10,0,0,0,44,118Z"}))],["regular",y.createElement(y.Fragment,null,y.createElement("path",{d:"M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"}))],["thin",y.createElement(y.Fragment,null,y.createElement("path",{d:"M84,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H88A4,4,0,0,1,84,64Zm132,60H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Zm0,64H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8ZM44,120a8,8,0,1,0,8,8A8,8,0,0,0,44,120Zm0-64a8,8,0,1,0,8,8A8,8,0,0,0,44,56Zm0,128a8,8,0,1,0,8,8A8,8,0,0,0,44,184Z"}))]]),hn=y.forwardRef((i,t)=>y.createElement(Me,{ref:t,...i,weights:Eo}));hn.displayName="BroadcastIcon";const $o=hn,dn=y.forwardRef((i,t)=>y.createElement(Me,{ref:t,...i,weights:zo}));dn.displayName="CaretDoubleRightIcon";const Wo=dn,un=y.forwardRef((i,t)=>y.createElement(Me,{ref:t,...i,weights:Lo}));un.displayName="ClipboardTextIcon";const Bo=un,fn=y.forwardRef((i,t)=>y.createElement(Me,{ref:t,...i,weights:Io}));fn.displayName="CurrencyDollarIcon";const Vo=fn,gn=y.forwardRef((i,t)=>y.createElement(Me,{ref:t,...i,weights:Ho}));gn.displayName="ListBulletsIcon";const No=gn,Zo=()=>{const[i,t]=y.useState([]),[e,s]=y.useState(!1),n=y.useCallback(r=>{const l={id:`msg-${Date.now()}`,role:"agent",content:r.agentOpeningMessage,artifact:r.expectedArtifactType?{id:`artifact-${r.id}`,type:r.expectedArtifactType,title:Ni(r),preview:Yo(r)}:void 0,timestamp:new Date().toISOString()};t([l])},[]),o=y.useCallback(async r=>{const l={id:`msg-${Date.now()}`,role:"user",content:r,timestamp:new Date().toISOString()};t(h=>[...h,l]),s(!0),await new Promise(h=>setTimeout(h,1200));const c={id:`msg-${Date.now()+1}`,role:"agent",content:`Boa pergunta. Deixa eu detalhar isso.
2
3[resposta mock para: "${r}"]`,timestamp:new Date().toISOString()};t(h=>[...h,c]),s(!1)},[]),a=y.useCallback((r,l)=>({id:`artifact-${Date.now()}`,type:r,title:Ni(l),content:qo(r,l),createdAt:new Date().toISOString()}),[]);return{messages:i,sending:e,sendMessage:o,initializeFromInsight:n,generateArtifact:a}};function Ni(i){return{"insight-stock-alert-stitch":"Ordem de Compra — Mochila Stitch","insight-abandoned-cart-spike":"Carrinhos abandonados — últimas 4h","insight-ads-monitor-roas":"Diagnóstico Meta Ads — ROAS","insight-low-margin-skus":"SKUs com margem real <5%","insight-calendar-mothers-day":"Briefing Dia das Mães 2026","insight-morning-briefing-today":"Morning briefing — top 3 ações","insight-reactivate-customers-list":"Lista de Reativação — 47 Clientes","insight-sales-summary-yesterday":"Resumo de vendas — ontem","insight-catalog-audit-issues":"Auditoria de catálogo — 12 SKUs","insight-demand-forecast-top":"Forecast — top 3 SKUs em alta","insight-rfm-segments":"RFM — 11 segmentos do mês"}[i.id]??i.message}function Yo(i){return{report:"Abrir relatório completo",list:"Abrir lista completa",calendar:"Abrir calendário",briefing:"Abrir briefing",action:"Executar ação",dashboard:"Abrir dashboard"}[i.expectedArtifactType??"report"]}function qo(i,t){switch(i){case"report":return t.id==="insight-morning-briefing-today"?{type:"report",narrative:"Bom dia. Olhei tudo que rolou nas últimas 24h e separei as 3 ações que vão render mais hoje.",actionCards:[{id:"action-1",step:1,title:"Aprovar ordem de compra · Mochila Stitch",metric:"Salva R$ 6.720",description:"Estoque atual aguenta 3 dias. Lead time do fornecedor é 7. Sem ordem hoje, você perde 4 dias de venda essa semana.",ctaLabel:"Criar ordem",ctaAction:"create-purchase-order",highlight:"warning"},{id:"action-2",step:2,title:"Ativar WhatsApp pros 23 carrinhos abandonados",metric:"R$ 4.180 potencial",description:"Volume 3x acima do normal nas últimas 4 horas. 78% dos clientes têm WhatsApp opt-in. Conversão histórica: 35%.",ctaLabel:"Disparar sequência",ctaAction:"trigger-whatsapp-recovery",highlight:"primary"},{id:"action-3",step:3,title:"Pausar criativo em fadiga + lançar 3 novos hooks",metric:"Recupera R$ 3.400/semana",description:"Vídeo do Cloud Walker está com frequência 4.8 e ROAS caindo 35%. Tenho 3 hooks novos prontos pra rotação.",ctaLabel:"Ver hooks",ctaAction:"view-creative-rotation",highlight:"primary"}],closingPrompt:"Total estimado: R$ 14.200 que entram (ou não saem) se você fizer as 3 hoje. Quer começar pela mais urgente?"}:t.id==="insight-rfm-segments"?{type:"report",narrative:"Análise mensal pronta. Olhei seus 1.247 clientes ativos e organizei em 11 segmentos. Separei as 3 ações que mais movem o ponteiro agora.",actionCards:[{id:"rfm-1",step:1,title:"Cuidar dos 87 Champions",metric:"R$ 47.200 LTV",description:"São os clientes que mais compram e mais recente. Vale uma mensagem de reconhecimento + acesso antecipado pro próximo lançamento.",ctaLabel:"Criar campanha VIP",ctaAction:"create-vip-campaign",highlight:"success"},{id:"rfm-2",step:2,title:"Resgatar 156 clientes hibernando",metric:"Risco alto de churn",description:"Compraram bem no passado mas sumiram. Sequência de WhatsApp com lembrete + cupom costuma reativar 22% dessa base.",ctaLabel:"Disparar resgate",ctaAction:"trigger-winback",highlight:"warning"},{id:"rfm-3",step:3,title:"Escalar os 198 Potential",metric:"Próximo Champion",description:"Compraram recente mas pouco. Empurrão certo (combo + frete grátis no segundo pedido) move pro Loyal.",ctaLabel:"Ver plano",ctaAction:"view-potential-plan",highlight:"primary"}],closingPrompt:"Quer que eu detalhe algum segmento específico?"}:{type:"report",narrative:"Aqui está o que encontrei.",sections:[{heading:"Contexto",body:t.message}],closingPrompt:"Quer que eu detalhe alguma parte específica?"};case"list":return t.id==="insight-reactivate-customers-list"?{type:"list",narrative:"Separei 47 clientes pra você reativar. Olhei pedidos, frequência e o que c
3ada um comprou — todos têm padrão claro de compra mas pararam há mais de 60 dias.",items:[{id:"c-001",primary:"Mariana Silva",secondary:"Tênis Cloud Walker · 63 dias atrás",metadata:"LTV R$ 487"},{id:"c-002",primary:"Rafael Costa",secondary:"Mochila Stitch + Meias · 67 dias atrás",metadata:"LTV R$ 312"},{id:"c-003",primary:"Patricia Mendes",secondary:"Slip-on Mini · 60 dias atrás",metadata:"LTV R$ 189"},{id:"c-004",primary:"Lucas Almeida",secondary:"Sneaker Cloud Kids · 70 dias atrás",metadata:"LTV R$ 425"},{id:"c-005",primary:"Juliana Santos",secondary:"Combo Tênis + Meia · 62 dias atrás",metadata:"LTV R$ 256"},{id:"c-006",primary:"Bruno Carvalho",secondary:"Mochila Stitch · 75 dias atrás",metadata:"LTV R$ 167"},{id:"c-007",primary:"Camila Rocha",secondary:"Tênis casual + Meia listrada · 61 dias atrás",metadata:"LTV R$ 398"},{id:"c-008",primary:"Felipe Martins",secondary:"Slip-on Mini · 68 dias atrás",metadata:"LTV R$ 145"},{id:"c-009",primary:"Beatriz Oliveira",secondary:"Combo Cloud Walker + Meia · 64 dias atrás",metadata:"LTV R$ 521"},{id:"c-010",primary:"Gabriel Lima",secondary:"Mochila Stitch + Lancheira · 72 dias atrás",metadata:"LTV R$ 287"}],bulkActions:[{label:"Enviar WhatsApp",action:"send-whatsapp"},{label:"Enviar e-mail",action:"send-email"},{label:"Adicionar tag",action:"add-tag"}],closingPrompt:"Reativar essa lista custa em torno de R$ 380 em mensagens — 5x menos que adquirir clientes novos. Quer disparar a sequência via WhatsApp?"}:t.id==="insight-abandoned-cart-spike"?{type:"list",narrative:"Olha os 23 carrinhos que abandonaram nas últimas 4 horas. Volume 3x acima do normal — vale acionar agora enquanto o interesse tá quente.",items:Array.from({length:10},(e,s)=>({id:`cart-${s+1}`,primary:["Ana","Bruno","Camila","Diego","Elisa","Felipe","Giovana","Henrique","Isabela","João"][s]+" · WhatsApp opt-in",secondary:["Tênis Cloud Walker","Mochila Stitch + Meia","Slip-on Mini","Sneaker Kids","Meia Listrada","Combo escolar","Tênis Cloud rosa","Mochila Stitch","Cloud Walker Kids","Combo Tênis + Mochila"][s],metadata:`R$ ${[218,412,156,289,67,387,234,198,312,445][s]}`})),bulkActions:[{label:"Disparar WhatsApp",action:"send-whatsapp"},{label:"Enviar cupom",action:"send-coupon"}],closingPrompt:"Conversão histórica da sequência de WhatsApp é 35%. Posso disparar agora?"}:t.id==="insight-low-margin-skus"?{type:"list",narrative:"Identifiquei 7 SKUs rodando praticamente no zero a zero. Frete e devolução estão consumindo a margem.",items:[{id:"sku-1",primary:"Meia Listrada Kids P",secondary:"Margem real: 1.2% · Devolução: 14%",metadata:"R$ 3.420/mês"},{id:"sku-2",primary:"Meia Cano Curto Baby",secondary:"Margem real: 2.4% · Frete N/NE alto",metadata:"R$ 2.180/mês"},{id:"sku-3",primary:"Slip-on Mini 22",secondary:"Margem real: 3.1% · Tabela tamanho",metadata:"R$ 4.120/mês"},{id:"sku-4",primary:"Tênis Casual 24",secondary:"Margem real: 3.8% · Devolução 11%",metadata:"R$ 2.950/mês"},{id:"sku-5",primary:"Meia Listrada Kids M",secondary:"Margem real: 4.1%",metadata:"R$ 1.890/mês"},{id:"sku-6",primary:"Sneaker Cloud Kids 26",secondary:"Margem real: 4.3% · Frete pesado",metadata:"R$ 2.140/mês"},{id:"sku-7",primary:"Mochila Mini Pop",secondary:"Margem real: 4.7%",metadata:"R$ 1.700/mês"}],bulkActions:[{label:"Reajustar preço",action:"reprice"},{label:"Mudar logística",action:"change-logistics"}],closingPrompt:"Posso simular o impacto de subir preço em 5% nesses 7 SKUs?"}:t.id==="insight-catalog-audit-issues"?{type:"list",narrative:"Auditoria semanal encontrou 12 SKUs com problemas que estão segurando conversão. Listei por tipo e impacto.",items:[{id:"a-1",primary:"Tênis Cloud Walker rosa 24",secondary:"Sem foto secundária",metadata:"Conversão -38%"},{id:"a-2",primary:"Mochila Stitch Pop",secondary:"Sem foto secundária",metadata:"Conversão -32%"},{id:"a-3",primary:"Slip-on Mini azul",secondary:"Descrição duplicada",metadata:"SEO ruim"},{id:"a-4",primary:"Slip-on Mini cinza",secondary:"Descrição duplicada",metadata:"SEO ruim"},{id:"a-5",primary:"Sneaker Cloud Kids 25",secondary:"Tamanho não preenchido",metadata:"Filtro quebrado"}],bulkActions:[{label:"Atribuir pra equipe",action:"assign-team"}],closingPrompt:"Quer que eu já comece pelo SKU com maior impacto em conversão?"}:{type:"list",narrative:"Separei a lista pra você revisar.",items:Array.from({length:8},(e,s)=>
3({id:`item-${s}`,primary:`Cliente ${s+1}`,secondary:`Última compra há ${60+s} dias`,metadata:`LTV R$ ${260+s*18}`})),bulkActions:[{label:"Selecionar todos",action:"select-all"},{label:"Enviar mensagem",action:"send-message"}]};case"calendar":{if(t.id==="insight-calendar-mothers-day"||t.id==="insight-content-calendar"){const e=new Date,s=["Reels: Volta às aulas com Milkes","Carrossel: Como escolher o tênis ideal","Story: Tour pelo showroom","Reels: Looks de inverno pra crianças","Post: Lançamento Cloud Walker rosa","Pin: Combinações de outono","Reels: UGC mãe + filho usando Stitch","Carrossel: 5 dicas pra durabilidade","Story: Bastidores produção","Pin: Inspiração looks Dia das Mães","Reels: Trend Tênis Casual TikTok","Post: Depoimento cliente real","Reels: Unboxing combo escolar","Story: Q&A com a fundadora","Pin: Tênis pro inverno chegando","Carrossel: Cuidados com mochila","Reels: Dia da família","Story: Promo flash 24h","Post: Lançamento meia listrada","Pin: Outfits volta às aulas","Reels: Comparativo Milkes vs concorrente","Carrossel: Por que escolher Milkes"],n=["Instagram","TikTok","Pinterest"],o=["Foco em conversão e prova social","Educacional, gerar engajamento","Conteúdo aspiracional","Demonstração de produto em uso","Lançamento + urgência"];return{type:"calendar",narrative:"Montei o calendário pra você aproveitar Dia das Mães. São 22 publicações em 18 dias — comecei pelo aquecimento D-15, intensifico D-7 em diante, e foco D-3 a D-1.",events:s.map((r,l)=>{const c=new Date(e);return c.setDate(e.getDate()+Math.floor(l*1.4)+1),{date:c.toISOString().slice(0,10),title:r,channel:n[l%3],description:o[l%o.length]}}),closingPrompt:"Posso já programar a publicação automática conforme o calendário?"}}return{type:"calendar",narrative:"Aqui está o calendário que preparei.",events:Array.from({length:22},(e,s)=>({date:new Date(Date.now()+s*864e5).toISOString().slice(0,10),title:`Publicação ${s+1}`,channel:["Instagram","TikTok","Pinterest"][s%3]}))}}case"briefing":return t.id==="insight-mothers-day"||t.id==="insight-calendar-mothers-day"?{type:"briefing",narrative:"Olha o briefing que pensei pra Dia das Mães. Usei o que funcionou em 2025 (R$ 18.400) e ajustei a meta pra 25% maior, considerando que tô vendo concorrentes mais agressivos esse ano.",campaign:{objective:"Aumentar receita Dia das Mães em 25% vs 2025 (R$ 18.400 → R$ 23.000), aproveitando a janela de 18 dias antes da data.",audience:"Mães e tias de crianças de 3 a 12 anos, classe B/C, principalmente das regiões Sul e Sudeste. Idade 28-45. Ativas no Instagram e WhatsApp. Já compraram pelo menos 1 vez na Milkes nos últimos 12 meses.",channels:["Instagram","TikTok","WhatsApp Business","E-mail","Pinterest"],keyMessages:["Carinho que cabe no pé","Pra pequenos passos, grandes momentos","Confie em quem entende de criança","O presente que dura mais que o abraço"],timeline:"18 dias até o Dia das Mães · Aquecimento D-18, intensificação D-7, peak D-3 a D-1",budget:"R$ 8.000"},closingPrompt:"Esse briefing tá alinhado com o tom da Milkes? Posso ajustar mensagens, audiência ou budget se precisar."}:{type:"briefing",narrative:"Olha o briefing que preparei.",campaign:{objective:"Aumentar receita Dia das Mães em 25% vs ano passado",audience:"Mães de crianças 3-12 anos, classe B/C, região Sul/Sudeste",channels:["Instagram","TikTok","WhatsApp","E-mail"],keyMessages:["Carinho que cabe no pé","Para pequenos passos, grandes momentos","Confie em quem entende de criança"],timeline:"18 dias até o D-day",budget:"R$ 8.000"}};case"action":return t.id==="insight-stock-alert-stitch"||t.id==="insight-inventory-stitch"?{type:"action",narrative:"Pra criar a ordem de compra emergencial da Mochila Stitch, preciso de algumas decisões.",context:"Estoque atual: 42 unidades · Velocidade: 14/dia · Sem ordem hoje, ruptura em 3 dias.",fields:[{id:"qty",label:"Quantas unidades comprar?",type:"number",hint:"Sugiro entre 200-300 pra cobrir 14-21 dias de venda + buffer"},{id:"supplier",label:"Qual fornecedor?",type:"select",options:["Indústria Têxtil Sul · 7 dias","Confecções Bahia · 12 dias","Fornecedor Express RS · 4 dias (+18% custo)"],hint:"Express é mais caro mas chega antes da ruptura"},{id:"priority",label:"Prioridade do pedido",type:"select",options:["Normal","Alta (sobretaxa 5%)","Emergencial (sobretaxa 15%)"],hint:"Considerando 3 dias até ruptura, recomendo Alta ou Emergencial"},{id:"notes",label:"Observação pro fornecedor",type:"text",hint:"Opcional · pode pedir prioridade na produção"}],ctaLabel:"Criar ordem agora",ctaAction:"create-purchase-order",successMessage:"Já mandei a ordem pro fornecedor. Vou acompanhar o status e te aviso quando confirmar a entrega."}:{type:"action",narrative:"Pra seguir, preciso de algumas decisões suas.",context:"Gerar ordem de compra emergencial pra evitar ruptura.",fields:[{id:"qty",label:"Quantidade",type:"number",hint:"Quantas unidades?"},{id:"supplier",label:"Fornecedor",type:"select",options:["Fornecedor A","Fornecedor B"]}],ctaLabel:"Gerar ordem",ctaAction:"create-order"};case"dashboard":default:return t.id==="insight-sales-summary-yesterday"?{type:"dashboard",narrative:"Olha como ontem foi pra Milkes — separei os números mais importantes.",spotlight:{label:"Receita ontem",value:"R$ 12.400",delta:"+18% vs anteontem",context:"Acima da média dos últimos 30 dias"},kpis:[{label:"Pedidos",value:"47",delta:"+5",trend:"up",comparison:"vs anteontem"},{label:"Ticket médio",value:"R$ 264",delta:"+R$ 14",trend:"up",comparison:"vs média 30d"},{label:"Conversão",value:"2.8%",delta:"+0.4pp",trend:"up",comparison:"vs anteontem"},{label:"Carrinhos abandonados",value:"23",delta:"+9",trend:"down",comparison:"fora do padrão"}],charts:[{title:"Receita por canal (ontem)",chartType:"doughnut",data:{labels:["Instagram orgânico","Meta Ads","Direto","Google Ads","WhatsApp"],datasets:[{data:[4200,3100,2400,1800,900],backgroundColor:["#1A1A1A","#4267B2","#666666","#4285F4","#25D366"]}]}},{title:"Top 5 produtos",chartType:"bar",data:{labels:["Cloud Walker","Slip-on Mini","Mochila Stitch","Sneaker Kids","Meia Listrada"],datasets:[{label:"Unidades",data:[12,8,7,6,5],backgroundColor:"#1A1A1A"}]}}],closingPrompt:"Quer que eu detalhe algum canal específico ou compare com semana passada?"}:t.id==="insight-ads-monitor-roas"?{type:"dashboard",narrative:"Diagnóstico das suas campanhas Meta Ads. O cenário mudou nos últimos 7 dias e dá pra reverter.",spotlight:{label:"ROAS médio (7 dias)",value:"2.7",delta:"−35% vs 7 dias anteriores",context:"Era 4.2 antes da fadiga"},kpis:[{label:"CPM",value:"R$ 38",delta:"+22%",trend:"down",comparison:"vs média 30d"},{label:"Frequência criativo principal",value:"4.8",trend:"down",comparison:"saudável até 3.0"},{label:"Receita perdida",value:"R$ 3.400",trend:"down",comparison:"estimado nos 7 dias"}],charts:[{title:"ROAS dia a dia (últimos 14d)",chartType:"line",data:{labels:["D-14","D-12","D-10","D-8","D-6","D-4","D-2","Hoje"],datasets:[{label:"ROAS",data:[4.3,4.2,4.1,3.6,3.1,2.9,2.7,2.7],borderColor:"#1A1A1A",backgroundColor:"rgba(0,0,0,0.05)"}]}}],closingPrompt:"Posso pausar o criativo cansado e te mostrar 3 hooks novos pra rotação?"}:t.id==="insight-demand-forecast-top"?{type:"dashboard",narrative:"Forecast pros próximos 30 dias. Cruzei vendas, sazonalidade e campanhas planejadas — 3 SKUs aparecem com tração forte.",spotlight:{label:"SKU em maior alta",value:"Cloud Walker",delta:"+52% previsto",context:"Volta às aulas + trend TikTok"},kpis:[{label:"Mochila Stitch",value:"+44%",trend:"up",comparison:"combinada com Cloud Walker"},{label:"Meia Listrada Kids",value:"+41%",trend:"up",comparison:"impulso do combo escolar"},{label:"Janela ideal de reposição",value:"10 dias",comparison:"pra evitar ruptura"}],charts:[],closingPrompt:"Quer que eu prepare a sugestão de ordem de compra pros 3 SKUs?"}:t.id==="insight-pixel-broken"?{type:"dashboard",narrative:"Detectei que algumas conversões não estão sendo registradas corretamente.",spotlight:{label:"Conversões perdidas em 4 dias",value:"R$ 4.200",delta:"12 páginas afetadas",context:"Atribuição Meta Ads distorcida"},kpis:[{label:"Páginas afetadas",value:"12",trend:"down",comparison:"todas PDPs"},{label:"Eventos errados",value:"342",trend:"down",comparison:"PageView no lugar de Purchase"},{label:"Tempo até correção",value:"~30min",comparison:"código simples"}],charts:[{title:"Conversões registradas vs reais",chartType:"bar",data:{labels:["Quinta","Sexta","Sábado","Domingo"],datasets:[{label:"Registradas",data:[142,128,156,98],backgroundColor:"#1A1A1A"},{label:"Reais (estimado)",data:[187,174,198,134],backgroundColor:"rgba(220, 38, 38, 0.6)"}]}}],closingPrompt:"Posso te mostrar o código exato que precisa ajustar nas páginas?"}:{type:"dashboard",narrative:"Aqui estão os números que separei.",kpis:[{label:"Receita 30d",value:"R$ 84.200",delta:"+12%",trend:"up",comparison:"vs 30d anteriores"},{label:"Pedidos",value:"412",delta:"+5%",trend:"up",comparison:"vs 30d anteriores"},{label:"Ticket médio",value:"R$ 204",delta:"−2%",trend:"down",comparison:"vs média trimestre"}],charts:[]}}}function Uo({children:i,size:t=14}){return g.jsx("div",{style:{fontSize:t,lineHeight:1.65,color:`hsl(${_.text.primary})`,fontFamily:"inherit",wordBreak:"break-word"}
3,children:g.jsx(_o,{remarkPlugins:[vo],components:{p:({children:e})=>g.jsx("p",{style:{margin:`0 0 ${S[3]}`,lineHeight:1.65},children:e}),a:({href:e,children:s})=>g.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",style:{color:`hsl(${_.text.primary})`,textDecoration:"underline",textUnderlineOffset:2,textDecorationColor:`hsl(${_.text.tertiary})`},children:s}),ul:({children:e})=>g.jsx("ul",{style:{margin:`0 0 ${S[3]}`,paddingLeft:18,lineHeight:1.6},children:e}),ol:({children:e})=>g.jsx("ol",{style:{margin:`0 0 ${S[3]}`,paddingLeft:18,lineHeight:1.6},children:e}),li:({children:e})=>g.jsx("li",{style:{marginBottom:4},children:e}),strong:({children:e})=>g.jsx("strong",{style:{fontWeight:600,color:`hsl(${_.text.primary})`},children:e}),em:({children:e})=>g.jsx("em",{style:{fontStyle:"italic"},children:e}),h1:({children:e})=>g.jsx("h1",{style:{fontSize:t+4,fontWeight:600,margin:`${S[3]} 0 ${S[2]}`},children:e}),h2:({children:e})=>g.jsx("h2",{style:{fontSize:t+2,fontWeight:600,margin:`${S[3]} 0 ${S[2]}`},children:e}),h3:({children:e})=>g.jsx("h3",{style:{fontSize:t+1,fontWeight:600,margin:`${S[3]} 0 ${S[2]}`},children:e}),blockquote:({children:e})=>g.jsx("blockquote",{style:{margin:`0 0 ${S[3]}`,paddingLeft:S[3],borderLeft:`2px solid hsl(${_.border.secondary})`,color:`hsl(${_.text.secondary})`},children:e}),code:({inline:e,children:s})=>e?g.jsx("code",{style:{background:`hsl(${_.bg.secondary})`,border:`1px solid hsl(${_.border.tertiary})`,borderRadius:z.sm,padding:"1px 4px",fontSize:t-1,fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:s}):g.jsx("pre",{style:{background:`hsl(${_.bg.secondary})`,border:`1px solid hsl(${_.border.tertiary})`,borderRadius:z.md,padding:S[3],overflowX:"auto",fontSize:t-1,margin:`0 0 ${S[3]}`,fontFamily:"var(--font-mono, ui-monospace, monospace)"},children:g.jsx("code",{children:s})}),hr:()=>g.jsx("hr",{style:{border:"none",borderTop:`1px solid hsl(${_.border.tertiary})`,margin:`${S[4]} 0`}})},children:Xo(i)})})}function Xo(i){return i.replace(new RegExp("(?<!\\n)\\n(?!\\n)","g"),`  
4`)}const Ko=({message:i,agentName:t,onArtifactClick:e})=>i.role==="user"?g.jsx(yo,{message:i.content}):g.jsxs("div",{style:{marginBottom:S[6]},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:S[2]},children:[g.jsx(xo,{size:26}),t&&g.jsx("span",{style:{fontSize:12,fontWeight:500,color:`hsl(${_.text.secondary})`},children:t})]}),g.jsx("div",{style:{paddingLeft:36},children:g.jsx(Uo,{children:i.content})}),i.artifact&&g.jsxs("button",{onClick:()=>e(i.artifact),style:{marginTop:S[3],marginLeft:36,background:`hsl(${_.bg.primary})`,border:q.default,borderRadius:z.lg,padding:`${S[3]} ${S[4]}`,cursor:"pointer",display:"flex",alignItems:"center",gap:S[3],fontFamily:"inherit",textAlign:"left",width:"calc(100% - 36px)",transition:"border-color 150ms, background 150ms"},onMouseEnter:s=>{s.currentTarget.style.background=`hsl(${_.bg.secondary})`},onMouseLeave:s=>{s.currentTarget.style.background=`hsl(${_.bg.primary})`},children:[g.jsx("div",{style:{width:32,height:32,borderRadius:z.sm,background:`hsl(${_.bg.secondary})`,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:Go(i.artifact.type)}),g.jsxs("div",{style:{flex:1,minWidth:0},children:[g.jsx("div",{style:{fontSize:13,fontWeight:500,color:`hsl(${_.text.primary})`},children:i.artifact.title}),g.jsx("div",{style:{fontSize:12,color:`hsl(${_.text.tertiary})`,marginTop:2},children:i.artifact.preview})]})]})]});function Go(i){const t={size:16,weight:"regular"};switch(i){case"report":return g.jsx(Vi,{...t});case"calendar":return g.jsx(mo,{...t});case"list":return g.jsx(No,{...t});case"action":return g.jsx(ln,{...t});case"dashboard":return g.jsx(bo,{...t});case"briefing":return g.jsx(Bo,{...t});default:return g.jsx(Vi,{...t})}}const Zi=({text:i})=>g.jsx("p",{style:{fontSize:16,lineHeight:1.5,color:`hsl(${_.text.primary})`,fontWeight:500,margin:0},children:i}),Yi=({text:i})=>g.jsx("p",{style:{fontSize:13,lineHeight:1.5,color:`hsl(${_.text.secondary})`,fontStyle:"italic",margin:0},children:i}),Qo=({card:i,onAction:t})=>{const e={primary:{bg:"rgba(0,0,0,0.03)",border:"rgba(0,0,0,0.08)",icon:g.jsx(ln,{size:14,weight:"fill"}),color:`hsl(${_.text.primary})`},warning:{bg:"rgba(245,158,11,0.06)",border:"rgba(245,158,11,0.2)",icon:g.jsx(Mo,{size:14,weight:"fill"}),color:"#F59E0B"},success:{bg:"rgba(34,197,94,0.06)",border:"rgba(34,197,94,0.2)",icon:g.jsx(So,{size:14,weight:"fill"}),color:"#22C55E"}}[i.highlight??"primary"];return g.jsxs("div",{style:{background:e.bg,border:`0.5px solid ${e.border}`,borderRadius:z.lg,padding:S[5],display:"flex",gap:S[3],alignItems:"flex-start"},children:[g.jsx("div",{style:{width:28,height:28,borderRadius:"50%",background:`hsl(${_.bg.primary})`,border:q.default,display:"flex",alignItems:"center",justifyContent:"center",fontSize:13,fontWeight:600,color:`hsl(${_.text.primary})`,flexShrink:0},children:i.step}),g.jsxs("div",{style:{flex:1,minWidth:0},children:[g.jsx("div",{style:{fontSize:14,fontWeight:600,color:`hsl(${_.text.primary})`,marginBottom:4},children:i.title}),g.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:12,fontWeight:600,color:e.color,marginBottom:S[2]},children:[e.icon,i.metric]}),g.jsx("p",{style:{fontSize:13,color:`hsl(${_.text.secondary})`,lineHeight:1.5,margin:`0 0 ${S[3]} 0`},children:i.description}),g.jsxs("button",{className:"snew-main-action",onClick:()=>t(i.ctaAction,i.id),style:{display:"inline-flex",alignItems:"center",gap:S[1],padding:`${S[2]} ${S[3]}`,border:"none",borderRadius:z.pill,fontSize:12,fontWeight:600,cursor:"pointer",fontFamily:"inherit",transition:`transform ${ge.fast}`},children:[i.ctaLabel,g.jsx(lo,{size:12,weight:"bold"})]})]})]})},Jo=({content:i})=>{var e;const t=(s,n)=>{console.log(`[Snew] Action ${s} on ${n}`)};return i.actionCards&&i.actionCards.length>0?g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:S[5]},children:[i.narrative&&g.jsx(Zi,{text:i.narrative}),g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:S[3]},children:i.actionCards.map(s=>g.jsx(Qo,{card:s,onAction:t},s.id))}),i.closingPrompt&&g.jsx(Yi,{text:i.closingPrompt})]}):g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:S[5]},children:[i.narrative&&g.jsx(Zi,{text:i.narrative}),(e=i.sections)==null?void 0:e.map((s,n)=>g.jsxs("section",{children:[g.jsx("h3",{style:{fontSize:14,fontWeight:600,color:`hsl(${_.text.primary})`,margin:`0 0 ${S[3]} 0`},children:s.heading}),g.jsx("p",{style:{fontSize:14,color:`hsl(${_.text.secondary})`,lineHeight:1.7,margin:0},children:s.body})]},n)),i.closingPrompt&&g.jsx(Yi,{text:i.closingPrompt})]})},ta=({content:i})=>{const[t,e]=y.useState(new Set),[s,n]=y.useState(""),o=y.useMemo(()=>
4{if(!s)return i.items;const h=s.toLowerCase();return i.items.filter(d=>{var u,f;return d.primary.toLowerCase().includes(h)||((u=d.secondary)==null?void 0:u.toLowerCase().includes(h))||((f=d.metadata)==null?void 0:f.toLowerCase().includes(h))})},[i.items,s]),a=o.length>0&&o.every(h=>t.has(h.id)),r=h=>{e(d=>{const u=new Set(d);return u.has(h)?u.delete(h):u.add(h),u})},l=()=>e(a?new Set:new Set(o.map(h=>h.id))),c=t.size>0;return g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:S[5]},children:[i.narrative&&g.jsx("p",{style:{fontSize:15,lineHeight:1.5,color:`hsl(${_.text.primary})`,fontWeight:500,margin:0},children:i.narrative}),g.jsxs("div",{style:{display:"flex",gap:S[2],alignItems:"center",padding:S[3],background:`hsl(${_.bg.primary})`,borderRadius:z.md,border:q.default},children:[g.jsxs("div",{style:{flex:1,display:"flex",alignItems:"center",gap:S[2],padding:`${S[2]} ${S[3]}`,background:`hsl(${_.bg.secondary})`,borderRadius:z.pill},children:[g.jsx(co,{size:14,color:`hsl(${_.text.tertiary})`}),g.jsx("input",{type:"text",placeholder:`Filtrar ${i.items.length} itens...`,value:s,onChange:h=>n(h.target.value),style:{flex:1,border:"none",background:"transparent",outline:"none",fontFamily:"inherit",fontSize:13,color:`hsl(${_.text.primary})`}})]}),g.jsx("button",{onClick:l,style:{padding:`${S[2]} ${S[3]}`,background:"transparent",border:q.default,borderRadius:z.pill,cursor:"pointer",fontFamily:"inherit",fontSize:13,color:`hsl(${_.text.secondary})`},children:a?"Desmarcar todos":"Selecionar todos"})]}),c&&i.bulkActions&&g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:S[2],padding:`${S[2]} ${S[3]}`,background:"#1A1A1A",color:"#FFFFFF",borderRadius:z.pill,fontSize:13},children:[g.jsxs("span",{style:{fontWeight:600},children:[t.size," selecionado",t.size>1?"s":""]}),g.jsx("div",{style:{flex:1}}),i.bulkActions.map(h=>g.jsx("button",{onClick:()=>console.log(`[bulk] ${h.action}`,Array.from(t)),style:{padding:`4px ${S[3]}`,background:"rgba(255,255,255,0.15)",border:"none",borderRadius:z.pill,color:"#FFFFFF",cursor:"pointer",fontFamily:"inherit",fontSize:13},children:h.label},h.action))]}),g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:S[2]},children:o.length===0?g.jsx("div",{style:{padding:S[7],textAlign:"center",color:`hsl(${_.text.tertiary})`,fontSize:14},children:"Nenhum item encontrado."}):o.map(h=>{const d=t.has(h.id);return g.jsxs("button",{onClick:()=>r(h.id),style:{display:"flex",alignItems:"center",gap:S[3],padding:S[3],background:d?"rgba(0,0,0,0.04)":`hsl(${_.bg.primary})`,border:d?"0.5px solid #1A1A1A":q.default,borderRadius:z.md,cursor:"pointer",fontFamily:"inherit",textAlign:"left",width:"100%",transition:`border-color ${ge.fast}, background ${ge.fast}`},children:[g.jsx("div",{style:{width:18,height:18,borderRadius:4,border:d?"none":`1.5px solid hsl(${_.border.tertiary})`,background:d?"#1A1A1A":"transparent",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:d&&g.jsx(cn,{size:12,color:"#FFFFFF",weight:"bold"})}),g.jsxs("div",{style:{flex:1,minWidth:0},children:[g.jsx("div",{style:{fontSize:14,fontWeight:600,color:`hsl(${_.text.primary})`,marginBottom:2},children:h.primary}),h.secondary&&g.jsx("div",{style:{fontSize:13,color:`hsl(${_.text.secondary})`,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:h.secondary})]}),h.metadata&&g.jsx("div",{style:{fontSize:13,color:`hsl(${_.text.tertiary})`,flexShrink:0},children:h.metadata})]},h.id)})}),g.jsxs("div",{style:{fontSize:13,color:`hsl(${_.text.tertiary})`,textAlign:"center",marginTop:S[2]},children:["Mostrando ",o.length," de ",i.items.length," itens"]}),i.closingPrompt&&g.jsx("p",{style:{fontSize:13,lineHeight:1.5,color:`hsl(${_.text.secondary})`,fontStyle:"italic",margin:0},children:i.closingPrompt})]})},Qt={Instagram:{bg:"#FFE4F1",text:"#C4185D"},TikTok:{bg:"#1A1A1A",text:"#FFFFFF"},Pinterest:{bg:"#FCE8E8",text:"#BD081C"},Default:{bg:"rgba(0,0,0,0.06)",text:"#666666"}},ea=({content:i})=>{const t=y.useMemo(()=>{if(i.events.length>0){const u=new Date(i.events[0].date);return new Date(u.getFullYear(),u.getMonth(),1)}const d=new Date;return new Date(d.getFullYear(),d.getMonth(),1)},[i.events]),[e,s]=y.useState(t),[n,o]=y.useState(null),a=y.useMemo(()=>{const d=e.getFullYear(),u=e.getMonth(),f=new Date(d,u,1),p=new Date(f),m=p.getDay(),b=m===0?6:m-1;p.setDate(p.getDate()-b);const x=[];for(let v=0;v<42;v++){const k=new Date(p);k.setDate(p.getDate()+v),x.push({date:k,isCurrentMonth:k.getMonth()===u,iso:k.toISOString().slice(0,10)})}return x},[e]),r=y.useMemo(()=>{const d={};
4return i.events.forEach(u=>{var f;(d[f=u.date]??(d[f]=[])).push(u)}),d},[i.events]),l=e.toLocaleDateString("pt-BR",{month:"long",year:"numeric"}),c=d=>{const u=new Date(e);u.setMonth(u.getMonth()+d),s(u),o(null)},h=n?r[n]??[]:[];return g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:S[3]},children:[i.narrative&&g.jsx("p",{style:{fontSize:15,lineHeight:1.5,color:`hsl(${_.text.primary})`,fontWeight:500,margin:`0 0 ${S[2]} 0`},children:i.narrative}),g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:`${S[2]} 0`},children:[g.jsx("button",{onClick:()=>c(-1),style:{background:"transparent",border:q.default,borderRadius:z.pill,padding:S[2],cursor:"pointer",color:`hsl(${_.text.secondary})`,display:"flex",alignItems:"center"},children:g.jsx(ko,{size:16})}),g.jsx("h3",{style:{fontSize:16,fontWeight:600,color:`hsl(${_.text.primary})`,textTransform:"capitalize",margin:0},children:l}),g.jsx("button",{onClick:()=>c(1),style:{background:"transparent",border:q.default,borderRadius:z.pill,padding:S[2],cursor:"pointer",color:`hsl(${_.text.secondary})`,display:"flex",alignItems:"center"},children:g.jsx(wo,{size:16})})]}),g.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:4},children:["Seg","Ter","Qua","Qui","Sex","Sáb","Dom"].map(d=>g.jsx("div",{style:{padding:S[2],textAlign:"center",fontSize:10,color:`hsl(${_.text.tertiary})`,textTransform:"uppercase",fontWeight:600,letterSpacing:"0.06em"},children:d},d))}),g.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:4},children:a.map((d,u)=>{const f=r[d.iso]??[],p=n===d.iso;return g.jsxs("button",{onClick:()=>f.length>0&&o(d.iso),disabled:!d.isCurrentMonth||f.length===0,style:{aspectRatio:"1",background:p?"#1A1A1A":`hsl(${_.bg.primary})`,border:p?"none":q.default,borderRadius:z.md,padding:S[2],cursor:f.length>0?"pointer":"default",opacity:d.isCurrentMonth?1:.3,display:"flex",flexDirection:"column",alignItems:"flex-start",gap:4,fontFamily:"inherit",transition:`background ${ge.fast}`},children:[g.jsx("div",{style:{fontSize:13,fontWeight:600,color:p?"#FFFFFF":`hsl(${_.text.primary})`},children:d.date.getDate()}),f.length>0&&g.jsxs("div",{style:{display:"flex",gap:2,flexWrap:"wrap"},children:[f.slice(0,3).map((m,b)=>{const x=Qt[m.channel??"Default"]??Qt.Default;return g.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:x.bg,border:`1px solid ${x.text}`}},b)}),f.length>3&&g.jsxs("div",{style:{fontSize:9,color:p?"#FFFFFF":`hsl(${_.text.tertiary})`},children:["+",f.length-3]})]})]},u)})}),n&&h.length>0&&g.jsxs("div",{style:{padding:S[5],background:`hsl(${_.bg.primary})`,border:q.default,borderRadius:z.lg,marginTop:S[3]},children:[g.jsx("div",{style:{fontSize:10,color:`hsl(${_.text.tertiary})`,textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600,marginBottom:S[3]},children:new Date(n).toLocaleDateString("pt-BR",{day:"numeric",month:"long",weekday:"long"})}),g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:S[3]},children:h.map((d,u)=>{const f=Qt[d.channel??"Default"]??Qt.Default;return g.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:S[3],padding:S[3],background:`hsl(${_.bg.secondary})`,borderRadius:z.md},children:[g.jsx("div",{style:{background:f.bg,color:f.text,padding:`2px ${S[2]}`,borderRadius:z.pill,fontSize:10,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.06em",flexShrink:0},children:d.channel??"—"}),g.jsxs("div",{style:{flex:1},children:[g.jsx("div",{style:{fontSize:14,fontWeight:600,color:`hsl(${_.text.primary})`,marginBottom:2},children:d.title}),d.description&&g.jsx("div",{style:{fontSize:13,color:`hsl(${_.text.secondary})`,lineHeight:1.5},children:d.description})]})]},u)})})]}),g.jsx("div",{style:{display:"flex",gap:S[3],justifyContent:"center",flexWrap:"wrap",marginTop:S[3]},children:Object.entries(Qt).filter(([d])=>d!=="Default").map(([d,u])=>g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:S[2],fontSize:13,color:`hsl(${_.text.secondary})`},children:[g.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:u.bg,border:`1px solid ${u.text}`}}),d]},d))}),i.closingPrompt&&g.jsx("p",{style:{fontSize:13,lineHeight:1.5,color:`hsl(${_.text.secondary})`,fontStyle:"italic",margin:`${S[3]} 0 0 0`},children:i.closingPrompt})]})},Bt=({icon:i,label:t,children:e})=>g.jsxs("section",{children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:S[2],marginBottom:S[3],color:`hsl(${_.text.tertiary})`},children:[i,g.jsx("div",{style:{fontSize:10,textTransform:"uppercase",letterSpacing:"0.06em",fontWeight:600},children:t})]}),e]}),ia=({content:i})=>{const{campaign:t}=i;return g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:S[6]},children:[i.narrative&&g.jsx("p",{style:{fontSize:16,lineHeight:1.5,color:`hsl(${_.text.primary})`,fontWeight:500,margin:0},children:i.narrative}),g.jsx(Bt,{icon:g.jsx(Po,{size:18}),label:"Objetivo",children:g.jsx("p",{style:{fontSize:16,fontWeight:500,color:`hsl(${_.text.primary})`,lineHeight:1.5,margin:0},children:t.objective})}),g.jsx(Bt,{icon:g.jsx(Ro,{size:18}),label:"Audiência",children:g.jsx("p",{style:{fontSize:14,color:`hsl(${_.text.secondary})`,lineHeight:1.6,margin:0},children:t.audience})}),g.jsx(Bt,{icon:g.jsx($o,{size:18}),label:"Canais ativos",children:g.jsx("div",{style:{display:"flex",gap:S[2],flexWrap:"wrap"},children:t.channels.map(e=>g.jsx("div",{style:{padding:`${S[2]} ${S[3]}`,background:`hsl(${_.bg.secondary})`,borderRadius:z.pill,fontSize:13,color:`hsl(${_.text.primary})`,fontWeight:500},children:e},e))})}),g.jsx(Bt,{icon:g.jsx(Do,{size:18}),label:"Mensagens-chave",children:g.jsx("ul",{style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:S[2]},children:t.keyMessages.map((e,s)=>
4g.jsxs("li",{style:{display:"flex",alignItems:"flex-start",gap:S[3],padding:S[3],background:`hsl(${_.bg.secondary})`,borderRadius:z.md,borderLeft:"3px solid #1A1A1A"},children:[g.jsxs("span",{style:{fontSize:13,color:`hsl(${_.text.tertiary})`,fontWeight:600,flexShrink:0},children:["#",s+1]}),g.jsxs("span",{style:{fontSize:14,color:`hsl(${_.text.primary})`,fontStyle:"italic",lineHeight:1.5},children:['"',e,'"']})]},s))})}),g.jsx(Bt,{icon:g.jsx(Ao,{size:18}),label:"Timeline",children:g.jsx("p",{style:{fontSize:14,color:`hsl(${_.text.primary})`,margin:0},children:t.timeline})}),t.budget&&g.jsx(Bt,{icon:g.jsx(Vo,{size:18}),label:"Budget",children:g.jsx("div",{style:{fontSize:22,fontWeight:600,color:`hsl(${_.text.primary})`},children:t.budget})}),i.closingPrompt&&g.jsx("p",{style:{fontSize:14,lineHeight:1.5,color:`hsl(${_.text.secondary})`,fontStyle:"italic",margin:0},children:i.closingPrompt})]})},sa=({content:i})=>{const[t,e]=y.useState(()=>Object.fromEntries(i.fields.map(d=>[d.id,""]))),[s,n]=y.useState({}),[o,a]=y.useState("idle"),r=(d,u)=>{e(f=>({...f,[d]:u})),s[d]&&n(f=>({...f,[d]:""}))},l=()=>{const d={};return i.fields.forEach(u=>{const f=t[u.id];f!=null&&f.trim()?u.type==="number"&&isNaN(Number(f))&&(d[u.id]="Esse valor precisa ser um número"):d[u.id]="Preciso desse dado pra continuar"}),n(d),Object.keys(d).length===0},c=async()=>{l()&&(a("submitting"),console.log(`[action] ${i.ctaAction}`,t),await new Promise(d=>setTimeout(d,1500)),a("success"))},h=()=>{e(Object.fromEntries(i.fields.map(d=>[d.id,""]))),n({}),a("idle")};return o==="success"?g.jsx("div",{style:{padding:S[6],background:"rgba(34, 197, 94, 0.05)",borderRadius:z.lg,border:"0.5px solid rgba(34, 197, 94, 0.2)"},children:g.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:S[3]},children:[g.jsx("div",{style:{width:32,height:32,borderRadius:"50%",background:"#22C55E",color:"#FFFFFF",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:g.jsx(cn,{size:18,weight:"bold"})}),g.jsxs("div",{style:{flex:1},children:[g.jsx("h3",{style:{fontSize:16,fontWeight:600,color:`hsl(${_.text.primary})`,margin:`0 0 ${S[2]} 0`},children:"Feito."}),g.jsx("p",{style:{fontSize:14,color:`hsl(${_.text.secondary})`,lineHeight:1.5,margin:`0 0 ${S[3]} 0`},children:i.successMessage??"Já segui com a ação. Vou acompanhar o status e te aviso assim que confirmar."}),g.jsx("button",{onClick:h,style:{padding:`${S[2]} ${S[3]}`,background:"transparent",border:q.default,borderRadius:z.pill,cursor:"pointer",fontFamily:"inherit",fontSize:12,color:`hsl(${_.text.secondary})`},children:"Refazer"})]})]})}):g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:S[5]},children:[i.narrative&&g.jsx("p",{style:{fontSize:15,lineHeight:1.6,color:`hsl(${_.text.primary})`,fontWeight:500,margin:0},children:i.narrative}),(i.context??i.description)&&g.jsx("p",{style:{fontSize:14,color:`hsl(${_.text.secondary})`,lineHeight:1.6,margin:0},children:i.context??i.description}),g.jsx("div",{style:{display:"flex",flexDirection:"column",gap:S[3]},children:i.fields.map(d=>{var u;return g.jsxs("div",{children:[g.jsx("label",{style:{display:"block",fontSize:13,fontWeight:600,color:`hsl(${_.text.primary})`,marginBottom:S[2]},children:d.label}),d.hint&&g.jsx("div",{style:{fontSize:12,color:`hsl(${_.text.tertiary})`,fontStyle:"italic",marginBottom:S[2]},children:d.hint}),d.type==="select"?g.jsxs("select",{value:t[d.id],onChange:f=>r(d.id,f.target.value),disabled:o==="submitting",style:{width:"100%",padding:S[3],border:s[d.id]?"1px solid #DC2626":q.default,borderRadius:z.md,fontSize:14,fontFamily:"inherit",background:`hsl(${_.bg.primary})`,outline:"none",color:`hsl(${_.text.primary})`,cursor:o==="submitting"?"not-allowed":"pointer"},children:[g.jsx("option",{value:"",children:"Selecionar..."}),(u=d.options)==null?void 0:u.map(f=>g.jsx("option",{value:f,children:f},f))]}):g.jsx("input",{type:d.type,value:t[d.id],onChange:f=>r(d.id,f.target.value),disabled:o==="submitting",style:{width:"100%",padding:S[3],border:s[d.id]?"1px solid #DC2626":q.default,borderRadius:z.md,fontSize:14,fontFamily:"inherit",background:`hsl(${_.bg.primary})`,outline:"none",color:`hsl(${_.text.primary})`,boxSizing:"border-box"}}),s[d.id]&&g.jsx("div",{style:{fontSize:11,color:"#DC2626",marginTop:4},children:s[d.id]})]},d.id)})}),g.jsx("button",{onClick:c,disabled:o==="submitting",style:{padding:`${S[3]} ${S[5]}`,background:o==="submitting"?`hsl(${_.bg.secondary})`:"#1A1A1A",color:o==="submitting"?`hsl(${_.text.tertiary})`:"#FFFFFF",border:"none",borderRadius:z.pill,cursor:o==="submitting"?"not-allowed":"pointer",fontFamily:"inherit",fontSize:14,fontWeight:600,display:"flex",alignItems:"center",justifyContent:"center",gap:S[2],transition:`background ${ge.fast}`},children:o==="submitting"?g.jsxs(g.Fragment,{children:[g.jsx(ho,{size:16,style:{animation:"spin 1s linear infinite"}}),"Processando..."]}):i.ctaLabel}),g.jsx("style",{children:"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"})]})};/*!
5 * @kurkle/color v0.3.4
6 * https://github.com/kurkle/color#readme
7 * (c) 2024 Jukka Kurkela
8 * Released under the MIT License
9 */function ke(i){return i+.5|0}const vt=(i,t,e)=>Math.max(Math.min(i,e),t);function ne(i){return vt(ke(i*2.55),0,255)}function wt(i){return vt(ke(i*255),0,255)}function xt(i){return vt(ke(i/2.55)/100,0,1)}function qi(i){return vt(ke(i*100),0,100)}const nt={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},pi=[..."0123456789ABCDEF"],na=i=>pi[i&15],oa=i=>pi[(i&240)>>4]+pi[i&15],Ae=i=>(i&240)>>4===(i&15),aa=i=>Ae(i.r)&&Ae(i.g)&&Ae(i.b)&&Ae(i.a);function ra(i){var t=i.length,e;
vendor: 6,032 bytes, line 9
9return i[0]==="#"&&(t===4||t===5?e={r:255&nt[i[1]]*17,g:255&nt[i[2]]*17,b:255&nt[i[3]]*17,a:t===5?nt[i[4]]*17:255}:(t===7||t===9)&&(e={r:nt[i[1]]<<4|nt[i[2]],g:nt[i[3]]<<4|nt[i[4]],b:nt[i[5]]<<4|nt[i[6]],a:t===9?nt[i[7]]<<4|nt[i[8]]:255})),e}const la=(i,t)=>i<255?t(i):"";function ca(i){var t=aa(i)?na:oa;return i?"#"+t(i.r)+t(i.g)+t(i.b)+la(i.a,t):void 0}const ha=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function pn(i,t,e){const s=t*Math.min(e,1-e),n=(o,a=(o+i/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function da(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function ua(i,t,e){const s=pn(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function fa(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function wi(i){const e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),a=Math.min(e,s,n),r=(o+a)/2;let l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=fa(e,s,n,h,o),l=l*60+.5),[l|0,c||0,r]}function Ai(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(wt)}function Ci(i,t,e){return Ai(pn,i,t,e)}function ga(i,t,e){return Ai(ua,i,t,e)}function pa(i,t,e){return Ai(da,i,t,e)}function mn(i){return(i%360+360)%360}function ma(i){const t=ha.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?ne(+t[5]):wt(+t[5]));const n=mn(+t[2]),o=+t[3]/100,a=+t[4]/100;return t[1]==="hwb"?s=ga(n,o,a):t[1]==="hsv"?s=pa(n,o,a):s=Ci(n,o,a),{r:s[0],g:s[1],b:s[2],a:e}}function ba(i,t){var e=wi(i);e[0]=mn(e[0]+t),e=Ci(e),i.r=e[0],i.g=e[1],i.b=e[2]}function xa(i){if(!i)return;const t=wi(i),e=t[0],s=qi(t[1]),n=qi(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${xt(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Ui={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"},Xi={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function ya(){const i={},t=Object.keys(Xi),e=Object.keys(Ui);let s,n,o,a,r;for(s=0;s<t.length;s++){for(a=r=t[s],n=0;n<e.length;n++)o=e[n],r=r.replace(o,Ui[o]);o=parseInt(Xi[a],16),i[r]=[o>>16&255,o>>8&255,o&255]}return i}let Ce;function _a(i){Ce||(Ce=ya(),Ce.transparent=[0,0,0,0]);const t=Ce[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const va=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Sa(i){const t=va.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const a=+t[7];e=t[8]?ne(a):vt(a*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?ne(s):vt(s,0,255)),n=255&(t[4]?ne(n):vt(n,0,255)),o=255&(t[6]?ne(o):vt(o,0,255)),{r:s,g:n,b:o,a:e}}}function Ma(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${xt(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const si=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Vt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function ka(i,t,e){const s=Vt(xt(i.r)),n=Vt(xt(i.g)),o=Vt(xt(i.b));return{r:wt(si(s+e*(Vt(xt(t.r))-s))),g:wt(si(n+e*(Vt(xt(t.g))-n))),b:wt(si(o+e*(Vt(xt(t.b))-o))),a:i.a+e*(t.a-i.a)}}function De(i,t,e){if(i){let s=wi(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Ci(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function bn(i,t){return i&&Object.assign(t||{},i)}function Ki(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=wt(i[3]))):(t=bn(i,{r:0,g:0,b:0,a:1}),t.a=wt(t.a)),t}function wa(i){return i.charAt(0)==="r"?Sa(i):ma(i)}class pe{constructor(t){if(t instanceof pe)return t;const e=typeof t;let s;e==="object"?s=Ki(t):e==="string"&&(s=ra(t)||_a(t)||wa(t)),this._rgb=s,this._val
vendor: 13,010 bytes, lines 9-14
9id=!!s}get valid(){return this._valid}get rgb(){var t=bn(this._rgb);return t&&(t.a=xt(t.a)),t}set rgb(t){this._rgb=Ki(t)}rgbString(){return this._valid?Ma(this._rgb):void 0}hexString(){return this._valid?ca(this._rgb):void 0}hslString(){return this._valid?xa(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const a=e===o?.5:e,r=2*a-1,l=s.a-n.a,c=((r*l===-1?r:(r+l)/(1+r*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=a*s.a+(1-a)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=ka(this._rgb,t._rgb,e)),this}clone(){return new pe(this.rgb)}alpha(t){return this._rgb.a=wt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ke(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return De(this._rgb,2,t),this}darken(t){return De(this._rgb,2,-t),this}saturate(t){return De(this._rgb,1,t),this}desaturate(t){return De(this._rgb,1,-t),this}rotate(t){return ba(this._rgb,t),this}}/*!
10 * Chart.js v4.5.1
11 * https://www.chartjs.org
12 * (c) 2025 Chart.js Contributors
13 * Released under the MIT License
14 */function pt(){}const Aa=(()=>{let i=0;return()=>i++})();function L(i){return i==null}function Y(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function E(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function at(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function dt(i,t){return at(i)?i:t}function O(i,t){return typeof i>"u"?t:i}const Ca=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,xn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function W(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function I(i,t,e,s){let n,o,a;if(Y(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(E(i))for(a=Object.keys(i),o=a.length,n=0;n<o;n++)t.call(e,i[a[n]],a[n])}function Ze(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function Ye(i){if(Y(i))return i.map(Ye);if(E(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=Ye(i[e[n]]);return t}return i}function yn(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function Da(i,t,e,s){if(!yn(i))return;const n=t[i],o=e[i];E(n)&&E(o)?me(n,o,s):t[i]=Ye(o)}function me(i,t,e){const s=Y(t)?t:[t],n=s.length;if(!E(i))return i;e=e||{};const o=e.merger||Da;let a;for(let r=0;r<n;++r){if(a=s[r],!E(a))continue;const l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],i,a,e)}return i}function he(i,t){return me(i,t,{merger:Pa})}function Pa(i,t,e){if(!yn(i))return;const s=t[i],n=e[i];E(s)&&E(n)?he(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=Ye(n))}const Gi={"":i=>i,x:i=>i.x,y:i=>i.y};function Ra(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function Ta(i){const t=Ra(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Lt(i,t){return(Gi[t]||(Gi[t]=Ta(t)))(i)}function Di(i){return i.charAt(0).toUpperCase()+i.slice(1)}const be=i=>typeof i<"u",At=i=>typeof i=="function",Qi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Oa(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const H=Math.PI,V=2*H,ja=V+H,qe=Number.POSITIVE_INFINITY,Fa=H/180,U=H/2,Pt=H/4,Ji=H*2/3,_n=Math.log10,gt=Math.sign;function de(i,t,e){return Math.abs(i-t)<e}function ts(i){const t=Math.round(i);i=de(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(_n(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function Ea(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function za(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function xe(i){return!za(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function La(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function Ia(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function yt(i){return i*(H/180)}function Ha(i){return i*(180/H)}function es(i){if(!at(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function vn(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*H&&(o+=V),{angle:o,distance:n}}function mi(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function $a(i,t){return(i-t+ja)%V-H}function ct(i){return(i%V+V)%V}function ye(i,t,e,s){const n=ct(i),o=ct(t),a=ct(e),r=ct(o-n),l=ct(a-n),c=ct(n-o),h=ct(n-a);return n===o||n===a||s&&o===a||r>l&&c<h}function Q(i,t,e){return Math.max(t,Math.min(e,i))}function Wa(i){return Q(i,-32768,32767)}function St(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Pi(i,t,e){e=e||(a=>i[a]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const Ft=(i,t,e,s)=>Pi(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),Ba=(i,t,e)=>Pi(i,e,s=>i[s][t]>=e);function Va(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const Sn=["push","pop","shift","splice","unshift"];function Na(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Sn.forEach(e=>{const s="_onData"+Di(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const a=n.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[s]=="function"&&r[s](...o)}),a}})})}function is(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Sn.forEach(o=>{delete i[o]}),delete i._chartjs)}function Mn(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const kn=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function wn(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,kn.call(window,()=>{s=!1,i.apply(t,e)}))}}function Za(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const Ri=i=>i==="start"?"left":i==="end"?"right":"center",G=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Ya=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function qa(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:a,vScale:r,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=a.axis,{min:d,max:u,minDefined:f,maxDefined:p}=a.getUserBounds();if(f){if(n=Math.min(Ft(l,h,d).lo,e?s:Ft(t,h,a.getPixelForValue(d)).lo),c){const m=l.slice(0,n+1).reverse().findIndex(b=>!L(b[r.axis]));n-=Math.max(0,m)}n=Q(n,0,s-1)}if(p){let m=Math.max(Ft(l,a.axis,u,!0).hi+1,e?0:Ft(t,h,a.getPixelForValue(u),!0).hi+1);if(c){const b=l.slice(m-1).findIndex(x=>!L(x[r.axis]));m+=Math.max(0,b)}o=Q(m,n,s)-n}else o=s-n}return{start:n,count:o}}function Ua(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const Pe=i=>i===0||i===1,ss=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*V/e)),ns=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*V/e)+1,ue={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*U)+1,easeOutSine:i=>Math.sin(i*U),easeInOutSine:i=>-.5*(Math.cos(H*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>Pe(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Pe(i)?i:ss(i,.075,.3),easeOutElastic:i=>Pe(i)?i:ns(i,.075,.3),easeInOutElastic(i){return Pe(i)?i:i<.5?.5*ss(i*2,.1125,.45):.5+.5*ns(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-ue.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?ue.easeInBounce(i*2)*.5:ue.easeOutBounce(i*2-1)*.5+.5};function Ti(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function os(i){return Ti(i)?i:new pe(i)}function ni(i){return Ti(i)?i:new pe(i).saturate(.5).darken(.1).hexString()}const Xa=["x","y","borderWidth","radius","tension"],Ka=["color","borderColor","backgroundColor"];function Ga(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:Ka},numbers:{type:"number",properties:Xa}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Qa(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const as=new Map;function Ja(i,t){t=t||{};const e=i+JSON.stringify(t);let s=as.get(e);return s||(s=new Intl.NumberFormat(i,t),as.set(e,s)),s}function Oi(i,t,e){return Ja(t,e).format(i)}const tr={values(i){return Y(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=er(i,e)}const a=_n(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Oi(i,s,l)}};function er(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var An={formatters:tr};function ir(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:An.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const It=Object.create(null),bi=Object.create(null);function fe(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function oi(i,t,e){return typeof t=="string"?me(fe(i,t),e):me(fe(i,""),t)}class sr{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={}
vendor: 46,240 bytes, lines 14-19
14,this.hoverBackgroundColor=(s,n)=>ni(n.backgroundColor),this.hoverBorderColor=(s,n)=>ni(n.borderColor),this.hoverColor=(s,n)=>ni(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return oi(this,t,e)}get(t){return fe(this,t)}describe(t,e){return oi(bi,t,e)}override(t,e){return oi(It,t,e)}route(t,e,s,n){const o=fe(this,t),a=fe(this,s),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[r],c=a[n];return E(l)?Object.assign({},c,l):O(l,c)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var Z=new sr({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ga,Qa,ir]);function nr(i){return!i||L(i.size)||L(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function rs(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function Rt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function ls(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function xi(i,t,e,s){Cn(i,t,e,s,null)}function Cn(i,t,e,s,n){let o,a,r,l,c,h,d,u;const f=t.pointStyle,p=t.rotation,m=t.radius;let b=(p||0)*Fa;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(b),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(m)||m<=0)){switch(i.beginPath(),f){default:n?i.ellipse(e,s,n/2,m,0,0,V):i.arc(e,s,m,0,V),i.closePath();break;case"triangle":h=n?n/2:m,i.moveTo(e+Math.sin(b)*h,s-Math.cos(b)*m),b+=Ji,i.lineTo(e+Math.sin(b)*h,s-Math.cos(b)*m),b+=Ji,i.lineTo(e+Math.sin(b)*h,s-Math.cos(b)*m),i.closePath();break;case"rectRounded":c=m*.516,l=m-c,a=Math.cos(b+Pt)*l,d=Math.cos(b+Pt)*(n?n/2-c:l),r=Math.sin(b+Pt)*l,u=Math.sin(b+Pt)*(n?n/2-c:l),i.arc(e-d,s-r,c,b-H,b-U),i.arc(e+u,s-a,c,b-U,b),i.arc(e+d,s+r,c,b,b+U),i.arc(e-u,s+a,c,b+U,b+H),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*m,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}b+=Pt;case"rectRot":d=Math.cos(b)*(n?n/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),i.moveTo(e-d,s-r),i.lineTo(e+u,s-a),i.lineTo(e+d,s+r),i.lineTo(e-u,s+a),i.closePath();break;case"crossRot":b+=Pt;case"cross":d=Math.cos(b)*(n?n/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),i.moveTo(e-d,s-r),i.lineTo(e+d,s+r),i.moveTo(e+u,s-a),i.lineTo(e-u,s+a);break;case"star":d=Math.cos(b)*(n?n/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),i.moveTo(e-d,s-r),i.lineTo(e+d,s+r),i.moveTo(e+u,s-a),i.lineTo(e-u,s+a),b+=Pt,d=Math.cos(b)*(n?n/2:m),a=Math.cos(b)*m,r=Math.sin(b)*m,u=Math.sin(b)*(n?n/2:m),i.moveTo(e-d,s-r),i.lineTo(e+d,s+r),i.moveTo(e+u,s-a),i.lineTo(e-u,s+a);break;case"line":a=n?n/2:Math.cos(b)*m,r=Math.sin(b)*m,i.moveTo(e-a,s-r),i.lineTo(e+a,s+r);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(b)*(n?n/2:m),s+Math.sin(b)*m);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function _e(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function ji(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function Fi(i){i.restore()}function or(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else n==="after"!=!!s?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function ar(i,t,e,s){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function rr(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),L(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function lr(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),a=t-o.actualBoundingBoxLeft,r=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(a,h),i.lineTo(r,h),i.stroke()}}function cr(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function ve(i,t,e,s,n,o={}){const a=Y(t)?t:[t],r=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,rr(i,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&cr(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),L(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),lr(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function Ue(i,t){const{x:e,y:s,w:n,h:o,radius:a}=t;i.arc(e+a.topLeft,s+a.topLeft,a.topLeft,1.5*H,H,!0),i.lineTo(e,s+o-a.bottomLeft),i.arc(e+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,H,U,!0),i.lineTo(e+n-a.bottomRight,s+o),i.arc(e+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,U,0,!0),i.lineTo(e+n,s+a.topRight),i.arc(e+n-a.topRight,s+a.topRight,a.topRight,0,-U,!0),i.lineTo(e+a.topLeft,s)}const hr=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,dr=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ur(i,t){const e=(""+i).match(hr);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const fr=i=>+i||0;function Ei(i,t){const e={},s=E(t),n=s?Object.keys(t):t,o=E(i)?s?a=>O(i[a],i[t[a]]):a=>i[a]:()=>i;for(const a of n)e[a]=fr(o(a));return e}function Dn(i){return Ei(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Zt(i){return Ei(i,["topLeft","topRight","bottomLeft","bottomRight"])}function rt(i){const t=Dn(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function J(i,t){i=i||{},t=t||Z.font;let e=O(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=O(i.style,t.style);s&&!(""+s).match(dr)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:O(i.family,t.family),lineHeight:ur(O(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:O(i.weight,t.weight),string:""};return n.string=nr(n),n}function Re(i,t,e,s){let n,o,a;for(n=0,o=i.length;n<o;++n)if(a=i[n],a!==void 0&&a!==void 0)return a}function gr(i,t,e){const{min:s,max:n}=i,o=xn(t,(n-s)/2),a=(r,l)=>e&&r===0?0:r+l;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function Ht(i,t){return Object.assign(Object.create(i),t)}function zi(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=On("_fallback",i));const a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:r=>zi([r,...i],t,o,s)};return new Proxy(a,{deleteProperty(r,l){return delete r[l],delete r._keys,delete i[0][l],!0},get(r,l){return Rn(r,l,()=>Sr(l,t,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return hs(r).includes(l)},ownKeys(r){return hs(r)},set(r,l,c){const h=r._storage||(r._storage=n());return r[l]=h[l]=c,delete r._keys,!0}})}function qt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Pn(i,s),setContext:o=>qt(i,o,e,s),override:o=>qt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return Rn(o,a,()=>mr(o,a,r))},getOwnPropertyDescriptor(o,a){return o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,a){return Reflect.has(i,a)},ownKeys(){return Reflect.ownKeys(i)},set(o,a,r){return i[a]=r,delete o[a],!0}})}function Pn(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:At(e)?e:()=>e,isIndexable:At(s)?s:()=>s}}const pr=(i,t)=>i?i+Di(t):t,Li=(i,t)=>E(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Rn(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function mr(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=i;let r=s[t];return At(r)&&a.isScriptable(t)&&(r=br(t,r,i,e)),Y(r)&&r.length&&(r=xr(t,r,i,a.isIndexable)),Li(t,r)&&(r=qt(r,n,o&&o[t],a)),r}function br(i,t,e,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=e;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let l=t(o,a||s);return r.delete(i),Li(i,l)&&(l=Ii(n._scopes,n,i,l)),l}function xr(i,t,e,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(E(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=Ii(c,n,i,h);t.push(qt(d,o,a&&a[i],r))}}return t}function Tn(i,t,e){return At(i)?i(t,e):i}const yr=(i,t)=>i===!0?t:typeof i=="string"?Lt(t,i):void 0;function _r(i,t,e,s,n){for(const o of t){const a=yr(e,o);if(a){i.add(a);const r=Tn(a._fallback,e,n);if(typeof r<"u"&&r!==e&&r!==s)return r}else if(a===!1&&typeof s<"u"&&e!==s)return null}return!1}function Ii(i,t,e,s){const n=t._rootScopes,o=Tn(t._fallback,e,s),a=[...i,...n],r=new Set;r.add(s);let l=cs(r,a,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=cs(r,a,o,l,s),l===null)?!1:zi(Array.from(r),[""],n,o,()=>vr(t,e,s))}function cs(i,t,e,s,n){for(;e;)e=_r(i,t,e,s,n);return e}function vr(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return Y(n)&&E(e)?e:n||{}}function Sr(i,t,e,s){let n;for(const o of t)if(n=On(pr(o,i),e),typeof n<"u")return Li(i,n)?Ii(e,s,i,n):n}function On(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function hs(i){let t=i._keys;return t||(t=i._keys=Mr(i._scopes)),t}function Mr(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}const kr=Number.EPSILON||1e-14,Ut=(i,t)=>t<i.length&&!i[t].skip&&i[t],jn=i=>i==="x"?"y":"x";function wr(i,t,e,s){const n=i.skip?t:i,o=t,a=e.skip?t:e,r=mi(o,n),l=mi(a,o);let c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,u=s*h;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function Ar(i,t,e){const s=i.length;let n,o,a,r,l,c=Ut(i,0);for(let h=0;h<s-1;++h)if(l=c,c=Ut(i,h+1),!(!l||!c)){if(de(t[h],0,kr)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],o=e[h+1]/t[h],r=Math.pow(n,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),e[h]=n*a*t[h],e[h+1]=o*a*t[h])}}function Cr(i,t,e="x"){const s=jn(e),n=i.length;let o,a,r,l=Ut(i,0);for(let c=0;c<n;++c){if(a=r,r=l,l=Ut(i,c+1),!r)continue;const h=r[e],d=r[s];a&&(o=(h-a[e])/3,r[`cp1${e}`]=h-o,r[`cp1${s}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,r[`cp2${e}`]=h+o,r[`cp2${s}`]=d+o*t[c])}}function Dr(i,t="x"){const e=jn(t),s=i.length,n=Array(s).fill(0),o=Array(s);let a,r,l,c=Ut(i,0);for(a=0;a<s;++a)if(r=l,l=c,c=Ut(i,a+1),!!l){if(c){const h=c[t]-l[t];n[a]=h!==0?(c[e]-l[e])/h:0}o[a]=r?c?gt(n[a-1])!==gt(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}Ar(i,n,o),Cr(i,o,t)}function Te(i,t,e){return Math.max(Math.min(i,e),t)}function Pr(i,t){let e,s,n,o,a,r=_e(i[0],t);for(e=0,s=i.length;e<s;++e)a=o,o=r,r=e<s-1&&_e(i[e+1],t),o&&(n=i[e],a&&(n.cp1x=Te(n.cp1x,t.left,t.right),n.cp1y=Te(n.cp1y,t.top,t.bottom)),r&&(n.cp2x=Te(n.cp2x,t.left,t.right),n.cp2y=Te(n.cp2y,t.top,t.bottom)))}function Rr(i,t,e,s,n){let o,a,r,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Dr(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,a=i.length;o<a;++o)r=i[o],l=wr(c,r,i[Math.min(o+1,a-(s?0:1))%a],t.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}t.capBezierPoints&&Pr(i,e)}function Hi(){return typeof window<"u"&&typeof document<"u"}function $i(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Xe(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const Je=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Tr(i,t){return Je(i).getPropertyValue(t)}const Or=["top","right","bottom","left"];function Et(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=Or[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const jr=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function Fr(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let a=!1,r,l;if(jr(n,o,i.target))r=n,l=o;else{const c=t.getBoundingClientRect();r=s.clientX-c.left,l=s.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function Ot(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Je(e),o=n.boxSizing==="border-box",a=Et(n,"padding"),r=Et(n,"border","width"),{x:l,y:c,box:h}=Fr(i,e),d=a.left+(h&&r.left),u=a.top+(h&&r.top);let{width:f,height:p}=t;return o&&(f-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/p*e.height/s)}}function Er(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&$i(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const a=o.getBoundingClientRect(),r=Je(o),l=Et(r,"border","width"),c=Et(r,"padding");t=a.width-c.width-l.width,e=a.height-c.height-l.height,s=Xe(r.maxWidth,o,"clientWidth"),n=Xe(r.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||qe,maxHeight:n||qe}}const Mt=i=>Math.round(i*10)/10;function zr(i,t,e,s){const n=Je(i),o=Et(n,"margin"),a=Xe(n.maxWidth,i,"clientWidth")||qe,r=Xe(n.maxHeight,i,"clientHeight")||qe,l=Er(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const u=Et(n,"border","width"),f=Et(n,"padding");c-=f.width+u.width,h-=f.height+u.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=Mt(Math.min(c,a,l.maxWidth)),h=Mt(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Mt(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=Mt(Math.floor(h*s))),{width:c,height:h}}function ds(i,t,e){const s=t||1,n=Mt(i.height*s),o=Mt(i.width*s);i.height=Mt(i.height),i.width=Mt(i.width);const a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||a.height!==n||a.width!==o?(i.currentDevicePixelRatio=s,a.height=n,a.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const Lr=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};Hi()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function us(i,t){const e=Tr(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function jt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function Ir(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function Hr(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=jt(i,n,e),r=jt(n,o,e),l=jt(o,t,e),c=jt(a,r,e),h=jt(r,l,e);return jt(c,h,e)}const $r=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Wr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Yt(i,t,e){return i?$r(t,e):Wr()}function Fn(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function En(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function zn(i){return i==="angle"?{between:ye,compare:$a,normalize:ct}:{between:St,compare:(t,e)=>t-e,normalize:t=>t}}function fs({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function Br(i,t,e){const{property:s,start:n,end:o}=e,{between:a,normalize:r}=zn(s),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&a(r(t[c%l][s]),n,o);++u)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function Vr(i,t,e){if(!e)return[i];const{property:s,start:n,end:o}=e,a=t.length,{compare:r,between:l,normalize:c}=zn(s),{start:h,end:d,loop:u,style:f}=Br(i,t,e),p=[];let m=!1,b=null,x,v,k;const w=()=>l(n,k,x)&&r(n,k)!==0,M=()=>r(o,x)===0||l(o,k,x),C=()=>m||w(),D=()=>!m||M();for(let A=h,R=h;A<=d;++A)v=t[A%a],!v.skip&&(x=c(v[s]),x!==k&&(m=l(x,n,o),b===null&&C()&&(b=r(x,n)===0?A:R),b!==null&&D()&&(p.push(fs({start:b,end:A,loop:u,count:a,style:f})),b=null),R=A,k=x));return b!==null&&p.push(fs({start:b,end:d,loop:u,count:a,style:f})),p}function Nr(i,t){const e=[],s=i.segments;for(let n=0;n<s.length;n++){const o=Vr(s[n],i.points,t);o.length&&e.push(...o)}return e}function Zr(i,t,e,s){let n=0,o=t-1;if(e&&!s)for(;n<t&&!i[n].skip;)n++;for(;n<t&&i[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Yr(i,t,e,s){const n=i.length,o=[];let a=t,r=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?r.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=a=c.stop?l:null):(a=l,r.skip&&(t=l)),r=c}return a!==null&&o.push({start:t%n,end:a%n,loop:s}),o}function qr(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:a,end:r}=Zr(e,n,o,s);if(s===!0)return gs(i,[{start:a,end:r,loop:o}],e,t);const l=r<a?r+n:r,c=!!i._fullLoop&&a===0&&r===n-1;return gs(i,Yr(e,a,l,c),e,t)}function gs(i,t,e,s){return!s||!s.setContext||!e?t:Ur(i,t,e,s)}function Ur(i,t,e,s){const n=i._chart.getContext(),o=ps(i.options),{_datasetIndex:a,options:{spanGaps:r}}=i,l=e.length,c=[];let h=o,d=t[0].start,u=d;function f(p,m,b,x){const v=r?-1:1;if(p!==m){for(p+=l;e[p%l].skip;)p-=v;for(;e[m%l].skip;)m+=v;p%l!==m%l&&(c.push({start:p%l,end:m%l,loop:b,style:x}),h=x,d=m%l)}}for(const p of t){d=r?d:p.start;let m=e[d%l],b;for(u=d+1;u<=p.end;u++){const x=e[u%l];b=ps(s.setContext(Ht(n,{type:"segment",p0:m,p1:x,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),Xr(b,h)&&f(d,u-1,p.loop,h),m=x,h=b}d<u-1&&f(d,u-1,p.loop,h)}return c}function ps(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function Xr(i,t){if(!t)return!1;const e=[],s=function(n,o){return Ti(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,s)!==JSON.stringify(t,s)}function Oe(i,t,e){return i.options.clip?i[e]:t[e]}function Kr(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:Oe(e,t,"left"),right:Oe(e,t,"right"),top:Oe(s,t,"top"),bottom:Oe(s,t,"bottom")}:t}function Gr(i,t){const e=t._clip;if(e.disabled)return!1;const s=Kr(t,i.chartArea);return{left:e.left===!1?0:s.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:s.right+(e.right===!0?0:e.right),top:e.top===!1?0:s.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:s.bottom+(e.bottom===!0?0:e.bottom)}}/*!
15 * Chart.js v4.5.1
16 * https://www.chartjs.org
17 * (c) 2025 Chart.js Contributors
18 * Released under the MIT License
19 */class Qr{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=kn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let a=o.length-1,r=!1,l;for(;a>=0;--a)l=o[a],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),r=!0):(o[a]=o[o.length-1],o.pop());r&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var mt=new Qr;const ms="transparent",Jr={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=os(i||ms),n=s.valid&&os(t||ms);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class tl{constructor(t,e,s,n){const o=e[s];n=Re([t.to,n,o,t.from]);const a=Re([t.from,o,n]);this._active=!0,this._fn=t.fn||Jr[t.type||typeof a],this._easing=ue[t.easing]||ue.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Re([t.to,e,n,t.from]),this._from=Re([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,a=this._loop,r=this._to;let l;if(this._active=o!==r&&(a||e<s),!this._active){this._target[n]=r,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=a&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,r,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class Ln{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!E(t))return;const e=Object.keys(Z.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!E(o))return;const a={};for(const r of e)a[r]=o[r];(Y(o.properties)&&o.properties||[n]).forEach(r=>{(r===n||!s.has(r))&&s.set(r,a)})})}_animateOptions(t,e){const s=e.options,n=il(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&el(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now();let l;for(l=a.length-1;l>=0;--l){const c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,r);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new tl(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return mt.add(this._chart,s),!0}}function el(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function il(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function bs(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function sl(i,t,e){if(e===!1)return!1;const s=bs(i,e),n=bs(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function nl(i){let t,e,s,n;return E(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function In(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function xs(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let a,r,l,c;if(t===null)return;let h=!1;for(a=0,r=n.length;a<r;++a){if(l=+n[a],l===e){if(h=!0,s.all)continue;break}c=i.values[l],at(c)&&(o||t===0||gt(t)===gt(c))&&(t+=c)}return!h&&!s.all?0:t}function ol(i,t){const{iScale:e,vScale:s}=t,n=e.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",a=Object.keys(i),r=new Array(a.length);let l,c,h;for(l=0,c=a.length;l<c;++l)h=a[l],r[l]={[n]:h,[o]:i[h]};return r}function ai(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function al(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function rl(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function ll(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function ys(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function _s(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,c=a.axis,h=al(o,a,s),d=t.length;let u;for(let f=0;f<d;++f){const p=t[f],{[l]:m,[c]:b}=p,x=p._stacks||(p._stacks={});u=x[c]=ll(n,h,m),u[r]=b,u._top=ys(u,a,!0,s.type),u._bottom=ys(u,a,!1,s.type);const v=u._visualValues||(u._visualValues={});v[r]=b}}function ri(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function cl(i,t){return Ht(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function hl(i,t,e){return Ht(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Jt(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const li=i=>i==="reset"||i==="none",vs=(i,t)=>t?i:Object.assign({},i),dl=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:In(e,!0),values:null};class zt{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ai(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&&Jt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,p)=>d==="x"?u:d==="r"?p:f,o=e.xAxisID=O(s.xAxisID,ri(t,"x")),a=e.yAxisID=O(s.yAxisID,ri(t,"y")),r=e.rAxisID=O(s.rAxisID,ri(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,a,r),h=e.vAxisID=n(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&is(this._data,this),t._stacked&&Jt(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(E(e)){const n=this._cachedMeta;this._data=ol(e,n)}else if(s!==e){if(s){is(s,this);const n=this._cachedMeta;Jt(n),n._parsed=[]}e&&Object.isExtensible(e)&&Na(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=ai(e.vScale,e),e.stack!==s.stack&&(n=!0,Jt(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(_s(this,e._parsed),e._stacked=ai(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:a}=s,r=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{Y(n[t])?u=this.parseArrayData(s,n,t,e):E(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);const f=()=>d[r]===null||c&&d[r]<c[r];for(h=0;h<e;++h)s._parsed[h+t]=d=u[h],l&&(f()&&(l=!1),c=d);s._sorted=l}a&&_s(this,u)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:a}=t,r=o.axis,l=a.axis,c=o.getLabels(),h=o===a,d=new Array(n);let u,f,p;for(u=0,f=n;u<f;++u)p=u+s,d[u]={[r]:h||o.parse(c[p],p),[l]:a.parse(e[p],p)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:a}=t,r=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],r[l]={x:o.parse(d[0],h),y:a.parse(d[1],h)};return r}parseObjectData(t,e,s,n){const{xScale:o,yScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,u,f;for(h=0,d=n;h<d;++h)u=h+s,f=e[u],c[h]={x:o.parse(Lt(f,r),u),y:a.parse(Lt(f,l),u)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,a=e[t.axis],r={keys:In(n,!0),values:e._stacks[t.axis]._visualValues};return xs(r,a,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let a=o===null?NaN:o;const r=n&&s._stacks[e.axis];n&&r&&(n.values=r,a=xs(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,a),t.max=Math.max(t.max,a)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,a=n.length,r=this._getOtherScale(t),l=dl(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=rl(r);let u,f;function p(){f=n[u];const m=f[r.axis];return!at(f[t.axis])||h>m||d<m}for(u=0;u<a&&!(!p()&&(this.updateRangeFromParsed(c,t,f,l),o));++u);if(o){for(u=a-1;u>=0;--u)if(!p()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,a;for(n=0,o=e.length;n<o;++n)a=e[n][t.axis],at(a)&&s.push(a);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=nl(O(this.options.clip,sl(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,a=[],r=this._drawStart||0,l=this._drawCount||n.length-r,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,r,l),h=r;h<r+l;++h){const d=n[h];d.hidden||(d.active&&c?a.push(d):d.draw(t,o))}for(h=0;h<a.length;++h)a[h].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const a=this._cachedMeta.data[t];o=a.$context||(a.$context=hl(this.getContext(),t,a)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=cl(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,a=t+"-"+e,r=o[a],l=this.enableOptionSharing&&be(s);if(r)return vs(r,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],u=c.getOptionScopes(this.getDataset(),h),f=Object.keys(Z.elements[t]),p=()=>this.getContext(s,n,e),m=c.resolveNamedOptions(u,f,p,d);return m.$shared&&(m.$shared=l,o[a]=Object.freeze(vs(m,l))),m}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}const c=new Ln(n,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||li(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),a=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:a}}updateElement(t,e,s,n){li(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!li(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[r,l,c]of this._syncList)this[r](l,c);this._syncList=[];const n=s.length,o=e.length,a=Math.min(o,n);a&&this.parse(0,a),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,a=t+e;let r;const l=c=>{for(c.length+=e,r=c.length-1;r>=a;r--)c[r]=c[r-e]};for(l(o),r=t;r<a;++r)o[r]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&Jt(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}P(zt,"defaults",{}),P(zt,"datasetElementType",null),P(zt,"dataElementType",null);function ul(i,t){if(!i._cache.$bar){const e=i.getMatchingVisibleMetas(t);let s=[];for(let n=0,o=e.length;n<o;n++)s=s.concat(e[n].controller.getAllParsedValues(i));i._cache.$bar=Mn(s.sort((n,o)=>n-o))}return i._cache.$bar}function fl(i){const t=i.iScale,e=ul(t,i.type);let s=t._length,n,o,a,r;const l=()=>{a===32767||a===-32768||(be(r)&&(s=Math.min(s,Math.abs(a-r)||s)),r=a)};for(n=0,o=e.length;n<o;++n)a=t.getPixelForValue(e[n]),l();for(r=void 0,n=0,o=t.ticks.length;n<o;++n)a=t.getPixelForTick(n),l();return s}function gl(i,t,e,s){const n=e.barThickness;let o,a;return L(n)?(o=t.min*e.categoryPercentage,a=e.barPercentage):(o=n*s,a=1),{chunk:o/s,ratio:a,start:t.pixels[i]-o/2}}function pl(i,t,e,s){const n=t.pixels,o=n[i];let a=i>0?n[i-1]:null,r=i<n.length-1?n[i+1]:null;const l=e.categoryPercentage;a===null&&(a=o-(r===null?t.end-t.start:r-o)),r===null&&(r=o+o-a);const c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/s,ratio:e.barPercentage,start:c}}function ml(i,t,e,s){const n=e.parse(i[0],s),o=e.parse(i[1],s),a=Math.min(n,o),r=Math.max(n,o);let l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:a,max:r}}function Hn(i,t,e,s){return Y(i)?ml(i,t,e,s):t[e.axis]=e.parse(i,s),t}function Ss(i,t,e,s){const n=i.iScale,o=i.vScale,a=n.getLabels(),r=n===o,l=[];let c,h,d,u;for(c=e,h=e+s;c<h;++c)u=t[c],d={},d[n.axis]=r||n.parse(a[c],c),l.push(Hn(u,d,o,c));return l}function ci(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function bl(i,t,e){return i!==0?gt(i):(t.isHorizontal()?1:-1)*(t.min>=e?1:-1)}function xl(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.base<i.y,e="bottom",s="top"),t?(n="end",o="start"):(n="start",o="end"),{start:e,end:s,reverse:t,top:n,bottom:o}}function yl(i,t,e,s){let n=t.borderSkipped;const o={};if(!n){i.borderSkipped=o;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:a,end:r,reverse:l,top:c,bottom:h}=xl(i);n==="middle"&&e&&(i.enableBorderRadius=!0,(e._top||0)===s?n=c:(e._bottom||0)===s?n=h:(o[Ms(h,a,r,l)]=!0,n=c)),o[Ms(n,a,r,l)]=!0,i.borderSkipped=o}function Ms(i,t,e,s){return s?(i=_l(i,t,e),i=ks(i,e,t)):i=ks(i,t,e),i}function _l(i,t,e){return i===t?e:i===e?t:i}function ks(i,t,e){return i==="start"?t:i==="end"?e:i}function vl(i,{inflateAmount:t},e){i.inflateAmount=t==="auto"?e===1?.33:0:t}class He extends zt{parsePrimitiveData(t,e,s,n){return Ss(t,e,s,n)}parseArrayData(t,e,s,n){return Ss(t,e,s,n)}parseObjectData(t,e,s,n){const{iScale:o,vScale:a}=t,{xAxisKey:r="x",yAxisKey:l="y"}=this._parsing,c=o.axis==="x"?r:l,h=a.axis==="x"?r:l,d=[];let u,f,p,m;for(u=s,f=s+n;u<f;++u)m=e[u],p={},p[o.axis]=o.parse(Lt(m,c),u),d.push(Hn(Lt(m,h),p,a,u));return d}updateRangeFromParsed(t,e,s,n){super.updateRangeFromParsed(t,e,s,n);const o=s._custom;o&&e===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const e=this._cachedMeta,{iScale:s,vScale:n}=e,o=this.getParsed(t),a=o._custom,r=ci(a)?"["+a.start+", "+a.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+s.getLabelForValue(o[s.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const e=this._cachedMeta;this.updateElements(e.data,0,e.data.length,t)}updateElements(t,e,s,n){const o=n==="reset",{index:a,_cachedMeta:{vScale:r}}=this,l=r.getBasePixel(),c=r.isHorizontal(),h=this._getRuler(),{sharedOptions:d,includeOptions:u}=this._getSharedOptions(e,n);for(let f=e;f<e+s;f++){const p=this.getParsed(f),m=o||L(p[r.axis])?{base:l,head:l}:this._calculateBarValuePixels(f),b=this._calculateBarIndexPixels(f,h),x=(p._stacks||{})[r.axis],v={horizontal:c,base:m.base,enableBorderRadius:!x||ci(p._custom)||a===x._top||a===x._bottom,x:c?m.head:b.center,y:c?b.center:m.head,height:c?b.size:Math.abs(m.size),width:c?Math.abs(m.size):b.size};u&&(v.options=d||this.resolveDataElementOptions(f,t[f].active?"active":n));const k=v.options||t[f].options;yl(v,k,x,a),vl(v,k,h.ratio),this.updateElement(t[f],f,v,n)}}_getStacks(t,e){const{iScale:s}=this._cachedMeta,n=s.getMatchingVisibleMetas(this._type).filter(h=>h.controller.options.grouped),o=s.options.stacked,a=[],r=this._cachedMeta.controller.getParsed(e),l=r&&r[s.axis],c=h=>{const d=h._parsed.find(f=>f[s.axis]===l),u=d&&d[h.vScale.axis];if(L(u)||isNaN(u))return!0};for(const h of n)if(!(e!==void 0&&c(h))&&((o===!1||a.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&a.push(h.stack),h.index===t))break;return a.length||a.push(void 0),a}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(s=>t[s].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const s of this.chart.data.datasets)t[O(this.chart.options.indexAxis==="x"?s.xAxisID:s.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,s){const n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let o,a;for(o=0,a=e.data.length;o<a;++o)n.push(s.getPixelForValue(this.getParsed(o)[s.axis],o));const r=t.barThickness;return{min:r||fl(e),pixels:n,start:s._startPixel,end:s._endPixel,stackCount:this._getStackCount(),scale:s,grouped:t.grouped,ratio:r?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:e,_stacked:s,index:n},options:{base:o,minBarLength:a}}=this,r=o||0,l=this.getParsed(t),c=l._custom,h=ci(c);let d=l[e.axis],u=0,f=s?this.applyStack(e,l,s):d,p,m;f!==d&&(u=f-d,f=d),h&&(d=c.barStart,f=c.barEnd-c.barStart,d!==0&&gt(d)!==gt(c.barEnd)&&(u=0),u+=d);const b=!L(o)&&!h?o:u;let x=e.getPixelForValue(b);if(this.chart.getDataVisibility(t)?p=e.getPixelForValue(u+f):p=x,m=p-x,Math.abs(m)<a){m=bl(m,e,r)*a,d===r&&(x-=m/2);const v=e.getPixelForDecimal(0),k=e.getPixelForDecimal(1),w=Math.min(v,k),M=Math.max(v,k);x=Math.max(Math.min(x,M),w),p=x+m,s&&!h&&(l._stacks[e.axis]._visualValues[n]=e.getValueForPixel(p)-e.getValueForPixel(x))}if(x===e.getPixelForValue(r)){const v=gt(m)*e.getLineWidthForValue(r)/2;x+=v,m-=v}return{size:m,base:x,head:p,center:p+m/2}}_calculateBarIndexPixels(t,e){const s=e.scale,n=this.options,o=n.skipNull,a=O(n.maxBarThickness,1/0);let r,l;const c=this._getAxisCount();if(e.grouped){const h=o?this._getStackCount(t):e.stackCount,d=n.barThickness==="flex"?pl(t,e,n,h*c):gl(t,e,n,h*c),u=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,f=this._getAxis().indexOf(O(u,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+f;r=d.start+d.chunk*p+d.chunk/2,l=Math.min(a,d.chunk*d.ratio)}else r=s.getPixelForValue(this.getParsed(t)[s.axis],t),l=Math.min(a,e.min*e.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}}draw(){const t=this._cachedMeta,e=t.vScale,s=t.data,n=s.length;let o=0;for(;o<n;++o)this.getParsed(o)[e.axis]!==null&&!s[o].hidden&&s[o].draw(this._ctx)}}P(He,"id","bar"),P(He,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),P(He,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function Sl(i,t,e){let s=1,n=1,o=0,a=0;if(t<V){const r=i,l=r+t,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(k,w,M)=>ye(k,r,l,!0)?1:Math.max(w,w*e,M,M*e),p=(k,w,M)=>ye(k,r,l,!0)?-1:Math.min(w,w*e,M,M*e),m=f(0,c,d),b=f(U,h,u),x=p(H,c,d),v=p(H+U,h,u);s=(m-x)/2,n=(b-v)/2,o=-(m+x)/2,a=-(b+v)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}class oe extends zt{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=l=>+s[l];if(E(s[t])){const{key:l="value"}=this._parsing;o=c=>+Lt(s[c],l)}let a,r;for(a=t,r=t+e;a<r;++a)n._parsed[a]=o(a)}}_getRotation(){return yt(this.options.rotation-90)}_getCircumference(){return yt(this.options.circumference)}_getRotationExtents(){let t=V,e=-V;for(let s=0;s<this.chart.data.datasets.length;++s)if(this.chart.isDatasetVisible(s)&&this.chart.getDatasetMeta(s).type===this._type){const n=this.chart.getDatasetMeta(s).controller,o=n._getRotation(),a=n._getCircumference();t=Math.min(t,o),e=Math.max(e,o+a)}return{rotation:t,circumference:e-t}}update(t){const e=this.chart,{chartArea:s}=e,n=this._cachedMeta,o=n.data,a=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,r=Math.max((Math.min(s.width,s.height)-a)/2,0),l=Math.min(Ca(this.options.cutout,r),1),c=this._getRingWeight(this.index),{circumference:h,rotation:d}=this._getRotationExtents(),{ratioX:u,ratioY:f,offsetX:p,offsetY:m}=Sl(d,h,l),b=(s.width-a)/u,x=(s.height-a)/f,v=Math.max(Math.min(b,x)/2,0),k=xn(this.options.radius,v),w=Math.max(k*l,0),M=(k-w)/this._getVisibleDatasetWeightTotal();this.offsetX=p*k,this.offsetY=m*k,n.total=this.calculateTotal(),this.outerRadius=k-M*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-M*c,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){const s=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/V)}updateElements(t,e,s,n){const o=n==="reset",a=this.chart,r=a.chartArea,c=a.options.animation,h=(r.left+r.right)/2,d=(r.top+r.bottom)/2,u=o&&c.animateScale,f=u?0:this.innerRadius,p=u?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(e,n);let x=this._getRotation(),v;for(v=0;v<e;++v)x+=this._circumference(v,o);for(v=e;v<e+s;++v){const k=this._circumference(v,o),w=t[v],M={x:h+this.offsetX,y:d+this.offsetY,startAngle:x,endAngle:x+k,circumference:k,outerRadius:p,innerRadius:f};b&&(M.options=m||this.resolveDataElementOptions(v,w.active?"active":n)),x+=k,this.updateElement(w,v,M,n)}}calculateTotal(){const t=this._cachedMeta,e=t.data;let s=0,n;for(n=0;n<e.length;n++){const o=t._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!e[n].hidden&&(s+=Math.abs(o))}return s}calculateCircumference(t){const e=this._cachedMeta.total;return e>0&&!isNaN(t)?V*(Math.abs(t)/e):0}
vendor: 6,439 bytes, line 19
19getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=Oi(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,a,r,l;if(!t){for(n=0,o=s.data.datasets.length;n<o;++n)if(s.isDatasetVisible(n)){a=s.getDatasetMeta(n),t=a.data,r=a.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++n)l=r.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(e=Math.max(e,l.borderWidth||0,l.hoverBorderWidth||0));return e}getMaxOffset(t){let e=0;for(let s=0,n=t.length;s<n;++s){const o=this.resolveDataElementOptions(s);e=Math.max(e,o.offset||0,o.hoverOffset||0)}return e}_getRingWeightOffset(t){let e=0;for(let s=0;s<t;++s)this.chart.isDatasetVisible(s)&&(e+=this._getRingWeight(s));return e}_getRingWeight(t){return Math.max(O(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}P(oe,"id","doughnut"),P(oe,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),P(oe,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),P(oe,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const d=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:n,pointStyle:s,borderRadius:a&&(r||d.borderRadius),index:c}}):[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}});class $e extends zt{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,a=this.chart._animationsDisabled;let{start:r,count:l}=qa(e,n,a);this._drawStart=r,this._drawCount=l,Ua(e)&&(r=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!a,options:c},t),this.updateElements(n,r,l,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:a,vScale:r,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),u=a.axis,f=r.axis,{spanGaps:p,segment:m}=this.options,b=xe(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||n==="none",v=e+s,k=t.length;let w=e>0&&this.getParsed(e-1);for(let M=0;M<k;++M){const C=t[M],D=x?C:{};if(M<e||M>=v){D.skip=!0;continue}const A=this.getParsed(M),R=L(A[f]),j=D[u]=a.getPixelForValue(A[u],M),T=D[f]=o||R?r.getBasePixel():r.getPixelForValue(l?this.applyStack(r,A,l):A[f],M);D.skip=isNaN(j)||isNaN(T)||R,D.stop=M>0&&Math.abs(A[u]-w[u])>b,m&&(D.parsed=A,D.raw=c.data[M]),d&&(D.options=h||this.resolveDataElementOptions(M,C.active?"active":n)),x||this.updateElement(C,M,D,n),w=A}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),a=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,a)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}P($e,"id","line"),P($e,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),P($e,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function Tt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Wi{constructor(t){P(this,"options");this.options=t||{}}static override(t){Object.assign(Wi.prototype,t)}init(){}formats(){return Tt()}parse(){return Tt()}format(){return Tt()}add(){return Tt()}diff(){return Tt()}startOf(){return Tt()}endOf(){return Tt()}}var Ml={_date:Wi};function kl(i,t,e,s){const{controller:n,data:o,_sorted:a}=i,r=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(r&&t===r.axis&&t!=="r"&&a&&o.length){const c=r._reversePixels?Ba:Ft;if(s){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const u=c(o,t,e-d),f=c(o,t,e+d);return{lo:u.lo,hi:f.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:u}=i,f=u.slice(0,h.lo+1).reverse().findIndex(m=>!L(m[d.axis]));h.lo-=Math.max(0,f);const p=u.slice(h.hi).findIndex(m=>!L(m[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function ti(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r<l;++r){const{index:c,data:h}=o[r],{lo:d,hi:u}=kl(o[r],t,a,n);for(let f=d;f<=u;++f){const p=h[f];p.skip||s(p,c,f)}}}function wl(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,a=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function hi(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||ti(i,e,t,function(r,l,c){!n&&!_e(r,i.chartArea,0)||r.inRange(t.x,t.y,s)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function Al(i,t,e,s){let n=[];function o(a,r,l){const{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],s),{angle:d}=vn(a,{x:t.x,y:t.y});ye(d,c,h)&&n.push({element:a,datasetIndex:r,index:l})}return ti(i,e,t,o),n}function Cl(i,t,e,s,n,o){let a=[];const r=wl(e);let l=Number.POSITIVE_INFINITY;function c(h,d,u){const f=h.inRange(t.x,t.y,n);if(s&&!f)return;const p=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(p))&&!f)return;const b=r(t,p);b<l?(a=[{element:h,datasetIndex:d,index:u}],l=b):b===l&&a.push({element:h,datasetIndex:d,index:u})}return ti(i,e,t,c),a}function di(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?Al(i,t,e,n):Cl(i,t,e,s,n,o)}function ws(i,t,e,s,n){const o=[],a=e==="x"?"inXRange":"inYRange";let r=!1;return ti(i,e,t,(l,c,h)=>
vendor: 52,103 bytes, line 19
19{l[a]&&l[a](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(t.x,t.y,n))}),s&&!r?[]:o}var Dl={modes:{index(i,t,e,s){const n=Ot(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?hi(i,n,o,s,a):di(i,n,o,!1,s,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=r[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=Ot(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;let r=e.intersect?hi(i,n,o,s,a):di(i,n,o,!1,s,a);if(r.length>0){const l=r[0].datasetIndex,c=i.getDatasetMeta(l).data;r=[];for(let h=0;h<c.length;++h)r.push({element:c[h],datasetIndex:l,index:h})}return r},point(i,t,e,s){const n=Ot(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return hi(i,n,o,s,a)},nearest(i,t,e,s){const n=Ot(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return di(i,n,o,e.intersect,s,a)},x(i,t,e,s){const n=Ot(t,i);return ws(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=Ot(t,i);return ws(i,n,"y",e.intersect,s)}}};const $n=["left","top","right","bottom"];function te(i,t){return i.filter(e=>e.pos===t)}function As(i,t){return i.filter(e=>$n.indexOf(e.pos)===-1&&e.box.axis===t)}function ee(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Pl(i){const t=[];let e,s,n,o,a,r;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:a,stackWeight:r=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return t}function Rl(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!$n.includes(n))continue;const a=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return t}function Tl(i,t){const e=Rl(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];const{fullSize:l}=r.box,c=e[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*s:l&&t.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:l&&t.availableHeight)}return e}function Ol(i){const t=Pl(i),e=ee(t.filter(c=>c.box.fullSize),!0),s=ee(te(t,"left"),!0),n=ee(te(t,"right")),o=ee(te(t,"top"),!0),a=ee(te(t,"bottom")),r=As(t,"x"),l=As(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:te(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}function Cs(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Wn(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function jl(i,t,e,s){const{pos:n,box:o}=e,a=i.maxPadding;if(!E(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&Wn(a,o.getPadding());const r=Math.max(0,t.outerWidth-Cs(a,i,"left","right")),l=Math.max(0,t.outerHeight-Cs(a,i,"top","bottom")),c=r!==i.w,h=l!==i.h;return i.w=r,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Fl(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function El(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(a=>{o[a]=Math.max(t[a],e[a])}),o}return s(i?["left","right"]:["top","bottom"])}function ae(i,t,e,s){const n=[];let o,a,r,l,c,h;for(o=0,a=i.length,c=0;o<a;++o){r=i[o],l=r.box,l.update(r.width||t.w,r.height||t.h,El(r.horizontal,t));const{same:d,other:u}=jl(t,e,r,s);c|=d&&n.length,h=h||u,l.fullSize||n.push(r)}return c&&ae(n,t,e,s)||h}function je(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function Ds(i,t,e,s){const n=e.padding;let{x:o,y:a}=t;for(const r of i){const l=r.box,c=s[r.stack]||{placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){const d=t.w*h,u=c.size||l.height;be(c.start)&&(a=c.start),l.fullSize?je(l,n.left,a,e.outerWidth-n.right-n.left,u):je(l,t.left+c.placed,a,d,u),c.start=a,c.placed+=d,a=l.bottom}else{const d=t.h*h,u=c.size||l.width;be(c.start)&&(o=c.start),l.fullSize?je(l,o,n.top,u,e.outerHeight-n.bottom-n.top):je(l,o,t.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=a}var ot={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=rt(i.options.layout.padding),o=Math.max(t-n.width,0),a=Math.max(e-n.height,0),r=Ol(i.boxes),l=r.vertical,c=r.horizontal;I(i.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=l.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},n);Wn(u,rt(s));const f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),p=Tl(l.concat(c),d);ae(r.fullSize,f,d,p),ae(l,f,d,p),ae(c,f,d,p)&&ae(l,f,d,p),Fl(f),Ds(r.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,Ds(r.rightAndBottom,f,d,p),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},I(r.chartArea,m=>{const b=m.box;Object.assign(b,i.chartArea),b.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Bn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class zl extends Bn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const We="$chartjs",Ll={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ps=i=>i===null||i==="";function Il(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[We]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Ps(n)){const o=us(i,"width");o!==void 0&&(i.width=o)}if(Ps(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=us(i,"height");o!==void 0&&(i.height=o)}return i}const Vn=Lr?{passive:!0}:!1;function Hl(i,t,e){i&&i.addEventListener(t,e,Vn)}function $l(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,Vn)}function Wl(i,t){const e=Ll[i.type]||i.type,{x:s,y:n}=Ot(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Ke(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Bl(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Ke(r.addedNodes,s),a=a&&!Ke(r.removedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Vl(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(const r of o)a=a||Ke(r.removedNodes,s),a=a&&!Ke(r.addedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const Se=new Map;let Rs=0;function Nn(){const i=window.devicePixelRatio;i!==Rs&&(Rs=i,Se.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Nl(i,t){Se.size||window.addEventListener("resize",Nn),Se.set(i,t)}function Zl(i){Se.delete(i),Se.size||window.removeEventListener("resize",Nn)}function Yl(i,t,e){const s=i.canvas,n=s&&$i(s);if(!n)return;const o=wn((r,l)=>{const c=n.clientWidth;e(r,l),c<n.clientWidth&&e()},window),a=new ResizeObserver(r=>{const l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return a.observe(n),Nl(i,o),a}function ui(i,t,e){e&&e.disconnect(),t==="resize"&&Zl(i)}function ql(i,t,e){const s=i.canvas,n=wn(o=>{i.ctx!==null&&e(Wl(o,i))},i);return Hl(s,t,n),n}class Ul extends Bn{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Il(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[We])return!1;const s=e[We].initial;["height","width"].forEach(o=>{const a=s[o];L(a)?e.removeAttribute(o):e.setAttribute(o,a)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[We],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),a={attach:Bl,detach:Vl,resize:Yl}[e]||ql;n[e]=a(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ui,detach:ui,resize:ui}[e]||$l)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return zr(t,e,s,n)}isAttached(t){const e=t&&$i(t);return!!(e&&e.isConnected)}}function Xl(i){return!Hi()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?zl:Ul}class ht{constructor(){P(this,"x");P(this,"y");P(this,"active",!1);P(this,"options");P(this,"$animations")}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return xe(this.x)&&xe(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}P(ht,"defaults",{}),P(ht,"defaultRoutes");function Kl(i,t){const e=i.options.ticks,s=Gl(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Jl(t):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>n)return tc(t,c,o,a/n),c;const h=Ql(o,t,n);if(a>0){let d,u;const f=a>1?Math.round((l-r)/(a-1)):null;for(Fe(t,c,h,L(f)?0:r-f,r),d=0,u=a-1;d<u;d++)Fe(t,c,h,o[d],o[d+1]);return Fe(t,c,h,l,L(f)?t.length:l+f),c}return Fe(t,c,h),c}function Gl(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function Ql(i,t,e){const s=ec(i),n=t.length/e;if(!s)return Math.max(n,1);const o=Ea(s);for(let a=0,r=o.length-1;a<r;a++){const l=o[a];if(l>n)return l}return Math.max(n,1)}function Jl(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function tc(i,t,e,s){let n=0,o=e[0],a;for(s=Math.ceil(s),a=0;a<i.length;a++)a===o&&(t.push(i[a]),n++,o=e[n*s])}function Fe(i,t,e,s,n){const o=O(s,0),a=Math.min(O(n,i.length),i.length);let r=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,e=l/Math.floor(l/e)),h=o;h<0;)r++,h=Math.round(o+r*e);for(c=Math.max(o,0);c<a;c++)c===h&&(t.push(i[c]),r++,h=Math.round(o+r*e))}function ec(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const ic=i=>i==="left"?"right":i==="right"?"left":i,Ts=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Os=(i,t)=>Math.min(t||i,i);function js(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function sc(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,a=i._endPixel,r=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,a-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-r||l>a+r)))return l}function nc(i,t){I(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function ie(i){return i.drawTicks?i.tickLength:0}function Fs(i,t){if(!i.display)return 0;const e=J(i.font,t),s=rt(i.padding);return(Y(i.text)?i.text.length:1)*e.lineHeight+s.height}function oc(i,t){return Ht(i,{scale:t,type:"scale"})}function ac(i,t,e){return Ht(i,{tick:e,index:t,type:"tick"})}function rc(i,t,e){let s=Ri(i);return(e&&t!=="right"||!e&&t==="right")&&(s=ic(s)),s}function lc(i,t,e,s){const{top:n,left:o,bottom:a,right:r,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,u,f,p;const m=a-n,b=r-o;if(i.isHorizontal()){if(f=G(s,o,r),E(e)){const x=Object.keys(e)[0],v=e[x];p=h[x].getPixelForValue(v)+m-t}else e==="center"?p=(c.bottom+c.top)/2+m-t:p=Ts(i,e,t);u=r-o}else{if(E(e)){const x=Object.keys(e)[0],v=e[x];f=h[x].getPixelForValue(v)-b+t}else e==="center"?f=(c.left+c.right)/2-b+t:f=Ts(i,e,t);p=G(s,a,n),d=e==="left"?-U:U}return{titleX:f,titleY:p,maxWidth:u,rotation:d}}class Xt extends ht{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=dt(t,Number.POSITIVE_INFINITY),e=dt(e,Number.NEGATIVE_INFINITY),s=dt(s,Number.POSITIVE_INFINITY),n=dt(n,Number.NEGATIVE_INFINITY),{min:dt(t,s),max:dt(e,n),minDefined:at(t),maxDefined:at(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),a;if(n&&o)return{min:e,max:s};const r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,t),n||(e=Math.min(e,a.min)),o||(s=Math.max(s,a.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:dt(e,dt(s,e)),max:dt(s,dt(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){W(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=gr(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=r<this.ticks.length;this._convertTicksToLabels(l?js(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=Kl(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){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){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=W(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){W(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){W(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=Os(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let a=n,r,l,c;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=Q(this.chart.width-d,0,this.maxWidth);r=t.offset?this.maxWidth/s:f/(s-1),d+6>r&&(r=f/(s-(t.offset?.5:1)),l=this.maxHeight-ie(t.grid)-e.padding-Fs(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),a=Ha(Math.min(Math.asin(Q((h.highest.height+6)/r,-1,1)),Math.asin(Q(l/c,-1,1))-Math.asin(Q(u/c,-1,1)))),a=Math.max(n,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){W(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){W(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){const l=Fs(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=ie(o)+l):(t.height=this.maxHeight,t.width=ie(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,p=yt(this.labelRotation),m=Math.cos(p),b=Math.sin(p);if(r){const x=s.mirror?0:b*d.width+m*u.height;t.height=Math.min(this.maxHeight,t.height+x+f)}else{const x=s.mirror?0:m*d.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+x+f)}this._calculatePadding(c,h,b,m)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+a)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+a)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+a,this.paddingBottom=d+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){W(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)L(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=js(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(e/Os(e,s));let c=0,h=0,d,u,f,p,m,b,x,v,k,w,M;for(d=0;d<e;d+=l){if(p=t[d].label,m=this._resolveTickFontOptions(d),n.font=b=m.string,x=o[b]=o[b]||{data:{},gc:[]},v=m.lineHeight,k=w=0,!L(p)&&!Y(p))k=rs(n,x.data,x.gc,k,p),w=v;else if(Y(p))for(u=0,f=p.length;u<f;++u)M=p[u],!L(M)&&!Y(M)&&(k=rs(n,x.data,x.gc,k,M),w+=v);a.push(k),r.push(w),c=Math.max(k,c),h=Math.max(w,h)}nc(o,e);const C=a.indexOf(c),D=r.indexOf(h),A=R=>({width:a[R]||0,height:r[R]||0});return{first:A(0),last:A(e-1),widest:A(C),highest:A(D),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Wa(this._alignToPixels?Rt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=ac(this.getContext(),t,s))}return this.$context||(this.$context=oc(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=yt(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),a=t.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return this.isHorizontal()?l*s>r*n?r/s:l/n:l*n<r*s?l/s:r/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:a,border:r}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=ie(o),f=[],p=r.setContext(this.getContext()),m=p.display?p.width:0,b=m/2,x=function(B){return Rt(s,B,m)};let v,k,w,M,C,D,A,R,j,T,F,X;if(a==="top")v=x(this.bottom),D=this.bottom-u,R=v-b,T=x(t.top)+b,X=t.bottom;else if(a==="bottom")v=x(this.top),T=t.top,X=x(t.bottom)-b,D=v+b,R=this.top+u;else if(a==="left")v=x(this.right),C=this.right-u,A=v-b,j=x(t.left)+b,F=t.right;else if(a==="right")v=x(this.left),j=t.left,F=x(t.right)-b,C=v+b,A=this.left+u;else if(e==="x"){if(a==="center")v=x((t.top+t.bottom)/2+.5);else if(E(a)){const B=Object.keys(a)[0],N=a[B];v=x(this.chart.scales[B].getPixelForValue(N))}T=t.top,X=t.bottom,D=v+b,R=D+u}else if(e==="y"){if(a==="center")v=x((t.left+t.right)/2);else if(E(a)){const B=Object.keys(a)[0],N=a[B];v=x(this.chart.scales[B].getPixelForValue(N))}C=v-b,A=C-u,j=t.left,F=t.right}const st=O(n.ticks.maxTicksLimit,d),$=Math.max(1,Math.ceil(d/st));for(k=0;k<d;k+=$){const B=this.getContext(k),N=o.setContext(B),lt=r.setContext(B),K=N.lineWidth,$t=N.color,we=lt.dash||[],Wt=lt.dashOffset,Kt=N.tickWidth,Ct=N.tickColor,Gt=N.tickBorderDash||[],Dt=N.tickBorderDashOffset;w=sc(this,k,l),w!==void 0&&(M=Rt(s,w,K),c?C=A=j=F=M:D=R=T=X=M,f.push({tx1:C,ty1:D,tx2:A,ty2:R,x1:j,y1:T,x2:F,y2:X,width:K,color:$t,borderDash:we,borderDashOffset:Wt,tickWidth:Kt,tickColor:Ct,tickBorderDash:Gt,tickBorderDashOffset:Dt}))}return this._ticksLength=d,this._borderValue=v,f}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,a=this.isHorizontal(),r=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,u=ie(s.grid),f=u+h,p=d?-h:f,m=-yt(this.labelRotation),b=[];let x,v,k,w,M,C,D,A,R,j,T,F,X="middle";if(n==="top")C=this.bottom-p,D=this._getXAxisLabelAlignment();else if(n==="bottom")C=this.top+p,D=this._getXAxisLabelAlignment();else if(n==="left"){const $=this._getYAxisLabelAlignment(u);D=$.textAlign,M=$.x}else if(n==="right"){const $=this._getYAxisLabelAlignment(u);D=$.textAlign,M=$.x}else if(e==="x"){if(n==="center")C=(t.top+t.bottom)/2+f;else if(E(n)){const $=Object.keys(n)[0],B=n[$];C=this.chart.scales[$].getPixelForValue(B)+f}D=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")M=(t.left+t.right)/2-f;else if(E(n)){const $=Object.keys(n)[0],B=n[$];M=this.chart.scales[$].getPixelForValue(B)}D=this._getYAxisLabelAlignment(u).textAlign}e==="y"&&(l==="start"?X="top":l==="end"&&(X="bottom"));const st=this._getLabelSizes();for(x=0,v=r.length;x<v;++x){k=r[x],w=k.label;const $=o.setContext(this.getContext(x));A=this.getPixelForTick(x)+o.labelOffset,R=this._resolveTickFontOptions(x),j=R.lineHeight,T=Y(w)?w.length:1;const B=T/2,N=$.color,lt=$.textStrokeColor,K=$.textStrokeWidth;let $t=D;a?(M=A,D==="inner"&&(x===v-1?$t=this.options.reverse?"left":"right":x===0?$t=this.options.reverse?"right":"left":$t="center"),n==="top"?c==="near"||m!==0?F=-T*j+j/2:c==="center"?F=-st.highest.height/2-B*j+j:F=-st.highest.height+j/2:c==="near"||m!==0?F=j/2:c==="center"?F=st.highest.height/2-B*j:F=st.highest.height-T*j,d&&(F*=-1),m!==0&&!$.showLabelBackdrop&&(M+=j/2*Math.sin(m))):(C=A,F=(1-T)*j/2);let we;if($.showLabelBackdrop){const Wt=rt($.backdropPadding),Kt=st.heights[x],Ct=st.widths[x];let Gt=F-Wt.top,Dt=0-Wt.left;switch(X){case"middle":Gt-=Kt/2;break;case"bottom":Gt-=Kt;break}switch(D){case"center":Dt-=Ct/2;break;case"right":Dt-=Ct;break;case"inner":x===v-1?Dt-=Ct:x>0&&(Dt-=Ct/2);break}we={left:Dt,top:Gt,width:Ct+Wt.width,height:Kt+Wt.height,color:$.backdropColor}}b.push({label:w,font:R,textOffset:F,options:{rotation:m,color:N,strokeColor:lt,strokeWidth:K,textAlign:$t,textBaseline:X,translation:[M,C],backdrop:we}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-yt(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,a=this._getLabelSizes(),r=t+o,l=a.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-r,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+r,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,a),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,a;const r=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,a=n.length;o<a;++o){const l=n[o];e.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&r({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;const r=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,u;this.isHorizontal()?(c=Rt(t,this.left,a)-a/2,h=Rt(t,this.right,r)+r/2,d=u=l):(d=Rt(t,this.top,a)-a/2,u=Rt(t,this.bottom,r)+r/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,u),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&ji(s,n);const o=this.getLabelItems(t);for(const a of o){const r=a.options,l=a.font,c=a.label,h=a.textOffset;ve(s,c,0,h,l,r)}n&&Fi(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=J(s.font),a=rt(s.padding),r=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||E(e)?(l+=a.bottom,Y(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=a.top;const{titleX:c,titleY:h,maxWidth:d,rotation:u}=lc(this,l,e,r);ve(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:u,textAlign:rc(r,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=O(t.grid&&t.grid.z,-1),n=O(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==Xt.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,a;for(o=0,a=e.length;o<a;++o){const r=e[o];r[s]===this.id&&(!t||r.type===t)&&n.push(r)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return J(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class Ee{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;dc(e)&&(s=this.register(e));const n=this.items,o=t.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,cc(t,a,s),this.override&&Z.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in Z[n]&&(delete Z[n][s],this.override&&delete It[s])}}function cc(i,t,e){const s=me(Object.create(null),[e?Z.get(e):{},Z.get(t),i.defaults]);Z.set(t,s),i.defaultRoutes&&hc(t,i.defaultRoutes),i.descriptors&&Z.describe(t,i.descriptors)}function hc(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),a=t[e].split("."),r=a.pop(),l=a.join(".");Z.route(o,n,l,r)})}function dc(i){return"id"in i&&"defaults"in i}class uc{constructor(){this.controllers=new Ee(zt,"datasets",!0),this.elements=new Ee(ht,"elements"),this.plugins=new Ee(Object,"plugins"),this.scales=new Ee(Xt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):I(n,a=>{const r=s||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,s){const n=Di(t);W(s["before"+n],[],s),e[t](s),W(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var ft=new uc;class fc{constructor(){this._init=void 0}notify(t,e,s,n){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=n?this._descriptors(t).filter(n):this._descriptors(t),a=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),a}_notify(t,e,s,n){n=n||{};for(const o of t){const a=o.plugin,r=a[s],l=[e,n,o.options];if(W(r,l,a)===!1&&n.cancelable)return!1}return!0}invalidate(){L(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=O(s.options&&s.options.plugins,{}),o=gc(s);return n===!1&&!e?[]:mc(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function gc(i){const t={},e=[],s=Object.keys(ft.plugins.items);for(let o=0;o<s.length;o++)e.push(ft.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const a=n[o];e.indexOf(a)===-1&&(e.push(a),t[a.id]=!0)}return{plugins:e,localIds:t}}function pc(i,t){return!t&&i===!1?null:i===!0?{}:i}function mc(i,{plugins:t,localIds:e},s,n){const o=[],a=i.getContext();for(const r of t){const l=r.id,c=pc(s[l],n);c!==null&&o.push({plugin:r,options:bc(i.config,{plugin:r,local:e[l]},c,a)})}return o}function bc(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),a=i.getOptionScopes(s,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function yi(i,t){const e=Z.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function xc(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function yc(i,t){return i===t?"_index_":"_value_"}function Es(i){if(i==="x"||i==="y"||i==="r")return i}function _c(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function _i(i,...t){if(Es(i))return i;for(const e of t){const s=e.axis||_c(e.position)||i.length>1&&Es(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function zs(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function vc(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return zs(i,"x",e[0])||zs(i,"y",e[0])}return{}}function Sc(i,t){const e=It[i.type]||{scales:{}},s=t.scales||{},n=yi(i.type,t),o=Object.create(null);return Object.keys(s).forEach(a=>{const r=s[a];if(!E(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const l=_i(a,r,vc(a,i),Z.scales[r.type]),c=yc(l,n),h=e.scales||{};o[a]=he(Object.create(null),[{axis:l},r,h[l],h[c]])}),i.data.datasets.forEach(a=>{const r=a.type||i.type,l=a.indexAxis||yi(r,t),h=(It[r]||{}).scales||{};Object.keys(h).forEach(d=>{const u=xc(d,l),f=a[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),he(o[f],[{axis:u},s[f],h[d]])})}),Object.keys(o).forEach(a=>{const r=o[a];he(r,[Z.scales[r.type],Z.scale])}),o}function Zn(i){const t=i.options||(i.options={});t.plugins=O(t.plugins,{}),t.scales=Sc(i,t)}function Yn(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Mc(i){return i=i||{},i.data=Yn(i.data),Zn(i),i}const Ls=new Map,qn=new Set;function ze(i,t){let e=Ls.get(i);return e||(e=t(),Ls.set(i,e),qn.add(e)),e}const se=(i,t,e)=>{const s=Lt(t,e);s!==void 0&&i.add(s)};class kc{constructor(t){this._config=Mc(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=Yn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Zn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ze(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ze(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ze(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return ze(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,a=this._cachedScopes(t,s),r=a.get(e);if(r)return r;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>se(l,t,d))),h.forEach(d=>se(l,n,d)),h.forEach(d=>se(l,It[o]||{},d)),h.forEach(d=>se(l,Z,d)),h.forEach(d=>se(l,bi,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),qn.has(e)&&a.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,It[e]||{},Z.datasets[e]||{},{type:e},Z,bi]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:a,subPrefixes:r}=Is(this._resolverCache,t,n);let l=a;if(Ac(a,e)){o.$shared=!1,s=At(s)?s():s;const c=this.createResolver(t,s,r);l=qt(a,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=Is(this._resolverCache,t,s);return E(e)?qt(o,e,void 0,n):o}}function Is(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:zi(t,e),subPrefixes:e.filter(r=>!r.toLowerCase().includes("hover"))},s.set(n,o)),o}const wc=i=>E(i)&&Object.getOwnPropertyNames(i).some(t=>At(i[t]));function Ac(i,t){const{isScriptable:e,isIndexable:s}=Pn(i);for(const n of t){const o=e(n),a=s(n),r=(a||o)&&i[n];if(o&&(At(r)||wc(r))||a&&Y(r))return!0}return!1}var Cc="4.5.1";const Dc=["top","bottom","left","right","chartArea"];function Hs(i,t){return i==="top"||i==="bottom"||Dc.indexOf(i)===-1&&t==="x"}function $s(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Ws(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),W(e&&e.onComplete,[i],t)}function Pc(i){const t=i.chart,e=t.options.animation;W(e&&e.onProgress,[i],t)}function Un(i){return Hi()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Be={},Bs=i=>{const t=Un(i);return Object.values(Be).filter(e=>e.canvas===t).pop()};function Rc(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const a=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=a)}}}function Tc(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}var _t;let ei=(_t=class{static register(...t){ft.add(...t),Vs()}static unregister(...t){ft.remove(...t),Vs()}constructor(t,e){const s=this.config=new kc(e),n=Un(t),o=Bs(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Xl(n)),this.platform.updateConfig(s);const r=this.platform.acquireContext(n,a.aspectRatio),l=r&&r.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Aa(),this.ctx=r,this.canvas=l,this.width=h,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new fc,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Za(d=>this.update(d),a.resizeDelay||0),this._dataChanges=[],Be[this.id]=this,!r||!l){console.error("Failed to create chart: can't acquire context from the given item");return}mt.listen(this,"complete",Ws),mt.listen(this,"progress",Pc),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return L(t)?e&&o?o:n?s/n: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 ft}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ds(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return ls(this.canvas,this.ctx),this}stop(){return mt.stop(this),this}resize(t,e){mt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,ds(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),W(s.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};I(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((a,r)=>(a[r]=!1,a),{});let o=[];e&&(o=o.concat(Object.keys(e).map(a=>{const r=e[a],l=_i(a,r),c=l==="r",h=l==="x";return{options:r,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),I(o,a=>{const r=a.options,l=r.id,c=_i(l,r),h=O(r.type,a.dtype);(r.position===void 0||Hs(r.position,c)!==Hs(a.dposition))&&(r.position=a.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const u=ft.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(r,t)}),I(n,(a,r)=>{a||delete s[r]}),I(s,a=>{ot.configure(this,a,a.options),ot.addBox(this,a)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort($s("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let a=this.getDatasetMeta(s);const r=o.type||this.config.type;if(a.type&&a.type!==r&&(this._destroyDatasetMeta(s),a=this.getDatasetMeta(s)),a.type=r,a.indexAxis=o.indexAxis||yi(r,this.options),a.order=o.order||0,a.index=s,a.label=""+o.label,a.visible=this.isDatasetVisible(s),a.controller)a.controller.updateIndex(s),a.controller.linkScales();else{const l=ft.getController(r),{datasetElementType:c,dataElementType:h}=Z.datasets[r];Object.assign(l,{dataElementType:ft.getElement(h),datasetElementType:c&&ft.getElement(c)}),a.controller=new l(this,s),t.push(a.controller)}}return this._updateMetasets(),t}_resetElements(){I(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),u=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(u),a=Math.max(+d.getMaxOverflow(),a)}a=this._minPadding=s.layout.autoPadding?a:0,this._updateLayout(a),n||I(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort($s("z","_idx"));const{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){I(this.scales,t=>{ot.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Qi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const a=s==="_removeElements"?-o:o;Rc(t,n,a)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!Qi(n,s(o)))return;return Array.from(n).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);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],I(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,At(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(mt.has(this)?this.attached&&!mt.running(this)&&mt.start(this):(this.draw(),Ws({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const a=e[n];(!t||a.visible)&&s.push(a)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s={meta:t,index:t.index,cancelable:!0},n=Gr(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(n&&ji(e,n),t.controller.draw(),n&&Fi(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return _e(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=Dl.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=Ht(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);be(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(o,{visible:s}),this.update(r=>r.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),mt.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),ls(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete Be[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,a)=>{e.addEventListener(this,o,a),t[o]=a},n=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};I(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let a;const r=()=>{n("attach",r),this.attached=!0,this.resize(),s("resize",o),s("detach",a)};a=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){I(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},I(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),r=0,l=t.length;r<l;++r){a=t[r];const c=a&&this.getDatasetMeta(a.datasetIndex).controller;c&&c[n+"HoverStyle"](a.element,a.datasetIndex,a.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:a})=>{const r=this.getDatasetMeta(o);if(!r)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:r.data[a],index:a}});!Ze(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),a=o(e,t),r=s?t:o(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,s,a),l=Oa(t),c=Tc(t,this._lastEvent,s,l);s&&(this._lastEvent=null,W(o.onHover,[t,r,this],this),l&&W(o.onClick,[t,r,this],this));const h=!Ze(r,n);
19return(h||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}},P(_t,"defaults",Z),P(_t,"instances",Be),P(_t,"overrides",It),P(_t,"registry",ft),P(_t,"version",Cc),P(_t,"getChart",Bs),_t);function Vs(){return I(ei.instances,i=>i._plugins.invalidate())}function Oc(i,t,e){const{startAngle:s,x:n,y:o,outerRadius:a,innerRadius:r,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/a,ct(s-e));if(i.beginPath(),i.arc(n,o,a-c/2,s+d/2,e-d/2),r>0){const u=Math.min(c/r,ct(s-e));i.arc(n,o,r+c/2,e-u/2,s+u/2,!0)}else{const u=Math.min(c/2,a*ct(s-e));if(h==="round")i.arc(n,o,u,e-H/2,s+H/2,!0);else if(h==="bevel"){const f=2*u*u,p=-f*Math.cos(e+H/2)+n,m=-f*Math.sin(e+H/2)+o,b=f*Math.cos(s+H/2)+n,x=f*Math.sin(s+H/2)+o;i.lineTo(p,m),i.lineTo(b,x)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function jc(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:l}=t;let c=n/r;i.beginPath(),i.arc(o,a,r,s-c,e+c),l>n?(c=n/l,i.arc(o,a,l,e+c,s-c,!0)):i.arc(o,a,n,e+U,s-U),i.closePath(),i.clip()}function Fc(i){return Ei(i,["outerStart","outerEnd","innerStart","innerEnd"])}function Ec(i,t,e,s){const n=Fc(i.options.borderRadius),o=(e-t)/2,a=Math.min(o,s*t/2),r=l=>{const c=(e-Math.min(o,l))*s/2;return Q(l,0,Math.min(o,c))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:Q(n.innerStart,0,a),innerEnd:Q(n.innerEnd,0,a)}}function Nt(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function Ge(i,t,e,s,n,o){const{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),u=h>0?h+s+e+c:0;let f=0;const p=n-l;if(s){const $=h>0?h-s:0,B=d>0?d-s:0,N=($+B)/2,lt=N!==0?p*N/(N+s):p;f=(p-lt)/2}const m=Math.max(.001,p*d-e/H)/d,b=(p-m)/2,x=l+b+f,v=n-b-f,{outerStart:k,outerEnd:w,innerStart:M,innerEnd:C}=Ec(t,u,d,v-x),D=d-k,A=d-w,R=x+k/D,j=v-w/A,T=u+M,F=u+C,X=x+M/T,st=v-C/F;if(i.beginPath(),o){const $=(R+j)/2;if(i.arc(a,r,d,R,$),i.arc(a,r,d,$,j),w>0){const K=Nt(A,j,a,r);i.arc(K.x,K.y,w,j,v+U)}const B=Nt(F,v,a,r);if(i.lineTo(B.x,B.y),C>0){const K=Nt(F,st,a,r);i.arc(K.x,K.y,C,v+U,st+Math.PI)}const N=(v-C/u+(x+M/u))/2;if(i.arc(a,r,u,v-C/u,N,!0),i.arc(a,r,u,N,x+M/u,!0),M>0){const K=Nt(T,X,a,r);i.arc(K.x,K.y,M,X+Math.PI,x-U)}const lt=Nt(D,x,a,r);if(i.lineTo(lt.x,lt.y),k>0){const K=Nt(D,R,a,r);i.arc(K.x,K.y,k,x-U,R)}}else{i.moveTo(a,r);const $=Math.cos(R)*d+a,B=Math.sin(R)*d+r;i.lineTo($,B);const N=Math.cos(j)*d+a,lt=Math.sin(j)*d+r;i.lineTo(N,lt)}i.closePath()}function zc(i,t,e,s,n){const{fullCircles:o,startAngle:a,circumference:r}=t;let l=t.endAngle;if(o){Ge(i,t,e,s,l,n);for(let c=0;c<o;++c)i.fill();isNaN(r)||(l=a+(r%V||V))}return Ge(i,t,e,s,l,n),i.fill(),l}function Lc(i,t,e,s,n){const{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:c,borderJoinStyle:h,borderDash:d,borderDashOffset:u,borderRadius:f}=l,p=l.borderAlign==="inner";if(!c)return;i.setLineDash(d||[]),i.lineDashOffset=u,p?(i.lineWidth=c*2,i.lineJoin=h||"round"):(i.lineWidth=c,i.lineJoin=h||"bevel");let m=t.endAngle;if(o){Ge(i,t,e,s,m,n);for(let b=0;b<o;++b)i.stroke();isNaN(r)||(m=a+(r%V||V))}p&&jc(i,t,m),l.selfJoin&&m-a>=H&&f===0&&h!=="miter"&&Oc(i,t,m),o||(Ge(i,t,e,s,m,n),i.stroke())}class re extends ht{constructor(e){super();P(this,"circumference");P(this,"endAngle");P(this,"fullCircles");P(this,"innerRadius");P(this,"outerRadius");P(this,"pixelMargin");P(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,s,n){const o=this.getProps(["x","y"],n),{angle:a,distance:r}=vn(o,{x:e,y:s}),{startAngle:l,endAngle:c,innerRadius:h,outerRadius:d,circumference:u}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),f=(this.options.spacing+this.options.borderWidth)/2,p=O(u,c-l),m=ye(a,l,c)&&l!==c,b=p>=V||m,x=St(r,h+f,d+f);return b&&x}getCenterPoint(e){const{x:s,y:n,startAngle:o,endAngle:a,innerRadius:r,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:c,spacing:h}=this.options,d=(o+a)/2,u=(r+l+h+c)/2;return{x:s+Math.cos(d)*u,y:n+Math.sin(d)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){const{options:s,circumference:n}=this,o=(s.offset||0)/4,a=(s.spacing||0)/2,r=s.circular;if(this.pixelMargin=s.borderAlign==="inner"?.33:0,this.fullCircles=n>V?Math.floor(n/V):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();const l=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(l)*o,Math.sin(l)*o);const c=1-Math.sin(Math.min(H,n||0)),h=o*c;e.fillStyle=s.backgroundColor,e.strokeStyle=s.borderColor,zc(e,this,h,a,r),Lc(e,this,h,a,r),e.restore(
vendor: 47,301 bytes, lines 19-21
19)}}P(re,"id","arc"),P(re,"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}),P(re,"defaultRoutes",{backgroundColor:"backgroundColor"}),P(re,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"});function Xn(i,t,e=t){i.lineCap=O(e.borderCapStyle,t.borderCapStyle),i.setLineDash(O(e.borderDash,t.borderDash)),i.lineDashOffset=O(e.borderDashOffset,t.borderDashOffset),i.lineJoin=O(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=O(e.borderWidth,t.borderWidth),i.strokeStyle=O(e.borderColor,t.borderColor)}function Ic(i,t,e){i.lineTo(e.x,e.y)}function Hc(i){return i.stepped?or:i.tension||i.cubicInterpolationMode==="monotone"?ar:Ic}function Kn(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:a,end:r}=t,l=Math.max(n,a),c=Math.min(o,r),h=n<a&&o<a||n>r&&o>r;return{count:s,start:l,loop:t.loop,ilen:c<l&&!h?s+c-l:c-l}}function $c(i,t,e,s){const{points:n,options:o}=t,{count:a,start:r,loop:l,ilen:c}=Kn(n,e,s),h=Hc(o);let{move:d=!0,reverse:u}=s||{},f,p,m;for(f=0;f<=c;++f)p=n[(r+(u?c-f:f))%a],!p.skip&&(d?(i.moveTo(p.x,p.y),d=!1):h(i,m,p,u,o.stepped),m=p);return l&&(p=n[(r+(u?c:0))%a],h(i,m,p,u,o.stepped)),!!l}function Wc(i,t,e,s){const n=t.points,{count:o,start:a,ilen:r}=Kn(n,e,s),{move:l=!0,reverse:c}=s||{};let h=0,d=0,u,f,p,m,b,x;const v=w=>(a+(c?r-w:w))%o,k=()=>{m!==b&&(i.lineTo(h,b),i.lineTo(h,m),i.lineTo(h,x))};for(l&&(f=n[v(0)],i.moveTo(f.x,f.y)),u=0;u<=r;++u){if(f=n[v(u)],f.skip)continue;const w=f.x,M=f.y,C=w|0;C===p?(M<m?m=M:M>b&&(b=M),h=(d*h+w)/++d):(k(),i.lineTo(w,M),p=C,d=0,m=b=M),x=M}k()}function vi(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Wc:$c}function Bc(i){return i.stepped?Ir:i.tension||i.cubicInterpolationMode==="monotone"?Hr:jt}function Vc(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Xn(i,t.options),i.stroke(n)}function Nc(i,t,e,s){const{segments:n,options:o}=t,a=vi(t);for(const r of n)Xn(i,o,r.style),i.beginPath(),a(i,t,r,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Zc=typeof Path2D=="function";function Yc(i,t,e,s){Zc&&!t.options.segment?Vc(i,t,e,s):Nc(i,t,e,s)}class le extends ht{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;Rr(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=qr(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,a=Nr(this,{property:e,start:n,end:n});if(!a.length)return;const r=[],l=Bc(s);let c,h;for(c=0,h=a.length;c<h;++c){const{start:d,end:u}=a[c],f=o[d],p=o[u];if(f===p){r.push(f);continue}const m=Math.abs((n-f[e])/(p[e]-f[e])),b=l(f,p,m,s.stepped);b[e]=t[e],r.push(b)}return r.length===1?r[0]:r}pathSegment(t,e,s){return vi(this)(t,this,e,s)}path(t,e,s){const n=this.segments,o=vi(this);let a=this._loop;e=e||0,s=s||this.points.length-e;for(const r of n)a&=o(t,this,r,{start:e,end:e+s-1});return!!a}draw(t,e,s,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Yc(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}P(le,"id","line"),P(le,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),P(le,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),P(le,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Ns(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}class Ve extends ht{constructor(e){super();P(this,"parsed");P(this,"skip");P(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,s,n){const o=this.options,{x:a,y:r}=this.getProps(["x","y"],n);return Math.pow(e-a,2)+Math.pow(s-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(e,s){return Ns(this,e,"x",s)}inYRange(e,s){return Ns(this,e,"y",s)}getCenterPoint(e){const{x:s,y:n}=this.getProps(["x","y"],e);return{x:s,y:n}}size(e){e=e||this.options||{};let s=e.radius||0;s=Math.max(s,s&&e.hoverRadius||0);const n=s&&e.borderWidth||0;return(s+n)*2}draw(e,s){const n=this.options;this.skip||n.radius<.1||!_e(this,s,this.size(n)/2)||(e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.fillStyle=n.backgroundColor,xi(e,n,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}P(Ve,"id","point"),P(Ve,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),P(Ve,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Gn(i,t){const{x:e,y:s,base:n,width:o,height:a}=i.getProps(["x","y","base","width","height"],t);let r,l,c,h,d;return i.horizontal?(d=a/2,r=Math.min(e,n),l=Math.max(e,n),c=s-d,h=s+d):(d=o/2,r=e-d,l=e+d,c=Math.min(s,n),h=Math.max(s,n)),{left:r,top:c,right:l,bottom:h}}function kt(i,t,e,s){return i?0:Q(t,e,s)}function qc(i,t,e){const s=i.options.borderWidth,n=i.borderSkipped,o=Dn(s);return{t:kt(n.top,o.top,0,e),r:kt(n.right,o.right,0,t),b:kt(n.bottom,o.bottom,0,e),l:kt(n.left,o.left,0,t)}}function Uc(i,t,e){const{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,o=Zt(n),a=Math.min(t,e),r=i.borderSkipped,l=s||E(n);return{topLeft:kt(!l||r.top||r.left,o.topLeft,0,a),topRight:kt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:kt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:kt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function Xc(i){const t=Gn(i),e=t.right-t.left,s=t.bottom-t.top,n=qc(i,e/2,s/2),o=Uc(i,e/2,s/2);return{outer:{x:t.left,y:t.top,w:e,h:s,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:e-n.l-n.r,h:s-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function fi(i,t,e,s){const n=t===null,o=e===null,r=i&&!(n&&o)&&Gn(i,s);return r&&(n||St(t,r.left,r.right))&&(o||St(e,r.top,r.bottom))}function Kc(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function Gc(i,t){i.rect(t.x,t.y,t.w,t.h)}function gi(i,t,e={}){const s=i.x!==e.x?-t:0,n=i.y!==e.y?-t:0,o=(i.x+i.w!==e.x+e.w?t:0)-s,a=(i.y+i.h!==e.y+e.h?t:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+a,radius:i.radius}}class Ne extends ht{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:e,options:{borderColor:s,backgroundColor:n}}=this,{inner:o,outer:a}=Xc(this),r=Kc(a.radius)?Ue:Gc;t.save(),(a.w!==o.w||a.h!==o.h)&&(t.beginPath(),r(t,gi(a,e,o)),t.clip(),r(t,gi(o,-e,a)),t.fillStyle=s,t.fill("evenodd")),t.beginPath(),r(t,gi(o,e)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,e,s){return fi(this,t,e,s)}inXRange(t,e){return fi(this,t,null,e)}inYRange(t,e){return fi(this,null,t,e)}getCenterPoint(t){const{x:e,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(e+n)/2:e,y:o?s:(s+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}P(Ne,"id","bar"),P(Ne,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),P(Ne,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const Zs=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},Qc=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Ys extends ht{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=W(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=J(s.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=Zs(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(a,o,r,l)+10):(h=this.maxHeight,c=this._fitCols(a,n,r,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+r;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((p,m)=>{const b=s+e/2+o.measureText(p.text).width;(m===0||c[c.length-1]+b+2*r>a)&&(d+=h,c[c.length-(m>0?0:1)]=0,f+=h,u++),l[m]={left:0,top:f,row:u,width:b,height:n},c[c.length-1]+=b+r}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-t;let d=r,u=0,f=0,p=0,m=0;return this.legendItems.forEach((b,x)=>{const{itemWidth:v,itemHeight:k}=Jc(s,e,o,b,n);x>0&&f+k+2*r>h&&(d+=u+r,c.push({width:u,height:f}),p+=u+r,m++,u=f=0),l[x]={left:p,top:f,col:m,width:v,height:k},u=Math.max(u,v),f+=k+r}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,a=Yt(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=G(s,this.left+n,this.right-this.lineWidths[r]);for(const c of e)r!==c.row&&(r=c.row,l=G(s,this.left+n,this.right-this.lineWidths[r])),c.top+=this.top+t+n,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+n}else{let r=0,l=G(s,this.top+t+n,this.bottom-this.columnSizes[r].height);for(const c of e)c.col!==r&&(r=c.col,l=G(s,this.top+t+n,this.bottom-this.columnSizes[r].height)),c.top=l,c.left+=this.left+n,c.left=a.leftForLtr(a.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ji(t,this),this._draw(),Fi(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:a}=t,r=Z.color,l=Yt(t.rtl,this.left,this.width),c=J(a.font),{padding:h}=a,d=c.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=Zs(a,d),x=function(C,D,A){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;n.save();const R=O(A.lineWidth,1);if(n.fillStyle=O(A.fillStyle,r),n.lineCap=O(A.lineCap,"butt"),n.lineDashOffset=O(A.lineDashOffset,0),n.lineJoin=O(A.lineJoin,"miter"),n.lineWidth=R,n.strokeStyle=O(A.strokeStyle,r),n.setLineDash(O(A.lineDash,[])),a.usePointStyle){const j={radius:m*Math.SQRT2/2,pointStyle:A.pointStyle,rotation:A.rotation,borderWidth:R},T=l.xPlus(C,p/2),F=D+u;Cn(n,j,T,F,a.pointStyleWidth&&p)}else{const j=D+Math.max((d-m)/2,0),T=l.leftForLtr(C,p),F=Zt(A.borderRadius);n.beginPath(),Object.values(F).some(X=>X!==0)?Ue(n,{x:T,y:j,w:p,h:m,radius:F}):n.rect(T,j,p,m),n.fill(),R!==0&&n.stroke()}n.restore()},v=function(C,D,A){ve(n,A.text,C,D+b/2,c,{strikethrough:A.hidden,textAlign:l.textAlign(A.textAlign)})},k=this.isHorizontal(),w=this._computeTitleHeight();k?f={x:G(o,this.left+h,this.right-s[0]),y:this.top+h+w,line:0}:f={x:this.left+h,y:G(o,this.top+w+h,this.bottom-e[0].height),line:0},Fn(this.ctx,t.textDirection);const M=b+h;this.legendItems.forEach((C,D)=>{n.strokeStyle=C.fontColor,n.fillStyle=C.fontColor;const A=n.measureText(C.text).width,R=l.textAlign(C.textAlign||(C.textAlign=a.textAlign)),j=p+u+A;let T=f.x,F=f.y;l.setWidth(this.width),k?D>0&&T+j+h>this.right&&(F=f.y+=M,f.line++,T=f.x=G(o,this.left+h,this.right-s[f.line])):D>0&&F+M>this.bottom&&(T=f.x=T+e[f.line].width+h,f.line++,F=f.y=G(o,this.top+w+h,this.bottom-e[f.line].height));const X=l.x(T);if(x(X,F,C),T=Ya(R,T+p+u,k?T+j:this.right,t.rtl),v(l.x(T),F,C),k)f.x+=j+h;else if(typeof C.text!="string"){const st=c.lineHeight;f.y+=Qn(C,st)+h}else f.y+=M}),En(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=J(e.font),n=rt(e.padding);if(!e.display)return;const o=Yt(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=G(t.align,d,this.right-u);else{const p=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);h=c+G(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const f=G(r,d,d+u);a.textAlign=o.textAlign(Ri(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,ve(a,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=J(t.font),s=rt(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(St(t,this.left,this.right)&&St(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],St(t,n.left,n.left+n.width)&&St(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!ih(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=Qc(n,s);n&&!o&&W(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&W(e.onHover,[t,s,this],this)}else s&&W(e.onClick,[t,s,this],this)}}function Jc(i,t,e,s,n){const o=th(s,i,t,e),a=eh(n,s,t.lineHeight);return{itemWidth:o,itemHeight:a}}function th(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,a)=>o.length>a.length?o:a)),t+e.size/2+s.measureText(n).width}function eh(i,t,e){let s=i;return typeof t.text!="string"&&(s=Qn(t,e)),s}function Qn(i,t){const e=i.text?i.text.length:0;return t*e}function ih(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var sh={id:"legend",_element:Ys,start(i,t,e){const s=i.legend=new Ys({ctx:i.ctx,options:e,chart:i});ot.configure(i,s,e),ot.addBox(i,s)},stop(i){ot.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;ot.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=rt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:a&&(r||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Jn extends ht{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=Y(s.text)?s.text.length:1;this._padding=rt(s.padding);const o=n*J(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:a}=this,r=a.align;let l=0,c,h,d;return this.isHorizontal()?(h=G(r,s,o),d=e+t,c=o-s):(a.position==="left"?(h=s+t,d=G(r,n,e),l=H*-.5):(h=o-t,d=G(r,e,n),l=H*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=J(e.font),o=s.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);ve(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:Ri(e.align),textBaseline:"middle",translation:[a,r]})}}function nh(i,t){const e=new Jn({ctx:i.ctx,options:t,chart:i});ot.configure(i,e,t),ot.addBox(i,e),i.titleBlock=e}var oh={id:"title",_element:Jn,start(i,t,e){nh(i,e)},stop(i){const t=i.titleBlock;ot.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;ot.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const ce={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;t<e;++t){const r=i[t].element;if(r&&r.hasValue()){const l=r.tooltipPosition();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((r,l)=>r+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=i.length;o<a;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=mi(t,c);h<n&&(n=h,r=l)}}if(r){const l=r.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function ut(i,t){return t&&(Y(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function bt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
20`)>-1?i.split(`
21`):i}function ah(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:i,label:a,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function qs(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=J(t.bodyFont),c=J(t.titleFont),h=J(t.footerFont),d=o.length,u=n.length,f=s.length,p=rt(t.padding);let m=p.height,b=0,x=s.reduce((w,M)=>w+M.before.length+M.lines.length+M.after.length,0);if(x+=i.beforeBody.length+i.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),x){const w=t.displayColors?Math.max(r,l.lineHeight):l.lineHeight;m+=f*w+(x-f)*l.lineHeight+(x-1)*t.bodySpacing}u&&(m+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let v=0;const k=function(w){b=Math.max(b,e.measureText(w).width+v)};return e.save(),e.font=c.string,I(i.title,k),e.font=l.string,I(i.beforeBody.concat(i.afterBody),k),v=t.displayColors?a+2+t.boxPadding:0,I(s,w=>{I(w.before,k),I(w.lines,k),I(w.after,k)}),v=0,e.font=h.string,I(i.footer,k),e.restore(),b+=p.width,{width:b,height:m}}function rh(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function lh(i,t,e,s){const{x:n,width:o}=s,a=e.caretSize+e.caretPadding;if(i==="left"&&n+o+a>t.width||i==="right"&&n-o-a<0)return!0}function ch(i,t,e,s){const{x:n,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i;let c="center";return s==="center"?c=n<=(r+l)/2?"left":"right":n<=o/2?c="left":n>=a-o/2&&(c="right"),lh(c,i,t,e)&&(c="center"),c}function Us(i,t,e){const s=e.yAlign||t.yAlign||rh(i,e);return{xAlign:e.xAlign||t.xAlign||ch(i,t,e,s),yAlign:s}}function hh(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function dh(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Xs(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Zt(a);let p=hh(t,r);const m=dh(t,l,c);return l==="center"?r==="left"?p+=c:r==="right"&&(p-=c):r==="left"?p-=Math.max(h,u)+n:r==="right"&&(p+=Math.max(d,f)+n),{x:Q(p,0,s.width-t.width),y:Q(m,0,s.height-t.height)}}function Le(i,t,e){const s=rt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Ks(i){return ut([],bt(i))}function uh(i,t,e){return Ht(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Gs(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const to={beforeTitle:pt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:pt,beforeBody:pt,beforeLabel:pt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return L(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:pt,afterBody:pt,beforeFooter:pt,footer:pt,afterFooter:pt};function tt(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?to[t].call(e,s):n}class Si extends ht{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new Ln(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=uh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=tt(s,"beforeTitle",this,t),o=tt(s,"title",this,t),a=tt(s,"afterTitle",this,t);let r=[];return r=ut(r,bt(n)),r=ut(r,bt(o)),r=ut(r,bt(a)),r}getBeforeBody(t,e){return Ks(tt(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return I(t,o=>{const a={before:[],lines:[],after:[]},r=Gs(s,o);ut(a.before,bt(tt(r,"beforeLabel",this,o))),ut(a.lines,tt(r,"label",this,o)),ut(a.after,bt(tt(r,"afterLabel",this,o))),n.push(a)}),n}getAfterBody(t,e){return Ks(tt(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=tt(s,"beforeFooter",this,t),o=tt(s,"footer",this,t),a=tt(s,"afterFooter",this,t);let r=[];return r=ut(r,bt(n)),r=ut(r,bt(o)),r=ut(r,bt(a)),r}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],a=[];let r=[],l,c;for(l=0,c=e.length;l<c;++l)r.push(ah(this.chart,e[l]));return t.filter&&(r=r.filter((h,d,u)=>t.filter(h,d,u,s))),t.itemSort&&(r=r.sort((h,d)=>t.itemSort(h,d,s))),I(r,h=>{const d=Gs(t.callbacks,h);n.push(tt(d,"labelColor",this,h)),o.push(tt(d,"labelPointStyle",this,h)),a.push(tt(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=r,r}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,a=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const r=ce[s.position].call(this,n,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);const l=this._size=qs(this,s),c=Object.assign({},r,l),h=Us(this.chart,s,c),d=Xs(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Zt(r),{x:u,y:f}=t,{width:p,height:m}=e;let b,x,v,k,w,M;return o==="center"?(w=f+m/2,n==="left"?(b=u,x=b-a,k=w+a,M=w-a):(b=u+p,x=b+a,k=w-a,M=w+a),v=b):(n==="left"?x=u+Math.max(l,h)+a:n==="right"?x=u+p-Math.max(c,d)-a:x=this.caretX,o==="top"?(k=f,w=k-a,b=x-a,v=x+a):(k=f+m,w=k+a,b=x+a,v=x-a),M=k),{x1:b,x2:x,x3:v,y1:k,y2:w,y3:M}}drawTitle(t,e,s){const n=this.title,o=n.length;let a,r,l;if(o){const c=Yt(s.rtl,this.x,this.width);for(t.x=Le(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",a=J(s.titleFont),r=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+r,l+1===o&&(t.y+=s.titleMarginBottom-r)}}_drawColorBox(t,e,s,n,o){const a=this.labelColors[s],r=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=J(o.bodyFont),d=Le(this,"left",o),u=n.x(d),f=l<h.lineHeight?(h.lineHeight-l)/2:0,p=e.y+f;if(o.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},b=n.leftForLtr(u,c)+c/2,x=p+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,xi(t,m,b,x),t.strokeStyle=a.borderColor,t.fillStyle=a.backgroundColor,xi(t,m,b,x)}else{t.lineWidth=E(a.borderWidth)?Math.max(...Object.values(a.borderWidth)):a.borderWidth||1,t.strokeStyle=a.borderColor,t.setLineDash(a.borderDash||[]),t.lineDashOffset=a.borderDashOffset||0;const m=n.leftForLtr(u,c),b=n.leftForLtr(n.xPlus(u,1),c-2),x=Zt(a.borderRadius);Object.values(x).some(v=>v!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Ue(t,{x:m,y:p,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),Ue(t,{x:b,y:p+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=a.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=J(s.bodyFont);let u=d.lineHeight,f=0;const p=Yt(s.rtl,this.x,this.width),m=function(A){e.fillText(A,p.x(t.x+f),t.y+u/2),t.y+=u+o},b=p.textAlign(a);let x,v,k,w,M,C,D;for(e.textAlign=a,e.textBaseline="middle",e.font=d.string,t.x=Le(this,b,s),e.fillStyle=s.bodyColor,I(this.beforeBody,m),f=r&&b!=="right"?a==="center"?c/2+h:c+2+h:0,w=0,C=n.length;w<C;++w){for(x=n[w],v=this.labelTextColors[w],e.fillStyle=v,I(x.before,m),k=x.lines,r&&k.length&&(this._drawColorBox(e,t,w,p,s),u=Math.max(d.lineHeight,l)),M=0,D=k.length;M<D;++M)m(k[M]),u=d.lineHeight;I(x.after,m)}f=0,u=d.lineHeight,I(this.afterBody,m),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let a,r;if(o){const l=Yt(s.rtl,this.x,this.width);for(t.x=Le(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",a=J(s.footerFont),e.fillStyle=s.footerColor,e.font=a.string,r=0;r<o;++r)e.fillText(n[r],l.x(t.x),t.y+a.lineHeight/2),t.y+=a.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:a}=this,{x:r,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:p}=Zt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(r+d,l),a==="top"&&this.drawCaret(t,e,s,n),e.lineTo(r+c-u,l),e.quadraticCurveTo(r+c,l,r+c,l+u),a==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(r+c,l+h-p),e.quadraticCurveTo(r+c,l+h,r+c-p,l+h),a==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(r+f,l+h),e.quadraticCurveTo(r,l+h,r,l+h-f),a==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(r,l+d),e.quadraticCurveTo(r,l,r+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const a=ce[t.position].call(this,this._active,this._eventPosition);if(!a)return;const r=this._size=qs(this,t),l=Object.assign({},a,this._size),c=Us(e,t,l),h=Xs(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const a=rt(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),Fn(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),En(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:r,index:l})=>{const c=this.chart.getDatasetMeta(r);if(!c)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:c.data[l],index:l}}),o=!Ze(s,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,s),r=this._positionChanged(a,t),l=e||!Ze(a,o)||r;return l&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const a=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&a.reverse(),a}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,a=ce[o.position].call(this,t,e);return a!==!1&&(s!==a.x||n!==a.y)}}P(Si,"positioners",ce);var fh={id:"tooltip",_element:Si,positioners:ce,afterInit(i,t,e){e&&(i.tooltip=new Si({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:to},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const gh=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function ph(i,t,e,s){const n=i.indexOf(t);if(n===-1)return gh(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const mh=(i,t)=>i===null?null:Q(Math.round(i),0,t);function Qs(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class Mi extends Xt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(L(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:ph(s,t,O(e,t),this._addedLabels),mh(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let a=t;a<=e;a++)n.push({value:a});return n}getLabelForValue(t){return Qs.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}P(Mi,"id","category"),P(Mi,"defaults",{ticks:{callback:Qs}});function bh(i,t){const e=[],{bounds:n,step:o,min:a,max:r,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,p=h-1,{min:m,max:b}=t,x=!L(a),v=!L(r),k=!L(c),w=(b-m)/(d+1);let M=ts((b-m)/p/f)*f,C,D,A,R;if(M<1e-14&&!x&&!v)return[{value:m},{value:b}];R=Math.ceil(b/M)-Math.floor(m/M),R>p&&(M=ts(R*M/p/f)*f),L(l)||(C=Math.pow(10,l),M=Math.ceil(M*C)/C),n==="ticks"?(D=Math.floor(m/M)*M,A=Math.ceil(b/M)*M):(D=m,A=b),x&&v&&o&&La((r-a)/o,M/1e3)?(R=Math.round(Math.min((r-a)/M,h)),M=(r-a)/R,D=a,A=r):k?(D=x?a:D,A=v?r:A,R=c-1,M=(A-D)/R):(R=(A-D)/M,de(R,Math.round(R),M/1e3)?R=Math.round(R):R=Math.ceil(R));const j=Math.max(es(M),es(D));C=Math.pow(10,L(l)?j:l),D=Math.round(D*C)/C,A=Math.round(A*C)/C;let T=0;for(x&&(u&&D!==a?(e.push({value:a}),D<a&&T++,de(Math.round((D+T*M)*C)/C,a,Js(a,w,i))&&T++):D<a&&T++);T<R;++T){const F=Math.round((D+T*M)*C)/C;if(v&&F>r)break;e.push({value:F})}return v&&u&&A!==r?e.length&&de(e[e.length-1].value,r,Js(r,w,i))?e[e.length-1].value=r:e.push({value:r}):(!v||A===r)&&e.push({value:A}),e}function Js(i,t,{horizontal:e,minRotation:s}){const n=yt(s),o=(e?Math.sin(n):Math.cos(n))||.001,a=.75*t*(""+i).length;return Math.min(t/o,a)}class xh extends Xt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return L(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const a=l=>n=e?n:l,r=l=>o=s?o:l;if(t){const l=gt(n),c=gt(o);l<0&&c<0?r(0):l>0&&c>0&&a(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);r(o+l),t||a(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,a=bh(n,o);return t.bounds==="ticks"&&Ia(a,this,"value"),t.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return Oi(t,this.chart.options.locale,this.options.ticks.format)}}class ki extends xh{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=at(t)?t:0,this.max=at(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=yt(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}P(ki,"id","linear"),P(ki,"defaults",{ticks:{callback:An.formatters.numeric}});const ii={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}},it=Object.keys(ii);function tn(i,t){return i-t}function en(i,t){if(L(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let a=t;return typeof s=="function"&&(a=s(a)),at(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(n&&(a=n==="week"&&(xe(o)||o===!0)?e.startOf(a,"isoWeek",o):e.startOf(a,n)),+a)}function sn(i,t,e,s){const n=it.length;for(let o=it.indexOf(i);o<n-1;++o){const a=ii[it[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((e-t)/(r*a.size))<=s)return it[o]}return it[n-1]}function yh(i,t,e,s,n){for(let o=it.length-1;o>=it.indexOf(e);o--){const a=it[o];if(ii[a].common&&i._adapter.diff(n,s,a)>=t-1)return a}return it[e?it.indexOf(e):0]}function _h(i){for(let t=it.indexOf(i)+1,e=it.length;t<e;++t)if(ii[it[t]].common)return it[t]}function nn(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=Pi(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function vh(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),a=t[t.length-1].value;let r,l;for(r=o;r<=a;r=+n.add(r,1,s))l=e[r],l>=0&&(t[l].major=!0);return t}function on(i,t,e){const s=[],n={},o=t.length;let a,r;for(a=0;a<o;++a)r=t[a],n[r]=a,s.push({value:r,major:!1});return o===0||!e?s:vh(i,s,n,e)}class Qe extends Xt{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){const s=t.time||(t.time={}),n=this._adapter=new Ml._date(t.adapters.date);n.init(e),he(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:en(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(c){!a&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!r&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!a||!r)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=at(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=at(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,a=this.max,r=Va(n,o,a);return this._unit=e.unit||(s.autoSkip?sn(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):yh(this,r.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:_h(this._unit),this.initOffsets(n),t.reverse&&r.reverse(),on(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const a=t.length<3?.5:.25;e=Q(e,0,a),s=Q(s,0,a),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,a=o.unit||sn(o.minUnit,e,s,this._getLabelCapacity(e)),r=O(n.ticks.stepSize,1),l=a==="week"?o.isoWeekday:!1,c=xe(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":a),t.diff(s,e,a)>1e5*r)throw new Error(e+" and "+s+" are too far apart with stepSize of "+r+" "+a);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u<s;u=+t.add(u,r,a),f++)nn(h,u,p);return(u===s||n.bounds==="ticks"||f===1)&&nn(h,u,p),Object.keys(h).sort(tn).map(m=>+m)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,a=e||n[o];return this._adapter.format(t,a)}_tickFormatFunction(t,e,s,n){const o=this.options,a=o.ticks.callback;if(a)return W(a,[t,e,s],this);const r=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&r[l],d=c&&r[c],u=s[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=yt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),a=Math.sin(n),r=this._resolveTickFontOptions(0).size;return{w:s*o+r*a,h:s*a+r*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,on(this,[t],this._majorUnit),n),a=this._getLabelSize(o),r=Math.floor(this.isHorizontal()?this.width/a.w:this.height/a.h)-1;return r>0?r:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(en(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Mn(t.sort(tn))}}P(Qe,"id","time"),P(Qe,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ie(i,t,e){let s=0,n=i.length-1,o,a,r,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=Ft(i,"pos",t)),{pos:o,time:r}=i[s],{pos:a,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=Ft(i,"time",t)),{time:o,pos:r}=i[s],{time:a,pos:l}=i[n]);const c=a-o;return c?r+(l-r)*(t-o)/c:r}class an extends Qe{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ie(e,this.min),this._tableRange=Ie(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let a,r,l,c,h;for(a=0,r=t.length;a<r;++a)c=t[a],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(a=0,r=n.length;a<r;++a)h=n[a+1],l=n[a-1],c=n[a],Math.round((h+l)/2)!==c&&o.push({time:c,pos:a/(r-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Ie(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Ie(this._table,s*this._tableRange+this._minPos,!0)}}P(an,"id","timeseries"),P(an,"defaults",Qe.defaults);const eo="label";function rn(i,t){typeof i=="function"?i(t):i&&(i.current=t)}function Sh(i,t){const e=i.options;
21e&&t&&Object.assign(e,t)}function io(i,t){i.labels=t}function so(i,t,e=eo){const s=[];i.datasets=t.map(n=>{const o=i.datasets.find(a=>a[e]===n[e]);return!o||!n.data||s.includes(o)?{...n}:(s.push(o),Object.assign(o,n),o)})}function Mh(i,t=eo){const e={labels:[],datasets:[]};return io(e,i.labels),so(e,i.datasets,t),e}function kh(i,t){const{height:e=150,width:s=300,redraw:n=!1,datasetIdKey:o,type:a,data:r,options:l,plugins:c=[],fallbackContent:h,updateMode:d,...u}=i,f=y.useRef(null),p=y.useRef(null),m=()=>{f.current&&(p.current=new ei(f.current,{type:a,data:Mh(r,o),options:l&&{...l},plugins:c}),rn(t,p.current))},b=()=>{rn(t,null),p.current&&(p.current.destroy(),p.current=null)};return y.useEffect(()=>{!n&&p.current&&l&&Sh(p.current,l)},[n,l]),y.useEffect(()=>{!n&&p.current&&io(p.current.config.data,r.labels)},[n,r.labels]),y.useEffect(()=>{!n&&p.current&&r.datasets&&so(p.current.config.data,r.datasets,o)},[n,r.datasets]),y.useEffect(()=>{p.current&&(n?(b(),setTimeout(m)):p.current.update(d))},[n,l,r.labels,r.datasets,d]),y.useEffect(()=>{p.current&&(b(),setTimeout(m))},[a]),y.useEffect(()=>(m(),()=>b()),[]),g.jsx("canvas",{ref:f,role:"img",height:e,width:s,...u,children:h})}const wh=y.forwardRef(kh);function Bi(i,t){return ei.register(t),y.forwardRef((e,s)=>g.jsx(wh,{...e,ref:s,type:i}))}const Ah=Bi("line",$e),Ch=Bi("bar",He),Dh=Bi("doughnut",oe);ei.register(Mi,ki,Ne,le,Ve,re,oh,fh,sh);const Ph=({kpi:i})=>{const t=i.trend==="up"?"#10B981":i.trend==="down"?"#DC2626":`hsl(${_.text.tertiary})`,e=i.trend==="up"?Oo:i.trend==="down"?To:jo;return g.jsxs("div",{style:{padding:S[5],background:`hsl(${_.bg.primary})`,borderRadius:z.lg,border:q.default},children:[g.jsx("div",{style:{fontSize:12,color:`hsl(${_.text.tertiary})`,fontWeight:500,marginBottom:S[2]},children:i.label}),g.jsx("div",{style:{fontSize:22,fontWeight:600,color:`hsl(${_.text.primary})`,lineHeight:1.2,marginBottom:S[2]},children:i.value}),i.delta&&g.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:13,color:t,fontWeight:500},children:[g.jsx(e,{size:12}),i.delta]}),i.comparison&&g.jsx("div",{style:{fontSize:11,color:`hsl(${_.text.tertiary})`,marginTop:4},children:i.comparison})]})},Rh=({chart:i})=>{const t={responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:i.chartType==="doughnut",position:"bottom",labels:{font:{family:"inherit",size:11},color:"#666",padding:12}}},scales:i.chartType==="doughnut"?void 0:{x:{grid:{display:!1},ticks:{font:{family:"inherit",size:10},color:"#999"}},y:{grid:{color:"rgba(0,0,0,0.04)"},ticks:{font:{family:"inherit",size:10},color:"#999"}}}};return g.jsxs("div",{style:{padding:S[5],background:`hsl(${_.bg.primary})`,borderRadius:z.lg,border:q.default},children:[g.jsx("h4",{style:{fontSize:14,fontWeight:600,color:`hsl(${_.text.primary})`,marginBottom:S[3],marginTop:0},children:i.title}),g.jsxs("div",{style:{height:240,position:"relative"},children:[i.chartType==="bar"&&g.jsx(Ch,{data:i.data,options:t}),i.chartType==="line"&&g.jsx(Ah,{data:i.data,options:t}),i.chartType==="doughnut"&&g.jsx(Dh,{data:i.data,options:t})]})]})},Th=({content:i})=>{const[t,e]=y.useState("30d");return g.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:S[5]},children:[i.narrative&&g.jsx("p",{style:{fontSize:16,lineHeight:1.5,color:`hsl(${_.text.primary})`,fontWeight:500,margin:0},children:i.narrative}),i.spotlight&&g.jsxs("div",{style:{padding:S[6],background:`hsl(${_.bg.primary})`,borderRadius:z.lg,border:q.default,textAlign:"center"},children:[g.jsx("div",{style:{fontSize:13,color:`hsl(${_.text.tertiary})`,fontWeight:500,marginBottom:S[2]},children:i.spotlight.label}),g.jsx("div",{style:{fontSize:44,fontWeight:600,color:`hsl(${_.text.primary})`,lineHeight:1,marginBottom:S[2]},children:i.spotlight.value}),i.spotlight.delta&&g.jsx("div",{style:{fontSize:14,color:`hsl(${_.text.secondary})`,fontWeight:500},children:i.spotlight.delta}),i.spotlight.context&&g.jsx("div",{style:{fontSize:12,color:`hsl(${_.text.tertiary})`,marginTop:S[2]},children:i.spotlight.context})]}),g.jsx("div",{style:{display:"flex",gap:S[2],alignItems:"center",justifyContent:"flex-end"},children:["7d","30d","90d"].map(s=>g.jsx("button",{onClick:()=>e(s),style:{padding:`${S[2]} ${S[3]}`,background:t===s?"#1A1A1A":"transparent",color:t===s?"#FFFFFF":`hsl(${_.text.secondary})`,border:t===s?"none":q.default,borderRadius:z.pill,cursor:"pointer",fontFamily:"inherit",fontSize:13,fontWeight:500},children:s},s))}),g.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(180px, 1fr))",gap:S[3]},children:i.kpis.map((s,n)=>g.jsx(Ph,{kpi:s},n))}),i.charts.length>0&&g.jsx("div",{style:{display:"grid",gridTemplateColumns:i.charts.length>1?"1fr 1fr":"1fr",gap:S[3]},children:i.charts.map((s,n)=>g.jsx(Rh,{chart:s},n))}),i.closingPrompt&&g.jsx("p",{style:{fontSize:13,lineHeight:1.5,color:`hsl(${_.text.secondary})`,fontStyle:"italic",margin:0},children:i.closingPrompt})]})},Oh=({artifact:i})=>g.jsxs("div",{style:{maxWidth:880,margin:"0 auto"},children:[g.jsx("h1",{style:{fontSize:26,fontWeight:600,color:"#1A1A1A",marginBottom:24,letterSpacing:"-0.02em"},children:i.title}),i.content.type==="report"&&g.jsx(Jo,{content:i.content}),i.content.type==="list"&&g.jsx(ta,{content:i.content}),i.content.type==="calendar"&&g.jsx(ea,{content:i.content}),i.content.type==="briefing"&&g.jsx(ia,{content:i.content}),i.content.type==="action"&&g.jsx(sa,{content:i.content}),i.content.type==="dashboard"&&g.jsx(Th,{content:i.content})]}),et=i=>`hsl(${i})`;function dd(){const{insightId:i}=ao(),t=ro(),e=i?po(i):void 0,[s,n]=y.useState(null),[o,a]=y.useState(!0),[r,l]=y.useState(!1),c=y.useRef(null),{messages:h,sending:d,sendMessage:u,initializeFromInsight:f,generateArtifact:p}=Zo();if(y.useEffect(()=>{e&&h.length===0&&(f(e),n(p(e.expectedArtifactType??"report",e)))},[e==null?void 0:e.id]),y.useEffect(()=>{var x;(x=c.current)==null||x.scrollIntoView({behavior:"smooth"})},[h]),!e)return g.jsxs("div",{style:{padding:80,textAlign:"center",fontFamily:"inherit"},children:[g.jsx("p",{style:{marginBottom:16,color:`hsl(${_.text.secondary})`,fontSize:14},children:"Insight não encontrado."}),g.jsx("button",{className:"snew-main-action",onClick:()=>t("/"),style:{padding:"10px 18px",borderRadius:z.pill,border:"none",cursor:"pointer",fontSize:13,fontFamily:"inherit"},children:"Voltar pra home"})]});const m=x=>{!x.trim()||d||u(x)},b=()=>{const x=p(e.expectedArtifactType??"report",e);n(x)};return g.jsxs("div",{style:{display:"flex",width:"100vw",height:"100vh",overflow:"hidden"},children:[g.jsx(Co,{collapsed:o,onToggleCollapse:()=>a(x=>!x)}),g.jsxs("div",{style:{flex:1,minWidth:0,display:"grid",gridTemplateColumns:r?"1fr":"40fr 60fr",background:et(_.bg.tertiary),transition:"grid-template-columns 0.25s ease",overflow:"hidden"},children:[!r&&g.jsx("div",{style:{height:"100%",padding:"12px 0 12px 12px",boxSizing:"border-box",display:"flex",flexDirection:"column",minHeight:0},children:g.jsxs("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",overflow:"hidden",minWidth:0},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",flexShrink:0,background:et(_.bg.primary)},children:[g.jsxs("button",{onClick:()=>t("/"),style:{display:"flex",alignItems:"center",gap:6,background:"transparent",border:"none",cursor:"pointer",padding:"2px 4px",borderRadius:6,fontFamily:"inherit",transition:"background 0.1s"},onMouseEnter:x=>x.currentTarget.style.background=et(_.bg.secondary),onMouseLeave:x=>x.currentTarget.style.background="transparent",children:[g.jsx(uo,{size:12,style:{color:et(_.text.tertiary),flexShrink:0}}),g.jsx("span",{style:{fontSize:13,fontWeight:400,color:et(_.text.primary),letterSpacing:0,maxWidth:220,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.agentName.toLowerCase()}),g.jsx(fo,{size:12,style:{color:et(_.text.tertiary),flexShrink:0}})]}),g.jsx("button",{onClick:()=>l(!0),title:"Minimizar chat",style:{width:28,height:28,borderRadius:7,border:"none",background:"transparent",color:et(_.text.tertiary),cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",transition:"color 0.1s",flexShrink:0},onMouseEnter:x=>x.currentTarget.style.color=et(_.text.primary),onMouseLeave:x=>x.currentTarget.style.color=et(_.text.tertiary),children:g.jsx(go,{size:15})})]}),g.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,minHeight:0,overflow:"hidden",background:et(_.bg.primary),position:"relative"},children:[g.jsx("div",{style:{height:12,flexShrink:0,background:`linear-gradient(to bottom, ${et(_.bg.primary)}, hsl(${_.bg.primary} / 0))`,pointerEvents:"none"}}),g.jsxs("div",{style:{flex:1,minHeight:0,overflowY:"auto",overflowX:"hidden",padding:"8px 16px 20px",display:"flex",flexDirection:"column",gap:10},children:[h.map(x=>g.jsx(Ko,{message:x,agentName:e.agentName,onArtifactClick:b},x.id)),d&&g.jsxs("div",{style:{fontSize:13,color:`hsl(${_.text.tertiary})`,paddingLeft:36},children:[e.agentName," está pensando…"]}),g.jsx("div",{ref:c})]})]}),g.jsx("div",{style:{padding:"12px 14px 14px",background:"transparent",flexShrink:0,boxSizing:"border-box"},children:g.jsx(Fo,{onSend:m,placeholder:"Peça um relatório, brief, calendário...",disabled:d})})]})}),g.jsx("div",{style:{position:"relative",minWidth:0,padding:12,boxSizing:"border-box",overflow:"hidden",display:"flex"},children:g.jsxs("div",{style:{flex:1,minWidth:0,background:`hsl(${_.bg.primary})`,borderRadius:16,border:q.default,overflow:"auto",padding:`${S[7]} ${S[7]}`,position:"relative"},children:[r&&g.jsx("button",{onClick:()=>l(!1),title:"Expandir chat",style:{position:"absolute",top:16,left:16,width:28,height:28,borderRadius:7,border:q.default,background:`hsl(${_.bg.primary})`,color:`hsl(${_.text.secondary}
21)`,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",zIndex:5},children:g.jsx(Wo,{size:15})}),s?g.jsxs(g.Fragment,{children:[g.jsx(Oh,{artifact:s}),g.jsxs("div",{style:{marginTop:S[6],paddingTop:S[5],borderTop:q.default,display:"flex",alignItems:"center",justifyContent:"space-between",gap:S[4],flexWrap:"wrap"},children:[g.jsxs("div",{style:{flex:1,minWidth:220},children:[g.jsx("div",{style:{fontSize:13,fontWeight:500,color:et(_.text.primary)},children:"Pronto para produzir?"}),g.jsx("div",{style:{fontSize:12,color:et(_.text.secondary),marginTop:2,lineHeight:1.5},children:"Veja quantas peças, em que formato e para qual canal — antes de gerar."})]}),g.jsx("button",{onClick:()=>t(`/insight/${e.id}/plan`),style:{height:36,padding:"0 16px",borderRadius:z.md,border:"1px solid transparent",background:et(_.text.primary),color:"#fff",fontSize:13,fontWeight:500,cursor:"pointer",whiteSpace:"nowrap"},children:"Ver plano de produção"})]})]}):g.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:`hsl(${_.text.tertiary})`,fontSize:13},children:"Aguardando o agente gerar o documento…"})]})})]})]})}export{dd as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.