ahoy_analytics 0.1.0

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 (198) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +163 -0
  4. data/Rakefile +6 -0
  5. data/app/assets/ahoy_analytics/build/assets/Combination-BpSXUjp9.js +41 -0
  6. data/app/assets/ahoy_analytics/build/assets/analytics-5KyfCxh6.css +1 -0
  7. data/app/assets/ahoy_analytics/build/assets/analytics-dashboard-uOXx8zYZ.js +1 -0
  8. data/app/assets/ahoy_analytics/build/assets/analytics-layout-ClAft5OU.js +1 -0
  9. data/app/assets/ahoy_analytics/build/assets/analytics-tracker-B3f8P98z.js +1 -0
  10. data/app/assets/ahoy_analytics/build/assets/analytics-ui-DMSkNqd6.js +90 -0
  11. data/app/assets/ahoy_analytics/build/assets/behaviors-panel-ChNGYbdH.js +1 -0
  12. data/app/assets/ahoy_analytics/build/assets/button-JVCrlR4s.js +1 -0
  13. data/app/assets/ahoy_analytics/build/assets/cable-DO-7y1-E.js +1 -0
  14. data/app/assets/ahoy_analytics/build/assets/createLucideIcon-BGzacY2v.js +1 -0
  15. data/app/assets/ahoy_analytics/build/assets/date-range-dialog-DWDp3cLG.js +1 -0
  16. data/app/assets/ahoy_analytics/build/assets/details-button-NqKfSGEG.js +1 -0
  17. data/app/assets/ahoy_analytics/build/assets/devices-panel-cXvlmNBY.js +1 -0
  18. data/app/assets/ahoy_analytics/build/assets/dialog-path-BBPNlB4Z.js +1 -0
  19. data/app/assets/ahoy_analytics/build/assets/dropdown-menu-Adj3O5fh.js +1 -0
  20. data/app/assets/ahoy_analytics/build/assets/filter-dialog-BN-rf4lp.js +1 -0
  21. data/app/assets/ahoy_analytics/build/assets/index-B1K1NTKT.js +3 -0
  22. data/app/assets/ahoy_analytics/build/assets/index-BcHeb-Rh.js +1 -0
  23. data/app/assets/ahoy_analytics/build/assets/index-DzpzLoG4.js +1 -0
  24. data/app/assets/ahoy_analytics/build/assets/index-vX97OY1J.js +1 -0
  25. data/app/assets/ahoy_analytics/build/assets/input-e4v_v0kE.js +1 -0
  26. data/app/assets/ahoy_analytics/build/assets/jsx-runtime-u17CrQMm.js +1 -0
  27. data/app/assets/ahoy_analytics/build/assets/last-load-context-De5uA95L.js +1 -0
  28. data/app/assets/ahoy_analytics/build/assets/list-table-ChHEzzF9.js +1 -0
  29. data/app/assets/ahoy_analytics/build/assets/live-Cp2MHECh.js +2 -0
  30. data/app/assets/ahoy_analytics/build/assets/locations-panel-BaISRmaQ.js +1 -0
  31. data/app/assets/ahoy_analytics/build/assets/mercator-BnxX5RzL.js +1 -0
  32. data/app/assets/ahoy_analytics/build/assets/pages-panel-Bh25L8mP.js +1 -0
  33. data/app/assets/ahoy_analytics/build/assets/panel-tabs-B2kvGFJx.js +1 -0
  34. data/app/assets/ahoy_analytics/build/assets/query-context-B-PgE00D.js +1 -0
  35. data/app/assets/ahoy_analytics/build/assets/remote-details-dialog-DDTcKaM5.js +1 -0
  36. data/app/assets/ahoy_analytics/build/assets/show-CCRicksg.js +1 -0
  37. data/app/assets/ahoy_analytics/build/assets/simple-tabs-D6G6Bs0k.js +1 -0
  38. data/app/assets/ahoy_analytics/build/assets/site-context-BNteYRlR.js +1 -0
  39. data/app/assets/ahoy_analytics/build/assets/sources-panel-DyB21hxD.js +1 -0
  40. data/app/assets/ahoy_analytics/build/assets/top-bar-FSiLBjq6.js +1 -0
  41. data/app/assets/ahoy_analytics/build/assets/top-stats-context-DU15P9jS.js +1 -0
  42. data/app/assets/ahoy_analytics/build/assets/use-debounce-VBpXQRL8.js +1 -0
  43. data/app/assets/ahoy_analytics/build/assets/user-context-DbYteluY.js +1 -0
  44. data/app/assets/ahoy_analytics/build/assets/visitor-globe-BWLDihid.js +4789 -0
  45. data/app/assets/ahoy_analytics/build/assets/visitor-graph-uKXjLvcu.js +1 -0
  46. data/app/assets/ahoy_analytics/images/icon/browser/brave.svg +1 -0
  47. data/app/assets/ahoy_analytics/images/icon/browser/chrome.svg +1 -0
  48. data/app/assets/ahoy_analytics/images/icon/browser/chromium.svg +1 -0
  49. data/app/assets/ahoy_analytics/images/icon/browser/duckduckgo.svg +2151 -0
  50. data/app/assets/ahoy_analytics/images/icon/browser/edge.svg +1 -0
  51. data/app/assets/ahoy_analytics/images/icon/browser/fallback.svg +5 -0
  52. data/app/assets/ahoy_analytics/images/icon/browser/firefox.svg +1 -0
  53. data/app/assets/ahoy_analytics/images/icon/browser/opera.svg +1 -0
  54. data/app/assets/ahoy_analytics/images/icon/browser/safari.png +0 -0
  55. data/app/assets/ahoy_analytics/images/icon/browser/samsung-internet.svg +1 -0
  56. data/app/assets/ahoy_analytics/images/icon/browser/uc.svg +1 -0
  57. data/app/assets/ahoy_analytics/images/icon/browser/vivaldi.svg +1 -0
  58. data/app/assets/ahoy_analytics/images/icon/browser/yandex.png +0 -0
  59. data/app/assets/ahoy_analytics/images/icon/os/android.png +0 -0
  60. data/app/assets/ahoy_analytics/images/icon/os/chrome_os.png +0 -0
  61. data/app/assets/ahoy_analytics/images/icon/os/fallback.svg +5 -0
  62. data/app/assets/ahoy_analytics/images/icon/os/fedora.png +0 -0
  63. data/app/assets/ahoy_analytics/images/icon/os/freebsd.png +0 -0
  64. data/app/assets/ahoy_analytics/images/icon/os/gnu_linux.png +0 -0
  65. data/app/assets/ahoy_analytics/images/icon/os/ios.png +0 -0
  66. data/app/assets/ahoy_analytics/images/icon/os/ipad_os.png +0 -0
  67. data/app/assets/ahoy_analytics/images/icon/os/mac.png +0 -0
  68. data/app/assets/ahoy_analytics/images/icon/os/ubuntu.png +0 -0
  69. data/app/assets/ahoy_analytics/images/icon/os/windows.png +0 -0
  70. data/app/assets/stylesheets/ahoy_analytics/application.css +15 -0
  71. data/app/channels/ahoy_analytics/analytics_channel.rb +9 -0
  72. data/app/controllers/ahoy_analytics/analytics_controller.rb +9 -0
  73. data/app/controllers/ahoy_analytics/application_controller.rb +8 -0
  74. data/app/controllers/ahoy_analytics/assets_controller.rb +46 -0
  75. data/app/controllers/ahoy_analytics/base_controller.rb +285 -0
  76. data/app/controllers/ahoy_analytics/behaviors_controller.rb +14 -0
  77. data/app/controllers/ahoy_analytics/devices_controller.rb +14 -0
  78. data/app/controllers/ahoy_analytics/export_controller.rb +12 -0
  79. data/app/controllers/ahoy_analytics/live_controller.rb +9 -0
  80. data/app/controllers/ahoy_analytics/locations_controller.rb +14 -0
  81. data/app/controllers/ahoy_analytics/main_graph_controller.rb +10 -0
  82. data/app/controllers/ahoy_analytics/pages_controller.rb +14 -0
  83. data/app/controllers/ahoy_analytics/referrers_controller.rb +34 -0
  84. data/app/controllers/ahoy_analytics/search_terms_controller.rb +47 -0
  85. data/app/controllers/ahoy_analytics/sources_controller.rb +14 -0
  86. data/app/controllers/ahoy_analytics/top_stats_controller.rb +13 -0
  87. data/app/controllers/concerns/ahoy_analytics/set_current_request.rb +17 -0
  88. data/app/frontend/components/analytics/hex-highlights.tsx +165 -0
  89. data/app/frontend/components/analytics/hex-land-layer.tsx +61 -0
  90. data/app/frontend/components/analytics/metric-card.tsx +138 -0
  91. data/app/frontend/components/analytics/sessions-by-location.tsx +62 -0
  92. data/app/frontend/components/analytics/visitor-globe.tsx +424 -0
  93. data/app/frontend/components/ui/accordion.tsx +64 -0
  94. data/app/frontend/components/ui/alert.tsx +66 -0
  95. data/app/frontend/components/ui/avatar.tsx +53 -0
  96. data/app/frontend/components/ui/badge.tsx +46 -0
  97. data/app/frontend/components/ui/button.tsx +62 -0
  98. data/app/frontend/components/ui/calendar.tsx +212 -0
  99. data/app/frontend/components/ui/card.tsx +91 -0
  100. data/app/frontend/components/ui/checkbox.tsx +32 -0
  101. data/app/frontend/components/ui/dropdown-menu.tsx +255 -0
  102. data/app/frontend/components/ui/input.tsx +21 -0
  103. data/app/frontend/components/ui/label.tsx +22 -0
  104. data/app/frontend/components/ui/popover.tsx +46 -0
  105. data/app/frontend/components/ui/select.tsx +183 -0
  106. data/app/frontend/components/ui/separator.tsx +26 -0
  107. data/app/frontend/components/ui/sheet.tsx +139 -0
  108. data/app/frontend/components/ui/sidebar.tsx +726 -0
  109. data/app/frontend/components/ui/skeleton.tsx +13 -0
  110. data/app/frontend/components/ui/sonner.tsx +33 -0
  111. data/app/frontend/components/ui/tooltip.tsx +59 -0
  112. data/app/frontend/data/countries-110m.json +1 -0
  113. data/app/frontend/data/globe-data.json +1 -0
  114. data/app/frontend/entrypoints/analytics-tracker.ts +680 -0
  115. data/app/frontend/entrypoints/analytics-ui.tsx +26 -0
  116. data/app/frontend/entrypoints/analytics.css +77 -0
  117. data/app/frontend/layouts/analytics-layout.tsx +28 -0
  118. data/app/frontend/lib/cable.ts +13 -0
  119. data/app/frontend/lib/geocode.ts +65 -0
  120. data/app/frontend/lib/utils.ts +6 -0
  121. data/app/frontend/pages/admin/analytics/api.ts +221 -0
  122. data/app/frontend/pages/admin/analytics/hooks/use-debounce.ts +36 -0
  123. data/app/frontend/pages/admin/analytics/last-load-context.tsx +29 -0
  124. data/app/frontend/pages/admin/analytics/lib/base-path.ts +28 -0
  125. data/app/frontend/pages/admin/analytics/lib/dialog-path.ts +242 -0
  126. data/app/frontend/pages/admin/analytics/lib/number-formatter.ts +100 -0
  127. data/app/frontend/pages/admin/analytics/live.tsx +608 -0
  128. data/app/frontend/pages/admin/analytics/query-context.tsx +61 -0
  129. data/app/frontend/pages/admin/analytics/show.tsx +40 -0
  130. data/app/frontend/pages/admin/analytics/site-context.tsx +22 -0
  131. data/app/frontend/pages/admin/analytics/top-stats-context.tsx +37 -0
  132. data/app/frontend/pages/admin/analytics/types.ts +161 -0
  133. data/app/frontend/pages/admin/analytics/ui/analytics-dashboard.tsx +60 -0
  134. data/app/frontend/pages/admin/analytics/ui/behaviors-panel.tsx +456 -0
  135. data/app/frontend/pages/admin/analytics/ui/date-range-dialog.tsx +173 -0
  136. data/app/frontend/pages/admin/analytics/ui/details-button.tsx +33 -0
  137. data/app/frontend/pages/admin/analytics/ui/devices-panel.tsx +474 -0
  138. data/app/frontend/pages/admin/analytics/ui/filter-dialog.tsx +558 -0
  139. data/app/frontend/pages/admin/analytics/ui/list-table.tsx +346 -0
  140. data/app/frontend/pages/admin/analytics/ui/locations-panel.tsx +566 -0
  141. data/app/frontend/pages/admin/analytics/ui/pages-panel.tsx +207 -0
  142. data/app/frontend/pages/admin/analytics/ui/panel-tabs.tsx +65 -0
  143. data/app/frontend/pages/admin/analytics/ui/remote-details-dialog.tsx +356 -0
  144. data/app/frontend/pages/admin/analytics/ui/simple-tabs.tsx +54 -0
  145. data/app/frontend/pages/admin/analytics/ui/sources-panel.tsx +771 -0
  146. data/app/frontend/pages/admin/analytics/ui/top-bar.tsx +793 -0
  147. data/app/frontend/pages/admin/analytics/ui/visitor-graph.tsx +891 -0
  148. data/app/frontend/pages/admin/analytics/user-context.tsx +22 -0
  149. data/app/frontend/styles/shared.css +156 -0
  150. data/app/helpers/ahoy_analytics/application_helper.rb +96 -0
  151. data/app/jobs/ahoy_analytics/application_job.rb +4 -0
  152. data/app/jobs/ahoy_analytics/update_job.rb +12 -0
  153. data/app/mailers/ahoy_analytics/application_mailer.rb +6 -0
  154. data/app/models/ahoy/event/filters.rb +7 -0
  155. data/app/models/ahoy/event.rb +9 -0
  156. data/app/models/ahoy/visit/cache_key.rb +15 -0
  157. data/app/models/ahoy/visit/constants.rb +11 -0
  158. data/app/models/ahoy/visit/devices.rb +144 -0
  159. data/app/models/ahoy/visit/export.rb +24 -0
  160. data/app/models/ahoy/visit/filters.rb +286 -0
  161. data/app/models/ahoy/visit/imports.rb +36 -0
  162. data/app/models/ahoy/visit/locations.rb +276 -0
  163. data/app/models/ahoy/visit/metrics.rb +473 -0
  164. data/app/models/ahoy/visit/ordering.rb +110 -0
  165. data/app/models/ahoy/visit/pages.rb +533 -0
  166. data/app/models/ahoy/visit/pagination.rb +17 -0
  167. data/app/models/ahoy/visit/ranges.rb +227 -0
  168. data/app/models/ahoy/visit/series.rb +177 -0
  169. data/app/models/ahoy/visit/sources.rb +418 -0
  170. data/app/models/ahoy/visit/url_labels.rb +32 -0
  171. data/app/models/ahoy/visit.rb +143 -0
  172. data/app/models/ahoy_analytics/application_record.rb +5 -0
  173. data/app/models/ahoy_analytics/current.rb +8 -0
  174. data/app/models/ahoy_analytics/funnel.rb +16 -0
  175. data/app/models/ahoy_analytics/imported_entry_page.rb +5 -0
  176. data/app/models/ahoy_analytics/imported_exit_page.rb +5 -0
  177. data/app/models/ahoy_analytics/imported_page.rb +5 -0
  178. data/app/models/ahoy_analytics/live_stats.rb +152 -0
  179. data/app/models/ahoy_analytics/setting.rb +19 -0
  180. data/app/models/analytics/source_catalog.rb +48 -0
  181. data/app/views/layouts/ahoy_analytics/application.html.erb +15 -0
  182. data/config/routes.rb +21 -0
  183. data/config/vite.json +22 -0
  184. data/db/migrate/20251006104056_create_ahoy_visits_and_events.rb +62 -0
  185. data/db/migrate/20251006105012_add_analytics_fields_to_ahoy_visits.rb +11 -0
  186. data/db/migrate/20251012090000_create_analytics_funnels_and_imports.rb +52 -0
  187. data/db/migrate/20251013021500_add_analytics_indexes.rb +14 -0
  188. data/lib/ahoy_analytics/ahoy_store.rb +429 -0
  189. data/lib/ahoy_analytics/asset_manifest.rb +56 -0
  190. data/lib/ahoy_analytics/device_bucket.rb +39 -0
  191. data/lib/ahoy_analytics/engine.rb +55 -0
  192. data/lib/ahoy_analytics/maxmind_geo.rb +77 -0
  193. data/lib/ahoy_analytics/version.rb +3 -0
  194. data/lib/ahoy_analytics.rb +52 -0
  195. data/lib/generators/ahoy_analytics/install/install_generator.rb +111 -0
  196. data/lib/generators/ahoy_analytics/install/templates/initializer.rb +28 -0
  197. data/lib/tasks/ahoy_analytics_tasks.rake +4 -0
  198. metadata +352 -0
@@ -0,0 +1,3 @@
1
+ import{j as Ls}from"./jsx-runtime-u17CrQMm.js";import{r as et}from"./analytics-ui-DMSkNqd6.js";function ee(i){return i+.5|0}const lt=(i,t,e)=>Math.max(Math.min(i,e),t);function Nt(i){return lt(ee(i*2.55),0,255)}function ht(i){return lt(ee(i*255),0,255)}function at(i){return lt(ee(i/2.55)/100,0,1)}function gi(i){return lt(ee(i*100),0,100)}const U={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},$e=[..."0123456789ABCDEF"],Mn=i=>$e[i&15],Pn=i=>$e[(i&240)>>4]+$e[i&15],oe=i=>(i&240)>>4===(i&15),Dn=i=>oe(i.r)&&oe(i.g)&&oe(i.b)&&oe(i.a);function Cn(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&U[i[1]]*17,g:255&U[i[2]]*17,b:255&U[i[3]]*17,a:t===5?U[i[4]]*17:255}:(t===7||t===9)&&(e={r:U[i[1]]<<4|U[i[2]],g:U[i[3]]<<4|U[i[4]],b:U[i[5]]<<4|U[i[6]],a:t===9?U[i[7]]<<4|U[i[8]]:255})),e}const On=(i,t)=>i<255?t(i):"";function Tn(i){var t=Dn(i)?Mn:Pn;return i?"#"+t(i.r)+t(i.g)+t(i.b)+On(i.a,t):void 0}const Ln=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function As(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function An(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function In(i,t,e){const s=As(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Fn(i,t,e,s,n){return i===n?(t-e)/s+(t<e?6:0):t===n?(e-i)/s+2:(i-t)/s+4}function Je(i){const e=i.r/255,s=i.g/255,n=i.b/255,o=Math.max(e,s,n),r=Math.min(e,s,n),a=(o+r)/2;let l,c,h;return o!==r&&(h=o-r,c=a>.5?h/(2-o-r):h/(o+r),l=Fn(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function ti(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(ht)}function ei(i,t,e){return ti(As,i,t,e)}function En(i,t,e){return ti(In,i,t,e)}function Rn(i,t,e){return ti(An,i,t,e)}function Is(i){return(i%360+360)%360}function zn(i){const t=Ln.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Nt(+t[5]):ht(+t[5]));const n=Is(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=En(n,o,r):t[1]==="hsv"?s=Rn(n,o,r):s=ei(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function Bn(i,t){var e=Je(i);e[0]=Is(e[0]+t),e=ei(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Hn(i){if(!i)return;const t=Je(i),e=t[0],s=gi(t[1]),n=gi(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${at(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const pi={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"},mi={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 Wn(){const i={},t=Object.keys(mi),e=Object.keys(pi);let s,n,o,r,a;for(s=0;s<t.length;s++){for(r=a=t[s],n=0;n<e.length;n++)o=e[n],a=a.replace(o,pi[o]);o=parseInt(mi[r],16),i[a]=[o>>16&255,o>>8&255,o&255]}return i}let re;function Nn(i){re||(re=Wn(),re.transparent=[0,0,0,0]);const t=re[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Vn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function jn(i){const t=Vn.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?Nt(r):lt(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Nt(s):lt(s,0,255)),n=255&(t[4]?Nt(n):lt(n,0,255)),o=255&(t[6]?Nt(o):lt(o,0,255)),{r:s,g:n,b:o,a:e}}}function $n(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${at(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ie=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Dt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Yn(i,t,e){const s=Dt(at(i.r)),n=Dt(at(i.g)),o=Dt(at(i.b));return{r:ht(Ie(s+e*(Dt(at(t.r))-s))),g:ht(Ie(n+e*(Dt(at(t.g))-n))),b:ht(Ie(o+e*(Dt(at(t.b))-o))),a:i.a+e*(t.a-i.a)}}function ae(i,t,e){if(i){let s=Je(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=ei(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function Fs(i,t){return i&&Object.assign(t||{},i)}function bi(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=ht(i[3]))):(t=Fs(i,{r:0,g:0,b:0,a:1}),t.a=ht(t.a)),t}function Un(i){return i.charAt(0)==="r"?jn(i):zn(i)}class qt{constructor(t){if(t instanceof qt)return t;const e=typeof t;let s;e==="object"?s=bi(t):e==="string"&&(s=Cn(t)||Nn(t)||Un(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=Fs(this._rgb);return t&&(t.a=at(t.a)),t}set rgb(t){this._rgb=bi(t)}rgbString(){return this._valid?$n(this._rgb):void 0}hexString(){return this._valid?Tn(this._rgb):void 0}hslString(){return this._valid?Hn(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*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=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=Yn(this._rgb,t._rgb,e)),this}clone(){return new qt(this.rgb)}alpha(t){return this._rgb.a=ht(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ee(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ae(this._rgb,2,t),this}darken(t){return ae(this._rgb,2,-t),this}saturate(t){return ae(this._rgb,1,t),this}desaturate(t){return ae(this._rgb,1,-t),this}rotate(t){return Bn(this._rgb,t),this}}function nt(){}const Xn=(()=>{let i=0;return()=>i++})();function A(i){return i==null}function R(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function C(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function N(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function J(i,t){return N(i)?i:t}function D(i,t){return typeof i>"u"?t:i}const Kn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function I(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function L(i,t,e,s){let n,o,r;if(R(i))for(o=i.length,n=0;n<o;n++)t.call(e,i[n],n);else if(C(i))for(r=Object.keys(i),o=r.length,n=0;n<o;n++)t.call(e,i[r[n]],r[n])}function ye(i,t){let e,s,n,o;if(!i||!t||i.length!==t.length)return!1;for(e=0,s=i.length;e<s;++e)if(n=i[e],o=t[e],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function ve(i){if(R(i))return i.map(ve);if(C(i)){const t=Object.create(null),e=Object.keys(i),s=e.length;let n=0;for(;n<s;++n)t[e[n]]=ve(i[e[n]]);return t}return i}function Es(i){return["__proto__","prototype","constructor"].indexOf(i)===-1}function qn(i,t,e,s){if(!Es(i))return;const n=t[i],o=e[i];C(n)&&C(o)?Gt(n,o,s):t[i]=ve(o)}function Gt(i,t,e){const s=R(t)?t:[t],n=s.length;if(!C(i))return i;e=e||{};const o=e.merger||qn;let r;for(let a=0;a<n;++a){if(r=s[a],!C(r))continue;const l=Object.keys(r);for(let c=0,h=l.length;c<h;++c)o(l[c],i,r,e)}return i}function $t(i,t){return Gt(i,t,{merger:Gn})}function Gn(i,t,e){if(!Es(i))return;const s=t[i],n=e[i];C(s)&&C(n)?$t(s,n):Object.prototype.hasOwnProperty.call(t,i)||(t[i]=ve(n))}const _i={"":i=>i,x:i=>i.x,y:i=>i.y};function Zn(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function Qn(i){const t=Zn(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function we(i,t){return(_i[t]||(_i[t]=Qn(t)))(i)}function ii(i){return i.charAt(0).toUpperCase()+i.slice(1)}const ke=i=>typeof i<"u",dt=i=>typeof i=="function",xi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function Jn(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const z=Math.PI,Z=2*z,to=Z+z,Se=Number.POSITIVE_INFINITY,eo=z/180,G=z/2,gt=z/4,yi=z*2/3,Rs=Math.log10,Tt=Math.sign;function Yt(i,t,e){return Math.abs(i-t)<e}function vi(i){const t=Math.round(i);i=Yt(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Rs(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function io(i){const t=[],e=Math.sqrt(i);let s;for(s=1;s<e;s++)i%s===0&&(t.push(s),t.push(i/s));return e===(e|0)&&t.push(e),t.sort((n,o)=>n-o).pop(),t}function so(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function Zt(i){return!so(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function no(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function oo(i,t,e){let s,n,o;for(s=0,n=i.length;s<n;s++)o=i[s][e],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function xt(i){return i*(z/180)}function ro(i){return i*(180/z)}function wi(i){if(!N(i))return;let t=1,e=0;for(;Math.round(i*t)/t!==i;)t*=10,e++;return e}function ao(i,t){const e=t.x-i.x,s=t.y-i.y,n=Math.sqrt(e*e+s*s);let o=Math.atan2(s,e);return o<-.5*z&&(o+=Z),{angle:o,distance:n}}function Ye(i,t){return Math.sqrt(Math.pow(t.x-i.x,2)+Math.pow(t.y-i.y,2))}function lo(i,t){return(i-t+to)%Z-z}function st(i){return(i%Z+Z)%Z}function zs(i,t,e,s){const n=st(i),o=st(t),r=st(e),a=st(o-n),l=st(r-n),c=st(n-o),h=st(n-r);return n===o||n===r||s&&o===r||a>l&&c<h}function X(i,t,e){return Math.max(t,Math.min(e,i))}function co(i){return X(i,-32768,32767)}function Ct(i,t,e,s=1e-6){return i>=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function si(i,t,e){e=e||(r=>i[r]<t);let s=i.length-1,n=0,o;for(;s-n>1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const yt=(i,t,e,s)=>si(i,e,s?n=>{const o=i[n][t];return o<e||o===e&&i[n+1][t]===e}:n=>i[n][t]<e),ho=(i,t,e)=>si(i,e,s=>i[s][t]>=e);function fo(i,t,e){let s=0,n=i.length;for(;s<n&&i[s]<t;)s++;for(;n>s&&i[n-1]>e;)n--;return s>0||n<i.length?i.slice(s,n):i}const Bs=["push","pop","shift","splice","unshift"];function uo(i,t){if(i._chartjs){i._chartjs.listeners.push(t);return}Object.defineProperty(i,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Bs.forEach(e=>{const s="_onData"+ii(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function ki(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Bs.forEach(o=>{delete i[o]}),delete i._chartjs)}function go(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Hs=(function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame})();function Ws(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Hs.call(window,()=>{s=!1,i.apply(t,e)}))}}function po(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const ni=i=>i==="start"?"left":i==="end"?"right":"center",H=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,mo=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function bo(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=r.axis,{min:d,max:f,minDefined:u,maxDefined:g}=r.getUserBounds();if(u){if(n=Math.min(yt(l,h,d).lo,e?s:yt(t,h,r.getPixelForValue(d)).lo),c){const p=l.slice(0,n+1).reverse().findIndex(m=>!A(m[a.axis]));n-=Math.max(0,p)}n=X(n,0,s-1)}if(g){let p=Math.max(yt(l,r.axis,f,!0).hi+1,e?0:yt(t,h,r.getPixelForValue(f),!0).hi+1);if(c){const m=l.slice(p-1).findIndex(b=>!A(b[a.axis]));p+=Math.max(0,m)}o=X(p,n,s)-n}else o=s-n}return{start:n,count:o}}function _o(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const le=i=>i===0||i===1,Si=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*Z/e)),Mi=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*Z/e)+1,Ut={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*G)+1,easeOutSine:i=>Math.sin(i*G),easeInOutSine:i=>-.5*(Math.cos(z*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=>le(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=>le(i)?i:Si(i,.075,.3),easeOutElastic:i=>le(i)?i:Mi(i,.075,.3),easeInOutElastic(i){return le(i)?i:i<.5?.5*Si(i*2,.1125,.45):.5+.5*Mi(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Ut.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?Ut.easeInBounce(i*2)*.5:Ut.easeOutBounce(i*2-1)*.5+.5};function oi(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Pi(i){return oi(i)?i:new qt(i)}function Fe(i){return oi(i)?i:new qt(i).saturate(.5).darken(.1).hexString()}const xo=["x","y","borderWidth","radius","tension"],yo=["color","borderColor","backgroundColor"];function vo(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:yo},numbers:{type:"number",properties:xo}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function wo(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Di=new Map;function ko(i,t){t=t||{};const e=i+JSON.stringify(t);let s=Di.get(e);return s||(s=new Intl.NumberFormat(i,t),Di.set(e,s)),s}function Ns(i,t,e){return ko(t,e).format(i)}const So={values(i){return R(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=Mo(i,e)}const r=Rs(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),Ns(i,s,l)}};function Mo(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Vs={formatters:So};function Po(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Vs.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const wt=Object.create(null),Ue=Object.create(null);function Xt(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;s<n;++s){const o=e[s];i=i[o]||(i[o]=Object.create(null))}return i}function Ee(i,t,e){return typeof t=="string"?Gt(Xt(i,t),e):Gt(Xt(i,""),t)}class Do{constructor(t,e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=s=>s.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>Fe(n.backgroundColor),this.hoverBorderColor=(s,n)=>Fe(n.borderColor),this.hoverColor=(s,n)=>Fe(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Ee(this,t,e)}get(t){return Xt(this,t)}describe(t,e){return Ee(Ue,t,e)}override(t,e){return Ee(wt,t,e)}route(t,e,s,n){const o=Xt(this,t),r=Xt(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return C(l)?Object.assign({},c,l):D(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var E=new Do({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[vo,wo,Po]);function Co(i){return!i||A(i.size)||A(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Ci(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function pt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function Oi(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function Xe(i,t,e,s){js(i,t,e,s,null)}function js(i,t,e,s,n){let o,r,a,l,c,h,d,f;const u=t.pointStyle,g=t.rotation,p=t.radius;let m=(g||0)*eo;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(m),i.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),i.restore();return}if(!(isNaN(p)||p<=0)){switch(i.beginPath(),u){default:n?i.ellipse(e,s,n/2,p,0,0,Z):i.arc(e,s,p,0,Z),i.closePath();break;case"triangle":h=n?n/2:p,i.moveTo(e+Math.sin(m)*h,s-Math.cos(m)*p),m+=yi,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*p),m+=yi,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*p),i.closePath();break;case"rectRounded":c=p*.516,l=p-c,r=Math.cos(m+gt)*l,d=Math.cos(m+gt)*(n?n/2-c:l),a=Math.sin(m+gt)*l,f=Math.sin(m+gt)*(n?n/2-c:l),i.arc(e-d,s-a,c,m-z,m-G),i.arc(e+f,s-r,c,m-G,m),i.arc(e+d,s+a,c,m,m+G),i.arc(e-f,s+r,c,m+G,m+z),i.closePath();break;case"rect":if(!g){l=Math.SQRT1_2*p,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}m+=gt;case"rectRot":d=Math.cos(m)*(n?n/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,f=Math.sin(m)*(n?n/2:p),i.moveTo(e-d,s-a),i.lineTo(e+f,s-r),i.lineTo(e+d,s+a),i.lineTo(e-f,s+r),i.closePath();break;case"crossRot":m+=gt;case"cross":d=Math.cos(m)*(n?n/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,f=Math.sin(m)*(n?n/2:p),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r);break;case"star":d=Math.cos(m)*(n?n/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,f=Math.sin(m)*(n?n/2:p),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r),m+=gt,d=Math.cos(m)*(n?n/2:p),r=Math.cos(m)*p,a=Math.sin(m)*p,f=Math.sin(m)*(n?n/2:p),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r);break;case"line":r=n?n/2:Math.cos(m)*p,a=Math.sin(m)*p,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(m)*(n?n/2:p),s+Math.sin(m)*p);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function Qt(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.x<t.right+e&&i.y>t.top-e&&i.y<t.bottom+e}function De(i,t){i.save(),i.beginPath(),i.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),i.clip()}function Ce(i){i.restore()}function Oo(i,t,e,s,n){if(!t)return i.lineTo(e.x,e.y);if(n==="middle"){const o=(t.x+e.x)/2;i.lineTo(o,t.y),i.lineTo(o,e.y)}else n==="after"!=!!s?i.lineTo(t.x,e.y):i.lineTo(e.x,t.y);i.lineTo(e.x,e.y)}function To(i,t,e,s){if(!t)return i.lineTo(e.x,e.y);i.bezierCurveTo(s?t.cp1x:t.cp2x,s?t.cp1y:t.cp2y,s?e.cp2x:e.cp1x,s?e.cp2y:e.cp1y,e.x,e.y)}function Lo(i,t){t.translation&&i.translate(t.translation[0],t.translation[1]),A(t.rotation)||i.rotate(t.rotation),t.color&&(i.fillStyle=t.color),t.textAlign&&(i.textAlign=t.textAlign),t.textBaseline&&(i.textBaseline=t.textBaseline)}function Ao(i,t,e,s,n){if(n.strikethrough||n.underline){const o=i.measureText(s),r=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=e-o.actualBoundingBoxAscent,c=e+o.actualBoundingBoxDescent,h=n.strikethrough?(l+c)/2:c;i.strokeStyle=i.fillStyle,i.beginPath(),i.lineWidth=n.decorationWidth||2,i.moveTo(r,h),i.lineTo(a,h),i.stroke()}}function Io(i,t){const e=i.fillStyle;i.fillStyle=t.color,i.fillRect(t.left,t.top,t.width,t.height),i.fillStyle=e}function Jt(i,t,e,s,n,o={}){const r=R(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,Lo(i,o),l=0;l<r.length;++l)c=r[l],o.backdrop&&Io(i,o.backdrop),a&&(o.strokeColor&&(i.strokeStyle=o.strokeColor),A(o.strokeWidth)||(i.lineWidth=o.strokeWidth),i.strokeText(c,e,s,o.maxWidth)),i.fillText(c,e,s,o.maxWidth),Ao(i,e,s,c,o),s+=Number(n.lineHeight);i.restore()}function Ke(i,t){const{x:e,y:s,w:n,h:o,radius:r}=t;i.arc(e+r.topLeft,s+r.topLeft,r.topLeft,1.5*z,z,!0),i.lineTo(e,s+o-r.bottomLeft),i.arc(e+r.bottomLeft,s+o-r.bottomLeft,r.bottomLeft,z,G,!0),i.lineTo(e+n-r.bottomRight,s+o),i.arc(e+n-r.bottomRight,s+o-r.bottomRight,r.bottomRight,G,0,!0),i.lineTo(e+n,s+r.topRight),i.arc(e+n-r.topRight,s+r.topRight,r.topRight,0,-G,!0),i.lineTo(e+r.topLeft,s)}const Fo=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,Eo=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Ro(i,t){const e=(""+i).match(Fo);if(!e||e[1]==="normal")return t*1.2;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100;break}return t*i}const zo=i=>+i||0;function $s(i,t){const e={},s=C(t),n=s?Object.keys(t):t,o=C(i)?s?r=>D(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=zo(o(r));return e}function Bo(i){return $s(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Kt(i){return $s(i,["topLeft","topRight","bottomLeft","bottomRight"])}function q(i){const t=Bo(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function W(i,t){i=i||{},t=t||E.font;let e=D(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=D(i.style,t.style);s&&!(""+s).match(Eo)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:D(i.family,t.family),lineHeight:Ro(D(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:D(i.weight,t.weight),string:""};return n.string=Co(n),n}function ce(i,t,e,s){let n,o,r;for(n=0,o=i.length;n<o;++n)if(r=i[n],r!==void 0&&r!==void 0)return r}function Ho(i,t,e){const{min:s,max:n}=i,o=Kn(t,(n-s)/2),r=(a,l)=>e&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function kt(i,t){return Object.assign(Object.create(i),t)}function ri(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=Ks("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>ri([a,...i],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return Us(a,l,()=>Xo(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Li(a).includes(l)},ownKeys(a){return Li(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function Lt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ys(i,s),setContext:o=>Lt(i,o,e,s),override:o=>Lt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return Us(o,r,()=>No(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function Ys(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:dt(e)?e:()=>e,isIndexable:dt(s)?s:()=>s}}const Wo=(i,t)=>i?i+ii(t):t,ai=(i,t)=>C(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function Us(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function No(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return dt(a)&&r.isScriptable(t)&&(a=Vo(t,a,i,e)),R(a)&&a.length&&(a=jo(t,a,i,r.isIndexable)),ai(t,a)&&(a=Lt(a,n,o&&o[t],r)),a}function Vo(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||s);return a.delete(i),ai(i,l)&&(l=li(n._scopes,n,i,l)),l}function jo(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(C(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=li(c,n,i,h);t.push(Lt(d,o,r&&r[i],a))}}return t}function Xs(i,t,e){return dt(i)?i(t,e):i}const $o=(i,t)=>i===!0?t:typeof i=="string"?we(t,i):void 0;function Yo(i,t,e,s,n){for(const o of t){const r=$o(e,o);if(r){i.add(r);const a=Xs(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(r===!1&&typeof s<"u"&&e!==s)return null}return!1}function li(i,t,e,s){const n=t._rootScopes,o=Xs(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Ti(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=Ti(a,r,o,l,s),l===null)?!1:ri(Array.from(a),[""],n,o,()=>Uo(t,e,s))}function Ti(i,t,e,s,n){for(;e;)e=Yo(i,t,e,s,n);return e}function Uo(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return R(n)&&C(e)?e:n||{}}function Xo(i,t,e,s){let n;for(const o of t)if(n=Ks(Wo(o,i),e),typeof n<"u")return ai(i,n)?li(e,s,i,n):n}function Ks(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function Li(i){let t=i._keys;return t||(t=i._keys=Ko(i._scopes)),t}function Ko(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}const qo=Number.EPSILON||1e-14,At=(i,t)=>t<i.length&&!i[t].skip&&i[t],qs=i=>i==="x"?"y":"x";function Go(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=Ye(o,n),l=Ye(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,f=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+f*(r.x-n.x),y:o.y+f*(r.y-n.y)}}}function Zo(i,t,e){const s=i.length;let n,o,r,a,l,c=At(i,0);for(let h=0;h<s-1;++h)if(l=c,c=At(i,h+1),!(!l||!c)){if(Yt(t[h],0,qo)){e[h]=e[h+1]=0;continue}n=e[h]/t[h],o=e[h+1]/t[h],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(r=3/Math.sqrt(a),e[h]=n*r*t[h],e[h+1]=o*r*t[h])}}function Qo(i,t,e="x"){const s=qs(e),n=i.length;let o,r,a,l=At(i,0);for(let c=0;c<n;++c){if(r=a,a=l,l=At(i,c+1),!a)continue;const h=a[e],d=a[s];r&&(o=(h-r[e])/3,a[`cp1${e}`]=h-o,a[`cp1${s}`]=d-o*t[c]),l&&(o=(l[e]-h)/3,a[`cp2${e}`]=h+o,a[`cp2${s}`]=d+o*t[c])}}function Jo(i,t="x"){const e=qs(t),s=i.length,n=Array(s).fill(0),o=Array(s);let r,a,l,c=At(i,0);for(r=0;r<s;++r)if(a=l,l=c,c=At(i,r+1),!!l){if(c){const h=c[t]-l[t];n[r]=h!==0?(c[e]-l[e])/h:0}o[r]=a?c?Tt(n[r-1])!==Tt(n[r])?0:(n[r-1]+n[r])/2:n[r-1]:n[r]}Zo(i,n,o),Qo(i,o,t)}function he(i,t,e){return Math.max(Math.min(i,e),t)}function tr(i,t){let e,s,n,o,r,a=Qt(i[0],t);for(e=0,s=i.length;e<s;++e)r=o,o=a,a=e<s-1&&Qt(i[e+1],t),o&&(n=i[e],r&&(n.cp1x=he(n.cp1x,t.left,t.right),n.cp1y=he(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=he(n.cp2x,t.left,t.right),n.cp2y=he(n.cp2y,t.top,t.bottom)))}function er(i,t,e,s,n){let o,r,a,l;if(t.spanGaps&&(i=i.filter(c=>!c.skip)),t.cubicInterpolationMode==="monotone")Jo(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;o<r;++o)a=i[o],l=Go(c,a,i[Math.min(o+1,r-(s?0:1))%r],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,c=a}t.capBezierPoints&&tr(i,e)}function ci(){return typeof window<"u"&&typeof document<"u"}function hi(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Me(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}const Oe=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function ir(i,t){return Oe(i).getPropertyValue(t)}const sr=["top","right","bottom","left"];function vt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=sr[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const nr=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function or(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(nr(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function bt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Oe(e),o=n.boxSizing==="border-box",r=vt(n,"padding"),a=vt(n,"border","width"),{x:l,y:c,box:h}=or(i,e),d=r.left+(h&&a.left),f=r.top+(h&&a.top);let{width:u,height:g}=t;return o&&(u-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/u*e.width/s),y:Math.round((c-f)/g*e.height/s)}}function rr(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&hi(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Oe(o),l=vt(a,"border","width"),c=vt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=Me(a.maxWidth,o,"clientWidth"),n=Me(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||Se,maxHeight:n||Se}}const ct=i=>Math.round(i*10)/10;function ar(i,t,e,s){const n=Oe(i),o=vt(n,"margin"),r=Me(n.maxWidth,i,"clientWidth")||Se,a=Me(n.maxHeight,i,"clientHeight")||Se,l=rr(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const f=vt(n,"border","width"),u=vt(n,"padding");c-=u.width+f.width,h-=u.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=ct(Math.min(c,r,l.maxWidth)),h=ct(Math.min(h,a,l.maxHeight)),c&&!h&&(h=ct(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=ct(Math.floor(h*s))),{width:c,height:h}}function Ai(i,t,e){const s=t||1,n=ct(i.height*s),o=ct(i.width*s);i.height=ct(i.height),i.width=ct(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const lr=(function(){let i=!1;try{const t={get passive(){return i=!0,!1}};ci()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i})();function Ii(i,t){const e=ir(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function _t(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function cr(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function hr(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=_t(i,n,e),a=_t(n,o,e),l=_t(o,t,e),c=_t(r,a,e),h=_t(a,l,e);return _t(c,h,e)}const dr=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},fr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Ot(i,t,e){return i?dr(t,e):fr()}function Gs(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Zs(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function Qs(i){return i==="angle"?{between:zs,compare:lo,normalize:st}:{between:Ct,compare:(t,e)=>t-e,normalize:t=>t}}function Fi({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function ur(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=Qs(s),l=t.length;let{start:c,end:h,loop:d}=i,f,u;if(d){for(c+=l,h+=l,f=0,u=l;f<u&&r(a(t[c%l][s]),n,o);++f)c--,h--;c%=l,h%=l}return h<c&&(h+=l),{start:c,end:h,loop:d,style:i.style}}function Js(i,t,e){if(!e)return[i];const{property:s,start:n,end:o}=e,r=t.length,{compare:a,between:l,normalize:c}=Qs(s),{start:h,end:d,loop:f,style:u}=ur(i,t,e),g=[];let p=!1,m=null,b,x,v;const w=()=>l(n,v,b)&&a(n,v)!==0,_=()=>a(o,b)===0||l(o,v,b),S=()=>p||w(),k=()=>!p||_();for(let y=h,M=h;y<=d;++y)x=t[y%r],!x.skip&&(b=c(x[s]),b!==v&&(p=l(b,n,o),m===null&&S()&&(m=a(b,n)===0?y:M),m!==null&&k()&&(g.push(Fi({start:m,end:y,loop:f,count:r,style:u})),m=null),M=y,v=b));return m!==null&&g.push(Fi({start:m,end:d,loop:f,count:r,style:u})),g}function tn(i,t){const e=[],s=i.segments;for(let n=0;n<s.length;n++){const o=Js(s[n],i.points,t);o.length&&e.push(...o)}return e}function gr(i,t,e,s){let n=0,o=t-1;if(e&&!s)for(;n<t&&!i[n].skip;)n++;for(;n<t&&i[n].skip;)n++;for(n%=t,e&&(o+=n);o>n&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function pr(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function mr(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=gr(e,n,o,s);if(s===!0)return Ei(i,[{start:r,end:a,loop:o}],e,t);const l=a<r?a+n:a,c=!!i._fullLoop&&r===0&&a===n-1;return Ei(i,pr(e,r,l,c),e,t)}function Ei(i,t,e,s){return!s||!s.setContext||!e?t:br(i,t,e,s)}function br(i,t,e,s){const n=i._chart.getContext(),o=Ri(i.options),{_datasetIndex:r,options:{spanGaps:a}}=i,l=e.length,c=[];let h=o,d=t[0].start,f=d;function u(g,p,m,b){const x=a?-1:1;if(g!==p){for(g+=l;e[g%l].skip;)g-=x;for(;e[p%l].skip;)p+=x;g%l!==p%l&&(c.push({start:g%l,end:p%l,loop:m,style:b}),h=b,d=p%l)}}for(const g of t){d=a?d:g.start;let p=e[d%l],m;for(f=d+1;f<=g.end;f++){const b=e[f%l];m=Ri(s.setContext(kt(n,{type:"segment",p0:p,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:r}))),_r(m,h)&&u(d,f-1,g.loop,h),p=b,h=m}d<f-1&&u(d,f-1,g.loop,h)}return c}function Ri(i){return{backgroundColor:i.backgroundColor,borderCapStyle:i.borderCapStyle,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderJoinStyle:i.borderJoinStyle,borderWidth:i.borderWidth,borderColor:i.borderColor}}function _r(i,t){if(!t)return!1;const e=[],s=function(n,o){return oi(o)?(e.includes(o)||e.push(o),e.indexOf(o)):o};return JSON.stringify(i,s)!==JSON.stringify(t,s)}function de(i,t,e){return i.options.clip?i[e]:t[e]}function xr(i,t){const{xScale:e,yScale:s}=i;return e&&s?{left:de(e,t,"left"),right:de(e,t,"right"),top:de(s,t,"top"),bottom:de(s,t,"bottom")}:t}function en(i,t){const e=t._clip;if(e.disabled)return!1;const s=xr(t,i.chartArea);return{left:e.left===!1?0:s.left-(e.left===!0?0:e.left),right:e.right===!1?i.width:s.right+(e.right===!0?0:e.right),top:e.top===!1?0:s.top-(e.top===!0?0:e.top),bottom:e.bottom===!1?i.height:s.bottom+(e.bottom===!0?0:e.bottom)}}class yr{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Hs.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ot=new yr;const zi="transparent",vr={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Pi(i||zi),n=s.valid&&Pi(t||zi);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class wr{constructor(t,e,s,n){const o=e[s];n=ce([t.to,n,o,t.from]);const r=ce([t.from,o,n]);this._active=!0,this._fn=t.fn||vr[t.type||typeof r],this._easing=Ut[t.easing]||Ut.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ce([t.to,e,n,t.from]),this._from=ce([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e<s),!this._active){this._target[n]=a,this._notify(!0);return}if(e<0){this._target[n]=o;return}l=e/s%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n<s.length;n++)s[n][e]()}}class sn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!C(t))return;const e=Object.keys(E.animation),s=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!C(o))return;const r={};for(const a of e)r[a]=o[a];(R(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=Sr(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&kr(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const f=s.get(c);if(d)if(f&&d.active()){d.update(f,h,a);continue}else d.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=d=new wr(f,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return ot.add(this._chart,s),!0}}function kr(i,t){const e=[],s=Object.keys(t);for(let n=0;n<s.length;n++){const o=i[s[n]];o&&o.active()&&e.push(o.wait())}return Promise.all(e)}function Sr(i,t){if(!t)return;let e=i.options;if(!e){i.options=t;return}return e.$shared&&(i.options=e=Object.assign({},e,{$shared:!1,$animations:{}})),e}function Bi(i,t){const e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function Mr(i,t,e){if(e===!1)return!1;const s=Bi(i,e),n=Bi(t,e);return{top:n.end,right:s.end,bottom:n.start,left:s.start}}function Pr(i){let t,e,s,n;return C(i)?(t=i.top,e=i.right,s=i.bottom,n=i.left):t=e=s=n=i,{top:t,right:e,bottom:s,left:n,disabled:i===!1}}function nn(i,t){const e=[],s=i._getSortedDatasetMetas(t);let n,o;for(n=0,o=s.length;n<o;++n)e.push(s[n].index);return e}function Hi(i,t,e,s={}){const n=i.keys,o=s.mode==="single";let r,a,l,c;if(t===null)return;let h=!1;for(r=0,a=n.length;r<a;++r){if(l=+n[r],l===e){if(h=!0,s.all)continue;break}c=i.values[l],N(c)&&(o||t===0||Tt(t)===Tt(c))&&(t+=c)}return!h&&!s.all?0:t}function Dr(i,t){const{iScale:e,vScale:s}=t,n=e.axis==="x"?"x":"y",o=s.axis==="x"?"x":"y",r=Object.keys(i),a=new Array(r.length);let l,c,h;for(l=0,c=r.length;l<c;++l)h=r[l],a[l]={[n]:h,[o]:i[h]};return a}function Re(i,t){const e=i&&i.options.stacked;return e||e===void 0&&t.stack!==void 0}function Cr(i,t,e){return`${i.id}.${t.id}.${e.stack||e.type}`}function Or(i){const{min:t,max:e,minDefined:s,maxDefined:n}=i.getUserBounds();return{min:s?t:Number.NEGATIVE_INFINITY,max:n?e:Number.POSITIVE_INFINITY}}function Tr(i,t,e){const s=i[t]||(i[t]={});return s[e]||(s[e]={})}function Wi(i,t,e,s){for(const n of t.getMatchingVisibleMetas(s).reverse()){const o=i[n.index];if(e&&o>0||!e&&o<0)return n.index}return null}function Ni(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=Cr(o,r,s),d=t.length;let f;for(let u=0;u<d;++u){const g=t[u],{[l]:p,[c]:m}=g,b=g._stacks||(g._stacks={});f=b[c]=Tr(n,h,p),f[a]=m,f._top=Wi(f,r,!0,s.type),f._bottom=Wi(f,r,!1,s.type);const x=f._visualValues||(f._visualValues={});x[a]=m}}function ze(i,t){const e=i.scales;return Object.keys(e).filter(s=>e[s].axis===t).shift()}function Lr(i,t){return kt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Ar(i,t,e){return kt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Rt(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const Be=i=>i==="reset"||i==="none",Vi=(i,t)=>t?i:Object.assign({},i),Ir=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:nn(e,!0),values:null};class on{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Re(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&&Rt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,f,u,g)=>d==="x"?f:d==="r"?g:u,o=e.xAxisID=D(s.xAxisID,ze(t,"x")),r=e.yAxisID=D(s.yAxisID,ze(t,"y")),a=e.rAxisID=D(s.rAxisID,ze(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&ki(this._data,this),t._stacked&&Rt(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(C(e)){const n=this._cachedMeta;this._data=Dr(e,n)}else if(s!==e){if(s){ki(s,this);const n=this._cachedMeta;Rt(n),n._parsed=[]}e&&Object.isExtensible(e)&&uo(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Re(e.vScale,e),e.stack!==s.stack&&(n=!0,Rt(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(Ni(this,e._parsed),e._stacked=Re(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,f;if(this._parsing===!1)s._parsed=n,s._sorted=!0,f=n;else{R(n[t])?f=this.parseArrayData(s,n,t,e):C(n[t])?f=this.parseObjectData(s,n,t,e):f=this.parsePrimitiveData(s,n,t,e);const u=()=>d[a]===null||c&&d[a]<c[a];for(h=0;h<e;++h)s._parsed[h+t]=d=f[h],l&&(u()&&(l=!1),c=d);s._sorted=l}r&&Ni(this,f)}parsePrimitiveData(t,e,s,n){const{iScale:o,vScale:r}=t,a=o.axis,l=r.axis,c=o.getLabels(),h=o===r,d=new Array(n);let f,u,g;for(f=0,u=n;f<u;++f)g=f+s,d[f]={[a]:h||o.parse(c[g],g),[l]:r.parse(e[g],g)};return d}parseArrayData(t,e,s,n){const{xScale:o,yScale:r}=t,a=new Array(n);let l,c,h,d;for(l=0,c=n;l<c;++l)h=l+s,d=e[h],a[l]={x:o.parse(d[0],h),y:r.parse(d[1],h)};return a}parseObjectData(t,e,s,n){const{xScale:o,yScale:r}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(n);let h,d,f,u;for(h=0,d=n;h<d;++h)f=h+s,u=e[f],c[h]={x:o.parse(we(u,a),f),y:r.parse(we(u,l),f)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,e,s){const n=this.chart,o=this._cachedMeta,r=e[t.axis],a={keys:nn(n,!0),values:e._stacks[t.axis]._visualValues};return Hi(a,r,o.index,{mode:s})}updateRangeFromParsed(t,e,s,n){const o=s[e.axis];let r=o===null?NaN:o;const a=n&&s._stacks[e.axis];n&&a&&(n.values=a,r=Hi(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,r),t.max=Math.max(t.max,r)}getMinMax(t,e){const s=this._cachedMeta,n=s._parsed,o=s._sorted&&t===s.iScale,r=n.length,a=this._getOtherScale(t),l=Ir(e,s,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:d}=Or(a);let f,u;function g(){u=n[f];const p=u[a.axis];return!N(u[t.axis])||h>p||d<p}for(f=0;f<r&&!(!g()&&(this.updateRangeFromParsed(c,t,u,l),o));++f);if(o){for(f=r-1;f>=0;--f)if(!g()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n<o;++n)r=e[n][t.axis],N(r)&&s.push(r);return s}getMaxOverflow(){return!1}getLabelAndValue(t){const e=this._cachedMeta,s=e.iScale,n=e.vScale,o=this.getParsed(t);return{label:s?""+s.getLabelForValue(o[s.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const e=this._cachedMeta;this.update(t||"default"),e._clip=Pr(D(this.options.clip,Mr(e.xScale,e.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,e=this.chart,s=this._cachedMeta,n=s.data||[],o=e.chartArea,r=[],a=this._drawStart||0,l=this._drawCount||n.length-a,c=this.options.drawActiveElementsOnTop;let h;for(s.dataset&&s.dataset.draw(t,o,a,l),h=a;h<a+l;++h){const d=n[h];d.hidden||(d.active&&c?r.push(d):d.draw(t,o))}for(h=0;h<r.length;++h)r[h].draw(t,o)}getStyle(t,e){const s=e?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(s):this.resolveDataElementOptions(t||0,s)}getContext(t,e,s){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const r=this._cachedMeta.data[t];o=r.$context||(r.$context=Ar(this.getContext(),t,r)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=Lr(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!e,o.mode=s,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,e){return this._resolveElementOptions(this.dataElementType.id,e,t)}_resolveElementOptions(t,e="default",s){const n=e==="active",o=this._cachedDataOpts,r=t+"-"+e,a=o[r],l=this.enableOptionSharing&&ke(s);if(a)return Vi(a,l);const c=this.chart.config,h=c.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],f=c.getOptionScopes(this.getDataset(),h),u=Object.keys(E.elements[t]),g=()=>this.getContext(s,n,e),p=c.resolveNamedOptions(f,u,g,d);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(Vi(p,l))),p}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(f,this.getContext(t,s,e))}const c=new sn(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Be(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){Be(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Be(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,e,s=!0){const n=this._cachedMeta,o=n.data,r=t+e;let a;const l=c=>{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;a<r;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,e),s&&this.updateElements(o,t,e,"reset")}updateElements(t,e,s,n){}_removeElements(t,e){const s=this._cachedMeta;if(this._parsing){const n=s._parsed.splice(t,e);s._stacked&&Rt(s,n)}s.data.splice(t,e)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[e,s,n]=t;this[e](s,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,e){e&&this._sync(["_removeElements",t,e]);const s=arguments.length-2;s&&this._sync(["_insertElements",t,s])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}class Fr extends on{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){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=bo(e,n,r);this._drawStart=a,this._drawCount=l,_o(e)&&(a=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),f=r.axis,u=a.axis,{spanGaps:g,segment:p}=this.options,m=Zt(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||n==="none",x=e+s,v=t.length;let w=e>0&&this.getParsed(e-1);for(let _=0;_<v;++_){const S=t[_],k=b?S:{};if(_<e||_>=x){k.skip=!0;continue}const y=this.getParsed(_),M=A(y[u]),O=k[f]=r.getPixelForValue(y[f],_),P=k[u]=o||M?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,y,l):y[u],_);k.skip=isNaN(O)||isNaN(P)||M,k.stop=_>0&&Math.abs(y[f]-w[f])>m,p&&(k.parsed=y,k.raw=c.data[_]),d&&(k.options=h||this.resolveDataElementOptions(_,S.active?"active":n)),b||this.updateElement(S,_,k,n),w=y}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function mt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class di{static override(t){Object.assign(di.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return mt()}parse(){return mt()}format(){return mt()}add(){return mt()}diff(){return mt()}startOf(){return mt()}endOf(){return mt()}}var Er={_date:di};function Rr(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?ho:yt;if(s){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const f=c(o,t,e-d),u=c(o,t,e+d);return{lo:f.lo,hi:u.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:f}=i,u=f.slice(0,h.lo+1).reverse().findIndex(p=>!A(p[d.axis]));h.lo-=Math.max(0,u);const g=f.slice(h.hi).findIndex(p=>!A(p[d.axis]));h.hi+=Math.max(0,g)}return h}}return{lo:0,hi:o.length-1}}function Te(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a<l;++a){const{index:c,data:h}=o[a],{lo:d,hi:f}=Rr(o[a],t,r,n);for(let u=d;u<=f;++u){const g=h[u];g.skip||s(g,c,u)}}}function zr(i){const t=i.indexOf("x")!==-1,e=i.indexOf("y")!==-1;return function(s,n){const o=t?Math.abs(s.x-n.x):0,r=e?Math.abs(s.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(r,2))}}function He(i,t,e,s,n){const o=[];return!n&&!i.isPointInArea(t)||Te(i,e,t,function(a,l,c){!n&&!Qt(a,i.chartArea,0)||a.inRange(t.x,t.y,s)&&o.push({element:a,datasetIndex:l,index:c})},!0),o}function Br(i,t,e,s){let n=[];function o(r,a,l){const{startAngle:c,endAngle:h}=r.getProps(["startAngle","endAngle"],s),{angle:d}=ao(r,{x:t.x,y:t.y});zs(d,c,h)&&n.push({element:r,datasetIndex:a,index:l})}return Te(i,e,t,o),n}function Hr(i,t,e,s,n,o){let r=[];const a=zr(e);let l=Number.POSITIVE_INFINITY;function c(h,d,f){const u=h.inRange(t.x,t.y,n);if(s&&!u)return;const g=h.getCenterPoint(n);if(!(!!o||i.isPointInArea(g))&&!u)return;const m=a(t,g);m<l?(r=[{element:h,datasetIndex:d,index:f}],l=m):m===l&&r.push({element:h,datasetIndex:d,index:f})}return Te(i,e,t,c),r}function We(i,t,e,s,n,o){return!o&&!i.isPointInArea(t)?[]:e==="r"&&!s?Br(i,t,e,n):Hr(i,t,e,s,n,o)}function ji(i,t,e,s,n){const o=[],r=e==="x"?"inXRange":"inYRange";let a=!1;return Te(i,e,t,(l,c,h)=>{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var Wr={modes:{index(i,t,e,s){const n=bt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?He(i,n,o,s,r):We(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=bt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?He(i,n,o,s,r):We(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;h<c.length;++h)a.push({element:c[h],datasetIndex:l,index:h})}return a},point(i,t,e,s){const n=bt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return He(i,n,o,s,r)},nearest(i,t,e,s){const n=bt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;return We(i,n,o,e.intersect,s,r)},x(i,t,e,s){const n=bt(t,i);return ji(i,n,"x",e.intersect,s)},y(i,t,e,s){const n=bt(t,i);return ji(i,n,"y",e.intersect,s)}}};const rn=["left","top","right","bottom"];function zt(i,t){return i.filter(e=>e.pos===t)}function $i(i,t){return i.filter(e=>rn.indexOf(e.pos)===-1&&e.box.axis===t)}function Bt(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Nr(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;e<s;++e)n=i[e],{position:o,options:{stack:r,stackWeight:a=1}}=n,t.push({index:e,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:r&&o+r,stackWeight:a});return t}function Vr(i){const t={};for(const e of i){const{stack:s,pos:n,stackWeight:o}=e;if(!s||!rn.includes(n))continue;const r=t[s]||(t[s]={count:0,placed:0,weight:0,size:0});r.count++,r.weight+=o}return t}function jr(i,t){const e=Vr(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t;let o,r,a;for(o=0,r=i.length;o<r;++o){a=i[o];const{fullSize:l}=a.box,c=e[a.stack],h=c&&a.stackWeight/c.weight;a.horizontal?(a.width=h?h*s:l&&t.availableWidth,a.height=n):(a.width=s,a.height=h?h*n:l&&t.availableHeight)}return e}function $r(i){const t=Nr(i),e=Bt(t.filter(c=>c.box.fullSize),!0),s=Bt(zt(t,"left"),!0),n=Bt(zt(t,"right")),o=Bt(zt(t,"top"),!0),r=Bt(zt(t,"bottom")),a=$i(t,"x"),l=$i(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:zt(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function Yi(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function an(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function Yr(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!C(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&an(r,o.getPadding());const a=Math.max(0,t.outerWidth-Yi(r,i,"left","right")),l=Math.max(0,t.outerHeight-Yi(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Ur(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Xr(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function Vt(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o<r;++o){a=i[o],l=a.box,l.update(a.width||t.w,a.height||t.h,Xr(a.horizontal,t));const{same:d,other:f}=Yr(t,e,a,s);c|=d&&n.length,h=h||f,l.fullSize||n.push(a)}return c&&Vt(n,t,e,s)||h}function fe(i,t,e,s,n){i.top=e,i.left=t,i.right=t+s,i.bottom=e+n,i.width=s,i.height=n}function Ui(i,t,e,s){const n=e.padding;let{x:o,y:r}=t;for(const a of i){const l=a.box,c=s[a.stack]||{placed:0,weight:1},h=a.stackWeight/c.weight||1;if(a.horizontal){const d=t.w*h,f=c.size||l.height;ke(c.start)&&(r=c.start),l.fullSize?fe(l,n.left,r,e.outerWidth-n.right-n.left,f):fe(l,t.left+c.placed,r,d,f),c.start=r,c.placed+=d,r=l.bottom}else{const d=t.h*h,f=c.size||l.width;ke(c.start)&&(o=c.start),l.fullSize?fe(l,o,n.top,f,e.outerHeight-n.bottom-n.top):fe(l,o,t.top+c.placed,f,d),c.start=o,c.placed+=d,o=l.right}}t.x=o,t.y=r}var K={addBox(i,t){i.boxes||(i.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(e){t.draw(e)}}]},i.boxes.push(t)},removeBox(i,t){const e=i.boxes?i.boxes.indexOf(t):-1;e!==-1&&i.boxes.splice(e,1)},configure(i,t,e){t.fullSize=e.fullSize,t.position=e.position,t.weight=e.weight},update(i,t,e,s){if(!i)return;const n=q(i.options.layout.padding),o=Math.max(t-n.width,0),r=Math.max(e-n.height,0),a=$r(i.boxes),l=a.vertical,c=a.horizontal;L(i.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),f=Object.assign({},n);an(f,q(s));const u=Object.assign({maxPadding:f,w:o,h:r,x:n.left,y:n.top},n),g=jr(l.concat(c),d);Vt(a.fullSize,u,d,g),Vt(l,u,d,g),Vt(c,u,d,g)&&Vt(l,u,d,g),Ur(u),Ui(a.leftAndTop,u,d,g),u.x+=u.w,u.y+=u.h,Ui(a.rightAndBottom,u,d,g),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},L(a.chartArea,p=>{const m=p.box;Object.assign(m,i.chartArea),m.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class ln{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class Kr extends ln{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const _e="$chartjs",qr={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Xi=i=>i===null||i==="";function Gr(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[_e]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",Xi(n)){const o=Ii(i,"width");o!==void 0&&(i.width=o)}if(Xi(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Ii(i,"height");o!==void 0&&(i.height=o)}return i}const cn=lr?{passive:!0}:!1;function Zr(i,t,e){i&&i.addEventListener(t,e,cn)}function Qr(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,cn)}function Jr(i,t){const e=qr[i.type]||i.type,{x:s,y:n}=bt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Pe(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function ta(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Pe(a.addedNodes,s),r=r&&!Pe(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function ea(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Pe(a.removedNodes,s),r=r&&!Pe(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const te=new Map;let Ki=0;function hn(){const i=window.devicePixelRatio;i!==Ki&&(Ki=i,te.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function ia(i,t){te.size||window.addEventListener("resize",hn),te.set(i,t)}function sa(i){te.delete(i),te.size||window.removeEventListener("resize",hn)}function na(i,t,e){const s=i.canvas,n=s&&hi(s);if(!n)return;const o=Ws((a,l)=>{const c=n.clientWidth;e(a,l),c<n.clientWidth&&e()},window),r=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),ia(i,o),r}function Ne(i,t,e){e&&e.disconnect(),t==="resize"&&sa(i)}function oa(i,t,e){const s=i.canvas,n=Ws(o=>{i.ctx!==null&&e(Jr(o,i))},i);return Zr(s,t,n),n}class ra extends ln{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Gr(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[_e])return!1;const s=e[_e].initial;["height","width"].forEach(o=>{const r=s[o];A(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[_e],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:ta,detach:ea,resize:na}[e]||oa;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:Ne,detach:Ne,resize:Ne}[e]||Qr)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return ar(t,e,s,n)}isAttached(t){const e=t&&hi(t);return!!(e&&e.isConnected)}}function aa(i){return!ci()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Kr:ra}class St{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return Zt(this.x)&&Zt(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}function la(i,t){const e=i.options.ticks,s=ca(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?da(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return fa(t,c,o,r/n),c;const h=ha(o,t,n);if(r>0){let d,f;const u=r>1?Math.round((l-a)/(r-1)):null;for(ue(t,c,h,A(u)?0:a-u,a),d=0,f=r-1;d<f;d++)ue(t,c,h,o[d],o[d+1]);return ue(t,c,h,l,A(u)?t.length:l+u),c}return ue(t,c,h),c}function ca(i){const t=i.options.offset,e=i._tickSize(),s=i._length/e+(t?0:1),n=i._maxLength/e;return Math.floor(Math.min(s,n))}function ha(i,t,e){const s=ua(i),n=t.length/e;if(!s)return Math.max(n,1);const o=io(s);for(let r=0,a=o.length-1;r<a;r++){const l=o[r];if(l>n)return l}return Math.max(n,1)}function da(i){const t=[];let e,s;for(e=0,s=i.length;e<s;e++)i[e].major&&t.push(e);return t}function fa(i,t,e,s){let n=0,o=e[0],r;for(s=Math.ceil(s),r=0;r<i.length;r++)r===o&&(t.push(i[r]),n++,o=e[n*s])}function ue(i,t,e,s,n){const o=D(s,0),r=Math.min(D(n,i.length),i.length);let a=0,l,c,h;for(e=Math.ceil(e),n&&(l=n-s,e=l/Math.floor(l/e)),h=o;h<0;)a++,h=Math.round(o+a*e);for(c=Math.max(o,0);c<r;c++)c===h&&(t.push(i[c]),a++,h=Math.round(o+a*e))}function ua(i){const t=i.length;let e,s;if(t<2)return!1;for(s=i[0],e=1;e<t;++e)if(i[e]-i[e-1]!==s)return!1;return s}const ga=i=>i==="left"?"right":i==="right"?"left":i,qi=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,Gi=(i,t)=>Math.min(t||i,i);function Zi(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;o<n;o+=s)e.push(i[Math.floor(o)]);return e}function pa(i,t,e){const s=i.ticks.length,n=Math.min(t,s-1),o=i._startPixel,r=i._endPixel,a=1e-6;let l=i.getPixelForTick(n),c;if(!(e&&(s===1?c=Math.max(l-o,r-l):t===0?c=(i.getPixelForTick(1)-l)/2:c=(l-i.getPixelForTick(n-1))/2,l+=n<t?c:-c,l<o-a||l>r+a)))return l}function ma(i,t){L(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;o<n;++o)delete e.data[s[o]];s.splice(0,n)}})}function Ht(i){return i.drawTicks?i.tickLength:0}function Qi(i,t){if(!i.display)return 0;const e=W(i.font,t),s=q(i.padding);return(R(i.text)?i.text.length:1)*e.lineHeight+s.height}function ba(i,t){return kt(i,{scale:t,type:"scale"})}function _a(i,t,e){return kt(i,{tick:e,index:t,type:"tick"})}function xa(i,t,e){let s=ni(i);return(e&&t!=="right"||!e&&t==="right")&&(s=ga(s)),s}function ya(i,t,e,s){const{top:n,left:o,bottom:r,right:a,chart:l}=i,{chartArea:c,scales:h}=l;let d=0,f,u,g;const p=r-n,m=a-o;if(i.isHorizontal()){if(u=H(s,o,a),C(e)){const b=Object.keys(e)[0],x=e[b];g=h[b].getPixelForValue(x)+p-t}else e==="center"?g=(c.bottom+c.top)/2+p-t:g=qi(i,e,t);f=a-o}else{if(C(e)){const b=Object.keys(e)[0],x=e[b];u=h[b].getPixelForValue(x)-m+t}else e==="center"?u=(c.left+c.right)/2-m+t:u=qi(i,e,t);g=H(s,r,n),d=e==="left"?-G:G}return{titleX:u,titleY:g,maxWidth:f,rotation:d}}class It extends St{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=J(t,Number.POSITIVE_INFINITY),e=J(e,Number.NEGATIVE_INFINITY),s=J(s,Number.POSITIVE_INFINITY),n=J(n,Number.NEGATIVE_INFINITY),{min:J(t,s),max:J(e,n),minDefined:N(t),maxDefined:N(e)}}getMinMax(t){let{min:e,max:s,minDefined:n,maxDefined:o}=this.getUserBounds(),r;if(n&&o)return{min:e,max:s};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)r=a[l].controller.getMinMax(this,t),n||(e=Math.min(e,r.min)),o||(s=Math.max(s,r.max));return e=o&&e>s?s:e,s=n&&e>s?e:s,{min:J(e,J(s,e)),max:J(s,J(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){I(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ho(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Zi(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),r.display&&(r.autoSkip||r.source==="auto")&&(this.ticks=la(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,e,s;this.isHorizontal()?(e=this.left,s=this.right):(e=this.top,s=this.bottom,t=!t),this._startPixel=e,this._endPixel=s,this._reversePixels=t,this._length=s-e,this._alignToPixels=this.options.alignToPixels}afterUpdate(){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(t){this.chart.notifyPlugins(t,this.getContext()),I(this.options[t],[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(t){const e=this.options.ticks;let s,n,o;for(s=0,n=t.length;s<n;s++)o=t[s],o.label=I(e.callback,[o.value,s,t],this)}afterTickToLabelConversion(){I(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){I(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,e=t.ticks,s=Gi(this.ticks.length,t.ticks.maxTicksLimit),n=e.minRotation||0,o=e.maxRotation;let r=n,a,l,c;if(!this._isVisible()||!e.display||n>=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,u=X(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:u/(s-1),d+6>a&&(a=u/(s-(t.offset?.5:1)),l=this.maxHeight-Ht(t.grid)-e.padding-Qi(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=ro(Math.min(Math.asin(X((h.highest.height+6)/a,-1,1)),Math.asin(X(l/c,-1,1))-Math.asin(X(f/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Qi(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ht(o)+l):(t.height=this.maxHeight,t.width=Ht(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),u=s.padding*2,g=xt(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const b=s.mirror?0:m*d.width+p*f.height;t.height=Math.min(this.maxHeight,t.height+b+u)}else{const b=s.mirror?0:p*d.width+m*f.height;t.width=Math.min(this.maxWidth,t.width+b+u)}this._calculatePadding(c,h,m,p)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,u=0;l?c?(f=n*t.width,u=s*e.height):(f=s*t.height,u=n*e.width):o==="start"?u=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,u=e.width/2),this.paddingLeft=Math.max((f-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){I(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e<s;e++)A(t[e].label)&&(t.splice(e,1),s--,e--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const e=this.options.ticks.sampleSize;let s=this.ticks;e<s.length&&(s=Zi(s,e)),this._labelSizes=t=this._computeLabelSizes(s,s.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,e,s){const{ctx:n,_longestTextCache:o}=this,r=[],a=[],l=Math.floor(e/Gi(e,s));let c=0,h=0,d,f,u,g,p,m,b,x,v,w,_;for(d=0;d<e;d+=l){if(g=t[d].label,p=this._resolveTickFontOptions(d),n.font=m=p.string,b=o[m]=o[m]||{data:{},gc:[]},x=p.lineHeight,v=w=0,!A(g)&&!R(g))v=Ci(n,b.data,b.gc,v,g),w=x;else if(R(g))for(f=0,u=g.length;f<u;++f)_=g[f],!A(_)&&!R(_)&&(v=Ci(n,b.data,b.gc,v,_),w+=x);r.push(v),a.push(w),c=Math.max(v,c),h=Math.max(w,h)}ma(o,e);const S=r.indexOf(c),k=a.indexOf(h),y=M=>({width:r[M]||0,height:a[M]||0});return{first:y(0),last:y(e-1),widest:y(S),highest:y(k),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return co(this._alignToPixels?pt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&t<e.length){const s=e[t];return s.$context||(s.$context=_a(this.getContext(),t,s))}return this.$context||(this.$context=ba(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,e=xt(this.labelRotation),s=Math.abs(Math.cos(e)),n=Math.abs(Math.sin(e)),o=this._getLabelSizes(),r=t.autoSkipPadding||0,a=o?o.widest.width+r:0,l=o?o.highest.height+r:0;return this.isHorizontal()?l*s>a*n?a/s:l/n:l*n<a*s?l/s:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Ht(o),u=[],g=a.setContext(this.getContext()),p=g.display?g.width:0,m=p/2,b=function(B){return pt(s,B,p)};let x,v,w,_,S,k,y,M,O,P,T,V;if(r==="top")x=b(this.bottom),k=this.bottom-f,M=x-m,P=b(t.top)+m,V=t.bottom;else if(r==="bottom")x=b(this.top),P=t.top,V=b(t.bottom)-m,k=x+m,M=this.top+f;else if(r==="left")x=b(this.right),S=this.right-f,y=x-m,O=b(t.left)+m,T=t.right;else if(r==="right")x=b(this.left),O=t.left,T=b(t.right)-m,S=x+m,y=this.left+f;else if(e==="x"){if(r==="center")x=b((t.top+t.bottom)/2+.5);else if(C(r)){const B=Object.keys(r)[0],Y=r[B];x=b(this.chart.scales[B].getPixelForValue(Y))}P=t.top,V=t.bottom,k=x+m,M=k+f}else if(e==="y"){if(r==="center")x=b((t.left+t.right)/2);else if(C(r)){const B=Object.keys(r)[0],Y=r[B];x=b(this.chart.scales[B].getPixelForValue(Y))}S=x-m,y=S-f,O=t.left,T=t.right}const Q=D(n.ticks.maxTicksLimit,d),F=Math.max(1,Math.ceil(d/Q));for(v=0;v<d;v+=F){const B=this.getContext(v),Y=o.setContext(B),ie=a.setContext(B),se=Y.lineWidth,Mt=Y.color,ne=ie.dash||[],Pt=ie.dashOffset,Ft=Y.tickWidth,ft=Y.tickColor,Et=Y.tickBorderDash||[],ut=Y.tickBorderDashOffset;w=pa(this,v,l),w!==void 0&&(_=pt(s,w,se),c?S=y=O=T=_:k=M=P=V=_,u.push({tx1:S,ty1:k,tx2:y,ty2:M,x1:O,y1:P,x2:T,y2:V,width:se,color:Mt,borderDash:ne,borderDashOffset:Pt,tickWidth:Ft,tickColor:ft,tickBorderDash:Et,tickBorderDashOffset:ut}))}return this._ticksLength=d,this._borderValue=x,u}_computeLabelItems(t){const e=this.axis,s=this.options,{position:n,ticks:o}=s,r=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:h,mirror:d}=o,f=Ht(s.grid),u=f+h,g=d?-h:u,p=-xt(this.labelRotation),m=[];let b,x,v,w,_,S,k,y,M,O,P,T,V="middle";if(n==="top")S=this.bottom-g,k=this._getXAxisLabelAlignment();else if(n==="bottom")S=this.top+g,k=this._getXAxisLabelAlignment();else if(n==="left"){const F=this._getYAxisLabelAlignment(f);k=F.textAlign,_=F.x}else if(n==="right"){const F=this._getYAxisLabelAlignment(f);k=F.textAlign,_=F.x}else if(e==="x"){if(n==="center")S=(t.top+t.bottom)/2+u;else if(C(n)){const F=Object.keys(n)[0],B=n[F];S=this.chart.scales[F].getPixelForValue(B)+u}k=this._getXAxisLabelAlignment()}else if(e==="y"){if(n==="center")_=(t.left+t.right)/2-u;else if(C(n)){const F=Object.keys(n)[0],B=n[F];_=this.chart.scales[F].getPixelForValue(B)}k=this._getYAxisLabelAlignment(f).textAlign}e==="y"&&(l==="start"?V="top":l==="end"&&(V="bottom"));const Q=this._getLabelSizes();for(b=0,x=a.length;b<x;++b){v=a[b],w=v.label;const F=o.setContext(this.getContext(b));y=this.getPixelForTick(b)+o.labelOffset,M=this._resolveTickFontOptions(b),O=M.lineHeight,P=R(w)?w.length:1;const B=P/2,Y=F.color,ie=F.textStrokeColor,se=F.textStrokeWidth;let Mt=k;r?(_=y,k==="inner"&&(b===x-1?Mt=this.options.reverse?"left":"right":b===0?Mt=this.options.reverse?"right":"left":Mt="center"),n==="top"?c==="near"||p!==0?T=-P*O+O/2:c==="center"?T=-Q.highest.height/2-B*O+O:T=-Q.highest.height+O/2:c==="near"||p!==0?T=O/2:c==="center"?T=Q.highest.height/2-B*O:T=Q.highest.height-P*O,d&&(T*=-1),p!==0&&!F.showLabelBackdrop&&(_+=O/2*Math.sin(p))):(S=y,T=(1-P)*O/2);let ne;if(F.showLabelBackdrop){const Pt=q(F.backdropPadding),Ft=Q.heights[b],ft=Q.widths[b];let Et=T-Pt.top,ut=0-Pt.left;switch(V){case"middle":Et-=Ft/2;break;case"bottom":Et-=Ft;break}switch(k){case"center":ut-=ft/2;break;case"right":ut-=ft;break;case"inner":b===x-1?ut-=ft:b>0&&(ut-=ft/2);break}ne={left:ut,top:Et,width:ft+Pt.width,height:Ft+Pt.height,color:F.backdropColor}}m.push({label:w,font:M,textOffset:T,options:{rotation:p,color:Y,strokeColor:ie,strokeWidth:se,textAlign:Mt,textBaseline:V,translation:[_,S],backdrop:ne}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-xt(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o<r;++o){const l=n[o];e.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),e.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:e,options:{border:s,grid:n}}=this,o=s.setContext(this.getContext()),r=s.display?o.width:0;if(!r)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,h,d,f;this.isHorizontal()?(c=pt(t,this.left,r)-r/2,h=pt(t,this.right,a)+a/2,d=f=l):(d=pt(t,this.top,r)-r/2,f=pt(t,this.bottom,a)+a/2,c=h=l),e.save(),e.lineWidth=o.width,e.strokeStyle=o.color,e.beginPath(),e.moveTo(c,d),e.lineTo(h,f),e.stroke(),e.restore()}drawLabels(t){if(!this.options.ticks.display)return;const s=this.ctx,n=this._computeLabelArea();n&&De(s,n);const o=this.getLabelItems(t);for(const r of o){const a=r.options,l=r.font,c=r.label,h=r.textOffset;Jt(s,c,0,h,l,a)}n&&Ce(s)}drawTitle(){const{ctx:t,options:{position:e,title:s,reverse:n}}=this;if(!s.display)return;const o=W(s.font),r=q(s.padding),a=s.align;let l=o.lineHeight/2;e==="bottom"||e==="center"||C(e)?(l+=r.bottom,R(s.text)&&(l+=o.lineHeight*(s.text.length-1))):l+=r.top;const{titleX:c,titleY:h,maxWidth:d,rotation:f}=ya(this,l,e,a);Jt(t,s.text,0,0,o,{color:s.color,maxWidth:d,rotation:f,textAlign:xa(a,e,n),textBaseline:"middle",translation:[c,h]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,e=t.ticks&&t.ticks.z||0,s=D(t.grid&&t.grid.z,-1),n=D(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==It.prototype.draw?[{z:e,draw:o=>{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o<r;++o){const a=e[o];a[s]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const e=this.options.ticks.setContext(this.getContext(t));return W(e.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class ge{constructor(t,e,s){this.type=t,this.scope=e,this.override=s,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const e=Object.getPrototypeOf(t);let s;ka(e)&&(s=this.register(e));const n=this.items,o=t.id,r=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,va(t,r,s),this.override&&E.override(t.id,t.overrides)),r}get(t){return this.items[t]}unregister(t){const e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in E[n]&&(delete E[n][s],this.override&&delete wt[s])}}function va(i,t,e){const s=Gt(Object.create(null),[e?E.get(e):{},E.get(t),i.defaults]);E.set(t,s),i.defaultRoutes&&wa(t,i.defaultRoutes),i.descriptors&&E.describe(t,i.descriptors)}function wa(i,t){Object.keys(t).forEach(e=>{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");E.route(o,n,l,a)})}function ka(i){return"id"in i&&"defaults"in i}class Sa{constructor(){this.controllers=new ge(on,"datasets",!0),this.elements=new ge(St,"elements"),this.plugins=new ge(Object,"plugins"),this.scales=new ge(It,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):L(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=ii(t);I(s["before"+n],[],s),e[t](s),I(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e<this._typedRegistries.length;e++){const s=this._typedRegistries[e];if(s.isForType(t))return s}return this.plugins}_get(t,e,s){const n=e.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+s+".");return n}}var it=new Sa;class Ma{constructor(){this._init=void 0}notify(t,e,s,n){if(e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),r}_notify(t,e,s,n){n=n||{};for(const o of t){const r=o.plugin,a=r[s],l=[e,n,o.options];if(I(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){A(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=D(s.options&&s.options.plugins,{}),o=Pa(s);return n===!1&&!e?[]:Ca(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function Pa(i){const t={},e=[],s=Object.keys(it.plugins.items);for(let o=0;o<s.length;o++)e.push(it.getPlugin(s[o]));const n=i.plugins||[];for(let o=0;o<n.length;o++){const r=n[o];e.indexOf(r)===-1&&(e.push(r),t[r.id]=!0)}return{plugins:e,localIds:t}}function Da(i,t){return!t&&i===!1?null:i===!0?{}:i}function Ca(i,{plugins:t,localIds:e},s,n){const o=[],r=i.getContext();for(const a of t){const l=a.id,c=Da(s[l],n);c!==null&&o.push({plugin:a,options:Oa(i.config,{plugin:a,local:e[l]},c,r)})}return o}function Oa(i,{plugin:t,local:e},s,n){const o=i.pluginScopeKeys(t),r=i.getOptionScopes(s,o);return e&&t.defaults&&r.push(t.defaults),i.createResolver(r,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function qe(i,t){const e=E.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Ta(i,t){let e=i;return i==="_index_"?e=t:i==="_value_"&&(e=t==="x"?"y":"x"),e}function La(i,t){return i===t?"_index_":"_value_"}function Ji(i){if(i==="x"||i==="y"||i==="r")return i}function Aa(i){if(i==="top"||i==="bottom")return"x";if(i==="left"||i==="right")return"y"}function Ge(i,...t){if(Ji(i))return i;for(const e of t){const s=e.axis||Aa(e.position)||i.length>1&&Ji(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function ts(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Ia(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return ts(i,"x",e[0])||ts(i,"y",e[0])}return{}}function Fa(i,t){const e=wt[i.type]||{scales:{}},s=t.scales||{},n=qe(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!C(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=Ge(r,a,Ia(r,i),E.scales[a.type]),c=La(l,n),h=e.scales||{};o[r]=$t(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||qe(a,t),h=(wt[a]||{}).scales||{};Object.keys(h).forEach(d=>{const f=Ta(d,l),u=r[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),$t(o[u],[{axis:f},s[u],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];$t(a,[E.scales[a.type],E.scale])}),o}function dn(i){const t=i.options||(i.options={});t.plugins=D(t.plugins,{}),t.scales=Fa(i,t)}function fn(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Ea(i){return i=i||{},i.data=fn(i.data),dn(i),i}const es=new Map,un=new Set;function pe(i,t){let e=es.get(i);return e||(e=t(),es.set(i,e),un.add(e)),e}const Wt=(i,t,e)=>{const s=we(t,e);s!==void 0&&i.add(s)};class Ra{constructor(t){this._config=Ea(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=fn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),dn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return pe(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return pe(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return pe(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return pe(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Wt(l,t,d))),h.forEach(d=>Wt(l,n,d)),h.forEach(d=>Wt(l,wt[o]||{},d)),h.forEach(d=>Wt(l,E,d)),h.forEach(d=>Wt(l,Ue,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),un.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,wt[e]||{},E.datasets[e]||{},{type:e},E,Ue]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=is(this._resolverCache,t,n);let l=r;if(Ba(r,e)){o.$shared=!1,s=dt(s)?s():s;const c=this.createResolver(t,s,a);l=Lt(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=is(this._resolverCache,t,s);return C(e)?Lt(o,e,void 0,n):o}}function is(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:ri(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const za=i=>C(i)&&Object.getOwnPropertyNames(i).some(t=>dt(i[t]));function Ba(i,t){const{isScriptable:e,isIndexable:s}=Ys(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(dt(a)||za(a))||r&&R(a))return!0}return!1}var Ha="4.5.1";const Wa=["top","bottom","left","right","chartArea"];function ss(i,t){return i==="top"||i==="bottom"||Wa.indexOf(i)===-1&&t==="x"}function ns(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function os(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),I(e&&e.onComplete,[i],t)}function Na(i){const t=i.chart,e=t.options.animation;I(e&&e.onProgress,[i],t)}function gn(i){return ci()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const xe={},rs=i=>{const t=gn(i);return Object.values(xe).filter(e=>e.canvas===t).pop()};function Va(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function ja(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}let fi=class{static defaults=E;static instances=xe;static overrides=wt;static registry=it;static version=Ha;static getChart=rs;static register(...t){it.add(...t),as()}static unregister(...t){it.remove(...t),as()}constructor(t,e){const s=this.config=new Ra(e),n=gn(t),o=rs(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||aa(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Xn(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ma,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=po(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],xe[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ot.listen(this,"complete",os),ot.listen(this,"progress",Na),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return A(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return it}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ai(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Oi(this.canvas,this.ctx),this}stop(){return ot.stop(this),this}resize(t,e){ot.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Ai(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),I(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};L(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=Ge(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),L(o,r=>{const a=r.options,l=a.id,c=Ge(l,a),h=D(a.type,r.dtype);(a.position===void 0||ss(a.position,c)!==ss(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const f=it.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),L(n,(r,a)=>{r||delete s[a]}),L(s,r=>{K.configure(this,r,r.options),K.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;n<s;++n)this._destroyDatasetMeta(n);t.splice(e,s-e)}this._sortedMetasets=t.slice(0).sort(ns("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:e}}=this;t.length>e.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s<n;s++){const o=e[s];let r=this.getDatasetMeta(s);const a=o.type||this.config.type;if(r.type&&r.type!==a&&(this._destroyDatasetMeta(s),r=this.getDatasetMeta(s)),r.type=a,r.indexAxis=o.indexAxis||qe(a,this.options),r.order=o.order||0,r.index=s,r.label=""+o.label,r.visible=this.isDatasetVisible(s),r.controller)r.controller.updateIndex(s),r.controller.linkScales();else{const l=it.getController(a),{datasetElementType:c,dataElementType:h}=E.datasets[a];Object.assign(l,{dataElementType:it.getElement(h),datasetElementType:c&&it.getElement(c)}),r.controller=new l(this,s),t.push(r.controller)}}return this._updateMetasets(),t}_resetElements(){L(this.data.datasets,(t,e)=>{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c<h;c++){const{controller:d}=this.getDatasetMeta(c),f=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),r=Math.max(+d.getMaxOverflow(),r)}r=this._minPadding=s.layout.autoPadding?r:0,this._updateLayout(r),n||L(o,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ns("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){L(this.scales,t=>{K.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!xi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;Va(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;o<e;o++)if(!xi(n,s(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;K.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],L(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e<s;++e)this.getDatasetMeta(e).controller.configure();for(let e=0,s=this.data.datasets.length;e<s;++e)this._updateDataset(e,dt(t)?t({datasetIndex:e}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,e){const s=this.getDatasetMeta(t),n={meta:s,index:t,mode:e,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(s.controller._update(e),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ot.has(this)?this.attached&&!ot.running(this)&&ot.start(this):(this.draw(),os({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:s,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(s,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const e=this._layers;for(t=0;t<e.length&&e[t].z<=0;++t)e[t].draw(this.chartArea);for(this._drawDatasets();t<e.length;++t)e[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const e=this._sortedMetasets,s=[];let n,o;for(n=0,o=e.length;n<o;++n){const r=e[n];(!t||r.visible)&&s.push(r)}return s}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let e=t.length-1;e>=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s={meta:t,index:t.index,cancelable:!0},n=en(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(n&&De(e,n),t.controller.draw(),n&&Ce(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return Qt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=Wr.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=kt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);ke(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ot.remove(this),t=0,e=this.data.datasets.length;t<e;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:e}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Oi(t,e),this.platform.releaseContext(e),this.canvas=null,this.ctx=null),delete xe[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,e=this.platform,s=(o,r)=>{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};L(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){L(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},L(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){r=t[a];const c=r&&this.getDatasetMeta(r.datasetIndex).controller;c&&c[n+"HoverStyle"](r.element,r.datasetIndex,r.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const e=this._active||[],s=t.map(({datasetIndex:o,index:r})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!ye(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=Jn(t),c=ja(t,this._lastEvent,s,l);s&&(this._lastEvent=null,I(o.onHover,[t,a,this],this),l&&I(o.onClick,[t,a,this],this));const h=!ye(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}};function as(){return L(fi.instances,i=>i._plugins.invalidate())}function pn(i,t,e=t){i.lineCap=D(e.borderCapStyle,t.borderCapStyle),i.setLineDash(D(e.borderDash,t.borderDash)),i.lineDashOffset=D(e.borderDashOffset,t.borderDashOffset),i.lineJoin=D(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=D(e.borderWidth,t.borderWidth),i.strokeStyle=D(e.borderColor,t.borderColor)}function $a(i,t,e){i.lineTo(e.x,e.y)}function Ya(i){return i.stepped?Oo:i.tension||i.cubicInterpolationMode==="monotone"?To:$a}function mn(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=n<r&&o<r||n>a&&o>a;return{count:s,start:l,loop:t.loop,ilen:c<l&&!h?s+c-l:c-l}}function Ua(i,t,e,s){const{points:n,options:o}=t,{count:r,start:a,loop:l,ilen:c}=mn(n,e,s),h=Ya(o);let{move:d=!0,reverse:f}=s||{},u,g,p;for(u=0;u<=c;++u)g=n[(a+(f?c-u:u))%r],!g.skip&&(d?(i.moveTo(g.x,g.y),d=!1):h(i,p,g,f,o.stepped),p=g);return l&&(g=n[(a+(f?c:0))%r],h(i,p,g,f,o.stepped)),!!l}function Xa(i,t,e,s){const n=t.points,{count:o,start:r,ilen:a}=mn(n,e,s),{move:l=!0,reverse:c}=s||{};let h=0,d=0,f,u,g,p,m,b;const x=w=>(r+(c?a-w:w))%o,v=()=>{p!==m&&(i.lineTo(h,m),i.lineTo(h,p),i.lineTo(h,b))};for(l&&(u=n[x(0)],i.moveTo(u.x,u.y)),f=0;f<=a;++f){if(u=n[x(f)],u.skip)continue;const w=u.x,_=u.y,S=w|0;S===g?(_<p?p=_:_>m&&(m=_),h=(d*h+w)/++d):(v(),i.lineTo(w,_),g=S,d=0,p=m=_),b=_}v()}function Ze(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Xa:Ua}function Ka(i){return i.stepped?cr:i.tension||i.cubicInterpolationMode==="monotone"?hr:_t}function qa(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),pn(i,t.options),i.stroke(n)}function Ga(i,t,e,s){const{segments:n,options:o}=t,r=Ze(t);for(const a of n)pn(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Za=typeof Path2D=="function";function Qa(i,t,e,s){Za&&!t.options.segment?qa(i,t,e,s):Ga(i,t,e,s)}class ui extends St{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,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;er(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=mr(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=tn(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=Ka(s);let c,h;for(c=0,h=r.length;c<h;++c){const{start:d,end:f}=r[c],u=o[d],g=o[f];if(u===g){a.push(u);continue}const p=Math.abs((n-u[e])/(g[e]-u[e])),m=l(u,g,p,s.stepped);m[e]=t[e],a.push(m)}return a.length===1?a[0]:a}pathSegment(t,e,s){return Ze(this)(t,this,e,s)}path(t,e,s){const n=this.segments,o=Ze(this);let r=this._loop;e=e||0,s=s||this.points.length-e;for(const a of n)r&=o(t,this,a,{start:e,end:e+s-1});return!!r}draw(t,e,s,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),Qa(t,this,s,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}function ls(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o)<n.radius+n.hitRadius}class Xl extends St{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,e,s){const n=this.options,{x:o,y:r}=this.getProps(["x","y"],s);return Math.pow(t-o,2)+Math.pow(e-r,2)<Math.pow(n.hitRadius+n.radius,2)}inXRange(t,e){return ls(this,t,"x",e)}inYRange(t,e){return ls(this,t,"y",e)}getCenterPoint(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}size(t){t=t||this.options||{};let e=t.radius||0;e=Math.max(e,e&&t.hoverRadius||0);const s=e&&t.borderWidth||0;return(e+s)*2}draw(t,e){const s=this.options;this.skip||s.radius<.1||!Qt(this,e,this.size(s)/2)||(t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.fillStyle=s.backgroundColor,Xe(t,s,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}function Ja(i,t,e){const s=i.segments,n=i.points,o=t.points,r=[];for(const a of s){let{start:l,end:c}=a;c=Le(l,c,n);const h=Qe(e,n[l],n[c],a.loop);if(!t.segments){r.push({source:a,target:h,start:n[l],end:n[c]});continue}const d=tn(t,h);for(const f of d){const u=Qe(e,o[f.start],o[f.end],f.loop),g=Js(a,n,u);for(const p of g)r.push({source:p,target:f,start:{[e]:cs(h,u,"start",Math.max)},end:{[e]:cs(h,u,"end",Math.min)}})}}return r}function Qe(i,t,e,s){if(s)return;let n=t[i],o=e[i];return i==="angle"&&(n=st(n),o=st(o)),{property:i,start:n,end:o}}function tl(i,t){const{x:e=null,y:s=null}=i||{},n=t.points,o=[];return t.segments.forEach(({start:r,end:a})=>{a=Le(r,a,n);const l=n[r],c=n[a];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Le(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function cs(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function bn(i,t){let e=[],s=!1;return R(i)?(s=!0,e=i):e=tl(i,t),e.length?new ui({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function hs(i){return i&&i.fill!==!1}function el(i,t,e){let n=i[t].fill;const o=[t];let r;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!N(n))return n;if(r=i[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function il(i,t,e){const s=rl(i);if(C(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return N(n)&&Math.floor(n)===n?sl(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function sl(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function nl(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:C(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function ol(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:C(i)?s=i.value:s=t.getBaseValue(),s}function rl(i){const t=i.options,e=t.fill;let s=D(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function al(i){const{scale:t,index:e,line:s}=i,n=[],o=s.segments,r=s.points,a=ll(t,e);a.push(bn({x:null,y:t.bottom},s));for(let l=0;l<o.length;l++){const c=o[l];for(let h=c.start;h<=c.end;h++)cl(n,r[h],a)}return new ui({points:n,options:{}})}function ll(i,t){const e=[],s=i.getMatchingVisibleMetas("line");for(let n=0;n<s.length;n++){const o=s[n];if(o.index===t)break;o.hidden||e.unshift(o.dataset)}return e}function cl(i,t,e){const s=[];for(let n=0;n<e.length;n++){const o=e[n],{first:r,last:a,point:l}=hl(o,t,"x");if(!(!l||r&&a)){if(r)s.unshift(l);else if(i.push(l),!a)break}}i.push(...s)}function hl(i,t,e){const s=i.interpolate(t,e);if(!s)return{};const n=s[e],o=i.segments,r=i.points;let a=!1,l=!1;for(let c=0;c<o.length;c++){const h=o[c],d=r[h.start][e],f=r[h.end][e];if(Ct(n,d,f)){a=n===d,l=n===f;break}}return{first:a,last:l,point:s}}class _n{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,s){const{x:n,y:o,radius:r}=this;return e=e||{start:0,end:Z},t.arc(n,o,r,e.end,e.start,!0),!s.bounds}interpolate(t){const{x:e,y:s,radius:n}=this,o=t.angle;return{x:e+Math.cos(o)*n,y:s+Math.sin(o)*n,angle:o}}}function dl(i){const{chart:t,fill:e,line:s}=i;if(N(e))return fl(t,e);if(e==="stack")return al(i);if(e==="shape")return!0;const n=ul(i);return n instanceof _n?n:bn(n,s)}function fl(i,t){const e=i.getDatasetMeta(t);return e&&i.isDatasetVisible(t)?e.dataset:null}function ul(i){return(i.scale||{}).getPointPositionForValue?pl(i):gl(i)}function gl(i){const{scale:t={},fill:e}=i,s=nl(e,t);if(N(s)){const n=t.isHorizontal();return{x:n?s:null,y:n?null:s}}return null}function pl(i){const{scale:t,fill:e}=i,s=t.options,n=t.getLabels().length,o=s.reverse?t.max:t.min,r=ol(e,t,o),a=[];if(s.grid.circular){const l=t.getPointPositionForValue(0,o);return new _n({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(r)})}for(let l=0;l<n;++l)a.push(t.getPointPositionForValue(l,r));return a}function Ve(i,t,e){const s=dl(t),{chart:n,index:o,line:r,scale:a,axis:l}=t,c=r.options,h=c.fill,d=c.backgroundColor,{above:f=d,below:u=d}=h||{},g=n.getDatasetMeta(o),p=en(n,g);s&&r.points.length&&(De(i,e),ml(i,{line:r,target:s,above:f,below:u,area:e,scale:a,axis:l,clip:p}),Ce(i))}function ml(i,t){const{line:e,target:s,above:n,below:o,area:r,scale:a,clip:l}=t,c=e._loop?"angle":t.axis;i.save();let h=o;o!==n&&(c==="x"?(ds(i,s,r.top),je(i,{line:e,target:s,color:n,scale:a,property:c,clip:l}),i.restore(),i.save(),ds(i,s,r.bottom)):c==="y"&&(fs(i,s,r.left),je(i,{line:e,target:s,color:o,scale:a,property:c,clip:l}),i.restore(),i.save(),fs(i,s,r.right),h=n)),je(i,{line:e,target:s,color:h,scale:a,property:c,clip:l}),i.restore()}function ds(i,t,e){const{segments:s,points:n}=t;let o=!0,r=!1;i.beginPath();for(const a of s){const{start:l,end:c}=a,h=n[l],d=n[Le(l,c,n)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(h.x,e),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(d.x,e)}i.lineTo(t.first().x,e),i.closePath(),i.clip()}function fs(i,t,e){const{segments:s,points:n}=t;let o=!0,r=!1;i.beginPath();for(const a of s){const{start:l,end:c}=a,h=n[l],d=n[Le(l,c,n)];o?(i.moveTo(h.x,h.y),o=!1):(i.lineTo(e,h.y),i.lineTo(h.x,h.y)),r=!!t.pathSegment(i,a,{move:r}),r?i.closePath():i.lineTo(e,d.y)}i.lineTo(e,t.first().y),i.closePath(),i.clip()}function je(i,t){const{line:e,target:s,property:n,color:o,scale:r,clip:a}=t,l=Ja(e,s,n);for(const{source:c,target:h,start:d,end:f}of l){const{style:{backgroundColor:u=o}={}}=c,g=s!==!0;i.save(),i.fillStyle=u,bl(i,r,a,g&&Qe(n,d,f)),i.beginPath();const p=!!e.pathSegment(i,c);let m;if(g){p?i.closePath():us(i,s,f,n);const b=!!s.pathSegment(i,h,{move:p,reverse:!0});m=p&&b,m||us(i,s,d,n)}i.closePath(),i.fill(m?"evenodd":"nonzero"),i.restore()}}function bl(i,t,e,s){const n=t.chart.chartArea,{property:o,start:r,end:a}=s||{};if(o==="x"||o==="y"){let l,c,h,d;o==="x"?(l=r,c=n.top,h=a,d=n.bottom):(l=n.left,c=r,h=n.right,d=a),i.beginPath(),e&&(l=Math.max(l,e.left),h=Math.min(h,e.right),c=Math.max(c,e.top),d=Math.min(d,e.bottom)),i.rect(l,c,h-l,d-c),i.clip()}}function us(i,t,e,s){const n=t.interpolate(e,s);n&&i.lineTo(n.x,n.y)}var Kl={id:"filler",afterDatasetsUpdate(i,t,e){const s=(i.data.datasets||[]).length,n=[];let o,r,a,l;for(r=0;r<s;++r)o=i.getDatasetMeta(r),a=o.dataset,l=null,a&&a.options&&a instanceof ui&&(l={visible:i.isDatasetVisible(r),index:r,fill:il(a,r,s),chart:i,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,n.push(l);for(r=0;r<s;++r)l=n[r],!(!l||l.fill===!1)&&(l.fill=el(n,r,e.propagate))},beforeDraw(i,t,e){const s=e.drawTime==="beforeDraw",n=i.getSortedVisibleDatasetMetas(),o=i.chartArea;for(let r=n.length-1;r>=0;--r){const a=n[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),s&&a.fill&&Ve(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const o=s[n].$filler;hs(o)&&Ve(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!hs(s)||e.drawTime!=="beforeDatasetDraw"||Ve(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const gs=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},_l=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class ps extends St{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=I(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=W(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=gs(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,u=-h;return this.legendItems.forEach((g,p)=>{const m=s+e/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(p>0?0:1)]=0,u+=h,f++),l[p]={left:0,top:u,row:f,width:m,height:n},c[c.length-1]+=m+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,f=0,u=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:x,itemHeight:v}=xl(s,e,o,m,n);b>0&&u+v+2*a>h&&(d+=f+a,c.push({width:f,height:u}),g+=f+a,p++,f=u=0),l[b]={left:g,top:u,col:p,width:x,height:v},f=Math.max(f,x),u+=v+a}),d+=f,c.push({width:f,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=Ot(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=H(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=H(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=H(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=H(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;De(t,this),this._draw(),Ce(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=E.color,l=Ot(t.rtl,this.left,this.width),c=W(r.font),{padding:h}=r,d=c.size,f=d/2;let u;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:g,boxHeight:p,itemHeight:m}=gs(r,d),b=function(S,k,y){if(isNaN(g)||g<=0||isNaN(p)||p<0)return;n.save();const M=D(y.lineWidth,1);if(n.fillStyle=D(y.fillStyle,a),n.lineCap=D(y.lineCap,"butt"),n.lineDashOffset=D(y.lineDashOffset,0),n.lineJoin=D(y.lineJoin,"miter"),n.lineWidth=M,n.strokeStyle=D(y.strokeStyle,a),n.setLineDash(D(y.lineDash,[])),r.usePointStyle){const O={radius:p*Math.SQRT2/2,pointStyle:y.pointStyle,rotation:y.rotation,borderWidth:M},P=l.xPlus(S,g/2),T=k+f;js(n,O,P,T,r.pointStyleWidth&&g)}else{const O=k+Math.max((d-p)/2,0),P=l.leftForLtr(S,g),T=Kt(y.borderRadius);n.beginPath(),Object.values(T).some(V=>V!==0)?Ke(n,{x:P,y:O,w:g,h:p,radius:T}):n.rect(P,O,g,p),n.fill(),M!==0&&n.stroke()}n.restore()},x=function(S,k,y){Jt(n,y.text,S,k+m/2,c,{strikethrough:y.hidden,textAlign:l.textAlign(y.textAlign)})},v=this.isHorizontal(),w=this._computeTitleHeight();v?u={x:H(o,this.left+h,this.right-s[0]),y:this.top+h+w,line:0}:u={x:this.left+h,y:H(o,this.top+w+h,this.bottom-e[0].height),line:0},Gs(this.ctx,t.textDirection);const _=m+h;this.legendItems.forEach((S,k)=>{n.strokeStyle=S.fontColor,n.fillStyle=S.fontColor;const y=n.measureText(S.text).width,M=l.textAlign(S.textAlign||(S.textAlign=r.textAlign)),O=g+f+y;let P=u.x,T=u.y;l.setWidth(this.width),v?k>0&&P+O+h>this.right&&(T=u.y+=_,u.line++,P=u.x=H(o,this.left+h,this.right-s[u.line])):k>0&&T+_>this.bottom&&(P=u.x=P+e[u.line].width+h,u.line++,T=u.y=H(o,this.top+w+h,this.bottom-e[u.line].height));const V=l.x(P);if(b(V,T,S),P=mo(M,P+g+f,v?P+O:this.right,t.rtl),x(l.x(P),T,S),v)u.x+=O+h;else if(typeof S.text!="string"){const Q=c.lineHeight;u.y+=xn(S,Q)+h}else u.y+=_}),Zs(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=W(e.font),n=q(e.padding);if(!e.display)return;const o=Ot(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,d=H(t.align,d,this.right-f);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+H(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const u=H(a,d,d+f);r.textAlign=o.textAlign(ni(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,Jt(r,e.text,u,h,s)}_computeTitleHeight(){const t=this.options.title,e=W(t.font),s=q(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(Ct(t,this.left,this.right)&&Ct(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;s<o.length;++s)if(n=o[s],Ct(t,n.left,n.left+n.width)&&Ct(e,n.top,n.top+n.height))return this.legendItems[s]}return null}handleEvent(t){const e=this.options;if(!wl(t.type,e))return;const s=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=_l(n,s);n&&!o&&I(e.onLeave,[t,n,this],this),this._hoveredItem=s,s&&!o&&I(e.onHover,[t,s,this],this)}else s&&I(e.onClick,[t,s,this],this)}}function xl(i,t,e,s,n){const o=yl(s,i,t,e),r=vl(n,s,t.lineHeight);return{itemWidth:o,itemHeight:r}}function yl(i,t,e,s){let n=i.text;return n&&typeof n!="string"&&(n=n.reduce((o,r)=>o.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function vl(i,t,e){let s=i;return typeof t.text!="string"&&(s=xn(t,e)),s}function xn(i,t){const e=i.text?i.text.length:0;return t*e}function wl(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var ql={id:"legend",_element:ps,start(i,t,e){const s=i.legend=new ps({ctx:i.ctx,options:e,chart:i});K.configure(i,s,e),K.addBox(i,s)},stop(i){K.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;K.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=q(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class yn extends St{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=R(s.text)?s.text.length:1;this._padding=q(s.padding);const o=n*W(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=H(a,s,o),d=e+t,c=o-s):(r.position==="left"?(h=s+t,d=H(a,n,e),l=z*-.5):(h=o-t,d=H(a,e,n),l=z*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=W(e.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Jt(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:ni(e.align),textBaseline:"middle",translation:[r,a]})}}function kl(i,t){const e=new yn({ctx:i.ctx,options:t,chart:i});K.configure(i,e,t),K.addBox(i,e),i.titleBlock=e}var Gl={id:"title",_element:yn,start(i,t,e){kl(i,e)},stop(i){const t=i.titleBlock;K.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;K.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const jt={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;t<e;++t){const a=i[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();s.add(l.x),n+=l.y,++o}}return o===0||s.size===0?!1:{x:[...s].reduce((a,l)=>a+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o<r;++o){const l=i[o].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),h=Ye(t,c);h<n&&(n=h,a=l)}}if(a){const l=a.tooltipPosition();e=l.x,s=l.y}return{x:e,y:s}}};function tt(i,t){return t&&(R(t)?Array.prototype.push.apply(i,t):i.push(t)),i}function rt(i){return(typeof i=="string"||i instanceof String)&&i.indexOf(`
2
+ `)>-1?i.split(`
3
+ `):i}function Sl(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function ms(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=W(t.bodyFont),c=W(t.titleFont),h=W(t.footerFont),d=o.length,f=n.length,u=s.length,g=q(t.padding);let p=g.height,m=0,b=s.reduce((w,_)=>w+_.before.length+_.lines.length+_.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=u*w+(b-u)*l.lineHeight+(b-1)*t.bodySpacing}f&&(p+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let x=0;const v=function(w){m=Math.max(m,e.measureText(w).width+x)};return e.save(),e.font=c.string,L(i.title,v),e.font=l.string,L(i.beforeBody.concat(i.afterBody),v),x=t.displayColors?r+2+t.boxPadding:0,L(s,w=>{L(w.before,v),L(w.lines,v),L(w.after,v)}),x=0,e.font=h.string,L(i.footer,v),e.restore(),m+=g.width,{width:m,height:p}}function Ml(i,t){const{y:e,height:s}=t;return e<s/2?"top":e>i.height-s/2?"bottom":"center"}function Pl(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function Dl(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),Pl(c,i,t,e)&&(c="center"),c}function bs(i,t,e){const s=e.yAlign||t.yAlign||Ml(i,e);return{xAlign:e.xAlign||t.xAlign||Dl(i,t,e,s),yAlign:s}}function Cl(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function Ol(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function _s(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:u}=Kt(r);let g=Cl(t,a);const p=Ol(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,f)+n:a==="right"&&(g+=Math.max(d,u)+n),{x:X(g,0,s.width-t.width),y:X(p,0,s.height-t.height)}}function me(i,t,e){const s=q(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function xs(i){return tt([],rt(i))}function Tl(i,t,e){return kt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function ys(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const vn={beforeTitle:nt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex<s)return e[t.dataIndex]}return""},afterTitle:nt,beforeBody:nt,beforeLabel:nt,label(i){if(this&&this.options&&this.options.mode==="dataset")return i.label+": "+i.formattedValue||i.formattedValue;let t=i.dataset.label||"";t&&(t+=": ");const e=i.formattedValue;return A(e)||(t+=e),t},labelColor(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{borderColor:e.borderColor,backgroundColor:e.backgroundColor,borderWidth:e.borderWidth,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(i){const e=i.chart.getDatasetMeta(i.datasetIndex).controller.getStyle(i.dataIndex);return{pointStyle:e.pointStyle,rotation:e.rotation}},afterLabel:nt,afterBody:nt,beforeFooter:nt,footer:nt,afterFooter:nt};function j(i,t,e,s){const n=i[t].call(e,s);return typeof n>"u"?vn[t].call(e,s):n}class vs extends St{static positioners=jt;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new sn(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=Tl(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=j(s,"beforeTitle",this,t),o=j(s,"title",this,t),r=j(s,"afterTitle",this,t);let a=[];return a=tt(a,rt(n)),a=tt(a,rt(o)),a=tt(a,rt(r)),a}getBeforeBody(t,e){return xs(j(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return L(t,o=>{const r={before:[],lines:[],after:[]},a=ys(s,o);tt(r.before,rt(j(a,"beforeLabel",this,o))),tt(r.lines,j(a,"label",this,o)),tt(r.after,rt(j(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return xs(j(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=j(s,"beforeFooter",this,t),o=j(s,"footer",this,t),r=j(s,"afterFooter",this,t);let a=[];return a=tt(a,rt(n)),a=tt(a,rt(o)),a=tt(a,rt(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;l<c;++l)a.push(Sl(this.chart,e[l]));return t.filter&&(a=a.filter((h,d,f)=>t.filter(h,d,f,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),L(a,h=>{const d=ys(t.callbacks,h);n.push(j(d,"labelColor",this,h)),o.push(j(d,"labelPointStyle",this,h)),r.push(j(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=jt[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=ms(this,s),c=Object.assign({},a,l),h=bs(this.chart,s,c),d=_s(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Kt(a),{x:f,y:u}=t,{width:g,height:p}=e;let m,b,x,v,w,_;return o==="center"?(w=u+p/2,n==="left"?(m=f,b=m-r,v=w+r,_=w-r):(m=f+g,b=m+r,v=w-r,_=w+r),x=m):(n==="left"?b=f+Math.max(l,h)+r:n==="right"?b=f+g-Math.max(c,d)-r:b=this.caretX,o==="top"?(v=u,w=v-r,m=b-r,x=b+r):(v=u+p,w=v+r,m=b+r,x=b-r),_=v),{x1:m,x2:b,x3:x,y1:v,y2:w,y3:_}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=Ot(s.rtl,this.x,this.width);for(t.x=me(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=W(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;l<o;++l)e.fillText(n[l],c.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+a,l+1===o&&(t.y+=s.titleMarginBottom-a)}}_drawColorBox(t,e,s,n,o){const r=this.labelColors[s],a=this.labelPointStyles[s],{boxHeight:l,boxWidth:c}=o,h=W(o.bodyFont),d=me(this,"left",o),f=n.x(d),u=l<h.lineHeight?(h.lineHeight-l)/2:0,g=e.y+u;if(o.usePointStyle){const p={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},m=n.leftForLtr(f,c)+c/2,b=g+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Xe(t,p,m,b),t.strokeStyle=r.borderColor,t.fillStyle=r.backgroundColor,Xe(t,p,m,b)}else{t.lineWidth=C(r.borderWidth)?Math.max(...Object.values(r.borderWidth)):r.borderWidth||1,t.strokeStyle=r.borderColor,t.setLineDash(r.borderDash||[]),t.lineDashOffset=r.borderDashOffset||0;const p=n.leftForLtr(f,c),m=n.leftForLtr(n.xPlus(f,1),c-2),b=Kt(r.borderRadius);Object.values(b).some(x=>x!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Ke(t,{x:p,y:g,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Ke(t,{x:m,y:g+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,g,c,l),t.strokeRect(p,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=W(s.bodyFont);let f=d.lineHeight,u=0;const g=Ot(s.rtl,this.x,this.width),p=function(y){e.fillText(y,g.x(t.x+u),t.y+f/2),t.y+=f+o},m=g.textAlign(r);let b,x,v,w,_,S,k;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=me(this,m,s),e.fillStyle=s.bodyColor,L(this.beforeBody,p),u=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,w=0,S=n.length;w<S;++w){for(b=n[w],x=this.labelTextColors[w],e.fillStyle=x,L(b.before,p),v=b.lines,a&&v.length&&(this._drawColorBox(e,t,w,g,s),f=Math.max(d.lineHeight,l)),_=0,k=v.length;_<k;++_)p(v[_]),f=d.lineHeight;L(b.after,p)}u=0,f=d.lineHeight,L(this.afterBody,p),t.y-=o}drawFooter(t,e,s){const n=this.footer,o=n.length;let r,a;if(o){const l=Ot(s.rtl,this.x,this.width);for(t.x=me(this,s.footerAlign,s),t.y+=s.footerMarginTop,e.textAlign=l.textAlign(s.footerAlign),e.textBaseline="middle",r=W(s.footerFont),e.fillStyle=s.footerColor,e.font=r.string,a=0;a<o;++a)e.fillText(n[a],l.x(t.x),t.y+r.lineHeight/2),t.y+=r.lineHeight+s.footerSpacing}}drawBackground(t,e,s,n){const{xAlign:o,yAlign:r}=this,{x:a,y:l}=t,{width:c,height:h}=s,{topLeft:d,topRight:f,bottomLeft:u,bottomRight:g}=Kt(n.cornerRadius);e.fillStyle=n.backgroundColor,e.strokeStyle=n.borderColor,e.lineWidth=n.borderWidth,e.beginPath(),e.moveTo(a+d,l),r==="top"&&this.drawCaret(t,e,s,n),e.lineTo(a+c-f,l),e.quadraticCurveTo(a+c,l,a+c,l+f),r==="center"&&o==="right"&&this.drawCaret(t,e,s,n),e.lineTo(a+c,l+h-g),e.quadraticCurveTo(a+c,l+h,a+c-g,l+h),r==="bottom"&&this.drawCaret(t,e,s,n),e.lineTo(a+u,l+h),e.quadraticCurveTo(a,l+h,a,l+h-u),r==="center"&&o==="left"&&this.drawCaret(t,e,s,n),e.lineTo(a,l+d),e.quadraticCurveTo(a,l,a+d,l),e.closePath(),e.fill(),n.borderWidth>0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=jt[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=ms(this,t),l=Object.assign({},r,this._size),c=bs(e,t,l),h=_s(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=q(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),Gs(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Zs(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!ye(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!ye(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=jt[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}var Zl={id:"tooltip",_element:vs,positioners:jt,afterInit(i,t,e){e&&(i.tooltip=new vs({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:vn},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const Ll=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function Al(i,t,e,s){const n=i.indexOf(t);if(n===-1)return Ll(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const Il=(i,t)=>i===null?null:X(Math.round(i),0,t);function ws(i){const t=this.getLabels();return i>=0&&i<t.length?t[i]:i}class Ql extends It{static id="category";static defaults={ticks:{callback:ws}};constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(A(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:Al(s,t,D(e,t),this._addedLabels),Il(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){return ws.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Fl(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:f}=i,u=o||1,g=h-1,{min:p,max:m}=t,b=!A(r),x=!A(a),v=!A(c),w=(m-p)/(d+1);let _=vi((m-p)/g/u)*u,S,k,y,M;if(_<1e-14&&!b&&!x)return[{value:p},{value:m}];M=Math.ceil(m/_)-Math.floor(p/_),M>g&&(_=vi(M*_/g/u)*u),A(l)||(S=Math.pow(10,l),_=Math.ceil(_*S)/S),n==="ticks"?(k=Math.floor(p/_)*_,y=Math.ceil(m/_)*_):(k=p,y=m),b&&x&&o&&no((a-r)/o,_/1e3)?(M=Math.round(Math.min((a-r)/_,h)),_=(a-r)/M,k=r,y=a):v?(k=b?r:k,y=x?a:y,M=c-1,_=(y-k)/M):(M=(y-k)/_,Yt(M,Math.round(M),_/1e3)?M=Math.round(M):M=Math.ceil(M));const O=Math.max(wi(_),wi(k));S=Math.pow(10,A(l)?O:l),k=Math.round(k*S)/S,y=Math.round(y*S)/S;let P=0;for(b&&(f&&k!==r?(e.push({value:r}),k<r&&P++,Yt(Math.round((k+P*_)*S)/S,r,ks(r,w,i))&&P++):k<r&&P++);P<M;++P){const T=Math.round((k+P*_)*S)/S;if(x&&T>a)break;e.push({value:T})}return x&&f&&y!==a?e.length&&Yt(e[e.length-1].value,a,ks(a,w,i))?e[e.length-1].value=a:e.push({value:a}):(!x||y===a)&&e.push({value:y}),e}function ks(i,t,{horizontal:e,minRotation:s}){const n=xt(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class El extends It{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return A(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=s?o:l;if(t){const l=Tt(n),c=Tt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=Fl(n,o);return t.bounds==="ticks"&&oo(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return Ns(t,this.chart.options.locale,this.options.ticks.format)}}class Jl extends El{static id="linear";static defaults={ticks:{callback:Vs.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=N(t)?t:0,this.max=N(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=xt(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const Ae={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}},$=Object.keys(Ae);function Ss(i,t){return i-t}function Ms(i,t){if(A(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),N(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Zt(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function Ps(i,t,e,s){const n=$.length;for(let o=$.indexOf(i);o<n-1;++o){const r=Ae[$[o]],a=r.steps?r.steps:Number.MAX_SAFE_INTEGER;if(r.common&&Math.ceil((e-t)/(a*r.size))<=s)return $[o]}return $[n-1]}function Rl(i,t,e,s,n){for(let o=$.length-1;o>=$.indexOf(e);o--){const r=$[o];if(Ae[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return $[e?$.indexOf(e):0]}function zl(i){for(let t=$.indexOf(i)+1,e=$.length;t<e;++t)if(Ae[$[t]].common)return $[t]}function Ds(i,t,e){if(!e)i[t]=!0;else if(e.length){const{lo:s,hi:n}=si(e,t),o=e[s]>=t?e[s]:e[n];i[o]=!0}}function Bl(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function Cs(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r<o;++r)a=t[r],n[a]=r,s.push({value:a,major:!1});return o===0||!e?s:Bl(i,s,n,e)}class Os extends It{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,e={}){const s=t.time||(t.time={}),n=this._adapter=new Er._date(t.adapters.date);n.init(e),$t(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:Ms(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,s=t.time.unit||"day";let{min:n,max:o,minDefined:r,maxDefined:a}=this.getUserBounds();function l(c){!r&&!isNaN(c.min)&&(n=Math.min(n,c.min)),!a&&!isNaN(c.max)&&(o=Math.max(o,c.max))}(!r||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=N(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=N(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){const t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,r=this.max,a=fo(n,o,r);return this._unit=e.unit||(s.autoSkip?Ps(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):Rl(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=!s.major.enabled||this._unit==="year"?void 0:zl(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),Cs(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=X(e,0,r),s=X(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||Ps(o.minUnit,e,s,this._getLabelCapacity(e)),a=D(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Zt(l)||l===!0,h={};let d=e,f,u;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const g=n.ticks.source==="data"&&this.getDataTimestamps();for(f=d,u=0;f<s;f=+t.add(f,a,r),u++)Ds(h,f,g);return(f===s||n.bounds==="ticks"||u===1)&&Ds(h,f,g),Object.keys(h).sort(Ss).map(p=>+p)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return I(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],f=s[e],u=c&&d&&f&&f.major;return this._adapter.format(t,n||(u?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e<s;++e)n=t[e],n.label=this._tickFormatFunction(n.value,e,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const e=this._offsets,s=this.getDecimalForValue(t);return this.getPixelForDecimal((e.start+s)*e.factor)}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return this.min+s*(this.max-this.min)}_getLabelSize(t){const e=this.options.ticks,s=this.ctx.measureText(t).width,n=xt(this.isHorizontal()?e.maxRotation:e.minRotation),o=Math.cos(n),r=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:s*o+a*r,h:s*r+a*o}}_getLabelCapacity(t){const e=this.options.time,s=e.displayFormats,n=s[e.unit]||s.millisecond,o=this._tickFormatFunction(t,0,Cs(this,[t],this._majorUnit),n),r=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/r.w:this.height/r.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e<s;++e)t=t.concat(n[e].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let e,s;if(t.length)return t;const n=this.getLabels();for(e=0,s=n.length;e<s;++e)t.push(Ms(this,n[e]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return go(t.sort(Ss))}}function be(i,t,e){let s=0,n=i.length-1,o,r,a,l;e?(t>=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=yt(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=yt(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class tc extends Os{static id="timeseries";static defaults=Os.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=be(e,this.min),this._tableRange=be(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r<a;++r)c=t[r],c>=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r<a;++r)h=n[r+1],l=n[r-1],c=n[r],Math.round((h+l)/2)!==c&&o.push({time:c,pos:r/(a-1)});return o}_generate(){const t=this.min,e=this.max;let s=super.getDataTimestamps();return(!s.includes(t)||!s.length)&&s.splice(0,0,t),(!s.includes(e)||s.length===1)&&s.push(e),s.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(be(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return be(this._table,s*this._tableRange+this._minPos,!0)}}const wn="label";function Ts(i,t){typeof i=="function"?i(t):i&&(i.current=t)}function Hl(i,t){const e=i.options;e&&t&&Object.assign(e,t)}function kn(i,t){i.labels=t}function Sn(i,t,e=wn){const s=[];i.datasets=t.map(n=>{const o=i.datasets.find(r=>r[e]===n[e]);return!o||!n.data||s.includes(o)?{...n}:(s.push(o),Object.assign(o,n),o)})}function Wl(i,t=wn){const e={labels:[],datasets:[]};return kn(e,i.labels),Sn(e,i.datasets,t),e}function Nl(i,t){const{height:e=150,width:s=300,redraw:n=!1,datasetIdKey:o,type:r,data:a,options:l,plugins:c=[],fallbackContent:h,updateMode:d,...f}=i,u=et.useRef(null),g=et.useRef(null),p=()=>{u.current&&(g.current=new fi(u.current,{type:r,data:Wl(a,o),options:l&&{...l},plugins:c}),Ts(t,g.current))},m=()=>{Ts(t,null),g.current&&(g.current.destroy(),g.current=null)};return et.useEffect(()=>{!n&&g.current&&l&&Hl(g.current,l)},[n,l]),et.useEffect(()=>{!n&&g.current&&kn(g.current.config.data,a.labels)},[n,a.labels]),et.useEffect(()=>{!n&&g.current&&a.datasets&&Sn(g.current.config.data,a.datasets,o)},[n,a.datasets]),et.useEffect(()=>{g.current&&(n?(m(),setTimeout(p)):g.current.update(d))},[n,l,a.labels,a.datasets,d]),et.useEffect(()=>{g.current&&(m(),setTimeout(p))},[r]),et.useEffect(()=>(p(),()=>m()),[]),Ls.jsx("canvas",{ref:u,role:"img",height:e,width:s,...f,children:h})}const Vl=et.forwardRef(Nl);function jl(i,t){return fi.register(t),et.forwardRef((e,s)=>Ls.jsx(Vl,{...e,ref:s,type:i}))}const ec=jl("line",Fr);export{fi as C,ec as L,Xl as P,Ql as a,Jl as b,ui as c,Zl as d,ql as e,Kl as i,Gl as p};
@@ -0,0 +1 @@
1
+ import{r as l,R}from"./analytics-ui-DMSkNqd6.js";import{a as v}from"./Combination-BpSXUjp9.js";import{a as T,u as M}from"./index-vX97OY1J.js";import{j as E}from"./jsx-runtime-u17CrQMm.js";function N(e){const t=j(e),n=l.forwardRef((r,o)=>{const{children:c,...a}=r,s=l.Children.toArray(c),d=s.find(D);if(d){const f=d.props.children,S=s.map(y=>y===d?l.Children.count(f)>1?l.Children.only(null):l.isValidElement(f)?f.props.children:null:y);return E.jsx(t,{...a,ref:o,children:l.isValidElement(f)?l.cloneElement(f,void 0,S):null})}return E.jsx(t,{...a,ref:o,children:c})});return n.displayName=`${e}.Slot`,n}function j(e){const t=l.forwardRef((n,r)=>{const{children:o,...c}=n;if(l.isValidElement(o)){const a=w(o),s=b(c,o.props);return o.type!==l.Fragment&&(s.ref=r?T(r,a):a),l.cloneElement(o,s)}return l.Children.count(o)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var P=Symbol("radix.slottable");function D(e){return l.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===P}function b(e,t){const n={...t};for(const r in t){const o=e[r],c=t[r];/^on[A-Z]/.test(r)?o&&c?n[r]=(...s)=>{const d=c(...s);return o(...s),d}:o&&(n[r]=o):r==="style"?n[r]={...o,...c}:r==="className"&&(n[r]=[o,c].filter(Boolean).join(" "))}return{...e,...n}}function w(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function F(e){const t=e+"CollectionProvider",[n,r]=v(t),[o,c]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:i,children:x}=m,u=R.useRef(null),p=R.useRef(new Map).current;return E.jsx(o,{scope:i,itemMap:p,collectionRef:u,children:x})};a.displayName=t;const s=e+"CollectionSlot",d=N(s),f=R.forwardRef((m,i)=>{const{scope:x,children:u}=m,p=c(s,x),C=M(i,p.collectionRef);return E.jsx(d,{ref:C,children:u})});f.displayName=s;const S=e+"CollectionItemSlot",y="data-radix-collection-item",O=N(S),g=R.forwardRef((m,i)=>{const{scope:x,children:u,...p}=m,C=R.useRef(null),A=M(i,C),I=c(S,x);return R.useEffect(()=>(I.itemMap.set(C,{ref:C,...p}),()=>{I.itemMap.delete(C)})),E.jsx(O,{[y]:"",ref:A,children:u})});g.displayName=S;function _(m){const i=c(e+"CollectionConsumer",m);return R.useCallback(()=>{const u=i.collectionRef.current;if(!u)return[];const p=Array.from(u.querySelectorAll(`[${y}]`));return Array.from(i.itemMap.values()).sort((I,h)=>p.indexOf(I.ref.current)-p.indexOf(h.ref.current))},[i.collectionRef,i.itemMap])}return[{Provider:a,Slot:f,ItemSlot:g},_,r]}var V=l.createContext(void 0);function H(e){const t=l.useContext(V);return e||t||"ltr"}export{F as c,H as u};
@@ -0,0 +1 @@
1
+ import{r as i}from"./analytics-ui-DMSkNqd6.js";import{u as y}from"./index-vX97OY1J.js";import{k as A}from"./Combination-BpSXUjp9.js";function E(n,e){return i.useReducer((t,r)=>e[t][r]??t,n)}var T=n=>{const{present:e,children:t}=n,r=P(e),a=typeof t=="function"?t({present:r.isPresent}):i.Children.only(t),c=y(r.ref,R(a));return typeof t=="function"||r.isPresent?i.cloneElement(a,{ref:c}):null};T.displayName="Presence";function P(n){const[e,t]=i.useState(),r=i.useRef(null),a=i.useRef(n),c=i.useRef("none"),p=n?"mounted":"unmounted",[N,s]=E(p,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return i.useEffect(()=>{const o=l(r.current);c.current=N==="mounted"?o:"none"},[N]),A(()=>{const o=r.current,m=a.current;if(m!==n){const f=c.current,u=l(o);n?s("MOUNT"):u==="none"||o?.display==="none"?s("UNMOUNT"):s(m&&f!==u?"ANIMATION_OUT":"UNMOUNT"),a.current=n}},[n,s]),A(()=>{if(e){let o;const m=e.ownerDocument.defaultView??window,d=u=>{const g=l(r.current).includes(CSS.escape(u.animationName));if(u.target===e&&g&&(s("ANIMATION_END"),!a.current)){const O=e.style.animationFillMode;e.style.animationFillMode="forwards",o=m.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=O)})}},f=u=>{u.target===e&&(c.current=l(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{m.clearTimeout(o),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else s("ANIMATION_END")},[e,s]),{isPresent:["mounted","unmountSuspended"].includes(N),ref:i.useCallback(o=>{r.current=o?getComputedStyle(o):null,t(o)},[])}}function l(n){return n?.animationName||"none"}function R(n){let e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning;return t?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get,t=e&&"isReactWarning"in e&&e.isReactWarning,t?n.props.ref:n.props.ref||n.ref)}export{T as P};
@@ -0,0 +1 @@
1
+ import{r as Te}from"./analytics-ui-DMSkNqd6.js";function ke(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=ke(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}function Oe(){for(var e,t,r=0,o="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=ke(e))&&(o&&(o+=" "),o+=t);return o}const je=(e,t)=>{const r=new Array(e.length+t.length);for(let o=0;o<e.length;o++)r[o]=e[o];for(let o=0;o<t.length;o++)r[e.length+o]=t[o];return r},Ee=(e,t)=>({classGroupId:e,validator:t}),we=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),K="-",ue=[],Le="arbitrary..",Ne=e=>{const t=Fe(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Ve(i);const u=i.split(K),d=u[0]===""&&u.length>1?1:0;return ye(u,d,t)},getConflictingClassGroupIds:(i,u)=>{if(u){const d=o[i],f=r[i];return d?f?je(f,d):d:f||ue}return r[i]||ue}}},ye=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const a=e[t],l=r.nextPart.get(a);if(l){const f=ye(e,t+1,l);if(f)return f}const i=r.validators;if(i===null)return;const u=t===0?e.join(K):e.slice(t).join(K),d=i.length;for(let f=0;f<d;f++){const h=i[f];if(h.validator(u))return h.classGroupId}},Ve=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),o=t.slice(0,r);return o?Le+o:void 0})(),Fe=e=>{const{theme:t,classGroups:r}=e;return _e(r,t)},_e=(e,t)=>{const r=we();for(const o in e){const a=e[o];se(a,r,o,t)}return r},se=(e,t,r,o)=>{const a=e.length;for(let l=0;l<a;l++){const i=e[l];We(i,t,r,o)}},We=(e,t,r,o)=>{if(typeof e=="string"){Be(e,t,r);return}if(typeof e=="function"){$e(e,t,r,o);return}Ue(e,t,r,o)},Be=(e,t,r)=>{const o=e===""?t:ve(t,e);o.classGroupId=r},$e=(e,t,r,o)=>{if(De(e)){se(e(o),t,r,o);return}t.validators===null&&(t.validators=[]),t.validators.push(Ee(r,e))},Ue=(e,t,r,o)=>{const a=Object.entries(e),l=a.length;for(let i=0;i<l;i++){const[u,d]=a[i];se(d,ve(t,u),r,o)}},ve=(e,t)=>{let r=e;const o=t.split(K),a=o.length;for(let l=0;l<a;l++){const i=o[l];let u=r.nextPart.get(i);u||(u=we(),r.nextPart.set(i,u)),r=u}return r},De=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Ye=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),o=Object.create(null);const a=(l,i)=>{r[l]=i,t++,t>e&&(t=0,o=r,r=Object.create(null))};return{get(l){let i=r[l];if(i!==void 0)return i;if((i=o[l])!==void 0)return a(l,i),i},set(l,i){l in r?r[l]=i:a(l,i)}}},te="!",fe=":",qe=[],be=(e,t,r,o,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:o,isExternal:a}),Xe=e=>{const{prefix:t,experimentalParseClassName:r}=e;let o=a=>{const l=[];let i=0,u=0,d=0,f;const h=a.length;for(let v=0;v<h;v++){const k=a[v];if(i===0&&u===0){if(k===fe){l.push(a.slice(d,v)),d=v+1;continue}if(k==="/"){f=v;continue}}k==="["?i++:k==="]"?i--:k==="("?u++:k===")"&&u--}const y=l.length===0?a:a.slice(d);let z=y,I=!1;y.endsWith(te)?(z=y.slice(0,-1),I=!0):y.startsWith(te)&&(z=y.slice(1),I=!0);const M=f&&f>d?f-d:void 0;return be(l,I,z,M)};if(t){const a=t+fe,l=o;o=i=>i.startsWith(a)?l(i.slice(a.length)):be(qe,!1,i,void 0,!0)}if(r){const a=o;o=l=>r({className:l,parseClassName:a})}return o},Je=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,o)=>{t.set(r,1e6+o)}),r=>{const o=[];let a=[];for(let l=0;l<r.length;l++){const i=r[l],u=i[0]==="[",d=t.has(i);u||d?(a.length>0&&(a.sort(),o.push(...a),a=[]),o.push(i)):a.push(i)}return a.length>0&&(a.sort(),o.push(...a)),o}},He=e=>({cache:Ye(e.cacheSize),parseClassName:Xe(e),sortModifiers:Je(e),...Ne(e)}),Ke=/\s+/,Qe=(e,t)=>{const{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:a,sortModifiers:l}=t,i=[],u=e.trim().split(Ke);let d="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{isExternal:y,modifiers:z,hasImportantModifier:I,baseClassName:M,maybePostfixModifierPosition:v}=r(h);if(y){d=h+(d.length>0?" "+d:d);continue}let k=!!v,P=o(k?M.substring(0,v):M);if(!P){if(!k){d=h+(d.length>0?" "+d:d);continue}if(P=o(M),!P){d=h+(d.length>0?" "+d:d);continue}k=!1}const $=z.length===0?"":z.length===1?z[0]:l(z).join(":"),_=I?$+te:$,j=_+P;if(i.indexOf(j)>-1)continue;i.push(j);const E=a(P,k);for(let G=0;G<E.length;++G){const W=E[G];i.push(_+W)}d=h+(d.length>0?" "+d:d)}return d},Ze=(...e)=>{let t=0,r,o,a="";for(;t<e.length;)(r=e[t++])&&(o=ze(r))&&(a&&(a+=" "),a+=o);return a},ze=e=>{if(typeof e=="string")return e;let t,r="";for(let o=0;o<e.length;o++)e[o]&&(t=ze(e[o]))&&(r&&(r+=" "),r+=t);return r},eo=(e,...t)=>{let r,o,a,l;const i=d=>{const f=t.reduce((h,y)=>y(h),e());return r=He(f),o=r.cache.get,a=r.cache.set,l=u,u(d)},u=d=>{const f=o(d);if(f)return f;const h=Qe(d,r);return a(d,h),h};return l=i,(...d)=>l(Ze(...d))},oo=[],b=e=>{const t=r=>r[e]||oo;return t.isThemeGetter=!0,t},Ce=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ae=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ro=/^\d+\/\d+$/,to=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,so=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,no=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ao=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,io=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,N=e=>ro.test(e),p=e=>!!e&&!Number.isNaN(Number(e)),R=e=>!!e&&Number.isInteger(Number(e)),oe=e=>e.endsWith("%")&&p(e.slice(0,-1)),S=e=>to.test(e),lo=()=>!0,co=e=>so.test(e)&&!no.test(e),Se=()=>!1,mo=e=>ao.test(e),po=e=>io.test(e),uo=e=>!s(e)&&!n(e),fo=e=>V(e,Me,Se),s=e=>Ce.test(e),O=e=>V(e,Pe,co),re=e=>V(e,ko,p),ge=e=>V(e,Re,Se),bo=e=>V(e,Ie,po),J=e=>V(e,Ge,mo),n=e=>Ae.test(e),B=e=>F(e,Pe),go=e=>F(e,wo),he=e=>F(e,Re),ho=e=>F(e,Me),xo=e=>F(e,Ie),H=e=>F(e,Ge,!0),V=(e,t,r)=>{const o=Ce.exec(e);return o?o[1]?t(o[1]):r(o[2]):!1},F=(e,t,r=!1)=>{const o=Ae.exec(e);return o?o[1]?t(o[1]):r:!1},Re=e=>e==="position"||e==="percentage",Ie=e=>e==="image"||e==="url",Me=e=>e==="length"||e==="size"||e==="bg-size",Pe=e=>e==="length",ko=e=>e==="number",wo=e=>e==="family-name",Ge=e=>e==="shadow",yo=()=>{const e=b("color"),t=b("font"),r=b("text"),o=b("font-weight"),a=b("tracking"),l=b("leading"),i=b("breakpoint"),u=b("container"),d=b("spacing"),f=b("radius"),h=b("shadow"),y=b("inset-shadow"),z=b("text-shadow"),I=b("drop-shadow"),M=b("blur"),v=b("perspective"),k=b("aspect"),P=b("ease"),$=b("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],j=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...j(),n,s],G=()=>["auto","hidden","clip","visible","scroll"],W=()=>["auto","contain","none"],m=()=>[n,s,d],C=()=>[N,"full","auto",...m()],ne=()=>[R,"none","subgrid",n,s],ae=()=>["auto",{span:["full",R,n,s]},R,n,s],U=()=>[R,"auto",n,s],ie=()=>["auto","min","max","fr",n,s],Q=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],L=()=>["start","end","center","stretch","center-safe","end-safe"],A=()=>["auto",...m()],T=()=>[N,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...m()],c=()=>[e,n,s],le=()=>[...j(),he,ge,{position:[n,s]}],ce=()=>["no-repeat",{repeat:["","x","y","space","round"]}],de=()=>["auto","cover","contain",ho,fo,{size:[n,s]}],Z=()=>[oe,B,O],x=()=>["","none","full",f,n,s],w=()=>["",p,B,O],D=()=>["solid","dashed","dotted","double"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],g=()=>[p,oe,he,ge],pe=()=>["","none",M,n,s],Y=()=>["none",p,n,s],q=()=>["none",p,n,s],ee=()=>[p,n,s],X=()=>[N,"full",...m()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[S],breakpoint:[S],color:[lo],container:[S],"drop-shadow":[S],ease:["in","out","in-out"],font:[uo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[S],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[S],shadow:[S],spacing:["px",p],text:[S],"text-shadow":[S],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",N,s,n,k]}],container:["container"],columns:[{columns:[p,s,n,u]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:G()}],"overflow-x":[{"overflow-x":G()}],"overflow-y":[{"overflow-y":G()}],overscroll:[{overscroll:W()}],"overscroll-x":[{"overscroll-x":W()}],"overscroll-y":[{"overscroll-y":W()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:C()}],"inset-x":[{"inset-x":C()}],"inset-y":[{"inset-y":C()}],start:[{start:C()}],end:[{end:C()}],top:[{top:C()}],right:[{right:C()}],bottom:[{bottom:C()}],left:[{left:C()}],visibility:["visible","invisible","collapse"],z:[{z:[R,"auto",n,s]}],basis:[{basis:[N,"full","auto",u,...m()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[p,N,"auto","initial","none",s]}],grow:[{grow:["",p,n,s]}],shrink:[{shrink:["",p,n,s]}],order:[{order:[R,"first","last","none",n,s]}],"grid-cols":[{"grid-cols":ne()}],"col-start-end":[{col:ae()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":ne()}],"row-start-end":[{row:ae()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:m()}],"gap-x":[{"gap-x":m()}],"gap-y":[{"gap-y":m()}],"justify-content":[{justify:[...Q(),"normal"]}],"justify-items":[{"justify-items":[...L(),"normal"]}],"justify-self":[{"justify-self":["auto",...L()]}],"align-content":[{content:["normal",...Q()]}],"align-items":[{items:[...L(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...L(),{baseline:["","last"]}]}],"place-content":[{"place-content":Q()}],"place-items":[{"place-items":[...L(),"baseline"]}],"place-self":[{"place-self":["auto",...L()]}],p:[{p:m()}],px:[{px:m()}],py:[{py:m()}],ps:[{ps:m()}],pe:[{pe:m()}],pt:[{pt:m()}],pr:[{pr:m()}],pb:[{pb:m()}],pl:[{pl:m()}],m:[{m:A()}],mx:[{mx:A()}],my:[{my:A()}],ms:[{ms:A()}],me:[{me:A()}],mt:[{mt:A()}],mr:[{mr:A()}],mb:[{mb:A()}],ml:[{ml:A()}],"space-x":[{"space-x":m()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":m()}],"space-y-reverse":["space-y-reverse"],size:[{size:T()}],w:[{w:[u,"screen",...T()]}],"min-w":[{"min-w":[u,"screen","none",...T()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[i]},...T()]}],h:[{h:["screen","lh",...T()]}],"min-h":[{"min-h":["screen","lh","none",...T()]}],"max-h":[{"max-h":["screen","lh",...T()]}],"font-size":[{text:["base",r,B,O]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,n,re]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",oe,s]}],"font-family":[{font:[go,s,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,n,s]}],"line-clamp":[{"line-clamp":[p,"none",n,re]}],leading:[{leading:[l,...m()]}],"list-image":[{"list-image":["none",n,s]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",n,s]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:c()}],"text-color":[{text:c()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...D(),"wavy"]}],"text-decoration-thickness":[{decoration:[p,"from-font","auto",n,O]}],"text-decoration-color":[{decoration:c()}],"underline-offset":[{"underline-offset":[p,"auto",n,s]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:m()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",n,s]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",n,s]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:le()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:de()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},R,n,s],radial:["",n,s],conic:[R,n,s]},xo,bo]}],"bg-color":[{bg:c()}],"gradient-from-pos":[{from:Z()}],"gradient-via-pos":[{via:Z()}],"gradient-to-pos":[{to:Z()}],"gradient-from":[{from:c()}],"gradient-via":[{via:c()}],"gradient-to":[{to:c()}],rounded:[{rounded:x()}],"rounded-s":[{"rounded-s":x()}],"rounded-e":[{"rounded-e":x()}],"rounded-t":[{"rounded-t":x()}],"rounded-r":[{"rounded-r":x()}],"rounded-b":[{"rounded-b":x()}],"rounded-l":[{"rounded-l":x()}],"rounded-ss":[{"rounded-ss":x()}],"rounded-se":[{"rounded-se":x()}],"rounded-ee":[{"rounded-ee":x()}],"rounded-es":[{"rounded-es":x()}],"rounded-tl":[{"rounded-tl":x()}],"rounded-tr":[{"rounded-tr":x()}],"rounded-br":[{"rounded-br":x()}],"rounded-bl":[{"rounded-bl":x()}],"border-w":[{border:w()}],"border-w-x":[{"border-x":w()}],"border-w-y":[{"border-y":w()}],"border-w-s":[{"border-s":w()}],"border-w-e":[{"border-e":w()}],"border-w-t":[{"border-t":w()}],"border-w-r":[{"border-r":w()}],"border-w-b":[{"border-b":w()}],"border-w-l":[{"border-l":w()}],"divide-x":[{"divide-x":w()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":w()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...D(),"hidden","none"]}],"divide-style":[{divide:[...D(),"hidden","none"]}],"border-color":[{border:c()}],"border-color-x":[{"border-x":c()}],"border-color-y":[{"border-y":c()}],"border-color-s":[{"border-s":c()}],"border-color-e":[{"border-e":c()}],"border-color-t":[{"border-t":c()}],"border-color-r":[{"border-r":c()}],"border-color-b":[{"border-b":c()}],"border-color-l":[{"border-l":c()}],"divide-color":[{divide:c()}],"outline-style":[{outline:[...D(),"none","hidden"]}],"outline-offset":[{"outline-offset":[p,n,s]}],"outline-w":[{outline:["",p,B,O]}],"outline-color":[{outline:c()}],shadow:[{shadow:["","none",h,H,J]}],"shadow-color":[{shadow:c()}],"inset-shadow":[{"inset-shadow":["none",y,H,J]}],"inset-shadow-color":[{"inset-shadow":c()}],"ring-w":[{ring:w()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:c()}],"ring-offset-w":[{"ring-offset":[p,O]}],"ring-offset-color":[{"ring-offset":c()}],"inset-ring-w":[{"inset-ring":w()}],"inset-ring-color":[{"inset-ring":c()}],"text-shadow":[{"text-shadow":["none",z,H,J]}],"text-shadow-color":[{"text-shadow":c()}],opacity:[{opacity:[p,n,s]}],"mix-blend":[{"mix-blend":[...me(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":me()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[p]}],"mask-image-linear-from-pos":[{"mask-linear-from":g()}],"mask-image-linear-to-pos":[{"mask-linear-to":g()}],"mask-image-linear-from-color":[{"mask-linear-from":c()}],"mask-image-linear-to-color":[{"mask-linear-to":c()}],"mask-image-t-from-pos":[{"mask-t-from":g()}],"mask-image-t-to-pos":[{"mask-t-to":g()}],"mask-image-t-from-color":[{"mask-t-from":c()}],"mask-image-t-to-color":[{"mask-t-to":c()}],"mask-image-r-from-pos":[{"mask-r-from":g()}],"mask-image-r-to-pos":[{"mask-r-to":g()}],"mask-image-r-from-color":[{"mask-r-from":c()}],"mask-image-r-to-color":[{"mask-r-to":c()}],"mask-image-b-from-pos":[{"mask-b-from":g()}],"mask-image-b-to-pos":[{"mask-b-to":g()}],"mask-image-b-from-color":[{"mask-b-from":c()}],"mask-image-b-to-color":[{"mask-b-to":c()}],"mask-image-l-from-pos":[{"mask-l-from":g()}],"mask-image-l-to-pos":[{"mask-l-to":g()}],"mask-image-l-from-color":[{"mask-l-from":c()}],"mask-image-l-to-color":[{"mask-l-to":c()}],"mask-image-x-from-pos":[{"mask-x-from":g()}],"mask-image-x-to-pos":[{"mask-x-to":g()}],"mask-image-x-from-color":[{"mask-x-from":c()}],"mask-image-x-to-color":[{"mask-x-to":c()}],"mask-image-y-from-pos":[{"mask-y-from":g()}],"mask-image-y-to-pos":[{"mask-y-to":g()}],"mask-image-y-from-color":[{"mask-y-from":c()}],"mask-image-y-to-color":[{"mask-y-to":c()}],"mask-image-radial":[{"mask-radial":[n,s]}],"mask-image-radial-from-pos":[{"mask-radial-from":g()}],"mask-image-radial-to-pos":[{"mask-radial-to":g()}],"mask-image-radial-from-color":[{"mask-radial-from":c()}],"mask-image-radial-to-color":[{"mask-radial-to":c()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":j()}],"mask-image-conic-pos":[{"mask-conic":[p]}],"mask-image-conic-from-pos":[{"mask-conic-from":g()}],"mask-image-conic-to-pos":[{"mask-conic-to":g()}],"mask-image-conic-from-color":[{"mask-conic-from":c()}],"mask-image-conic-to-color":[{"mask-conic-to":c()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:le()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:de()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",n,s]}],filter:[{filter:["","none",n,s]}],blur:[{blur:pe()}],brightness:[{brightness:[p,n,s]}],contrast:[{contrast:[p,n,s]}],"drop-shadow":[{"drop-shadow":["","none",I,H,J]}],"drop-shadow-color":[{"drop-shadow":c()}],grayscale:[{grayscale:["",p,n,s]}],"hue-rotate":[{"hue-rotate":[p,n,s]}],invert:[{invert:["",p,n,s]}],saturate:[{saturate:[p,n,s]}],sepia:[{sepia:["",p,n,s]}],"backdrop-filter":[{"backdrop-filter":["","none",n,s]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[p,n,s]}],"backdrop-contrast":[{"backdrop-contrast":[p,n,s]}],"backdrop-grayscale":[{"backdrop-grayscale":["",p,n,s]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p,n,s]}],"backdrop-invert":[{"backdrop-invert":["",p,n,s]}],"backdrop-opacity":[{"backdrop-opacity":[p,n,s]}],"backdrop-saturate":[{"backdrop-saturate":[p,n,s]}],"backdrop-sepia":[{"backdrop-sepia":["",p,n,s]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":m()}],"border-spacing-x":[{"border-spacing-x":m()}],"border-spacing-y":[{"border-spacing-y":m()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",n,s]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[p,"initial",n,s]}],ease:[{ease:["linear","initial",P,n,s]}],delay:[{delay:[p,n,s]}],animate:[{animate:["none",$,n,s]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,n,s]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:Y()}],"rotate-x":[{"rotate-x":Y()}],"rotate-y":[{"rotate-y":Y()}],"rotate-z":[{"rotate-z":Y()}],scale:[{scale:q()}],"scale-x":[{"scale-x":q()}],"scale-y":[{"scale-y":q()}],"scale-z":[{"scale-z":q()}],"scale-3d":["scale-3d"],skew:[{skew:ee()}],"skew-x":[{"skew-x":ee()}],"skew-y":[{"skew-y":ee()}],transform:[{transform:[n,s,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:X()}],"translate-x":[{"translate-x":X()}],"translate-y":[{"translate-y":X()}],"translate-z":[{"translate-z":X()}],"translate-none":["translate-none"],accent:[{accent:c()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:c()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",n,s]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":m()}],"scroll-mx":[{"scroll-mx":m()}],"scroll-my":[{"scroll-my":m()}],"scroll-ms":[{"scroll-ms":m()}],"scroll-me":[{"scroll-me":m()}],"scroll-mt":[{"scroll-mt":m()}],"scroll-mr":[{"scroll-mr":m()}],"scroll-mb":[{"scroll-mb":m()}],"scroll-ml":[{"scroll-ml":m()}],"scroll-p":[{"scroll-p":m()}],"scroll-px":[{"scroll-px":m()}],"scroll-py":[{"scroll-py":m()}],"scroll-ps":[{"scroll-ps":m()}],"scroll-pe":[{"scroll-pe":m()}],"scroll-pt":[{"scroll-pt":m()}],"scroll-pr":[{"scroll-pr":m()}],"scroll-pb":[{"scroll-pb":m()}],"scroll-pl":[{"scroll-pl":m()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",n,s]}],fill:[{fill:["none",...c()]}],"stroke-w":[{stroke:[p,B,O,re]}],stroke:[{stroke:["none",...c()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},vo=eo(yo);function Ao(...e){return vo(Oe(e))}function xe(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function zo(...e){return t=>{let r=!1;const o=e.map(a=>{const l=xe(a,t);return!r&&typeof l=="function"&&(r=!0),l});if(r)return()=>{for(let a=0;a<o.length;a++){const l=o[a];typeof l=="function"?l():xe(e[a],null)}}}}function So(...e){return Te.useCallback(zo(...e),e)}export{zo as a,Oe as b,Ao as c,So as u};
@@ -0,0 +1 @@
1
+ import{c as t}from"./createLucideIcon-BGzacY2v.js";import{j as o}from"./jsx-runtime-u17CrQMm.js";import{c as n}from"./index-vX97OY1J.js";const a=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],u=t("x",a);function c({className:e,type:i,...r}){return o.jsx("input",{type:i,"data-slot":"input",className:n("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}export{c as I,u as X};
@@ -0,0 +1 @@
1
+ var s={exports:{}},e={};var o;function d(){if(o)return e;o=1;var R=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(v,r,t){var u=null;if(t!==void 0&&(u=""+t),r.key!==void 0&&(u=""+r.key),"key"in r){t={};for(var n in r)n!=="key"&&(t[n]=r[n])}else t=r;return r=t.ref,{$$typeof:R,type:v,key:u,ref:r!==void 0?r:null,props:t}}return e.Fragment=a,e.jsx=i,e.jsxs=i,e}var x;function l(){return x||(x=1,s.exports=d()),s.exports}var p=l();export{p as j};
@@ -0,0 +1 @@
1
+ import{j as u}from"./jsx-runtime-u17CrQMm.js";import{r as t}from"./analytics-ui-DMSkNqd6.js";/* empty css */const a=t.createContext(null);function i({children:o}){const[e,r]=t.useState(()=>Date.now()),s=t.useCallback(()=>r(Date.now()),[]),n=t.useMemo(()=>({lastLoadedAt:e,touch:s}),[e,s]);return u.jsx(a.Provider,{value:n,children:o})}function x(){const o=t.useContext(a);if(!o)throw new Error("useLastLoadContext must be used within a LastLoadProvider");return o}export{i as LastLoadProvider,x as useLastLoadContext};
@@ -0,0 +1 @@
1
+ import{j as t}from"./jsx-runtime-u17CrQMm.js";import{c as B}from"./createLucideIcon-BGzacY2v.js";const q=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],O=B("external-link",q),_=1e3,H=1e5,b=1e6,W=1e8,N=1e9,V=1e11,z=1e12;function u(e){if(e>=_&&e<b){const s=e/_;return s===Math.floor(s)||e>=H?Math.floor(s)+"k":Math.floor(s*10)/10+"k"}else if(e>=b&&e<N){const s=e/b;return s===Math.floor(s)||e>=W?Math.floor(s)+"M":Math.floor(s*10)/10+"M"}else if(e>=N&&e<z){const s=e/N;return s===Math.floor(s)||e>=V?Math.floor(s)+"B":Math.floor(s*10)/10+"B"}else return e.toString()}function I(e){return s=>s==null?"-":e(s)}function X(e,s){return("000"+e).slice(s*-1)}function D(e){const s=Math.floor(e/60/60),n=Math.floor(e/60)%60,i=Math.floor(e-n*60-s*60*60);return s>0?`${s}h ${n}m ${i}s`:n>0?`${n}m ${X(i,2)}s`:`${i}s`}function p(e){if(e==null||Number.isNaN(e))return"-";const s=Number(e);return`${s<=1?Math.round(s*1e3)/10:Math.round(s*10)/10}%`}const x={visitors:"Visitors",visits:"Visits",percentage:"%",uniques:"Uniques",total:"Total",conversionRate:"CR",exitRate:"Exit Rate",bounceRate:"Bounce Rate",visitDuration:"Visit duration",scrollDepth:"Scroll Depth",timeOnPage:"Time on Page",pageviews:"Pageviews",impressions:"Impressions",ctr:"CTR",position:"Position"},T={visitors:e=>u(e??0),uniques:e=>u(e??0),total:e=>u(e??0),percentage:e=>p(e??null),conversionRate:e=>p(e??null),exitRate:e=>p(e??null),bounceRate:e=>p(e??null),visitDuration:I(D),scrollDepth:e=>p(e??null),timeOnPage:I(D),pageviews:e=>u(e??0),impressions:e=>u(e??0),ctr:e=>p(e??null),position:e=>e==null||Number.isNaN(e)?"-":(Math.round(e*10)/10).toFixed(1)};function Z({data:e,onRowClick:s,renderLeading:n,rowBarClassName:i,displayBars:E=!0,firstColumnLabel:F,barColorTheme:P="emerald",metricLabels:h,testId:o}){const c=e.metrics,y=72,M=c.includes("visitors")?"visitors":c[0],f=Math.max(...e.results.map(r=>Number(r[M]??0)),1),w=F??(e.meta.skipImportedReason?"Item*":"Item"),A={indigo:["bg-indigo-500/15","bg-indigo-500/12","bg-indigo-500/8"],emerald:["bg-emerald-500/15","bg-emerald-500/10","bg-emerald-500/5"],amber:["bg-amber-500/15","bg-amber-500/12","bg-amber-500/10"],violet:["bg-violet-500/12","bg-violet-500/8","bg-violet-500/6"],cyan:["bg-cyan-400/20","bg-cyan-400/12","bg-cyan-400/8"]};return E?t.jsxs("div",{className:"overflow-hidden rounded-xs border",children:[t.jsxs("table",{className:"min-w-full divide-y divide-border text-sm","data-testid":o?`${o}-table`:void 0,children:[t.jsx("thead",{className:"bg-muted/40",children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",className:"px-4 py-1.5 text-left font-semibold text-muted-foreground",children:w}),c.map(r=>t.jsx("th",{scope:"col",className:"px-4 py-1.5 text-right font-semibold text-muted-foreground",children:x[r]??r},r))]})}),t.jsx("tbody",{className:"divide-y divide-border bg-background",children:e.results.map(r=>t.jsxs("tr",{className:`group transition hover:bg-muted/40 ${s?"cursor-pointer":""}`,onClick:()=>s?.(r),"data-testid":o?`${o}-row`:void 0,"data-name":String(r.name),children:[t.jsx("td",{className:"px-4 py-1.5",children:t.jsxs("div",{className:"relative flex items-center gap-2",children:[i?t.jsx("span",{"aria-hidden":!0,className:`pointer-events-none absolute inset-y-1 left-0 block rounded-xs ${i}`,style:{width:`${Math.max(Number(r[c[0]]??0)/f*100,6)}%`}}):null,t.jsxs("span",{className:"relative z-10 flex items-center gap-2",children:[n?n(r):j(r),t.jsx("span",{className:"font-medium text-foreground break-all whitespace-normal",children:t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx("span",{children:r.name}),L(r.name)?t.jsx("a",{href:String(r.name),target:"_blank",rel:"noopener noreferrer",className:"opacity-0 group-hover:opacity-100 transition text-muted-foreground hover:text-foreground",onClick:a=>a.stopPropagation(),"aria-label":"Open page in new tab",title:"Open page",children:t.jsx(O,{className:"h-3.5 w-3.5"})}):null]})})]})]})}),c.map((a,d)=>t.jsx("td",{className:"px-4 py-1.5 text-right",children:t.jsxs("div",{className:"flex items-center justify-end gap-2.5",children:[d===0?t.jsx("span",{"aria-hidden":!0,className:"flex-1 rounded-full bg-primary/10",style:{maxWidth:120,height:5,position:"relative"},children:t.jsx("span",{className:"absolute inset-y-0 left-0 rounded-full bg-primary",style:{width:`${Number(r[a]??0)/f*100}%`}})}):null,t.jsx("span",{className:"tabular-nums text-foreground",children:v(a,r[a])})]})},a))]},r.name))})]}),e.meta.skipImportedReason&&t.jsxs("p",{className:"px-4 py-2 text-xs text-muted-foreground",children:["* Imported data omitted: ",e.meta.skipImportedReason]})]}):t.jsxs("div",{className:"overflow-hidden","data-testid":o?`${o}-wrap`:void 0,children:[t.jsxs("table",{className:"min-w-full text-sm","data-testid":o?`${o}-table`:void 0,children:[t.jsx("thead",{children:t.jsxs("tr",{className:"border-b border-border",children:[t.jsx("th",{scope:"col",className:"pb-2 pr-3 text-left text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:w}),t.jsx("th",{scope:"col",className:"pb-2 text-right",children:t.jsx("div",{className:"flex items-center justify-end gap-8",children:c.map(r=>{const a=(h&&h[r])??x[r]??r,d=String(a).length,m=d>=16?144:d>=12?120:y;return t.jsx("span",{className:"text-right text-xs font-semibold uppercase tracking-wide text-muted-foreground whitespace-nowrap",style:{minWidth:m,width:m},children:a},r)})})})]})}),t.jsx("tbody",{className:"divide-y divide-border",children:e.results.map((r,a)=>{const d=Number(r[M]??0),m=Math.max(d/f*100,0),g=A[P],C=a===0?g[0]:a===1?g[1]:g[2],k=n?n(r):j(r),S=!!k;return t.jsx("tr",{className:`group relative h-9 transition ${s?"cursor-pointer hover:bg-muted/20":""}`,onClick:()=>s?.(r),"data-testid":o?`${o}-row`:void 0,"data-name":String(r.name),children:t.jsx("td",{className:"",colSpan:2,children:t.jsxs("div",{className:"relative flex items-center justify-between",children:[t.jsxs("div",{className:`relative flex min-w-0 flex-1 items-center gap-3 pr-3 ${S?"pl-8":"pl-2"}`,children:[t.jsx("div",{className:`absolute inset-y-[1px] left-0 rounded-xs ${C}`,style:{width:`${m}%`},"aria-hidden":"true"}),S?t.jsx("span",{className:"absolute left-1 z-10 inline-flex h-6 w-6 items-center justify-center",children:k}):null,t.jsx("span",{className:"relative z-10 break-all whitespace-normal font-medium text-foreground",children:t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx("span",{children:r.name}),L(r.name)?t.jsx("a",{href:String(r.name),target:"_blank",rel:"noopener noreferrer",className:"opacity-0 group-hover:opacity-100 transition text-muted-foreground hover:text-foreground",onClick:l=>l.stopPropagation(),"aria-label":"Open page in new tab",title:"Open page",children:t.jsx(O,{className:"h-3.5 w-3.5"})}):null]})})]}),t.jsx("div",{className:"flex shrink-0 items-center gap-8",children:c.map(l=>{const U=(h&&h[l])??x[l]??l,$=String(U).length,R=$>=16?144:$>=12?120:y;return t.jsx("span",{className:"text-right font-semibold tabular-nums text-foreground whitespace-nowrap",style:{minWidth:R,width:R},children:v(l,r[l])},l)})})]})})},r.name)})})]}),e.meta.skipImportedReason&&t.jsxs("p",{className:"px-4 py-2 text-xs text-muted-foreground",children:["* Imported data omitted: ",e.meta.skipImportedReason]})]})}function j(e){if("flag"in e&&typeof e.flag=="string")return t.jsx("span",{"aria-hidden":!0,children:e.flag});if("countryFlag"in e&&typeof e.countryFlag=="string")return t.jsx("span",{"aria-hidden":!0,children:e.countryFlag});const s=e.code||e.alpha2||e.alpha3,n=G(s);return n?t.jsx("span",{"aria-hidden":!0,children:n}):null}function G(e){if(!e)return"";const s=String(e).toUpperCase().match(/^[A-Z]{2}$/);if(!s)return"";const n=127462;return Array.from(s[0]).map(i=>String.fromCodePoint(n+(i.charCodeAt(0)-65))).join("")}function v(e,s){const n=T[e];return n?n(typeof s=="number"?s:Number(s)):s==null?"—":String(s)}function L(e){const s=String(e||"");return s.startsWith("/")&&!s.startsWith("//")}const Q=Object.freeze(Object.defineProperty({__proto__:null,FORMATTERS:T,METRIC_LABELS:x,MetricTable:Z,formatMetric:v,renderFlag:j},Symbol.toStringTag,{value:"Module"}));export{T as F,Z as M,x as a,Q as l,u as n,j as r};