homebridge-config-ui-x 5.4.2-beta.2 → 5.4.2-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/CHANGELOG.md +25 -5
  2. package/dist/core/auth/auth.controller.d.ts +1 -0
  3. package/dist/core/config/config.service.d.ts +3 -1
  4. package/dist/core/config/config.service.js +3 -2
  5. package/dist/core/config/config.service.js.map +1 -1
  6. package/dist/core/config/config.startup.d.ts +1 -0
  7. package/dist/core/config/config.startup.js +13 -3
  8. package/dist/core/config/config.startup.js.map +1 -1
  9. package/dist/core/spa/spa-html.service.d.ts +5 -0
  10. package/dist/core/spa/spa-html.service.js +39 -0
  11. package/dist/core/spa/spa-html.service.js.map +1 -0
  12. package/dist/core/spa/spa.filter.d.ts +2 -0
  13. package/dist/core/spa/spa.filter.js +17 -2
  14. package/dist/core/spa/spa.filter.js.map +1 -1
  15. package/dist/main.js +8 -3
  16. package/dist/main.js.map +1 -1
  17. package/dist/modules/accessories/accessories.service.js +5 -1
  18. package/dist/modules/accessories/accessories.service.js.map +1 -1
  19. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js +1 -1
  20. package/dist/modules/custom-plugins/plugins-settings-ui/plugins-settings-ui.service.js.map +1 -1
  21. package/dist/modules/plugins/plugins.service.d.ts +1 -0
  22. package/dist/modules/plugins/plugins.service.js +27 -15
  23. package/dist/modules/plugins/plugins.service.js.map +1 -1
  24. package/package.json +18 -13
  25. package/public/3rdpartylicenses.txt +91 -91
  26. package/public/assets/monaco/ThirdPartyNotices.txt +448 -0
  27. package/public/assets/monaco/min/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  28. package/public/assets/monaco/min/vs/base/worker/workerMain.js +31 -0
  29. package/public/assets/monaco/min/vs/basic-languages/shell/shell.js +10 -0
  30. package/public/assets/monaco/min/vs/editor/editor.main.css +8 -0
  31. package/public/assets/monaco/min/vs/editor/editor.main.js +798 -0
  32. package/public/assets/monaco/min/vs/language/json/jsonMode.js +19 -0
  33. package/public/assets/monaco/min/vs/language/json/jsonWorker.js +42 -0
  34. package/public/assets/monaco/min/vs/loader.js +11 -0
  35. package/public/chunk-24MFIAJC.js +1 -0
  36. package/public/chunk-2GPXWXUT.js +1 -0
  37. package/public/chunk-3LEW5FOJ.js +5 -0
  38. package/public/chunk-5RI5TLFW.js +1 -0
  39. package/public/{chunk-QX6BFGHZ.js → chunk-5WYRGCHF.js} +1 -1
  40. package/public/chunk-5YEBXXYW.js +1 -0
  41. package/public/{chunk-ZUTM7S4U.js → chunk-7FVJXUCR.js} +1 -1
  42. package/public/chunk-AEEAPTXE.js +1 -0
  43. package/public/chunk-AM53KSWA.js +1 -0
  44. package/public/chunk-ANRLCCQG.js +1 -0
  45. package/public/chunk-BH4JDZF4.js +1 -0
  46. package/public/chunk-BHMKIJVI.js +1 -0
  47. package/public/{chunk-IWFKJHPR.js → chunk-BQMDK4YS.js} +2 -2
  48. package/public/{chunk-3POLSI6J.js → chunk-C64P3A75.js} +1 -1
  49. package/public/{chunk-WCOLHYTR.js → chunk-CCHRGHTT.js} +1 -1
  50. package/public/chunk-CDS2MSIW.js +1 -0
  51. package/public/{chunk-J6CJ26QN.js → chunk-CIVLN3HQ.js} +1 -1
  52. package/public/{chunk-CMOVUX6R.js → chunk-CTYK4ZDT.js} +1 -1
  53. package/public/chunk-DOOSRLOB.js +1 -0
  54. package/public/{chunk-OYULLXTP.js → chunk-E6AE64XW.js} +1 -1
  55. package/public/chunk-EKP4IO3L.js +4 -0
  56. package/public/{chunk-H45DK7IX.js → chunk-EWO5Q2EI.js} +2 -2
  57. package/public/{chunk-FXJWZ2UF.js → chunk-F3ULAZ4E.js} +1 -1
  58. package/public/chunk-F6VJ3EFY.js +1 -0
  59. package/public/chunk-FB6OF4XR.js +1 -0
  60. package/public/chunk-G5PK6IZW.js +2 -0
  61. package/public/chunk-GFPRNM6N.js +1 -0
  62. package/public/chunk-GTGO4A2X.js +1 -0
  63. package/public/chunk-IJXZNORX.js +1 -0
  64. package/public/chunk-KCX2WQ7I.js +20 -0
  65. package/public/{chunk-D7VCPH6W.js → chunk-KNZTEJFP.js} +1 -1
  66. package/public/{chunk-H5WTK5UT.js → chunk-KXMDG63G.js} +1 -1
  67. package/public/chunk-L432DR6J.js +1 -0
  68. package/public/chunk-LNGNBQBM.js +1 -0
  69. package/public/{chunk-2C3X2ESN.js → chunk-M7Q6VBJE.js} +1 -1
  70. package/public/chunk-MCMJ5GFL.js +1 -0
  71. package/public/chunk-MDV2S56W.js +1 -0
  72. package/public/chunk-MIOXSBCB.js +1 -0
  73. package/public/{chunk-TWIBESLE.js → chunk-MKVX26LQ.js} +1 -1
  74. package/public/chunk-MODJOHCZ.js +1 -0
  75. package/public/chunk-MVMZJM7B.js +9 -0
  76. package/public/chunk-NMHMMKMV.js +1 -0
  77. package/public/chunk-NVX4KPO6.js +1 -0
  78. package/public/chunk-OLGI5A27.js +1 -0
  79. package/public/chunk-P6VGWWMV.js +1 -0
  80. package/public/chunk-PCCN3UQI.js +49 -0
  81. package/public/chunk-POHAQOWN.js +1 -0
  82. package/public/chunk-PVFUJ4PR.js +4 -0
  83. package/public/chunk-QZJJX4BS.js +1 -0
  84. package/public/{chunk-WTDK2HE6.js → chunk-RH474C2P.js} +1 -1
  85. package/public/chunk-RN2CW4V7.js +4 -0
  86. package/public/chunk-SEYIRMYP.js +40 -0
  87. package/public/{chunk-6E4QOLAB.js → chunk-SJP6OUG5.js} +1 -1
  88. package/public/chunk-TXNEVPOK.js +14 -0
  89. package/public/chunk-UFFCOH7L.js +1 -0
  90. package/public/chunk-UO7UMJN3.js +1 -0
  91. package/public/{chunk-5E4D6S2D.js → chunk-UUM2722D.js} +1 -1
  92. package/public/chunk-VNH6VAIL.js +1 -0
  93. package/public/chunk-VSICB3TW.js +1 -0
  94. package/public/chunk-W5UULTHE.js +1 -0
  95. package/public/chunk-XBQ6GTWH.js +3 -0
  96. package/public/chunk-XHOBTVZN.js +1 -0
  97. package/public/chunk-XSTH4HOH.js +1 -0
  98. package/public/chunk-YBETHBKT.js +1 -0
  99. package/public/chunk-YGABEALD.js +1 -0
  100. package/public/chunk-YWY6NRRB.js +1 -0
  101. package/public/chunk-ZUW7E67I.js +1 -0
  102. package/public/index.html +2 -2
  103. package/public/main-CVBTY5OH.js +1 -0
  104. package/public/polyfills-5KWHJ7II.js +2 -0
  105. package/public/{styles-LKRXKJ7O.css → styles-AUT3PDLG.css} +1 -1
  106. package/public/assets/hap-icons/light-bulb.svg +0 -25
  107. package/public/assets/hap-icons/outlet.svg +0 -25
  108. package/public/assets/hap-icons/switch.svg +0 -25
  109. package/public/assets/hap-icons/unknown.svg +0 -25
  110. package/public/assets/monaco-0.21.3/README.md +0 -96
  111. package/public/assets/monaco-0.21.3/ThirdPartyNotices.txt +0 -283
  112. package/public/assets/monaco-0.21.3/min/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
  113. package/public/assets/monaco-0.21.3/min/vs/base/worker/workerMain.js +0 -160
  114. package/public/assets/monaco-0.21.3/min/vs/basic-languages/shell/shell.js +0 -7
  115. package/public/assets/monaco-0.21.3/min/vs/editor/editor.main.css +0 -6
  116. package/public/assets/monaco-0.21.3/min/vs/editor/editor.main.js +0 -2368
  117. package/public/assets/monaco-0.21.3/min/vs/editor/editor.main.nls.js +0 -39
  118. package/public/assets/monaco-0.21.3/min/vs/language/json/jsonMode.js +0 -7
  119. package/public/assets/monaco-0.21.3/min/vs/language/json/jsonWorker.js +0 -7
  120. package/public/assets/monaco-0.21.3/min/vs/loader.js +0 -38
  121. package/public/assets/monaco-0.21.3/package.json +0 -38
  122. package/public/assets/service-icons/air-purifier.svg +0 -50
  123. package/public/assets/service-icons/air-quality-sensor.svg +0 -30
  124. package/public/assets/service-icons/carbon-dioxide-sensor.svg +0 -53
  125. package/public/assets/service-icons/carbon-monoxide-sensor.svg +0 -53
  126. package/public/assets/service-icons/contact-sensor.svg +0 -45
  127. package/public/assets/service-icons/door.svg +0 -49
  128. package/public/assets/service-icons/doorbell.svg +0 -7
  129. package/public/assets/service-icons/fan.svg +0 -15
  130. package/public/assets/service-icons/filter-maintenance.svg +0 -54
  131. package/public/assets/service-icons/garage-door.svg +0 -120
  132. package/public/assets/service-icons/irrigation-system.svg +0 -34
  133. package/public/assets/service-icons/leak-sensor.svg +0 -42
  134. package/public/assets/service-icons/light-sensor.svg +0 -34
  135. package/public/assets/service-icons/lock-mechanism.svg +0 -39
  136. package/public/assets/service-icons/microphone.svg +0 -12
  137. package/public/assets/service-icons/motion-sensor.svg +0 -84
  138. package/public/assets/service-icons/occupancy-sensor.svg +0 -49
  139. package/public/assets/service-icons/robot-vacuum.svg +0 -76
  140. package/public/assets/service-icons/security-system.svg +0 -19
  141. package/public/assets/service-icons/smoke-sensor.svg +0 -38
  142. package/public/assets/service-icons/speaker.svg +0 -28
  143. package/public/assets/service-icons/stateless-programmable-switch.svg +0 -18
  144. package/public/assets/service-icons/television.svg +0 -17
  145. package/public/assets/service-icons/valve-faucet.svg +0 -22
  146. package/public/assets/service-icons/valve-generic.svg +0 -25
  147. package/public/assets/service-icons/valve-irrigation.svg +0 -34
  148. package/public/assets/service-icons/valve-shower-head.svg +0 -32
  149. package/public/assets/service-icons/washing-machine.svg +0 -34
  150. package/public/assets/service-icons/window-covering.svg +0 -44
  151. package/public/assets/service-icons/window.svg +0 -71
  152. package/public/chunk-2H6KO42L.js +0 -1
  153. package/public/chunk-3M6IUC74.js +0 -1
  154. package/public/chunk-5PN3M3TS.js +0 -1
  155. package/public/chunk-5VJLO72Y.js +0 -1
  156. package/public/chunk-6CQ7JJUY.js +0 -1
  157. package/public/chunk-7EQFLCW4.js +0 -1
  158. package/public/chunk-7ZUAPFH6.js +0 -1
  159. package/public/chunk-A5YMO7NI.js +0 -1
  160. package/public/chunk-BEPC7IPQ.js +0 -23
  161. package/public/chunk-BG7RRQGG.js +0 -1
  162. package/public/chunk-BO3HTTPA.js +0 -1
  163. package/public/chunk-CN4SGKOR.js +0 -1
  164. package/public/chunk-DFFTJVRY.js +0 -1
  165. package/public/chunk-FCJZJIQL.js +0 -1
  166. package/public/chunk-FG5GS755.js +0 -1
  167. package/public/chunk-FMHXNJHJ.js +0 -1
  168. package/public/chunk-FSWVJTPN.js +0 -1
  169. package/public/chunk-FUTRU3DJ.js +0 -4
  170. package/public/chunk-FVKMBZOU.js +0 -9
  171. package/public/chunk-G3JSRG2Q.js +0 -2
  172. package/public/chunk-GHMFFLJG.js +0 -1
  173. package/public/chunk-HT7KLIKB.js +0 -1
  174. package/public/chunk-HWAWBYVQ.js +0 -1
  175. package/public/chunk-IOKYXV5M.js +0 -4
  176. package/public/chunk-JFPT3QXX.js +0 -30
  177. package/public/chunk-JL4UQXPL.js +0 -1
  178. package/public/chunk-KZKL7DGI.js +0 -1
  179. package/public/chunk-LDCR6K2U.js +0 -12
  180. package/public/chunk-LXAXEGMX.js +0 -1
  181. package/public/chunk-MHTCWHP3.js +0 -1
  182. package/public/chunk-NDBMU5RD.js +0 -14
  183. package/public/chunk-NHNGZ4PI.js +0 -1
  184. package/public/chunk-NORBG6QU.js +0 -1
  185. package/public/chunk-OA7Y3E5A.js +0 -2
  186. package/public/chunk-PA5E2G2J.js +0 -4
  187. package/public/chunk-Q3EG5UQP.js +0 -1
  188. package/public/chunk-QE27FJRU.js +0 -1
  189. package/public/chunk-QVCO7S7N.js +0 -20
  190. package/public/chunk-R3KUMAWN.js +0 -1
  191. package/public/chunk-RHZTPEXE.js +0 -1
  192. package/public/chunk-RZXCKXEZ.js +0 -1
  193. package/public/chunk-SL5FI37R.js +0 -1
  194. package/public/chunk-SULJOYSB.js +0 -3
  195. package/public/chunk-TR3AIWBS.js +0 -1
  196. package/public/chunk-V6JVOQNN.js +0 -1
  197. package/public/chunk-WX32WZFA.js +0 -1
  198. package/public/chunk-WYMH5QZG.js +0 -1
  199. package/public/chunk-X5YIKTO6.js +0 -1
  200. package/public/chunk-Z2T4OZ7I.js +0 -1
  201. package/public/chunk-ZAIVLZNZ.js +0 -1
  202. package/public/chunk-ZKQAULZM.js +0 -1
  203. package/public/chunk-ZLYGOSRJ.js +0 -1
  204. package/public/main-ILQAVUPM.js +0 -1
  205. package/public/polyfills-WE4HA5DL.js +0 -2
  206. /package/public/assets/{monaco-0.21.3 → monaco}/LICENSE +0 -0
@@ -0,0 +1,3 @@
1
+ import{c as gi}from"./chunk-TXNEVPOK.js";import{Ba as Is,Q as Ts,Qa as se,Ya as Fs,a as we,b as Ce,bb as fi,cb as zs,ea as Ls,ha as Rs,o as As,ya as Es}from"./chunk-3LEW5FOJ.js";function ae(i){return i+.5|0}var _t=(i,e,t)=>Math.max(Math.min(i,t),e);function ne(i){return _t(ae(i*2.55),0,255)}function yt(i){return _t(ae(i*255),0,255)}function ut(i){return _t(ae(i/2.55)/100,0,1)}function Bs(i){return _t(ae(i*100),0,100)}var et={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},mi=[..."0123456789ABCDEF"],ea=i=>mi[i&15],ia=i=>mi[(i&240)>>4]+mi[i&15],Pe=i=>(i&240)>>4===(i&15),sa=i=>Pe(i.r)&&Pe(i.g)&&Pe(i.b)&&Pe(i.a);function na(i){var e=i.length,t;return i[0]==="#"&&(e===4||e===5?t={r:255&et[i[1]]*17,g:255&et[i[2]]*17,b:255&et[i[3]]*17,a:e===5?et[i[4]]*17:255}:(e===7||e===9)&&(t={r:et[i[1]]<<4|et[i[2]],g:et[i[3]]<<4|et[i[4]],b:et[i[5]]<<4|et[i[6]],a:e===9?et[i[7]]<<4|et[i[8]]:255})),t}var oa=(i,e)=>i<255?e(i):"";function aa(i){var e=sa(i)?ea:ia;return i?"#"+e(i.r)+e(i.g)+e(i.b)+oa(i.a,e):void 0}var ra=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Hs(i,e,t){let s=e*Math.min(t,1-t),n=(o,a=(o+i/30)%12)=>t-s*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function la(i,e,t){let s=(n,o=(n+i/60)%6)=>t-t*e*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function ca(i,e,t){let s=Hs(i,1,.5),n;for(e+t>1&&(n=1/(e+t),e*=n,t*=n),n=0;n<3;n++)s[n]*=1-e-t,s[n]+=e;return s}function ha(i,e,t,s,n){return i===n?(e-t)/s+(e<t?6:0):e===n?(t-i)/s+2:(i-e)/s+4}function bi(i){let t=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(t,s,n),a=Math.min(t,s,n),r=(o+a)/2,l,c,h;return o!==a&&(h=o-a,c=r>.5?h/(2-o-a):h/(o+a),l=ha(t,s,n,h,o),l=l*60+.5),[l|0,c||0,r]}function xi(i,e,t,s){return(Array.isArray(e)?i(e[0],e[1],e[2]):i(e,t,s)).map(yt)}function _i(i,e,t){return xi(Hs,i,e,t)}function da(i,e,t){return xi(ca,i,e,t)}function ua(i,e,t){return xi(la,i,e,t)}function js(i){return(i%360+360)%360}function fa(i){let e=ra.exec(i),t=255,s;if(!e)return;e[5]!==s&&(t=e[6]?ne(+e[5]):yt(+e[5]));let n=js(+e[2]),o=+e[3]/100,a=+e[4]/100;return e[1]==="hwb"?s=da(n,o,a):e[1]==="hsv"?s=ua(n,o,a):s=_i(n,o,a),{r:s[0],g:s[1],b:s[2],a:t}}function ga(i,e){var t=bi(i);t[0]=js(t[0]+e),t=_i(t),i.r=t[0],i.g=t[1],i.b=t[2]}function pa(i){if(!i)return;let e=bi(i),t=e[0],s=Bs(e[1]),n=Bs(e[2]);return i.a<255?`hsla(${t}, ${s}%, ${n}%, ${ut(i.a)})`:`hsl(${t}, ${s}%, ${n}%)`}var Vs={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"},Ns={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 ma(){let i={},e=Object.keys(Ns),t=Object.keys(Vs),s,n,o,a,r;for(s=0;s<e.length;s++){for(a=r=e[s],n=0;n<t.length;n++)o=t[n],r=r.replace(o,Vs[o]);o=parseInt(Ns[a],16),i[r]=[o>>16&255,o>>8&255,o&255]}return i}var De;function ba(i){De||(De=ma(),De.transparent=[0,0,0,0]);let e=De[i.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}var xa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function _a(i){let e=xa.exec(i),t=255,s,n,o;if(e){if(e[7]!==s){let a=+e[7];t=e[8]?ne(a):_t(a*255,0,255)}return s=+e[1],n=+e[3],o=+e[5],s=255&(e[2]?ne(s):_t(s,0,255)),n=255&(e[4]?ne(n):_t(n,0,255)),o=255&(e[6]?ne(o):_t(o,0,255)),{r:s,g:n,b:o,a:t}}}function ya(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${ut(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}var pi=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Wt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function va(i,e,t){let s=Wt(ut(i.r)),n=Wt(ut(i.g)),o=Wt(ut(i.b));return{r:yt(pi(s+t*(Wt(ut(e.r))-s))),g:yt(pi(n+t*(Wt(ut(e.g))-n))),b:yt(pi(o+t*(Wt(ut(e.b))-o))),a:i.a+t*(e.a-i.a)}}function Oe(i,e,t){if(i){let s=bi(i);s[e]=Math.max(0,Math.min(s[e]+s[e]*t,e===0?360:1)),s=_i(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function Ys(i,e){return i&&Object.assign(e||{},i)}function Ws(i){var e={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(e={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(e.a=yt(i[3]))):(e=Ys(i,{r:0,g:0,b:0,a:1}),e.a=yt(e.a)),e}function Ma(i){return i.charAt(0)==="r"?_a(i):fa(i)}var oe=class i{constructor(e){if(e instanceof i)return e;let t=typeof e,s;t==="object"?s=Ws(e):t==="string"&&(s=na(e)||ba(e)||Ma(e)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var e=Ys(this._rgb);return e&&(e.a=ut(e.a)),e}set rgb(e){this._rgb=Ws(e)}rgbString(){return this._valid?ya(this._rgb):void 0}hexString(){return this._valid?aa(this._rgb):void 0}hslString(){return this._valid?pa(this._rgb):void 0}mix(e,t){if(e){let s=this.rgb,n=e.rgb,o,a=t===o?.5:t,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(e,t){return e&&(this._rgb=va(this._rgb,e._rgb,t)),this}clone(){return new i(this.rgb)}alpha(e){return this._rgb.a=yt(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let e=this._rgb,t=ae(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Oe(this._rgb,2,e),this}darken(e){return Oe(this._rgb,2,-e),this}saturate(e){return Oe(this._rgb,1,e),this}desaturate(e){return Oe(this._rgb,1,-e),this}rotate(e){return ga(this._rgb,e),this}};function lt(){}var en=(()=>{let i=0;return()=>i++})();function O(i){return i==null}function z(i){if(Array.isArray&&Array.isArray(i))return!0;let e=Object.prototype.toString.call(i);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function A(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function N(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function Z(i,e){return N(i)?i:e}function C(i,e){return typeof i>"u"?e:i}var sn=(i,e)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/e,ki=(i,e)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*e:+i;function I(i,e,t){if(i&&typeof i.call=="function")return i.apply(t,e)}function R(i,e,t,s){let n,o,a;if(z(i))if(o=i.length,s)for(n=o-1;n>=0;n--)e.call(t,i[n],n);else for(n=0;n<o;n++)e.call(t,i[n],n);else if(A(i))for(a=Object.keys(i),o=a.length,n=0;n<o;n++)e.call(t,i[a[n]],a[n])}function ce(i,e){let t,s,n,o;if(!i||!e||i.length!==e.length)return!1;for(t=0,s=i.length;t<s;++t)if(n=i[t],o=e[t],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function Ee(i){if(z(i))return i.map(Ee);if(A(i)){let e=Object.create(null),t=Object.keys(i),s=t.length,n=0;for(;n<s;++n)e[t[n]]=Ee(i[t[n]]);return e}return i}function nn(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function ka(i,e,t,s){if(!nn(i))return;let n=e[i],o=t[i];A(n)&&A(o)?jt(n,o,s):e[i]=Ee(o)}function jt(i,e,t){let s=z(e)?e:[e],n=s.length;if(!A(i))return i;t=t||{};let o=t.merger||ka,a;for(let r=0;r<n;++r){if(a=s[r],!A(a))continue;let l=Object.keys(a);for(let c=0,h=l.length;c<h;++c)o(l[c],i,a,t)}return i}function $t(i,e){return jt(i,e,{merger:Sa})}function Sa(i,e,t){if(!nn(i))return;let s=e[i],n=t[i];A(s)&&A(n)?$t(s,n):Object.prototype.hasOwnProperty.call(e,i)||(e[i]=Ee(n))}var $s={"":i=>i,x:i=>i.x,y:i=>i.y};function wa(i){let e=i.split("."),t=[],s="";for(let n of e)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(t.push(s),s="");return t}function Ca(i){let e=wa(i);return t=>{for(let s of e){if(s==="")break;t=t&&t[s]}return t}}function pt(i,e){return($s[e]||($s[e]=Ca(e)))(i)}function Be(i){return i.charAt(0).toUpperCase()+i.slice(1)}var Ut=i=>typeof i<"u",ft=i=>typeof i=="function",Si=(i,e)=>{if(i.size!==e.size)return!1;for(let t of i)if(!e.has(t))return!1;return!0};function on(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}var L=Math.PI,B=2*L,Pa=B+L,Ie=Number.POSITIVE_INFINITY,Da=L/180,W=L/2,Tt=L/4,Us=L*2/3,gt=Math.log10,nt=Math.sign;function Xt(i,e,t){return Math.abs(i-e)<t}function wi(i){let e=Math.round(i);i=Xt(i,e,i/1e3)?e:i;let t=Math.pow(10,Math.floor(gt(i))),s=i/t;return(s<=1?1:s<=2?2:s<=5?5:10)*t}function an(i){let e=[],t=Math.sqrt(i),s;for(s=1;s<t;s++)i%s===0&&(e.push(s),e.push(i/s));return t===(t|0)&&e.push(t),e.sort((n,o)=>n-o).pop(),e}function Oa(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function Et(i){return!Oa(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function rn(i,e){let t=Math.round(i);return t-e<=i&&t+e>=i}function Ci(i,e,t){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][t],isNaN(o)||(e.min=Math.min(e.min,o),e.max=Math.max(e.max,o))}function it(i){return i*(L/180)}function Ve(i){return i*(180/L)}function Pi(i){if(!N(i))return;let e=1,t=0;for(;Math.round(i*e)/e!==i;)e*=10,t++;return t}function Di(i,e){let t=e.x-i.x,s=e.y-i.y,n=Math.sqrt(t*t+s*s),o=Math.atan2(s,t);return o<-.5*L&&(o+=B),{angle:o,distance:n}}function Fe(i,e){return Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2))}function Aa(i,e){return(i-e+Pa)%B-L}function U(i){return(i%B+B)%B}function Kt(i,e,t,s){let n=U(i),o=U(e),a=U(t),r=U(o-n),l=U(a-n),c=U(n-o),h=U(n-a);return n===o||n===a||s&&o===a||r>l&&c<h}function Y(i,e,t){return Math.max(e,Math.min(t,i))}function ln(i){return Y(i,-32768,32767)}function ct(i,e,t,s=1e-6){return i>=Math.min(e,t)-s&&i<=Math.max(e,t)+s}function Ne(i,e,t){t=t||(a=>i[a]<e);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,t(o)?n=o:s=o;return{lo:n,hi:s}}var at=(i,e,t,s)=>Ne(i,t,s?n=>{let o=i[n][e];return o<t||o===t&&i[n+1][e]===t}:n=>i[n][e]<t),cn=(i,e,t)=>Ne(i,t,s=>i[s][e]>=t);function hn(i,e,t){let s=0,n=i.length;for(;s<n&&i[s]<e;)s++;for(;n>s&&i[n-1]>t;)n--;return s>0||n<i.length?i.slice(s,n):i}var dn=["push","pop","shift","splice","unshift"];function un(i,e){if(i._chartjs){i._chartjs.listeners.push(e);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),dn.forEach(t=>{let s="_onData"+Be(t),n=i[t];Object.defineProperty(i,t,{configurable:!0,enumerable:!1,value(...o){let a=n.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[s]=="function"&&r[s](...o)}),a}})})}function Oi(i,e){let t=i._chartjs;if(!t)return;let s=t.listeners,n=s.indexOf(e);n!==-1&&s.splice(n,1),!(s.length>0)&&(dn.forEach(o=>{delete i[o]}),delete i._chartjs)}function Ai(i){let e=new Set(i);return e.size===i.length?i:Array.from(e)}var Ti=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function Li(i,e){let t=[],s=!1;return function(...n){t=n,s||(s=!0,Ti.call(window,()=>{s=!1,i.apply(e,t)}))}}function fn(i,e){let t;return function(...s){return e?(clearTimeout(t),t=setTimeout(i,e,s)):i.apply(this,s),e}}var We=i=>i==="start"?"left":i==="end"?"right":"center",X=(i,e,t)=>i==="start"?e:i==="end"?t:(e+t)/2,gn=(i,e,t,s)=>i===(s?"left":"right")?t:i==="center"?(e+t)/2:e;function Ri(i,e,t){let s=e.length,n=0,o=s;if(i._sorted){let{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(at(l,h,d).lo,t?s:at(e,h,a.getPixelForValue(d)).lo),c){let g=l.slice(0,n+1).reverse().findIndex(m=>!O(m[r.axis]));n-=Math.max(0,g)}n=Y(n,0,s-1)}if(p){let g=Math.max(at(l,a.axis,u,!0).hi+1,t?0:at(e,h,a.getPixelForValue(u),!0).hi+1);if(c){let m=l.slice(g-1).findIndex(b=>!O(b[r.axis]));g+=Math.max(0,m)}o=Y(g,n,s)-n}else o=s-n}return{start:n,count:o}}function Ei(i){let{xScale:e,yScale:t,_scaleRanges:s}=i,n={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!s)return i._scaleRanges=n,!0;let o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==t.min||s.ymax!==t.max;return Object.assign(s,n),o}var Ae=i=>i===0||i===1,Xs=(i,e,t)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-e)*B/t)),Ks=(i,e,t)=>Math.pow(2,-10*i)*Math.sin((i-e)*B/t)+1,Ht={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*W)+1,easeOutSine:i=>Math.sin(i*W),easeInOutSine:i=>-.5*(Math.cos(L*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=>Ae(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=>Ae(i)?i:Xs(i,.075,.3),easeOutElastic:i=>Ae(i)?i:Ks(i,.075,.3),easeInOutElastic(i){return Ae(i)?i:i<.5?.5*Xs(i*2,.1125,.45):.5+.5*Ks(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 e=1.70158;return(i/=.5)<1?.5*(i*i*(((e*=1.525)+1)*i-e)):.5*((i-=2)*i*(((e*=1.525)+1)*i+e)+2)},easeInBounce:i=>1-Ht.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?Ht.easeInBounce(i*2)*.5:Ht.easeOutBounce(i*2-1)*.5+.5};function Ii(i){if(i&&typeof i=="object"){let e=i.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Fi(i){return Ii(i)?i:new oe(i)}function yi(i){return Ii(i)?i:new oe(i).saturate(.5).darken(.1).hexString()}var Ta=["x","y","borderWidth","radius","tension"],La=["color","borderColor","backgroundColor"];function Ra(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:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),i.set("animations",{colors:{type:"color",properties:La},numbers:{type:"number",properties:Ta}}),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:e=>e|0}}}})}function Ea(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var qs=new Map;function Ia(i,e){e=e||{};let t=i+JSON.stringify(e),s=qs.get(t);return s||(s=new Intl.NumberFormat(i,e),qs.set(t,s)),s}function qt(i,e,t){return Ia(e,t).format(i)}var pn={values(i){return z(i)?i:""+i},numeric(i,e,t){if(i===0)return"0";let s=this.chart.options.locale,n,o=i;if(t.length>1){let c=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=Fa(i,t)}let a=gt(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),qt(i,s,l)},logarithmic(i,e,t){if(i===0)return"0";let s=t[e].significand||i/Math.pow(10,Math.floor(gt(i)));return[1,2,3,5,10,15].includes(s)||e>.8*t.length?pn.numeric.call(this,i,e,t):""}};function Fa(i,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&i!==Math.floor(i)&&(t=i-Math.floor(i)),t}var he={formatters:pn};function za(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:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.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:he.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:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}var Mt=Object.create(null),He=Object.create(null);function re(i,e){if(!e)return i;let t=e.split(".");for(let s=0,n=t.length;s<n;++s){let o=t[s];i=i[o]||(i[o]=Object.create(null))}return i}function vi(i,e,t){return typeof e=="string"?jt(re(i,e),t):jt(re(i,""),e)}var Mi=class{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>yi(n.backgroundColor),this.hoverBorderColor=(s,n)=>yi(n.borderColor),this.hoverColor=(s,n)=>yi(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(e),this.apply(t)}set(e,t){return vi(this,e,t)}get(e){return re(this,e)}describe(e,t){return vi(He,e,t)}override(e,t){return vi(Mt,e,t)}route(e,t,s,n){let o=re(this,e),a=re(this,s),r="_"+t;Object.defineProperties(o,{[r]:{value:o[t],writable:!0},[t]:{enumerable:!0,get(){let l=this[r],c=a[n];return A(l)?Object.assign({},c,l):C(l,c)},set(l){this[r]=l}}})}apply(e){e.forEach(t=>t(this))}},F=new Mi({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Ra,Ea,za]);function Ba(i){return!i||O(i.size)||O(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function le(i,e,t,s,n){let o=e[n];return o||(o=e[n]=i.measureText(n).width,t.push(n)),o>s&&(s=o),s}function mn(i,e,t,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(n=s.data={},o=s.garbageCollect=[],s.font=e),i.save(),i.font=e;let a=0,r=t.length,l,c,h,d,u;for(l=0;l<r;l++)if(d=t[l],d!=null&&!z(d))a=le(i,n,o,a,d);else if(z(d))for(c=0,h=d.length;c<h;c++)u=d[c],u!=null&&!z(u)&&(a=le(i,n,o,a,u));i.restore();let f=o.length/2;if(f>t.length){for(l=0;l<f;l++)delete n[o[l]];o.splice(0,f)}return a}function kt(i,e,t){let s=i.currentDevicePixelRatio,n=t!==0?Math.max(t/2,.5):0;return Math.round((e-n)*s)/s+n}function zi(i,e){!e&&!i||(e=e||i.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,i.width,i.height),e.restore())}function je(i,e,t,s){Bi(i,e,t,s,null)}function Bi(i,e,t,s,n){let o,a,r,l,c,h,d,u,f=e.pointStyle,p=e.rotation,g=e.radius,m=(p||0)*Da;if(f&&typeof f=="object"&&(o=f.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(t,s),i.rotate(m),i.drawImage(f,-f.width/2,-f.height/2,f.width,f.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),f){default:n?i.ellipse(t,s,n/2,g,0,0,B):i.arc(t,s,g,0,B),i.closePath();break;case"triangle":h=n?n/2:g,i.moveTo(t+Math.sin(m)*h,s-Math.cos(m)*g),m+=Us,i.lineTo(t+Math.sin(m)*h,s-Math.cos(m)*g),m+=Us,i.lineTo(t+Math.sin(m)*h,s-Math.cos(m)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,a=Math.cos(m+Tt)*l,d=Math.cos(m+Tt)*(n?n/2-c:l),r=Math.sin(m+Tt)*l,u=Math.sin(m+Tt)*(n?n/2-c:l),i.arc(t-d,s-r,c,m-L,m-W),i.arc(t+u,s-a,c,m-W,m),i.arc(t+d,s+r,c,m,m+W),i.arc(t-u,s+a,c,m+W,m+L),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=n?n/2:l,i.rect(t-h,s-l,2*h,2*l);break}m+=Tt;case"rectRot":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(t-d,s-r),i.lineTo(t+u,s-a),i.lineTo(t+d,s+r),i.lineTo(t-u,s+a),i.closePath();break;case"crossRot":m+=Tt;case"cross":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(t-d,s-r),i.lineTo(t+d,s+r),i.moveTo(t+u,s-a),i.lineTo(t-u,s+a);break;case"star":d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(t-d,s-r),i.lineTo(t+d,s+r),i.moveTo(t+u,s-a),i.lineTo(t-u,s+a),m+=Tt,d=Math.cos(m)*(n?n/2:g),a=Math.cos(m)*g,r=Math.sin(m)*g,u=Math.sin(m)*(n?n/2:g),i.moveTo(t-d,s-r),i.lineTo(t+d,s+r),i.moveTo(t+u,s-a),i.lineTo(t-u,s+a);break;case"line":a=n?n/2:Math.cos(m)*g,r=Math.sin(m)*g,i.moveTo(t-a,s-r),i.lineTo(t+a,s+r);break;case"dash":i.moveTo(t,s),i.lineTo(t+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:i.closePath();break}i.fill(),e.borderWidth>0&&i.stroke()}}function rt(i,e,t){return t=t||.5,!e||i&&i.x>e.left-t&&i.x<e.right+t&&i.y>e.top-t&&i.y<e.bottom+t}function de(i,e){i.save(),i.beginPath(),i.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),i.clip()}function ue(i){i.restore()}function bn(i,e,t,s,n){if(!e)return i.lineTo(t.x,t.y);if(n==="middle"){let o=(e.x+t.x)/2;i.lineTo(o,e.y),i.lineTo(o,t.y)}else n==="after"!=!!s?i.lineTo(e.x,t.y):i.lineTo(t.x,e.y);i.lineTo(t.x,t.y)}function xn(i,e,t,s){if(!e)return i.lineTo(t.x,t.y);i.bezierCurveTo(s?e.cp1x:e.cp2x,s?e.cp1y:e.cp2y,s?t.cp2x:t.cp1x,s?t.cp2y:t.cp1y,t.x,t.y)}function Va(i,e){e.translation&&i.translate(e.translation[0],e.translation[1]),O(e.rotation)||i.rotate(e.rotation),e.color&&(i.fillStyle=e.color),e.textAlign&&(i.textAlign=e.textAlign),e.textBaseline&&(i.textBaseline=e.textBaseline)}function Na(i,e,t,s,n){if(n.strikethrough||n.underline){let o=i.measureText(s),a=e-o.actualBoundingBoxLeft,r=e+o.actualBoundingBoxRight,l=t-o.actualBoundingBoxAscent,c=t+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 Wa(i,e){let t=i.fillStyle;i.fillStyle=e.color,i.fillRect(e.left,e.top,e.width,e.height),i.fillStyle=t}function St(i,e,t,s,n,o={}){let a=z(e)?e:[e],r=o.strokeWidth>0&&o.strokeColor!=="",l,c;for(i.save(),i.font=n.string,Va(i,o),l=0;l<a.length;++l)c=a[l],o.backdrop&&Wa(i,o.backdrop),r&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),O(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,t,s,o.maxWidth)),i.fillText(c,t,s,o.maxWidth),Na(i,t,s,c,o),s+=Number(n.lineHeight);i.restore()}function Gt(i,e){let{x:t,y:s,w:n,h:o,radius:a}=e;i.arc(t+a.topLeft,s+a.topLeft,a.topLeft,1.5*L,L,!0),i.lineTo(t,s+o-a.bottomLeft),i.arc(t+a.bottomLeft,s+o-a.bottomLeft,a.bottomLeft,L,W,!0),i.lineTo(t+n-a.bottomRight,s+o),i.arc(t+n-a.bottomRight,s+o-a.bottomRight,a.bottomRight,W,0,!0),i.lineTo(t+n,s+a.topRight),i.arc(t+n-a.topRight,s+a.topRight,a.topRight,0,-W,!0),i.lineTo(t+a.topLeft,s)}var Ha=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,ja=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ya(i,e){let t=(""+i).match(Ha);if(!t||t[1]==="normal")return e*1.2;switch(i=+t[2],t[3]){case"px":return i;case"%":i/=100;break}return e*i}var $a=i=>+i||0;function Ye(i,e){let t={},s=A(e),n=s?Object.keys(e):e,o=A(i)?s?a=>C(i[a],i[e[a]]):a=>i[a]:()=>i;for(let a of n)t[a]=$a(o(a));return t}function Vi(i){return Ye(i,{top:"y",right:"x",bottom:"y",left:"x"})}function wt(i){return Ye(i,["topLeft","topRight","bottomLeft","bottomRight"])}function K(i){let e=Vi(i);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function j(i,e){i=i||{},e=e||F.font;let t=C(i.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let s=C(i.style,e.style);s&&!(""+s).match(ja)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);let n={family:C(i.family,e.family),lineHeight:Ya(C(i.lineHeight,e.lineHeight),t),size:t,style:s,weight:C(i.weight,e.weight),string:""};return n.string=Ba(n),n}function Zt(i,e,t,s){let n=!0,o,a,r;for(o=0,a=i.length;o<a;++o)if(r=i[o],r!==void 0&&(e!==void 0&&typeof r=="function"&&(r=r(e),n=!1),t!==void 0&&z(r)&&(r=r[t%r.length],n=!1),r!==void 0))return s&&!n&&(s.cacheable=!1),r}function _n(i,e,t){let{min:s,max:n}=i,o=ki(e,(n-s)/2),a=(r,l)=>t&&r===0?0:r+l;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function mt(i,e){return Object.assign(Object.create(i),e)}function $e(i,e=[""],t,s,n=()=>i[0]){let o=t||i;typeof s>"u"&&(s=Mn("_fallback",i));let a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:r=>$e([r,...i],e,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 yn(r,l,()=>Qa(l,e,i,r))},getOwnPropertyDescriptor(r,l){return Reflect.getOwnPropertyDescriptor(r._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,l){return Zs(r).includes(l)},ownKeys(r){return Zs(r)},set(r,l,c){let h=r._storage||(r._storage=n());return r[l]=h[l]=c,delete r._keys,!0}})}function Rt(i,e,t,s){let n={_cacheable:!1,_proxy:i,_context:e,_subProxy:t,_stack:new Set,_descriptors:Ni(i,s),setContext:o=>Rt(i,o,t,s),override:o=>Rt(i.override(o),e,t,s)};return new Proxy(n,{deleteProperty(o,a){return delete o[a],delete i[a],!0},get(o,a,r){return yn(o,a,()=>Xa(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 Ni(i,e={scriptable:!0,indexable:!0}){let{_scriptable:t=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=i;return{allKeys:n,scriptable:t,indexable:s,isScriptable:ft(t)?t:()=>t,isIndexable:ft(s)?s:()=>s}}var Ua=(i,e)=>i?i+Be(e):e,Wi=(i,e)=>A(e)&&i!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function yn(i,e,t){if(Object.prototype.hasOwnProperty.call(i,e)||e==="constructor")return i[e];let s=t();return i[e]=s,s}function Xa(i,e,t){let{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=i,r=s[e];return ft(r)&&a.isScriptable(e)&&(r=Ka(e,r,i,t)),z(r)&&r.length&&(r=qa(e,r,i,a.isIndexable)),Wi(e,r)&&(r=Rt(r,n,o&&o[e],a)),r}function Ka(i,e,t,s){let{_proxy:n,_context:o,_subProxy:a,_stack:r}=t;if(r.has(i))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+i);r.add(i);let l=e(o,a||s);return r.delete(i),Wi(i,l)&&(l=Hi(n._scopes,n,i,l)),l}function qa(i,e,t,s){let{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=t;if(typeof o.index<"u"&&s(i))return e[o.index%e.length];if(A(e[0])){let l=e,c=n._scopes.filter(h=>h!==l);e=[];for(let h of l){let d=Hi(c,n,i,h);e.push(Rt(d,o,a&&a[i],r))}}return e}function vn(i,e,t){return ft(i)?i(e,t):i}var Ga=(i,e)=>i===!0?e:typeof i=="string"?pt(e,i):void 0;function Za(i,e,t,s,n){for(let o of e){let a=Ga(t,o);if(a){i.add(a);let r=vn(a._fallback,t,n);if(typeof r<"u"&&r!==t&&r!==s)return r}else if(a===!1&&typeof s<"u"&&t!==s)return null}return!1}function Hi(i,e,t,s){let n=e._rootScopes,o=vn(e._fallback,t,s),a=[...i,...n],r=new Set;r.add(s);let l=Gs(r,a,t,o||t,s);return l===null||typeof o<"u"&&o!==t&&(l=Gs(r,a,o,l,s),l===null)?!1:$e(Array.from(r),[""],n,o,()=>Ja(e,t,s))}function Gs(i,e,t,s,n){for(;t;)t=Za(i,e,t,s,n);return t}function Ja(i,e,t){let s=i._getTarget();e in s||(s[e]={});let n=s[e];return z(n)&&A(t)?t:n||{}}function Qa(i,e,t,s){let n;for(let o of e)if(n=Mn(Ua(o,i),t),typeof n<"u")return Wi(i,n)?Hi(t,s,i,n):n}function Mn(i,e){for(let t of e){if(!t)continue;let s=t[i];if(typeof s<"u")return s}}function Zs(i){let e=i._keys;return e||(e=i._keys=tr(i._scopes)),e}function tr(i){let e=new Set;for(let t of i)for(let s of Object.keys(t).filter(n=>!n.startsWith("_")))e.add(s);return Array.from(e)}function ji(i,e,t,s){let{iScale:n}=i,{key:o="r"}=this._parsing,a=new Array(s),r,l,c,h;for(r=0,l=s;r<l;++r)c=r+t,h=e[c],a[r]={r:n.parse(pt(h,o),c)};return a}var er=Number.EPSILON||1e-14,Yt=(i,e)=>e<i.length&&!i[e].skip&&i[e],kn=i=>i==="x"?"y":"x";function ir(i,e,t,s){let n=i.skip?e:i,o=e,a=t.skip?e:t,r=Fe(o,n),l=Fe(a,o),c=r/(r+l),h=l/(r+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;let 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 sr(i,e,t){let s=i.length,n,o,a,r,l,c=Yt(i,0);for(let h=0;h<s-1;++h)if(l=c,c=Yt(i,h+1),!(!l||!c)){if(Xt(e[h],0,er)){t[h]=t[h+1]=0;continue}n=t[h]/e[h],o=t[h+1]/e[h],r=Math.pow(n,2)+Math.pow(o,2),!(r<=9)&&(a=3/Math.sqrt(r),t[h]=n*a*e[h],t[h+1]=o*a*e[h])}}function nr(i,e,t="x"){let s=kn(t),n=i.length,o,a,r,l=Yt(i,0);for(let c=0;c<n;++c){if(a=r,r=l,l=Yt(i,c+1),!r)continue;let h=r[t],d=r[s];a&&(o=(h-a[t])/3,r[`cp1${t}`]=h-o,r[`cp1${s}`]=d-o*e[c]),l&&(o=(l[t]-h)/3,r[`cp2${t}`]=h+o,r[`cp2${s}`]=d+o*e[c])}}function or(i,e="x"){let t=kn(e),s=i.length,n=Array(s).fill(0),o=Array(s),a,r,l,c=Yt(i,0);for(a=0;a<s;++a)if(r=l,l=c,c=Yt(i,a+1),!!l){if(c){let h=c[e]-l[e];n[a]=h!==0?(c[t]-l[t])/h:0}o[a]=r?c?nt(n[a-1])!==nt(n[a])?0:(n[a-1]+n[a])/2:n[a-1]:n[a]}sr(i,n,o),nr(i,o,e)}function Te(i,e,t){return Math.max(Math.min(i,t),e)}function ar(i,e){let t,s,n,o,a,r=rt(i[0],e);for(t=0,s=i.length;t<s;++t)a=o,o=r,r=t<s-1&&rt(i[t+1],e),o&&(n=i[t],a&&(n.cp1x=Te(n.cp1x,e.left,e.right),n.cp1y=Te(n.cp1y,e.top,e.bottom)),r&&(n.cp2x=Te(n.cp2x,e.left,e.right),n.cp2y=Te(n.cp2y,e.top,e.bottom)))}function Sn(i,e,t,s,n){let o,a,r,l;if(e.spanGaps&&(i=i.filter(c=>!c.skip)),e.cubicInterpolationMode==="monotone")or(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=ir(c,r,i[Math.min(o+1,a-(s?0:1))%a],e.tension),r.cp1x=l.previous.x,r.cp1y=l.previous.y,r.cp2x=l.next.x,r.cp2y=l.next.y,c=r}e.capBezierPoints&&ar(i,t)}function Ue(){return typeof window<"u"&&typeof document<"u"}function Xe(i){let e=i.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function ze(i,e,t){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*e.parentNode[t])):s=i,s}var Ke=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function rr(i,e){return Ke(i).getPropertyValue(e)}var lr=["top","right","bottom","left"];function Lt(i,e,t){let s={};t=t?"-"+t:"";for(let n=0;n<4;n++){let o=lr[n];s[o]=parseFloat(i[e+"-"+o+t])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}var cr=(i,e,t)=>(i>0||e>0)&&(!t||!t.shadowRoot);function hr(i,e){let t=i.touches,s=t&&t.length?t[0]:i,{offsetX:n,offsetY:o}=s,a=!1,r,l;if(cr(n,o,i.target))r=n,l=o;else{let c=e.getBoundingClientRect();r=s.clientX-c.left,l=s.clientY-c.top,a=!0}return{x:r,y:l,box:a}}function Ct(i,e){if("native"in i)return i;let{canvas:t,currentDevicePixelRatio:s}=e,n=Ke(t),o=n.boxSizing==="border-box",a=Lt(n,"padding"),r=Lt(n,"border","width"),{x:l,y:c,box:h}=hr(i,t),d=a.left+(h&&r.left),u=a.top+(h&&r.top),{width:f,height:p}=e;return o&&(f-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-d)/f*t.width/s),y:Math.round((c-u)/p*t.height/s)}}function dr(i,e,t){let s,n;if(e===void 0||t===void 0){let o=i&&Xe(i);if(!o)e=i.clientWidth,t=i.clientHeight;else{let a=o.getBoundingClientRect(),r=Ke(o),l=Lt(r,"border","width"),c=Lt(r,"padding");e=a.width-c.width-l.width,t=a.height-c.height-l.height,s=ze(r.maxWidth,o,"clientWidth"),n=ze(r.maxHeight,o,"clientHeight")}}return{width:e,height:t,maxWidth:s||Ie,maxHeight:n||Ie}}var Le=i=>Math.round(i*10)/10;function wn(i,e,t,s){let n=Ke(i),o=Lt(n,"margin"),a=ze(n.maxWidth,i,"clientWidth")||Ie,r=ze(n.maxHeight,i,"clientHeight")||Ie,l=dr(i,e,t),{width:c,height:h}=l;if(n.boxSizing==="content-box"){let u=Lt(n,"border","width"),f=Lt(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=Le(Math.min(c,a,l.maxWidth)),h=Le(Math.min(h,r,l.maxHeight)),c&&!h&&(h=Le(c/2)),(e!==void 0||t!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=Le(Math.floor(h*s))),{width:c,height:h}}function Yi(i,e,t){let s=e||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);let a=i.canvas;return a.style&&(t||!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}var Cn=(function(){let i=!1;try{let e={get passive(){return i=!0,!1}};Ue()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return i})();function $i(i,e){let t=rr(i,e),s=t&&t.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function vt(i,e,t,s){return{x:i.x+t*(e.x-i.x),y:i.y+t*(e.y-i.y)}}function Pn(i,e,t,s){return{x:i.x+t*(e.x-i.x),y:s==="middle"?t<.5?i.y:e.y:s==="after"?t<1?i.y:e.y:t>0?e.y:i.y}}function Dn(i,e,t,s){let n={x:i.cp2x,y:i.cp2y},o={x:e.cp1x,y:e.cp1y},a=vt(i,n,t),r=vt(n,o,t),l=vt(o,e,t),c=vt(a,r,t),h=vt(r,l,t);return vt(c,h,t)}var ur=function(i,e){return{x(t){return i+i+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,s){return t-s},leftForLtr(t,s){return t-s}}},fr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,e){return i+e},leftForLtr(i,e){return i}}};function It(i,e,t){return i?ur(e,t):fr()}function Ui(i,e){let t,s;(e==="ltr"||e==="rtl")&&(t=i.canvas.style,s=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),i.prevTextDirection=s)}function Xi(i,e){e!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",e[0],e[1]))}function On(i){return i==="angle"?{between:Kt,compare:Aa,normalize:U}:{between:ct,compare:(e,t)=>e-t,normalize:e=>e}}function Js({start:i,end:e,count:t,loop:s,style:n}){return{start:i%t,end:e%t,loop:s&&(e-i+1)%t===0,style:n}}function gr(i,e,t){let{property:s,start:n,end:o}=t,{between:a,normalize:r}=On(s),l=e.length,{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;u<f&&a(r(e[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 Ki(i,e,t){if(!t)return[i];let{property:s,start:n,end:o}=t,a=e.length,{compare:r,between:l,normalize:c}=On(s),{start:h,end:d,loop:u,style:f}=gr(i,e,t),p=[],g=!1,m=null,b,x,y,M=()=>l(n,y,b)&&r(n,y)!==0,_=()=>r(o,b)===0||l(o,y,b),v=()=>g||M(),S=()=>!g||_();for(let k=h,w=h;k<=d;++k)x=e[k%a],!x.skip&&(b=c(x[s]),b!==y&&(g=l(b,n,o),m===null&&v()&&(m=r(b,n)===0?k:w),m!==null&&S()&&(p.push(Js({start:m,end:k,loop:u,count:a,style:f})),m=null),w=k,y=b));return m!==null&&p.push(Js({start:m,end:d,loop:u,count:a,style:f})),p}function qi(i,e){let t=[],s=i.segments;for(let n=0;n<s.length;n++){let o=Ki(s[n],i.points,e);o.length&&t.push(...o)}return t}function pr(i,e,t,s){let n=0,o=e-1;if(t&&!s)for(;n<e&&!i[n].skip;)n++;for(;n<e&&i[n].skip;)n++;for(n%=e,t&&(o+=n);o>n&&i[o%e].skip;)o--;return o%=e,{start:n,end:o}}function mr(i,e,t,s){let n=i.length,o=[],a=e,r=i[e],l;for(l=e+1;l<=t;++l){let c=i[l%n];c.skip||c.stop?r.skip||(s=!1,o.push({start:e%n,end:(l-1)%n,loop:s}),e=a=c.stop?l:null):(a=l,r.skip&&(e=l)),r=c}return a!==null&&o.push({start:e%n,end:a%n,loop:s}),o}function An(i,e){let t=i.points,s=i.options.spanGaps,n=t.length;if(!n)return[];let o=!!i._loop,{start:a,end:r}=pr(t,n,o,s);if(s===!0)return Qs(i,[{start:a,end:r,loop:o}],t,e);let l=r<a?r+n:r,c=!!i._fullLoop&&a===0&&r===n-1;return Qs(i,mr(t,a,l,c),t,e)}function Qs(i,e,t,s){return!s||!s.setContext||!t?e:br(i,e,t,s)}function br(i,e,t,s){let n=i._chart.getContext(),o=tn(i.options),{_datasetIndex:a,options:{spanGaps:r}}=i,l=t.length,c=[],h=o,d=e[0].start,u=d;function f(p,g,m,b){let x=r?-1:1;if(p!==g){for(p+=l;t[p%l].skip;)p-=x;for(;t[g%l].skip;)g+=x;p%l!==g%l&&(c.push({start:p%l,end:g%l,loop:m,style:b}),h=b,d=g%l)}}for(let p of e){d=r?d:p.start;let g=t[d%l],m;for(u=d+1;u<=p.end;u++){let b=t[u%l];m=tn(s.setContext(mt(n,{type:"segment",p0:g,p1:b,p0DataIndex:(u-1)%l,p1DataIndex:u%l,datasetIndex:a}))),xr(m,h)&&f(d,u-1,p.loop,h),g=b,h=m}d<u-1&&f(d,u-1,p.loop,h)}return c}function tn(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,e){if(!e)return!1;let t=[],s=function(n,o){return Ii(o)?(t.includes(o)||t.push(o),t.indexOf(o)):o};return JSON.stringify(i,s)!==JSON.stringify(e,s)}function Re(i,e,t){return i.options.clip?i[t]:e[t]}function _r(i,e){let{xScale:t,yScale:s}=i;return t&&s?{left:Re(t,e,"left"),right:Re(t,e,"right"),top:Re(s,e,"top"),bottom:Re(s,e,"bottom")}:e}function Gi(i,e){let t=e._clip;if(t.disabled)return!1;let s=_r(e,i.chartArea);return{left:t.left===!1?0:s.left-(t.left===!0?0:t.left),right:t.right===!1?i.width:s.right+(t.right===!0?0:t.right),top:t.top===!1?0:s.top-(t.top===!0?0:t.top),bottom:t.bottom===!1?i.height:s.bottom+(t.bottom===!0?0:t.bottom)}}var ls=class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,s,n){let o=t.listeners[n],a=t.duration;o.forEach(r=>r({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(s-t.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=Ti.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;let o=s.items,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(e),r=!0):(o[a]=o[o.length-1],o.pop());r&&(n.draw(),this._notify(n,s,e,"progress")),o.length||(s.running=!1,this._notify(n,s,e,"complete"),s.initial=!1),t+=o.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,s=t.get(e);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,s)),s}listen(e,t,s){this._getAnims(e).listeners[t].push(s)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let s=t.items,n=s.length-1;for(;n>=0;--n)s[n].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}},bt=new ls,Tn="transparent",yr={boolean(i,e,t){return t>.5?e:i},color(i,e,t){let s=Fi(i||Tn),n=s.valid&&Fi(e||Tn);return n&&n.valid?n.mix(s,t).hexString():e},number(i,e,t){return i+(e-i)*t}},cs=class{constructor(e,t,s,n){let o=t[s];n=Zt([e.to,n,o,e.from]);let a=Zt([e.from,o,n]);this._active=!0,this._fn=e.fn||yr[e.type||typeof a],this._easing=Ht[e.easing]||Ht.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=s,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(e,t,s){if(this._active){this._notify(!1);let n=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=o,this._loop=!!e.loop,this._to=Zt([e.to,t,n,e.from]),this._from=Zt([e.from,n,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,s=this._duration,n=this._prop,o=this._from,a=this._loop,r=this._to,l;if(this._active=o!==r&&(a||t<s),!this._active){this._target[n]=r,this._notify(!0);return}if(t<0){this._target[n]=o;return}l=t/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(){let e=this._promises||(this._promises=[]);return new Promise((t,s)=>{e.push({res:t,rej:s})})}_notify(e){let t=e?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][t]()}},si=class{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!A(e))return;let t=Object.keys(F.animation),s=this._properties;Object.getOwnPropertyNames(e).forEach(n=>{let o=e[n];if(!A(o))return;let a={};for(let r of t)a[r]=o[r];(z(o.properties)&&o.properties||[n]).forEach(r=>{(r===n||!s.has(r))&&s.set(r,a)})})}_animateOptions(e,t){let s=t.options,n=Mr(e,s);if(!n)return[];let o=this._createAnimations(n,s);return s.$shared&&vr(e.options.$animations,s).then(()=>{e.options=s},()=>{}),o}_createAnimations(e,t){let s=this._properties,n=[],o=e.$animations||(e.$animations={}),a=Object.keys(t),r=Date.now(),l;for(l=a.length-1;l>=0;--l){let c=a[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(e,t));continue}let h=t[c],d=o[c],u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,r);continue}else d.cancel();if(!u||!u.duration){e[c]=h;continue}o[c]=d=new cs(u,e,c,h),n.push(d)}return n}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let s=this._createAnimations(e,t);if(s.length)return bt.add(this._chart,s),!0}};function vr(i,e){let t=[],s=Object.keys(e);for(let n=0;n<s.length;n++){let o=i[s[n]];o&&o.active()&&t.push(o.wait())}return Promise.all(t)}function Mr(i,e){if(!e)return;let t=i.options;if(!t){i.options=e;return}return t.$shared&&(i.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function Ln(i,e){let t=i&&i.options||{},s=t.reverse,n=t.min===void 0?e:0,o=t.max===void 0?e:0;return{start:s?o:n,end:s?n:o}}function kr(i,e,t){if(t===!1)return!1;let s=Ln(i,t),n=Ln(e,t);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function Sr(i){let e,t,s,n;return A(i)?(e=i.top,t=i.right,s=i.bottom,n=i.left):e=t=s=n=i,{top:e,right:t,bottom:s,left:n,disabled:i===!1}}function Lo(i,e){let t=[],s=i._getSortedDatasetMetas(e),n,o;for(n=0,o=s.length;n<o;++n)t.push(s[n].index);return t}function Rn(i,e,t,s={}){let n=i.keys,o=s.mode==="single",a,r,l,c;if(e===null)return;let h=!1;for(a=0,r=n.length;a<r;++a){if(l=+n[a],l===t){if(h=!0,s.all)continue;break}c=i.values[l],N(c)&&(o||e===0||nt(e)===nt(c))&&(e+=c)}return!h&&!s.all?0:e}function wr(i,e){let{iScale:t,vScale:s}=e,n=t.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",a=Object.keys(i),r=new Array(a.length),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 Zi(i,e){let t=i&&i.options.stacked;return t||t===void 0&&e.stack!==void 0}function Cr(i,e,t){return`${i.id}.${e.id}.${t.stack||t.type}`}function Pr(i){let{min:e,max:t,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?t:Number.POSITIVE_INFINITY}}function Dr(i,e,t){let s=i[e]||(i[e]={});return s[t]||(s[t]={})}function En(i,e,t,s){for(let n of e.getMatchingVisibleMetas(s).reverse()){let o=i[n.index];if(t&&o>0||!t&&o<0)return n.index}return null}function In(i,e){let{chart:t,_cachedMeta:s}=i,n=t._stacks||(t._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,c=a.axis,h=Cr(o,a,s),d=e.length,u;for(let f=0;f<d;++f){let p=e[f],{[l]:g,[c]:m}=p,b=p._stacks||(p._stacks={});u=b[c]=Dr(n,h,g),u[r]=m,u._top=En(u,a,!0,s.type),u._bottom=En(u,a,!1,s.type);let x=u._visualValues||(u._visualValues={});x[r]=m}}function Ji(i,e){let t=i.scales;return Object.keys(t).filter(s=>t[s].axis===e).shift()}function Or(i,e){return mt(i,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Ar(i,e,t){return mt(i,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function fe(i,e){let t=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){e=e||i._parsed;for(let n of e){let o=n._stacks;if(!o||o[s]===void 0||o[s][t]===void 0)return;delete o[s][t],o[s]._visualValues!==void 0&&o[s]._visualValues[t]!==void 0&&delete o[s]._visualValues[t]}}}var Qi=i=>i==="reset"||i==="none",Fn=(i,e)=>e?i:Object.assign({},i),Tr=(i,e,t)=>i&&!e.hidden&&e._stacked&&{keys:Lo(t,!0),values:null},Dt=(()=>{class i{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,s){this.chart=t,this._ctx=t.ctx,this.index=s,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Zi(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&&fe(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,s=this._cachedMeta,n=this.getDataset(),o=(u,f,p,g)=>u==="x"?f:u==="r"?g:p,a=s.xAxisID=C(n.xAxisID,Ji(t,"x")),r=s.yAxisID=C(n.yAxisID,Ji(t,"y")),l=s.rAxisID=C(n.rAxisID,Ji(t,"r")),c=s.indexAxis,h=s.iAxisID=o(c,a,r,l),d=s.vAxisID=o(c,r,a,l);s.xScale=this.getScaleForId(a),s.yScale=this.getScaleForId(r),s.rScale=this.getScaleForId(l),s.iScale=this.getScaleForId(h),s.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let s=this._cachedMeta;return t===s.iScale?s.vScale:s.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&Oi(this._data,this),t._stacked&&fe(t)}_dataCheck(){let t=this.getDataset(),s=t.data||(t.data=[]),n=this._data;if(A(s)){let o=this._cachedMeta;this._data=wr(s,o)}else if(n!==s){if(n){Oi(n,this);let o=this._cachedMeta;fe(o),o._parsed=[]}s&&Object.isExtensible(s)&&un(s,this),this._syncList=[],this._data=s}}addElements(){let t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){let s=this._cachedMeta,n=this.getDataset(),o=!1;this._dataCheck();let a=s._stacked;s._stacked=Zi(s.vScale,s),s.stack!==n.stack&&(o=!0,fe(s),s.stack=n.stack),this._resyncElements(t),(o||a!==s._stacked)&&(In(this,s._parsed),s._stacked=Zi(s.vScale,s))}configure(){let t=this.chart.config,s=t.datasetScopeKeys(this._type),n=t.getOptionScopes(this.getDataset(),s,!0);this.options=t.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,s){let{_cachedMeta:n,_data:o}=this,{iScale:a,_stacked:r}=n,l=a.axis,c=t===0&&s===o.length?!0:n._sorted,h=t>0&&n._parsed[t-1],d,u,f;if(this._parsing===!1)n._parsed=o,n._sorted=!0,f=o;else{z(o[t])?f=this.parseArrayData(n,o,t,s):A(o[t])?f=this.parseObjectData(n,o,t,s):f=this.parsePrimitiveData(n,o,t,s);let p=()=>u[l]===null||h&&u[l]<h[l];for(d=0;d<s;++d)n._parsed[d+t]=u=f[d],c&&(p()&&(c=!1),h=u);n._sorted=c}r&&In(this,f)}parsePrimitiveData(t,s,n,o){let{iScale:a,vScale:r}=t,l=a.axis,c=r.axis,h=a.getLabels(),d=a===r,u=new Array(o),f,p,g;for(f=0,p=o;f<p;++f)g=f+n,u[f]={[l]:d||a.parse(h[g],g),[c]:r.parse(s[g],g)};return u}parseArrayData(t,s,n,o){let{xScale:a,yScale:r}=t,l=new Array(o),c,h,d,u;for(c=0,h=o;c<h;++c)d=c+n,u=s[d],l[c]={x:a.parse(u[0],d),y:r.parse(u[1],d)};return l}parseObjectData(t,s,n,o){let{xScale:a,yScale:r}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,h=new Array(o),d,u,f,p;for(d=0,u=o;d<u;++d)f=d+n,p=s[f],h[d]={x:a.parse(pt(p,l),f),y:r.parse(pt(p,c),f)};return h}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,s,n){let o=this.chart,a=this._cachedMeta,r=s[t.axis],l={keys:Lo(o,!0),values:s._stacks[t.axis]._visualValues};return Rn(l,r,a.index,{mode:n})}updateRangeFromParsed(t,s,n,o){let a=n[s.axis],r=a===null?NaN:a,l=o&&n._stacks[s.axis];o&&l&&(o.values=l,r=Rn(o,a,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,s){let n=this._cachedMeta,o=n._parsed,a=n._sorted&&t===n.iScale,r=o.length,l=this._getOtherScale(t),c=Tr(s,n,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:u}=Pr(l),f,p;function g(){p=o[f];let m=p[l.axis];return!N(p[t.axis])||d>m||u<m}for(f=0;f<r&&!(!g()&&(this.updateRangeFromParsed(h,t,p,c),a));++f);if(a){for(f=r-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(h,t,p,c);break}}return h}getAllParsedValues(t){let s=this._cachedMeta._parsed,n=[],o,a,r;for(o=0,a=s.length;o<a;++o)r=s[o][t.axis],N(r)&&n.push(r);return n}getMaxOverflow(){return!1}getLabelAndValue(t){let s=this._cachedMeta,n=s.iScale,o=s.vScale,a=this.getParsed(t);return{label:n?""+n.getLabelForValue(a[n.axis]):"",value:o?""+o.getLabelForValue(a[o.axis]):""}}_update(t){let s=this._cachedMeta;this.update(t||"default"),s._clip=Sr(C(this.options.clip,kr(s.xScale,s.yScale,this.getMaxOverflow())))}update(t){}draw(){let t=this._ctx,s=this.chart,n=this._cachedMeta,o=n.data||[],a=s.chartArea,r=[],l=this._drawStart||0,c=this._drawCount||o.length-l,h=this.options.drawActiveElementsOnTop,d;for(n.dataset&&n.dataset.draw(t,a,l,c),d=l;d<l+c;++d){let u=o[d];u.hidden||(u.active&&h?r.push(u):u.draw(t,a))}for(d=0;d<r.length;++d)r[d].draw(t,a)}getStyle(t,s){let n=s?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(n):this.resolveDataElementOptions(t||0,n)}getContext(t,s,n){let o=this.getDataset(),a;if(t>=0&&t<this._cachedMeta.data.length){let r=this._cachedMeta.data[t];a=r.$context||(r.$context=Ar(this.getContext(),t,r)),a.parsed=this.getParsed(t),a.raw=o.data[t],a.index=a.dataIndex=t}else a=this.$context||(this.$context=Or(this.chart.getContext(),this.index)),a.dataset=o,a.index=a.datasetIndex=this.index;return a.active=!!s,a.mode=n,a}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,s){return this._resolveElementOptions(this.dataElementType.id,s,t)}_resolveElementOptions(t,s="default",n){let o=s==="active",a=this._cachedDataOpts,r=t+"-"+s,l=a[r],c=this.enableOptionSharing&&Ut(n);if(l)return Fn(l,c);let h=this.chart.config,d=h.datasetElementScopeKeys(this._type,t),u=o?[`${t}Hover`,"hover",t,""]:[t,""],f=h.getOptionScopes(this.getDataset(),d),p=Object.keys(F.elements[t]),g=()=>this.getContext(n,o,s),m=h.resolveNamedOptions(f,p,g,u);return m.$shared&&(m.$shared=c,a[r]=Object.freeze(Fn(m,c))),m}_resolveAnimations(t,s,n){let o=this.chart,a=this._cachedDataOpts,r=`animation-${s}`,l=a[r];if(l)return l;let c;if(o.options.animation!==!1){let d=this.chart.config,u=d.datasetAnimationScopeKeys(this._type,s),f=d.getOptionScopes(this.getDataset(),u);c=d.createResolver(f,this.getContext(t,n,s))}let h=new si(o,c&&c.animations);return c&&c._cacheable&&(a[r]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,s){return!s||Qi(t)||this.chart._animationsDisabled}_getSharedOptions(t,s){let n=this.resolveDataElementOptions(t,s),o=this._sharedOptions,a=this.getSharedOptions(n),r=this.includeOptions(s,a)||a!==o;return this.updateSharedOptions(a,s,n),{sharedOptions:a,includeOptions:r}}updateElement(t,s,n,o){Qi(o)?Object.assign(t,n):this._resolveAnimations(s,o).update(t,n)}updateSharedOptions(t,s,n){t&&!Qi(s)&&this._resolveAnimations(void 0,s).update(t,n)}_setStyle(t,s,n,o){t.active=o;let a=this.getStyle(s,o);this._resolveAnimations(s,n,o).update(t,{options:!o&&this.getSharedOptions(a)||a})}removeHoverStyle(t,s,n){this._setStyle(t,n,"active",!1)}setHoverStyle(t,s,n){this._setStyle(t,n,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let s=this._data,n=this._cachedMeta.data;for(let[l,c,h]of this._syncList)this[l](c,h);this._syncList=[];let o=n.length,a=s.length,r=Math.min(a,o);r&&this.parse(0,r),a>o?this._insertElements(o,a-o,t):a<o&&this._removeElements(a,o-a)}_insertElements(t,s,n=!0){let o=this._cachedMeta,a=o.data,r=t+s,l,c=h=>{for(h.length+=s,l=h.length-1;l>=r;l--)h[l]=h[l-s]};for(c(a),l=t;l<r;++l)a[l]=new this.dataElementType;this._parsing&&c(o._parsed),this.parse(t,s),n&&this.updateElements(a,t,s,"reset")}updateElements(t,s,n,o){}_removeElements(t,s){let n=this._cachedMeta;if(this._parsing){let o=n._parsed.splice(t,s);n._stacked&&fe(n,o)}n.data.splice(t,s)}_sync(t){if(this._parsing)this._syncList.push(t);else{let[s,n,o]=t;this[s](n,o)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){let t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,s){s&&this._sync(["_removeElements",t,s]);let n=arguments.length-2;n&&this._sync(["_insertElements",t,n])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}return i})();function Lr(i,e){if(!i._cache.$bar){let t=i.getMatchingVisibleMetas(e),s=[];for(let n=0,o=t.length;n<o;n++)s=s.concat(t[n].controller.getAllParsedValues(i));i._cache.$bar=Ai(s.sort((n,o)=>n-o))}return i._cache.$bar}function Rr(i){let e=i.iScale,t=Lr(e,i.type),s=e._length,n,o,a,r,l=()=>{a===32767||a===-32768||(Ut(r)&&(s=Math.min(s,Math.abs(a-r)||s)),r=a)};for(n=0,o=t.length;n<o;++n)a=e.getPixelForValue(t[n]),l();for(r=void 0,n=0,o=e.ticks.length;n<o;++n)a=e.getPixelForTick(n),l();return s}function Er(i,e,t,s){let n=t.barThickness,o,a;return O(n)?(o=e.min*t.categoryPercentage,a=t.barPercentage):(o=n*s,a=1),{chunk:o/s,ratio:a,start:e.pixels[i]-o/2}}function Ir(i,e,t,s){let n=e.pixels,o=n[i],a=i>0?n[i-1]:null,r=i<n.length-1?n[i+1]:null,l=t.categoryPercentage;a===null&&(a=o-(r===null?e.end-e.start:r-o)),r===null&&(r=o+o-a);let c=o-(o-Math.min(a,r))/2*l;return{chunk:Math.abs(r-a)/2*l/s,ratio:t.barPercentage,start:c}}function Fr(i,e,t,s){let n=t.parse(i[0],s),o=t.parse(i[1],s),a=Math.min(n,o),r=Math.max(n,o),l=a,c=r;Math.abs(a)>Math.abs(r)&&(l=r,c=a),e[t.axis]=c,e._custom={barStart:l,barEnd:c,start:n,end:o,min:a,max:r}}function Ro(i,e,t,s){return z(i)?Fr(i,e,t,s):e[t.axis]=t.parse(i,s),e}function zn(i,e,t,s){let n=i.iScale,o=i.vScale,a=n.getLabels(),r=n===o,l=[],c,h,d,u;for(c=t,h=t+s;c<h;++c)u=e[c],d={},d[n.axis]=r||n.parse(a[c],c),l.push(Ro(u,d,o,c));return l}function ts(i){return i&&i.barStart!==void 0&&i.barEnd!==void 0}function zr(i,e,t){return i!==0?nt(i):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Br(i){let e,t,s,n,o;return i.horizontal?(e=i.base>i.x,t="left",s="right"):(e=i.base<i.y,t="bottom",s="top"),e?(n="end",o="start"):(n="start",o="end"),{start:t,end:s,reverse:e,top:n,bottom:o}}function Vr(i,e,t,s){let n=e.borderSkipped,o={};if(!n){i.borderSkipped=o;return}if(n===!0){i.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}let{start:a,end:r,reverse:l,top:c,bottom:h}=Br(i);n==="middle"&&t&&(i.enableBorderRadius=!0,(t._top||0)===s?n=c:(t._bottom||0)===s?n=h:(o[Bn(h,a,r,l)]=!0,n=c)),o[Bn(n,a,r,l)]=!0,i.borderSkipped=o}function Bn(i,e,t,s){return s?(i=Nr(i,e,t),i=Vn(i,t,e)):i=Vn(i,e,t),i}function Nr(i,e,t){return i===e?t:i===t?e:i}function Vn(i,e,t){return i==="start"?e:i==="end"?t:i}function Wr(i,{inflateAmount:e},t){i.inflateAmount=e==="auto"?t===1?.33:0:e}var Hr=(()=>{class i extends Dt{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(t,s,n,o){return zn(t,s,n,o)}parseArrayData(t,s,n,o){return zn(t,s,n,o)}parseObjectData(t,s,n,o){let{iScale:a,vScale:r}=t,{xAxisKey:l="x",yAxisKey:c="y"}=this._parsing,h=a.axis==="x"?l:c,d=r.axis==="x"?l:c,u=[],f,p,g,m;for(f=n,p=n+o;f<p;++f)m=s[f],g={},g[a.axis]=a.parse(pt(m,h),f),u.push(Ro(pt(m,d),g,r,f));return u}updateRangeFromParsed(t,s,n,o){super.updateRangeFromParsed(t,s,n,o);let a=n._custom;a&&s===this._cachedMeta.vScale&&(t.min=Math.min(t.min,a.min),t.max=Math.max(t.max,a.max))}getMaxOverflow(){return 0}getLabelAndValue(t){let s=this._cachedMeta,{iScale:n,vScale:o}=s,a=this.getParsed(t),r=a._custom,l=ts(r)?"["+r.start+", "+r.end+"]":""+o.getLabelForValue(a[o.axis]);return{label:""+n.getLabelForValue(a[n.axis]),value:l}}initialize(){this.enableOptionSharing=!0,super.initialize();let t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){let s=this._cachedMeta;this.updateElements(s.data,0,s.data.length,t)}updateElements(t,s,n,o){let a=o==="reset",{index:r,_cachedMeta:{vScale:l}}=this,c=l.getBasePixel(),h=l.isHorizontal(),d=this._getRuler(),{sharedOptions:u,includeOptions:f}=this._getSharedOptions(s,o);for(let p=s;p<s+n;p++){let g=this.getParsed(p),m=a||O(g[l.axis])?{base:c,head:c}:this._calculateBarValuePixels(p),b=this._calculateBarIndexPixels(p,d),x=(g._stacks||{})[l.axis],y={horizontal:h,base:m.base,enableBorderRadius:!x||ts(g._custom)||r===x._top||r===x._bottom,x:h?m.head:b.center,y:h?b.center:m.head,height:h?b.size:Math.abs(m.size),width:h?Math.abs(m.size):b.size};f&&(y.options=u||this.resolveDataElementOptions(p,t[p].active?"active":o));let M=y.options||t[p].options;Vr(y,M,x,r),Wr(y,M,d.ratio),this.updateElement(t[p],p,y,o)}}_getStacks(t,s){let{iScale:n}=this._cachedMeta,o=n.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),a=n.options.stacked,r=[],l=this._cachedMeta.controller.getParsed(s),c=l&&l[n.axis],h=d=>{let u=d._parsed.find(p=>p[n.axis]===c),f=u&&u[d.vScale.axis];if(O(f)||isNaN(f))return!0};for(let d of o)if(!(s!==void 0&&h(d))&&((a===!1||r.indexOf(d.stack)===-1||a===void 0&&d.stack===void 0)&&r.push(d.stack),d.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let t=this.chart.scales,s=this.chart.options.indexAxis;return Object.keys(t).filter(n=>t[n].axis===s).shift()}_getAxis(){let t={},s=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)t[C(this.chart.options.indexAxis==="x"?n.xAxisID:n.yAxisID,s)]=!0;return Object.keys(t)}_getStackIndex(t,s,n){let o=this._getStacks(t,n),a=s!==void 0?o.indexOf(s):-1;return a===-1?o.length-1:a}_getRuler(){let t=this.options,s=this._cachedMeta,n=s.iScale,o=[],a,r;for(a=0,r=s.data.length;a<r;++a)o.push(n.getPixelForValue(this.getParsed(a)[n.axis],a));let l=t.barThickness;return{min:l||Rr(s),pixels:o,start:n._startPixel,end:n._endPixel,stackCount:this._getStackCount(),scale:n,grouped:t.grouped,ratio:l?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){let{_cachedMeta:{vScale:s,_stacked:n,index:o},options:{base:a,minBarLength:r}}=this,l=a||0,c=this.getParsed(t),h=c._custom,d=ts(h),u=c[s.axis],f=0,p=n?this.applyStack(s,c,n):u,g,m;p!==u&&(f=p-u,p=u),d&&(u=h.barStart,p=h.barEnd-h.barStart,u!==0&&nt(u)!==nt(h.barEnd)&&(f=0),f+=u);let b=!O(a)&&!d?a:f,x=s.getPixelForValue(b);if(this.chart.getDataVisibility(t)?g=s.getPixelForValue(f+p):g=x,m=g-x,Math.abs(m)<r){m=zr(m,s,l)*r,u===l&&(x-=m/2);let y=s.getPixelForDecimal(0),M=s.getPixelForDecimal(1),_=Math.min(y,M),v=Math.max(y,M);x=Math.max(Math.min(x,v),_),g=x+m,n&&!d&&(c._stacks[s.axis]._visualValues[o]=s.getValueForPixel(g)-s.getValueForPixel(x))}if(x===s.getPixelForValue(l)){let y=nt(m)*s.getLineWidthForValue(l)/2;x+=y,m-=y}return{size:m,base:x,head:g,center:g+m/2}}_calculateBarIndexPixels(t,s){let n=s.scale,o=this.options,a=o.skipNull,r=C(o.maxBarThickness,1/0),l,c,h=this._getAxisCount();if(s.grouped){let d=a?this._getStackCount(t):s.stackCount,u=o.barThickness==="flex"?Ir(t,s,o,d*h):Er(t,s,o,d*h),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(C(f,this.getFirstScaleIdForIndexAxis())),g=this._getStackIndex(this.index,this._cachedMeta.stack,a?t:void 0)+p;l=u.start+u.chunk*g+u.chunk/2,c=Math.min(r,u.chunk*u.ratio)}else l=n.getPixelForValue(this.getParsed(t)[n.axis],t),c=Math.min(r,s.min*s.ratio);return{base:l-c/2,head:l+c/2,center:l,size:c}}draw(){let t=this._cachedMeta,s=t.vScale,n=t.data,o=n.length,a=0;for(;a<o;++a)this.getParsed(a)[s.axis]!==null&&!n[a].hidden&&n[a].draw(this._ctx)}}return i})(),jr=(()=>{class i extends Dt{static id="bubble";static defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};static overrides={scales:{x:{type:"linear"},y:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,s,n,o){let a=super.parsePrimitiveData(t,s,n,o);for(let r=0;r<a.length;r++)a[r]._custom=this.resolveDataElementOptions(r+n).radius;return a}parseArrayData(t,s,n,o){let a=super.parseArrayData(t,s,n,o);for(let r=0;r<a.length;r++){let l=s[n+r];a[r]._custom=C(l[2],this.resolveDataElementOptions(r+n).radius)}return a}parseObjectData(t,s,n,o){let a=super.parseObjectData(t,s,n,o);for(let r=0;r<a.length;r++){let l=s[n+r];a[r]._custom=C(l&&l.r&&+l.r,this.resolveDataElementOptions(r+n).radius)}return a}getMaxOverflow(){let t=this._cachedMeta.data,s=0;for(let n=t.length-1;n>=0;--n)s=Math.max(s,t[n].size(this.resolveDataElementOptions(n))/2);return s>0&&s}getLabelAndValue(t){let s=this._cachedMeta,n=this.chart.data.labels||[],{xScale:o,yScale:a}=s,r=this.getParsed(t),l=o.getLabelForValue(r.x),c=a.getLabelForValue(r.y),h=r._custom;return{label:n[t]||"",value:"("+l+", "+c+(h?", "+h:"")+")"}}update(t){let s=this._cachedMeta.data;this.updateElements(s,0,s.length,t)}updateElements(t,s,n,o){let a=o==="reset",{iScale:r,vScale:l}=this._cachedMeta,{sharedOptions:c,includeOptions:h}=this._getSharedOptions(s,o),d=r.axis,u=l.axis;for(let f=s;f<s+n;f++){let p=t[f],g=!a&&this.getParsed(f),m={},b=m[d]=a?r.getPixelForDecimal(.5):r.getPixelForValue(g[d]),x=m[u]=a?l.getBasePixel():l.getPixelForValue(g[u]);m.skip=isNaN(b)||isNaN(x),h&&(m.options=c||this.resolveDataElementOptions(f,p.active?"active":o),a&&(m.options.radius=0)),this.updateElement(p,f,m,o)}}resolveDataElementOptions(t,s){let n=this.getParsed(t),o=super.resolveDataElementOptions(t,s);o.$shared&&(o=Object.assign({},o,{$shared:!1}));let a=o.radius;return s!=="active"&&(o.radius=0),o.radius+=C(n&&n._custom,a),o}}return i})();function Yr(i,e,t){let s=1,n=1,o=0,a=0;if(e<B){let r=i,l=r+e,c=Math.cos(r),h=Math.sin(r),d=Math.cos(l),u=Math.sin(l),f=(y,M,_)=>Kt(y,r,l,!0)?1:Math.max(M,M*t,_,_*t),p=(y,M,_)=>Kt(y,r,l,!0)?-1:Math.min(M,M*t,_,_*t),g=f(0,c,d),m=f(W,h,u),b=p(L,c,d),x=p(L+W,h,u);s=(g-b)/2,n=(m-x)/2,o=-(g+b)/2,a=-(m+x)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}var Os=(()=>{class i extends Dt{static id="doughnut";static 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"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let s=t.data;if(s.labels.length&&s.datasets.length){let{labels:{pointStyle:n,color:o}}=t.legend.options;return s.labels.map((a,r)=>{let c=t.getDatasetMeta(0).controller.getStyle(r);return{text:a,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,s,n){n.chart.toggleDataVisibility(s.index),n.chart.update()}}}};constructor(t,s){super(t,s),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,s){let n=this.getDataset().data,o=this._cachedMeta;if(this._parsing===!1)o._parsed=n;else{let a=c=>+n[c];if(A(n[t])){let{key:c="value"}=this._parsing;a=h=>+pt(n[h],c)}let r,l;for(r=t,l=t+s;r<l;++r)o._parsed[r]=a(r)}}_getRotation(){return it(this.options.rotation-90)}_getCircumference(){return it(this.options.circumference)}_getRotationExtents(){let t=B,s=-B;for(let n=0;n<this.chart.data.datasets.length;++n)if(this.chart.isDatasetVisible(n)&&this.chart.getDatasetMeta(n).type===this._type){let o=this.chart.getDatasetMeta(n).controller,a=o._getRotation(),r=o._getCircumference();t=Math.min(t,a),s=Math.max(s,a+r)}return{rotation:t,circumference:s-t}}update(t){let s=this.chart,{chartArea:n}=s,o=this._cachedMeta,a=o.data,r=this.getMaxBorderWidth()+this.getMaxOffset(a)+this.options.spacing,l=Math.max((Math.min(n.width,n.height)-r)/2,0),c=Math.min(sn(this.options.cutout,l),1),h=this._getRingWeight(this.index),{circumference:d,rotation:u}=this._getRotationExtents(),{ratioX:f,ratioY:p,offsetX:g,offsetY:m}=Yr(u,d,c),b=(n.width-r)/f,x=(n.height-r)/p,y=Math.max(Math.min(b,x)/2,0),M=ki(this.options.radius,y),_=Math.max(M*c,0),v=(M-_)/this._getVisibleDatasetWeightTotal();this.offsetX=g*M,this.offsetY=m*M,o.total=this.calculateTotal(),this.outerRadius=M-v*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-v*h,0),this.updateElements(a,0,a.length,t)}_circumference(t,s){let n=this.options,o=this._cachedMeta,a=this._getCircumference();return s&&n.animation.animateRotate||!this.chart.getDataVisibility(t)||o._parsed[t]===null||o.data[t].hidden?0:this.calculateCircumference(o._parsed[t]*a/B)}updateElements(t,s,n,o){let a=o==="reset",r=this.chart,l=r.chartArea,h=r.options.animation,d=(l.left+l.right)/2,u=(l.top+l.bottom)/2,f=a&&h.animateScale,p=f?0:this.innerRadius,g=f?0:this.outerRadius,{sharedOptions:m,includeOptions:b}=this._getSharedOptions(s,o),x=this._getRotation(),y;for(y=0;y<s;++y)x+=this._circumference(y,a);for(y=s;y<s+n;++y){let M=this._circumference(y,a),_=t[y],v={x:d+this.offsetX,y:u+this.offsetY,startAngle:x,endAngle:x+M,circumference:M,outerRadius:g,innerRadius:p};b&&(v.options=m||this.resolveDataElementOptions(y,_.active?"active":o)),x+=M,this.updateElement(_,y,v,o)}}calculateTotal(){let t=this._cachedMeta,s=t.data,n=0,o;for(o=0;o<s.length;o++){let a=t._parsed[o];a!==null&&!isNaN(a)&&this.chart.getDataVisibility(o)&&!s[o].hidden&&(n+=Math.abs(a))}return n}calculateCircumference(t){let s=this._cachedMeta.total;return s>0&&!isNaN(t)?B*(Math.abs(t)/s):0}getLabelAndValue(t){let s=this._cachedMeta,n=this.chart,o=n.data.labels||[],a=qt(s._parsed[t],n.options.locale);return{label:o[t]||"",value:a}}getMaxBorderWidth(t){let s=0,n=this.chart,o,a,r,l,c;if(!t){for(o=0,a=n.data.datasets.length;o<a;++o)if(n.isDatasetVisible(o)){r=n.getDatasetMeta(o),t=r.data,l=r.controller;break}}if(!t)return 0;for(o=0,a=t.length;o<a;++o)c=l.resolveDataElementOptions(o),c.borderAlign!=="inner"&&(s=Math.max(s,c.borderWidth||0,c.hoverBorderWidth||0));return s}getMaxOffset(t){let s=0;for(let n=0,o=t.length;n<o;++n){let a=this.resolveDataElementOptions(n);s=Math.max(s,a.offset||0,a.hoverOffset||0)}return s}_getRingWeightOffset(t){let s=0;for(let n=0;n<t;++n)this.chart.isDatasetVisible(n)&&(s+=this._getRingWeight(n));return s}_getRingWeight(t){return Math.max(C(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}return i})(),$r=(()=>{class i extends Dt{static id="line";static defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};static overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){let s=this._cachedMeta,{dataset:n,data:o=[],_dataset:a}=s,r=this.chart._animationsDisabled,{start:l,count:c}=Ri(s,o,r);this._drawStart=l,this._drawCount=c,Ei(s)&&(l=0,c=o.length),n._chart=this.chart,n._datasetIndex=this.index,n._decimated=!!a._decimated,n.points=o;let h=this.resolveDatasetElementOptions(t);this.options.showLine||(h.borderWidth=0),h.segment=this.options.segment,this.updateElement(n,void 0,{animated:!r,options:h},t),this.updateElements(o,l,c,t)}updateElements(t,s,n,o){let a=o==="reset",{iScale:r,vScale:l,_stacked:c,_dataset:h}=this._cachedMeta,{sharedOptions:d,includeOptions:u}=this._getSharedOptions(s,o),f=r.axis,p=l.axis,{spanGaps:g,segment:m}=this.options,b=Et(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||a||o==="none",y=s+n,M=t.length,_=s>0&&this.getParsed(s-1);for(let v=0;v<M;++v){let S=t[v],k=x?S:{};if(v<s||v>=y){k.skip=!0;continue}let w=this.getParsed(v),D=O(w[p]),P=k[f]=r.getPixelForValue(w[f],v),T=k[p]=a||D?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,w,c):w[p],v);k.skip=isNaN(P)||isNaN(T)||D,k.stop=v>0&&Math.abs(w[f]-_[f])>b,m&&(k.parsed=w,k.raw=h.data[v]),u&&(k.options=d||this.resolveDataElementOptions(v,S.active?"active":o)),x||this.updateElement(S,v,k,o),_=w}}getMaxOverflow(){let t=this._cachedMeta,s=t.dataset,n=s.options&&s.options.borderWidth||0,o=t.data||[];if(!o.length)return n;let a=o[0].size(this.resolveDataElementOptions(0)),r=o[o.length-1].size(this.resolveDataElementOptions(o.length-1));return Math.max(n,a,r)/2}draw(){let t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}return i})(),Eo=(()=>{class i extends Dt{static id="polarArea";static defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let s=t.data;if(s.labels.length&&s.datasets.length){let{labels:{pointStyle:n,color:o}}=t.legend.options;return s.labels.map((a,r)=>{let c=t.getDatasetMeta(0).controller.getStyle(r);return{text:a,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:o,lineWidth:c.borderWidth,pointStyle:n,hidden:!t.getDataVisibility(r),index:r}})}return[]}},onClick(t,s,n){n.chart.toggleDataVisibility(s.index),n.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,s){super(t,s),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let s=this._cachedMeta,n=this.chart,o=n.data.labels||[],a=qt(s._parsed[t].r,n.options.locale);return{label:o[t]||"",value:a}}parseObjectData(t,s,n,o){return ji.bind(this)(t,s,n,o)}update(t){let s=this._cachedMeta.data;this._updateRadius(),this.updateElements(s,0,s.length,t)}getMinMax(){let t=this._cachedMeta,s={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((n,o)=>{let a=this.getParsed(o).r;!isNaN(a)&&this.chart.getDataVisibility(o)&&(a<s.min&&(s.min=a),a>s.max&&(s.max=a))}),s}_updateRadius(){let t=this.chart,s=t.chartArea,n=t.options,o=Math.min(s.right-s.left,s.bottom-s.top),a=Math.max(o/2,0),r=Math.max(n.cutoutPercentage?a/100*n.cutoutPercentage:1,0),l=(a-r)/t.getVisibleDatasetCount();this.outerRadius=a-l*this.index,this.innerRadius=this.outerRadius-l}updateElements(t,s,n,o){let a=o==="reset",r=this.chart,c=r.options.animation,h=this._cachedMeta.rScale,d=h.xCenter,u=h.yCenter,f=h.getIndexAngle(0)-.5*L,p=f,g,m=360/this.countVisibleElements();for(g=0;g<s;++g)p+=this._computeAngle(g,o,m);for(g=s;g<s+n;g++){let b=t[g],x=p,y=p+this._computeAngle(g,o,m),M=r.getDataVisibility(g)?h.getDistanceFromCenterForValue(this.getParsed(g).r):0;p=y,a&&(c.animateScale&&(M=0),c.animateRotate&&(x=y=f));let _={x:d,y:u,innerRadius:0,outerRadius:M,startAngle:x,endAngle:y,options:this.resolveDataElementOptions(g,b.active?"active":o)};this.updateElement(b,g,_,o)}}countVisibleElements(){let t=this._cachedMeta,s=0;return t.data.forEach((n,o)=>{!isNaN(this.getParsed(o).r)&&this.chart.getDataVisibility(o)&&s++}),s}_computeAngle(t,s,n){return this.chart.getDataVisibility(t)?it(this.resolveDataElementOptions(t,s).angle||n):0}}return i})(),Ur=(()=>{class i extends Os{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}}return i})(),Xr=(()=>{class i extends Dt{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(t){let s=this._cachedMeta.vScale,n=this.getParsed(t);return{label:s.getLabels()[t],value:""+s.getLabelForValue(n[s.axis])}}parseObjectData(t,s,n,o){return ji.bind(this)(t,s,n,o)}update(t){let s=this._cachedMeta,n=s.dataset,o=s.data||[],a=s.iScale.getLabels();if(n.points=o,t!=="resize"){let r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);let l={_loop:!0,_fullLoop:a.length===o.length,options:r};this.updateElement(n,void 0,l,t)}this.updateElements(o,0,o.length,t)}updateElements(t,s,n,o){let a=this._cachedMeta.rScale,r=o==="reset";for(let l=s;l<s+n;l++){let c=t[l],h=this.resolveDataElementOptions(l,c.active?"active":o),d=a.getPointPositionForValue(l,this.getParsed(l).r),u=r?a.xCenter:d.x,f=r?a.yCenter:d.y,p={x:u,y:f,angle:d.angle,skip:isNaN(u)||isNaN(f),options:h};this.updateElement(c,l,p,o)}}}return i})(),Kr=(()=>{class i extends Dt{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){let s=this._cachedMeta,n=this.chart.data.labels||[],{xScale:o,yScale:a}=s,r=this.getParsed(t),l=o.getLabelForValue(r.x),c=a.getLabelForValue(r.y);return{label:n[t]||"",value:"("+l+", "+c+")"}}update(t){let s=this._cachedMeta,{data:n=[]}=s,o=this.chart._animationsDisabled,{start:a,count:r}=Ri(s,n,o);if(this._drawStart=a,this._drawCount=r,Ei(s)&&(a=0,r=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:l,_dataset:c}=s;l._chart=this.chart,l._datasetIndex=this.index,l._decimated=!!c._decimated,l.points=n;let h=this.resolveDatasetElementOptions(t);h.segment=this.options.segment,this.updateElement(l,void 0,{animated:!o,options:h},t)}else this.datasetElementType&&(delete s.dataset,this.datasetElementType=!1);this.updateElements(n,a,r,t)}addElements(){let{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,s,n,o){let a=o==="reset",{iScale:r,vScale:l,_stacked:c,_dataset:h}=this._cachedMeta,d=this.resolveDataElementOptions(s,o),u=this.getSharedOptions(d),f=this.includeOptions(o,u),p=r.axis,g=l.axis,{spanGaps:m,segment:b}=this.options,x=Et(m)?m:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||a||o==="none",M=s>0&&this.getParsed(s-1);for(let _=s;_<s+n;++_){let v=t[_],S=this.getParsed(_),k=y?v:{},w=O(S[g]),D=k[p]=r.getPixelForValue(S[p],_),P=k[g]=a||w?l.getBasePixel():l.getPixelForValue(c?this.applyStack(l,S,c):S[g],_);k.skip=isNaN(D)||isNaN(P)||w,k.stop=_>0&&Math.abs(S[p]-M[p])>x,b&&(k.parsed=S,k.raw=h.data[_]),f&&(k.options=u||this.resolveDataElementOptions(_,v.active?"active":o)),y||this.updateElement(v,_,k,o),M=S}this.updateSharedOptions(u,o,d)}getMaxOverflow(){let t=this._cachedMeta,s=t.data||[];if(!this.options.showLine){let l=0;for(let c=s.length-1;c>=0;--c)l=Math.max(l,s[c].size(this.resolveDataElementOptions(c))/2);return l>0&&l}let n=t.dataset,o=n.options&&n.options.borderWidth||0;if(!s.length)return o;let a=s[0].size(this.resolveDataElementOptions(0)),r=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(o,a,r)/2}}return i})(),qr=Object.freeze({__proto__:null,BarController:Hr,BubbleController:jr,DoughnutController:Os,LineController:$r,PieController:Ur,PolarAreaController:Eo,RadarController:Xr,ScatterController:Kr});function Ft(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}var hs=class i{static override(e){Object.assign(i.prototype,e)}options;constructor(e){this.options=e||{}}init(){}formats(){return Ft()}parse(){return Ft()}format(){return Ft()}add(){return Ft()}diff(){return Ft()}startOf(){return Ft()}endOf(){return Ft()}},Gr={_date:hs};function Zr(i,e,t,s){let{controller:n,data:o,_sorted:a}=i,r=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(r&&e===r.axis&&e!=="r"&&a&&o.length){let c=r._reversePixels?cn:at;if(s){if(n._sharedOptions){let h=o[0],d=typeof h.getRange=="function"&&h.getRange(e);if(d){let u=c(o,e,t-d),f=c(o,e,t+d);return{lo:u.lo,hi:f.hi}}}}else{let h=c(o,e,t);if(l){let{vScale:d}=n._cachedMeta,{_parsed:u}=i,f=u.slice(0,h.lo+1).reverse().findIndex(g=>!O(g[d.axis]));h.lo-=Math.max(0,f);let p=u.slice(h.hi).findIndex(g=>!O(g[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function ke(i,e,t,s,n){let o=i.getSortedVisibleDatasetMetas(),a=t[e];for(let r=0,l=o.length;r<l;++r){let{index:c,data:h}=o[r],{lo:d,hi:u}=Zr(o[r],e,a,n);for(let f=d;f<=u;++f){let p=h[f];p.skip||s(p,c,f)}}}function Jr(i){let e=i.indexOf("x")!==-1,t=i.indexOf("y")!==-1;return function(s,n){let o=e?Math.abs(s.x-n.x):0,a=t?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(a,2))}}function es(i,e,t,s,n){let o=[];return!n&&!i.isPointInArea(e)||ke(i,t,e,function(r,l,c){!n&&!rt(r,i.chartArea,0)||r.inRange(e.x,e.y,s)&&o.push({element:r,datasetIndex:l,index:c})},!0),o}function Qr(i,e,t,s){let n=[];function o(a,r,l){let{startAngle:c,endAngle:h}=a.getProps(["startAngle","endAngle"],s),{angle:d}=Di(a,{x:e.x,y:e.y});Kt(d,c,h)&&n.push({element:a,datasetIndex:r,index:l})}return ke(i,t,e,o),n}function tl(i,e,t,s,n,o){let a=[],r=Jr(t),l=Number.POSITIVE_INFINITY;function c(h,d,u){let f=h.inRange(e.x,e.y,n);if(s&&!f)return;let p=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(p))&&!f)return;let m=r(e,p);m<l?(a=[{element:h,datasetIndex:d,index:u}],l=m):m===l&&a.push({element:h,datasetIndex:d,index:u})}return ke(i,t,e,c),a}function is(i,e,t,s,n,o){return!o&&!i.isPointInArea(e)?[]:t==="r"&&!s?Qr(i,e,t,n):tl(i,e,t,s,n,o)}function Nn(i,e,t,s,n){let o=[],a=t==="x"?"inXRange":"inYRange",r=!1;return ke(i,t,e,(l,c,h)=>{l[a]&&l[a](e[t],n)&&(o.push({element:l,datasetIndex:c,index:h}),r=r||l.inRange(e.x,e.y,n))}),s&&!r?[]:o}var el={evaluateInteractionItems:ke,modes:{index(i,e,t,s){let n=Ct(e,i),o=t.axis||"x",a=t.includeInvisible||!1,r=t.intersect?es(i,n,o,s,a):is(i,n,o,!1,s,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{let h=r[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,e,t,s){let n=Ct(e,i),o=t.axis||"xy",a=t.includeInvisible||!1,r=t.intersect?es(i,n,o,s,a):is(i,n,o,!1,s,a);if(r.length>0){let 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,e,t,s){let n=Ct(e,i),o=t.axis||"xy",a=t.includeInvisible||!1;return es(i,n,o,s,a)},nearest(i,e,t,s){let n=Ct(e,i),o=t.axis||"xy",a=t.includeInvisible||!1;return is(i,n,o,t.intersect,s,a)},x(i,e,t,s){let n=Ct(e,i);return Nn(i,n,"x",t.intersect,s)},y(i,e,t,s){let n=Ct(e,i);return Nn(i,n,"y",t.intersect,s)}}},Io=["left","top","right","bottom"];function ge(i,e){return i.filter(t=>t.pos===e)}function Wn(i,e){return i.filter(t=>Io.indexOf(t.pos)===-1&&t.box.axis===e)}function pe(i,e){return i.sort((t,s)=>{let n=e?s:t,o=e?t:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function il(i){let e=[],t,s,n,o,a,r;for(t=0,s=(i||[]).length;t<s;++t)n=i[t],{position:o,options:{stack:a,stackWeight:r=1}}=n,e.push({index:t,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:a&&o+a,stackWeight:r});return e}function sl(i){let e={};for(let t of i){let{stack:s,pos:n,stackWeight:o}=t;if(!s||!Io.includes(n))continue;let a=e[s]||(e[s]={count:0,placed:0,weight:0,size:0});a.count++,a.weight+=o}return e}function nl(i,e){let t=sl(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e,o,a,r;for(o=0,a=i.length;o<a;++o){r=i[o];let{fullSize:l}=r.box,c=t[r.stack],h=c&&r.stackWeight/c.weight;r.horizontal?(r.width=h?h*s:l&&e.availableWidth,r.height=n):(r.width=s,r.height=h?h*n:l&&e.availableHeight)}return t}function ol(i){let e=il(i),t=pe(e.filter(c=>c.box.fullSize),!0),s=pe(ge(e,"left"),!0),n=pe(ge(e,"right")),o=pe(ge(e,"top"),!0),a=pe(ge(e,"bottom")),r=Wn(e,"x"),l=Wn(e,"y");return{fullSize:t,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:ge(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}function Hn(i,e,t,s){return Math.max(i[t],e[t])+Math.max(i[s],e[s])}function Fo(i,e){i.top=Math.max(i.top,e.top),i.left=Math.max(i.left,e.left),i.bottom=Math.max(i.bottom,e.bottom),i.right=Math.max(i.right,e.right)}function al(i,e,t,s){let{pos:n,box:o}=t,a=i.maxPadding;if(!A(n)){t.size&&(i[n]-=t.size);let d=s[t.stack]||{size:0,count:1};d.size=Math.max(d.size,t.horizontal?o.height:o.width),t.size=d.size/d.count,i[n]+=t.size}o.getPadding&&Fo(a,o.getPadding());let r=Math.max(0,e.outerWidth-Hn(a,i,"left","right")),l=Math.max(0,e.outerHeight-Hn(a,i,"top","bottom")),c=r!==i.w,h=l!==i.h;return i.w=r,i.h=l,t.horizontal?{same:c,other:h}:{same:h,other:c}}function rl(i){let e=i.maxPadding;function t(s){let n=Math.max(e[s]-i[s],0);return i[s]+=n,n}i.y+=t("top"),i.x+=t("left"),t("right"),t("bottom")}function ll(i,e){let t=e.maxPadding;function s(n){let o={left:0,top:0,right:0,bottom:0};return n.forEach(a=>{o[a]=Math.max(e[a],t[a])}),o}return s(i?["left","right"]:["top","bottom"])}function xe(i,e,t,s){let n=[],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||e.w,r.height||e.h,ll(r.horizontal,e));let{same:d,other:u}=al(e,t,r,s);c|=d&&n.length,h=h||u,l.fullSize||n.push(r)}return c&&xe(n,e,t,s)||h}function qe(i,e,t,s,n){i.top=t,i.left=e,i.right=e+s,i.bottom=t+n,i.width=s,i.height=n}function jn(i,e,t,s){let n=t.padding,{x:o,y:a}=e;for(let r of i){let l=r.box,c=s[r.stack]||{count:1,placed:0,weight:1},h=r.stackWeight/c.weight||1;if(r.horizontal){let d=e.w*h,u=c.size||l.height;Ut(c.start)&&(a=c.start),l.fullSize?qe(l,n.left,a,t.outerWidth-n.right-n.left,u):qe(l,e.left+c.placed,a,d,u),c.start=a,c.placed+=d,a=l.bottom}else{let d=e.h*h,u=c.size||l.width;Ut(c.start)&&(o=c.start),l.fullSize?qe(l,o,n.top,u,t.outerHeight-n.bottom-n.top):qe(l,o,e.top+c.placed,u,d),c.start=o,c.placed+=d,o=l.right}}e.x=o,e.y=a}var G={addBox(i,e){i.boxes||(i.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},i.boxes.push(e)},removeBox(i,e){let t=i.boxes?i.boxes.indexOf(e):-1;t!==-1&&i.boxes.splice(t,1)},configure(i,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(i,e,t,s){if(!i)return;let n=K(i.options.layout.padding),o=Math.max(e-n.width,0),a=Math.max(t-n.height,0),r=ol(i.boxes),l=r.vertical,c=r.horizontal;R(i.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});let h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:e,outerHeight:t,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/h,hBoxMaxHeight:a/2}),u=Object.assign({},n);Fo(u,K(s));let f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),p=nl(l.concat(c),d);xe(r.fullSize,f,d,p),xe(l,f,d,p),xe(c,f,d,p)&&xe(l,f,d,p),rl(f),jn(r.leftAndTop,f,d,p),f.x+=f.w,f.y+=f.h,jn(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},R(r.chartArea,g=>{let m=g.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}},ni=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,s){}removeEventListener(e,t,s){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,s,n){return t=Math.max(0,t||e.width),s=s||e.height,{width:t,height:Math.max(0,n?Math.floor(t/n):s)}}isAttached(e){return!0}updateConfig(e){}},ds=class extends ni{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}},ei="$chartjs",cl={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Yn=i=>i===null||i==="";function hl(i,e){let t=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[ei]={initial:{height:s,width:n,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Yn(n)){let o=$i(i,"width");o!==void 0&&(i.width=o)}if(Yn(s))if(i.style.height==="")i.height=i.width/(e||2);else{let o=$i(i,"height");o!==void 0&&(i.height=o)}return i}var zo=Cn?{passive:!0}:!1;function dl(i,e,t){i&&i.addEventListener(e,t,zo)}function ul(i,e,t){i&&i.canvas&&i.canvas.removeEventListener(e,t,zo)}function fl(i,e){let t=cl[i.type]||i.type,{x:s,y:n}=Ct(i,e);return{type:t,chart:e,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function oi(i,e){for(let t of i)if(t===e||t.contains(e))return!0}function gl(i,e,t){let s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||oi(r.addedNodes,s),a=a&&!oi(r.removedNodes,s);a&&t()});return n.observe(document,{childList:!0,subtree:!0}),n}function pl(i,e,t){let s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||oi(r.removedNodes,s),a=a&&!oi(r.addedNodes,s);a&&t()});return n.observe(document,{childList:!0,subtree:!0}),n}var ye=new Map,$n=0;function Bo(){let i=window.devicePixelRatio;i!==$n&&($n=i,ye.forEach((e,t)=>{t.currentDevicePixelRatio!==i&&e()}))}function ml(i,e){ye.size||window.addEventListener("resize",Bo),ye.set(i,e)}function bl(i){ye.delete(i),ye.size||window.removeEventListener("resize",Bo)}function xl(i,e,t){let s=i.canvas,n=s&&Xe(s);if(!n)return;let o=Li((r,l)=>{let c=n.clientWidth;t(r,l),c<n.clientWidth&&t()},window),a=new ResizeObserver(r=>{let l=r[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return a.observe(n),ml(i,o),a}function ss(i,e,t){t&&t.disconnect(),e==="resize"&&bl(i)}function _l(i,e,t){let s=i.canvas,n=Li(o=>{i.ctx!==null&&t(fl(o,i))},i);return dl(s,e,n),n}var us=class extends ni{acquireContext(e,t){let s=e&&e.getContext&&e.getContext("2d");return s&&s.canvas===e?(hl(e,t),s):null}releaseContext(e){let t=e.canvas;if(!t[ei])return!1;let s=t[ei].initial;["height","width"].forEach(o=>{let a=s[o];O(a)?t.removeAttribute(o):t.setAttribute(o,a)});let n=s.style||{};return Object.keys(n).forEach(o=>{t.style[o]=n[o]}),t.width=t.width,delete t[ei],!0}addEventListener(e,t,s){this.removeEventListener(e,t);let n=e.$proxies||(e.$proxies={}),a={attach:gl,detach:pl,resize:xl}[t]||_l;n[t]=a(e,t,s)}removeEventListener(e,t){let s=e.$proxies||(e.$proxies={}),n=s[t];if(!n)return;({attach:ss,detach:ss,resize:ss}[t]||ul)(e,t,n),s[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,s,n){return wn(e,t,s,n)}isAttached(e){let t=e&&Xe(e);return!!(t&&t.isConnected)}};function yl(i){return!Ue()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?ds:us}var ot=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:s}=this.getProps(["x","y"],e);return{x:t,y:s}}hasValue(){return Et(this.x)&&Et(this.y)}getProps(e,t){let s=this.$animations;if(!t||!s)return this;let n={};return e.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}};function vl(i,e){let t=i.options.ticks,s=Ml(i),n=Math.min(t.maxTicksLimit||s,s),o=t.major.enabled?Sl(e):[],a=o.length,r=o[0],l=o[a-1],c=[];if(a>n)return wl(e,c,o,a/n),c;let h=kl(o,e,n);if(a>0){let d,u,f=a>1?Math.round((l-r)/(a-1)):null;for(Ge(e,c,h,O(f)?0:r-f,r),d=0,u=a-1;d<u;d++)Ge(e,c,h,o[d],o[d+1]);return Ge(e,c,h,l,O(f)?e.length:l+f),c}return Ge(e,c,h),c}function Ml(i){let e=i.options.offset,t=i._tickSize(),s=i._length/t+(e?0:1),n=i._maxLength/t;return Math.floor(Math.min(s,n))}function kl(i,e,t){let s=Cl(i),n=e.length/t;if(!s)return Math.max(n,1);let o=an(s);for(let a=0,r=o.length-1;a<r;a++){let l=o[a];if(l>n)return l}return Math.max(n,1)}function Sl(i){let e=[],t,s;for(t=0,s=i.length;t<s;t++)i[t].major&&e.push(t);return e}function wl(i,e,t,s){let n=0,o=t[0],a;for(s=Math.ceil(s),a=0;a<i.length;a++)a===o&&(e.push(i[a]),n++,o=t[n*s])}function Ge(i,e,t,s,n){let o=C(s,0),a=Math.min(C(n,i.length),i.length),r=0,l,c,h;for(t=Math.ceil(t),n&&(l=n-s,t=l/Math.floor(l/t)),h=o;h<0;)r++,h=Math.round(o+r*t);for(c=Math.max(o,0);c<a;c++)c===h&&(e.push(i[c]),r++,h=Math.round(o+r*t))}function Cl(i){let e=i.length,t,s;if(e<2)return!1;for(s=i[0],t=1;t<e;++t)if(i[t]-i[t-1]!==s)return!1;return s}var Pl=i=>i==="left"?"right":i==="right"?"left":i,Un=(i,e,t)=>e==="top"||e==="left"?i[e]+t:i[e]-t,Xn=(i,e)=>Math.min(e||i,i);function Kn(i,e){let t=[],s=i.length/e,n=i.length,o=0;for(;o<n;o+=s)t.push(i[Math.floor(o)]);return t}function Dl(i,e,t){let s=i.ticks.length,n=Math.min(e,s-1),o=i._startPixel,a=i._endPixel,r=1e-6,l=i.getPixelForTick(n),c;if(!(t&&(s===1?c=Math.max(l-o,a-l):e===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<e?c:-c,l<o-r||l>a+r)))return l}function Ol(i,e){R(i,t=>{let s=t.gc,n=s.length/2,o;if(n>e){for(o=0;o<n;++o)delete t.data[s[o]];s.splice(0,n)}})}function me(i){return i.drawTicks?i.tickLength:0}function qn(i,e){if(!i.display)return 0;let t=j(i.font,e),s=K(i.padding);return(z(i.text)?i.text.length:1)*t.lineHeight+s.height}function Al(i,e){return mt(i,{scale:e,type:"scale"})}function Tl(i,e,t){return mt(i,{tick:t,index:e,type:"tick"})}function Ll(i,e,t){let s=We(i);return(t&&e!=="right"||!t&&e==="right")&&(s=Pl(s)),s}function Rl(i,e,t,s){let{top:n,left:o,bottom:a,right:r,chart:l}=i,{chartArea:c,scales:h}=l,d=0,u,f,p,g=a-n,m=r-o;if(i.isHorizontal()){if(f=X(s,o,r),A(t)){let b=Object.keys(t)[0],x=t[b];p=h[b].getPixelForValue(x)+g-e}else t==="center"?p=(c.bottom+c.top)/2+g-e:p=Un(i,t,e);u=r-o}else{if(A(t)){let b=Object.keys(t)[0],x=t[b];f=h[b].getPixelForValue(x)-m+e}else t==="center"?f=(c.left+c.right)/2-m+e:f=Un(i,t,e);p=X(s,a,n),d=t==="left"?-W:W}return{titleX:f,titleY:p,maxWidth:u,rotation:d}}var Bt=class i extends ot{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.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(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:s,_suggestedMax:n}=this;return e=Z(e,Number.POSITIVE_INFINITY),t=Z(t,Number.NEGATIVE_INFINITY),s=Z(s,Number.POSITIVE_INFINITY),n=Z(n,Number.NEGATIVE_INFINITY),{min:Z(e,s),max:Z(t,n),minDefined:N(e),maxDefined:N(t)}}getMinMax(e){let{min:t,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),a;if(n&&o)return{min:t,max:s};let r=this.getMatchingVisibleMetas();for(let l=0,c=r.length;l<c;++l)a=r[l].controller.getMinMax(this,e),n||(t=Math.min(t,a.min)),o||(s=Math.max(s,a.max));return t=o&&t>s?s:t,s=n&&t>s?t:s,{min:Z(t,Z(s,t)),max:Z(s,Z(t,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){I(this.options.beforeUpdate,[this])}update(e,t,s){let{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,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=_n(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=r<this.ticks.length;this._convertTicksToLabels(l?Kn(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),a.display&&(a.autoSkip||a.source==="auto")&&(this.ticks=vl(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,s;this.isHorizontal()?(t=this.left,s=this.right):(t=this.top,s=this.bottom,e=!e),this._startPixel=t,this._endPixel=s,this._reversePixels=e,this._length=s-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){I(this.options.afterUpdate,[this])}beforeSetDimensions(){I(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(){I(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),I(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){I(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){let t=this.options.ticks,s,n,o;for(s=0,n=e.length;s<n;s++)o=e[s],o.label=I(t.callback,[o.value,s,e],this)}afterTickToLabelConversion(){I(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){I(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){let e=this.options,t=e.ticks,s=Xn(this.ticks.length,e.ticks.maxTicksLimit),n=t.minRotation||0,o=t.maxRotation,a=n,r,l,c;if(!this._isVisible()||!t.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}let h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=Y(this.chart.width-d,0,this.maxWidth);r=e.offset?this.maxWidth/s:f/(s-1),d+6>r&&(r=f/(s-(e.offset?.5:1)),l=this.maxHeight-me(e.grid)-t.padding-qn(e.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),a=Ve(Math.min(Math.asin(Y((h.highest.height+6)/r,-1,1)),Math.asin(Y(l/c,-1,1))-Math.asin(Y(u/c,-1,1)))),a=Math.max(n,Math.min(o,a))),this.labelRotation=a}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:s,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){let l=qn(n,t.options.font);if(r?(e.width=this.maxWidth,e.height=me(o)+l):(e.height=this.maxHeight,e.width=me(o)+l),s.display&&this.ticks.length){let{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,p=it(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(r){let b=s.mirror?0:m*d.width+g*u.height;e.height=Math.min(this.maxHeight,e.height+b+f)}else{let b=s.mirror?0:g*d.width+m*u.height;e.width=Math.min(this.maxWidth,e.width+b+f)}this._calculatePadding(c,h,m,g)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,s,n){let{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,c=r!=="top"&&this.axis==="x";if(this.isHorizontal()){let h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1),u=0,f=0;l?c?(u=n*e.width,f=s*t.height):(u=s*e.height,f=n*t.width):o==="start"?f=t.width:o==="end"?u=e.width:o!=="inner"&&(u=e.width/2,f=t.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=t.height/2,d=e.height/2;o==="start"?(h=0,d=e.height):o==="end"&&(h=t.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(){I(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,s;for(t=0,s=e.length;t<s;t++)O(e[t].label)&&(e.splice(t,1),s--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){let t=this.options.ticks.sampleSize,s=this.ticks;t<s.length&&(s=Kn(s,t)),this._labelSizes=e=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,s){let{ctx:n,_longestTextCache:o}=this,a=[],r=[],l=Math.floor(t/Xn(t,s)),c=0,h=0,d,u,f,p,g,m,b,x,y,M,_;for(d=0;d<t;d+=l){if(p=e[d].label,g=this._resolveTickFontOptions(d),n.font=m=g.string,b=o[m]=o[m]||{data:{},gc:[]},x=g.lineHeight,y=M=0,!O(p)&&!z(p))y=le(n,b.data,b.gc,y,p),M=x;else if(z(p))for(u=0,f=p.length;u<f;++u)_=p[u],!O(_)&&!z(_)&&(y=le(n,b.data,b.gc,y,_),M+=x);a.push(y),r.push(M),c=Math.max(y,c),h=Math.max(M,h)}Ol(o,t);let v=a.indexOf(c),S=r.indexOf(h),k=w=>({width:a[w]||0,height:r[w]||0});return{first:k(0),last:k(t-1),widest:k(v),highest:k(S),widths:a,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return ln(this._alignToPixels?kt(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&e<t.length){let s=t[e];return s.$context||(s.$context=Tl(this.getContext(),e,s))}return this.$context||(this.$context=Al(this.chart.getContext(),this))}_tickSize(){let e=this.options.ticks,t=it(this.labelRotation),s=Math.abs(Math.cos(t)),n=Math.abs(Math.sin(t)),o=this._getLabelSizes(),a=e.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(){let e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){let t=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=me(o),f=[],p=r.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(V){return kt(s,V,g)},x,y,M,_,v,S,k,w,D,P,T,$;if(a==="top")x=b(this.bottom),S=this.bottom-u,w=x-m,P=b(e.top)+m,$=e.bottom;else if(a==="bottom")x=b(this.top),P=e.top,$=b(e.bottom)-m,S=x+m,w=this.top+u;else if(a==="left")x=b(this.right),v=this.right-u,k=x-m,D=b(e.left)+m,T=e.right;else if(a==="right")x=b(this.left),D=e.left,T=b(e.right)-m,v=x+m,k=this.left+u;else if(t==="x"){if(a==="center")x=b((e.top+e.bottom)/2+.5);else if(A(a)){let V=Object.keys(a)[0],H=a[V];x=b(this.chart.scales[V].getPixelForValue(H))}P=e.top,$=e.bottom,S=x+m,w=S+u}else if(t==="y"){if(a==="center")x=b((e.left+e.right)/2);else if(A(a)){let V=Object.keys(a)[0],H=a[V];x=b(this.chart.scales[V].getPixelForValue(H))}v=x-m,k=v-u,D=e.left,T=e.right}let tt=C(n.ticks.maxTicksLimit,d),E=Math.max(1,Math.ceil(d/tt));for(y=0;y<d;y+=E){let V=this.getContext(y),H=o.setContext(V),st=r.setContext(V),q=H.lineWidth,Vt=H.color,Se=st.dash||[],Nt=st.dashOffset,ee=H.tickWidth,Ot=H.tickColor,ie=H.tickBorderDash||[],At=H.tickBorderDashOffset;M=Dl(this,y,l),M!==void 0&&(_=kt(s,M,q),c?v=k=D=T=_:S=w=P=$=_,f.push({tx1:v,ty1:S,tx2:k,ty2:w,x1:D,y1:P,x2:T,y2:$,width:q,color:Vt,borderDash:Se,borderDashOffset:Nt,tickWidth:ee,tickColor:Ot,tickBorderDash:ie,tickBorderDashOffset:At}))}return this._ticksLength=d,this._borderValue=x,f}_computeLabelItems(e){let t=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=me(s.grid),f=u+h,p=d?-h:f,g=-it(this.labelRotation),m=[],b,x,y,M,_,v,S,k,w,D,P,T,$="middle";if(n==="top")v=this.bottom-p,S=this._getXAxisLabelAlignment();else if(n==="bottom")v=this.top+p,S=this._getXAxisLabelAlignment();else if(n==="left"){let E=this._getYAxisLabelAlignment(u);S=E.textAlign,_=E.x}else if(n==="right"){let E=this._getYAxisLabelAlignment(u);S=E.textAlign,_=E.x}else if(t==="x"){if(n==="center")v=(e.top+e.bottom)/2+f;else if(A(n)){let E=Object.keys(n)[0],V=n[E];v=this.chart.scales[E].getPixelForValue(V)+f}S=this._getXAxisLabelAlignment()}else if(t==="y"){if(n==="center")_=(e.left+e.right)/2-f;else if(A(n)){let E=Object.keys(n)[0],V=n[E];_=this.chart.scales[E].getPixelForValue(V)}S=this._getYAxisLabelAlignment(u).textAlign}t==="y"&&(l==="start"?$="top":l==="end"&&($="bottom"));let tt=this._getLabelSizes();for(b=0,x=r.length;b<x;++b){y=r[b],M=y.label;let E=o.setContext(this.getContext(b));k=this.getPixelForTick(b)+o.labelOffset,w=this._resolveTickFontOptions(b),D=w.lineHeight,P=z(M)?M.length:1;let V=P/2,H=E.color,st=E.textStrokeColor,q=E.textStrokeWidth,Vt=S;a?(_=k,S==="inner"&&(b===x-1?Vt=this.options.reverse?"left":"right":b===0?Vt=this.options.reverse?"right":"left":Vt="center"),n==="top"?c==="near"||g!==0?T=-P*D+D/2:c==="center"?T=-tt.highest.height/2-V*D+D:T=-tt.highest.height+D/2:c==="near"||g!==0?T=D/2:c==="center"?T=tt.highest.height/2-V*D:T=tt.highest.height-P*D,d&&(T*=-1),g!==0&&!E.showLabelBackdrop&&(_+=D/2*Math.sin(g))):(v=k,T=(1-P)*D/2);let Se;if(E.showLabelBackdrop){let Nt=K(E.backdropPadding),ee=tt.heights[b],Ot=tt.widths[b],ie=T-Nt.top,At=0-Nt.left;switch($){case"middle":ie-=ee/2;break;case"bottom":ie-=ee;break}switch(S){case"center":At-=Ot/2;break;case"right":At-=Ot;break;case"inner":b===x-1?At-=Ot:b>0&&(At-=Ot/2);break}Se={left:At,top:ie,width:Ot+Nt.width,height:ee+Nt.height,color:E.backdropColor}}m.push({label:M,font:w,textOffset:T,options:{rotation:g,color:H,strokeColor:st,strokeWidth:q,textAlign:Vt,textBaseline:$,translation:[_,v],backdrop:Se}})}return m}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-it(this.labelRotation))return e==="top"?"left":"right";let n="center";return t.align==="start"?n="left":t.align==="end"?n="right":t.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,a=this._getLabelSizes(),r=e+o,l=a.widest.width,c,h;return t==="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)):t==="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;let e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:s,top:n,width:o,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(s,n,o,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(o=>o.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e)),o,a,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(t.display)for(o=0,a=n.length;o<a;++o){let l=n[o];t.drawOnChartArea&&r({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),t.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(){let{chart:e,ctx:t,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),a=s.display?o.width:0;if(!a)return;let r=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue,c,h,d,u;this.isHorizontal()?(c=kt(e,this.left,a)-a/2,h=kt(e,this.right,r)+r/2,d=u=l):(d=kt(e,this.top,a)-a/2,u=kt(e,this.bottom,r)+r/2,c=h=l),t.save(),t.lineWidth=o.width,t.strokeStyle=o.color,t.beginPath(),t.moveTo(c,d),t.lineTo(h,u),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;let s=this.ctx,n=this._computeLabelArea();n&&de(s,n);let o=this.getLabelItems(e);for(let a of o){let r=a.options,l=a.font,c=a.label,h=a.textOffset;St(s,c,0,h,l,r)}n&&ue(s)}drawTitle(){let{ctx:e,options:{position:t,title:s,reverse:n}}=this;if(!s.display)return;let o=j(s.font),a=K(s.padding),r=s.align,l=o.lineHeight/2;t==="bottom"||t==="center"||A(t)?(l+=a.bottom,z(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=a.top;let{titleX:c,titleY:h,maxWidth:d,rotation:u}=Rl(this,l,t,r);St(e,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:u,textAlign:Ll(r,t,n),textBaseline:"middle",translation:[c,h]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){let e=this.options,t=e.ticks&&e.ticks.z||0,s=C(e.grid&&e.grid.z,-1),n=C(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==i.prototype.draw?[{z:t,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:t,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[],o,a;for(o=0,a=t.length;o<a;++o){let r=t[o];r[s]===this.id&&(!e||r.type===e)&&n.push(r)}return n}_resolveTickFontOptions(e){let t=this.options.ticks.setContext(this.getContext(e));return j(t.font)}_maxDigits(){let e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}},Qt=class{constructor(e,t,s){this.type=e,this.scope=t,this.override=s,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){let t=Object.getPrototypeOf(e),s;Fl(t)&&(s=this.register(t));let n=this.items,o=e.id,a=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+e);return o in n||(n[o]=e,El(e,a,s),this.override&&F.override(e.id,e.overrides)),a}get(e){return this.items[e]}unregister(e){let t=this.items,s=e.id,n=this.scope;s in t&&delete t[s],n&&s in F[n]&&(delete F[n][s],this.override&&delete Mt[s])}};function El(i,e,t){let s=jt(Object.create(null),[t?F.get(t):{},F.get(e),i.defaults]);F.set(e,s),i.defaultRoutes&&Il(e,i.defaultRoutes),i.descriptors&&F.describe(e,i.descriptors)}function Il(i,e){Object.keys(e).forEach(t=>{let s=t.split("."),n=s.pop(),o=[i].concat(s).join("."),a=e[t].split("."),r=a.pop(),l=a.join(".");F.route(o,n,l,r)})}function Fl(i){return"id"in i&&"defaults"in i}var fs=class{constructor(){this.controllers=new Qt(Dt,"datasets",!0),this.elements=new Qt(ot,"elements"),this.plugins=new Qt(Object,"plugins"),this.scales=new Qt(Bt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,s){[...t].forEach(n=>{let o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(e,o,n):R(n,a=>{let r=s||this._getRegistryForType(a);this._exec(e,r,a)})})}_exec(e,t,s){let n=Be(e);I(s["before"+n],[],s),t[e](s),I(s["after"+n],[],s)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){let s=this._typedRegistries[t];if(s.isForType(e))return s}return this.plugins}_get(e,t,s){let n=t.get(e);if(n===void 0)throw new Error('"'+e+'" is not a registered '+s+".");return n}},dt=new fs,gs=class{constructor(){this._init=[]}notify(e,t,s,n){t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install"));let o=n?this._descriptors(e).filter(n):this._descriptors(e),a=this._notify(o,e,t,s);return t==="afterDestroy"&&(this._notify(o,e,"stop"),this._notify(this._init,e,"uninstall")),a}_notify(e,t,s,n){n=n||{};for(let o of e){let a=o.plugin,r=a[s],l=[t,n,o.options];if(I(r,l,a)===!1&&n.cancelable)return!1}return!0}invalidate(){O(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;let t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){let s=e&&e.config,n=C(s.options&&s.options.plugins,{}),o=zl(s);return n===!1&&!t?[]:Vl(e,o,n,t)}_notifyStateChanges(e){let t=this._oldCache||[],s=this._cache,n=(o,a)=>o.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(n(t,s),e,"stop"),this._notify(n(s,t),e,"start")}};function zl(i){let e={},t=[],s=Object.keys(dt.plugins.items);for(let o=0;o<s.length;o++)t.push(dt.getPlugin(s[o]));let n=i.plugins||[];for(let o=0;o<n.length;o++){let a=n[o];t.indexOf(a)===-1&&(t.push(a),e[a.id]=!0)}return{plugins:t,localIds:e}}function Bl(i,e){return!e&&i===!1?null:i===!0?{}:i}function Vl(i,{plugins:e,localIds:t},s,n){let o=[],a=i.getContext();for(let r of e){let l=r.id,c=Bl(s[l],n);c!==null&&o.push({plugin:r,options:Nl(i.config,{plugin:r,local:t[l]},c,a)})}return o}function Nl(i,{plugin:e,local:t},s,n){let o=i.pluginScopeKeys(e),a=i.getOptionScopes(s,o);return t&&e.defaults&&a.push(e.defaults),i.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ps(i,e){let t=F.datasets[i]||{};return((e.datasets||{})[i]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function Wl(i,e){let t=i;return i==="_index_"?t=e:i==="_value_"&&(t=e==="x"?"y":"x"),t}function Hl(i,e){return i===e?"_index_":"_value_"}function Gn(i){if(i==="x"||i==="y"||i==="r")return i}function jl(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function ms(i,...e){if(Gn(i))return i;for(let t of e){let s=t.axis||jl(t.position)||i.length>1&&Gn(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function Zn(i,e,t){if(t[e+"AxisID"]===i)return{axis:e}}function Yl(i,e){if(e.data&&e.data.datasets){let t=e.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(t.length)return Zn(i,"x",t[0])||Zn(i,"y",t[0])}return{}}function $l(i,e){let t=Mt[i.type]||{scales:{}},s=e.scales||{},n=ps(i.type,e),o=Object.create(null);return Object.keys(s).forEach(a=>{let r=s[a];if(!A(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let l=ms(a,r,Yl(a,i),F.scales[r.type]),c=Hl(l,n),h=t.scales||{};o[a]=$t(Object.create(null),[{axis:l},r,h[l],h[c]])}),i.data.datasets.forEach(a=>{let r=a.type||i.type,l=a.indexAxis||ps(r,e),h=(Mt[r]||{}).scales||{};Object.keys(h).forEach(d=>{let u=Wl(d,l),f=a[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),$t(o[f],[{axis:u},s[f],h[d]])})}),Object.keys(o).forEach(a=>{let r=o[a];$t(r,[F.scales[r.type],F.scale])}),o}function Vo(i){let e=i.options||(i.options={});e.plugins=C(e.plugins,{}),e.scales=$l(i,e)}function No(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Ul(i){return i=i||{},i.data=No(i.data),Vo(i),i}var Jn=new Map,Wo=new Set;function Ze(i,e){let t=Jn.get(i);return t||(t=e(),Jn.set(i,t),Wo.add(t)),t}var be=(i,e,t)=>{let s=pt(e,t);s!==void 0&&i.add(s)},bs=class{constructor(e){this._config=Ul(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=No(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),Vo(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Ze(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Ze(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Ze(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){let t=e.id,s=this.type;return Ze(`${s}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let s=this._scopeCache,n=s.get(e);return(!n||t)&&(n=new Map,s.set(e,n)),n}getOptionScopes(e,t,s){let{options:n,type:o}=this,a=this._cachedScopes(e,s),r=a.get(t);if(r)return r;let l=new Set;t.forEach(h=>{e&&(l.add(e),h.forEach(d=>be(l,e,d))),h.forEach(d=>be(l,n,d)),h.forEach(d=>be(l,Mt[o]||{},d)),h.forEach(d=>be(l,F,d)),h.forEach(d=>be(l,He,d))});let c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Wo.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,Mt[t]||{},F.datasets[t]||{},{type:t},F,He]}resolveNamedOptions(e,t,s,n=[""]){let o={$shared:!0},{resolver:a,subPrefixes:r}=Qn(this._resolverCache,e,n),l=a;if(Kl(a,t)){o.$shared=!1,s=ft(s)?s():s;let c=this.createResolver(e,s,r);l=Rt(a,s,c)}for(let c of t)o[c]=l[c];return o}createResolver(e,t,s=[""],n){let{resolver:o}=Qn(this._resolverCache,e,s);return A(t)?Rt(o,t,void 0,n):o}};function Qn(i,e,t){let s=i.get(e);s||(s=new Map,i.set(e,s));let n=t.join(),o=s.get(n);return o||(o={resolver:$e(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},s.set(n,o)),o}var Xl=i=>A(i)&&Object.getOwnPropertyNames(i).some(e=>ft(i[e]));function Kl(i,e){let{isScriptable:t,isIndexable:s}=Ni(i);for(let n of e){let o=t(n),a=s(n),r=(a||o)&&i[n];if(o&&(ft(r)||Xl(r))||a&&z(r))return!0}return!1}var ql="4.5.0",Gl=["top","bottom","left","right","chartArea"];function to(i,e){return i==="top"||i==="bottom"||Gl.indexOf(i)===-1&&e==="x"}function eo(i,e){return function(t,s){return t[i]===s[i]?t[e]-s[e]:t[i]-s[i]}}function io(i){let e=i.chart,t=e.options.animation;e.notifyPlugins("afterRender"),I(t&&t.onComplete,[i],e)}function Zl(i){let e=i.chart,t=e.options.animation;I(t&&t.onProgress,[i],e)}function Ho(i){return Ue()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}var ii={},so=i=>{let e=Ho(i);return Object.values(ii).filter(t=>t.canvas===e).pop()};function Jl(i,e,t){let s=Object.keys(i);for(let n of s){let o=+n;if(o>=e){let a=i[n];delete i[n],(t>0||o>e)&&(i[o+t]=a)}}}function Ql(i,e,t,s){return!t||i.type==="mouseout"?null:s?e:i}var ci=(()=>{class i{static defaults=F;static instances=ii;static overrides=Mt;static registry=dt;static version=ql;static getChart=so;static register(...t){dt.add(...t),no()}static unregister(...t){dt.remove(...t),no()}constructor(t,s){let n=this.config=new bs(s),o=Ho(t),a=so(o);if(a)throw new Error("Canvas is already in use. Chart with ID '"+a.id+"' must be destroyed before the canvas with ID '"+a.canvas.id+"' can be reused.");let r=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||yl(o)),this.platform.updateConfig(n);let l=this.platform.acquireContext(o,r.aspectRatio),c=l&&l.canvas,h=c&&c.height,d=c&&c.width;if(this.id=en(),this.ctx=l,this.canvas=c,this.width=d,this.height=h,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new gs,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=fn(u=>this.update(u),r.resizeDelay||0),this._dataChanges=[],ii[this.id]=this,!l||!c){console.error("Failed to create chart: can't acquire context from the given item");return}bt.listen(this,"complete",io),bt.listen(this,"progress",Zl),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:s},width:n,height:o,_aspectRatio:a}=this;return O(t)?s&&a?a:o?n/o:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return dt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Yi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return zi(this.canvas,this.ctx),this}stop(){return bt.stop(this),this}resize(t,s){bt.running(this)?this._resizeBeforeDraw={width:t,height:s}:this._resize(t,s)}_resize(t,s){let n=this.options,o=this.canvas,a=n.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(o,t,s,a),l=n.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Yi(this,l,!0)&&(this.notifyPlugins("resize",{size:r}),I(n.onResize,[this,r],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){let s=this.options.scales||{};R(s,(n,o)=>{n.id=o})}buildOrUpdateScales(){let t=this.options,s=t.scales,n=this.scales,o=Object.keys(n).reduce((r,l)=>(r[l]=!1,r),{}),a=[];s&&(a=a.concat(Object.keys(s).map(r=>{let l=s[r],c=ms(r,l),h=c==="r",d=c==="x";return{options:l,dposition:h?"chartArea":d?"bottom":"left",dtype:h?"radialLinear":d?"category":"linear"}}))),R(a,r=>{let l=r.options,c=l.id,h=ms(c,l),d=C(l.type,r.dtype);(l.position===void 0||to(l.position,h)!==to(r.dposition))&&(l.position=r.dposition),o[c]=!0;let u=null;if(c in n&&n[c].type===d)u=n[c];else{let f=dt.getScale(d);u=new f({id:c,type:d,ctx:this.ctx,chart:this}),n[u.id]=u}u.init(l,t)}),R(o,(r,l)=>{r||delete n[l]}),R(n,r=>{G.configure(this,r,r.options),G.addBox(this,r)})}_updateMetasets(){let t=this._metasets,s=this.data.datasets.length,n=t.length;if(t.sort((o,a)=>o.index-a.index),n>s){for(let o=s;o<n;++o)this._destroyDatasetMeta(o);t.splice(s,n-s)}this._sortedMetasets=t.slice(0).sort(eo("order","index"))}_removeUnreferencedMetasets(){let{_metasets:t,data:{datasets:s}}=this;t.length>s.length&&delete this._stacks,t.forEach((n,o)=>{s.filter(a=>a===n._dataset).length===0&&this._destroyDatasetMeta(o)})}buildOrUpdateControllers(){let t=[],s=this.data.datasets,n,o;for(this._removeUnreferencedMetasets(),n=0,o=s.length;n<o;n++){let a=s[n],r=this.getDatasetMeta(n),l=a.type||this.config.type;if(r.type&&r.type!==l&&(this._destroyDatasetMeta(n),r=this.getDatasetMeta(n)),r.type=l,r.indexAxis=a.indexAxis||ps(l,this.options),r.order=a.order||0,r.index=n,r.label=""+a.label,r.visible=this.isDatasetVisible(n),r.controller)r.controller.updateIndex(n),r.controller.linkScales();else{let c=dt.getController(l),{datasetElementType:h,dataElementType:d}=F.datasets[l];Object.assign(c,{dataElementType:dt.getElement(d),datasetElementType:h&&dt.getElement(h)}),r.controller=new c(this,n),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){R(this.data.datasets,(t,s)=>{this.getDatasetMeta(s).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let s=this.config;s.update();let n=this._options=s.createResolver(s.chartOptionScopes(),this.getContext()),o=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let a=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let h=0,d=this.data.datasets.length;h<d;h++){let{controller:u}=this.getDatasetMeta(h),f=!o&&a.indexOf(u)===-1;u.buildOrUpdateElements(f),r=Math.max(+u.getMaxOverflow(),r)}r=this._minPadding=n.layout.autoPadding?r:0,this._updateLayout(r),o||R(a,h=>{h.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(eo("z","_idx"));let{_active:l,_lastEvent:c}=this;c?this._eventHandler(c,!0):l.length&&this._updateHoverStyles(l,l,!0),this.render()}_updateScales(){R(this.scales,t=>{G.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,s=new Set(Object.keys(this._listeners)),n=new Set(t.events);(!Si(s,n)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,s=this._getUniformDataChanges()||[];for(let{method:n,start:o,count:a}of s){let r=n==="_removeElements"?-a:a;Jl(t,o,r)}}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let s=this.data.datasets.length,n=a=>new Set(t.filter(r=>r[0]===a).map((r,l)=>l+","+r.splice(1).join(","))),o=n(0);for(let a=1;a<s;a++)if(!Si(o,n(a)))return;return Array.from(o).map(a=>a.split(",")).map(a=>({method:a[1],start:+a[2],count:+a[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;G.update(this,this.width,this.height,t);let s=this.chartArea,n=s.width<=0||s.height<=0;this._layers=[],R(this.boxes,o=>{n&&o.position==="chartArea"||(o.configure&&o.configure(),this._layers.push(...o._layers()))},this),this._layers.forEach((o,a)=>{o._idx=a}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let s=0,n=this.data.datasets.length;s<n;++s)this.getDatasetMeta(s).controller.configure();for(let s=0,n=this.data.datasets.length;s<n;++s)this._updateDataset(s,ft(t)?t({datasetIndex:s}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,s){let n=this.getDatasetMeta(t),o={meta:n,index:t,mode:s,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",o)!==!1&&(n.controller._update(s),o.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",o))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(bt.has(this)?this.attached&&!bt.running(this)&&bt.start(this):(this.draw(),io({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){let{width:n,height:o}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(n,o)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;let s=this._layers;for(t=0;t<s.length&&s[t].z<=0;++t)s[t].draw(this.chartArea);for(this._drawDatasets();t<s.length;++t)s[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){let s=this._sortedMetasets,n=[],o,a;for(o=0,a=s.length;o<a;++o){let r=s[o];(!t||r.visible)&&n.push(r)}return n}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;let t=this.getSortedVisibleDatasetMetas();for(let s=t.length-1;s>=0;--s)this._drawDataset(t[s]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let s=this.ctx,n={meta:t,index:t.index,cancelable:!0},o=Gi(this,t);this.notifyPlugins("beforeDatasetDraw",n)!==!1&&(o&&de(s,o),t.controller.draw(),o&&ue(s),n.cancelable=!1,this.notifyPlugins("afterDatasetDraw",n))}isPointInArea(t){return rt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,s,n,o){let a=el.modes[s];return typeof a=="function"?a(this,t,n,o):[]}getDatasetMeta(t){let s=this.data.datasets[t],n=this._metasets,o=n.filter(a=>a&&a._dataset===s).pop();return o||(o={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:s&&s.order||0,index:t,_dataset:s,_parsed:[],_sorted:!1},n.push(o)),o}getContext(){return this.$context||(this.$context=mt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let s=this.data.datasets[t];if(!s)return!1;let n=this.getDatasetMeta(t);return typeof n.hidden=="boolean"?!n.hidden:!s.hidden}setDatasetVisibility(t,s){let n=this.getDatasetMeta(t);n.hidden=!s}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,s,n){let o=n?"show":"hide",a=this.getDatasetMeta(t),r=a.controller._resolveAnimations(void 0,o);Ut(s)?(a.data[s].hidden=!n,this.update()):(this.setDatasetVisibility(t,n),r.update(a,{visible:n}),this.update(l=>l.datasetIndex===t?o:void 0))}hide(t,s){this._updateVisibility(t,s,!1)}show(t,s){this._updateVisibility(t,s,!0)}_destroyDatasetMeta(t){let s=this._metasets[t];s&&s.controller&&s.controller._destroy(),delete this._metasets[t]}_stop(){let t,s;for(this.stop(),bt.remove(this),t=0,s=this.data.datasets.length;t<s;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");let{canvas:t,ctx:s}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),zi(t,s),this.platform.releaseContext(s),this.canvas=null,this.ctx=null),delete ii[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){let t=this._listeners,s=this.platform,n=(a,r)=>{s.addEventListener(this,a,r),t[a]=r},o=(a,r,l)=>{a.offsetX=r,a.offsetY=l,this._eventHandler(a)};R(this.options.events,a=>n(a,o))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,s=this.platform,n=(c,h)=>{s.addEventListener(this,c,h),t[c]=h},o=(c,h)=>{t[c]&&(s.removeEventListener(this,c,h),delete t[c])},a=(c,h)=>{this.canvas&&this.resize(c,h)},r,l=()=>{o("attach",l),this.attached=!0,this.resize(),n("resize",a),n("detach",r)};r=()=>{this.attached=!1,o("resize",a),this._stop(),this._resize(0,0),n("attach",l)},s.isAttached(this.canvas)?l():r()}unbindEvents(){R(this._listeners,(t,s)=>{this.platform.removeEventListener(this,s,t)}),this._listeners={},R(this._responsiveListeners,(t,s)=>{this.platform.removeEventListener(this,s,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,s,n){let o=n?"set":"remove",a,r,l,c;for(s==="dataset"&&(a=this.getDatasetMeta(t[0].datasetIndex),a.controller["_"+o+"DatasetHoverStyle"]()),l=0,c=t.length;l<c;++l){r=t[l];let h=r&&this.getDatasetMeta(r.datasetIndex).controller;h&&h[o+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){let s=this._active||[],n=t.map(({datasetIndex:a,index:r})=>{let l=this.getDatasetMeta(a);if(!l)throw new Error("No dataset found at index "+a);return{datasetIndex:a,element:l.data[r],index:r}});!ce(n,s)&&(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,s))}notifyPlugins(t,s,n){return this._plugins.notify(this,t,s,n)}isPluginEnabled(t){return this._plugins._cache.filter(s=>s.plugin.id===t).length===1}_updateHoverStyles(t,s,n){let o=this.options.hover,a=(c,h)=>c.filter(d=>!h.some(u=>d.datasetIndex===u.datasetIndex&&d.index===u.index)),r=a(s,t),l=n?t:a(t,s);r.length&&this.updateHoverStyle(r,o.mode,!1),l.length&&o.mode&&this.updateHoverStyle(l,o.mode,!0)}_eventHandler(t,s){let n={event:t,replay:s,cancelable:!0,inChartArea:this.isPointInArea(t)},o=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",n,o)===!1)return;let a=this._handleEvent(t,s,n.inChartArea);return n.cancelable=!1,this.notifyPlugins("afterEvent",n,o),(a||n.changed)&&this.render(),this}_handleEvent(t,s,n){let{_active:o=[],options:a}=this,r=s,l=this._getActiveElements(t,o,n,r),c=on(t),h=Ql(t,this._lastEvent,n,c);n&&(this._lastEvent=null,I(a.onHover,[t,l,this],this),c&&I(a.onClick,[t,l,this],this));let d=!ce(l,o);return(d||s)&&(this._active=l,this._updateHoverStyles(l,o,s)),this._lastEvent=h,d}_getActiveElements(t,s,n,o){if(t.type==="mouseout")return[];if(!n)return s;let a=this.options.hover;return this.getElementsAtEventForMode(t,a.mode,a,o)}}return i})();function no(){return R(ci.instances,i=>i._plugins.invalidate())}function tc(i,e,t){let{startAngle:s,x:n,y:o,outerRadius:a,innerRadius:r,options:l}=e,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/a,U(s-t));if(i.beginPath(),i.arc(n,o,a-c/2,s+d/2,t-d/2),r>0){let u=Math.min(c/r,U(s-t));i.arc(n,o,r+c/2,t-u/2,s+u/2,!0)}else{let u=Math.min(c/2,a*U(s-t));if(h==="round")i.arc(n,o,u,t-L/2,s+L/2,!0);else if(h==="bevel"){let f=2*u*u,p=-f*Math.cos(t+L/2)+n,g=-f*Math.sin(t+L/2)+o,m=f*Math.cos(s+L/2)+n,b=f*Math.sin(s+L/2)+o;i.lineTo(p,g),i.lineTo(m,b)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function ec(i,e,t){let{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:l}=e,c=n/r;i.beginPath(),i.arc(o,a,r,s-c,t+c),l>n?(c=n/l,i.arc(o,a,l,t+c,s-c,!0)):i.arc(o,a,n,t+W,s-W),i.closePath(),i.clip()}function ic(i){return Ye(i,["outerStart","outerEnd","innerStart","innerEnd"])}function sc(i,e,t,s){let n=ic(i.options.borderRadius),o=(t-e)/2,a=Math.min(o,s*e/2),r=l=>{let c=(t-Math.min(o,l))*s/2;return Y(l,0,Math.min(o,c))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:Y(n.innerStart,0,a),innerEnd:Y(n.innerEnd,0,a)}}function Jt(i,e,t,s){return{x:t+i*Math.cos(e),y:s+i*Math.sin(e)}}function ai(i,e,t,s,n,o){let{x:a,y:r,startAngle:l,pixelMargin:c,innerRadius:h}=e,d=Math.max(e.outerRadius+s+t-c,0),u=h>0?h+s+t+c:0,f=0,p=n-l;if(s){let E=h>0?h-s:0,V=d>0?d-s:0,H=(E+V)/2,st=H!==0?p*H/(H+s):p;f=(p-st)/2}let g=Math.max(.001,p*d-t/L)/d,m=(p-g)/2,b=l+m+f,x=n-m-f,{outerStart:y,outerEnd:M,innerStart:_,innerEnd:v}=sc(e,u,d,x-b),S=d-y,k=d-M,w=b+y/S,D=x-M/k,P=u+_,T=u+v,$=b+_/P,tt=x-v/T;if(i.beginPath(),o){let E=(w+D)/2;if(i.arc(a,r,d,w,E),i.arc(a,r,d,E,D),M>0){let q=Jt(k,D,a,r);i.arc(q.x,q.y,M,D,x+W)}let V=Jt(T,x,a,r);if(i.lineTo(V.x,V.y),v>0){let q=Jt(T,tt,a,r);i.arc(q.x,q.y,v,x+W,tt+Math.PI)}let H=(x-v/u+(b+_/u))/2;if(i.arc(a,r,u,x-v/u,H,!0),i.arc(a,r,u,H,b+_/u,!0),_>0){let q=Jt(P,$,a,r);i.arc(q.x,q.y,_,$+Math.PI,b-W)}let st=Jt(S,b,a,r);if(i.lineTo(st.x,st.y),y>0){let q=Jt(S,w,a,r);i.arc(q.x,q.y,y,b-W,w)}}else{i.moveTo(a,r);let E=Math.cos(w)*d+a,V=Math.sin(w)*d+r;i.lineTo(E,V);let H=Math.cos(D)*d+a,st=Math.sin(D)*d+r;i.lineTo(H,st)}i.closePath()}function nc(i,e,t,s,n){let{fullCircles:o,startAngle:a,circumference:r}=e,l=e.endAngle;if(o){ai(i,e,t,s,l,n);for(let c=0;c<o;++c)i.fill();isNaN(r)||(l=a+(r%B||B))}return ai(i,e,t,s,l,n),i.fill(),l}function oc(i,e,t,s,n){let{fullCircles:o,startAngle:a,circumference:r,options:l}=e,{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 g=e.endAngle;if(o){ai(i,e,t,s,g,n);for(let m=0;m<o;++m)i.stroke();isNaN(r)||(g=a+(r%B||B))}p&&ec(i,e,g),l.selfJoin&&g-a>=L&&f===0&&h!=="miter"&&tc(i,e,g),o||(ai(i,e,t,s,g,n),i.stroke())}var xs=class extends ot{static id="arc";static 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};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:e=>e!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),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,t,s){let n=this.getProps(["x","y"],s),{angle:o,distance:a}=Di(n,{x:e,y:t}),{startAngle:r,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),u=(this.options.spacing+this.options.borderWidth)/2,f=C(d,l-r),p=Kt(o,r,l)&&r!==l,g=f>=B||p,m=ct(a,c+u,h+u);return g&&m}getCenterPoint(e){let{x:t,y:s,startAngle:n,endAngle:o,innerRadius:a,outerRadius:r}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],e),{offset:l,spacing:c}=this.options,h=(n+o)/2,d=(a+r+c+l)/2;return{x:t+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:s}=this,n=(t.offset||0)/4,o=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=s>B?Math.floor(s/B):0,s===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let r=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(r)*n,Math.sin(r)*n);let l=1-Math.sin(Math.min(L,s||0)),c=n*l;e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,nc(e,this,c,o,a),oc(e,this,c,o,a),e.restore()}};function jo(i,e,t=e){i.lineCap=C(t.borderCapStyle,e.borderCapStyle),i.setLineDash(C(t.borderDash,e.borderDash)),i.lineDashOffset=C(t.borderDashOffset,e.borderDashOffset),i.lineJoin=C(t.borderJoinStyle,e.borderJoinStyle),i.lineWidth=C(t.borderWidth,e.borderWidth),i.strokeStyle=C(t.borderColor,e.borderColor)}function ac(i,e,t){i.lineTo(t.x,t.y)}function rc(i){return i.stepped?bn:i.tension||i.cubicInterpolationMode==="monotone"?xn:ac}function Yo(i,e,t={}){let s=i.length,{start:n=0,end:o=s-1}=t,{start:a,end:r}=e,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:e.loop,ilen:c<l&&!h?s+c-l:c-l}}function lc(i,e,t,s){let{points:n,options:o}=e,{count:a,start:r,loop:l,ilen:c}=Yo(n,t,s),h=rc(o),{move:d=!0,reverse:u}=s||{},f,p,g;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,g,p,u,o.stepped),g=p);return l&&(p=n[(r+(u?c:0))%a],h(i,g,p,u,o.stepped)),!!l}function cc(i,e,t,s){let n=e.points,{count:o,start:a,ilen:r}=Yo(n,t,s),{move:l=!0,reverse:c}=s||{},h=0,d=0,u,f,p,g,m,b,x=M=>(a+(c?r-M:M))%o,y=()=>{g!==m&&(i.lineTo(h,m),i.lineTo(h,g),i.lineTo(h,b))};for(l&&(f=n[x(0)],i.moveTo(f.x,f.y)),u=0;u<=r;++u){if(f=n[x(u)],f.skip)continue;let M=f.x,_=f.y,v=M|0;v===p?(_<g?g=_:_>m&&(m=_),h=(d*h+M)/++d):(y(),i.lineTo(M,_),p=v,d=0,g=m=_),b=_}y()}function _s(i){let e=i.options,t=e.borderDash&&e.borderDash.length;return!i._decimated&&!i._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?cc:lc}function hc(i){return i.stepped?Pn:i.tension||i.cubicInterpolationMode==="monotone"?Dn:vt}function dc(i,e,t,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,t,s)&&n.closePath()),jo(i,e.options),i.stroke(n)}function uc(i,e,t,s){let{segments:n,options:o}=e,a=_s(e);for(let r of n)jo(i,o,r.style),i.beginPath(),a(i,e,r,{start:t,end:t+s-1})&&i.closePath(),i.stroke()}var fc=typeof Path2D=="function";function gc(i,e,t,s){fc&&!e.options.segment?dc(i,e,t,s):uc(i,e,t,s)}var hi=(()=>{class i extends ot{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};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,s){let n=this.options;if((n.tension||n.cubicInterpolationMode==="monotone")&&!n.stepped&&!this._pointsUpdated){let o=n.spanGaps?this._loop:this._fullLoop;Sn(this._points,n,t,o,s),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=An(this,this.options.segment))}first(){let t=this.segments,s=this.points;return t.length&&s[t[0].start]}last(){let t=this.segments,s=this.points,n=t.length;return n&&s[t[n-1].end]}interpolate(t,s){let n=this.options,o=t[s],a=this.points,r=qi(this,{property:s,start:o,end:o});if(!r.length)return;let l=[],c=hc(n),h,d;for(h=0,d=r.length;h<d;++h){let{start:u,end:f}=r[h],p=a[u],g=a[f];if(p===g){l.push(p);continue}let m=Math.abs((o-p[s])/(g[s]-p[s])),b=c(p,g,m,n.stepped);b[s]=t[s],l.push(b)}return l.length===1?l[0]:l}pathSegment(t,s,n){return _s(this)(t,this,s,n)}path(t,s,n){let o=this.segments,a=_s(this),r=this._loop;s=s||0,n=n||this.points.length-s;for(let l of o)r&=a(t,this,l,{start:s,end:s+n-1});return!!r}draw(t,s,n,o){let a=this.options||{};(this.points||[]).length&&a.borderWidth&&(t.save(),gc(t,this,n,o),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}return i})();function oo(i,e,t,s){let n=i.options,{[t]:o}=i.getProps([t],s);return Math.abs(e-o)<n.radius+n.hitRadius}var pc=(()=>{class i extends ot{static id="point";parsed;skip;stop;static defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,s,n){let o=this.options,{x:a,y:r}=this.getProps(["x","y"],n);return Math.pow(t-a,2)+Math.pow(s-r,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(t,s){return oo(this,t,"x",s)}inYRange(t,s){return oo(this,t,"y",s)}getCenterPoint(t){let{x:s,y:n}=this.getProps(["x","y"],t);return{x:s,y:n}}size(t){t=t||this.options||{};let s=t.radius||0;s=Math.max(s,s&&t.hoverRadius||0);let n=s&&t.borderWidth||0;return(s+n)*2}draw(t,s){let n=this.options;this.skip||n.radius<.1||!rt(this,s,this.size(n)/2)||(t.strokeStyle=n.borderColor,t.lineWidth=n.borderWidth,t.fillStyle=n.backgroundColor,je(t,n,this.x,this.y))}getRange(){let t=this.options||{};return t.radius+t.hitRadius}}return i})();function $o(i,e){let{x:t,y:s,base:n,width:o,height:a}=i.getProps(["x","y","base","width","height"],e),r,l,c,h,d;return i.horizontal?(d=a/2,r=Math.min(t,n),l=Math.max(t,n),c=s-d,h=s+d):(d=o/2,r=t-d,l=t+d,c=Math.min(s,n),h=Math.max(s,n)),{left:r,top:c,right:l,bottom:h}}function Pt(i,e,t,s){return i?0:Y(e,t,s)}function mc(i,e,t){let s=i.options.borderWidth,n=i.borderSkipped,o=Vi(s);return{t:Pt(n.top,o.top,0,t),r:Pt(n.right,o.right,0,e),b:Pt(n.bottom,o.bottom,0,t),l:Pt(n.left,o.left,0,e)}}function bc(i,e,t){let{enableBorderRadius:s}=i.getProps(["enableBorderRadius"]),n=i.options.borderRadius,o=wt(n),a=Math.min(e,t),r=i.borderSkipped,l=s||A(n);return{topLeft:Pt(!l||r.top||r.left,o.topLeft,0,a),topRight:Pt(!l||r.top||r.right,o.topRight,0,a),bottomLeft:Pt(!l||r.bottom||r.left,o.bottomLeft,0,a),bottomRight:Pt(!l||r.bottom||r.right,o.bottomRight,0,a)}}function xc(i){let e=$o(i),t=e.right-e.left,s=e.bottom-e.top,n=mc(i,t/2,s/2),o=bc(i,t/2,s/2);return{outer:{x:e.left,y:e.top,w:t,h:s,radius:o},inner:{x:e.left+n.l,y:e.top+n.t,w:t-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 ns(i,e,t,s){let n=e===null,o=t===null,r=i&&!(n&&o)&&$o(i,s);return r&&(n||ct(e,r.left,r.right))&&(o||ct(t,r.top,r.bottom))}function _c(i){return i.topLeft||i.topRight||i.bottomLeft||i.bottomRight}function yc(i,e){i.rect(e.x,e.y,e.w,e.h)}function os(i,e,t={}){let s=i.x!==t.x?-e:0,n=i.y!==t.y?-e:0,o=(i.x+i.w!==t.x+t.w?e:0)-s,a=(i.y+i.h!==t.y+t.h?e:0)-n;return{x:i.x+s,y:i.y+n,w:i.w+o,h:i.h+a,radius:i.radius}}var ys=class extends ot{static id="bar";static defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};constructor(e){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,e&&Object.assign(this,e)}draw(e){let{inflateAmount:t,options:{borderColor:s,backgroundColor:n}}=this,{inner:o,outer:a}=xc(this),r=_c(a.radius)?Gt:yc;e.save(),(a.w!==o.w||a.h!==o.h)&&(e.beginPath(),r(e,os(a,t,o)),e.clip(),r(e,os(o,-t,a)),e.fillStyle=s,e.fill("evenodd")),e.beginPath(),r(e,os(o,t)),e.fillStyle=n,e.fill(),e.restore()}inRange(e,t,s){return ns(this,e,t,s)}inXRange(e,t){return ns(this,e,null,t)}inYRange(e,t){return ns(this,null,e,t)}getCenterPoint(e){let{x:t,y:s,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],e);return{x:o?(t+n)/2:t,y:o?s:(s+n)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}},vc=Object.freeze({__proto__:null,ArcElement:xs,BarElement:ys,LineElement:hi,PointElement:pc}),vs=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],ao=vs.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function Uo(i){return vs[i%vs.length]}function Xo(i){return ao[i%ao.length]}function Mc(i,e){return i.borderColor=Uo(e),i.backgroundColor=Xo(e),++e}function kc(i,e){return i.backgroundColor=i.data.map(()=>Uo(e++)),e}function Sc(i,e){return i.backgroundColor=i.data.map(()=>Xo(e++)),e}function wc(i){let e=0;return(t,s)=>{let n=i.getDatasetMeta(s).controller;n instanceof Os?e=kc(t,e):n instanceof Eo?e=Sc(t,e):n&&(e=Mc(t,e))}}function ro(i){let e;for(e in i)if(i[e].borderColor||i[e].backgroundColor)return!0;return!1}function Cc(i){return i&&(i.borderColor||i.backgroundColor)}function Pc(){return F.borderColor!=="rgba(0,0,0,0.1)"||F.backgroundColor!=="rgba(0,0,0,0.1)"}var Dc={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,e,t){if(!t.enabled)return;let{data:{datasets:s},options:n}=i.config,{elements:o}=n,a=ro(s)||Cc(n)||o&&ro(o)||Pc();if(!t.forceOverride&&a)return;let r=wc(i);s.forEach(r)}};function Oc(i,e,t,s,n){let o=n.samples||s;if(o>=t)return i.slice(e,e+t);let a=[],r=(t-2)/(o-2),l=0,c=e+t-1,h=e,d,u,f,p,g;for(a[l++]=i[h],d=0;d<o-2;d++){let m=0,b=0,x,y=Math.floor((d+1)*r)+1+e,M=Math.min(Math.floor((d+2)*r)+1,t)+e,_=M-y;for(x=y;x<M;x++)m+=i[x].x,b+=i[x].y;m/=_,b/=_;let v=Math.floor(d*r)+1+e,S=Math.min(Math.floor((d+1)*r)+1,t)+e,{x:k,y:w}=i[h];for(f=p=-1,x=v;x<S;x++)p=.5*Math.abs((k-m)*(i[x].y-w)-(k-i[x].x)*(b-w)),p>f&&(f=p,u=i[x],g=x);a[l++]=u,h=g}return a[l++]=i[c],a}function Ac(i,e,t,s){let n=0,o=0,a,r,l,c,h,d,u,f,p,g,m=[],b=e+t-1,x=i[e].x,M=i[b].x-x;for(a=e;a<e+t;++a){r=i[a],l=(r.x-x)/M*s,c=r.y;let _=l|0;if(_===h)c<p?(p=c,d=a):c>g&&(g=c,u=a),n=(o*n+r.x)/++o;else{let v=a-1;if(!O(d)&&!O(u)){let S=Math.min(d,u),k=Math.max(d,u);S!==f&&S!==v&&m.push(Ce(we({},i[S]),{x:n})),k!==f&&k!==v&&m.push(Ce(we({},i[k]),{x:n}))}a>0&&v!==f&&m.push(i[v]),m.push(r),h=_,o=0,p=g=c,d=u=f=a}}return m}function Ko(i){if(i._decimated){let e=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function lo(i){i.data.datasets.forEach(e=>{Ko(e)})}function Tc(i,e){let t=e.length,s=0,n,{iScale:o}=i,{min:a,max:r,minDefined:l,maxDefined:c}=o.getUserBounds();return l&&(s=Y(at(e,o.axis,a).lo,0,t-1)),c?n=Y(at(e,o.axis,r).hi+1,s,t)-s:n=t-s,{start:s,count:n}}var Lc={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,e,t)=>{if(!t.enabled){lo(i);return}let s=i.width;i.data.datasets.forEach((n,o)=>{let{_data:a,indexAxis:r}=n,l=i.getDatasetMeta(o),c=a||n.data;if(Zt([r,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let h=i.scales[l.xAxisID];if(h.type!=="linear"&&h.type!=="time"||i.options.parsing)return;let{start:d,count:u}=Tc(l,c),f=t.threshold||4*s;if(u<=f){Ko(n);return}O(a)&&(n._data=c,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(t.algorithm){case"lttb":p=Oc(c,d,u,s,t);break;case"min-max":p=Ac(c,d,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`)}n._decimated=p})},destroy(i){lo(i)}};function Rc(i,e,t){let s=i.segments,n=i.points,o=e.points,a=[];for(let r of s){let{start:l,end:c}=r;c=di(l,c,n);let h=Ms(t,n[l],n[c],r.loop);if(!e.segments){a.push({source:r,target:h,start:n[l],end:n[c]});continue}let d=qi(e,h);for(let u of d){let f=Ms(t,o[u.start],o[u.end],u.loop),p=Ki(r,n,f);for(let g of p)a.push({source:g,target:u,start:{[t]:co(h,f,"start",Math.max)},end:{[t]:co(h,f,"end",Math.min)}})}}return a}function Ms(i,e,t,s){if(s)return;let n=e[i],o=t[i];return i==="angle"&&(n=U(n),o=U(o)),{property:i,start:n,end:o}}function Ec(i,e){let{x:t=null,y:s=null}=i||{},n=e.points,o=[];return e.segments.forEach(({start:a,end:r})=>{r=di(a,r,n);let l=n[a],c=n[r];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):t!==null&&(o.push({x:t,y:l.y}),o.push({x:t,y:c.y}))}),o}function di(i,e,t){for(;e>i;e--){let s=t[e];if(!isNaN(s.x)&&!isNaN(s.y))break}return e}function co(i,e,t,s){return i&&e?s(i[t],e[t]):i?i[t]:e?e[t]:0}function qo(i,e){let t=[],s=!1;return z(i)?(s=!0,t=i):t=Ec(i,e),t.length?new hi({points:t,options:{tension:0},_loop:s,_fullLoop:s}):null}function ho(i){return i&&i.fill!==!1}function Ic(i,e,t){let n=i[e].fill,o=[e],a;if(!t)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!N(n))return n;if(a=i[n],!a)return!1;if(a.visible)return n;o.push(n),n=a.fill}return!1}function Fc(i,e,t){let s=Nc(i);if(A(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return N(n)&&Math.floor(n)===n?zc(s[0],e,n,t):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function zc(i,e,t,s){return(i==="-"||i==="+")&&(t=e+t),t===e||t<0||t>=s?!1:t}function Bc(i,e){let t=null;return i==="start"?t=e.bottom:i==="end"?t=e.top:A(i)?t=e.getPixelForValue(i.value):e.getBasePixel&&(t=e.getBasePixel()),t}function Vc(i,e,t){let s;return i==="start"?s=t:i==="end"?s=e.options.reverse?e.min:e.max:A(i)?s=i.value:s=e.getBaseValue(),s}function Nc(i){let e=i.options,t=e.fill,s=C(t&&t.target,t);return s===void 0&&(s=!!e.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function Wc(i){let{scale:e,index:t,line:s}=i,n=[],o=s.segments,a=s.points,r=Hc(e,t);r.push(qo({x:null,y:e.bottom},s));for(let l=0;l<o.length;l++){let c=o[l];for(let h=c.start;h<=c.end;h++)jc(n,a[h],r)}return new hi({points:n,options:{}})}function Hc(i,e){let t=[],s=i.getMatchingVisibleMetas("line");for(let n=0;n<s.length;n++){let o=s[n];if(o.index===e)break;o.hidden||t.unshift(o.dataset)}return t}function jc(i,e,t){let s=[];for(let n=0;n<t.length;n++){let o=t[n],{first:a,last:r,point:l}=Yc(o,e,"x");if(!(!l||a&&r)){if(a)s.unshift(l);else if(i.push(l),!r)break}}i.push(...s)}function Yc(i,e,t){let s=i.interpolate(e,t);if(!s)return{};let n=s[t],o=i.segments,a=i.points,r=!1,l=!1;for(let c=0;c<o.length;c++){let h=o[c],d=a[h.start][t],u=a[h.end][t];if(ct(n,d,u)){r=n===d,l=n===u;break}}return{first:r,last:l,point:s}}var ri=class{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,s){let{x:n,y:o,radius:a}=this;return t=t||{start:0,end:B},e.arc(n,o,a,t.end,t.start,!0),!s.bounds}interpolate(e){let{x:t,y:s,radius:n}=this,o=e.angle;return{x:t+Math.cos(o)*n,y:s+Math.sin(o)*n,angle:o}}};function $c(i){let{chart:e,fill:t,line:s}=i;if(N(t))return Uc(e,t);if(t==="stack")return Wc(i);if(t==="shape")return!0;let n=Xc(i);return n instanceof ri?n:qo(n,s)}function Uc(i,e){let t=i.getDatasetMeta(e);return t&&i.isDatasetVisible(e)?t.dataset:null}function Xc(i){return(i.scale||{}).getPointPositionForValue?qc(i):Kc(i)}function Kc(i){let{scale:e={},fill:t}=i,s=Bc(t,e);if(N(s)){let n=e.isHorizontal();return{x:n?s:null,y:n?null:s}}return null}function qc(i){let{scale:e,fill:t}=i,s=e.options,n=e.getLabels().length,o=s.reverse?e.max:e.min,a=Vc(t,e,o),r=[];if(s.grid.circular){let l=e.getPointPositionForValue(0,o);return new ri({x:l.x,y:l.y,radius:e.getDistanceFromCenterForValue(a)})}for(let l=0;l<n;++l)r.push(e.getPointPositionForValue(l,a));return r}function as(i,e,t){let s=$c(e),{chart:n,index:o,line:a,scale:r,axis:l}=e,c=a.options,h=c.fill,d=c.backgroundColor,{above:u=d,below:f=d}=h||{},p=n.getDatasetMeta(o),g=Gi(n,p);s&&a.points.length&&(de(i,t),Gc(i,{line:a,target:s,above:u,below:f,area:t,scale:r,axis:l,clip:g}),ue(i))}function Gc(i,e){let{line:t,target:s,above:n,below:o,area:a,scale:r,clip:l}=e,c=t._loop?"angle":e.axis;i.save();let h=o;o!==n&&(c==="x"?(uo(i,s,a.top),rs(i,{line:t,target:s,color:n,scale:r,property:c,clip:l}),i.restore(),i.save(),uo(i,s,a.bottom)):c==="y"&&(fo(i,s,a.left),rs(i,{line:t,target:s,color:o,scale:r,property:c,clip:l}),i.restore(),i.save(),fo(i,s,a.right),h=n)),rs(i,{line:t,target:s,color:h,scale:r,property:c,clip:l}),i.restore()}function uo(i,e,t){let{segments:s,points:n}=e,o=!0,a=!1;i.beginPath();for(let r of s){let{start:l,end:c}=r,h=n[l],d=n[di(l,c,n)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,t),i.lineTo(h.x,h.y)),a=!!e.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(d.x,t)}i.lineTo(e.first().x,t),i.closePath(),i.clip()}function fo(i,e,t){let{segments:s,points:n}=e,o=!0,a=!1;i.beginPath();for(let r of s){let{start:l,end:c}=r,h=n[l],d=n[di(l,c,n)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(t,h.y),i.lineTo(h.x,h.y)),a=!!e.pathSegment(i,r,{move:a}),a?i.closePath():i.lineTo(t,d.y)}i.lineTo(t,e.first().y),i.closePath(),i.clip()}function rs(i,e){let{line:t,target:s,property:n,color:o,scale:a,clip:r}=e,l=Rc(t,s,n);for(let{source:c,target:h,start:d,end:u}of l){let{style:{backgroundColor:f=o}={}}=c,p=s!==!0;i.save(),i.fillStyle=f,Zc(i,a,r,p&&Ms(n,d,u)),i.beginPath();let g=!!t.pathSegment(i,c),m;if(p){g?i.closePath():go(i,s,u,n);let b=!!s.pathSegment(i,h,{move:g,reverse:!0});m=g&&b,m||go(i,s,d,n)}i.closePath(),i.fill(m?"evenodd":"nonzero"),i.restore()}}function Zc(i,e,t,s){let n=e.chart.chartArea,{property:o,start:a,end:r}=s||{};if(o==="x"||o==="y"){let l,c,h,d;o==="x"?(l=a,c=n.top,h=r,d=n.bottom):(l=n.left,c=a,h=n.right,d=r),i.beginPath(),t&&(l=Math.max(l,t.left),h=Math.min(h,t.right),c=Math.max(c,t.top),d=Math.min(d,t.bottom)),i.rect(l,c,h-l,d-c),i.clip()}}function go(i,e,t,s){let n=e.interpolate(t,s);n&&i.lineTo(n.x,n.y)}var Jc={id:"filler",afterDatasetsUpdate(i,e,t){let s=(i.data.datasets||[]).length,n=[],o,a,r,l;for(a=0;a<s;++a)o=i.getDatasetMeta(a),r=o.dataset,l=null,r&&r.options&&r instanceof hi&&(l={visible:i.isDatasetVisible(a),index:a,fill:Fc(r,a,s),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:r}),o.$filler=l,n.push(l);for(a=0;a<s;++a)l=n[a],!(!l||l.fill===!1)&&(l.fill=Ic(n,a,t.propagate))},beforeDraw(i,e,t){let s=t.drawTime==="beforeDraw",n=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let a=n.length-1;a>=0;--a){let r=n[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),s&&r.fill&&as(i.ctx,r,o))}},beforeDatasetsDraw(i,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;let s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){let o=s[n].$filler;ho(o)&&as(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,e,t){let s=e.meta.$filler;!ho(s)||t.drawTime!=="beforeDatasetDraw"||as(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}},po=(i,e)=>{let{boxHeight:t=e,boxWidth:s=e}=i;return i.usePointStyle&&(t=Math.min(t,e),s=i.pointStyleWidth||Math.min(s,e)),{boxWidth:s,boxHeight:t,itemHeight:Math.max(e,t)}},Qc=(i,e)=>i!==null&&e!==null&&i.datasetIndex===e.datasetIndex&&i.index===e.index,li=class extends ot{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t,s){this.maxWidth=e,this.maxHeight=t,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(){let e=this.options.labels||{},t=I(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(s=>e.filter(s,this.chart.data))),e.sort&&(t=t.sort((s,n)=>e.sort(s,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let s=e.labels,n=j(s.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=po(s,o),c,h;t.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,e.maxWidth||this.maxWidth),this.height=Math.min(h,e.maxHeight||this.maxHeight)}_fitRows(e,t,s,n){let{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+r,d=e;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((p,g)=>{let m=s+t/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*r>a)&&(d+=h,c[c.length-(g>0?0:1)]=0,f+=h,u++),l[g]={left:0,top:f,row:u,width:m,height:n},c[c.length-1]+=m+r}),d}_fitCols(e,t,s,n){let{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=a-e,d=r,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:x,itemHeight:y}=th(s,t,o,m,n);b>0&&f+y+2*r>h&&(d+=u+r,c.push({width:u,height:f}),p+=u+r,g++,u=f=0),l[b]={left:p,top:f,col:g,width:x,height:y},u=Math.max(u,x),f+=y+r}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:s,labels:{padding:n},rtl:o}}=this,a=It(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=X(s,this.left+n,this.right-this.lineWidths[r]);for(let c of t)r!==c.row&&(r=c.row,l=X(s,this.left+n,this.right-this.lineWidths[r])),c.top+=this.top+e+n,c.left=a.leftForLtr(a.x(l),c.width),l+=c.width+n}else{let r=0,l=X(s,this.top+e+n,this.bottom-this.columnSizes[r].height);for(let c of t)c.col!==r&&(r=c.col,l=X(s,this.top+e+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){let e=this.ctx;de(e,this),this._draw(),ue(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:s,ctx:n}=this,{align:o,labels:a}=e,r=F.color,l=It(e.rtl,this.left,this.width),c=j(a.font),{padding:h}=a,d=c.size,u=d/2,f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;let{boxWidth:p,boxHeight:g,itemHeight:m}=po(a,d),b=function(v,S,k){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();let w=C(k.lineWidth,1);if(n.fillStyle=C(k.fillStyle,r),n.lineCap=C(k.lineCap,"butt"),n.lineDashOffset=C(k.lineDashOffset,0),n.lineJoin=C(k.lineJoin,"miter"),n.lineWidth=w,n.strokeStyle=C(k.strokeStyle,r),n.setLineDash(C(k.lineDash,[])),a.usePointStyle){let D={radius:g*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:w},P=l.xPlus(v,p/2),T=S+u;Bi(n,D,P,T,a.pointStyleWidth&&p)}else{let D=S+Math.max((d-g)/2,0),P=l.leftForLtr(v,p),T=wt(k.borderRadius);n.beginPath(),Object.values(T).some($=>$!==0)?Gt(n,{x:P,y:D,w:p,h:g,radius:T}):n.rect(P,D,p,g),n.fill(),w!==0&&n.stroke()}n.restore()},x=function(v,S,k){St(n,k.text,v,S+m/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},y=this.isHorizontal(),M=this._computeTitleHeight();y?f={x:X(o,this.left+h,this.right-s[0]),y:this.top+h+M,line:0}:f={x:this.left+h,y:X(o,this.top+M+h,this.bottom-t[0].height),line:0},Ui(this.ctx,e.textDirection);let _=m+h;this.legendItems.forEach((v,S)=>{n.strokeStyle=v.fontColor,n.fillStyle=v.fontColor;let k=n.measureText(v.text).width,w=l.textAlign(v.textAlign||(v.textAlign=a.textAlign)),D=p+u+k,P=f.x,T=f.y;l.setWidth(this.width),y?S>0&&P+D+h>this.right&&(T=f.y+=_,f.line++,P=f.x=X(o,this.left+h,this.right-s[f.line])):S>0&&T+_>this.bottom&&(P=f.x=P+t[f.line].width+h,f.line++,T=f.y=X(o,this.top+M+h,this.bottom-t[f.line].height));let $=l.x(P);if(b($,T,v),P=gn(w,P+p+u,y?P+D:this.right,e.rtl),x(l.x(P),T,v),y)f.x+=D+h;else if(typeof v.text!="string"){let tt=c.lineHeight;f.y+=Go(v,tt)+h}else f.y+=_}),Xi(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,s=j(t.font),n=K(t.padding);if(!t.display)return;let o=It(e.rtl,this.left,this.width),a=this.ctx,r=t.position,l=s.size/2,c=n.top+l,h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=X(e.align,d,this.right-u);else{let p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+X(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}let f=X(r,d,d+u);a.textAlign=o.textAlign(We(r)),a.textBaseline="middle",a.strokeStyle=t.color,a.fillStyle=t.color,a.font=s.string,St(a,t.text,f,h,s)}_computeTitleHeight(){let e=this.options.title,t=j(e.font),s=K(e.padding);return e.display?t.lineHeight+s.height:0}_getLegendItemAt(e,t){let s,n,o;if(ct(e,this.left,this.right)&&ct(t,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],ct(e,n.left,n.left+n.width)&&ct(t,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(e){let t=this.options;if(!sh(e.type,t))return;let s=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){let n=this._hoveredItem,o=Qc(n,s);n&&!o&&I(t.onLeave,[e,n,this],this),this._hoveredItem=s,s&&!o&&I(t.onHover,[e,s,this],this)}else s&&I(t.onClick,[e,s,this],this)}};function th(i,e,t,s,n){let o=eh(s,i,e,t),a=ih(n,s,e.lineHeight);return{itemWidth:o,itemHeight:a}}function eh(i,e,t,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,a)=>o.length>a.length?o:a)),e+t.size/2+s.measureText(n).width}function ih(i,e,t){let s=i;return typeof e.text!="string"&&(s=Go(e,t)),s}function Go(i,e){let t=i.text?i.text.length:0;return e*t}function sh(i,e){return!!((i==="mousemove"||i==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(i==="click"||i==="mouseup"))}var nh={id:"legend",_element:li,start(i,e,t){let s=i.legend=new li({ctx:i.ctx,options:t,chart:i});G.configure(i,s,t),G.addBox(i,s)},stop(i){G.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,e,t){let s=i.legend;G.configure(i,s,t),s.options=t},afterUpdate(i){let e=i.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(i,e){e.replay||i.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,e,t){let s=e.datasetIndex,n=t.chart;n.isDatasetVisible(s)?(n.hide(s),e.hidden=!0):(n.show(s),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){let e=i.data.datasets,{labels:{usePointStyle:t,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{let c=l.controller.getStyle(t?0:void 0),h=K(c.borderWidth);return{text:e[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)}}},ve=class extends ot{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.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(e,t){let 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=e,this.height=this.bottom=t;let n=z(s.text)?s.text.length:1;this._padding=K(s.padding);let o=n*j(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){let{top:t,left:s,bottom:n,right:o,options:a}=this,r=a.align,l=0,c,h,d;return this.isHorizontal()?(h=X(r,s,o),d=t+e,c=o-s):(a.position==="left"?(h=s+e,d=X(r,n,t),l=L*-.5):(h=o-e,d=X(r,t,n),l=L*.5),c=n-t),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let s=j(t.font),o=s.lineHeight/2+this._padding.top,{titleX:a,titleY:r,maxWidth:l,rotation:c}=this._drawArgs(o);St(e,t.text,0,0,s,{color:t.color,maxWidth:l,rotation:c,textAlign:We(t.align),textBaseline:"middle",translation:[a,r]})}};function oh(i,e){let t=new ve({ctx:i.ctx,options:e,chart:i});G.configure(i,t,e),G.addBox(i,t),i.titleBlock=t}var ah={id:"title",_element:ve,start(i,e,t){oh(i,t)},stop(i){let e=i.titleBlock;G.removeBox(i,e),delete i.titleBlock},beforeUpdate(i,e,t){let s=i.titleBlock;G.configure(i,s,t),s.options=t},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}},Je=new WeakMap,rh={id:"subtitle",start(i,e,t){let s=new ve({ctx:i.ctx,options:t,chart:i});G.configure(i,s,t),G.addBox(i,s),Je.set(i,s)},stop(i){G.removeBox(i,Je.get(i)),Je.delete(i)},beforeUpdate(i,e,t){let s=Je.get(i);G.configure(i,s,t),s.options=t},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}},_e={average(i){if(!i.length)return!1;let e,t,s=new Set,n=0,o=0;for(e=0,t=i.length;e<t;++e){let r=i[e].element;if(r&&r.hasValue()){let 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,e){if(!i.length)return!1;let t=e.x,s=e.y,n=Number.POSITIVE_INFINITY,o,a,r;for(o=0,a=i.length;o<a;++o){let l=i[o].element;if(l&&l.hasValue()){let c=l.getCenterPoint(),h=Fe(e,c);h<n&&(n=h,r=l)}}if(r){let l=r.tooltipPosition();t=l.x,s=l.y}return{x:t,y:s}}};function ht(i,e){return e&&(z(e)?Array.prototype.push.apply(i,e):i.push(e)),i}function xt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
2
+ `)>-1?i.split(`
3
+ `):i}function lh(i,e){let{element:t,datasetIndex:s,index:n}=e,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:t}}function mo(i,e){let t=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:a,boxHeight:r}=e,l=j(e.bodyFont),c=j(e.titleFont),h=j(e.footerFont),d=o.length,u=n.length,f=s.length,p=K(e.padding),g=p.height,m=0,b=s.reduce((M,_)=>M+_.before.length+_.lines.length+_.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),b){let M=e.displayColors?Math.max(r,l.lineHeight):l.lineHeight;g+=f*M+(b-f)*l.lineHeight+(b-1)*e.bodySpacing}u&&(g+=e.footerMarginTop+u*h.lineHeight+(u-1)*e.footerSpacing);let x=0,y=function(M){m=Math.max(m,t.measureText(M).width+x)};return t.save(),t.font=c.string,R(i.title,y),t.font=l.string,R(i.beforeBody.concat(i.afterBody),y),x=e.displayColors?a+2+e.boxPadding:0,R(s,M=>{R(M.before,y),R(M.lines,y),R(M.after,y)}),x=0,t.font=h.string,R(i.footer,y),t.restore(),m+=p.width,{width:m,height:g}}function ch(i,e){let{y:t,height:s}=e;return t<s/2?"top":t>i.height-s/2?"bottom":"center"}function hh(i,e,t,s){let{x:n,width:o}=s,a=t.caretSize+t.caretPadding;if(i==="left"&&n+o+a>e.width||i==="right"&&n-o-a<0)return!0}function dh(i,e,t,s){let{x:n,width:o}=t,{width:a,chartArea:{left:r,right:l}}=i,c="center";return s==="center"?c=n<=(r+l)/2?"left":"right":n<=o/2?c="left":n>=a-o/2&&(c="right"),hh(c,i,e,t)&&(c="center"),c}function bo(i,e,t){let s=t.yAlign||e.yAlign||ch(i,t);return{xAlign:t.xAlign||e.xAlign||dh(i,e,t,s),yAlign:s}}function uh(i,e){let{x:t,width:s}=i;return e==="right"?t-=s:e==="center"&&(t-=s/2),t}function fh(i,e,t){let{y:s,height:n}=i;return e==="top"?s+=t:e==="bottom"?s-=n+t:s-=n/2,s}function xo(i,e,t,s){let{caretSize:n,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=t,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=wt(a),p=uh(e,r),g=fh(e,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:Y(p,0,s.width-e.width),y:Y(g,0,s.height-e.height)}}function Qe(i,e,t){let s=K(t.padding);return e==="center"?i.x+i.width/2:e==="right"?i.x+i.width-s.right:i.x+s.left}function _o(i){return ht([],xt(i))}function gh(i,e,t){return mt(i,{tooltip:e,tooltipItems:t,type:"tooltip"})}function yo(i,e){let t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?i.override(t):i}var Zo={beforeTitle:lt,title(i){if(i.length>0){let e=i[0],t=e.chart.data.labels,s=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex<s)return t[e.dataIndex]}return""},afterTitle:lt,beforeBody:lt,beforeLabel:lt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let e=i.dataset.label||"";e&&(e+=": ");let t=i.formattedValue;return O(t)||(e+=t),e},labelColor(i){let t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){let t=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:lt,afterBody:lt,beforeFooter:lt,footer:lt,afterFooter:lt};function J(i,e,t,s){let n=i[e].call(t,s);return typeof n>"u"?Zo[e].call(t,s):n}var vo=(()=>{class i extends ot{static positioners=_e;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){let t=this._cachedAnimations;if(t)return t;let s=this.chart,n=this.options.setContext(this.getContext()),o=n.enabled&&s.options.animation&&n.animations,a=new si(this.chart,o);return o._cacheable&&(this._cachedAnimations=Object.freeze(a)),a}getContext(){return this.$context||(this.$context=gh(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,s){let{callbacks:n}=s,o=J(n,"beforeTitle",this,t),a=J(n,"title",this,t),r=J(n,"afterTitle",this,t),l=[];return l=ht(l,xt(o)),l=ht(l,xt(a)),l=ht(l,xt(r)),l}getBeforeBody(t,s){return _o(J(s.callbacks,"beforeBody",this,t))}getBody(t,s){let{callbacks:n}=s,o=[];return R(t,a=>{let r={before:[],lines:[],after:[]},l=yo(n,a);ht(r.before,xt(J(l,"beforeLabel",this,a))),ht(r.lines,J(l,"label",this,a)),ht(r.after,xt(J(l,"afterLabel",this,a))),o.push(r)}),o}getAfterBody(t,s){return _o(J(s.callbacks,"afterBody",this,t))}getFooter(t,s){let{callbacks:n}=s,o=J(n,"beforeFooter",this,t),a=J(n,"footer",this,t),r=J(n,"afterFooter",this,t),l=[];return l=ht(l,xt(o)),l=ht(l,xt(a)),l=ht(l,xt(r)),l}_createItems(t){let s=this._active,n=this.chart.data,o=[],a=[],r=[],l=[],c,h;for(c=0,h=s.length;c<h;++c)l.push(lh(this.chart,s[c]));return t.filter&&(l=l.filter((d,u,f)=>t.filter(d,u,f,n))),t.itemSort&&(l=l.sort((d,u)=>t.itemSort(d,u,n))),R(l,d=>{let u=yo(t.callbacks,d);o.push(J(u,"labelColor",this,d)),a.push(J(u,"labelPointStyle",this,d)),r.push(J(u,"labelTextColor",this,d))}),this.labelColors=o,this.labelPointStyles=a,this.labelTextColors=r,this.dataPoints=l,l}update(t,s){let n=this.options.setContext(this.getContext()),o=this._active,a,r=[];if(!o.length)this.opacity!==0&&(a={opacity:0});else{let l=_e[n.position].call(this,o,this._eventPosition);r=this._createItems(n),this.title=this.getTitle(r,n),this.beforeBody=this.getBeforeBody(r,n),this.body=this.getBody(r,n),this.afterBody=this.getAfterBody(r,n),this.footer=this.getFooter(r,n);let c=this._size=mo(this,n),h=Object.assign({},l,c),d=bo(this.chart,n,h),u=xo(n,h,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,a={opacity:1,x:u.x,y:u.y,width:c.width,height:c.height,caretX:l.x,caretY:l.y}}this._tooltipItems=r,this.$context=void 0,a&&this._resolveAnimations().update(this,a),t&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:s})}drawCaret(t,s,n,o){let a=this.getCaretPosition(t,n,o);s.lineTo(a.x1,a.y1),s.lineTo(a.x2,a.y2),s.lineTo(a.x3,a.y3)}getCaretPosition(t,s,n){let{xAlign:o,yAlign:a}=this,{caretSize:r,cornerRadius:l}=n,{topLeft:c,topRight:h,bottomLeft:d,bottomRight:u}=wt(l),{x:f,y:p}=t,{width:g,height:m}=s,b,x,y,M,_,v;return a==="center"?(_=p+m/2,o==="left"?(b=f,x=b-r,M=_+r,v=_-r):(b=f+g,x=b+r,M=_-r,v=_+r),y=b):(o==="left"?x=f+Math.max(c,d)+r:o==="right"?x=f+g-Math.max(h,u)-r:x=this.caretX,a==="top"?(M=p,_=M-r,b=x-r,y=x+r):(M=p+m,_=M+r,b=x+r,y=x-r),v=M),{x1:b,x2:x,x3:y,y1:M,y2:_,y3:v}}drawTitle(t,s,n){let o=this.title,a=o.length,r,l,c;if(a){let h=It(n.rtl,this.x,this.width);for(t.x=Qe(this,n.titleAlign,n),s.textAlign=h.textAlign(n.titleAlign),s.textBaseline="middle",r=j(n.titleFont),l=n.titleSpacing,s.fillStyle=n.titleColor,s.font=r.string,c=0;c<a;++c)s.fillText(o[c],h.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+l,c+1===a&&(t.y+=n.titleMarginBottom-l)}}_drawColorBox(t,s,n,o,a){let r=this.labelColors[n],l=this.labelPointStyles[n],{boxHeight:c,boxWidth:h}=a,d=j(a.bodyFont),u=Qe(this,"left",a),f=o.x(u),p=c<d.lineHeight?(d.lineHeight-c)/2:0,g=s.y+p;if(a.usePointStyle){let m={radius:Math.min(h,c)/2,pointStyle:l.pointStyle,rotation:l.rotation,borderWidth:1},b=o.leftForLtr(f,h)+h/2,x=g+c/2;t.strokeStyle=a.multiKeyBackground,t.fillStyle=a.multiKeyBackground,je(t,m,b,x),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,je(t,m,b,x)}else{t.lineWidth=A(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;let m=o.leftForLtr(f,h),b=o.leftForLtr(o.xPlus(f,1),h-2),x=wt(r.borderRadius);Object.values(x).some(y=>y!==0)?(t.beginPath(),t.fillStyle=a.multiKeyBackground,Gt(t,{x:m,y:g,w:h,h:c,radius:x}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Gt(t,{x:b,y:g+1,w:h-2,h:c-2,radius:x}),t.fill()):(t.fillStyle=a.multiKeyBackground,t.fillRect(m,g,h,c),t.strokeRect(m,g,h,c),t.fillStyle=r.backgroundColor,t.fillRect(b,g+1,h-2,c-2))}t.fillStyle=this.labelTextColors[n]}drawBody(t,s,n){let{body:o}=this,{bodySpacing:a,bodyAlign:r,displayColors:l,boxHeight:c,boxWidth:h,boxPadding:d}=n,u=j(n.bodyFont),f=u.lineHeight,p=0,g=It(n.rtl,this.x,this.width),m=function(w){s.fillText(w,g.x(t.x+p),t.y+f/2),t.y+=f+a},b=g.textAlign(r),x,y,M,_,v,S,k;for(s.textAlign=r,s.textBaseline="middle",s.font=u.string,t.x=Qe(this,b,n),s.fillStyle=n.bodyColor,R(this.beforeBody,m),p=l&&b!=="right"?r==="center"?h/2+d:h+2+d:0,_=0,S=o.length;_<S;++_){for(x=o[_],y=this.labelTextColors[_],s.fillStyle=y,R(x.before,m),M=x.lines,l&&M.length&&(this._drawColorBox(s,t,_,g,n),f=Math.max(u.lineHeight,c)),v=0,k=M.length;v<k;++v)m(M[v]),f=u.lineHeight;R(x.after,m)}p=0,f=u.lineHeight,R(this.afterBody,m),t.y-=a}drawFooter(t,s,n){let o=this.footer,a=o.length,r,l;if(a){let c=It(n.rtl,this.x,this.width);for(t.x=Qe(this,n.footerAlign,n),t.y+=n.footerMarginTop,s.textAlign=c.textAlign(n.footerAlign),s.textBaseline="middle",r=j(n.footerFont),s.fillStyle=n.footerColor,s.font=r.string,l=0;l<a;++l)s.fillText(o[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+n.footerSpacing}}drawBackground(t,s,n,o){let{xAlign:a,yAlign:r}=this,{x:l,y:c}=t,{width:h,height:d}=n,{topLeft:u,topRight:f,bottomLeft:p,bottomRight:g}=wt(o.cornerRadius);s.fillStyle=o.backgroundColor,s.strokeStyle=o.borderColor,s.lineWidth=o.borderWidth,s.beginPath(),s.moveTo(l+u,c),r==="top"&&this.drawCaret(t,s,n,o),s.lineTo(l+h-f,c),s.quadraticCurveTo(l+h,c,l+h,c+f),r==="center"&&a==="right"&&this.drawCaret(t,s,n,o),s.lineTo(l+h,c+d-g),s.quadraticCurveTo(l+h,c+d,l+h-g,c+d),r==="bottom"&&this.drawCaret(t,s,n,o),s.lineTo(l+p,c+d),s.quadraticCurveTo(l,c+d,l,c+d-p),r==="center"&&a==="left"&&this.drawCaret(t,s,n,o),s.lineTo(l,c+u),s.quadraticCurveTo(l,c,l+u,c),s.closePath(),s.fill(),o.borderWidth>0&&s.stroke()}_updateAnimationTarget(t){let s=this.chart,n=this.$animations,o=n&&n.x,a=n&&n.y;if(o||a){let r=_e[t.position].call(this,this._active,this._eventPosition);if(!r)return;let l=this._size=mo(this,t),c=Object.assign({},r,this._size),h=bo(s,t,c),d=xo(t,c,h,s);(o._to!==d.x||a._to!==d.y)&&(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=l.width,this.height=l.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){let s=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(s);let o={width:this.width,height:this.height},a={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let r=K(s.padding),l=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;s.enabled&&l&&(t.save(),t.globalAlpha=n,this.drawBackground(a,t,o,s),Ui(t,s.textDirection),a.y+=r.top,this.drawTitle(a,t,s),this.drawBody(a,t,s),this.drawFooter(a,t,s),Xi(t,s.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,s){let n=this._active,o=t.map(({datasetIndex:l,index:c})=>{let h=this.chart.getDatasetMeta(l);if(!h)throw new Error("Cannot find a dataset at index "+l);return{datasetIndex:l,element:h.data[c],index:c}}),a=!ce(n,o),r=this._positionChanged(o,s);(a||r)&&(this._active=o,this._eventPosition=s,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,s,n=!0){if(s&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let o=this.options,a=this._active||[],r=this._getActiveElements(t,a,s,n),l=this._positionChanged(r,t),c=s||!ce(r,a)||l;return c&&(this._active=r,(o.enabled||o.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,s))),c}_getActiveElements(t,s,n,o){let a=this.options;if(t.type==="mouseout")return[];if(!o)return s.filter(l=>this.chart.data.datasets[l.datasetIndex]&&this.chart.getDatasetMeta(l.datasetIndex).controller.getParsed(l.index)!==void 0);let r=this.chart.getElementsAtEventForMode(t,a.mode,a,n);return a.reverse&&r.reverse(),r}_positionChanged(t,s){let{caretX:n,caretY:o,options:a}=this,r=_e[a.position].call(this,t,s);return r!==!1&&(n!==r.x||o!==r.y)}}return i})(),ph={id:"tooltip",_element:vo,positioners:_e,afterInit(i,e,t){t&&(i.tooltip=new vo({chart:i,options:t}))},beforeUpdate(i,e,t){i.tooltip&&i.tooltip.initialize(t)},reset(i,e,t){i.tooltip&&i.tooltip.initialize(t)},afterDraw(i){let e=i.tooltip;if(e&&e._willRender()){let t={tooltip:e};if(i.notifyPlugins("beforeTooltipDraw",Ce(we({},t),{cancelable:!0}))===!1)return;e.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",t)}},afterEvent(i,e){if(i.tooltip){let t=e.replay;i.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.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,e)=>e.bodyFont.size,boxWidth:(i,e)=>e.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:Zo},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"]},mh=Object.freeze({__proto__:null,Colors:Dc,Decimation:Lc,Filler:Jc,Legend:nh,SubTitle:rh,Title:ah,Tooltip:ph}),bh=(i,e,t,s)=>(typeof e=="string"?(t=i.push(e)-1,s.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function xh(i,e,t,s){let n=i.indexOf(e);if(n===-1)return bh(i,e,t,s);let o=i.lastIndexOf(e);return n!==o?t:n}var _h=(i,e)=>i===null?null:Y(Math.round(i),0,e);function Mo(i){let e=this.getLabels();return i>=0&&i<e.length?e[i]:i}var yh=(()=>{class i extends Bt{static id="category";static defaults={ticks:{callback:Mo}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){let s=this._addedLabels;if(s.length){let n=this.getLabels();for(let{index:o,label:a}of s)n[o]===a&&n.splice(o,1);this._addedLabels=[]}super.init(t)}parse(t,s){if(O(t))return null;let n=this.getLabels();return s=isFinite(s)&&n[s]===t?s:xh(n,t,C(s,t),this._addedLabels),_h(s,n.length-1)}determineDataLimits(){let{minDefined:t,maxDefined:s}=this.getUserBounds(),{min:n,max:o}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(n=0),s||(o=this.getLabels().length-1)),this.min=n,this.max=o}buildTicks(){let t=this.min,s=this.max,n=this.options.offset,o=[],a=this.getLabels();a=t===0&&s===a.length-1?a:a.slice(t,s+1),this._valueRange=Math.max(a.length-(n?0:1),1),this._startValue=this.min-(n?.5:0);for(let r=t;r<=s;r++)o.push({value:r});return o}getLabelForValue(t){return Mo.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){let s=this.ticks;return t<0||t>s.length-1?null:this.getPixelForValue(s[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}return i})();function vh(i,e){let t=[],{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:g,max:m}=e,b=!O(a),x=!O(r),y=!O(c),M=(m-g)/(d+1),_=wi((m-g)/p/f)*f,v,S,k,w;if(_<1e-14&&!b&&!x)return[{value:g},{value:m}];w=Math.ceil(m/_)-Math.floor(g/_),w>p&&(_=wi(w*_/p/f)*f),O(l)||(v=Math.pow(10,l),_=Math.ceil(_*v)/v),n==="ticks"?(S=Math.floor(g/_)*_,k=Math.ceil(m/_)*_):(S=g,k=m),b&&x&&o&&rn((r-a)/o,_/1e3)?(w=Math.round(Math.min((r-a)/_,h)),_=(r-a)/w,S=a,k=r):y?(S=b?a:S,k=x?r:k,w=c-1,_=(k-S)/w):(w=(k-S)/_,Xt(w,Math.round(w),_/1e3)?w=Math.round(w):w=Math.ceil(w));let D=Math.max(Pi(_),Pi(S));v=Math.pow(10,O(l)?D:l),S=Math.round(S*v)/v,k=Math.round(k*v)/v;let P=0;for(b&&(u&&S!==a?(t.push({value:a}),S<a&&P++,Xt(Math.round((S+P*_)*v)/v,a,ko(a,M,i))&&P++):S<a&&P++);P<w;++P){let T=Math.round((S+P*_)*v)/v;if(x&&T>r)break;t.push({value:T})}return x&&u&&k!==r?t.length&&Xt(t[t.length-1].value,r,ko(r,M,i))?t[t.length-1].value=r:t.push({value:r}):(!x||k===r)&&t.push({value:k}),t}function ko(i,e,{horizontal:t,minRotation:s}){let n=it(s),o=(t?Math.sin(n):Math.cos(n))||.001,a=.75*e*(""+i).length;return Math.min(e/o,a)}var te=class extends Bt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return O(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:s}=this.getUserBounds(),{min:n,max:o}=this,a=l=>n=t?n:l,r=l=>o=s?o:l;if(e){let l=nt(n),c=nt(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),e||a(n-l)}this.min=n,this.max=o}getTickLimit(){let e=this.options.ticks,{maxTicksLimit:t,stepSize:s}=e,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(),t=t||11),t&&(n=Math.min(t,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let e=this.options,t=e.ticks,s=this.getTickLimit();s=Math.max(2,s);let n={maxTicks:s,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},o=this._range||this,a=vh(n,o);return e.bounds==="ticks"&&Ci(a,this,"value"),e.reverse?(a.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),a}configure(){let e=this.ticks,t=this.min,s=this.max;if(super.configure(),this.options.offset&&e.length){let n=(s-t)/Math.max(e.length-1,1)/2;t-=n,s+=n}this._startValue=t,this._endValue=s,this._valueRange=s-t}getLabelForValue(e){return qt(e,this.chart.options.locale,this.options.ticks.format)}},ks=class extends te{static id="linear";static defaults={ticks:{callback:he.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=N(e)?e:0,this.max=N(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,s=it(this.options.ticks.minRotation),n=(e?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,o.lineHeight/n))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},Me=i=>Math.floor(gt(i)),zt=(i,e)=>Math.pow(10,Me(i)+e);function So(i){return i/Math.pow(10,Me(i))===1}function wo(i,e,t){let s=Math.pow(10,t),n=Math.floor(i/s);return Math.ceil(e/s)-n}function Mh(i,e){let t=e-i,s=Me(t);for(;wo(i,e,s)>10;)s++;for(;wo(i,e,s)<10;)s--;return Math.min(s,Me(i))}function kh(i,{min:e,max:t}){e=Z(i.min,e);let s=[],n=Me(e),o=Mh(e,t),a=o<0?Math.pow(10,Math.abs(o)):1,r=Math.pow(10,o),l=n>o?Math.pow(10,n):0,c=Math.round((e-l)*a)/a,h=Math.floor((e-l)/r/10)*r*10,d=Math.floor((c-h)/Math.pow(10,o)),u=Z(i.min,Math.round((l+h+d*Math.pow(10,o))*a)/a);for(;u<t;)s.push({value:u,major:So(u),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,a=o>=0?1:a),u=Math.round((l+h+d*Math.pow(10,o))*a)/a;let f=Z(i.max,u);return s.push({value:f,major:So(f),significand:d}),s}var Ss=class extends Bt{static id="logarithmic";static defaults={ticks:{callback:he.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let s=te.prototype.parse.apply(this,[e,t]);if(s===0){this._zero=!0;return}return N(s)&&s>0?s:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=N(e)?Math.max(0,e):null,this.max=N(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!N(this._userMin)&&(this.min=e===zt(this.min,0)?zt(this.min,-1):zt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),s=this.min,n=this.max,o=r=>s=e?s:r,a=r=>n=t?n:r;s===n&&(s<=0?(o(1),a(10)):(o(zt(s,-1)),a(zt(n,1)))),s<=0&&o(zt(n,-1)),n<=0&&a(zt(s,1)),this.min=s,this.max=n}buildTicks(){let e=this.options,t={min:this._userMin,max:this._userMax},s=kh(t,this);return e.bounds==="ticks"&&Ci(s,this,"value"),e.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(e){return e===void 0?"0":qt(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=gt(e),this._valueRange=gt(this.max)-gt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(gt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}};function ws(i){let e=i.ticks;if(e.display&&i.display){let t=K(e.backdropPadding);return C(e.font&&e.font.size,F.font.size)+t.height}return 0}function Sh(i,e,t){return t=z(t)?t:[t],{w:mn(i,e.string,t),h:t.length*e.lineHeight}}function Co(i,e,t,s,n){return i===s||i===n?{start:e-t/2,end:e+t/2}:i<s||i>n?{start:e-t,end:e}:{start:e,end:e+t}}function wh(i){let e={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},t=Object.assign({},e),s=[],n=[],o=i._pointLabels.length,a=i.options.pointLabels,r=a.centerPointLabels?L/o:0;for(let l=0;l<o;l++){let c=a.setContext(i.getPointLabelContext(l));n[l]=c.padding;let h=i.getPointPosition(l,i.drawingArea+n[l],r),d=j(c.font),u=Sh(i.ctx,d,i._pointLabels[l]);s[l]=u;let f=U(i.getIndexAngle(l)+r),p=Math.round(Ve(f)),g=Co(p,h.x,u.w,0,180),m=Co(p,h.y,u.h,90,270);Ch(t,e,f,g,m)}i.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),i._pointLabelItems=Oh(i,s,n)}function Ch(i,e,t,s,n){let o=Math.abs(Math.sin(t)),a=Math.abs(Math.cos(t)),r=0,l=0;s.start<e.l?(r=(e.l-s.start)/o,i.l=Math.min(i.l,e.l-r)):s.end>e.r&&(r=(s.end-e.r)/o,i.r=Math.max(i.r,e.r+r)),n.start<e.t?(l=(e.t-n.start)/a,i.t=Math.min(i.t,e.t-l)):n.end>e.b&&(l=(n.end-e.b)/a,i.b=Math.max(i.b,e.b+l))}function Ph(i,e,t){let s=i.drawingArea,{extra:n,additionalAngle:o,padding:a,size:r}=t,l=i.getPointPosition(e,s+n+a,o),c=Math.round(Ve(U(l.angle+W))),h=Lh(l.y,r.h,c),d=Ah(c),u=Th(l.x,r.w,d);return{visible:!0,x:l.x,y:h,textAlign:d,left:u,top:h,right:u+r.w,bottom:h+r.h}}function Dh(i,e){if(!e)return!0;let{left:t,top:s,right:n,bottom:o}=i;return!(rt({x:t,y:s},e)||rt({x:t,y:o},e)||rt({x:n,y:s},e)||rt({x:n,y:o},e))}function Oh(i,e,t){let s=[],n=i._pointLabels.length,o=i.options,{centerPointLabels:a,display:r}=o.pointLabels,l={extra:ws(o)/2,additionalAngle:a?L/n:0},c;for(let h=0;h<n;h++){l.padding=t[h],l.size=e[h];let d=Ph(i,h,l);s.push(d),r==="auto"&&(d.visible=Dh(d,c),d.visible&&(c=d))}return s}function Ah(i){return i===0||i===180?"center":i<180?"left":"right"}function Th(i,e,t){return t==="right"?i-=e:t==="center"&&(i-=e/2),i}function Lh(i,e,t){return t===90||t===270?i-=e/2:(t>270||t<90)&&(i-=e),i}function Rh(i,e,t){let{left:s,top:n,right:o,bottom:a}=t,{backdropColor:r}=e;if(!O(r)){let l=wt(e.borderRadius),c=K(e.backdropPadding);i.fillStyle=r;let h=s-c.left,d=n-c.top,u=o-s+c.width,f=a-n+c.height;Object.values(l).some(p=>p!==0)?(i.beginPath(),Gt(i,{x:h,y:d,w:u,h:f,radius:l}),i.fill()):i.fillRect(h,d,u,f)}}function Eh(i,e){let{ctx:t,options:{pointLabels:s}}=i;for(let n=e-1;n>=0;n--){let o=i._pointLabelItems[n];if(!o.visible)continue;let a=s.setContext(i.getPointLabelContext(n));Rh(t,a,o);let r=j(a.font),{x:l,y:c,textAlign:h}=o;St(t,i._pointLabels[n],l,c+r.lineHeight/2,r,{color:a.color,textAlign:h,textBaseline:"middle"})}}function Jo(i,e,t,s){let{ctx:n}=i;if(t)n.arc(i.xCenter,i.yCenter,e,0,B);else{let o=i.getPointPosition(0,e);n.moveTo(o.x,o.y);for(let a=1;a<s;a++)o=i.getPointPosition(a,e),n.lineTo(o.x,o.y)}}function Ih(i,e,t,s,n){let o=i.ctx,a=e.circular,{color:r,lineWidth:l}=e;!a&&!s||!r||!l||t<0||(o.save(),o.strokeStyle=r,o.lineWidth=l,o.setLineDash(n.dash||[]),o.lineDashOffset=n.dashOffset,o.beginPath(),Jo(i,t,a,s),o.closePath(),o.stroke(),o.restore())}function Fh(i,e,t){return mt(i,{label:t,index:e,type:"pointLabel"})}var Cs=class extends te{static id="radialLinear";static defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:he.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let e=this._padding=K(ws(this.options)/2),t=this.width=this.maxWidth-e.width,s=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+s/2+e.top),this.drawingArea=Math.floor(Math.min(t,s)/2)}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!1);this.min=N(e)&&!isNaN(e)?e:0,this.max=N(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ws(this.options))}generateTickLabels(e){te.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,s)=>{let n=I(this.options.pointLabels.callback,[t,s],this);return n||n===0?n:""}).filter((t,s)=>this.chart.getDataVisibility(s))}fit(){let e=this.options;e.display&&e.pointLabels.display?wh(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,s,n){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,s,n))}getIndexAngle(e){let t=B/(this._pointLabels.length||1),s=this.options.startAngle||0;return U(e*t+it(s))}getDistanceFromCenterForValue(e){if(O(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(O(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e<t.length){let s=t[e];return Fh(this.getContext(),e,s)}}getPointPosition(e,t,s=0){let n=this.getIndexAngle(e)-W+s;return{x:Math.cos(n)*t+this.xCenter,y:Math.sin(n)*t+this.yCenter,angle:n}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){let{left:t,top:s,right:n,bottom:o}=this._pointLabelItems[e];return{left:t,top:s,right:n,bottom:o}}drawBackground(){let{backgroundColor:e,grid:{circular:t}}=this.options;if(e){let s=this.ctx;s.save(),s.beginPath(),Jo(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),s.closePath(),s.fillStyle=e,s.fill(),s.restore()}}drawGrid(){let e=this.ctx,t=this.options,{angleLines:s,grid:n,border:o}=t,a=this._pointLabels.length,r,l,c;if(t.pointLabels.display&&Eh(this,a),n.display&&this.ticks.forEach((h,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(h.value);let u=this.getContext(d),f=n.setContext(u),p=o.setContext(u);Ih(this,f,l,a,p)}}),s.display){for(e.save(),r=a-1;r>=0;r--){let h=s.setContext(this.getPointLabelContext(r)),{color:d,lineWidth:u}=h;!u||!d||(e.lineWidth=u,e.strokeStyle=d,e.setLineDash(h.borderDash),e.lineDashOffset=h.borderDashOffset,l=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(r,l),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,s=t.ticks;if(!s.display)return;let n=this.getIndexAngle(0),o,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(n),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!t.reverse)return;let c=s.setContext(this.getContext(l)),h=j(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){e.font=h.string,a=e.measureText(r.label).width,e.fillStyle=c.backdropColor;let d=K(c.backdropPadding);e.fillRect(-a/2-d.left,-o-h.size/2-d.top,a+d.width,h.size+d.height)}St(e,r.label,0,-o,h,{color:c.color,strokeColor:c.textStrokeColor,strokeWidth:c.textStrokeWidth})}),e.restore()}drawTitle(){}},ui={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}},Q=Object.keys(ui);function Po(i,e){return i-e}function Do(i,e){if(O(e))return null;let t=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts,a=e;return typeof s=="function"&&(a=s(a)),N(a)||(a=typeof s=="string"?t.parse(a,s):t.parse(a)),a===null?null:(n&&(a=n==="week"&&(Et(o)||o===!0)?t.startOf(a,"isoWeek",o):t.startOf(a,n)),+a)}function Oo(i,e,t,s){let n=Q.length;for(let o=Q.indexOf(i);o<n-1;++o){let a=ui[Q[o]],r=a.steps?a.steps:Number.MAX_SAFE_INTEGER;if(a.common&&Math.ceil((t-e)/(r*a.size))<=s)return Q[o]}return Q[n-1]}function zh(i,e,t,s,n){for(let o=Q.length-1;o>=Q.indexOf(t);o--){let a=Q[o];if(ui[a].common&&i._adapter.diff(n,s,a)>=e-1)return a}return Q[t?Q.indexOf(t):0]}function Bh(i){for(let e=Q.indexOf(i)+1,t=Q.length;e<t;++e)if(ui[Q[e]].common)return Q[e]}function Ao(i,e,t){if(!t)i[e]=!0;else if(t.length){let{lo:s,hi:n}=Ne(t,e),o=t[s]>=e?t[s]:t[n];i[o]=!0}}function Vh(i,e,t,s){let n=i._adapter,o=+n.startOf(e[0].value,s),a=e[e.length-1].value,r,l;for(r=o;r<=a;r=+n.add(r,1,s))l=t[r],l>=0&&(e[l].major=!0);return e}function To(i,e,t){let s=[],n={},o=e.length,a,r;for(a=0;a<o;++a)r=e[a],n[r]=a,s.push({value:r,major:!1});return o===0||!t?s:Vh(i,s,n,t)}var Ps=(()=>{class i extends Bt{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};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,s={}){let n=t.time||(t.time={}),o=this._adapter=new Gr._date(t.adapters.date);o.init(s),$t(n.displayFormats,o.formats()),this._parseOpts={parser:n.parser,round:n.round,isoWeekday:n.isoWeekday},super.init(t),this._normalized=s.normalized}parse(t,s){return t===void 0?null:Do(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,s=this._adapter,n=t.time.unit||"day",{min:o,max:a,minDefined:r,maxDefined:l}=this.getUserBounds();function c(h){!r&&!isNaN(h.min)&&(o=Math.min(o,h.min)),!l&&!isNaN(h.max)&&(a=Math.max(a,h.max))}(!r||!l)&&(c(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&c(this.getMinMax(!1))),o=N(o)&&!isNaN(o)?o:+s.startOf(Date.now(),n),a=N(a)&&!isNaN(a)?a:+s.endOf(Date.now(),n)+1,this.min=Math.min(o,a-1),this.max=Math.max(o+1,a)}_getLabelBounds(){let t=this.getLabelTimestamps(),s=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;return t.length&&(s=t[0],n=t[t.length-1]),{min:s,max:n}}buildTicks(){let t=this.options,s=t.time,n=t.ticks,o=n.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&o.length&&(this.min=this._userMin||o[0],this.max=this._userMax||o[o.length-1]);let a=this.min,r=this.max,l=hn(o,a,r);return this._unit=s.unit||(n.autoSkip?Oo(s.minUnit,this.min,this.max,this._getLabelCapacity(a)):zh(this,l.length,s.minUnit,this.min,this.max)),this._majorUnit=!n.major.enabled||this._unit==="year"?void 0:Bh(this._unit),this.initOffsets(o),t.reverse&&l.reverse(),To(this,l,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let s=0,n=0,o,a;this.options.offset&&t.length&&(o=this.getDecimalForValue(t[0]),t.length===1?s=1-o:s=(this.getDecimalForValue(t[1])-o)/2,a=this.getDecimalForValue(t[t.length-1]),t.length===1?n=a:n=(a-this.getDecimalForValue(t[t.length-2]))/2);let r=t.length<3?.5:.25;s=Y(s,0,r),n=Y(n,0,r),this._offsets={start:s,end:n,factor:1/(s+1+n)}}_generate(){let t=this._adapter,s=this.min,n=this.max,o=this.options,a=o.time,r=a.unit||Oo(a.minUnit,s,n,this._getLabelCapacity(s)),l=C(o.ticks.stepSize,1),c=r==="week"?a.isoWeekday:!1,h=Et(c)||c===!0,d={},u=s,f,p;if(h&&(u=+t.startOf(u,"isoWeek",c)),u=+t.startOf(u,h?"day":r),t.diff(n,s,r)>1e5*l)throw new Error(s+" and "+n+" are too far apart with stepSize of "+l+" "+r);let g=o.ticks.source==="data"&&this.getDataTimestamps();for(f=u,p=0;f<n;f=+t.add(f,l,r),p++)Ao(d,f,g);return(f===n||o.bounds==="ticks"||p===1)&&Ao(d,f,g),Object.keys(d).sort(Po).map(m=>+m)}getLabelForValue(t){let s=this._adapter,n=this.options.time;return n.tooltipFormat?s.format(t,n.tooltipFormat):s.format(t,n.displayFormats.datetime)}format(t,s){let o=this.options.time.displayFormats,a=this._unit,r=s||o[a];return this._adapter.format(t,r)}_tickFormatFunction(t,s,n,o){let a=this.options,r=a.ticks.callback;if(r)return I(r,[t,s,n],this);let l=a.time.displayFormats,c=this._unit,h=this._majorUnit,d=c&&l[c],u=h&&l[h],f=n[s],p=h&&u&&f&&f.major;return this._adapter.format(t,o||(p?u:d))}generateTickLabels(t){let s,n,o;for(s=0,n=t.length;s<n;++s)o=t[s],o.label=this._tickFormatFunction(o.value,s,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){let s=this._offsets,n=this.getDecimalForValue(t);return this.getPixelForDecimal((s.start+n)*s.factor)}getValueForPixel(t){let s=this._offsets,n=this.getDecimalForPixel(t)/s.factor-s.end;return this.min+n*(this.max-this.min)}_getLabelSize(t){let s=this.options.ticks,n=this.ctx.measureText(t).width,o=it(this.isHorizontal()?s.maxRotation:s.minRotation),a=Math.cos(o),r=Math.sin(o),l=this._resolveTickFontOptions(0).size;return{w:n*a+l*r,h:n*r+l*a}}_getLabelCapacity(t){let s=this.options.time,n=s.displayFormats,o=n[s.unit]||n.millisecond,a=this._tickFormatFunction(t,0,To(this,[t],this._majorUnit),o),r=this._getLabelSize(a),l=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return l>0?l:1}getDataTimestamps(){let t=this._cache.data||[],s,n;if(t.length)return t;let o=this.getMatchingVisibleMetas();if(this._normalized&&o.length)return this._cache.data=o[0].controller.getAllParsedValues(this);for(s=0,n=o.length;s<n;++s)t=t.concat(o[s].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){let t=this._cache.labels||[],s,n;if(t.length)return t;let o=this.getLabels();for(s=0,n=o.length;s<n;++s)t.push(Do(this,o[s]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Ai(t.sort(Po))}}return i})();function ti(i,e,t){let s=0,n=i.length-1,o,a,r,l;t?(e>=i[s].pos&&e<=i[n].pos&&({lo:s,hi:n}=at(i,"pos",e)),{pos:o,time:r}=i[s],{pos:a,time:l}=i[n]):(e>=i[s].time&&e<=i[n].time&&({lo:s,hi:n}=at(i,"time",e)),{time:o,pos:r}=i[s],{time:a,pos:l}=i[n]);let c=a-o;return c?r+(l-r)*(e-o)/c:r}var Ds=class extends Ps{static id="timeseries";static defaults=Ps.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=ti(t,this.min),this._tableRange=ti(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:s}=this,n=[],o=[],a,r,l,c,h;for(a=0,r=e.length;a<r;++a)c=e[a],c>=t&&c<=s&&n.push(c);if(n.length<2)return[{time:t,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(){let e=this.min,t=this.max,s=super.getDataTimestamps();return(!s.includes(e)||!s.length)&&s.splice(0,0,e),(!s.includes(t)||s.length===1)&&s.push(t),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),s=this.getLabelTimestamps();return t.length&&s.length?e=this.normalize(t.concat(s)):e=t.length?t:s,e=this._cache.all=e,e}getDecimalForValue(e){return(ti(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,s=this.getDecimalForPixel(e)/t.factor-t.end;return ti(this._table,s*this._tableRange+this._minPos,!0)}},Nh=Object.freeze({__proto__:null,CategoryScale:yh,LinearScale:ks,LogarithmicScale:Ss,RadialLinearScale:Cs,TimeScale:Ps,TimeSeriesScale:Ds}),Qo=[qr,vc,mh,Nh];var ta=new Rs("Configuration for ngCharts");function ad(...i){return{registerables:[...Qo,...i]}}function rd(...i){let e=gi({},...i);return{provide:ta,useValue:e}}var Wh=(()=>{let e=class e{constructor(){this.colorschemesOptions=new As(void 0)}setColorschemesOptions(s){this.pColorschemesOptions=s,this.colorschemesOptions.next(s)}getColorschemesOptions(){return this.pColorschemesOptions}};e.\u0275fac=function(n){return new(n||e)},e.\u0275prov=Ls({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})(),ld=(()=>{let e=class e{constructor(s,n,o,a){this.zone=n,this.themeService=o,this.type="bar",this.plugins=[],this.chartClick=new fi,this.chartHover=new fi,this.subs=[],this.themeOverrides={},a?.registerables&&ci.register(...a.registerables),a?.defaults&&F.set(a.defaults),this.ctx=s.nativeElement.getContext("2d"),this.subs.push(this.themeService.colorschemesOptions.pipe(Ts()).subscribe(r=>this.themeChanged(r)))}ngOnChanges(s){let n=["type"],o=Object.getOwnPropertyNames(s);if(o.some(a=>n.includes(a))||o.every(a=>s[a].isFirstChange()))this.render();else{let a=this.getChartConfiguration();this.chart&&(Object.assign(this.chart.config.data,a.data),this.chart.config.plugins&&Object.assign(this.chart.config.plugins,a.plugins),this.chart.config.options&&Object.assign(this.chart.config.options,a.options)),this.update()}}ngOnDestroy(){this.chart&&(this.chart.destroy(),this.chart=void 0),this.subs.forEach(s=>s.unsubscribe())}render(){return this.chart&&this.chart.destroy(),this.zone.runOutsideAngular(()=>this.chart=new ci(this.ctx,this.getChartConfiguration()))}update(s){this.chart&&this.zone.runOutsideAngular(()=>this.chart?.update(s))}hideDataset(s,n){this.chart&&(this.chart.getDatasetMeta(s).hidden=n,this.update())}isDatasetHidden(s){return this.chart?.getDatasetMeta(s)?.hidden}toBase64Image(){return this.chart?.toBase64Image()}themeChanged(s){this.themeOverrides=s,this.chart&&(this.chart.config.options&&Object.assign(this.chart.config.options,this.getChartOptions()),this.update())}getChartOptions(){return gi({onHover:(s,n)=>{!this.chartHover.observed&&!this.chartHover.observers?.length||this.zone.run(()=>this.chartHover.emit({event:s,active:n}))},onClick:(s,n)=>{!this.chartClick.observed&&!this.chartClick.observers?.length||this.zone.run(()=>this.chartClick.emit({event:s,active:n}))}},this.themeOverrides,this.options,{plugins:{legend:{display:this.legend}}})}getChartConfiguration(){return{type:this.type,data:this.getChartData(),options:this.getChartOptions(),plugins:this.plugins}}getChartData(){return this.data?this.data:{labels:this.labels||[],datasets:this.datasets||[]}}};e.\u0275fac=function(n){return new(n||e)(se(Is),se(zs),se(Wh),se(ta,8))},e.\u0275dir=Fs({type:e,selectors:[["canvas","baseChart",""]],inputs:{type:"type",legend:"legend",data:"data",options:"options",plugins:"plugins",labels:"labels",datasets:"datasets"},outputs:{chartClick:"chartClick",chartHover:"chartHover"},exportAs:["base-chart"],features:[Es]});let i=e;return i})();export{ad as a,rd as b,ld as c};
@@ -0,0 +1 @@
1
+ import{a as I}from"./chunk-UO7UMJN3.js";import"./chunk-BH4JDZF4.js";import{b as k,d as w}from"./chunk-MDV2S56W.js";import{b}from"./chunk-5RI5TLFW.js";import{k as $,l as C,n as T,q as S}from"./chunk-FB6OF4XR.js";import{Eb as E,Ga as x,Ib as u,La as r,Vb as a,Wa as _,Wb as s,gc as g,ja as n,lb as d,mb as f,mc as m,nc as c,oc as y,vb as o,wb as i,xb as l}from"./chunk-3LEW5FOJ.js";var R=t=>({command:t});function D(t,h){if(t&1&&(o(0,"div",7),a(1),i()),t&2){let e=u();r(),s(e.error)}}function B(t,h){t&1&&(o(0,"p",9),a(1),m(2,"translate"),i(),o(3,"div",10)(4,"div",11),l(5,"i",12),i()()),t&2&&(r(),s(c(2,1,"restart.please_wait_while_server_restarts")))}function M(t,h){if(t&1&&(o(0,"div",8)(1,"p"),a(2),m(3,"translate"),i(),l(4,"p",13),m(5,"translate"),i()),t&2){let e=u();r(2),s(c(3,2,"platform.docker.server_long_time")),r(2),E("innerHTML",y(5,4,"platform.docker.run_with_restart",g(7,R,e.command)),x)}}var N=(()=>{class t{$api=n(S);$route=n(k);$router=n(w);$settings=n(b);$toastr=n(T);$translate=n($);$ws=n(I);checkTimeout;checkDelay;io;resp={};timeout=!1;error=!1;command='<span class="font-monospace">--restart=always</span>';ngOnInit(){this.io=this.$ws.connectToNamespace("status"),this.io.connected.subscribe(()=>{this.io.socket.emit("monitor-server-status"),this.$settings.getAppSettings().catch(()=>{})}),this.$api.put("/platform-tools/docker/restart-container",{}).subscribe({next:e=>{this.resp=e,this.checkIfServerUp()},error:e=>{this.error=this.$translate.instant("restart.toast_server_restart_error"),console.error(e),this.$toastr.error(this.$translate.instant("restart.toast_server_restart_error"),this.$translate.instant("toast.title_error"))}})}ngOnDestroy(){this.io.end(),clearTimeout(this.checkDelay),clearTimeout(this.checkTimeout)}checkIfServerUp(){this.checkDelay=setTimeout(()=>{this.io.socket.on("homebridge-status",e=>{(e.status==="up"||e.status==="pending")&&(this.$toastr.success(this.$translate.instant("platform.docker.container_restarted"),this.$translate.instant("toast.title_success")),this.$router.navigate(["/"],{relativeTo:this.$route}))})},1e4),this.checkTimeout=setTimeout(()=>{this.$toastr.warning(this.$translate.instant("restart.toast_server_restart_timeout"),this.$translate.instant("toast.title_warning"),{timeOut:1e4}),this.timeout=!0},6e4)}static \u0275fac=function(p){return new(p||t)};static \u0275cmp=_({type:t,selectors:[["ng-component"]],decls:14,vars:8,consts:[[1,"d-flex","justify-content-between"],[1,"primary-text","m-0"],[1,"my-4","align-items-center",2,"max-width","1000px","margin","auto"],[1,"w-100","text-center","primary-text","mb-5"],[1,"fab","fa-fw","fa-docker",2,"font-size","75px"],[1,"text-center"],[1,"primary-text","mb-4"],[1,"alert","alert-error","my-4"],[1,"alert","alert-warning","my-4"],[1,"grey-text"],[1,"justify-content-center","my-4"],[1,"restart-progress-box","primary-text"],[1,"fas","fa-fw","fa-spinner","fa-spin"],[1,"grey-text","mb-0",3,"innerHTML"]],template:function(p,v){p&1&&(o(0,"div",0)(1,"h3",1),a(2),m(3,"translate"),i()(),o(4,"div",2)(5,"div",3),l(6,"i",4),i(),o(7,"div",5)(8,"h4",6),a(9),m(10,"translate"),i(),d(11,D,2,1,"div",7)(12,B,6,3),d(13,M,6,9,"div",8),i()()),p&2&&(r(2),s(c(3,4,"menu.restart.title")),r(7),s(c(10,6,"platform.docker.title_restarting")),r(2),f(v.error?11:12),r(2),f(v.timeout?13:-1))},dependencies:[C],styles:[".restart-progress-box[_ngcontent-%COMP%]{font-size:22px;font-weight:300;margin-top:15px}"]})}return t})();export{N as ContainerRestartComponent};
@@ -0,0 +1 @@
1
+ import{a as n}from"./chunk-RN2CW4V7.js";import"./chunk-PCCN3UQI.js";import"./chunk-2GPXWXUT.js";import"./chunk-TXNEVPOK.js";import"./chunk-M7Q6VBJE.js";import"./chunk-KNZTEJFP.js";import"./chunk-E6AE64XW.js";import"./chunk-MVMZJM7B.js";import"./chunk-KXMDG63G.js";import"./chunk-CCHRGHTT.js";import"./chunk-EWO5Q2EI.js";import"./chunk-CIVLN3HQ.js";import"./chunk-7FVJXUCR.js";import"./chunk-BQMDK4YS.js";import"./chunk-AM53KSWA.js";import"./chunk-UO7UMJN3.js";import"./chunk-BH4JDZF4.js";import{g as r}from"./chunk-MDV2S56W.js";import"./chunk-5RI5TLFW.js";import"./chunk-FB6OF4XR.js";import{Xa as i,fa as t}from"./chunk-3LEW5FOJ.js";var l=[{path:"",loadComponent:()=>import("./chunk-LNGNBQBM.js").then(o=>o.PluginsComponent)}],u=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=i({type:o});static \u0275inj=t({imports:[r.forChild(l),r]})}return o})();var f=(()=>{class o{static \u0275fac=function(e){return new(e||o)};static \u0275mod=i({type:o});static \u0275inj=t({imports:[n,u]})}return o})();export{f as PluginsModule};