@sabrenski/spire-ui 0.0.1

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 (237) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +233 -0
  3. package/dist/index.d.ts +4981 -0
  4. package/dist/spire-ui.css +1 -0
  5. package/dist/spire-ui.es.js +18403 -0
  6. package/dist/spire-ui.umd.js +45 -0
  7. package/package.json +83 -0
  8. package/src/components/Accordion/Accordion.test.ts +218 -0
  9. package/src/components/Accordion/AccordionContent.vue +112 -0
  10. package/src/components/Accordion/AccordionItem.vue +87 -0
  11. package/src/components/Accordion/AccordionRoot.vue +111 -0
  12. package/src/components/Accordion/AccordionTrigger.vue +125 -0
  13. package/src/components/Accordion/index.ts +11 -0
  14. package/src/components/Accordion/keys.ts +23 -0
  15. package/src/components/Avatar/Avatar.test.ts +181 -0
  16. package/src/components/Avatar/Avatar.vue +150 -0
  17. package/src/components/Avatar/index.ts +2 -0
  18. package/src/components/Badge/Badge.test.ts +141 -0
  19. package/src/components/Badge/Badge.vue +133 -0
  20. package/src/components/Badge/index.ts +2 -0
  21. package/src/components/BadgeContainer/BadgeContainer.test.ts +150 -0
  22. package/src/components/BadgeContainer/BadgeContainer.vue +90 -0
  23. package/src/components/BadgeContainer/index.ts +2 -0
  24. package/src/components/Breadcrumb/Breadcrumb.test.ts +342 -0
  25. package/src/components/Breadcrumb/BreadcrumbEllipsis.vue +96 -0
  26. package/src/components/Breadcrumb/BreadcrumbItem.vue +16 -0
  27. package/src/components/Breadcrumb/BreadcrumbLink.vue +67 -0
  28. package/src/components/Breadcrumb/BreadcrumbList.vue +20 -0
  29. package/src/components/Breadcrumb/BreadcrumbPage.vue +25 -0
  30. package/src/components/Breadcrumb/BreadcrumbRoot.vue +41 -0
  31. package/src/components/Breadcrumb/BreadcrumbSeparator.vue +63 -0
  32. package/src/components/Breadcrumb/index.ts +13 -0
  33. package/src/components/Breadcrumb/keys.ts +7 -0
  34. package/src/components/Button/Button.test.ts +231 -0
  35. package/src/components/Button/Button.vue +349 -0
  36. package/src/components/Button/index.ts +2 -0
  37. package/src/components/Callout/Callout.test.ts +260 -0
  38. package/src/components/Callout/Callout.vue +341 -0
  39. package/src/components/Callout/index.ts +2 -0
  40. package/src/components/Card/Card.test.ts +565 -0
  41. package/src/components/Card/Card.vue +209 -0
  42. package/src/components/Card/CardContent.vue +57 -0
  43. package/src/components/Card/CardFooter.vue +72 -0
  44. package/src/components/Card/CardHeader.vue +111 -0
  45. package/src/components/Card/CardImage.vue +124 -0
  46. package/src/components/Card/index.ts +14 -0
  47. package/src/components/Chart/BarChart.vue +208 -0
  48. package/src/components/Chart/BaseChart.vue +444 -0
  49. package/src/components/Chart/Chart.test.ts +359 -0
  50. package/src/components/Chart/DonutChart.vue +283 -0
  51. package/src/components/Chart/LineChart.vue +211 -0
  52. package/src/components/Chart/index.ts +20 -0
  53. package/src/components/Chart/useChartTheme.ts +192 -0
  54. package/src/components/Checkbox/Checkbox.test.ts +209 -0
  55. package/src/components/Checkbox/Checkbox.vue +285 -0
  56. package/src/components/Checkbox/index.ts +2 -0
  57. package/src/components/ChoiceChip/ChoiceChip.test.ts +142 -0
  58. package/src/components/ChoiceChip/ChoiceChip.vue +218 -0
  59. package/src/components/ChoiceChip/index.ts +2 -0
  60. package/src/components/ChoiceChipGroup/ChoiceChipGroup.test.ts +151 -0
  61. package/src/components/ChoiceChipGroup/ChoiceChipGroup.vue +70 -0
  62. package/src/components/ChoiceChipGroup/index.ts +2 -0
  63. package/src/components/ColorPicker/ColorArea.vue +159 -0
  64. package/src/components/ColorPicker/ColorPicker.test.ts +250 -0
  65. package/src/components/ColorPicker/ColorPicker.vue +339 -0
  66. package/src/components/ColorPicker/ColorSlider.vue +191 -0
  67. package/src/components/ColorPicker/index.ts +7 -0
  68. package/src/components/Combobox/Combobox.test.ts +891 -0
  69. package/src/components/Combobox/Combobox.vue +934 -0
  70. package/src/components/Combobox/index.ts +2 -0
  71. package/src/components/DataTable/DataTable.test.ts +1221 -0
  72. package/src/components/DataTable/DataTable.vue +1415 -0
  73. package/src/components/DataTable/index.ts +10 -0
  74. package/src/components/DatePicker/DatePicker.test.ts +625 -0
  75. package/src/components/DatePicker/DatePicker.vue +1586 -0
  76. package/src/components/DatePicker/index.ts +2 -0
  77. package/src/components/Drawer/Drawer.test.ts +336 -0
  78. package/src/components/Drawer/Drawer.vue +466 -0
  79. package/src/components/Drawer/index.ts +2 -0
  80. package/src/components/Dropdown/Dropdown.test.ts +607 -0
  81. package/src/components/Dropdown/Dropdown.vue +807 -0
  82. package/src/components/Dropdown/DropdownItem.vue +227 -0
  83. package/src/components/Dropdown/DropdownSeparator.vue +14 -0
  84. package/src/components/Dropdown/DropdownSub.vue +104 -0
  85. package/src/components/Dropdown/DropdownSubContent.vue +187 -0
  86. package/src/components/Dropdown/DropdownSubTrigger.vue +151 -0
  87. package/src/components/Dropdown/index.ts +14 -0
  88. package/src/components/EmptyState/EmptyState.test.ts +180 -0
  89. package/src/components/EmptyState/EmptyState.vue +137 -0
  90. package/src/components/EmptyState/index.ts +2 -0
  91. package/src/components/FileUpload/FileUpload.test.ts +1151 -0
  92. package/src/components/FileUpload/FileUpload.vue +1042 -0
  93. package/src/components/FileUpload/index.ts +2 -0
  94. package/src/components/Heading/Heading.test.ts +107 -0
  95. package/src/components/Heading/Heading.vue +67 -0
  96. package/src/components/Heading/index.ts +2 -0
  97. package/src/components/Icon/Icon.test.ts +157 -0
  98. package/src/components/Icon/Icon.vue +86 -0
  99. package/src/components/Icon/index.ts +2 -0
  100. package/src/components/Input/Input.test.ts +273 -0
  101. package/src/components/Input/Input.vue +388 -0
  102. package/src/components/Input/index.ts +2 -0
  103. package/src/components/Layout/Container.vue +67 -0
  104. package/src/components/Layout/Grid.vue +159 -0
  105. package/src/components/Layout/GridItem.vue +154 -0
  106. package/src/components/Layout/Layout.test.ts +202 -0
  107. package/src/components/Layout/Stack.vue +128 -0
  108. package/src/components/Layout/index.ts +9 -0
  109. package/src/components/Layout/keys.ts +7 -0
  110. package/src/components/Modal/Modal.test.ts +311 -0
  111. package/src/components/Modal/Modal.vue +336 -0
  112. package/src/components/Modal/index.ts +2 -0
  113. package/src/components/Pagination/Pagination.test.ts +303 -0
  114. package/src/components/Pagination/Pagination.vue +212 -0
  115. package/src/components/Pagination/index.ts +3 -0
  116. package/src/components/Pagination/utils.ts +86 -0
  117. package/src/components/Popover/Popover.test.ts +285 -0
  118. package/src/components/Popover/Popover.vue +441 -0
  119. package/src/components/Popover/index.ts +2 -0
  120. package/src/components/Progress/Progress.test.ts +361 -0
  121. package/src/components/Progress/Progress.vue +363 -0
  122. package/src/components/Progress/index.ts +7 -0
  123. package/src/components/Radio/Radio.test.ts +216 -0
  124. package/src/components/Radio/Radio.vue +214 -0
  125. package/src/components/Radio/index.ts +2 -0
  126. package/src/components/Rating/Rating.test.ts +319 -0
  127. package/src/components/Rating/Rating.vue +247 -0
  128. package/src/components/Rating/index.ts +2 -0
  129. package/src/components/SegmentedControl/SegmentedControl.test.ts +292 -0
  130. package/src/components/SegmentedControl/SegmentedControl.vue +288 -0
  131. package/src/components/SegmentedControl/index.ts +2 -0
  132. package/src/components/Select/Select.test.ts +589 -0
  133. package/src/components/Select/Select.vue +666 -0
  134. package/src/components/Select/index.ts +2 -0
  135. package/src/components/Sidebar/Sidebar.test.ts +301 -0
  136. package/src/components/Sidebar/SidebarGroup.vue +103 -0
  137. package/src/components/Sidebar/SidebarItem.vue +196 -0
  138. package/src/components/Sidebar/SidebarLayout.vue +42 -0
  139. package/src/components/Sidebar/SidebarRoot.vue +122 -0
  140. package/src/components/Sidebar/index.ts +11 -0
  141. package/src/components/Sidebar/keys.ts +14 -0
  142. package/src/components/Skeleton/Skeleton.test.ts +130 -0
  143. package/src/components/Skeleton/Skeleton.vue +104 -0
  144. package/src/components/Skeleton/index.ts +2 -0
  145. package/src/components/Slider/Slider.test.ts +416 -0
  146. package/src/components/Slider/Slider.vue +435 -0
  147. package/src/components/Slider/index.ts +2 -0
  148. package/src/components/Slider/utils.ts +91 -0
  149. package/src/components/Spinner/Spinner.test.ts +79 -0
  150. package/src/components/Spinner/Spinner.vue +159 -0
  151. package/src/components/Spinner/index.ts +2 -0
  152. package/src/components/SpireProvider/SpireProvider.vue +71 -0
  153. package/src/components/SpireProvider/index.ts +11 -0
  154. package/src/components/Stepper/Stepper.test.ts +221 -0
  155. package/src/components/Stepper/StepperContent.vue +51 -0
  156. package/src/components/Stepper/StepperItem.vue +89 -0
  157. package/src/components/Stepper/StepperRoot.vue +101 -0
  158. package/src/components/Stepper/StepperSeparator.vue +52 -0
  159. package/src/components/Stepper/StepperTrigger.vue +144 -0
  160. package/src/components/Stepper/index.ts +11 -0
  161. package/src/components/Stepper/keys.ts +27 -0
  162. package/src/components/Switch/Switch.test.ts +214 -0
  163. package/src/components/Switch/Switch.vue +235 -0
  164. package/src/components/Switch/index.ts +2 -0
  165. package/src/components/Tabs/Tabs.test.ts +363 -0
  166. package/src/components/Tabs/Tabs.vue +318 -0
  167. package/src/components/Tabs/index.ts +2 -0
  168. package/src/components/Text/Text.test.ts +154 -0
  169. package/src/components/Text/Text.vue +100 -0
  170. package/src/components/Text/index.ts +2 -0
  171. package/src/components/Textarea/Textarea.test.ts +432 -0
  172. package/src/components/Textarea/Textarea.vue +411 -0
  173. package/src/components/Textarea/index.ts +2 -0
  174. package/src/components/TimePicker/TimePicker.test.ts +352 -0
  175. package/src/components/TimePicker/TimePicker.vue +569 -0
  176. package/src/components/TimePicker/index.ts +2 -0
  177. package/src/components/Timeline/Timeline.test.ts +193 -0
  178. package/src/components/Timeline/Timeline.vue +111 -0
  179. package/src/components/Timeline/TimelineItem.vue +167 -0
  180. package/src/components/Timeline/index.ts +13 -0
  181. package/src/components/Timeline/keys.ts +21 -0
  182. package/src/components/Toast/ToastItem.test.ts +289 -0
  183. package/src/components/Toast/ToastItem.vue +370 -0
  184. package/src/components/Toast/ToastProvider.test.ts +158 -0
  185. package/src/components/Toast/ToastProvider.vue +181 -0
  186. package/src/components/Toast/index.ts +83 -0
  187. package/src/components/Toast/toastState.test.ts +165 -0
  188. package/src/components/Toast/toastState.ts +161 -0
  189. package/src/components/ToggleButton/ToggleButton.test.ts +166 -0
  190. package/src/components/ToggleButton/ToggleButton.vue +197 -0
  191. package/src/components/ToggleButton/index.ts +2 -0
  192. package/src/components/ToggleGroup/ToggleGroup.test.ts +181 -0
  193. package/src/components/ToggleGroup/ToggleGroup.vue +130 -0
  194. package/src/components/ToggleGroup/index.ts +2 -0
  195. package/src/components/Tooltip/Tooltip.test.ts +238 -0
  196. package/src/components/Tooltip/Tooltip.vue +217 -0
  197. package/src/components/Tooltip/index.ts +2 -0
  198. package/src/components/TreeView/TreeView.test.ts +357 -0
  199. package/src/components/TreeView/TreeView.vue +251 -0
  200. package/src/components/TreeView/TreeViewItem.vue +288 -0
  201. package/src/components/TreeView/index.ts +11 -0
  202. package/src/components/TreeView/keys.ts +35 -0
  203. package/src/composables/index.ts +12 -0
  204. package/src/composables/useClickOutside.ts +36 -0
  205. package/src/composables/useClipboard.ts +35 -0
  206. package/src/composables/useEventListener.ts +48 -0
  207. package/src/composables/useFocusTrap.ts +58 -0
  208. package/src/composables/useHoverReveal.ts +98 -0
  209. package/src/composables/useId.ts +10 -0
  210. package/src/composables/useMagnetic.ts +171 -0
  211. package/src/composables/useRelativePosition.ts +127 -0
  212. package/src/composables/useRipple.ts +146 -0
  213. package/src/composables/useScrollLock.ts +25 -0
  214. package/src/composables/useSpireConfig.ts +27 -0
  215. package/src/composables/useStagger.ts +224 -0
  216. package/src/config/icons.test.ts +115 -0
  217. package/src/config/icons.ts +170 -0
  218. package/src/index.ts +361 -0
  219. package/src/styles/depth.css +129 -0
  220. package/src/styles/effects.css +169 -0
  221. package/src/styles/fallback.css +152 -0
  222. package/src/styles/main.css +25 -0
  223. package/src/styles/mood.css +211 -0
  224. package/src/styles/motion.css +159 -0
  225. package/src/styles/reset.css +97 -0
  226. package/src/styles/theme.css +708 -0
  227. package/src/styles/tokens.css +183 -0
  228. package/src/utils/.gitkeep +0 -0
  229. package/src/utils/color.ts +277 -0
  230. package/src/utils/date.test.ts +522 -0
  231. package/src/utils/date.ts +380 -0
  232. package/src/utils/index.ts +23 -0
  233. package/src/utils/object.test.ts +80 -0
  234. package/src/utils/object.ts +25 -0
  235. package/src/utils/string.test.ts +64 -0
  236. package/src/utils/string.ts +32 -0
  237. package/src/utils/time.ts +156 -0
@@ -0,0 +1,45 @@
1
+ (function(E,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(E=typeof globalThis<"u"?globalThis:E||self,i(E.SpireUI={},E.Vue))})(this,(function(E,i){"use strict";var _0=Object.defineProperty;var y0=(E,i,Et)=>i in E?_0(E,i,{enumerable:!0,configurable:!0,writable:!0,value:Et}):E[i]=Et;var W=(E,i,Et)=>y0(E,typeof i!="symbol"?i+"":i,Et);var Ro;const Et=Symbol("accordion"),Mi=Symbol("accordion-item"),ql=i.defineComponent({__name:"AccordionRoot",props:{modelValue:{},collapsible:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},variant:{default:"contained"}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(t.modelValue);i.watch(()=>t.modelValue,c=>{a.value=c});const s=i.computed(()=>t.modelValue!==void 0),l=i.computed(()=>{const c=s.value?t.modelValue:a.value;return c===void 0?new Set:Array.isArray(c)?new Set(c):new Set([c])});function r(c){const d=l.value.has(c);let u;if(d){if(!t.collapsible&&l.value.size===1)return;if(t.multiple){const h=new Set(l.value);h.delete(c),u=Array.from(h)}else u=void 0}else if(t.multiple){const h=new Set(l.value);h.add(c),u=Array.from(h)}else u=c;a.value=u,o("update:modelValue",u)}return i.provide(Et,{openItems:l,toggle:r,collapsible:i.toRef(t,"collapsible"),multiple:i.toRef(t,"multiple"),variant:i.toRef(t,"variant")}),(c,d)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-accordion",[`ui-accordion--${n.variant}`]])},[i.renderSlot(c.$slots,"default",{},void 0,!0)],2))}}),O=(n,e)=>{const t=n.__vccOpts||n;for(const[o,a]of e)t[o]=a;return t},Gl=O(ql,[["__scopeId","data-v-93a5c4e6"]]);function Jl(n,e){const t=o=>{const a=o.target;!n.value||n.value.contains(a)||e()};i.onMounted(()=>{document.addEventListener("mousedown",t),document.addEventListener("touchstart",t)}),i.onUnmounted(()=>{document.removeEventListener("mousedown",t),document.removeEventListener("touchstart",t)})}function Zl(n=2e3){const e=i.ref(!1);let t=null;return{copy:async a=>{if(!(navigator!=null&&navigator.clipboard))return console.warn("Clipboard API not supported"),!1;try{return await navigator.clipboard.writeText(a),e.value=!0,t&&clearTimeout(t),t=setTimeout(()=>{e.value=!1},n),!0}catch(s){return console.error("Failed to copy:",s),e.value=!1,!1}},copied:e}}function Ql(n,e,t,o){const a=l=>{l==null||l.addEventListener(e,t,o)},s=l=>{l==null||l.removeEventListener(e,t,o)};i.isRef(n)?i.watch(n,(l,r)=>{r&&s(r),l&&a(l)},{immediate:!0}):i.onMounted(()=>a(n)),i.onUnmounted(()=>s(i.unref(n)))}const Oo=["a[href]","button:not([disabled])","input:not([disabled])","textarea:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(", ");function er(n,e){const t=o=>{if(!e.value||!n.value||o.key!=="Tab")return;const a=n.value.querySelectorAll(Oo);if(a.length===0)return;const s=a[0],l=a[a.length-1];o.shiftKey?document.activeElement===s&&(o.preventDefault(),l.focus()):document.activeElement===l&&(o.preventDefault(),s.focus())};i.watch(e,async o=>{var a;if(o){await i.nextTick();const s=(a=n.value)==null?void 0:a.querySelector(Oo);s==null||s.focus(),window.addEventListener("keydown",t)}else window.removeEventListener("keydown",t)}),i.onUnmounted(()=>{window.removeEventListener("keydown",t)})}function tr(n,e={}){const{size:t,opacity:o}=e;let a=!1,s=null;function l(u){if(!n.value)return;const h=n.value.getBoundingClientRect(),f=(u.clientX-h.left)/h.width*100,m=(u.clientY-h.top)/h.height*100;n.value.style.setProperty("--mouse-x",`${f}%`),n.value.style.setProperty("--mouse-y",`${m}%`),t!==void 0&&n.value.style.setProperty("--effect-hover-reveal-size",`${t}px`),o!==void 0&&n.value.style.setProperty("--effect-hover-reveal-opacity",`${o}`)}function r(){n.value&&(n.value.style.removeProperty("--mouse-x"),n.value.style.removeProperty("--mouse-y"))}function c(u){a&&s===u||(d(),s=u,a=!0,u.setAttribute("data-hover-reveal",""),u.addEventListener("mousemove",l),u.addEventListener("mouseleave",r))}function d(){s&&(s.removeEventListener("mousemove",l),s.removeEventListener("mouseleave",r),s.style.removeProperty("--mouse-x"),s.style.removeProperty("--mouse-y")),a=!1,s=null}i.watch(n,u=>{u?c(u):d()},{immediate:!0}),i.onUnmounted(()=>{d()})}let nr=0;function ye(n="ui"){return`${n}-${++nr}`}function ir(n,e={}){const{strength:t=.2,radius:o=100,ease:a=.15}=e,s=i.ref(0),l=i.ref(0),r=i.ref(!1),c=i.ref({});let d=null,u=0,h=0,f=0,m=0,p=!1,g=null;function b(x,S,w){return x+(S-x)*w}function _(){f=b(f,u,a),m=b(m,h,a);const x=Math.abs(f-u),S=Math.abs(m-h);x<.01&&S<.01&&(f=u,m=h),s.value=f,l.value=m,c.value={transform:`translate(${f}px, ${m}px)`,transition:"none"},r.value||f!==0||m!==0?d=requestAnimationFrame(_):(d=null,c.value={transform:"translate(0, 0)",transition:"transform var(--duration-normal, 200ms) var(--ease-out, ease-out)"})}function k(x){if(!n.value)return;const S=n.value.getBoundingClientRect(),w=S.left+S.width/2,M=S.top+S.height/2,N=x.clientX-w,T=x.clientY-M,$=Math.sqrt(N**2+T**2);if($<o){r.value=!0;const K=1-$/o;u=N*t*K,h=T*t*K,d||(d=requestAnimationFrame(_))}else r.value&&B()}function B(){r.value=!1,u=0,h=0,d||(d=requestAnimationFrame(_))}function C(x){p&&g===x||(y(),g=x,p=!0,document.addEventListener("mousemove",k),x.addEventListener("mouseleave",B))}function y(){document.removeEventListener("mousemove",k),g&&g.removeEventListener("mouseleave",B),d&&(cancelAnimationFrame(d),d=null),p=!1,g=null}return i.watch(n,x=>{x?C(x):y()},{immediate:!0}),i.onUnmounted(()=>{y()}),{x:s,y:l,isHovering:r,style:c}}function Fo(n,e,t,o){const a=n.getBoundingClientRect(),s=e.offsetWidth,l=e.offsetHeight,r={width:window.innerWidth||1024,height:window.innerHeight||768},c=a.left+a.width/2,d=a.top+a.height/2;function u(_){switch(_){case"top":return{top:a.top-l-o,left:c-s/2};case"bottom":return{top:a.bottom+o,left:c-s/2};case"left":return{top:d-l/2,left:a.left-s-o};case"right":return{top:d-l/2,left:a.right+o}}}const h={top:"bottom",bottom:"top",left:"right",right:"left"};let f=t,m=u(f);const p={top:m.top<0,bottom:m.top+l>r.height,left:m.left<0,right:m.left+s>r.width};(f==="top"&&p.top||f==="bottom"&&p.bottom||f==="left"&&p.left||f==="right"&&p.right)&&(f=h[f],m=u(f));const g=Math.max(o,Math.min(m.top,r.height-l-o)),b=Math.max(o,Math.min(m.left,r.width-s-o));return{top:g,left:b,actualPlacement:f}}function Wo(n,e,t="top",o=8){const a=i.ref({top:0,left:0,actualPlacement:"top"});function s(){return typeof t=="string"?t:typeof t=="function"?t():t.value}function l(){!n.value||!e.value||(a.value=Fo(n.value,e.value,s(),o))}return i.onMounted(()=>{window.addEventListener("resize",l),window.addEventListener("scroll",l,!0)}),i.onUnmounted(()=>{window.removeEventListener("resize",l),window.removeEventListener("scroll",l,!0)}),{coords:a,updatePosition:l,getPlacement:s}}function or(n,e={}){const{color:t="var(--effect-ripple-color, white)",opacity:o=.25,duration:a=800,disabled:s=!1}=e;let l=!1,r=null,c=null;function d(){return typeof s=="boolean"?s:s.value}function u(){document.querySelector("style[data-ripple-keyframes]")||(c=document.createElement("style"),c.setAttribute("data-ripple-keyframes",""),c.textContent=`
2
+ @keyframes ui-ripple-expand {
3
+ 0% {
4
+ opacity: 0;
5
+ transform: scale(0);
6
+ }
7
+ 15% {
8
+ opacity: var(--ripple-opacity, 0.25);
9
+ }
10
+ 100% {
11
+ transform: scale(2.5);
12
+ opacity: 0;
13
+ }
14
+ }
15
+ `,document.head.appendChild(c))}function h(p){if(!n.value||d())return;const g=n.value,b=g.getBoundingClientRect(),_=p.clientX-b.left,k=p.clientY-b.top,B=Math.max(b.width,b.height)*2,C=document.createElement("span");C.className="ui-ripple",C.style.cssText=`
16
+ position: absolute;
17
+ left: ${_-B/2}px;
18
+ top: ${k-B/2}px;
19
+ width: ${B}px;
20
+ height: ${B}px;
21
+ border-radius: 50%;
22
+ background: ${t};
23
+ --ripple-opacity: ${o};
24
+ opacity: 0;
25
+ transform: scale(0);
26
+ pointer-events: none;
27
+ animation: ui-ripple-expand ${a}ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
28
+ `,g.style.position=g.style.position||"relative",g.style.overflow="hidden",g.appendChild(C),C.addEventListener("animationend",()=>{C.remove()})}function f(p){l&&r===p||(m(),r=p,l=!0,u(),p.addEventListener("click",h),p.setAttribute("data-ripple",""))}function m(){r&&r.removeEventListener("click",h),l=!1,r=null}i.watch(n,p=>{p?f(p):m()},{immediate:!0}),i.onUnmounted(()=>{m()})}function Tn(n){const e=()=>{const o=window.innerWidth-document.documentElement.clientWidth;document.body.style.paddingRight=`${o}px`,document.body.style.overflow="hidden"},t=()=>{document.body.style.paddingRight="",document.body.style.overflow=""};i.watch(n,o=>{o?e():t()}),i.onUnmounted(()=>t())}const Ho=Symbol("spire-config"),ar=O(i.defineComponent({__name:"SpireProvider",props:{theme:{},mood:{},depth:{},motion:{},texture:{},tag:{default:"div"}},setup(n){const e=n,t=i.computed(()=>({theme:e.theme,mood:e.mood,depth:e.depth,motion:e.motion,texture:e.texture}));i.provide(Ho,t);const o=i.computed(()=>{const a={};return e.theme&&(a["data-theme"]=e.theme),e.mood&&(a["data-mood"]=e.mood),e.depth&&(a["data-depth"]=e.depth),e.motion&&(a["data-motion"]=e.motion),e.texture&&(a["data-texture"]=e.texture),a});return(a,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.tag),i.mergeProps({class:"spire-provider"},o.value),{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default",{},void 0,!0)]),_:3},16))}}),[["__scopeId","data-v-5f21efd3"]]);function sr(n,e,t={}){const{delay:o=80,duration:a=400,easing:s="cubic-bezier(0.16, 1, 0.3, 1)",from:l={opacity:0,transform:"translateY(16px)"},to:r={opacity:1,transform:"translateY(0)"},animateOnVisible:c=!1}=t,d=i.ref(!1);let u=!1,h=null;function f(){return n.value?Array.from(n.value.querySelectorAll(e)):[]}function m(_){_.offsetHeight}function p(_){_.forEach(k=>{k.style.transition="none",l.opacity!==void 0&&(k.style.opacity=String(l.opacity)),l.transform&&(k.style.transform=l.transform)})}async function g(){await i.nextTick();const _=f();if(_.length===0||d.value)return;d.value=!0,p(_),_[0]&&m(_[0]),await new Promise(B=>requestAnimationFrame(B)),_.forEach((B,C)=>{const y=C*o;B.style.transition=`opacity ${a}ms ${s} ${y}ms, transform ${a}ms ${s} ${y}ms`,r.opacity!==void 0&&(B.style.opacity=String(r.opacity)),r.transform&&(B.style.transform=r.transform)});const k=(_.length-1)*o+a;await new Promise(B=>{h&&clearTimeout(h),h=setTimeout(()=>{h=null,d.value=!1,_.forEach(C=>{C.style.transition=""}),B()},k+50)})}function b(){f().forEach(k=>{k.style.opacity="",k.style.transform="",k.style.transition=""}),d.value=!1,u=!1}return c&&i.watch(n,async _=>{_&&!u&&(await i.nextTick(),f().length>0&&(u=!0,g()))},{immediate:!0}),i.onUnmounted(()=>{h&&(clearTimeout(h),h=null)}),{isAnimating:d,animate:g,reset:b}}function lr(n,e={}){const{delay:t=80}=e;return{"--stagger-delay":`${n*t}ms`,"--stagger-index":String(n)}}const rr=["data-state"],cr=O(i.defineComponent({__name:"AccordionItem",props:{value:{},disabled:{type:Boolean,default:!1}},setup(n){const e=n,t=i.inject(Et);if(!t)throw new Error("AccordionItem must be used within AccordionRoot");const o=ye("accordion-trigger"),a=ye("accordion-content"),s=i.computed(()=>t.openItems.value.has(e.value));function l(){e.disabled||t.toggle(e.value)}i.provide(Mi,{value:e.value,triggerId:o,contentId:a,isOpen:s,disabled:i.computed(()=>e.disabled),toggle:l});const r=i.computed(()=>["ui-accordion__item",`ui-accordion__item--${t.variant.value}`,{"ui-accordion__item--disabled":e.disabled,"ui-accordion__item--open":s.value}]);return(c,d)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(r.value),"data-state":s.value?"open":"closed"},[i.renderSlot(c.$slots,"default",{},void 0,!0)],10,rr))}}),[["__scopeId","data-v-7dfbd25c"]]),dr={class:"ui-accordion__heading"},ur=["id","aria-expanded","aria-controls","disabled"],hr={class:"ui-accordion__trigger-text"},fr={key:0,class:"ui-accordion__indicator"},mr=O(i.defineComponent({__name:"AccordionTrigger",props:{hideIndicator:{type:Boolean,default:!1}},setup(n){const e=i.useSlots(),t=i.inject(Mi);if(!t)throw new Error("AccordionTrigger must be used within AccordionItem");const o=!!e.icon;return(a,s)=>(i.openBlock(),i.createElementBlock("h3",dr,[i.createElementVNode("button",{type:"button",class:"ui-accordion__trigger",id:i.unref(t).triggerId,"aria-expanded":i.unref(t).isOpen.value,"aria-controls":i.unref(t).contentId,disabled:i.unref(t).disabled.value,onClick:s[0]||(s[0]=(...l)=>i.unref(t).toggle&&i.unref(t).toggle(...l))},[i.createElementVNode("span",hr,[i.renderSlot(a.$slots,"default",{},void 0,!0)]),o?(i.openBlock(),i.createElementBlock("span",fr,[i.renderSlot(a.$slots,"icon",{isOpen:i.unref(t).isOpen.value},void 0,!0)])):n.hideIndicator?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("svg",{key:1,class:i.normalizeClass(["ui-accordion__chevron",{"ui-accordion__chevron--open":i.unref(t).isOpen.value}]),width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...s[1]||(s[1]=[i.createElementVNode("path",{d:"M6 9l6 6 6-6"},null,-1)])],2))],8,ur)]))}}),[["__scopeId","data-v-d8ac582f"]]),pr=["id","aria-labelledby"],gr={class:"ui-accordion__content-inner"},br=["id","aria-labelledby"],_r={class:"ui-accordion__content-inner"},yr=O(i.defineComponent({__name:"AccordionContent",props:{lazy:{type:Boolean,default:!1}},setup(n){const e=i.inject(Mi);if(!e)throw new Error("AccordionContent must be used within AccordionItem");function t(l){const r=l;r.style.height="0",r.style.overflow="hidden",r.offsetHeight,r.style.height=`${r.scrollHeight}px`}function o(l){const r=l;r.style.height="auto",r.style.overflow=""}function a(l){const r=l;r.style.height=`${r.scrollHeight}px`,r.style.overflow="hidden",r.offsetHeight,r.style.height="0"}function s(l){const r=l;r.style.height="",r.style.overflow=""}return(l,r)=>n.lazy?(i.openBlock(),i.createBlock(i.Transition,{key:0,name:"ui-accordion-content",onEnter:t,onAfterEnter:o,onLeave:a,onAfterLeave:s},{default:i.withCtx(()=>[i.unref(e).isOpen.value?(i.openBlock(),i.createElementBlock("div",{key:0,id:i.unref(e).contentId,class:"ui-accordion__content",role:"region","aria-labelledby":i.unref(e).triggerId},[i.createElementVNode("div",gr,[i.renderSlot(l.$slots,"default",{},void 0,!0)])],8,pr)):i.createCommentVNode("",!0)]),_:3})):(i.openBlock(),i.createBlock(i.Transition,{key:1,name:"ui-accordion-content",onEnter:t,onAfterEnter:o,onLeave:a,onAfterLeave:s},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("div",{id:i.unref(e).contentId,class:"ui-accordion__content",role:"region","aria-labelledby":i.unref(e).triggerId},[i.createElementVNode("div",_r,[i.renderSlot(l.$slots,"default",{},void 0,!0)])],8,br),[[i.vShow,i.unref(e).isOpen.value]])]),_:3}))}}),[["__scopeId","data-v-1f8efcd8"]]);function jo(n,e=2){if(!n)return"";const t=n.trim().split(/\s+/);if(t.length===0||t[0]==="")return"";if(t.length===1)return t[0].substring(0,e).toUpperCase();const o=t[0][0],a=t[t.length-1][0];return(o+a).toUpperCase()}const kr=["aria-label"],xr=["src","alt"],wr={key:1,class:"ui-avatar__text"},Cr={key:2,class:"ui-avatar__icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Yo=O(i.defineComponent({__name:"Avatar",props:{src:{},name:{},alt:{},size:{default:"md"},shape:{default:"circle"},variant:{default:"soft"},bordered:{type:Boolean,default:!1}},setup(n){const e=n,t=i.ref(!1);i.watch(()=>e.src,()=>{t.value=!1});function o(){t.value=!0}const a=i.computed(()=>jo(e.name)),s=i.computed(()=>e.src&&!t.value),l=i.computed(()=>!s.value&&a.value);i.computed(()=>!s.value&&!a.value);const r=i.computed(()=>["ui-avatar",`ui-avatar--${e.size}`,`ui-avatar--${e.shape}`,`ui-avatar--${e.variant}`,{"ui-avatar--bordered":e.bordered}]),c=i.computed(()=>e.alt||e.name||"Avatar");return(d,u)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(r.value),role:"img","aria-label":c.value},[s.value?(i.openBlock(),i.createElementBlock("img",{key:0,src:n.src,alt:n.alt||n.name,class:"ui-avatar__img",onError:o},null,40,xr)):l.value?(i.openBlock(),i.createElementBlock("span",wr,i.toDisplayString(a.value),1)):(i.openBlock(),i.createElementBlock("svg",Cr,[...u[0]||(u[0]=[i.createElementVNode("circle",{cx:"12",cy:"8",r:"4"},null,-1),i.createElementVNode("path",{d:"M4 20c0-4 4-6 8-6s8 2 8 6"},null,-1)])]))],10,kr))}}),[["__scopeId","data-v-336c7655"]]),Br=["aria-label"],Sr=O(i.defineComponent({__name:"Badge",props:{variant:{default:"default"},dot:{type:Boolean},pulse:{type:Boolean},value:{},max:{default:99},label:{}},setup(n){const e=n,t=i.useSlots(),o=i.computed(()=>e.dot||!t.default&&e.value===void 0),a=i.computed(()=>e.value===void 0?null:e.value>e.max?`${e.max}+`:String(e.value)),s=i.computed(()=>{if(e.label)return e.label;if(e.value!==void 0)return String(e.value)}),l=i.computed(()=>["ui-badge",`ui-badge--${e.variant}`,{"ui-badge--dot":o.value,"ui-badge--pulse":e.pulse&&o.value}]);return(r,c)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass(l.value),"aria-label":s.value,role:"status"},[o.value?i.createCommentVNode("",!0):i.renderSlot(r.$slots,"default",{key:0},()=>[i.createTextVNode(i.toDisplayString(a.value),1)],!0)],10,Br))}}),[["__scopeId","data-v-1251e7f1"]]),Er={class:"ui-badge-container"},Mr=O(i.defineComponent({__name:"BadgeContainer",props:{position:{default:"top-right"},offsetX:{default:"0px"},offsetY:{default:"0px"},cutout:{type:Boolean,default:!1}},setup(n){const e=n,t=i.computed(()=>({"top-right":{top:"0",right:"0",transform:`translate(calc(50% + ${e.offsetX}), calc(-50% + ${e.offsetY}))`},"top-left":{top:"0",left:"0",transform:`translate(calc(-50% + ${e.offsetX}), calc(-50% + ${e.offsetY}))`},"bottom-right":{bottom:"0",right:"0",transform:`translate(calc(50% + ${e.offsetX}), calc(50% + ${e.offsetY}))`},"bottom-left":{bottom:"0",left:"0",transform:`translate(calc(-50% + ${e.offsetX}), calc(50% + ${e.offsetY}))`}})[e.position]),o=i.computed(()=>["ui-badge-container__badge",{"ui-badge-container__badge--cutout":e.cutout}]);return(a,s)=>(i.openBlock(),i.createElementBlock("span",Er,[i.renderSlot(a.$slots,"default",{},void 0,!0),a.$slots.badge?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(o.value),style:i.normalizeStyle(t.value)},[i.renderSlot(a.$slots,"badge",{},void 0,!0)],6)):i.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-cc26bf8f"]]),Uo=Symbol("breadcrumb"),vr={"aria-label":"Breadcrumb",class:"ui-breadcrumb"},Vr=O(i.defineComponent({__name:"BreadcrumbRoot",props:{separator:{type:[String,Function],default:"/"}},setup(n){const e=n,t=i.useSlots();return i.provide(Uo,{separator:t.separator?()=>t.separator():e.separator}),(o,a)=>(i.openBlock(),i.createElementBlock("nav",vr,[i.renderSlot(o.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-0216e016"]]),Dr={},$r={class:"ui-breadcrumb__list"};function Tr(n,e){return i.openBlock(),i.createElementBlock("ol",$r,[i.renderSlot(n.$slots,"default",{},void 0,!0)])}const Ir=O(Dr,[["render",Tr],["__scopeId","data-v-5d41319b"]]),Lr={},zr={class:"ui-breadcrumb__item"};function Nr(n,e){return i.openBlock(),i.createElementBlock("li",zr,[i.renderSlot(n.$slots,"default",{},void 0,!0)])}const Pr=O(Lr,[["render",Nr],["__scopeId","data-v-2e881efe"]]),Ar=O(i.defineComponent({__name:"BreadcrumbLink",props:{href:{},to:{},as:{}},setup(n){const e=n,t=i.computed(()=>e.as?e.as:e.to?"router-link":(e.href,"a")),o=i.computed(()=>e.to?{to:e.to}:e.href?{href:e.href}:{});return(a,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.value),i.mergeProps(o.value,{class:"ui-breadcrumb__link"}),{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default",{},void 0,!0)]),_:3},16))}}),[["__scopeId","data-v-61a847e7"]]),Rr={},Or={role:"link","aria-disabled":"true","aria-current":"page",class:"ui-breadcrumb__page"};function Fr(n,e){return i.openBlock(),i.createElementBlock("span",Or,[i.renderSlot(n.$slots,"default",{},void 0,!0)])}const Wr=O(Rr,[["render",Fr],["__scopeId","data-v-933b4a45"]]),Hr={role:"presentation","aria-hidden":"true",class:"ui-breadcrumb__separator"},jr=O(i.defineComponent({__name:"BreadcrumbSeparator",setup(n){const e=i.inject(Uo),t=i.useSlots();function o(){if(t.default)return t.default()[0];if(!e)return"/";const a=e.separator;if(typeof a=="string")return a;if(typeof a=="function"){const s=a();if(i.isVNode(s))return s;if(Array.isArray(s)&&s.length>0)return s[0]}return i.h(a)}return(a,s)=>(i.openBlock(),i.createElementBlock("li",Hr,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(()=>o())))]))}}),[["__scopeId","data-v-489380bd"]]),Yr=["id","aria-expanded","aria-controls"],Ur=["id","aria-labelledby"],Xr={key:0,class:"ui-dropdown__mobile-header"},Kr={class:"ui-dropdown__mobile-title"},Gt=Symbol("dropdown"),Xo=O(i.defineComponent({__name:"Dropdown",props:{placement:{default:"bottom-start"},offset:{default:4},disabled:{type:Boolean,default:!1},menuWidth:{default:"auto"}},emits:["open","close"],setup(n,{emit:e}){const t=n,o=e,a=i.inject(Gt,null),s=!!a,l=a?a.depth+1:0,r=i.ref(!1),c=i.ref(null),d=i.ref(null),u=i.ref([]),h=i.ref(new Map),f=i.ref(-1),m=i.ref(null),p=ye("dropdown-trigger"),g=ye("dropdown-menu"),b=ye("submenu"),_=i.ref(!1),k=i.ref([]),B=i.ref(new Map);let C=null;const y=i.reactive({active:!1,points:[],submenuId:null});function x(){_.value=window.matchMedia("(max-width: 768px)").matches||"ontouchstart"in window||navigator.maxTouchPoints>0}i.onMounted(()=>{x(),window.addEventListener("resize",x),s&&a&&a.registerSubmenu({id:b,triggerEl:c.value,open:A,close:R})}),i.onUnmounted(()=>{window.removeEventListener("resize",x),s&&a&&a.unregisterSubmenu(b)});const S=i.computed(()=>s&&t.placement==="bottom-start"?"right-start":t.placement);function w(V){u.value.includes(V)||u.value.push(V)}function M(V){const Z=u.value.indexOf(V);Z>-1&&u.value.splice(Z,1)}function N(V){h.value.set(V.id,V)}function T(V){h.value.delete(V)}function $(V){if(m.value&&m.value!==V){const Z=h.value.get(m.value);Z==null||Z.close()}m.value=V}function K(V,Z){B.value.set(V,Z),k.value.push(V)}function P(){const V=k.value.pop();if(V){B.value.delete(V);const Z=h.value.get(V);Z==null||Z.close()}}i.provide(Gt,{close:R,closeAll:q,cancelClose:ge,registerItem:w,unregisterItem:M,registerSubmenu:N,unregisterSubmenu:T,isSubmenu:s,depth:l,isMobile:_,openSubmenuId:m,setOpenSubmenu:$,safeTriangle:y,menuStack:k,pushMenu:K,popMenu:P});function A(){t.disabled||r.value||(r.value=!0,o("open"),s&&a&&a.setOpenSubmenu(b),i.nextTick(()=>{ne(),requestAnimationFrame(()=>{fe()})}))}function R(){r.value&&(h.value.forEach(V=>V.close()),m.value=null,r.value=!1,f.value=-1,o("close"),s||(k.value=[],B.value.clear()),s&&a&&a.setOpenSubmenu(null),i.nextTick(()=>{var V;(V=c.value)==null||V.focus()}))}function q(){R(),a==null||a.closeAll()}function Q(){r.value?R():A()}function ee(){C&&clearTimeout(C),C=setTimeout(()=>{R()},150)}function ge(){C&&(clearTimeout(C),C=null)}function fe(){if(!d.value)return;const V=d.value.querySelector(':scope > .ui-dropdown-item:not([disabled]):not([aria-disabled="true"]), :scope > .ui-dropdown > .ui-dropdown__trigger .ui-dropdown-item:not([disabled]):not([aria-disabled="true"])');V&&(f.value=0,V.focus())}function be(){return d.value?Array.from(d.value.querySelectorAll(':scope > .ui-dropdown-item:not([disabled]):not([aria-disabled="true"]), :scope > .ui-dropdown > .ui-dropdown__trigger .ui-dropdown-item:not([disabled]):not([aria-disabled="true"])')):[]}function xe(V){const Z=be();Z.length!==0&&(V<0&&(V=Z.length-1),V>=Z.length&&(V=0),f.value=V,Z[V].focus())}function F(V){s&&!_.value||Q()}function v(){var V;!s||_.value||(ge(),(V=a==null?void 0:a.cancelClose)==null||V.call(a),A())}function D(V){if(!(!s||_.value)){if(d.value){const Z=d.value.getBoundingClientRect();V.clientX,V.clientY,y.active=!0,y.submenuId=b,y.points=[{x:V.clientX,y:V.clientY},{x:Z.left,y:Z.top},{x:Z.left,y:Z.bottom}]}ee()}}function G(){var V;ge(),(V=a==null?void 0:a.cancelClose)==null||V.call(a),y.active=!1}function ce(){s&&ee()}function ze(V){if(s){switch(V.key){case"ArrowRight":case"Enter":V.preventDefault(),V.stopPropagation(),A();break}return}switch(V.key){case"Enter":case" ":case"ArrowDown":V.preventDefault(),A();break;case"ArrowUp":V.preventDefault(),A(),i.nextTick(()=>{const Z=be();Z.length>0&&(f.value=Z.length-1,Z[Z.length-1].focus())});break}}function L(V){const Z=be(),Te=Z.findIndex(me=>me===document.activeElement);switch(V.key){case"ArrowDown":V.preventDefault(),xe(Te+1);break;case"ArrowUp":V.preventDefault(),xe(Te-1);break;case"ArrowLeft":s&&(V.preventDefault(),V.stopPropagation(),R());break;case"Home":V.preventDefault(),xe(0);break;case"End":V.preventDefault(),xe(Z.length-1);break;case"Escape":V.preventDefault(),V.stopPropagation(),R();break;case"Tab":q();break}}const j=i.computed(()=>{const V={};return t.menuWidth==="trigger"&&c.value?V.minWidth=`${c.value.offsetWidth}px`:typeof t.menuWidth=="number"&&(V.width=`${t.menuWidth}px`),V}),X=i.ref({top:"0",left:"0"});function ne(){if(!c.value||!d.value)return;const V=c.value.getBoundingClientRect(),Z=d.value.getBoundingClientRect(),Te={width:window.innerWidth,height:window.innerHeight};let me,we,le=S.value;if(le.startsWith("right")||le.startsWith("left")){const Ne=Te.width-V.right,De=V.left;(le.startsWith("right")&&Ne<Z.width&&De>Ne||le.startsWith("left")&&De<Z.width&&Ne>De)&&(le=le.startsWith("right")?le.replace("right","left"):le.replace("left","right")),le.startsWith("right")?we=V.right+t.offset:we=V.left-Z.width-t.offset,le.endsWith("start")?me=V.top:me=V.bottom-Z.height}else{const Ne=Te.height-V.bottom,De=V.top;(le.startsWith("bottom")&&Ne<Z.height&&De>Ne||le.startsWith("top")&&De<Z.height&&Ne>De)&&(le=le.startsWith("bottom")?le.replace("bottom","top"):le.replace("top","bottom")),le.startsWith("bottom")?me=V.bottom+t.offset:me=V.top-Z.height-t.offset,le.endsWith("start")?we=V.left:we=V.right-Z.width}we=Math.max(8,Math.min(we,Te.width-Z.width-8)),me=Math.max(8,Math.min(me,Te.height-Z.height-8)),X.value={top:`${me}px`,left:`${we}px`}}function he(V,Z,Te){if(Te.length<3)return!1;const[me,we,le]=Te,Ne=.5*(-we.y*le.x+me.y*(-we.x+le.x)+me.x*(we.y-le.y)+we.x*le.y),De=Ne<0?-1:1,tt=(me.y*le.x-me.x*le.y+(le.y-me.y)*V+(me.x-le.x)*Z)*De,I=(me.x*we.y-me.y*we.x+(me.y-we.y)*V+(we.x-me.x)*Z)*De;return tt>0&&I>0&&tt+I<2*Ne*De}function Ae(V){if(!y.active||!y.points.length)return;he(V.clientX,V.clientY,y.points)?ge():y.active=!1}function Re(V){var me,we;const Z=V.target;let Te=!1;h.value.forEach(le=>{const Ne=document.getElementById(`dropdown-menu-${le.id.split("-").pop()}`);Ne!=null&&Ne.contains(Z)&&(Te=!0)}),!((me=c.value)!=null&&me.contains(Z))&&!((we=d.value)!=null&&we.contains(Z))&&!Te&&q()}i.watch(r,V=>{V?(document.addEventListener("mousedown",Re),document.addEventListener("mousemove",Ae),window.addEventListener("resize",ne),window.addEventListener("scroll",ne,!0)):(document.removeEventListener("mousedown",Re),document.removeEventListener("mousemove",Ae),window.removeEventListener("resize",ne),window.removeEventListener("scroll",ne,!0),y.active=!1)}),i.onUnmounted(()=>{document.removeEventListener("mousedown",Re),document.removeEventListener("mousemove",Ae),window.removeEventListener("resize",ne),window.removeEventListener("scroll",ne,!0),C&&clearTimeout(C)});const Ye=i.computed(()=>{if(k.value.length===0)return null;const V=k.value[k.value.length-1];return B.value.get(V)||null});return i.computed(()=>_.value&&!s&&k.value.length>0),(V,Z)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-dropdown",{"ui-dropdown--submenu":s}])},[i.createElementVNode("div",{ref_key:"triggerRef",ref:c,class:"ui-dropdown__trigger",id:i.unref(p),"aria-haspopup":!0,"aria-expanded":r.value,"aria-controls":i.unref(g),onClick:F,onMouseenter:v,onMouseleave:D,onKeydown:ze},[i.renderSlot(V.$slots,"trigger",{open:r.value,toggle:Q},void 0,!0)],40,Yr),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:s?"ui-dropdown-sub":"ui-dropdown"},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"menuRef",ref:d,class:i.normalizeClass(["ui-dropdown__menu",{"ui-dropdown__menu--submenu":s,"ui-dropdown__menu--mobile":_.value&&!s}]),id:i.unref(g),role:"menu","aria-labelledby":i.unref(p),style:i.normalizeStyle(_.value&&!s?{}:[j.value,X.value]),onMouseenter:G,onMouseleave:ce,onKeydown:L},[_.value&&!s&&k.value.length>0?(i.openBlock(),i.createElementBlock("div",Xr,[i.createElementVNode("button",{type:"button",class:"ui-dropdown__back-btn",onClick:P},[...Z[0]||(Z[0]=[i.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[i.createElementVNode("path",{d:"M15 18l-6-6 6-6"})],-1),i.createTextVNode(" Back ",-1)])]),i.createElementVNode("span",Kr,i.toDisplayString(Ye.value),1)])):i.createCommentVNode("",!0),i.renderSlot(V.$slots,"default",{},void 0,!0)],46,Ur)):i.createCommentVNode("",!0)]),_:3},8,["name"]),i.createVNode(i.Transition,{name:"ui-dropdown-overlay"},{default:i.withCtx(()=>[r.value&&_.value&&!s?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-dropdown__overlay",onClick:q})):i.createCommentVNode("",!0)]),_:1})]))],2))}}),[["__scopeId","data-v-63a8a408"]]),qr={key:0,class:"ui-dropdown-item__icon"},Gr={class:"ui-dropdown-item__content"},Jr={key:1,class:"ui-dropdown-item__shortcut"},Zr={key:2,class:"ui-dropdown-item__chevron"},Ko=O(i.defineComponent({__name:"DropdownItem",props:{to:{},href:{},disabled:{type:Boolean,default:!1},danger:{type:Boolean,default:!1},icon:{},shortcut:{},preventClose:{type:Boolean,default:!1},chevron:{type:Boolean,default:!1}},emits:["click"],setup(n,{emit:e}){const t=n,o=e,a=i.inject(Gt),s=i.ref(null),l=i.computed(()=>t.to?"router-link":t.href?"a":"button"),r=i.computed(()=>{const u={class:["ui-dropdown-item",{"ui-dropdown-item--disabled":t.disabled,"ui-dropdown-item--danger":t.danger}],role:"menuitem",tabindex:t.disabled?-1:0};return t.disabled&&(u["aria-disabled"]="true"),l.value==="router-link"?u.to=t.to:l.value==="a"?(u.href=t.href,u.target="_blank",u.rel="noopener noreferrer"):(u.type="button",u.disabled=t.disabled),u});function c(u){if(t.disabled){u.preventDefault();return}o("click",u),t.preventClose||a==null||a.close()}function d(u){t.disabled||(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),o("click",u),t.preventClose||a==null||a.close())}return i.onMounted(()=>{s.value&&(a==null||a.registerItem(s.value))}),i.onUnmounted(()=>{s.value&&(a==null||a.unregisterItem(s.value))}),(u,h)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l.value),i.mergeProps({ref_key:"itemRef",ref:s},r.value,{onClick:c,onKeydown:d}),{default:i.withCtx(()=>[n.icon?(i.openBlock(),i.createElementBlock("span",qr,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.icon)))])):i.createCommentVNode("",!0),i.createElementVNode("span",Gr,[i.renderSlot(u.$slots,"default",{},void 0,!0)]),n.shortcut?(i.openBlock(),i.createElementBlock("span",Jr,i.toDisplayString(n.shortcut),1)):i.createCommentVNode("",!0),n.chevron?(i.openBlock(),i.createElementBlock("span",Zr,[...h[0]||(h[0]=[i.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[i.createElementVNode("path",{d:"M9 18l6-6-6-6"})],-1)])])):i.createCommentVNode("",!0)]),_:3},16))}}),[["__scopeId","data-v-110fb457"]]),Qr={},ec={class:"ui-dropdown-separator",role:"separator"};function tc(n,e){return i.openBlock(),i.createElementBlock("div",ec)}const nc=O(Qr,[["render",tc],["__scopeId","data-v-5ed4af21"]]),ic={class:"ui-dropdown-sub"},vi=Symbol("dropdownSub"),oc=O(i.defineComponent({__name:"DropdownSub",setup(n,{expose:e}){i.inject(Gt);const t=i.ref(!1),o=i.ref(null),a=i.ref(null);let s=null;function l(){s&&(clearTimeout(s),s=null),t.value=!0}function r(){t.value=!1}function c(){s&&clearTimeout(s),s=setTimeout(()=>{r()},150)}function d(){s&&(clearTimeout(s),s=null)}function u(f){(f.key==="ArrowRight"||f.key==="Enter")&&(f.preventDefault(),f.stopPropagation(),l())}function h(f){var m;f.key==="ArrowLeft"&&(f.preventDefault(),f.stopPropagation(),r(),(m=o.value)==null||m.focus())}return i.provide(vi,{isOpen:t,triggerRef:o,open:l,close:r,onTriggerKeydown:u,scheduleClose:c,cancelClose:d}),e({isOpen:t,triggerRef:o,contentRef:a,open:l,close:r,scheduleClose:c,cancelClose:d,onContentKeydown:h}),(f,m)=>(i.openBlock(),i.createElementBlock("div",ic,[i.renderSlot(f.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-4078e150"]]),ac=["aria-expanded","aria-disabled","tabindex","disabled"],sc={key:0,class:"ui-dropdown-sub-trigger__icon"},lc={class:"ui-dropdown-sub-trigger__content"},rc=O(i.defineComponent({__name:"DropdownSubTrigger",props:{disabled:{type:Boolean,default:!1},icon:{}},setup(n){const e=n,t=i.inject(Gt),o=i.inject(vi),a=i.ref(null);function s(){e.disabled||(o==null||o.cancelClose(),o==null||o.open())}function l(){e.disabled||o==null||o.scheduleClose()}function r(c){e.disabled||o==null||o.onTriggerKeydown(c)}return i.onMounted(()=>{a.value&&(t==null||t.registerItem(a.value),o&&(o.triggerRef.value=a.value))}),i.onUnmounted(()=>{a.value&&(t==null||t.unregisterItem(a.value))}),(c,d)=>{var u;return i.openBlock(),i.createElementBlock("button",{ref_key:"triggerRef",ref:a,type:"button",class:i.normalizeClass(["ui-dropdown-sub-trigger",{"ui-dropdown-sub-trigger--disabled":n.disabled}]),role:"menuitem","aria-haspopup":!0,"aria-expanded":(u=i.unref(o))==null?void 0:u.isOpen.value,"aria-disabled":n.disabled||void 0,tabindex:n.disabled?-1:0,disabled:n.disabled,onMouseenter:s,onMouseleave:l,onKeydown:r},[n.icon?(i.openBlock(),i.createElementBlock("span",sc,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.icon)))])):i.createCommentVNode("",!0),i.createElementVNode("span",lc,[i.renderSlot(c.$slots,"default",{},void 0,!0)]),d[0]||(d[0]=i.createElementVNode("span",{class:"ui-dropdown-sub-trigger__chevron"},[i.createElementVNode("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[i.createElementVNode("path",{d:"M9 18l6-6-6-6"})])],-1))],42,ac)}}}),[["__scopeId","data-v-3588cf5f"]]),cc=O(i.defineComponent({__name:"DropdownSubContent",setup(n){const e=i.inject(vi),t=i.ref(null),o=i.ref({top:"0",left:"0"});function a(){e==null||e.cancelClose()}function s(){e==null||e.scheduleClose()}function l(){return t.value?Array.from(t.value.querySelectorAll('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])')).filter(u=>u.getAttribute("aria-disabled")!=="true"):[]}function r(u){const h=l();h.length!==0&&(u<0&&(u=h.length-1),u>=h.length&&(u=0),h[u].focus())}function c(u){var m;const h=l(),f=h.findIndex(p=>p===document.activeElement);switch(u.key){case"ArrowDown":u.preventDefault(),u.stopPropagation(),r(f+1);break;case"ArrowUp":u.preventDefault(),u.stopPropagation(),r(f-1);break;case"Home":u.preventDefault(),u.stopPropagation(),r(0);break;case"End":u.preventDefault(),u.stopPropagation(),r(h.length-1);break;case"ArrowLeft":case"Escape":u.preventDefault(),u.stopPropagation(),e==null||e.close(),(m=e==null?void 0:e.triggerRef.value)==null||m.focus();break}}function d(){const u=e==null?void 0:e.triggerRef.value,h=t.value;if(!u||!h)return;const f=u.getBoundingClientRect(),m=h.getBoundingClientRect(),p={width:window.innerWidth,height:window.innerHeight},g=4;let b=f.top,_=f.right+g;_+m.width>p.width-8&&(_=f.left-m.width-g),b+m.height>p.height-8&&(b=p.height-m.height-8),b=Math.max(8,b),_=Math.max(8,Math.min(_,p.width-m.width-8)),o.value={top:`${b}px`,left:`${_}px`}}return i.watch(()=>e==null?void 0:e.isOpen.value,async u=>{var h;if(u){await i.nextTick(),d();const f=(h=t.value)==null?void 0:h.querySelector('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"])');f==null||f.focus()}}),i.onMounted(()=>{window.addEventListener("resize",d),window.addEventListener("scroll",d,!0)}),i.onUnmounted(()=>{window.removeEventListener("resize",d),window.removeEventListener("scroll",d,!0)}),(u,h)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ui-dropdown-sub"},{default:i.withCtx(()=>{var f;return[(f=i.unref(e))!=null&&f.isOpen.value?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"menuRef",ref:t,class:"ui-dropdown-sub-content",role:"menu",style:i.normalizeStyle(o.value),onMouseenter:a,onMouseleave:s,onKeydown:c},[i.renderSlot(u.$slots,"default",{},void 0,!0)],36)):i.createCommentVNode("",!0)]}),_:3})]))}}),[["__scopeId","data-v-7d7ddc2e"]]),dc={class:"ui-breadcrumb__item"},uc={key:1,class:"ui-breadcrumb__ellipsis-static","aria-hidden":"true"},hc=O(i.defineComponent({__name:"BreadcrumbEllipsis",props:{items:{default:()=>[]}},setup(n){return(e,t)=>(i.openBlock(),i.createElementBlock("li",dc,[n.items.length>0?(i.openBlock(),i.createBlock(i.unref(Xo),{key:0,placement:"bottom-start"},{trigger:i.withCtx(()=>[...t[0]||(t[0]=[i.createElementVNode("button",{type:"button",class:"ui-breadcrumb__ellipsis","aria-label":"Show more breadcrumbs"},[i.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"},[i.createElementVNode("circle",{cx:"12",cy:"12",r:"1.5"}),i.createElementVNode("circle",{cx:"6",cy:"12",r:"1.5"}),i.createElementVNode("circle",{cx:"18",cy:"12",r:"1.5"})])],-1)])]),default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.items,(o,a)=>(i.openBlock(),i.createBlock(i.unref(Ko),{key:a,href:o.href,to:o.to},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.label),1)]),_:2},1032,["href","to"]))),128))]),_:1})):(i.openBlock(),i.createElementBlock("span",uc,[i.renderSlot(e.$slots,"default",{},()=>[t[1]||(t[1]=i.createTextVNode("…",-1))],!0)]))]))}}),[["__scopeId","data-v-c4a5d946"]]),fc=["aria-label"],mc={class:"ui-spinner__sr-only"},In=O(i.defineComponent({__name:"Spinner",props:{size:{default:"md"},speed:{default:.9},label:{default:"Loading"}},setup(n){const e=n,t={xs:"var(--spinner-xs)",sm:"var(--spinner-sm)",md:"var(--spinner-md)",lg:"var(--spinner-lg)",xl:"var(--spinner-xl)"},o=i.computed(()=>t[e.size]??e.size),a=i.computed(()=>`${e.speed}s`);return(s,l)=>(i.openBlock(),i.createElementBlock("div",{class:"ui-spinner",role:"status","aria-label":n.label,style:i.normalizeStyle({"--spinner-size":o.value,"--spinner-speed":a.value})},[l[0]||(l[0]=i.createStaticVNode('<div class="ui-spinner__dot" data-v-9f42aed4></div><div class="ui-spinner__dot" data-v-9f42aed4></div><div class="ui-spinner__dot" data-v-9f42aed4></div><div class="ui-spinner__dot" data-v-9f42aed4></div><div class="ui-spinner__dot" data-v-9f42aed4></div><div class="ui-spinner__dot" data-v-9f42aed4></div><div class="ui-spinner__dot" data-v-9f42aed4></div><div class="ui-spinner__dot" data-v-9f42aed4></div>',8)),i.createElementVNode("span",mc,i.toDisplayString(n.label),1)],12,fc))}}),[["__scopeId","data-v-9f42aed4"]]),je=O(i.defineComponent({__name:"Icon",props:{icon:{},size:{default:"md"},strokeWidth:{default:1.5},label:{}},setup(n){const e=n,t={xs:"var(--icon-xs)",sm:"var(--icon-sm)",md:"var(--icon-md)",lg:"var(--icon-lg)",xl:"var(--icon-xl)"},o=i.computed(()=>t[e.size]??e.size),a=i.computed(()=>!e.label),s=i.computed(()=>Array.isArray(e.icon)&&e.icon.length>0&&Array.isArray(e.icon[0]));function l(){const c=e.icon.map(([d,u])=>e.strokeWidth&&u["stroke-width"]?i.h(d,{...u,"stroke-width":e.strokeWidth}):i.h(d,u));return i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",class:"ui-icon",style:{"--icon-size":o.value},"aria-label":e.label,"aria-hidden":a.value,role:"img"},c)}return(r,c)=>s.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(l),{key:1})):(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.icon),{key:0,class:"ui-icon",style:i.normalizeStyle({"--icon-size":o.value}),"stroke-width":n.strokeWidth,"aria-label":n.label,"aria-hidden":a.value,role:"img"},null,8,["style","stroke-width","aria-label","aria-hidden"]))}}),[["__scopeId","data-v-9f24c7a4"]]),pc={key:0,class:"ui-button__icon ui-button__icon--left","aria-hidden":"true"},gc={key:1,class:"ui-button__content"},bc={key:2,class:"ui-button__icon ui-button__icon--right","aria-hidden":"true"},_c={key:0,class:"ui-button__loader","aria-hidden":"true"},Je=O(i.defineComponent({__name:"Button",props:{variant:{default:"primary"},size:{default:"md"},as:{default:"button"},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},iconLeft:{},iconRight:{},block:{type:Boolean,default:!1},type:{default:"button"}},emits:["click"],setup(n,{emit:e}){const t=n,o=e,a=i.useSlots(),s=i.computed(()=>t.disabled||t.loading),l=i.computed(()=>!a.default&&!!(t.iconLeft||t.iconRight));function r(u){if(s.value){u.preventDefault();return}o("click",u)}const c={xs:"var(--text-xs)",sm:"var(--text-sm)",md:"var(--text-md)",lg:"var(--text-lg)",xl:"var(--text-xl)"},d=i.computed(()=>c[t.size]);return(u,h)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{type:n.as==="button"?n.type:void 0,disabled:n.as==="button"?s.value:void 0,"aria-disabled":s.value,"aria-busy":n.loading,class:i.normalizeClass(["ui-button",[`ui-button--${n.variant}`,`ui-button--${n.size}`,{"ui-button--loading":n.loading,"ui-button--disabled":s.value,"ui-button--block":n.block,"ui-button--icon-only":l.value}]]),onClick:r},{default:i.withCtx(()=>[h[0]||(h[0]=i.createElementVNode("span",{class:"ui-button__highlight","aria-hidden":"true"},null,-1)),i.createElementVNode("span",{class:i.normalizeClass(["ui-button__inner",{"ui-button__inner--hidden":n.loading}])},[n.iconLeft?(i.openBlock(),i.createElementBlock("span",pc,[i.createVNode(je,{icon:n.iconLeft,size:d.value},null,8,["icon","size"])])):i.createCommentVNode("",!0),u.$slots.default?(i.openBlock(),i.createElementBlock("span",gc,[i.renderSlot(u.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0),n.iconRight?(i.openBlock(),i.createElementBlock("span",bc,[i.createVNode(je,{icon:n.iconRight,size:d.value},null,8,["icon","size"])])):i.createCommentVNode("",!0)],2),n.loading?(i.openBlock(),i.createElementBlock("span",_c,[i.createVNode(In,{size:d.value,speed:.8,label:"Loading"},null,8,["size"])])):i.createCommentVNode("",!0)]),_:3},8,["type","disabled","aria-disabled","aria-busy","class"]))}}),[["__scopeId","data-v-7389849f"]]),yc=["role"],kc={key:0,class:"ui-callout__icon"},xc={key:0,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},wc={key:1,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Cc={key:2,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Bc={key:3,width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},Sc={class:"ui-callout__content"},Ec={key:0,class:"ui-callout__title"},Mc={key:1,class:"ui-callout__body"},vc={key:1,class:"ui-callout__actions"},Vc=O(i.defineComponent({__name:"Callout",props:{variant:{default:"info"},title:{},accent:{type:Boolean,default:!1},dismissible:{type:Boolean,default:!1},hideIcon:{type:Boolean,default:!1}},emits:["close"],setup(n,{emit:e}){const t=n,o=e,a=i.useSlots(),s=i.computed(()=>!!t.title||!!a.title),l=i.computed(()=>t.variant==="error"?"alert":"status"),r=i.computed(()=>["ui-callout",`ui-callout--${t.variant}`,{"ui-callout--accent":t.accent}]);return(c,d)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(r.value),role:l.value},[n.hideIcon?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",kc,[i.renderSlot(c.$slots,"icon",{},()=>[n.variant==="info"||n.variant==="neutral"?(i.openBlock(),i.createElementBlock("svg",xc,[...d[1]||(d[1]=[i.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),i.createElementVNode("path",{d:"M12 16v-4"},null,-1),i.createElementVNode("path",{d:"M12 8h.01"},null,-1)])])):n.variant==="success"?(i.openBlock(),i.createElementBlock("svg",wc,[...d[2]||(d[2]=[i.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),i.createElementVNode("path",{d:"M9 12l2 2 4-4"},null,-1)])])):n.variant==="warning"?(i.openBlock(),i.createElementBlock("svg",Cc,[...d[3]||(d[3]=[i.createElementVNode("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"},null,-1),i.createElementVNode("path",{d:"M12 9v4"},null,-1),i.createElementVNode("path",{d:"M12 17h.01"},null,-1)])])):n.variant==="error"?(i.openBlock(),i.createElementBlock("svg",Bc,[...d[4]||(d[4]=[i.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),i.createElementVNode("path",{d:"M15 9l-6 6"},null,-1),i.createElementVNode("path",{d:"M9 9l6 6"},null,-1)])])):i.createCommentVNode("",!0)],!0)])),i.createElementVNode("div",Sc,[s.value?(i.openBlock(),i.createElementBlock("div",Ec,[i.renderSlot(c.$slots,"title",{},()=>[i.createTextVNode(i.toDisplayString(n.title),1)],!0)])):i.createCommentVNode("",!0),c.$slots.default?(i.openBlock(),i.createElementBlock("div",Mc,[i.renderSlot(c.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),c.$slots.action||n.dismissible?(i.openBlock(),i.createElementBlock("div",vc,[i.renderSlot(c.$slots,"action",{},void 0,!0),n.dismissible?(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",class:"ui-callout__close","aria-label":"Dismiss",onClick:d[0]||(d[0]=u=>o("close"))},[...d[5]||(d[5]=[i.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[i.createElementVNode("path",{d:"M18 6L6 18"}),i.createElementVNode("path",{d:"M6 6l12 12"})],-1)])])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],10,yc))}}),[["__scopeId","data-v-92cdd5ed"]]),Dc={key:0,class:"ui-card__skeleton","aria-hidden":"true"},$c=O(i.defineComponent({__name:"Card",props:{variant:{default:"elevated"},as:{default:"div"},interactive:{type:Boolean,default:!1},horizontal:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},padding:{default:"md"}},emits:["click"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(!1),s=i.ref(!1);function l(){a.value=!0}function r(){s.value=!0}i.provide("card",{variant:i.toRef(t,"variant"),horizontal:i.toRef(t,"horizontal"),interactive:i.toRef(t,"interactive"),loading:i.toRef(t,"loading"),padding:i.toRef(t,"padding"),hasHeader:a,hasTopImage:s,registerHeader:l,registerTopImage:r});function c(h){t.disabled||t.loading||t.interactive&&o("click",h)}function d(h){(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),c(h))}const u=i.computed(()=>t.interactive&&!t.disabled&&!t.loading);return(h,f)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{class:i.normalizeClass(["ui-card",[`ui-card--${n.variant}`,`ui-card--padding-${n.padding}`,{"ui-card--interactive":n.interactive,"ui-card--horizontal":n.horizontal,"ui-card--disabled":n.disabled,"ui-card--loading":n.loading}]]),tabindex:u.value?0:void 0,role:u.value?"button":void 0,"aria-disabled":n.disabled||void 0,"aria-busy":n.loading||void 0,onClick:c,onKeydown:d},{default:i.withCtx(()=>[i.renderSlot(h.$slots,"default",{},void 0,!0),n.loading?(i.openBlock(),i.createElementBlock("div",Dc)):i.createCommentVNode("",!0)]),_:3},40,["class","tabindex","role","aria-disabled","aria-busy"]))}}),[["__scopeId","data-v-6a2baf44"]]),Tc={class:"ui-card__header-content"},Ic={key:0,class:"ui-card__title"},Lc={key:0,class:"ui-card__subtitle"},zc={key:0,class:"ui-card__header-actions"},Nc=O(i.defineComponent({__name:"CardHeader",props:{title:{},subtitle:{},align:{default:"start"}},setup(n){const e=i.useSlots(),t=i.inject("card",null);i.onMounted(()=>{t==null||t.registerHeader()}),e.actions;const o=i.computed(()=>{var a;return((a=t==null?void 0:t.padding)==null?void 0:a.value)??"md"});return(a,s)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-card__header",[`ui-card__header--${n.align}`,`ui-card__header--padding-${o.value}`]])},[i.createElementVNode("div",Tc,[i.renderSlot(a.$slots,"title",{},()=>[n.title?(i.openBlock(),i.createElementBlock("h3",Ic,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0)],!0),i.renderSlot(a.$slots,"subtitle",{},()=>[n.subtitle?(i.openBlock(),i.createElementBlock("p",Lc,i.toDisplayString(n.subtitle),1)):i.createCommentVNode("",!0)],!0),i.renderSlot(a.$slots,"default",{},void 0,!0)]),a.$slots.actions?(i.openBlock(),i.createElementBlock("div",zc,[i.renderSlot(a.$slots,"actions",{},void 0,!0)])):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-f785719b"]]),Pc=O(i.defineComponent({__name:"CardContent",props:{flush:{type:Boolean,default:!1}},setup(n){const e=i.inject("card",null),t=i.computed(()=>{var a;return((a=e==null?void 0:e.hasHeader)==null?void 0:a.value)??!1}),o=i.computed(()=>{var a;return((a=e==null?void 0:e.padding)==null?void 0:a.value)??"md"});return(a,s)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-card__content",[`ui-card__content--padding-${o.value}`,{"ui-card__content--flush":n.flush,"ui-card__content--no-top-padding":t.value}]])},[i.renderSlot(a.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-11087f9c"]]),Ac=O(i.defineComponent({__name:"CardFooter",props:{align:{default:"end"},borderless:{type:Boolean,default:!1}},setup(n){const e=i.inject("card",null),t=i.computed(()=>{var o;return((o=e==null?void 0:e.padding)==null?void 0:o.value)??"md"});return(o,a)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-card__footer",[`ui-card__footer--${n.align}`,`ui-card__footer--padding-${t.value}`,{"ui-card__footer--borderless":n.borderless}]])},[i.renderSlot(o.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-e5f0a860"]]),Rc=["src","alt","loading"],Oc=O(i.defineComponent({__name:"CardImage",props:{src:{},alt:{},aspectRatio:{default:"auto"},position:{default:"top"},fit:{default:"cover"},loading:{default:"lazy"}},setup(n){const e=n,t=i.inject("card",null);i.onMounted(()=>{e.position==="top"&&(t==null||t.registerTopImage())});const o=i.computed(()=>({"16:9":"16 / 9","4:3":"4 / 3","3:2":"3 / 2","1:1":"1 / 1",auto:"auto"})[e.aspectRatio]);return(a,s)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-card__image",[`ui-card__image--${n.position}`]]),style:i.normalizeStyle(n.aspectRatio!=="auto"?{"--aspect-ratio":o.value}:void 0)},[i.createElementVNode("img",{src:n.src,alt:n.alt,loading:n.loading,class:i.normalizeClass(["ui-card__image-img",[`ui-card__image-img--${n.fit}`]])},null,10,Rc)],6))}}),[["__scopeId","data-v-14ed4ba2"]]),Fc=["id","checked","disabled","name","value"],Wc={class:"ui-checkbox__box","aria-hidden":"true"},Hc={key:0,class:"ui-checkbox__icon ui-checkbox__check",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},jc={key:1,class:"ui-checkbox__icon ui-checkbox__indeterminate",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},Yc={key:0,class:"ui-checkbox__content"},Uc={key:0,class:"ui-checkbox__label"},Xc={key:1,class:"ui-checkbox__description"},Kc=24,qc=10,Vi=O(i.defineComponent({__name:"Checkbox",props:{modelValue:{type:Boolean,default:!1},indeterminate:{type:Boolean,default:!1},size:{default:"md"},disabled:{type:Boolean,default:!1},label:{},description:{},name:{},value:{},id:{}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(null),s=ye("checkbox"),l=i.computed(()=>t.id||s);i.watch(()=>t.indeterminate,c=>{a.value&&(a.value.indeterminate=c)}),i.onMounted(()=>{a.value&&t.indeterminate&&(a.value.indeterminate=!0)});function r(c){const d=c.target;o("update:modelValue",d.checked),o("change",d.checked)}return(c,d)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ui-checkbox",[`ui-checkbox--${n.size}`,{"ui-checkbox--disabled":n.disabled,"ui-checkbox--checked":n.modelValue,"ui-checkbox--indeterminate":n.indeterminate}]])},[i.createElementVNode("input",{ref_key:"inputRef",ref:a,id:l.value,type:"checkbox",checked:n.modelValue,disabled:n.disabled,name:n.name,value:n.value,class:"ui-checkbox__input",onChange:r},null,40,Fc),i.createElementVNode("span",Wc,[n.modelValue&&!n.indeterminate?(i.openBlock(),i.createElementBlock("svg",Hc,[i.createElementVNode("path",{d:"M3.5 8.5L6.5 11.5L12.5 4.5","stroke-dasharray":Kc,"stroke-dashoffset":0})])):n.indeterminate?(i.openBlock(),i.createElementBlock("svg",jc,[i.createElementVNode("path",{d:"M4 8H12","stroke-dasharray":qc,"stroke-dashoffset":0})])):i.createCommentVNode("",!0)]),n.label||n.description?(i.openBlock(),i.createElementBlock("span",Yc,[n.label?(i.openBlock(),i.createElementBlock("span",Uc,i.toDisplayString(n.label),1)):i.createCommentVNode("",!0),n.description?(i.openBlock(),i.createElementBlock("span",Xc,i.toDisplayString(n.description),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-08930332"]]),Gc={class:"ui-popover"},Jc=["id","aria-expanded","aria-controls"],Zc=["id","aria-labelledby"],qo='a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Ln=O(i.defineComponent({__name:"Popover",props:{placement:{default:"bottom"},offset:{default:8},arrow:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},width:{default:"auto"},closeOnEscape:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!1},trapFocus:{type:Boolean,default:!0}},emits:["open","close"],setup(n,{expose:e,emit:t}){const o=n,a=t,s=i.ref(!1),l=i.ref(null),r=i.ref(null),c=ye("popover-trigger"),d=ye("popover-content"),u=i.computed(()=>o.lockScroll&&s.value);Tn(u);function h(w){if(!o.trapFocus||!r.value||w.key!=="Tab")return;const M=r.value.querySelectorAll(qo);if(M.length===0)return;const N=M[0],T=M[M.length-1];w.shiftKey?document.activeElement===N&&(w.preventDefault(),T.focus()):document.activeElement===T&&(w.preventDefault(),N.focus())}function f(){if(!o.trapFocus||!r.value)return;const w=r.value.querySelector(qo);w==null||w.focus()}const m=i.ref({}),p=i.ref({}),g=i.ref(o.placement);function b(){o.disabled||s.value||(s.value=!0,a("open"),i.nextTick(()=>{B(),o.trapFocus&&requestAnimationFrame(()=>{f(),window.addEventListener("keydown",h)})}))}function _(){s.value&&(s.value=!1,window.removeEventListener("keydown",h),a("close"),i.nextTick(()=>{var M;const w=(M=l.value)==null?void 0:M.querySelector("button, [tabindex]");w==null||w.focus()}))}function k(){s.value?_():b()}function B(){if(!l.value||!r.value)return;const w=l.value.getBoundingClientRect(),M=r.value.getBoundingClientRect(),N={width:window.innerWidth,height:window.innerHeight},T=o.arrow?8:0;let $=o.placement,K,P;const A=w.top,R=N.height-w.bottom,q=w.left,Q=N.width-w.right;$.startsWith("top")&&A<M.height+o.offset&&R>A?$=$.replace("top","bottom"):$.startsWith("bottom")&&R<M.height+o.offset&&A>R?$=$.replace("bottom","top"):$.startsWith("left")&&q<M.width+o.offset&&Q>q?$=$.replace("left","right"):$.startsWith("right")&&Q<M.width+o.offset&&q>Q&&($=$.replace("right","left")),g.value=$;const ee=o.offset+T;$.startsWith("top")?K=w.top-M.height-ee:$.startsWith("bottom")?K=w.bottom+ee:$.startsWith("left")?P=w.left-M.width-ee:P=w.right+ee,$.startsWith("top")||$.startsWith("bottom")?$.endsWith("start")?P=w.left:$.endsWith("end")?P=w.right-M.width:P=w.left+(w.width-M.width)/2:$.endsWith("start")?K=w.top:$.endsWith("end")?K=w.bottom-M.height:K=w.top+(w.height-M.height)/2,P=Math.max(8,Math.min(P,N.width-M.width-8)),K=Math.max(8,Math.min(K,N.height-M.height-8)),m.value={top:`${K}px`,left:`${P}px`},o.arrow&&C(w,M,$,K,P)}function C(w,M,N,T,$){const R={};if(N.startsWith("top")||N.startsWith("bottom")){let Q=w.left+w.width/2-$-6;Q=Math.max(12,Math.min(Q,M.width-12-12)),R.left=`${Q}px`,N.startsWith("top")?R.bottom="-6px":R.top="-6px"}else{let Q=w.top+w.height/2-T-6;Q=Math.max(12,Math.min(Q,M.height-12-12)),R.top=`${Q}px`,N.startsWith("left")?R.right="-6px":R.left="-6px"}p.value=R}function y(w){w.key==="Escape"&&o.closeOnEscape&&(w.preventDefault(),w.stopPropagation(),_())}function x(w){var N,T;if(!o.closeOnClickOutside)return;const M=w.target;!((N=l.value)!=null&&N.contains(M))&&!((T=r.value)!=null&&T.contains(M))&&_()}const S=i.computed(()=>{const w={...m.value};return typeof o.width=="number"&&(w.width=`${o.width}px`),w});return i.watch(s,w=>{w?(document.addEventListener("mousedown",x),window.addEventListener("resize",B),window.addEventListener("scroll",B,!0)):(document.removeEventListener("mousedown",x),window.removeEventListener("resize",B),window.removeEventListener("scroll",B,!0))}),i.onUnmounted(()=>{document.removeEventListener("mousedown",x),window.removeEventListener("resize",B),window.removeEventListener("scroll",B,!0),window.removeEventListener("keydown",h)}),e({open:b,close:_,toggle:k,isOpen:s}),(w,M)=>(i.openBlock(),i.createElementBlock("div",Gc,[i.createElementVNode("div",{ref_key:"triggerRef",ref:l,class:"ui-popover__trigger",id:i.unref(c),"aria-haspopup":"dialog","aria-expanded":s.value,"aria-controls":i.unref(d),onClick:k},[i.renderSlot(w.$slots,"trigger",{open:s.value,toggle:k,close:_},void 0,!0)],8,Jc),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ui-popover"},{default:i.withCtx(()=>[s.value?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"popoverRef",ref:r,class:i.normalizeClass(["ui-popover__content",[`ui-popover__content--${g.value}`]]),id:i.unref(d),role:"dialog","aria-labelledby":i.unref(c),"aria-modal":h,style:i.normalizeStyle(S.value),onKeydown:y},[n.arrow?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-popover__arrow",style:i.normalizeStyle(p.value)},null,4)):i.createCommentVNode("",!0),i.renderSlot(w.$slots,"default",{close:_},void 0,!0)],46,Zc)):i.createCommentVNode("",!0)]),_:3})]))]))}}),[["__scopeId","data-v-5e829fd8"]]),Qc=["for"],ed={key:0,class:"ui-input-field__required","aria-hidden":"true"},td={key:0,class:"ui-input-wrapper__addon ui-input-wrapper__addon--left"},nd=["id","type","value","name","placeholder","disabled","readonly","required","autocomplete","aria-invalid","aria-describedby"],id={key:1,class:"ui-input-wrapper__addon ui-input-wrapper__addon--right"},od=["id"],ad=["id"],Jt=O(i.defineComponent({__name:"Input",props:{modelValue:{},type:{default:"text"},label:{},placeholder:{},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},required:{type:Boolean,default:!1},iconLeft:{},iconRight:{},id:{},name:{},autocomplete:{},block:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur"],setup(n,{emit:e}){const t=n,o=e,a=i.useSlots(),s=ye("input"),l=i.computed(()=>t.id||s),r=i.computed(()=>`${l.value}-hint`),c=i.computed(()=>`${l.value}-error`),d=i.computed(()=>{if(t.error)return c.value;if(t.hint)return r.value}),u=i.computed(()=>t.iconLeft||a.left),h=i.computed(()=>t.iconRight||a.right||t.loading),f={xs:"var(--text-xs)",sm:"var(--text-sm)",md:"var(--text-md)",lg:"var(--text-lg)",xl:"var(--text-xl)"},m=i.computed(()=>f[t.size]);function p(_){const k=_.target,B=t.type==="number"?Number(k.value):k.value;o("update:modelValue",B)}function g(_){o("focus",_)}function b(_){o("blur",_)}return(_,k)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-input-field",[`ui-input-field--${n.size}`,{"ui-input-field--block":n.block,"ui-input-field--disabled":n.disabled,"ui-input-field--error":n.error,"ui-input-field--readonly":n.readonly}]])},[n.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:l.value,class:"ui-input-field__label"},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),n.required?(i.openBlock(),i.createElementBlock("span",ed,"*")):i.createCommentVNode("",!0)],8,Qc)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ui-input-wrapper",[`ui-input-wrapper--${n.size}`,{"ui-input-wrapper--disabled":n.disabled,"ui-input-wrapper--error":n.error,"ui-input-wrapper--readonly":n.readonly,"ui-input-wrapper--has-left":u.value,"ui-input-wrapper--has-right":h.value}]])},[u.value?(i.openBlock(),i.createElementBlock("span",td,[i.renderSlot(_.$slots,"left",{},()=>[n.iconLeft?(i.openBlock(),i.createBlock(je,{key:0,icon:n.iconLeft,size:m.value},null,8,["icon","size"])):i.createCommentVNode("",!0)],!0)])):i.createCommentVNode("",!0),i.createElementVNode("input",{id:l.value,type:n.type,value:n.modelValue,name:n.name,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:n.required,autocomplete:n.autocomplete,"aria-invalid":n.error?"true":void 0,"aria-describedby":d.value,class:"ui-input-wrapper__input",onInput:p,onFocus:g,onBlur:b},null,40,nd),h.value?(i.openBlock(),i.createElementBlock("span",id,[n.loading?(i.openBlock(),i.createBlock(In,{key:0,size:m.value},null,8,["size"])):i.renderSlot(_.$slots,"right",{key:1},()=>[n.iconRight?(i.openBlock(),i.createBlock(je,{key:0,icon:n.iconRight,size:m.value},null,8,["icon","size"])):i.createCommentVNode("",!0)],!0)])):i.createCommentVNode("",!0)],2),n.error?(i.openBlock(),i.createElementBlock("p",{key:1,id:c.value,class:"ui-input-field__message ui-input-field__message--error",role:"alert"},i.toDisplayString(n.error),9,od)):n.hint?(i.openBlock(),i.createElementBlock("p",{key:2,id:r.value,class:"ui-input-field__message ui-input-field__message--hint"},i.toDisplayString(n.hint),9,ad)):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-d0cdaff4"]]);function Ue(n,e,t){return Math.min(Math.max(n,e),t)}function Go(n){const e=n.replace(/^#/,""),t=e.length===3?e.split("").map(a=>a+a).join(""):e,o=parseInt(t,16);return{r:o>>16&255,g:o>>8&255,b:o&255}}function Jo(n){const e=t=>Ue(Math.round(t),0,255).toString(16).padStart(2,"0");return`#${e(n.r)}${e(n.g)}${e(n.b)}`}function zn(n){const e=n.r/255,t=n.g/255,o=n.b/255,a=Math.max(e,t,o),s=Math.min(e,t,o),l=a-s;let r=0;l!==0&&(a===e?r=(t-o)/l%6:a===t?r=(o-e)/l+2:r=(e-t)/l+4,r=Math.round(r*60),r<0&&(r+=360));const c=a===0?0:l/a;return{h:r,s:c,v:a}}function Zt(n){const{h:e,s:t,v:o}=n,a=o*t,s=a*(1-Math.abs(e/60%2-1)),l=o-a;let r=0,c=0,d=0;return e>=0&&e<60?(r=a,c=s,d=0):e>=60&&e<120?(r=s,c=a,d=0):e>=120&&e<180?(r=0,c=a,d=s):e>=180&&e<240?(r=0,c=s,d=a):e>=240&&e<300?(r=s,c=0,d=a):(r=a,c=0,d=s),{r:Math.round((r+l)*255),g:Math.round((c+l)*255),b:Math.round((d+l)*255)}}function Di(n){return zn(Go(n))}function Nn(n){return Jo(Zt(n))}function $i(n){return n<=.0031308?n*12.92:1.055*Math.pow(n,1/2.4)-.055}function Ti(n){return n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function sd(n,e,t){const o=n+.3963377774*e+.2158037573*t,a=n-.1055613458*e-.0638541728*t,s=n-.0894841775*e-1.291485548*t,l=o*o*o,r=a*a*a,c=s*s*s;return{r:4.0767416621*l-3.3077115913*r+.2309699292*c,g:-1.2684380046*l+2.6097574011*r-.3413193965*c,b:-.0041960863*l-.7034186147*r+1.707614701*c}}function ld(n,e,t){const o=.4122214708*n+.5363325363*e+.0514459929*t,a=.2119034982*n+.6806995451*e+.1073969566*t,s=.0883024619*n+.2817188376*e+.6299787005*t,l=Math.cbrt(o),r=Math.cbrt(a),c=Math.cbrt(s);return{L:.2104542553*l+.793617785*r-.0040720468*c,a:1.9779984951*l-2.428592205*r+.4505937099*c,b:.0259040371*l+.7827717662*r-.808675766*c}}function Zo(n){const{l:e,c:t,h:o}=n,a=o*Math.PI/180,s=t*Math.cos(a),l=t*Math.sin(a),r=sd(e,s,l);return{r:Ue(Math.round($i(r.r)*255),0,255),g:Ue(Math.round($i(r.g)*255),0,255),b:Ue(Math.round($i(r.b)*255),0,255)}}function Qo(n){const e=Ti(n.r/255),t=Ti(n.g/255),o=Ti(n.b/255),a=ld(e,t,o),s=Math.sqrt(a.a*a.a+a.b*a.b);let l=Math.atan2(a.b,a.a)*180/Math.PI;return l<0&&(l+=360),{l:a.L,c:s,h:s<1e-4?0:l}}function ea(n){return Qo(Zt(n))}function ta(n){return zn(Zo(n))}function Ii(n,e){return e!==void 0&&e<1?`rgba(${n.r}, ${n.g}, ${n.b}, ${e})`:`rgb(${n.r}, ${n.g}, ${n.b})`}function na(n,e){const t=(n.l*100).toFixed(1),o=n.c.toFixed(3),a=n.h.toFixed(0);return e!==void 0&&e<1?`oklch(${t}% ${o} ${a} / ${e})`:`oklch(${t}% ${o} ${a})`}function Qt(n){const e=n.trim().toLowerCase();if(e.startsWith("#")){const a=e.slice(1);if(/^[0-9a-f]{3}$/.test(a)||/^[0-9a-f]{6}$/.test(a))return{hsv:Di(e),alpha:1,format:"hex"};if(/^[0-9a-f]{8}$/.test(a)){const s=parseInt(a.slice(6,8),16)/255;return{hsv:Di("#"+a.slice(0,6)),alpha:s,format:"hex"}}return null}const t=e.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)$/);if(t){const a={r:Ue(parseInt(t[1],10),0,255),g:Ue(parseInt(t[2],10),0,255),b:Ue(parseInt(t[3],10),0,255)},s=t[4]?Ue(parseFloat(t[4]),0,1):1;return{hsv:zn(a),alpha:s,format:"rgb"}}const o=e.match(/^oklch\(\s*([\d.]+)%?\s+([\d.]+)\s+([\d.]+)\s*(?:\/\s*([\d.]+))?\s*\)$/);if(o){const a=parseFloat(o[1])/(o[1].includes("%")?1:100),s={l:Ue(a>1?a/100:a,0,1),c:Ue(parseFloat(o[2]),0,.5),h:parseFloat(o[3])%360},l=o[4]?Ue(parseFloat(o[4]),0,1):1;return{hsv:ta(s),alpha:l,format:"oklch"}}return null}function Li(n,e,t){switch(t){case"hex":{const o=Nn(n);if(e<1){const a=Math.round(e*255).toString(16).padStart(2,"0");return o+a}return o}case"rgb":return Ii(Zt(n),e);case"oklch":return na(ea(n),e)}}const ia=O(i.defineComponent({__name:"ColorArea",props:{hue:{},saturation:{},value:{}},emits:["update:saturation","update:value"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(null),s=i.ref(!1),l=i.computed(()=>({left:`${t.saturation*100}%`,top:`${(1-t.value)*100}%`})),r=i.computed(()=>`hsl(${t.hue}, 100%, 50%)`);function c(g,b){if(!a.value)return;const _=a.value.getBoundingClientRect(),k=g-_.left,B=b-_.top,C=Ue(k/_.width,0,1),y=Ue(1-B/_.height,0,1);o("update:saturation",C),o("update:value",y)}function d(g){g.preventDefault(),s.value=!0,c(g.clientX,g.clientY),document.addEventListener("mousemove",u),document.addEventListener("mouseup",h)}function u(g){s.value&&c(g.clientX,g.clientY)}function h(){s.value=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",h)}function f(g){g.preventDefault(),s.value=!0,c(g.touches[0].clientX,g.touches[0].clientY),document.addEventListener("touchmove",m,{passive:!1}),document.addEventListener("touchend",p)}function m(g){g.preventDefault(),s.value&&c(g.touches[0].clientX,g.touches[0].clientY)}function p(){s.value=!1,document.removeEventListener("touchmove",m),document.removeEventListener("touchend",p)}return i.onUnmounted(()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",h),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",p)}),(g,b)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"areaRef",ref:a,class:i.normalizeClass(["ui-color-area",{"ui-color-area--dragging":s.value}]),style:i.normalizeStyle({"--hue-color":r.value}),onMousedown:d,onTouchstart:f},[b[0]||(b[0]=i.createElementVNode("div",{class:"ui-color-area__gradient ui-color-area__gradient--saturation"},null,-1)),b[1]||(b[1]=i.createElementVNode("div",{class:"ui-color-area__gradient ui-color-area__gradient--value"},null,-1)),i.createElementVNode("div",{class:"ui-color-area__thumb",style:i.normalizeStyle(l.value)},null,4)],38))}}),[["__scopeId","data-v-da7ba502"]]),rd={key:0,class:"ui-color-slider__checkerboard"},zi=O(i.defineComponent({__name:"ColorSlider",props:{modelValue:{},type:{},color:{default:"#ff0000"}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(null),s=i.ref(!1),l=i.computed(()=>t.type==="hue"?t.modelValue/360*100:t.modelValue*100),r=i.computed(()=>t.type!=="alpha"?"":`linear-gradient(to right, transparent, ${t.color})`);function c(g){if(!a.value)return;const b=a.value.getBoundingClientRect(),_=g-b.left,k=Ue(_/b.width,0,1);t.type==="hue"?o("update:modelValue",Math.round(k*360)):o("update:modelValue",k)}function d(g){g.preventDefault(),s.value=!0,c(g.clientX),document.addEventListener("mousemove",u),document.addEventListener("mouseup",h)}function u(g){s.value&&c(g.clientX)}function h(){s.value=!1,document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",h)}function f(g){g.preventDefault(),s.value=!0,c(g.touches[0].clientX),document.addEventListener("touchmove",m,{passive:!1}),document.addEventListener("touchend",p)}function m(g){g.preventDefault(),s.value&&c(g.touches[0].clientX)}function p(){s.value=!1,document.removeEventListener("touchmove",m),document.removeEventListener("touchend",p)}return i.onUnmounted(()=>{document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",h),document.removeEventListener("touchmove",m),document.removeEventListener("touchend",p)}),(g,b)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"trackRef",ref:a,class:i.normalizeClass(["ui-color-slider",[`ui-color-slider--${n.type}`,{"ui-color-slider--dragging":s.value}]]),onMousedown:d,onTouchstart:f},[n.type==="alpha"?(i.openBlock(),i.createElementBlock("div",rd)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"ui-color-slider__gradient",style:i.normalizeStyle(n.type==="alpha"?{background:r.value}:void 0)},null,4),i.createElementVNode("div",{class:"ui-color-slider__thumb",style:i.normalizeStyle({left:`${l.value}%`})},null,4)],34))}}),[["__scopeId","data-v-025e0a7f"]]),cd={class:"ui-color-picker__panel"},dd={class:"ui-color-picker__sliders"},ud={class:"ui-color-picker__footer"},hd={class:"ui-color-picker__preview"},fd={class:"ui-color-picker__preview-text"},md=O(i.defineComponent({__name:"ColorPicker",props:{modelValue:{},format:{default:"hex"},disabled:{type:Boolean,default:!1},swatchOnly:{type:Boolean,default:!1},alpha:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,o=e,a=i.ref({h:0,s:1,v:1}),s=i.ref(1),l=i.ref(""),r=i.ref(!1),c=i.computed(()=>{const B=Zt(a.value);return t.alpha&&s.value<1?Ii(B,s.value):Nn(a.value)}),d=i.computed(()=>Nn({...a.value,s:1,v:1}));i.watch(()=>t.modelValue,B=>{if(!B)return;const C=Qt(B);C&&(a.value=C.hsv,s.value=C.alpha,l.value=B)},{immediate:!0});function u(){const B=Li(a.value,s.value,t.format);l.value=B,o("update:modelValue",B)}function h(B){a.value={...a.value,h:B},u()}function f(B){a.value={...a.value,s:B},u()}function m(B){a.value={...a.value,v:B},u()}function p(B){s.value=B,u()}function g(B){const C=B.target.value;l.value=C;const y=Qt(C);y&&(a.value=y.hsv,s.value=y.alpha,o("update:modelValue",C))}function b(){Qt(l.value)||(l.value=Li(a.value,s.value,t.format))}async function _(){if("EyeDropper"in window)try{const C=await new EyeDropper().open();if(C.sRGBHex){const y=Qt(C.sRGBHex);y&&(a.value=y.hsv,s.value=1,u())}}catch{}}const k=i.computed(()=>"EyeDropper"in window);return(B,C)=>(i.openBlock(),i.createBlock(Ln,{placement:"bottom-start",disabled:n.disabled,width:240,onOpen:C[0]||(C[0]=y=>r.value=!0),onClose:C[1]||(C[1]=y=>r.value=!1)},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["ui-color-picker__trigger",{"ui-color-picker__trigger--disabled":n.disabled}])},[i.createElementVNode("div",{class:"ui-color-picker__swatch",style:i.normalizeStyle({backgroundColor:c.value})},[...C[2]||(C[2]=[i.createElementVNode("div",{class:"ui-color-picker__swatch-checkerboard"},null,-1)])],4),n.swatchOnly?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(Jt,{key:0,"model-value":l.value,disabled:n.disabled,class:"ui-color-picker__input",onInput:g,onBlur:b},null,8,["model-value","disabled"]))],2)]),default:i.withCtx(()=>[i.createElementVNode("div",cd,[i.createVNode(ia,{hue:a.value.h,saturation:a.value.s,value:a.value.v,"onUpdate:saturation":f,"onUpdate:value":m},null,8,["hue","saturation","value"]),i.createElementVNode("div",dd,[i.createVNode(zi,{"model-value":a.value.h,type:"hue","onUpdate:modelValue":h},null,8,["model-value"]),n.alpha?(i.openBlock(),i.createBlock(zi,{key:0,"model-value":s.value,type:"alpha",color:d.value,"onUpdate:modelValue":p},null,8,["model-value","color"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",ud,[i.createElementVNode("div",hd,[i.createElementVNode("div",{class:"ui-color-picker__preview-swatch",style:i.normalizeStyle({backgroundColor:c.value})},[...C[3]||(C[3]=[i.createElementVNode("div",{class:"ui-color-picker__swatch-checkerboard"},null,-1)])],4),i.createElementVNode("span",fd,i.toDisplayString(l.value),1)]),k.value?(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",class:"ui-color-picker__eyedropper",title:"Pick color from screen",onClick:_},[...C[4]||(C[4]=[i.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 22l1-1h3l9-9"}),i.createElementVNode("path",{d:"M3 21v-3l9-9"}),i.createElementVNode("path",{d:"M14.5 6.5l3-3a2.12 2.12 0 0 1 3 3l-3 3"}),i.createElementVNode("path",{d:"M12 9l3 3"})],-1)])])):i.createCommentVNode("",!0)])])]),_:1},8,["disabled"]))}}),[["__scopeId","data-v-ea7d9545"]]);/*!
29
+ * @kurkle/color v0.3.4
30
+ * https://github.com/kurkle/color#readme
31
+ * (c) 2024 Jukka Kurkela
32
+ * Released under the MIT License
33
+ */function en(n){return n+.5|0}const pt=(n,e,t)=>Math.max(Math.min(n,t),e);function tn(n){return pt(en(n*2.55),0,255)}function gt(n){return pt(en(n*255),0,255)}function at(n){return pt(en(n/2.55)/100,0,1)}function oa(n){return pt(en(n*100),0,100)}const Ge={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},Ni=[..."0123456789ABCDEF"],pd=n=>Ni[n&15],gd=n=>Ni[(n&240)>>4]+Ni[n&15],Pn=n=>(n&240)>>4===(n&15),bd=n=>Pn(n.r)&&Pn(n.g)&&Pn(n.b)&&Pn(n.a);function _d(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Ge[n[1]]*17,g:255&Ge[n[2]]*17,b:255&Ge[n[3]]*17,a:e===5?Ge[n[4]]*17:255}:(e===7||e===9)&&(t={r:Ge[n[1]]<<4|Ge[n[2]],g:Ge[n[3]]<<4|Ge[n[4]],b:Ge[n[5]]<<4|Ge[n[6]],a:e===9?Ge[n[7]]<<4|Ge[n[8]]:255})),t}const yd=(n,e)=>n<255?e(n):"";function kd(n){var e=bd(n)?pd:gd;return n?"#"+e(n.r)+e(n.g)+e(n.b)+yd(n.a,e):void 0}const xd=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function aa(n,e,t){const o=e*Math.min(t,1-t),a=(s,l=(s+n/30)%12)=>t-o*Math.max(Math.min(l-3,9-l,1),-1);return[a(0),a(8),a(4)]}function wd(n,e,t){const o=(a,s=(a+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[o(5),o(3),o(1)]}function Cd(n,e,t){const o=aa(n,1,.5);let a;for(e+t>1&&(a=1/(e+t),e*=a,t*=a),a=0;a<3;a++)o[a]*=1-e-t,o[a]+=e;return o}function Bd(n,e,t,o,a){return n===a?(e-t)/o+(e<t?6:0):e===a?(t-n)/o+2:(n-e)/o+4}function Pi(n){const t=n.r/255,o=n.g/255,a=n.b/255,s=Math.max(t,o,a),l=Math.min(t,o,a),r=(s+l)/2;let c,d,u;return s!==l&&(u=s-l,d=r>.5?u/(2-s-l):u/(s+l),c=Bd(t,o,a,u,s),c=c*60+.5),[c|0,d||0,r]}function Ai(n,e,t,o){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,o)).map(gt)}function Ri(n,e,t){return Ai(aa,n,e,t)}function Sd(n,e,t){return Ai(Cd,n,e,t)}function Ed(n,e,t){return Ai(wd,n,e,t)}function sa(n){return(n%360+360)%360}function Md(n){const e=xd.exec(n);let t=255,o;if(!e)return;e[5]!==o&&(t=e[6]?tn(+e[5]):gt(+e[5]));const a=sa(+e[2]),s=+e[3]/100,l=+e[4]/100;return e[1]==="hwb"?o=Sd(a,s,l):e[1]==="hsv"?o=Ed(a,s,l):o=Ri(a,s,l),{r:o[0],g:o[1],b:o[2],a:t}}function vd(n,e){var t=Pi(n);t[0]=sa(t[0]+e),t=Ri(t),n.r=t[0],n.g=t[1],n.b=t[2]}function Vd(n){if(!n)return;const e=Pi(n),t=e[0],o=oa(e[1]),a=oa(e[2]);return n.a<255?`hsla(${t}, ${o}%, ${a}%, ${at(n.a)})`:`hsl(${t}, ${o}%, ${a}%)`}const la={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"},ra={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 Dd(){const n={},e=Object.keys(ra),t=Object.keys(la);let o,a,s,l,r;for(o=0;o<e.length;o++){for(l=r=e[o],a=0;a<t.length;a++)s=t[a],r=r.replace(s,la[s]);s=parseInt(ra[l],16),n[r]=[s>>16&255,s>>8&255,s&255]}return n}let An;function $d(n){An||(An=Dd(),An.transparent=[0,0,0,0]);const e=An[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Td=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Id(n){const e=Td.exec(n);let t=255,o,a,s;if(e){if(e[7]!==o){const l=+e[7];t=e[8]?tn(l):pt(l*255,0,255)}return o=+e[1],a=+e[3],s=+e[5],o=255&(e[2]?tn(o):pt(o,0,255)),a=255&(e[4]?tn(a):pt(a,0,255)),s=255&(e[6]?tn(s):pt(s,0,255)),{r:o,g:a,b:s,a:t}}}function Ld(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${at(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const Oi=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,Ht=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function zd(n,e,t){const o=Ht(at(n.r)),a=Ht(at(n.g)),s=Ht(at(n.b));return{r:gt(Oi(o+t*(Ht(at(e.r))-o))),g:gt(Oi(a+t*(Ht(at(e.g))-a))),b:gt(Oi(s+t*(Ht(at(e.b))-s))),a:n.a+t*(e.a-n.a)}}function Rn(n,e,t){if(n){let o=Pi(n);o[e]=Math.max(0,Math.min(o[e]+o[e]*t,e===0?360:1)),o=Ri(o),n.r=o[0],n.g=o[1],n.b=o[2]}}function ca(n,e){return n&&Object.assign(e||{},n)}function da(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=gt(n[3]))):(e=ca(n,{r:0,g:0,b:0,a:1}),e.a=gt(e.a)),e}function Nd(n){return n.charAt(0)==="r"?Id(n):Md(n)}class nn{constructor(e){if(e instanceof nn)return e;const t=typeof e;let o;t==="object"?o=da(e):t==="string"&&(o=_d(e)||$d(e)||Nd(e)),this._rgb=o,this._valid=!!o}get valid(){return this._valid}get rgb(){var e=ca(this._rgb);return e&&(e.a=at(e.a)),e}set rgb(e){this._rgb=da(e)}rgbString(){return this._valid?Ld(this._rgb):void 0}hexString(){return this._valid?kd(this._rgb):void 0}hslString(){return this._valid?Vd(this._rgb):void 0}mix(e,t){if(e){const o=this.rgb,a=e.rgb;let s;const l=t===s?.5:t,r=2*l-1,c=o.a-a.a,d=((r*c===-1?r:(r+c)/(1+r*c))+1)/2;s=1-d,o.r=255&d*o.r+s*a.r+.5,o.g=255&d*o.g+s*a.g+.5,o.b=255&d*o.b+s*a.b+.5,o.a=l*o.a+(1-l)*a.a,this.rgb=o}return this}interpolate(e,t){return e&&(this._rgb=zd(this._rgb,e._rgb,t)),this}clone(){return new nn(this.rgb)}alpha(e){return this._rgb.a=gt(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=en(e.r*.3+e.g*.59+e.b*.11);return e.r=e.g=e.b=t,this}opaquer(e){const t=this._rgb;return t.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return Rn(this._rgb,2,e),this}darken(e){return Rn(this._rgb,2,-e),this}saturate(e){return Rn(this._rgb,1,e),this}desaturate(e){return Rn(this._rgb,1,-e),this}rotate(e){return vd(this._rgb,e),this}}/*!
34
+ * Chart.js v4.5.1
35
+ * https://www.chartjs.org
36
+ * (c) 2025 Chart.js Contributors
37
+ * Released under the MIT License
38
+ */function st(){}const Pd=(()=>{let n=0;return()=>n++})();function ae(n){return n==null}function Se(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function se(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function Me(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function qe(n,e){return Me(n)?n:e}function ie(n,e){return typeof n>"u"?e:n}const Ad=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:+n/e,ua=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function ke(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function pe(n,e,t,o){let a,s,l;if(Se(n))for(s=n.length,a=0;a<s;a++)e.call(t,n[a],a);else if(se(n))for(l=Object.keys(n),s=l.length,a=0;a<s;a++)e.call(t,n[l[a]],l[a])}function On(n,e){let t,o,a,s;if(!n||!e||n.length!==e.length)return!1;for(t=0,o=n.length;t<o;++t)if(a=n[t],s=e[t],a.datasetIndex!==s.datasetIndex||a.index!==s.index)return!1;return!0}function Fn(n){if(Se(n))return n.map(Fn);if(se(n)){const e=Object.create(null),t=Object.keys(n),o=t.length;let a=0;for(;a<o;++a)e[t[a]]=Fn(n[t[a]]);return e}return n}function ha(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Rd(n,e,t,o){if(!ha(n))return;const a=e[n],s=t[n];se(a)&&se(s)?on(a,s,o):e[n]=Fn(s)}function on(n,e,t){const o=Se(e)?e:[e],a=o.length;if(!se(n))return n;t=t||{};const s=t.merger||Rd;let l;for(let r=0;r<a;++r){if(l=o[r],!se(l))continue;const c=Object.keys(l);for(let d=0,u=c.length;d<u;++d)s(c[d],n,l,t)}return n}function an(n,e){return on(n,e,{merger:Od})}function Od(n,e,t){if(!ha(n))return;const o=e[n],a=t[n];se(o)&&se(a)?an(o,a):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=Fn(a))}const fa={"":n=>n,x:n=>n.x,y:n=>n.y};function Fd(n){const e=n.split("."),t=[];let o="";for(const a of e)o+=a,o.endsWith("\\")?o=o.slice(0,-1)+".":(t.push(o),o="");return t}function Wd(n){const e=Fd(n);return t=>{for(const o of e){if(o==="")break;t=t&&t[o]}return t}}function bt(n,e){return(fa[e]||(fa[e]=Wd(e)))(n)}function Fi(n){return n.charAt(0).toUpperCase()+n.slice(1)}const sn=n=>typeof n<"u",_t=n=>typeof n=="function",ma=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Hd(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const de=Math.PI,Ce=2*de,jd=Ce+de,Wn=Number.POSITIVE_INFINITY,Yd=de/180,Ve=de/2,Mt=de/4,pa=de*2/3,yt=Math.log10,nt=Math.sign;function ln(n,e,t){return Math.abs(n-e)<t}function ga(n){const e=Math.round(n);n=ln(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(yt(n))),o=n/t;return(o<=1?1:o<=2?2:o<=5?5:10)*t}function Ud(n){const e=[],t=Math.sqrt(n);let o;for(o=1;o<t;o++)n%o===0&&(e.push(o),e.push(n/o));return t===(t|0)&&e.push(t),e.sort((a,s)=>a-s).pop(),e}function Xd(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function jt(n){return!Xd(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function Kd(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function ba(n,e,t){let o,a,s;for(o=0,a=n.length;o<a;o++)s=n[o][t],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function Ze(n){return n*(de/180)}function Wi(n){return n*(180/de)}function _a(n){if(!Me(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function ya(n,e){const t=e.x-n.x,o=e.y-n.y,a=Math.sqrt(t*t+o*o);let s=Math.atan2(o,t);return s<-.5*de&&(s+=Ce),{angle:s,distance:a}}function Hi(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function qd(n,e){return(n-e+jd)%Ce-de}function Oe(n){return(n%Ce+Ce)%Ce}function rn(n,e,t,o){const a=Oe(n),s=Oe(e),l=Oe(t),r=Oe(s-a),c=Oe(l-a),d=Oe(a-s),u=Oe(a-l);return a===s||a===l||o&&s===l||r>c&&d<u}function Ie(n,e,t){return Math.max(e,Math.min(t,n))}function Gd(n){return Ie(n,-32768,32767)}function lt(n,e,t,o=1e-6){return n>=Math.min(e,t)-o&&n<=Math.max(e,t)+o}function ji(n,e,t){t=t||(l=>n[l]<e);let o=n.length-1,a=0,s;for(;o-a>1;)s=a+o>>1,t(s)?a=s:o=s;return{lo:a,hi:o}}const rt=(n,e,t,o)=>ji(n,t,o?a=>{const s=n[a][e];return s<t||s===t&&n[a+1][e]===t}:a=>n[a][e]<t),Jd=(n,e,t)=>ji(n,t,o=>n[o][e]>=t);function Zd(n,e,t){let o=0,a=n.length;for(;o<a&&n[o]<e;)o++;for(;a>o&&n[a-1]>t;)a--;return o>0||a<n.length?n.slice(o,a):n}const ka=["push","pop","shift","splice","unshift"];function Qd(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),ka.forEach(t=>{const o="_onData"+Fi(t),a=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const l=a.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[o]=="function"&&r[o](...s)}),l}})})}function xa(n,e){const t=n._chartjs;if(!t)return;const o=t.listeners,a=o.indexOf(e);a!==-1&&o.splice(a,1),!(o.length>0)&&(ka.forEach(s=>{delete n[s]}),delete n._chartjs)}function wa(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const Ca=(function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame})();function Ba(n,e){let t=[],o=!1;return function(...a){t=a,o||(o=!0,Ca.call(window,()=>{o=!1,n.apply(e,t)}))}}function eu(n,e){let t;return function(...o){return e?(clearTimeout(t),t=setTimeout(n,e,o)):n.apply(this,o),e}}const Yi=n=>n==="start"?"left":n==="end"?"right":"center",Fe=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2,tu=(n,e,t,o)=>n===(o?"left":"right")?t:n==="center"?(e+t)/2:e;function Sa(n,e,t){const o=e.length;let a=0,s=o;if(n._sorted){const{iScale:l,vScale:r,_parsed:c}=n,d=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,u=l.axis,{min:h,max:f,minDefined:m,maxDefined:p}=l.getUserBounds();if(m){if(a=Math.min(rt(c,u,h).lo,t?o:rt(e,u,l.getPixelForValue(h)).lo),d){const g=c.slice(0,a+1).reverse().findIndex(b=>!ae(b[r.axis]));a-=Math.max(0,g)}a=Ie(a,0,o-1)}if(p){let g=Math.max(rt(c,l.axis,f,!0).hi+1,t?0:rt(e,u,l.getPixelForValue(f),!0).hi+1);if(d){const b=c.slice(g-1).findIndex(_=>!ae(_[r.axis]));g+=Math.max(0,b)}s=Ie(g,a,o)-a}else s=o-a}return{start:a,count:s}}function Ea(n){const{xScale:e,yScale:t,_scaleRanges:o}=n,a={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!o)return n._scaleRanges=a,!0;const s=o.xmin!==e.min||o.xmax!==e.max||o.ymin!==t.min||o.ymax!==t.max;return Object.assign(o,a),s}const Hn=n=>n===0||n===1,Ma=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*Ce/t)),va=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*Ce/t)+1,cn={linear:n=>n,easeInQuad:n=>n*n,easeOutQuad:n=>-n*(n-2),easeInOutQuad:n=>(n/=.5)<1?.5*n*n:-.5*(--n*(n-2)-1),easeInCubic:n=>n*n*n,easeOutCubic:n=>(n-=1)*n*n+1,easeInOutCubic:n=>(n/=.5)<1?.5*n*n*n:.5*((n-=2)*n*n+2),easeInQuart:n=>n*n*n*n,easeOutQuart:n=>-((n-=1)*n*n*n-1),easeInOutQuart:n=>(n/=.5)<1?.5*n*n*n*n:-.5*((n-=2)*n*n*n-2),easeInQuint:n=>n*n*n*n*n,easeOutQuint:n=>(n-=1)*n*n*n*n+1,easeInOutQuint:n=>(n/=.5)<1?.5*n*n*n*n*n:.5*((n-=2)*n*n*n*n+2),easeInSine:n=>-Math.cos(n*Ve)+1,easeOutSine:n=>Math.sin(n*Ve),easeInOutSine:n=>-.5*(Math.cos(de*n)-1),easeInExpo:n=>n===0?0:Math.pow(2,10*(n-1)),easeOutExpo:n=>n===1?1:-Math.pow(2,-10*n)+1,easeInOutExpo:n=>Hn(n)?n:n<.5?.5*Math.pow(2,10*(n*2-1)):.5*(-Math.pow(2,-10*(n*2-1))+2),easeInCirc:n=>n>=1?n:-(Math.sqrt(1-n*n)-1),easeOutCirc:n=>Math.sqrt(1-(n-=1)*n),easeInOutCirc:n=>(n/=.5)<1?-.5*(Math.sqrt(1-n*n)-1):.5*(Math.sqrt(1-(n-=2)*n)+1),easeInElastic:n=>Hn(n)?n:Ma(n,.075,.3),easeOutElastic:n=>Hn(n)?n:va(n,.075,.3),easeInOutElastic(n){return Hn(n)?n:n<.5?.5*Ma(n*2,.1125,.45):.5+.5*va(n*2-1,.1125,.45)},easeInBack(n){return n*n*((1.70158+1)*n-1.70158)},easeOutBack(n){return(n-=1)*n*((1.70158+1)*n+1.70158)+1},easeInOutBack(n){let e=1.70158;return(n/=.5)<1?.5*(n*n*(((e*=1.525)+1)*n-e)):.5*((n-=2)*n*(((e*=1.525)+1)*n+e)+2)},easeInBounce:n=>1-cn.easeOutBounce(1-n),easeOutBounce(n){return n<1/2.75?7.5625*n*n:n<2/2.75?7.5625*(n-=1.5/2.75)*n+.75:n<2.5/2.75?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375},easeInOutBounce:n=>n<.5?cn.easeInBounce(n*2)*.5:cn.easeOutBounce(n*2-1)*.5+.5};function Ui(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Va(n){return Ui(n)?n:new nn(n)}function Xi(n){return Ui(n)?n:new nn(n).saturate(.5).darken(.1).hexString()}const nu=["x","y","borderWidth","radius","tension"],iu=["color","borderColor","backgroundColor"];function ou(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:iu},numbers:{type:"number",properties:nu}}),n.describe("animations",{_fallback:"animation"}),n.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:e=>e|0}}}})}function au(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Da=new Map;function su(n,e){e=e||{};const t=n+JSON.stringify(e);let o=Da.get(t);return o||(o=new Intl.NumberFormat(n,e),Da.set(t,o)),o}function dn(n,e,t){return su(e,t).format(n)}const $a={values(n){return Se(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const o=this.chart.options.locale;let a,s=n;if(t.length>1){const d=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(d<1e-4||d>1e15)&&(a="scientific"),s=lu(n,t)}const l=yt(Math.abs(s)),r=isNaN(l)?1:Math.max(Math.min(-1*Math.floor(l),20),0),c={notation:a,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(c,this.options.ticks.format),dn(n,o,c)},logarithmic(n,e,t){if(n===0)return"0";const o=t[e].significand||n/Math.pow(10,Math.floor(yt(n)));return[1,2,3,5,10,15].includes(o)||e>.8*t.length?$a.numeric.call(this,n,e,t):""}};function lu(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var jn={formatters:$a};function ru(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:jn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const vt=Object.create(null),Ki=Object.create(null);function un(n,e){if(!e)return n;const t=e.split(".");for(let o=0,a=t.length;o<a;++o){const s=t[o];n=n[s]||(n[s]=Object.create(null))}return n}function qi(n,e,t){return typeof e=="string"?on(un(n,e),t):on(un(n,""),e)}class cu{constructor(e,t){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=o=>o.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=(o,a)=>Xi(a.backgroundColor),this.hoverBorderColor=(o,a)=>Xi(a.borderColor),this.hoverColor=(o,a)=>Xi(a.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return qi(this,e,t)}get(e){return un(this,e)}describe(e,t){return qi(Ki,e,t)}override(e,t){return qi(vt,e,t)}route(e,t,o,a){const s=un(this,e),l=un(this,o),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const c=this[r],d=l[a];return se(c)?Object.assign({},d,c):ie(c,d)},set(c){this[r]=c}}})}apply(e){e.forEach(t=>t(this))}}var Ee=new cu({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[ou,au,ru]);function du(n){return!n||ae(n.size)||ae(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Yn(n,e,t,o,a){let s=e[a];return s||(s=e[a]=n.measureText(a).width,t.push(a)),s>o&&(o=s),o}function uu(n,e,t,o){o=o||{};let a=o.data=o.data||{},s=o.garbageCollect=o.garbageCollect||[];o.font!==e&&(a=o.data={},s=o.garbageCollect=[],o.font=e),n.save(),n.font=e;let l=0;const r=t.length;let c,d,u,h,f;for(c=0;c<r;c++)if(h=t[c],h!=null&&!Se(h))l=Yn(n,a,s,l,h);else if(Se(h))for(d=0,u=h.length;d<u;d++)f=h[d],f!=null&&!Se(f)&&(l=Yn(n,a,s,l,f));n.restore();const m=s.length/2;if(m>t.length){for(c=0;c<m;c++)delete a[s[c]];s.splice(0,m)}return l}function Vt(n,e,t){const o=n.currentDevicePixelRatio,a=t!==0?Math.max(t/2,.5):0;return Math.round((e-a)*o)/o+a}function Ta(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function Gi(n,e,t,o){Ia(n,e,t,o,null)}function Ia(n,e,t,o,a){let s,l,r,c,d,u,h,f;const m=e.pointStyle,p=e.rotation,g=e.radius;let b=(p||0)*Yd;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,o),n.rotate(b),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(g)||g<=0)){switch(n.beginPath(),m){default:a?n.ellipse(t,o,a/2,g,0,0,Ce):n.arc(t,o,g,0,Ce),n.closePath();break;case"triangle":u=a?a/2:g,n.moveTo(t+Math.sin(b)*u,o-Math.cos(b)*g),b+=pa,n.lineTo(t+Math.sin(b)*u,o-Math.cos(b)*g),b+=pa,n.lineTo(t+Math.sin(b)*u,o-Math.cos(b)*g),n.closePath();break;case"rectRounded":d=g*.516,c=g-d,l=Math.cos(b+Mt)*c,h=Math.cos(b+Mt)*(a?a/2-d:c),r=Math.sin(b+Mt)*c,f=Math.sin(b+Mt)*(a?a/2-d:c),n.arc(t-h,o-r,d,b-de,b-Ve),n.arc(t+f,o-l,d,b-Ve,b),n.arc(t+h,o+r,d,b,b+Ve),n.arc(t-f,o+l,d,b+Ve,b+de),n.closePath();break;case"rect":if(!p){c=Math.SQRT1_2*g,u=a?a/2:c,n.rect(t-u,o-c,2*u,2*c);break}b+=Mt;case"rectRot":h=Math.cos(b)*(a?a/2:g),l=Math.cos(b)*g,r=Math.sin(b)*g,f=Math.sin(b)*(a?a/2:g),n.moveTo(t-h,o-r),n.lineTo(t+f,o-l),n.lineTo(t+h,o+r),n.lineTo(t-f,o+l),n.closePath();break;case"crossRot":b+=Mt;case"cross":h=Math.cos(b)*(a?a/2:g),l=Math.cos(b)*g,r=Math.sin(b)*g,f=Math.sin(b)*(a?a/2:g),n.moveTo(t-h,o-r),n.lineTo(t+h,o+r),n.moveTo(t+f,o-l),n.lineTo(t-f,o+l);break;case"star":h=Math.cos(b)*(a?a/2:g),l=Math.cos(b)*g,r=Math.sin(b)*g,f=Math.sin(b)*(a?a/2:g),n.moveTo(t-h,o-r),n.lineTo(t+h,o+r),n.moveTo(t+f,o-l),n.lineTo(t-f,o+l),b+=Mt,h=Math.cos(b)*(a?a/2:g),l=Math.cos(b)*g,r=Math.sin(b)*g,f=Math.sin(b)*(a?a/2:g),n.moveTo(t-h,o-r),n.lineTo(t+h,o+r),n.moveTo(t+f,o-l),n.lineTo(t-f,o+l);break;case"line":l=a?a/2:Math.cos(b)*g,r=Math.sin(b)*g,n.moveTo(t-l,o-r),n.lineTo(t+l,o+r);break;case"dash":n.moveTo(t,o),n.lineTo(t+Math.cos(b)*(a?a/2:g),o+Math.sin(b)*g);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function ct(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x<e.right+t&&n.y>e.top-t&&n.y<e.bottom+t}function Un(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Xn(n){n.restore()}function hu(n,e,t,o,a){if(!e)return n.lineTo(t.x,t.y);if(a==="middle"){const s=(e.x+t.x)/2;n.lineTo(s,e.y),n.lineTo(s,t.y)}else a==="after"!=!!o?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function fu(n,e,t,o){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(o?e.cp1x:e.cp2x,o?e.cp1y:e.cp2y,o?t.cp2x:t.cp1x,o?t.cp2y:t.cp1y,t.x,t.y)}function mu(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),ae(e.rotation)||n.rotate(e.rotation),e.color&&(n.fillStyle=e.color),e.textAlign&&(n.textAlign=e.textAlign),e.textBaseline&&(n.textBaseline=e.textBaseline)}function pu(n,e,t,o,a){if(a.strikethrough||a.underline){const s=n.measureText(o),l=e-s.actualBoundingBoxLeft,r=e+s.actualBoundingBoxRight,c=t-s.actualBoundingBoxAscent,d=t+s.actualBoundingBoxDescent,u=a.strikethrough?(c+d)/2:d;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=a.decorationWidth||2,n.moveTo(l,u),n.lineTo(r,u),n.stroke()}}function gu(n,e){const t=n.fillStyle;n.fillStyle=e.color,n.fillRect(e.left,e.top,e.width,e.height),n.fillStyle=t}function Dt(n,e,t,o,a,s={}){const l=Se(e)?e:[e],r=s.strokeWidth>0&&s.strokeColor!=="";let c,d;for(n.save(),n.font=a.string,mu(n,s),c=0;c<l.length;++c)d=l[c],s.backdrop&&gu(n,s.backdrop),r&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),ae(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(d,t,o,s.maxWidth)),n.fillText(d,t,o,s.maxWidth),pu(n,t,o,d,s),o+=Number(a.lineHeight);n.restore()}function hn(n,e){const{x:t,y:o,w:a,h:s,radius:l}=e;n.arc(t+l.topLeft,o+l.topLeft,l.topLeft,1.5*de,de,!0),n.lineTo(t,o+s-l.bottomLeft),n.arc(t+l.bottomLeft,o+s-l.bottomLeft,l.bottomLeft,de,Ve,!0),n.lineTo(t+a-l.bottomRight,o+s),n.arc(t+a-l.bottomRight,o+s-l.bottomRight,l.bottomRight,Ve,0,!0),n.lineTo(t+a,o+l.topRight),n.arc(t+a-l.topRight,o+l.topRight,l.topRight,0,-Ve,!0),n.lineTo(t+l.topLeft,o)}const bu=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,_u=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function yu(n,e){const t=(""+n).match(bu);if(!t||t[1]==="normal")return e*1.2;switch(n=+t[2],t[3]){case"px":return n;case"%":n/=100;break}return e*n}const ku=n=>+n||0;function Ji(n,e){const t={},o=se(e),a=o?Object.keys(e):e,s=se(n)?o?l=>ie(n[l],n[e[l]]):l=>n[l]:()=>n;for(const l of a)t[l]=ku(s(l));return t}function La(n){return Ji(n,{top:"y",right:"x",bottom:"y",left:"x"})}function $t(n){return Ji(n,["topLeft","topRight","bottomLeft","bottomRight"])}function We(n){const e=La(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function $e(n,e){n=n||{},e=e||Ee.font;let t=ie(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let o=ie(n.style,e.style);o&&!(""+o).match(_u)&&(console.warn('Invalid font style specified: "'+o+'"'),o=void 0);const a={family:ie(n.family,e.family),lineHeight:yu(ie(n.lineHeight,e.lineHeight),t),size:t,style:o,weight:ie(n.weight,e.weight),string:""};return a.string=du(a),a}function fn(n,e,t,o){let a,s,l;for(a=0,s=n.length;a<s;++a)if(l=n[a],l!==void 0&&l!==void 0)return l}function xu(n,e,t){const{min:o,max:a}=n,s=ua(e,(a-o)/2),l=(r,c)=>t&&r===0?0:r+c;return{min:l(o,-Math.abs(s)),max:l(a,s)}}function kt(n,e){return Object.assign(Object.create(n),e)}function Zi(n,e=[""],t,o,a=()=>n[0]){const s=t||n;typeof o>"u"&&(o=Ra("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:o,_getTarget:a,override:r=>Zi([r,...n],e,s,o)};return new Proxy(l,{deleteProperty(r,c){return delete r[c],delete r._keys,delete n[0][c],!0},get(r,c){return Na(r,c,()=>Vu(c,e,n,r))},getOwnPropertyDescriptor(r,c){return Reflect.getOwnPropertyDescriptor(r._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,c){return Oa(r).includes(c)},ownKeys(r){return Oa(r)},set(r,c,d){const u=r._storage||(r._storage=a());return r[c]=u[c]=d,delete r._keys,!0}})}function Yt(n,e,t,o){const a={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:za(n,o),setContext:s=>Yt(n,s,t,o),override:s=>Yt(n.override(s),e,t,o)};return new Proxy(a,{deleteProperty(s,l){return delete s[l],delete n[l],!0},get(s,l,r){return Na(s,l,()=>Cu(s,l,r))},getOwnPropertyDescriptor(s,l){return s._descriptors.allKeys?Reflect.has(n,l)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,l)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,l){return Reflect.has(n,l)},ownKeys(){return Reflect.ownKeys(n)},set(s,l,r){return n[l]=r,delete s[l],!0}})}function za(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:o=e.indexable,_allKeys:a=e.allKeys}=n;return{allKeys:a,scriptable:t,indexable:o,isScriptable:_t(t)?t:()=>t,isIndexable:_t(o)?o:()=>o}}const wu=(n,e)=>n?n+Fi(e):e,Qi=(n,e)=>se(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Na(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const o=t();return n[e]=o,o}function Cu(n,e,t){const{_proxy:o,_context:a,_subProxy:s,_descriptors:l}=n;let r=o[e];return _t(r)&&l.isScriptable(e)&&(r=Bu(e,r,n,t)),Se(r)&&r.length&&(r=Su(e,r,n,l.isIndexable)),Qi(e,r)&&(r=Yt(r,a,s&&s[e],l)),r}function Bu(n,e,t,o){const{_proxy:a,_context:s,_subProxy:l,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let c=e(s,l||o);return r.delete(n),Qi(n,c)&&(c=eo(a._scopes,a,n,c)),c}function Su(n,e,t,o){const{_proxy:a,_context:s,_subProxy:l,_descriptors:r}=t;if(typeof s.index<"u"&&o(n))return e[s.index%e.length];if(se(e[0])){const c=e,d=a._scopes.filter(u=>u!==c);e=[];for(const u of c){const h=eo(d,a,n,u);e.push(Yt(h,s,l&&l[n],r))}}return e}function Pa(n,e,t){return _t(n)?n(e,t):n}const Eu=(n,e)=>n===!0?e:typeof n=="string"?bt(e,n):void 0;function Mu(n,e,t,o,a){for(const s of e){const l=Eu(t,s);if(l){n.add(l);const r=Pa(l._fallback,t,a);if(typeof r<"u"&&r!==t&&r!==o)return r}else if(l===!1&&typeof o<"u"&&t!==o)return null}return!1}function eo(n,e,t,o){const a=e._rootScopes,s=Pa(e._fallback,t,o),l=[...n,...a],r=new Set;r.add(o);let c=Aa(r,l,t,s||t,o);return c===null||typeof s<"u"&&s!==t&&(c=Aa(r,l,s,c,o),c===null)?!1:Zi(Array.from(r),[""],a,s,()=>vu(e,t,o))}function Aa(n,e,t,o,a){for(;t;)t=Mu(n,e,t,o,a);return t}function vu(n,e,t){const o=n._getTarget();e in o||(o[e]={});const a=o[e];return Se(a)&&se(t)?t:a||{}}function Vu(n,e,t,o){let a;for(const s of e)if(a=Ra(wu(s,n),t),typeof a<"u")return Qi(n,a)?eo(t,o,n,a):a}function Ra(n,e){for(const t of e){if(!t)continue;const o=t[n];if(typeof o<"u")return o}}function Oa(n){let e=n._keys;return e||(e=n._keys=Du(n._scopes)),e}function Du(n){const e=new Set;for(const t of n)for(const o of Object.keys(t).filter(a=>!a.startsWith("_")))e.add(o);return Array.from(e)}function Fa(n,e,t,o){const{iScale:a}=n,{key:s="r"}=this._parsing,l=new Array(o);let r,c,d,u;for(r=0,c=o;r<c;++r)d=r+t,u=e[d],l[r]={r:a.parse(bt(u,s),d)};return l}const $u=Number.EPSILON||1e-14,Ut=(n,e)=>e<n.length&&!n[e].skip&&n[e],Wa=n=>n==="x"?"y":"x";function Tu(n,e,t,o){const a=n.skip?e:n,s=e,l=t.skip?e:t,r=Hi(s,a),c=Hi(l,s);let d=r/(r+c),u=c/(r+c);d=isNaN(d)?0:d,u=isNaN(u)?0:u;const h=o*d,f=o*u;return{previous:{x:s.x-h*(l.x-a.x),y:s.y-h*(l.y-a.y)},next:{x:s.x+f*(l.x-a.x),y:s.y+f*(l.y-a.y)}}}function Iu(n,e,t){const o=n.length;let a,s,l,r,c,d=Ut(n,0);for(let u=0;u<o-1;++u)if(c=d,d=Ut(n,u+1),!(!c||!d)){if(ln(e[u],0,$u)){t[u]=t[u+1]=0;continue}a=t[u]/e[u],s=t[u+1]/e[u],r=Math.pow(a,2)+Math.pow(s,2),!(r<=9)&&(l=3/Math.sqrt(r),t[u]=a*l*e[u],t[u+1]=s*l*e[u])}}function Lu(n,e,t="x"){const o=Wa(t),a=n.length;let s,l,r,c=Ut(n,0);for(let d=0;d<a;++d){if(l=r,r=c,c=Ut(n,d+1),!r)continue;const u=r[t],h=r[o];l&&(s=(u-l[t])/3,r[`cp1${t}`]=u-s,r[`cp1${o}`]=h-s*e[d]),c&&(s=(c[t]-u)/3,r[`cp2${t}`]=u+s,r[`cp2${o}`]=h+s*e[d])}}function zu(n,e="x"){const t=Wa(e),o=n.length,a=Array(o).fill(0),s=Array(o);let l,r,c,d=Ut(n,0);for(l=0;l<o;++l)if(r=c,c=d,d=Ut(n,l+1),!!c){if(d){const u=d[e]-c[e];a[l]=u!==0?(d[t]-c[t])/u:0}s[l]=r?d?nt(a[l-1])!==nt(a[l])?0:(a[l-1]+a[l])/2:a[l-1]:a[l]}Iu(n,a,s),Lu(n,s,e)}function Kn(n,e,t){return Math.max(Math.min(n,t),e)}function Nu(n,e){let t,o,a,s,l,r=ct(n[0],e);for(t=0,o=n.length;t<o;++t)l=s,s=r,r=t<o-1&&ct(n[t+1],e),s&&(a=n[t],l&&(a.cp1x=Kn(a.cp1x,e.left,e.right),a.cp1y=Kn(a.cp1y,e.top,e.bottom)),r&&(a.cp2x=Kn(a.cp2x,e.left,e.right),a.cp2y=Kn(a.cp2y,e.top,e.bottom)))}function Pu(n,e,t,o,a){let s,l,r,c;if(e.spanGaps&&(n=n.filter(d=>!d.skip)),e.cubicInterpolationMode==="monotone")zu(n,a);else{let d=o?n[n.length-1]:n[0];for(s=0,l=n.length;s<l;++s)r=n[s],c=Tu(d,r,n[Math.min(s+1,l-(o?0:1))%l],e.tension),r.cp1x=c.previous.x,r.cp1y=c.previous.y,r.cp2x=c.next.x,r.cp2y=c.next.y,d=r}e.capBezierPoints&&Nu(n,t)}function to(){return typeof window<"u"&&typeof document<"u"}function no(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function qn(n,e,t){let o;return typeof n=="string"?(o=parseInt(n,10),n.indexOf("%")!==-1&&(o=o/100*e.parentNode[t])):o=n,o}const Gn=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Au(n,e){return Gn(n).getPropertyValue(e)}const Ru=["top","right","bottom","left"];function Tt(n,e,t){const o={};t=t?"-"+t:"";for(let a=0;a<4;a++){const s=Ru[a];o[s]=parseFloat(n[e+"-"+s+t])||0}return o.width=o.left+o.right,o.height=o.top+o.bottom,o}const Ou=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Fu(n,e){const t=n.touches,o=t&&t.length?t[0]:n,{offsetX:a,offsetY:s}=o;let l=!1,r,c;if(Ou(a,s,n.target))r=a,c=s;else{const d=e.getBoundingClientRect();r=o.clientX-d.left,c=o.clientY-d.top,l=!0}return{x:r,y:c,box:l}}function It(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:o}=e,a=Gn(t),s=a.boxSizing==="border-box",l=Tt(a,"padding"),r=Tt(a,"border","width"),{x:c,y:d,box:u}=Fu(n,t),h=l.left+(u&&r.left),f=l.top+(u&&r.top);let{width:m,height:p}=e;return s&&(m-=l.width+r.width,p-=l.height+r.height),{x:Math.round((c-h)/m*t.width/o),y:Math.round((d-f)/p*t.height/o)}}function Wu(n,e,t){let o,a;if(e===void 0||t===void 0){const s=n&&no(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const l=s.getBoundingClientRect(),r=Gn(s),c=Tt(r,"border","width"),d=Tt(r,"padding");e=l.width-d.width-c.width,t=l.height-d.height-c.height,o=qn(r.maxWidth,s,"clientWidth"),a=qn(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:o||Wn,maxHeight:a||Wn}}const xt=n=>Math.round(n*10)/10;function Hu(n,e,t,o){const a=Gn(n),s=Tt(a,"margin"),l=qn(a.maxWidth,n,"clientWidth")||Wn,r=qn(a.maxHeight,n,"clientHeight")||Wn,c=Wu(n,e,t);let{width:d,height:u}=c;if(a.boxSizing==="content-box"){const f=Tt(a,"border","width"),m=Tt(a,"padding");d-=m.width+f.width,u-=m.height+f.height}return d=Math.max(0,d-s.width),u=Math.max(0,o?d/o:u-s.height),d=xt(Math.min(d,l,c.maxWidth)),u=xt(Math.min(u,r,c.maxHeight)),d&&!u&&(u=xt(d/2)),(e!==void 0||t!==void 0)&&o&&c.height&&u>c.height&&(u=c.height,d=xt(Math.floor(u*o))),{width:d,height:u}}function Ha(n,e,t){const o=e||1,a=xt(n.height*o),s=xt(n.width*o);n.height=xt(n.height),n.width=xt(n.width);const l=n.canvas;return l.style&&(t||!l.style.height&&!l.style.width)&&(l.style.height=`${n.height}px`,l.style.width=`${n.width}px`),n.currentDevicePixelRatio!==o||l.height!==a||l.width!==s?(n.currentDevicePixelRatio=o,l.height=a,l.width=s,n.ctx.setTransform(o,0,0,o,0,0),!0):!1}const ju=(function(){let n=!1;try{const e={get passive(){return n=!0,!1}};to()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n})();function ja(n,e){const t=Au(n,e),o=t&&t.match(/^(\d+)(\.\d+)?px$/);return o?+o[1]:void 0}function Lt(n,e,t,o){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Yu(n,e,t,o){return{x:n.x+t*(e.x-n.x),y:o==="middle"?t<.5?n.y:e.y:o==="after"?t<1?n.y:e.y:t>0?e.y:n.y}}function Uu(n,e,t,o){const a={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},l=Lt(n,a,t),r=Lt(a,s,t),c=Lt(s,e,t),d=Lt(l,r,t),u=Lt(r,c,t);return Lt(d,u,t)}const Xu=function(n,e){return{x(t){return n+n+e-t},setWidth(t){e=t},textAlign(t){return t==="center"?t:t==="right"?"left":"right"},xPlus(t,o){return t-o},leftForLtr(t,o){return t-o}}},Ku=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function Xt(n,e,t){return n?Xu(e,t):Ku()}function Ya(n,e){let t,o;(e==="ltr"||e==="rtl")&&(t=n.canvas.style,o=[t.getPropertyValue("direction"),t.getPropertyPriority("direction")],t.setProperty("direction",e,"important"),n.prevTextDirection=o)}function Ua(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Xa(n){return n==="angle"?{between:rn,compare:qd,normalize:Oe}:{between:lt,compare:(e,t)=>e-t,normalize:e=>e}}function Ka({start:n,end:e,count:t,loop:o,style:a}){return{start:n%t,end:e%t,loop:o&&(e-n+1)%t===0,style:a}}function qu(n,e,t){const{property:o,start:a,end:s}=t,{between:l,normalize:r}=Xa(o),c=e.length;let{start:d,end:u,loop:h}=n,f,m;if(h){for(d+=c,u+=c,f=0,m=c;f<m&&l(r(e[d%c][o]),a,s);++f)d--,u--;d%=c,u%=c}return u<d&&(u+=c),{start:d,end:u,loop:h,style:n.style}}function qa(n,e,t){if(!t)return[n];const{property:o,start:a,end:s}=t,l=e.length,{compare:r,between:c,normalize:d}=Xa(o),{start:u,end:h,loop:f,style:m}=qu(n,e,t),p=[];let g=!1,b=null,_,k,B;const C=()=>c(a,B,_)&&r(a,B)!==0,y=()=>r(s,_)===0||c(s,B,_),x=()=>g||C(),S=()=>!g||y();for(let w=u,M=u;w<=h;++w)k=e[w%l],!k.skip&&(_=d(k[o]),_!==B&&(g=c(_,a,s),b===null&&x()&&(b=r(_,a)===0?w:M),b!==null&&S()&&(p.push(Ka({start:b,end:w,loop:f,count:l,style:m})),b=null),M=w,B=_));return b!==null&&p.push(Ka({start:b,end:h,loop:f,count:l,style:m})),p}function Ga(n,e){const t=[],o=n.segments;for(let a=0;a<o.length;a++){const s=qa(o[a],n.points,e);s.length&&t.push(...s)}return t}function Gu(n,e,t,o){let a=0,s=e-1;if(t&&!o)for(;a<e&&!n[a].skip;)a++;for(;a<e&&n[a].skip;)a++;for(a%=e,t&&(s+=a);s>a&&n[s%e].skip;)s--;return s%=e,{start:a,end:s}}function Ju(n,e,t,o){const a=n.length,s=[];let l=e,r=n[e],c;for(c=e+1;c<=t;++c){const d=n[c%a];d.skip||d.stop?r.skip||(o=!1,s.push({start:e%a,end:(c-1)%a,loop:o}),e=l=d.stop?c:null):(l=c,r.skip&&(e=c)),r=d}return l!==null&&s.push({start:e%a,end:l%a,loop:o}),s}function Zu(n,e){const t=n.points,o=n.options.spanGaps,a=t.length;if(!a)return[];const s=!!n._loop,{start:l,end:r}=Gu(t,a,s,o);if(o===!0)return Ja(n,[{start:l,end:r,loop:s}],t,e);const c=r<l?r+a:r,d=!!n._fullLoop&&l===0&&r===a-1;return Ja(n,Ju(t,l,c,d),t,e)}function Ja(n,e,t,o){return!o||!o.setContext||!t?e:Qu(n,e,t,o)}function Qu(n,e,t,o){const a=n._chart.getContext(),s=Za(n.options),{_datasetIndex:l,options:{spanGaps:r}}=n,c=t.length,d=[];let u=s,h=e[0].start,f=h;function m(p,g,b,_){const k=r?-1:1;if(p!==g){for(p+=c;t[p%c].skip;)p-=k;for(;t[g%c].skip;)g+=k;p%c!==g%c&&(d.push({start:p%c,end:g%c,loop:b,style:_}),u=_,h=g%c)}}for(const p of e){h=r?h:p.start;let g=t[h%c],b;for(f=h+1;f<=p.end;f++){const _=t[f%c];b=Za(o.setContext(kt(a,{type:"segment",p0:g,p1:_,p0DataIndex:(f-1)%c,p1DataIndex:f%c,datasetIndex:l}))),eh(b,u)&&m(h,f-1,p.loop,u),g=_,u=b}h<f-1&&m(h,f-1,p.loop,u)}return d}function Za(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function eh(n,e){if(!e)return!1;const t=[],o=function(a,s){return Ui(s)?(t.includes(s)||t.push(s),t.indexOf(s)):s};return JSON.stringify(n,o)!==JSON.stringify(e,o)}function Jn(n,e,t){return n.options.clip?n[t]:e[t]}function th(n,e){const{xScale:t,yScale:o}=n;return t&&o?{left:Jn(t,e,"left"),right:Jn(t,e,"right"),top:Jn(o,e,"top"),bottom:Jn(o,e,"bottom")}:e}function Qa(n,e){const t=e._clip;if(t.disabled)return!1;const o=th(e,n.chartArea);return{left:t.left===!1?0:o.left-(t.left===!0?0:t.left),right:t.right===!1?n.width:o.right+(t.right===!0?0:t.right),top:t.top===!1?0:o.top-(t.top===!0?0:t.top),bottom:t.bottom===!1?n.height:o.bottom+(t.bottom===!0?0:t.bottom)}}/*!
39
+ * Chart.js v4.5.1
40
+ * https://www.chartjs.org
41
+ * (c) 2025 Chart.js Contributors
42
+ * Released under the MIT License
43
+ */class nh{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,o,a){const s=t.listeners[a],l=t.duration;s.forEach(r=>r({chart:e,initial:t.initial,numSteps:l,currentStep:Math.min(o-t.start,l)}))}_refresh(){this._request||(this._running=!0,this._request=Ca.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((o,a)=>{if(!o.running||!o.items.length)return;const s=o.items;let l=s.length-1,r=!1,c;for(;l>=0;--l)c=s[l],c._active?(c._total>o.duration&&(o.duration=c._total),c.tick(e),r=!0):(s[l]=s[s.length-1],s.pop());r&&(a.draw(),this._notify(a,o,e,"progress")),s.length||(o.running=!1,this._notify(a,o,e,"complete"),o.initial=!1),t+=s.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let o=t.get(e);return o||(o={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,o)),o}listen(e,t,o){this._getAnims(e).listeners[t].push(o)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((o,a)=>Math.max(o,a._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const o=t.items;let a=o.length-1;for(;a>=0;--a)o[a].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var dt=new nh;const es="transparent",ih={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const o=Va(n||es),a=o.valid&&Va(e||es);return a&&a.valid?a.mix(o,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class oh{constructor(e,t,o,a){const s=t[o];a=fn([e.to,a,s,e.from]);const l=fn([e.from,s,a]);this._active=!0,this._fn=e.fn||ih[e.type||typeof l],this._easing=cn[e.easing]||cn.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=o,this._from=l,this._to=a,this._promises=void 0}active(){return this._active}update(e,t,o){if(this._active){this._notify(!1);const a=this._target[this._prop],s=o-this._start,l=this._duration-s;this._start=o,this._duration=Math.floor(Math.max(l,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=fn([e.to,t,a,e.from]),this._from=fn([e.from,a,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,o=this._duration,a=this._prop,s=this._from,l=this._loop,r=this._to;let c;if(this._active=s!==r&&(l||t<o),!this._active){this._target[a]=r,this._notify(!0);return}if(t<0){this._target[a]=s;return}c=t/o%2,c=l&&c>1?2-c:c,c=this._easing(Math.min(1,Math.max(0,c))),this._target[a]=this._fn(s,r,c)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,o)=>{e.push({res:t,rej:o})})}_notify(e){const t=e?"res":"rej",o=this._promises||[];for(let a=0;a<o.length;a++)o[a][t]()}}class ts{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!se(e))return;const t=Object.keys(Ee.animation),o=this._properties;Object.getOwnPropertyNames(e).forEach(a=>{const s=e[a];if(!se(s))return;const l={};for(const r of t)l[r]=s[r];(Se(s.properties)&&s.properties||[a]).forEach(r=>{(r===a||!o.has(r))&&o.set(r,l)})})}_animateOptions(e,t){const o=t.options,a=sh(e,o);if(!a)return[];const s=this._createAnimations(a,o);return o.$shared&&ah(e.options.$animations,o).then(()=>{e.options=o},()=>{}),s}_createAnimations(e,t){const o=this._properties,a=[],s=e.$animations||(e.$animations={}),l=Object.keys(t),r=Date.now();let c;for(c=l.length-1;c>=0;--c){const d=l[c];if(d.charAt(0)==="$")continue;if(d==="options"){a.push(...this._animateOptions(e,t));continue}const u=t[d];let h=s[d];const f=o.get(d);if(h)if(f&&h.active()){h.update(f,u,r);continue}else h.cancel();if(!f||!f.duration){e[d]=u;continue}s[d]=h=new oh(f,e,d,u),a.push(h)}return a}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const o=this._createAnimations(e,t);if(o.length)return dt.add(this._chart,o),!0}}function ah(n,e){const t=[],o=Object.keys(e);for(let a=0;a<o.length;a++){const s=n[o[a]];s&&s.active()&&t.push(s.wait())}return Promise.all(t)}function sh(n,e){if(!e)return;let t=n.options;if(!t){n.options=e;return}return t.$shared&&(n.options=t=Object.assign({},t,{$shared:!1,$animations:{}})),t}function ns(n,e){const t=n&&n.options||{},o=t.reverse,a=t.min===void 0?e:0,s=t.max===void 0?e:0;return{start:o?s:a,end:o?a:s}}function lh(n,e,t){if(t===!1)return!1;const o=ns(n,t),a=ns(e,t);return{top:a.end,right:o.end,bottom:a.start,left:o.start}}function rh(n){let e,t,o,a;return se(n)?(e=n.top,t=n.right,o=n.bottom,a=n.left):e=t=o=a=n,{top:e,right:t,bottom:o,left:a,disabled:n===!1}}function is(n,e){const t=[],o=n._getSortedDatasetMetas(e);let a,s;for(a=0,s=o.length;a<s;++a)t.push(o[a].index);return t}function os(n,e,t,o={}){const a=n.keys,s=o.mode==="single";let l,r,c,d;if(e===null)return;let u=!1;for(l=0,r=a.length;l<r;++l){if(c=+a[l],c===t){if(u=!0,o.all)continue;break}d=n.values[c],Me(d)&&(s||e===0||nt(e)===nt(d))&&(e+=d)}return!u&&!o.all?0:e}function ch(n,e){const{iScale:t,vScale:o}=e,a=t.axis==="x"?"x":"y",s=o.axis==="x"?"x":"y",l=Object.keys(n),r=new Array(l.length);let c,d,u;for(c=0,d=l.length;c<d;++c)u=l[c],r[c]={[a]:u,[s]:n[u]};return r}function io(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function dh(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function uh(n){const{min:e,max:t,minDefined:o,maxDefined:a}=n.getUserBounds();return{min:o?e:Number.NEGATIVE_INFINITY,max:a?t:Number.POSITIVE_INFINITY}}function hh(n,e,t){const o=n[e]||(n[e]={});return o[t]||(o[t]={})}function as(n,e,t,o){for(const a of e.getMatchingVisibleMetas(o).reverse()){const s=n[a.index];if(t&&s>0||!t&&s<0)return a.index}return null}function ss(n,e){const{chart:t,_cachedMeta:o}=n,a=t._stacks||(t._stacks={}),{iScale:s,vScale:l,index:r}=o,c=s.axis,d=l.axis,u=dh(s,l,o),h=e.length;let f;for(let m=0;m<h;++m){const p=e[m],{[c]:g,[d]:b}=p,_=p._stacks||(p._stacks={});f=_[d]=hh(a,u,g),f[r]=b,f._top=as(f,l,!0,o.type),f._bottom=as(f,l,!1,o.type);const k=f._visualValues||(f._visualValues={});k[r]=b}}function oo(n,e){const t=n.scales;return Object.keys(t).filter(o=>t[o].axis===e).shift()}function fh(n,e){return kt(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function mh(n,e,t){return kt(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function mn(n,e){const t=n.controller.index,o=n.vScale&&n.vScale.axis;if(o){e=e||n._parsed;for(const a of e){const s=a._stacks;if(!s||s[o]===void 0||s[o][t]===void 0)return;delete s[o][t],s[o]._visualValues!==void 0&&s[o]._visualValues[t]!==void 0&&delete s[o]._visualValues[t]}}}const ao=n=>n==="reset"||n==="none",ls=(n,e)=>e?n:Object.assign({},n),ph=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:is(t,!0),values:null};class Qe{constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,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 e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=io(e.vScale,e),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(e){this.index!==e&&mn(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,o=this.getDataset(),a=(h,f,m,p)=>h==="x"?f:h==="r"?p:m,s=t.xAxisID=ie(o.xAxisID,oo(e,"x")),l=t.yAxisID=ie(o.yAxisID,oo(e,"y")),r=t.rAxisID=ie(o.rAxisID,oo(e,"r")),c=t.indexAxis,d=t.iAxisID=a(c,s,l,r),u=t.vAxisID=a(c,l,s,r);t.xScale=this.getScaleForId(s),t.yScale=this.getScaleForId(l),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(d),t.vScale=this.getScaleForId(u)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&xa(this._data,this),e._stacked&&mn(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),o=this._data;if(se(t)){const a=this._cachedMeta;this._data=ch(t,a)}else if(o!==t){if(o){xa(o,this);const a=this._cachedMeta;mn(a),a._parsed=[]}t&&Object.isExtensible(t)&&Qd(t,this),this._syncList=[],this._data=t}}addElements(){const e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){const t=this._cachedMeta,o=this.getDataset();let a=!1;this._dataCheck();const s=t._stacked;t._stacked=io(t.vScale,t),t.stack!==o.stack&&(a=!0,mn(t),t.stack=o.stack),this._resyncElements(e),(a||s!==t._stacked)&&(ss(this,t._parsed),t._stacked=io(t.vScale,t))}configure(){const e=this.chart.config,t=e.datasetScopeKeys(this._type),o=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(o,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){const{_cachedMeta:o,_data:a}=this,{iScale:s,_stacked:l}=o,r=s.axis;let c=e===0&&t===a.length?!0:o._sorted,d=e>0&&o._parsed[e-1],u,h,f;if(this._parsing===!1)o._parsed=a,o._sorted=!0,f=a;else{Se(a[e])?f=this.parseArrayData(o,a,e,t):se(a[e])?f=this.parseObjectData(o,a,e,t):f=this.parsePrimitiveData(o,a,e,t);const m=()=>h[r]===null||d&&h[r]<d[r];for(u=0;u<t;++u)o._parsed[u+e]=h=f[u],c&&(m()&&(c=!1),d=h);o._sorted=c}l&&ss(this,f)}parsePrimitiveData(e,t,o,a){const{iScale:s,vScale:l}=e,r=s.axis,c=l.axis,d=s.getLabels(),u=s===l,h=new Array(a);let f,m,p;for(f=0,m=a;f<m;++f)p=f+o,h[f]={[r]:u||s.parse(d[p],p),[c]:l.parse(t[p],p)};return h}parseArrayData(e,t,o,a){const{xScale:s,yScale:l}=e,r=new Array(a);let c,d,u,h;for(c=0,d=a;c<d;++c)u=c+o,h=t[u],r[c]={x:s.parse(h[0],u),y:l.parse(h[1],u)};return r}parseObjectData(e,t,o,a){const{xScale:s,yScale:l}=e,{xAxisKey:r="x",yAxisKey:c="y"}=this._parsing,d=new Array(a);let u,h,f,m;for(u=0,h=a;u<h;++u)f=u+o,m=t[f],d[u]={x:s.parse(bt(m,r),f),y:l.parse(bt(m,c),f)};return d}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,o){const a=this.chart,s=this._cachedMeta,l=t[e.axis],r={keys:is(a,!0),values:t._stacks[e.axis]._visualValues};return os(r,l,s.index,{mode:o})}updateRangeFromParsed(e,t,o,a){const s=o[t.axis];let l=s===null?NaN:s;const r=a&&o._stacks[t.axis];a&&r&&(a.values=r,l=os(a,s,this._cachedMeta.index)),e.min=Math.min(e.min,l),e.max=Math.max(e.max,l)}getMinMax(e,t){const o=this._cachedMeta,a=o._parsed,s=o._sorted&&e===o.iScale,l=a.length,r=this._getOtherScale(e),c=ph(t,o,this.chart),d={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:u,max:h}=uh(r);let f,m;function p(){m=a[f];const g=m[r.axis];return!Me(m[e.axis])||u>g||h<g}for(f=0;f<l&&!(!p()&&(this.updateRangeFromParsed(d,e,m,c),s));++f);if(s){for(f=l-1;f>=0;--f)if(!p()){this.updateRangeFromParsed(d,e,m,c);break}}return d}getAllParsedValues(e){const t=this._cachedMeta._parsed,o=[];let a,s,l;for(a=0,s=t.length;a<s;++a)l=t[a][e.axis],Me(l)&&o.push(l);return o}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,o=t.iScale,a=t.vScale,s=this.getParsed(e);return{label:o?""+o.getLabelForValue(s[o.axis]):"",value:a?""+a.getLabelForValue(s[a.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=rh(ie(this.options.clip,lh(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,o=this._cachedMeta,a=o.data||[],s=t.chartArea,l=[],r=this._drawStart||0,c=this._drawCount||a.length-r,d=this.options.drawActiveElementsOnTop;let u;for(o.dataset&&o.dataset.draw(e,s,r,c),u=r;u<r+c;++u){const h=a[u];h.hidden||(h.active&&d?l.push(h):h.draw(e,s))}for(u=0;u<l.length;++u)l[u].draw(e,s)}getStyle(e,t){const o=t?"active":"default";return e===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(o):this.resolveDataElementOptions(e||0,o)}getContext(e,t,o){const a=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const l=this._cachedMeta.data[e];s=l.$context||(l.$context=mh(this.getContext(),e,l)),s.parsed=this.getParsed(e),s.raw=a.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=fh(this.chart.getContext(),this.index)),s.dataset=a,s.index=s.datasetIndex=this.index;return s.active=!!t,s.mode=o,s}resolveDatasetElementOptions(e){return this._resolveElementOptions(this.datasetElementType.id,e)}resolveDataElementOptions(e,t){return this._resolveElementOptions(this.dataElementType.id,t,e)}_resolveElementOptions(e,t="default",o){const a=t==="active",s=this._cachedDataOpts,l=e+"-"+t,r=s[l],c=this.enableOptionSharing&&sn(o);if(r)return ls(r,c);const d=this.chart.config,u=d.datasetElementScopeKeys(this._type,e),h=a?[`${e}Hover`,"hover",e,""]:[e,""],f=d.getOptionScopes(this.getDataset(),u),m=Object.keys(Ee.elements[e]),p=()=>this.getContext(o,a,t),g=d.resolveNamedOptions(f,m,p,h);return g.$shared&&(g.$shared=c,s[l]=Object.freeze(ls(g,c))),g}_resolveAnimations(e,t,o){const a=this.chart,s=this._cachedDataOpts,l=`animation-${t}`,r=s[l];if(r)return r;let c;if(a.options.animation!==!1){const u=this.chart.config,h=u.datasetAnimationScopeKeys(this._type,t),f=u.getOptionScopes(this.getDataset(),h);c=u.createResolver(f,this.getContext(e,o,t))}const d=new ts(a,c&&c.animations);return c&&c._cacheable&&(s[l]=Object.freeze(d)),d}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||ao(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const o=this.resolveDataElementOptions(e,t),a=this._sharedOptions,s=this.getSharedOptions(o),l=this.includeOptions(t,s)||s!==a;return this.updateSharedOptions(s,t,o),{sharedOptions:s,includeOptions:l}}updateElement(e,t,o,a){ao(a)?Object.assign(e,o):this._resolveAnimations(t,a).update(e,o)}updateSharedOptions(e,t,o){e&&!ao(t)&&this._resolveAnimations(void 0,t).update(e,o)}_setStyle(e,t,o,a){e.active=a;const s=this.getStyle(t,a);this._resolveAnimations(t,o,a).update(e,{options:!a&&this.getSharedOptions(s)||s})}removeHoverStyle(e,t,o){this._setStyle(e,o,"active",!1)}setHoverStyle(e,t,o){this._setStyle(e,o,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,o=this._cachedMeta.data;for(const[r,c,d]of this._syncList)this[r](c,d);this._syncList=[];const a=o.length,s=t.length,l=Math.min(s,a);l&&this.parse(0,l),s>a?this._insertElements(a,s-a,e):s<a&&this._removeElements(s,a-s)}_insertElements(e,t,o=!0){const a=this._cachedMeta,s=a.data,l=e+t;let r;const c=d=>{for(d.length+=t,r=d.length-1;r>=l;r--)d[r]=d[r-t]};for(c(s),r=e;r<l;++r)s[r]=new this.dataElementType;this._parsing&&c(a._parsed),this.parse(e,t),o&&this.updateElements(s,e,t,"reset")}updateElements(e,t,o,a){}_removeElements(e,t){const o=this._cachedMeta;if(this._parsing){const a=o._parsed.splice(e,t);o._stacked&&mn(o,a)}o.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,o,a]=e;this[t](o,a)}this.chart._dataChanges.push([this.index,...e])}_onDataPush(){const e=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-e,e])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(e,t){t&&this._sync(["_removeElements",e,t]);const o=arguments.length-2;o&&this._sync(["_insertElements",e,o])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}W(Qe,"defaults",{}),W(Qe,"datasetElementType",null),W(Qe,"dataElementType",null);function gh(n,e){if(!n._cache.$bar){const t=n.getMatchingVisibleMetas(e);let o=[];for(let a=0,s=t.length;a<s;a++)o=o.concat(t[a].controller.getAllParsedValues(n));n._cache.$bar=wa(o.sort((a,s)=>a-s))}return n._cache.$bar}function bh(n){const e=n.iScale,t=gh(e,n.type);let o=e._length,a,s,l,r;const c=()=>{l===32767||l===-32768||(sn(r)&&(o=Math.min(o,Math.abs(l-r)||o)),r=l)};for(a=0,s=t.length;a<s;++a)l=e.getPixelForValue(t[a]),c();for(r=void 0,a=0,s=e.ticks.length;a<s;++a)l=e.getPixelForTick(a),c();return o}function _h(n,e,t,o){const a=t.barThickness;let s,l;return ae(a)?(s=e.min*t.categoryPercentage,l=t.barPercentage):(s=a*o,l=1),{chunk:s/o,ratio:l,start:e.pixels[n]-s/2}}function yh(n,e,t,o){const a=e.pixels,s=a[n];let l=n>0?a[n-1]:null,r=n<a.length-1?a[n+1]:null;const c=t.categoryPercentage;l===null&&(l=s-(r===null?e.end-e.start:r-s)),r===null&&(r=s+s-l);const d=s-(s-Math.min(l,r))/2*c;return{chunk:Math.abs(r-l)/2*c/o,ratio:t.barPercentage,start:d}}function kh(n,e,t,o){const a=t.parse(n[0],o),s=t.parse(n[1],o),l=Math.min(a,s),r=Math.max(a,s);let c=l,d=r;Math.abs(l)>Math.abs(r)&&(c=r,d=l),e[t.axis]=d,e._custom={barStart:c,barEnd:d,start:a,end:s,min:l,max:r}}function rs(n,e,t,o){return Se(n)?kh(n,e,t,o):e[t.axis]=t.parse(n,o),e}function cs(n,e,t,o){const a=n.iScale,s=n.vScale,l=a.getLabels(),r=a===s,c=[];let d,u,h,f;for(d=t,u=t+o;d<u;++d)f=e[d],h={},h[a.axis]=r||a.parse(l[d],d),c.push(rs(f,h,s,d));return c}function so(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function xh(n,e,t){return n!==0?nt(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function wh(n){let e,t,o,a,s;return n.horizontal?(e=n.base>n.x,t="left",o="right"):(e=n.base<n.y,t="bottom",o="top"),e?(a="end",s="start"):(a="start",s="end"),{start:t,end:o,reverse:e,top:a,bottom:s}}function Ch(n,e,t,o){let a=e.borderSkipped;const s={};if(!a){n.borderSkipped=s;return}if(a===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:l,end:r,reverse:c,top:d,bottom:u}=wh(n);a==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===o?a=d:(t._bottom||0)===o?a=u:(s[ds(u,l,r,c)]=!0,a=d)),s[ds(a,l,r,c)]=!0,n.borderSkipped=s}function ds(n,e,t,o){return o?(n=Bh(n,e,t),n=us(n,t,e)):n=us(n,e,t),n}function Bh(n,e,t){return n===e?t:n===t?e:n}function us(n,e,t){return n==="start"?e:n==="end"?t:n}function Sh(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class Zn extends Qe{parsePrimitiveData(e,t,o,a){return cs(e,t,o,a)}parseArrayData(e,t,o,a){return cs(e,t,o,a)}parseObjectData(e,t,o,a){const{iScale:s,vScale:l}=e,{xAxisKey:r="x",yAxisKey:c="y"}=this._parsing,d=s.axis==="x"?r:c,u=l.axis==="x"?r:c,h=[];let f,m,p,g;for(f=o,m=o+a;f<m;++f)g=t[f],p={},p[s.axis]=s.parse(bt(g,d),f),h.push(rs(bt(g,u),p,l,f));return h}updateRangeFromParsed(e,t,o,a){super.updateRangeFromParsed(e,t,o,a);const s=o._custom;s&&t===this._cachedMeta.vScale&&(e.min=Math.min(e.min,s.min),e.max=Math.max(e.max,s.max))}getMaxOverflow(){return 0}getLabelAndValue(e){const t=this._cachedMeta,{iScale:o,vScale:a}=t,s=this.getParsed(e),l=s._custom,r=so(l)?"["+l.start+", "+l.end+"]":""+a.getLabelForValue(s[a.axis]);return{label:""+o.getLabelForValue(s[o.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,o,a){const s=a==="reset",{index:l,_cachedMeta:{vScale:r}}=this,c=r.getBasePixel(),d=r.isHorizontal(),u=this._getRuler(),{sharedOptions:h,includeOptions:f}=this._getSharedOptions(t,a);for(let m=t;m<t+o;m++){const p=this.getParsed(m),g=s||ae(p[r.axis])?{base:c,head:c}:this._calculateBarValuePixels(m),b=this._calculateBarIndexPixels(m,u),_=(p._stacks||{})[r.axis],k={horizontal:d,base:g.base,enableBorderRadius:!_||so(p._custom)||l===_._top||l===_._bottom,x:d?g.head:b.center,y:d?b.center:g.head,height:d?b.size:Math.abs(g.size),width:d?Math.abs(g.size):b.size};f&&(k.options=h||this.resolveDataElementOptions(m,e[m].active?"active":a));const B=k.options||e[m].options;Ch(k,B,_,l),Sh(k,B,u.ratio),this.updateElement(e[m],m,k,a)}}_getStacks(e,t){const{iScale:o}=this._cachedMeta,a=o.getMatchingVisibleMetas(this._type).filter(u=>u.controller.options.grouped),s=o.options.stacked,l=[],r=this._cachedMeta.controller.getParsed(t),c=r&&r[o.axis],d=u=>{const h=u._parsed.find(m=>m[o.axis]===c),f=h&&h[u.vScale.axis];if(ae(f)||isNaN(f))return!0};for(const u of a)if(!(t!==void 0&&d(u))&&((s===!1||l.indexOf(u.stack)===-1||s===void 0&&u.stack===void 0)&&l.push(u.stack),u.index===e))break;return l.length||l.push(void 0),l}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(o=>e[o].axis===t).shift()}_getAxis(){const e={},t=this.getFirstScaleIdForIndexAxis();for(const o of this.chart.data.datasets)e[ie(this.chart.options.indexAxis==="x"?o.xAxisID:o.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,o){const a=this._getStacks(e,o),s=t!==void 0?a.indexOf(t):-1;return s===-1?a.length-1:s}_getRuler(){const e=this.options,t=this._cachedMeta,o=t.iScale,a=[];let s,l;for(s=0,l=t.data.length;s<l;++s)a.push(o.getPixelForValue(this.getParsed(s)[o.axis],s));const r=e.barThickness;return{min:r||bh(t),pixels:a,start:o._startPixel,end:o._endPixel,stackCount:this._getStackCount(),scale:o,grouped:e.grouped,ratio:r?1:e.categoryPercentage*e.barPercentage}}_calculateBarValuePixels(e){const{_cachedMeta:{vScale:t,_stacked:o,index:a},options:{base:s,minBarLength:l}}=this,r=s||0,c=this.getParsed(e),d=c._custom,u=so(d);let h=c[t.axis],f=0,m=o?this.applyStack(t,c,o):h,p,g;m!==h&&(f=m-h,m=h),u&&(h=d.barStart,m=d.barEnd-d.barStart,h!==0&&nt(h)!==nt(d.barEnd)&&(f=0),f+=h);const b=!ae(s)&&!u?s:f;let _=t.getPixelForValue(b);if(this.chart.getDataVisibility(e)?p=t.getPixelForValue(f+m):p=_,g=p-_,Math.abs(g)<l){g=xh(g,t,r)*l,h===r&&(_-=g/2);const k=t.getPixelForDecimal(0),B=t.getPixelForDecimal(1),C=Math.min(k,B),y=Math.max(k,B);_=Math.max(Math.min(_,y),C),p=_+g,o&&!u&&(c._stacks[t.axis]._visualValues[a]=t.getValueForPixel(p)-t.getValueForPixel(_))}if(_===t.getPixelForValue(r)){const k=nt(g)*t.getLineWidthForValue(r)/2;_+=k,g-=k}return{size:g,base:_,head:p,center:p+g/2}}_calculateBarIndexPixels(e,t){const o=t.scale,a=this.options,s=a.skipNull,l=ie(a.maxBarThickness,1/0);let r,c;const d=this._getAxisCount();if(t.grouped){const u=s?this._getStackCount(e):t.stackCount,h=a.barThickness==="flex"?yh(e,t,a,u*d):_h(e,t,a,u*d),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,m=this._getAxis().indexOf(ie(f,this.getFirstScaleIdForIndexAxis())),p=this._getStackIndex(this.index,this._cachedMeta.stack,s?e:void 0)+m;r=h.start+h.chunk*p+h.chunk/2,c=Math.min(l,h.chunk*h.ratio)}else r=o.getPixelForValue(this.getParsed(e)[o.axis],e),c=Math.min(l,t.min*t.ratio);return{base:r-c/2,head:r+c/2,center:r,size:c}}draw(){const e=this._cachedMeta,t=e.vScale,o=e.data,a=o.length;let s=0;for(;s<a;++s)this.getParsed(s)[t.axis]!==null&&!o[s].hidden&&o[s].draw(this._ctx)}}W(Zn,"id","bar"),W(Zn,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),W(Zn,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Qn extends Qe{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(e,t,o,a){const s=super.parsePrimitiveData(e,t,o,a);for(let l=0;l<s.length;l++)s[l]._custom=this.resolveDataElementOptions(l+o).radius;return s}parseArrayData(e,t,o,a){const s=super.parseArrayData(e,t,o,a);for(let l=0;l<s.length;l++){const r=t[o+l];s[l]._custom=ie(r[2],this.resolveDataElementOptions(l+o).radius)}return s}parseObjectData(e,t,o,a){const s=super.parseObjectData(e,t,o,a);for(let l=0;l<s.length;l++){const r=t[o+l];s[l]._custom=ie(r&&r.r&&+r.r,this.resolveDataElementOptions(l+o).radius)}return s}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let o=e.length-1;o>=0;--o)t=Math.max(t,e[o].size(this.resolveDataElementOptions(o))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,o=this.chart.data.labels||[],{xScale:a,yScale:s}=t,l=this.getParsed(e),r=a.getLabelForValue(l.x),c=s.getLabelForValue(l.y),d=l._custom;return{label:o[e]||"",value:"("+r+", "+c+(d?", "+d:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,o,a){const s=a==="reset",{iScale:l,vScale:r}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,a),u=l.axis,h=r.axis;for(let f=t;f<t+o;f++){const m=e[f],p=!s&&this.getParsed(f),g={},b=g[u]=s?l.getPixelForDecimal(.5):l.getPixelForValue(p[u]),_=g[h]=s?r.getBasePixel():r.getPixelForValue(p[h]);g.skip=isNaN(b)||isNaN(_),d&&(g.options=c||this.resolveDataElementOptions(f,m.active?"active":a),s&&(g.options.radius=0)),this.updateElement(m,f,g,a)}}resolveDataElementOptions(e,t){const o=this.getParsed(e);let a=super.resolveDataElementOptions(e,t);a.$shared&&(a=Object.assign({},a,{$shared:!1}));const s=a.radius;return t!=="active"&&(a.radius=0),a.radius+=ie(o&&o._custom,s),a}}W(Qn,"id","bubble"),W(Qn,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),W(Qn,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function Eh(n,e,t){let o=1,a=1,s=0,l=0;if(e<Ce){const r=n,c=r+e,d=Math.cos(r),u=Math.sin(r),h=Math.cos(c),f=Math.sin(c),m=(B,C,y)=>rn(B,r,c,!0)?1:Math.max(C,C*t,y,y*t),p=(B,C,y)=>rn(B,r,c,!0)?-1:Math.min(C,C*t,y,y*t),g=m(0,d,h),b=m(Ve,u,f),_=p(de,d,h),k=p(de+Ve,u,f);o=(g-_)/2,a=(b-k)/2,s=-(g+_)/2,l=-(b+k)/2}return{ratioX:o,ratioY:a,offsetX:s,offsetY:l}}class zt extends Qe{constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){const o=this.getDataset().data,a=this._cachedMeta;if(this._parsing===!1)a._parsed=o;else{let s=c=>+o[c];if(se(o[e])){const{key:c="value"}=this._parsing;s=d=>+bt(o[d],c)}let l,r;for(l=e,r=e+t;l<r;++l)a._parsed[l]=s(l)}}_getRotation(){return Ze(this.options.rotation-90)}_getCircumference(){return Ze(this.options.circumference)}_getRotationExtents(){let e=Ce,t=-Ce;for(let o=0;o<this.chart.data.datasets.length;++o)if(this.chart.isDatasetVisible(o)&&this.chart.getDatasetMeta(o).type===this._type){const a=this.chart.getDatasetMeta(o).controller,s=a._getRotation(),l=a._getCircumference();e=Math.min(e,s),t=Math.max(t,s+l)}return{rotation:e,circumference:t-e}}update(e){const t=this.chart,{chartArea:o}=t,a=this._cachedMeta,s=a.data,l=this.getMaxBorderWidth()+this.getMaxOffset(s)+this.options.spacing,r=Math.max((Math.min(o.width,o.height)-l)/2,0),c=Math.min(Ad(this.options.cutout,r),1),d=this._getRingWeight(this.index),{circumference:u,rotation:h}=this._getRotationExtents(),{ratioX:f,ratioY:m,offsetX:p,offsetY:g}=Eh(h,u,c),b=(o.width-l)/f,_=(o.height-l)/m,k=Math.max(Math.min(b,_)/2,0),B=ua(this.options.radius,k),C=Math.max(B*c,0),y=(B-C)/this._getVisibleDatasetWeightTotal();this.offsetX=p*B,this.offsetY=g*B,a.total=this.calculateTotal(),this.outerRadius=B-y*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-y*d,0),this.updateElements(s,0,s.length,e)}_circumference(e,t){const o=this.options,a=this._cachedMeta,s=this._getCircumference();return t&&o.animation.animateRotate||!this.chart.getDataVisibility(e)||a._parsed[e]===null||a.data[e].hidden?0:this.calculateCircumference(a._parsed[e]*s/Ce)}updateElements(e,t,o,a){const s=a==="reset",l=this.chart,r=l.chartArea,d=l.options.animation,u=(r.left+r.right)/2,h=(r.top+r.bottom)/2,f=s&&d.animateScale,m=f?0:this.innerRadius,p=f?0:this.outerRadius,{sharedOptions:g,includeOptions:b}=this._getSharedOptions(t,a);let _=this._getRotation(),k;for(k=0;k<t;++k)_+=this._circumference(k,s);for(k=t;k<t+o;++k){const B=this._circumference(k,s),C=e[k],y={x:u+this.offsetX,y:h+this.offsetY,startAngle:_,endAngle:_+B,circumference:B,outerRadius:p,innerRadius:m};b&&(y.options=g||this.resolveDataElementOptions(k,C.active?"active":a)),_+=B,this.updateElement(C,k,y,a)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let o=0,a;for(a=0;a<t.length;a++){const s=e._parsed[a];s!==null&&!isNaN(s)&&this.chart.getDataVisibility(a)&&!t[a].hidden&&(o+=Math.abs(s))}return o}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?Ce*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,o=this.chart,a=o.data.labels||[],s=dn(t._parsed[e],o.options.locale);return{label:a[e]||"",value:s}}getMaxBorderWidth(e){let t=0;const o=this.chart;let a,s,l,r,c;if(!e){for(a=0,s=o.data.datasets.length;a<s;++a)if(o.isDatasetVisible(a)){l=o.getDatasetMeta(a),e=l.data,r=l.controller;break}}if(!e)return 0;for(a=0,s=e.length;a<s;++a)c=r.resolveDataElementOptions(a),c.borderAlign!=="inner"&&(t=Math.max(t,c.borderWidth||0,c.hoverBorderWidth||0));return t}getMaxOffset(e){let t=0;for(let o=0,a=e.length;o<a;++o){const s=this.resolveDataElementOptions(o);t=Math.max(t,s.offset||0,s.hoverOffset||0)}return t}_getRingWeightOffset(e){let t=0;for(let o=0;o<e;++o)this.chart.isDatasetVisible(o)&&(t+=this._getRingWeight(o));return t}_getRingWeight(e){return Math.max(ie(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}W(zt,"id","doughnut"),W(zt,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),W(zt,"descriptors",{_scriptable:e=>e!=="spacing",_indexable:e=>e!=="spacing"&&!e.startsWith("borderDash")&&!e.startsWith("hoverBorderDash")}),W(zt,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data,{labels:{pointStyle:o,textAlign:a,color:s,useBorderRadius:l,borderRadius:r}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((c,d)=>{const h=e.getDatasetMeta(0).controller.getStyle(d);return{text:c,fillStyle:h.backgroundColor,fontColor:s,hidden:!e.getDataVisibility(d),lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:h.borderWidth,strokeStyle:h.borderColor,textAlign:a,pointStyle:o,borderRadius:l&&(r||h.borderRadius),index:d}}):[]}},onClick(e,t,o){o.chart.toggleDataVisibility(t.index),o.chart.update()}}}});class ei extends Qe{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:o,data:a=[],_dataset:s}=t,l=this.chart._animationsDisabled;let{start:r,count:c}=Sa(t,a,l);this._drawStart=r,this._drawCount=c,Ea(t)&&(r=0,c=a.length),o._chart=this.chart,o._datasetIndex=this.index,o._decimated=!!s._decimated,o.points=a;const d=this.resolveDatasetElementOptions(e);this.options.showLine||(d.borderWidth=0),d.segment=this.options.segment,this.updateElement(o,void 0,{animated:!l,options:d},e),this.updateElements(a,r,c,e)}updateElements(e,t,o,a){const s=a==="reset",{iScale:l,vScale:r,_stacked:c,_dataset:d}=this._cachedMeta,{sharedOptions:u,includeOptions:h}=this._getSharedOptions(t,a),f=l.axis,m=r.axis,{spanGaps:p,segment:g}=this.options,b=jt(p)?p:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||s||a==="none",k=t+o,B=e.length;let C=t>0&&this.getParsed(t-1);for(let y=0;y<B;++y){const x=e[y],S=_?x:{};if(y<t||y>=k){S.skip=!0;continue}const w=this.getParsed(y),M=ae(w[m]),N=S[f]=l.getPixelForValue(w[f],y),T=S[m]=s||M?r.getBasePixel():r.getPixelForValue(c?this.applyStack(r,w,c):w[m],y);S.skip=isNaN(N)||isNaN(T)||M,S.stop=y>0&&Math.abs(w[f]-C[f])>b,g&&(S.parsed=w,S.raw=d.data[y]),h&&(S.options=u||this.resolveDataElementOptions(y,x.active?"active":a)),_||this.updateElement(x,y,S,a),C=w}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,o=t.options&&t.options.borderWidth||0,a=e.data||[];if(!a.length)return o;const s=a[0].size(this.resolveDataElementOptions(0)),l=a[a.length-1].size(this.resolveDataElementOptions(a.length-1));return Math.max(o,s,l)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}W(ei,"id","line"),W(ei,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),W(ei,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class pn extends Qe{constructor(e,t){super(e,t),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(e){const t=this._cachedMeta,o=this.chart,a=o.data.labels||[],s=dn(t._parsed[e].r,o.options.locale);return{label:a[e]||"",value:s}}parseObjectData(e,t,o,a){return Fa.bind(this)(e,t,o,a)}update(e){const t=this._cachedMeta.data;this._updateRadius(),this.updateElements(t,0,t.length,e)}getMinMax(){const e=this._cachedMeta,t={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return e.data.forEach((o,a)=>{const s=this.getParsed(a).r;!isNaN(s)&&this.chart.getDataVisibility(a)&&(s<t.min&&(t.min=s),s>t.max&&(t.max=s))}),t}_updateRadius(){const e=this.chart,t=e.chartArea,o=e.options,a=Math.min(t.right-t.left,t.bottom-t.top),s=Math.max(a/2,0),l=Math.max(o.cutoutPercentage?s/100*o.cutoutPercentage:1,0),r=(s-l)/e.getVisibleDatasetCount();this.outerRadius=s-r*this.index,this.innerRadius=this.outerRadius-r}updateElements(e,t,o,a){const s=a==="reset",l=this.chart,c=l.options.animation,d=this._cachedMeta.rScale,u=d.xCenter,h=d.yCenter,f=d.getIndexAngle(0)-.5*de;let m=f,p;const g=360/this.countVisibleElements();for(p=0;p<t;++p)m+=this._computeAngle(p,a,g);for(p=t;p<t+o;p++){const b=e[p];let _=m,k=m+this._computeAngle(p,a,g),B=l.getDataVisibility(p)?d.getDistanceFromCenterForValue(this.getParsed(p).r):0;m=k,s&&(c.animateScale&&(B=0),c.animateRotate&&(_=k=f));const C={x:u,y:h,innerRadius:0,outerRadius:B,startAngle:_,endAngle:k,options:this.resolveDataElementOptions(p,b.active?"active":a)};this.updateElement(b,p,C,a)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((o,a)=>{!isNaN(this.getParsed(a).r)&&this.chart.getDataVisibility(a)&&t++}),t}_computeAngle(e,t,o){return this.chart.getDataVisibility(e)?Ze(this.resolveDataElementOptions(e,t).angle||o):0}}W(pn,"id","polarArea"),W(pn,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),W(pn,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){const t=e.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:o,color:a}}=e.legend.options;return t.labels.map((s,l)=>{const c=e.getDatasetMeta(0).controller.getStyle(l);return{text:s,fillStyle:c.backgroundColor,strokeStyle:c.borderColor,fontColor:a,lineWidth:c.borderWidth,pointStyle:o,hidden:!e.getDataVisibility(l),index:l}})}return[]}},onClick(e,t,o){o.chart.toggleDataVisibility(t.index),o.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class lo extends zt{}W(lo,"id","pie"),W(lo,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class ti extends Qe{getLabelAndValue(e){const t=this._cachedMeta.vScale,o=this.getParsed(e);return{label:t.getLabels()[e],value:""+t.getLabelForValue(o[t.axis])}}parseObjectData(e,t,o,a){return Fa.bind(this)(e,t,o,a)}update(e){const t=this._cachedMeta,o=t.dataset,a=t.data||[],s=t.iScale.getLabels();if(o.points=a,e!=="resize"){const l=this.resolveDatasetElementOptions(e);this.options.showLine||(l.borderWidth=0);const r={_loop:!0,_fullLoop:s.length===a.length,options:l};this.updateElement(o,void 0,r,e)}this.updateElements(a,0,a.length,e)}updateElements(e,t,o,a){const s=this._cachedMeta.rScale,l=a==="reset";for(let r=t;r<t+o;r++){const c=e[r],d=this.resolveDataElementOptions(r,c.active?"active":a),u=s.getPointPositionForValue(r,this.getParsed(r).r),h=l?s.xCenter:u.x,f=l?s.yCenter:u.y,m={x:h,y:f,angle:u.angle,skip:isNaN(h)||isNaN(f),options:d};this.updateElement(c,r,m,a)}}}W(ti,"id","radar"),W(ti,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),W(ti,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class ni extends Qe{getLabelAndValue(e){const t=this._cachedMeta,o=this.chart.data.labels||[],{xScale:a,yScale:s}=t,l=this.getParsed(e),r=a.getLabelForValue(l.x),c=s.getLabelForValue(l.y);return{label:o[e]||"",value:"("+r+", "+c+")"}}update(e){const t=this._cachedMeta,{data:o=[]}=t,a=this.chart._animationsDisabled;let{start:s,count:l}=Sa(t,o,a);if(this._drawStart=s,this._drawCount=l,Ea(t)&&(s=0,l=o.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:r,_dataset:c}=t;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!c._decimated,r.points=o;const d=this.resolveDatasetElementOptions(e);d.segment=this.options.segment,this.updateElement(r,void 0,{animated:!a,options:d},e)}else this.datasetElementType&&(delete t.dataset,this.datasetElementType=!1);this.updateElements(o,s,l,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(e,t,o,a){const s=a==="reset",{iScale:l,vScale:r,_stacked:c,_dataset:d}=this._cachedMeta,u=this.resolveDataElementOptions(t,a),h=this.getSharedOptions(u),f=this.includeOptions(a,h),m=l.axis,p=r.axis,{spanGaps:g,segment:b}=this.options,_=jt(g)?g:Number.POSITIVE_INFINITY,k=this.chart._animationsDisabled||s||a==="none";let B=t>0&&this.getParsed(t-1);for(let C=t;C<t+o;++C){const y=e[C],x=this.getParsed(C),S=k?y:{},w=ae(x[p]),M=S[m]=l.getPixelForValue(x[m],C),N=S[p]=s||w?r.getBasePixel():r.getPixelForValue(c?this.applyStack(r,x,c):x[p],C);S.skip=isNaN(M)||isNaN(N)||w,S.stop=C>0&&Math.abs(x[m]-B[m])>_,b&&(S.parsed=x,S.raw=d.data[C]),f&&(S.options=h||this.resolveDataElementOptions(C,y.active?"active":a)),k||this.updateElement(y,C,S,a),B=x}this.updateSharedOptions(h,a,u)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let c=t.length-1;c>=0;--c)r=Math.max(r,t[c].size(this.resolveDataElementOptions(c))/2);return r>0&&r}const o=e.dataset,a=o.options&&o.options.borderWidth||0;if(!t.length)return a;const s=t[0].size(this.resolveDataElementOptions(0)),l=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(a,s,l)/2}}W(ni,"id","scatter"),W(ni,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),W(ni,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var Mh=Object.freeze({__proto__:null,BarController:Zn,BubbleController:Qn,DoughnutController:zt,LineController:ei,PieController:lo,PolarAreaController:pn,RadarController:ti,ScatterController:ni});function Nt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ro{constructor(e){W(this,"options");this.options=e||{}}static override(e){Object.assign(ro.prototype,e)}init(){}formats(){return Nt()}parse(){return Nt()}format(){return Nt()}add(){return Nt()}diff(){return Nt()}startOf(){return Nt()}endOf(){return Nt()}}var vh={_date:ro};function Vh(n,e,t,o){const{controller:a,data:s,_sorted:l}=n,r=a._cachedMeta.iScale,c=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(r&&e===r.axis&&e!=="r"&&l&&s.length){const d=r._reversePixels?Jd:rt;if(o){if(a._sharedOptions){const u=s[0],h=typeof u.getRange=="function"&&u.getRange(e);if(h){const f=d(s,e,t-h),m=d(s,e,t+h);return{lo:f.lo,hi:m.hi}}}}else{const u=d(s,e,t);if(c){const{vScale:h}=a._cachedMeta,{_parsed:f}=n,m=f.slice(0,u.lo+1).reverse().findIndex(g=>!ae(g[h.axis]));u.lo-=Math.max(0,m);const p=f.slice(u.hi).findIndex(g=>!ae(g[h.axis]));u.hi+=Math.max(0,p)}return u}}return{lo:0,hi:s.length-1}}function ii(n,e,t,o,a){const s=n.getSortedVisibleDatasetMetas(),l=t[e];for(let r=0,c=s.length;r<c;++r){const{index:d,data:u}=s[r],{lo:h,hi:f}=Vh(s[r],e,l,a);for(let m=h;m<=f;++m){const p=u[m];p.skip||o(p,d,m)}}}function Dh(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(o,a){const s=e?Math.abs(o.x-a.x):0,l=t?Math.abs(o.y-a.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(l,2))}}function co(n,e,t,o,a){const s=[];return!a&&!n.isPointInArea(e)||ii(n,t,e,function(r,c,d){!a&&!ct(r,n.chartArea,0)||r.inRange(e.x,e.y,o)&&s.push({element:r,datasetIndex:c,index:d})},!0),s}function $h(n,e,t,o){let a=[];function s(l,r,c){const{startAngle:d,endAngle:u}=l.getProps(["startAngle","endAngle"],o),{angle:h}=ya(l,{x:e.x,y:e.y});rn(h,d,u)&&a.push({element:l,datasetIndex:r,index:c})}return ii(n,t,e,s),a}function Th(n,e,t,o,a,s){let l=[];const r=Dh(t);let c=Number.POSITIVE_INFINITY;function d(u,h,f){const m=u.inRange(e.x,e.y,a);if(o&&!m)return;const p=u.getCenterPoint(a);if(!(!!s||n.isPointInArea(p))&&!m)return;const b=r(e,p);b<c?(l=[{element:u,datasetIndex:h,index:f}],c=b):b===c&&l.push({element:u,datasetIndex:h,index:f})}return ii(n,t,e,d),l}function uo(n,e,t,o,a,s){return!s&&!n.isPointInArea(e)?[]:t==="r"&&!o?$h(n,e,t,a):Th(n,e,t,o,a,s)}function hs(n,e,t,o,a){const s=[],l=t==="x"?"inXRange":"inYRange";let r=!1;return ii(n,t,e,(c,d,u)=>{c[l]&&c[l](e[t],a)&&(s.push({element:c,datasetIndex:d,index:u}),r=r||c.inRange(e.x,e.y,a))}),o&&!r?[]:s}var Ih={modes:{index(n,e,t,o){const a=It(e,n),s=t.axis||"x",l=t.includeInvisible||!1,r=t.intersect?co(n,a,s,o,l):uo(n,a,s,!1,o,l),c=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(d=>{const u=r[0].index,h=d.data[u];h&&!h.skip&&c.push({element:h,datasetIndex:d.index,index:u})}),c):[]},dataset(n,e,t,o){const a=It(e,n),s=t.axis||"xy",l=t.includeInvisible||!1;let r=t.intersect?co(n,a,s,o,l):uo(n,a,s,!1,o,l);if(r.length>0){const c=r[0].datasetIndex,d=n.getDatasetMeta(c).data;r=[];for(let u=0;u<d.length;++u)r.push({element:d[u],datasetIndex:c,index:u})}return r},point(n,e,t,o){const a=It(e,n),s=t.axis||"xy",l=t.includeInvisible||!1;return co(n,a,s,o,l)},nearest(n,e,t,o){const a=It(e,n),s=t.axis||"xy",l=t.includeInvisible||!1;return uo(n,a,s,t.intersect,o,l)},x(n,e,t,o){const a=It(e,n);return hs(n,a,"x",t.intersect,o)},y(n,e,t,o){const a=It(e,n);return hs(n,a,"y",t.intersect,o)}}};const fs=["left","top","right","bottom"];function gn(n,e){return n.filter(t=>t.pos===e)}function ms(n,e){return n.filter(t=>fs.indexOf(t.pos)===-1&&t.box.axis===e)}function bn(n,e){return n.sort((t,o)=>{const a=e?o:t,s=e?t:o;return a.weight===s.weight?a.index-s.index:a.weight-s.weight})}function Lh(n){const e=[];let t,o,a,s,l,r;for(t=0,o=(n||[]).length;t<o;++t)a=n[t],{position:s,options:{stack:l,stackWeight:r=1}}=a,e.push({index:t,box:a,pos:s,horizontal:a.isHorizontal(),weight:a.weight,stack:l&&s+l,stackWeight:r});return e}function zh(n){const e={};for(const t of n){const{stack:o,pos:a,stackWeight:s}=t;if(!o||!fs.includes(a))continue;const l=e[o]||(e[o]={count:0,placed:0,weight:0,size:0});l.count++,l.weight+=s}return e}function Nh(n,e){const t=zh(n),{vBoxMaxWidth:o,hBoxMaxHeight:a}=e;let s,l,r;for(s=0,l=n.length;s<l;++s){r=n[s];const{fullSize:c}=r.box,d=t[r.stack],u=d&&r.stackWeight/d.weight;r.horizontal?(r.width=u?u*o:c&&e.availableWidth,r.height=a):(r.width=o,r.height=u?u*a:c&&e.availableHeight)}return t}function Ph(n){const e=Lh(n),t=bn(e.filter(d=>d.box.fullSize),!0),o=bn(gn(e,"left"),!0),a=bn(gn(e,"right")),s=bn(gn(e,"top"),!0),l=bn(gn(e,"bottom")),r=ms(e,"x"),c=ms(e,"y");return{fullSize:t,leftAndTop:o.concat(s),rightAndBottom:a.concat(c).concat(l).concat(r),chartArea:gn(e,"chartArea"),vertical:o.concat(a).concat(c),horizontal:s.concat(l).concat(r)}}function ps(n,e,t,o){return Math.max(n[t],e[t])+Math.max(n[o],e[o])}function gs(n,e){n.top=Math.max(n.top,e.top),n.left=Math.max(n.left,e.left),n.bottom=Math.max(n.bottom,e.bottom),n.right=Math.max(n.right,e.right)}function Ah(n,e,t,o){const{pos:a,box:s}=t,l=n.maxPadding;if(!se(a)){t.size&&(n[a]-=t.size);const h=o[t.stack]||{size:0,count:1};h.size=Math.max(h.size,t.horizontal?s.height:s.width),t.size=h.size/h.count,n[a]+=t.size}s.getPadding&&gs(l,s.getPadding());const r=Math.max(0,e.outerWidth-ps(l,n,"left","right")),c=Math.max(0,e.outerHeight-ps(l,n,"top","bottom")),d=r!==n.w,u=c!==n.h;return n.w=r,n.h=c,t.horizontal?{same:d,other:u}:{same:u,other:d}}function Rh(n){const e=n.maxPadding;function t(o){const a=Math.max(e[o]-n[o],0);return n[o]+=a,a}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function Oh(n,e){const t=e.maxPadding;function o(a){const s={left:0,top:0,right:0,bottom:0};return a.forEach(l=>{s[l]=Math.max(e[l],t[l])}),s}return o(n?["left","right"]:["top","bottom"])}function _n(n,e,t,o){const a=[];let s,l,r,c,d,u;for(s=0,l=n.length,d=0;s<l;++s){r=n[s],c=r.box,c.update(r.width||e.w,r.height||e.h,Oh(r.horizontal,e));const{same:h,other:f}=Ah(e,t,r,o);d|=h&&a.length,u=u||f,c.fullSize||a.push(r)}return d&&_n(a,e,t,o)||u}function oi(n,e,t,o,a){n.top=t,n.left=e,n.right=e+o,n.bottom=t+a,n.width=o,n.height=a}function bs(n,e,t,o){const a=t.padding;let{x:s,y:l}=e;for(const r of n){const c=r.box,d=o[r.stack]||{placed:0,weight:1},u=r.stackWeight/d.weight||1;if(r.horizontal){const h=e.w*u,f=d.size||c.height;sn(d.start)&&(l=d.start),c.fullSize?oi(c,a.left,l,t.outerWidth-a.right-a.left,f):oi(c,e.left+d.placed,l,h,f),d.start=l,d.placed+=h,l=c.bottom}else{const h=e.h*u,f=d.size||c.width;sn(d.start)&&(s=d.start),c.fullSize?oi(c,s,a.top,f,t.outerHeight-a.bottom-a.top):oi(c,s,e.top+d.placed,f,h),d.start=s,d.placed+=h,s=c.right}}e.x=s,e.y=l}var He={addBox(n,e){n.boxes||(n.boxes=[]),e.fullSize=e.fullSize||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw(t){e.draw(t)}}]},n.boxes.push(e)},removeBox(n,e){const t=n.boxes?n.boxes.indexOf(e):-1;t!==-1&&n.boxes.splice(t,1)},configure(n,e,t){e.fullSize=t.fullSize,e.position=t.position,e.weight=t.weight},update(n,e,t,o){if(!n)return;const a=We(n.options.layout.padding),s=Math.max(e-a.width,0),l=Math.max(t-a.height,0),r=Ph(n.boxes),c=r.vertical,d=r.horizontal;pe(n.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});const u=c.reduce((g,b)=>b.box.options&&b.box.options.display===!1?g:g+1,0)||1,h=Object.freeze({outerWidth:e,outerHeight:t,padding:a,availableWidth:s,availableHeight:l,vBoxMaxWidth:s/2/u,hBoxMaxHeight:l/2}),f=Object.assign({},a);gs(f,We(o));const m=Object.assign({maxPadding:f,w:s,h:l,x:a.left,y:a.top},a),p=Nh(c.concat(d),h);_n(r.fullSize,m,h,p),_n(c,m,h,p),_n(d,m,h,p)&&_n(c,m,h,p),Rh(m),bs(r.leftAndTop,m,h,p),m.x+=m.w,m.y+=m.h,bs(r.rightAndBottom,m,h,p),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},pe(r.chartArea,g=>{const b=g.box;Object.assign(b,n.chartArea),b.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class _s{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,o){}removeEventListener(e,t,o){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,o,a){return t=Math.max(0,t||e.width),o=o||e.height,{width:t,height:Math.max(0,a?Math.floor(t/a):o)}}isAttached(e){return!0}updateConfig(e){}}class Fh extends _s{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ai="$chartjs",Wh={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ys=n=>n===null||n==="";function Hh(n,e){const t=n.style,o=n.getAttribute("height"),a=n.getAttribute("width");if(n[ai]={initial:{height:o,width:a,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",ys(a)){const s=ja(n,"width");s!==void 0&&(n.width=s)}if(ys(o))if(n.style.height==="")n.height=n.width/(e||2);else{const s=ja(n,"height");s!==void 0&&(n.height=s)}return n}const ks=ju?{passive:!0}:!1;function jh(n,e,t){n&&n.addEventListener(e,t,ks)}function Yh(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,ks)}function Uh(n,e){const t=Wh[n.type]||n.type,{x:o,y:a}=It(n,e);return{type:t,chart:e,native:n,x:o!==void 0?o:null,y:a!==void 0?a:null}}function si(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function Xh(n,e,t){const o=n.canvas,a=new MutationObserver(s=>{let l=!1;for(const r of s)l=l||si(r.addedNodes,o),l=l&&!si(r.removedNodes,o);l&&t()});return a.observe(document,{childList:!0,subtree:!0}),a}function Kh(n,e,t){const o=n.canvas,a=new MutationObserver(s=>{let l=!1;for(const r of s)l=l||si(r.removedNodes,o),l=l&&!si(r.addedNodes,o);l&&t()});return a.observe(document,{childList:!0,subtree:!0}),a}const yn=new Map;let xs=0;function ws(){const n=window.devicePixelRatio;n!==xs&&(xs=n,yn.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function qh(n,e){yn.size||window.addEventListener("resize",ws),yn.set(n,e)}function Gh(n){yn.delete(n),yn.size||window.removeEventListener("resize",ws)}function Jh(n,e,t){const o=n.canvas,a=o&&no(o);if(!a)return;const s=Ba((r,c)=>{const d=a.clientWidth;t(r,c),d<a.clientWidth&&t()},window),l=new ResizeObserver(r=>{const c=r[0],d=c.contentRect.width,u=c.contentRect.height;d===0&&u===0||s(d,u)});return l.observe(a),qh(n,s),l}function ho(n,e,t){t&&t.disconnect(),e==="resize"&&Gh(n)}function Zh(n,e,t){const o=n.canvas,a=Ba(s=>{n.ctx!==null&&t(Uh(s,n))},n);return jh(o,e,a),a}class Qh extends _s{acquireContext(e,t){const o=e&&e.getContext&&e.getContext("2d");return o&&o.canvas===e?(Hh(e,t),o):null}releaseContext(e){const t=e.canvas;if(!t[ai])return!1;const o=t[ai].initial;["height","width"].forEach(s=>{const l=o[s];ae(l)?t.removeAttribute(s):t.setAttribute(s,l)});const a=o.style||{};return Object.keys(a).forEach(s=>{t.style[s]=a[s]}),t.width=t.width,delete t[ai],!0}addEventListener(e,t,o){this.removeEventListener(e,t);const a=e.$proxies||(e.$proxies={}),l={attach:Xh,detach:Kh,resize:Jh}[t]||Zh;a[t]=l(e,t,o)}removeEventListener(e,t){const o=e.$proxies||(e.$proxies={}),a=o[t];if(!a)return;({attach:ho,detach:ho,resize:ho}[t]||Yh)(e,t,a),o[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,o,a){return Hu(e,t,o,a)}isAttached(e){const t=e&&no(e);return!!(t&&t.isConnected)}}function ef(n){return!to()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Fh:Qh}class et{constructor(){W(this,"x");W(this,"y");W(this,"active",!1);W(this,"options");W(this,"$animations")}tooltipPosition(e){const{x:t,y:o}=this.getProps(["x","y"],e);return{x:t,y:o}}hasValue(){return jt(this.x)&&jt(this.y)}getProps(e,t){const o=this.$animations;if(!t||!o)return this;const a={};return e.forEach(s=>{a[s]=o[s]&&o[s].active()?o[s]._to:this[s]}),a}}W(et,"defaults",{}),W(et,"defaultRoutes");function tf(n,e){const t=n.options.ticks,o=nf(n),a=Math.min(t.maxTicksLimit||o,o),s=t.major.enabled?af(e):[],l=s.length,r=s[0],c=s[l-1],d=[];if(l>a)return sf(e,d,s,l/a),d;const u=of(s,e,a);if(l>0){let h,f;const m=l>1?Math.round((c-r)/(l-1)):null;for(li(e,d,u,ae(m)?0:r-m,r),h=0,f=l-1;h<f;h++)li(e,d,u,s[h],s[h+1]);return li(e,d,u,c,ae(m)?e.length:c+m),d}return li(e,d,u),d}function nf(n){const e=n.options.offset,t=n._tickSize(),o=n._length/t+(e?0:1),a=n._maxLength/t;return Math.floor(Math.min(o,a))}function of(n,e,t){const o=lf(n),a=e.length/t;if(!o)return Math.max(a,1);const s=Ud(o);for(let l=0,r=s.length-1;l<r;l++){const c=s[l];if(c>a)return c}return Math.max(a,1)}function af(n){const e=[];let t,o;for(t=0,o=n.length;t<o;t++)n[t].major&&e.push(t);return e}function sf(n,e,t,o){let a=0,s=t[0],l;for(o=Math.ceil(o),l=0;l<n.length;l++)l===s&&(e.push(n[l]),a++,s=t[a*o])}function li(n,e,t,o,a){const s=ie(o,0),l=Math.min(ie(a,n.length),n.length);let r=0,c,d,u;for(t=Math.ceil(t),a&&(c=a-o,t=c/Math.floor(c/t)),u=s;u<0;)r++,u=Math.round(s+r*t);for(d=Math.max(s,0);d<l;d++)d===u&&(e.push(n[d]),r++,u=Math.round(s+r*t))}function lf(n){const e=n.length;let t,o;if(e<2)return!1;for(o=n[0],t=1;t<e;++t)if(n[t]-n[t-1]!==o)return!1;return o}const rf=n=>n==="left"?"right":n==="right"?"left":n,Cs=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Bs=(n,e)=>Math.min(e||n,n);function Ss(n,e){const t=[],o=n.length/e,a=n.length;let s=0;for(;s<a;s+=o)t.push(n[Math.floor(s)]);return t}function cf(n,e,t){const o=n.ticks.length,a=Math.min(e,o-1),s=n._startPixel,l=n._endPixel,r=1e-6;let c=n.getPixelForTick(a),d;if(!(t&&(o===1?d=Math.max(c-s,l-c):e===0?d=(n.getPixelForTick(1)-c)/2:d=(c-n.getPixelForTick(a-1))/2,c+=a<e?d:-d,c<s-r||c>l+r)))return c}function df(n,e){pe(n,t=>{const o=t.gc,a=o.length/2;let s;if(a>e){for(s=0;s<a;++s)delete t.data[o[s]];o.splice(0,a)}})}function kn(n){return n.drawTicks?n.tickLength:0}function Es(n,e){if(!n.display)return 0;const t=$e(n.font,e),o=We(n.padding);return(Se(n.text)?n.text.length:1)*t.lineHeight+o.height}function uf(n,e){return kt(n,{scale:e,type:"scale"})}function hf(n,e,t){return kt(n,{tick:t,index:e,type:"tick"})}function ff(n,e,t){let o=Yi(n);return(t&&e!=="right"||!t&&e==="right")&&(o=rf(o)),o}function mf(n,e,t,o){const{top:a,left:s,bottom:l,right:r,chart:c}=n,{chartArea:d,scales:u}=c;let h=0,f,m,p;const g=l-a,b=r-s;if(n.isHorizontal()){if(m=Fe(o,s,r),se(t)){const _=Object.keys(t)[0],k=t[_];p=u[_].getPixelForValue(k)+g-e}else t==="center"?p=(d.bottom+d.top)/2+g-e:p=Cs(n,t,e);f=r-s}else{if(se(t)){const _=Object.keys(t)[0],k=t[_];m=u[_].getPixelForValue(k)-b+e}else t==="center"?m=(d.left+d.right)/2-b+e:m=Cs(n,t,e);p=Fe(o,l,a),h=t==="left"?-Ve:Ve}return{titleX:m,titleY:p,maxWidth:f,rotation:h}}class Pt extends et{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:o,_suggestedMax:a}=this;return e=qe(e,Number.POSITIVE_INFINITY),t=qe(t,Number.NEGATIVE_INFINITY),o=qe(o,Number.POSITIVE_INFINITY),a=qe(a,Number.NEGATIVE_INFINITY),{min:qe(e,o),max:qe(t,a),minDefined:Me(e),maxDefined:Me(t)}}getMinMax(e){let{min:t,max:o,minDefined:a,maxDefined:s}=this.getUserBounds(),l;if(a&&s)return{min:t,max:o};const r=this.getMatchingVisibleMetas();for(let c=0,d=r.length;c<d;++c)l=r[c].controller.getMinMax(this,e),a||(t=Math.min(t,l.min)),s||(o=Math.max(o,l.max));return t=s&&t>o?o:t,o=a&&t>o?t:o,{min:qe(t,qe(o,t)),max:qe(o,qe(t,o))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ke(this.options.beforeUpdate,[this])}update(e,t,o){const{beginAtZero:a,grace:s,ticks:l}=this.options,r=l.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=o=Object.assign({left:0,right:0,top:0,bottom:0},o),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+o.left+o.right:this.height+o.top+o.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=xu(this,s,a),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const c=r<this.ticks.length;this._convertTicksToLabels(c?Ss(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),l.display&&(l.autoSkip||l.source==="auto")&&(this.ticks=tf(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),c&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let e=this.options.reverse,t,o;this.isHorizontal()?(t=this.left,o=this.right):(t=this.top,o=this.bottom,e=!e),this._startPixel=t,this._endPixel=o,this._reversePixels=e,this._length=o-t,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ke(this.options.afterUpdate,[this])}beforeSetDimensions(){ke(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(){ke(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),ke(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ke(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let o,a,s;for(o=0,a=e.length;o<a;o++)s=e[o],s.label=ke(t.callback,[s.value,o,e],this)}afterTickToLabelConversion(){ke(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ke(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,o=Bs(this.ticks.length,e.ticks.maxTicksLimit),a=t.minRotation||0,s=t.maxRotation;let l=a,r,c,d;if(!this._isVisible()||!t.display||a>=s||o<=1||!this.isHorizontal()){this.labelRotation=a;return}const u=this._getLabelSizes(),h=u.widest.width,f=u.highest.height,m=Ie(this.chart.width-h,0,this.maxWidth);r=e.offset?this.maxWidth/o:m/(o-1),h+6>r&&(r=m/(o-(e.offset?.5:1)),c=this.maxHeight-kn(e.grid)-t.padding-Es(e.title,this.chart.options.font),d=Math.sqrt(h*h+f*f),l=Wi(Math.min(Math.asin(Ie((u.highest.height+6)/r,-1,1)),Math.asin(Ie(c/d,-1,1))-Math.asin(Ie(f/d,-1,1)))),l=Math.max(a,Math.min(s,l))),this.labelRotation=l}afterCalculateLabelRotation(){ke(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ke(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:o,title:a,grid:s}}=this,l=this._isVisible(),r=this.isHorizontal();if(l){const c=Es(a,t.options.font);if(r?(e.width=this.maxWidth,e.height=kn(s)+c):(e.height=this.maxHeight,e.width=kn(s)+c),o.display&&this.ticks.length){const{first:d,last:u,widest:h,highest:f}=this._getLabelSizes(),m=o.padding*2,p=Ze(this.labelRotation),g=Math.cos(p),b=Math.sin(p);if(r){const _=o.mirror?0:b*h.width+g*f.height;e.height=Math.min(this.maxHeight,e.height+_+m)}else{const _=o.mirror?0:g*h.width+b*f.height;e.width=Math.min(this.maxWidth,e.width+_+m)}this._calculatePadding(d,u,b,g)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,o,a){const{ticks:{align:s,padding:l},position:r}=this.options,c=this.labelRotation!==0,d=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const u=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,m=0;c?d?(f=a*e.width,m=o*t.height):(f=o*e.height,m=a*t.width):s==="start"?m=t.width:s==="end"?f=e.width:s!=="inner"&&(f=e.width/2,m=t.width/2),this.paddingLeft=Math.max((f-u+l)*this.width/(this.width-u),0),this.paddingRight=Math.max((m-h+l)*this.width/(this.width-h),0)}else{let u=t.height/2,h=e.height/2;s==="start"?(u=0,h=e.height):s==="end"&&(u=t.height,h=0),this.paddingTop=u+l,this.paddingBottom=h+l}}_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(){ke(this.options.afterFit,[this])}isHorizontal(){const{axis:e,position:t}=this.options;return t==="top"||t==="bottom"||e==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,o;for(t=0,o=e.length;t<o;t++)ae(e[t].label)&&(e.splice(t,1),o--,t--);this.afterTickToLabelConversion()}_getLabelSizes(){let e=this._labelSizes;if(!e){const t=this.options.ticks.sampleSize;let o=this.ticks;t<o.length&&(o=Ss(o,t)),this._labelSizes=e=this._computeLabelSizes(o,o.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,o){const{ctx:a,_longestTextCache:s}=this,l=[],r=[],c=Math.floor(t/Bs(t,o));let d=0,u=0,h,f,m,p,g,b,_,k,B,C,y;for(h=0;h<t;h+=c){if(p=e[h].label,g=this._resolveTickFontOptions(h),a.font=b=g.string,_=s[b]=s[b]||{data:{},gc:[]},k=g.lineHeight,B=C=0,!ae(p)&&!Se(p))B=Yn(a,_.data,_.gc,B,p),C=k;else if(Se(p))for(f=0,m=p.length;f<m;++f)y=p[f],!ae(y)&&!Se(y)&&(B=Yn(a,_.data,_.gc,B,y),C+=k);l.push(B),r.push(C),d=Math.max(B,d),u=Math.max(C,u)}df(s,t);const x=l.indexOf(d),S=r.indexOf(u),w=M=>({width:l[M]||0,height:r[M]||0});return{first:w(0),last:w(t-1),widest:w(x),highest:w(S),widths:l,heights:r}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);const t=this._startPixel+e*this._length;return Gd(this._alignToPixels?Vt(this.chart,t,0):t)}getDecimalForPixel(e){const t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){const t=this.ticks||[];if(e>=0&&e<t.length){const o=t[e];return o.$context||(o.$context=hf(this.getContext(),e,o))}return this.$context||(this.$context=uf(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Ze(this.labelRotation),o=Math.abs(Math.cos(t)),a=Math.abs(Math.sin(t)),s=this._getLabelSizes(),l=e.autoSkipPadding||0,r=s?s.widest.width+l:0,c=s?s.highest.height+l:0;return this.isHorizontal()?c*o>r*a?r/o:c/a:c*a<r*o?c/o:r/a}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,o=this.chart,a=this.options,{grid:s,position:l,border:r}=a,c=s.offset,d=this.isHorizontal(),h=this.ticks.length+(c?1:0),f=kn(s),m=[],p=r.setContext(this.getContext()),g=p.display?p.width:0,b=g/2,_=function(R){return Vt(o,R,g)};let k,B,C,y,x,S,w,M,N,T,$,K;if(l==="top")k=_(this.bottom),S=this.bottom-f,M=k-b,T=_(e.top)+b,K=e.bottom;else if(l==="bottom")k=_(this.top),T=e.top,K=_(e.bottom)-b,S=k+b,M=this.top+f;else if(l==="left")k=_(this.right),x=this.right-f,w=k-b,N=_(e.left)+b,$=e.right;else if(l==="right")k=_(this.left),N=e.left,$=_(e.right)-b,x=k+b,w=this.left+f;else if(t==="x"){if(l==="center")k=_((e.top+e.bottom)/2+.5);else if(se(l)){const R=Object.keys(l)[0],q=l[R];k=_(this.chart.scales[R].getPixelForValue(q))}T=e.top,K=e.bottom,S=k+b,M=S+f}else if(t==="y"){if(l==="center")k=_((e.left+e.right)/2);else if(se(l)){const R=Object.keys(l)[0],q=l[R];k=_(this.chart.scales[R].getPixelForValue(q))}x=k-b,w=x-f,N=e.left,$=e.right}const P=ie(a.ticks.maxTicksLimit,h),A=Math.max(1,Math.ceil(h/P));for(B=0;B<h;B+=A){const R=this.getContext(B),q=s.setContext(R),Q=r.setContext(R),ee=q.lineWidth,ge=q.color,fe=Q.dash||[],be=Q.dashOffset,xe=q.tickWidth,F=q.tickColor,v=q.tickBorderDash||[],D=q.tickBorderDashOffset;C=cf(this,B,c),C!==void 0&&(y=Vt(o,C,ee),d?x=w=N=$=y:S=M=T=K=y,m.push({tx1:x,ty1:S,tx2:w,ty2:M,x1:N,y1:T,x2:$,y2:K,width:ee,color:ge,borderDash:fe,borderDashOffset:be,tickWidth:xe,tickColor:F,tickBorderDash:v,tickBorderDashOffset:D}))}return this._ticksLength=h,this._borderValue=k,m}_computeLabelItems(e){const t=this.axis,o=this.options,{position:a,ticks:s}=o,l=this.isHorizontal(),r=this.ticks,{align:c,crossAlign:d,padding:u,mirror:h}=s,f=kn(o.grid),m=f+u,p=h?-u:m,g=-Ze(this.labelRotation),b=[];let _,k,B,C,y,x,S,w,M,N,T,$,K="middle";if(a==="top")x=this.bottom-p,S=this._getXAxisLabelAlignment();else if(a==="bottom")x=this.top+p,S=this._getXAxisLabelAlignment();else if(a==="left"){const A=this._getYAxisLabelAlignment(f);S=A.textAlign,y=A.x}else if(a==="right"){const A=this._getYAxisLabelAlignment(f);S=A.textAlign,y=A.x}else if(t==="x"){if(a==="center")x=(e.top+e.bottom)/2+m;else if(se(a)){const A=Object.keys(a)[0],R=a[A];x=this.chart.scales[A].getPixelForValue(R)+m}S=this._getXAxisLabelAlignment()}else if(t==="y"){if(a==="center")y=(e.left+e.right)/2-m;else if(se(a)){const A=Object.keys(a)[0],R=a[A];y=this.chart.scales[A].getPixelForValue(R)}S=this._getYAxisLabelAlignment(f).textAlign}t==="y"&&(c==="start"?K="top":c==="end"&&(K="bottom"));const P=this._getLabelSizes();for(_=0,k=r.length;_<k;++_){B=r[_],C=B.label;const A=s.setContext(this.getContext(_));w=this.getPixelForTick(_)+s.labelOffset,M=this._resolveTickFontOptions(_),N=M.lineHeight,T=Se(C)?C.length:1;const R=T/2,q=A.color,Q=A.textStrokeColor,ee=A.textStrokeWidth;let ge=S;l?(y=w,S==="inner"&&(_===k-1?ge=this.options.reverse?"left":"right":_===0?ge=this.options.reverse?"right":"left":ge="center"),a==="top"?d==="near"||g!==0?$=-T*N+N/2:d==="center"?$=-P.highest.height/2-R*N+N:$=-P.highest.height+N/2:d==="near"||g!==0?$=N/2:d==="center"?$=P.highest.height/2-R*N:$=P.highest.height-T*N,h&&($*=-1),g!==0&&!A.showLabelBackdrop&&(y+=N/2*Math.sin(g))):(x=w,$=(1-T)*N/2);let fe;if(A.showLabelBackdrop){const be=We(A.backdropPadding),xe=P.heights[_],F=P.widths[_];let v=$-be.top,D=0-be.left;switch(K){case"middle":v-=xe/2;break;case"bottom":v-=xe;break}switch(S){case"center":D-=F/2;break;case"right":D-=F;break;case"inner":_===k-1?D-=F:_>0&&(D-=F/2);break}fe={left:D,top:v,width:F+be.width,height:xe+be.height,color:A.backdropColor}}b.push({label:C,font:M,textOffset:$,options:{rotation:g,color:q,strokeColor:Q,strokeWidth:ee,textAlign:ge,textBaseline:K,translation:[y,x],backdrop:fe}})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Ze(this.labelRotation))return e==="top"?"left":"right";let a="center";return t.align==="start"?a="left":t.align==="end"?a="right":t.align==="inner"&&(a="inner"),a}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:o,mirror:a,padding:s}}=this.options,l=this._getLabelSizes(),r=e+s,c=l.widest.width;let d,u;return t==="left"?a?(u=this.right+s,o==="near"?d="left":o==="center"?(d="center",u+=c/2):(d="right",u+=c)):(u=this.right-r,o==="near"?d="right":o==="center"?(d="center",u-=c/2):(d="left",u=this.left)):t==="right"?a?(u=this.left+s,o==="near"?d="right":o==="center"?(d="center",u-=c/2):(d="left",u-=c)):(u=this.left+r,o==="near"?d="left":o==="center"?(d="center",u+=c/2):(d="right",u=this.right)):d="right",{textAlign:d,x:u}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:o,top:a,width:s,height:l}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(o,a,s,l),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const a=this.ticks.findIndex(s=>s.value===e);return a>=0?t.setContext(this.getContext(a)).lineWidth:0}drawGrid(e){const t=this.options.grid,o=this.ctx,a=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,l;const r=(c,d,u)=>{!u.width||!u.color||(o.save(),o.lineWidth=u.width,o.strokeStyle=u.color,o.setLineDash(u.borderDash||[]),o.lineDashOffset=u.borderDashOffset,o.beginPath(),o.moveTo(c.x,c.y),o.lineTo(d.x,d.y),o.stroke(),o.restore())};if(t.display)for(s=0,l=a.length;s<l;++s){const c=a[s];t.drawOnChartArea&&r({x:c.x1,y:c.y1},{x:c.x2,y:c.y2},c),t.drawTicks&&r({x:c.tx1,y:c.ty1},{x:c.tx2,y:c.ty2},{color:c.tickColor,width:c.tickWidth,borderDash:c.tickBorderDash,borderDashOffset:c.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{border:o,grid:a}}=this,s=o.setContext(this.getContext()),l=o.display?s.width:0;if(!l)return;const r=a.setContext(this.getContext(0)).lineWidth,c=this._borderValue;let d,u,h,f;this.isHorizontal()?(d=Vt(e,this.left,l)-l/2,u=Vt(e,this.right,r)+r/2,h=f=c):(h=Vt(e,this.top,l)-l/2,f=Vt(e,this.bottom,r)+r/2,d=u=c),t.save(),t.lineWidth=s.width,t.strokeStyle=s.color,t.beginPath(),t.moveTo(d,h),t.lineTo(u,f),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const o=this.ctx,a=this._computeLabelArea();a&&Un(o,a);const s=this.getLabelItems(e);for(const l of s){const r=l.options,c=l.font,d=l.label,u=l.textOffset;Dt(o,d,0,u,c,r)}a&&Xn(o)}drawTitle(){const{ctx:e,options:{position:t,title:o,reverse:a}}=this;if(!o.display)return;const s=$e(o.font),l=We(o.padding),r=o.align;let c=s.lineHeight/2;t==="bottom"||t==="center"||se(t)?(c+=l.bottom,Se(o.text)&&(c+=s.lineHeight*(o.text.length-1))):c+=l.top;const{titleX:d,titleY:u,maxWidth:h,rotation:f}=mf(this,c,t,r);Dt(e,o.text,0,0,s,{color:o.color,maxWidth:h,rotation:f,textAlign:ff(r,t,a),textBaseline:"middle",translation:[d,u]})}draw(e){this._isVisible()&&(this.drawBackground(),this.drawGrid(e),this.drawBorder(),this.drawTitle(),this.drawLabels(e))}_layers(){const e=this.options,t=e.ticks&&e.ticks.z||0,o=ie(e.grid&&e.grid.z,-1),a=ie(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Pt.prototype.draw?[{z:t,draw:s=>{this.draw(s)}}]:[{z:o,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:a,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),o=this.axis+"AxisID",a=[];let s,l;for(s=0,l=t.length;s<l;++s){const r=t[s];r[o]===this.id&&(!e||r.type===e)&&a.push(r)}return a}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return $e(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class ri{constructor(e,t,o){this.type=e,this.scope=t,this.override=o,this.items=Object.create(null)}isForType(e){return Object.prototype.isPrototypeOf.call(this.type.prototype,e.prototype)}register(e){const t=Object.getPrototypeOf(e);let o;bf(t)&&(o=this.register(t));const a=this.items,s=e.id,l=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in a||(a[s]=e,pf(e,l,o),this.override&&Ee.override(e.id,e.overrides)),l}get(e){return this.items[e]}unregister(e){const t=this.items,o=e.id,a=this.scope;o in t&&delete t[o],a&&o in Ee[a]&&(delete Ee[a][o],this.override&&delete vt[o])}}function pf(n,e,t){const o=on(Object.create(null),[t?Ee.get(t):{},Ee.get(e),n.defaults]);Ee.set(e,o),n.defaultRoutes&&gf(e,n.defaultRoutes),n.descriptors&&Ee.describe(e,n.descriptors)}function gf(n,e){Object.keys(e).forEach(t=>{const o=t.split("."),a=o.pop(),s=[n].concat(o).join("."),l=e[t].split("."),r=l.pop(),c=l.join(".");Ee.route(s,a,c,r)})}function bf(n){return"id"in n&&"defaults"in n}class _f{constructor(){this.controllers=new ri(Qe,"datasets",!0),this.elements=new ri(et,"elements"),this.plugins=new ri(Object,"plugins"),this.scales=new ri(Pt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each("register",e)}remove(...e){this._each("unregister",e)}addControllers(...e){this._each("register",e,this.controllers)}addElements(...e){this._each("register",e,this.elements)}addPlugins(...e){this._each("register",e,this.plugins)}addScales(...e){this._each("register",e,this.scales)}getController(e){return this._get(e,this.controllers,"controller")}getElement(e){return this._get(e,this.elements,"element")}getPlugin(e){return this._get(e,this.plugins,"plugin")}getScale(e){return this._get(e,this.scales,"scale")}removeControllers(...e){this._each("unregister",e,this.controllers)}removeElements(...e){this._each("unregister",e,this.elements)}removePlugins(...e){this._each("unregister",e,this.plugins)}removeScales(...e){this._each("unregister",e,this.scales)}_each(e,t,o){[...t].forEach(a=>{const s=o||this._getRegistryForType(a);o||s.isForType(a)||s===this.plugins&&a.id?this._exec(e,s,a):pe(a,l=>{const r=o||this._getRegistryForType(l);this._exec(e,r,l)})})}_exec(e,t,o){const a=Fi(e);ke(o["before"+a],[],o),t[e](o),ke(o["after"+a],[],o)}_getRegistryForType(e){for(let t=0;t<this._typedRegistries.length;t++){const o=this._typedRegistries[t];if(o.isForType(e))return o}return this.plugins}_get(e,t,o){const a=t.get(e);if(a===void 0)throw new Error('"'+e+'" is not a registered '+o+".");return a}}var it=new _f;class yf{constructor(){this._init=void 0}notify(e,t,o,a){if(t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const s=a?this._descriptors(e).filter(a):this._descriptors(e),l=this._notify(s,e,t,o);return t==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),l}_notify(e,t,o,a){a=a||{};for(const s of e){const l=s.plugin,r=l[o],c=[t,a,s.options];if(ke(r,c,l)===!1&&a.cancelable)return!1}return!0}invalidate(){ae(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(e){if(this._cache)return this._cache;const t=this._cache=this._createDescriptors(e);return this._notifyStateChanges(e),t}_createDescriptors(e,t){const o=e&&e.config,a=ie(o.options&&o.options.plugins,{}),s=kf(o);return a===!1&&!t?[]:wf(e,s,a,t)}_notifyStateChanges(e){const t=this._oldCache||[],o=this._cache,a=(s,l)=>s.filter(r=>!l.some(c=>r.plugin.id===c.plugin.id));this._notify(a(t,o),e,"stop"),this._notify(a(o,t),e,"start")}}function kf(n){const e={},t=[],o=Object.keys(it.plugins.items);for(let s=0;s<o.length;s++)t.push(it.getPlugin(o[s]));const a=n.plugins||[];for(let s=0;s<a.length;s++){const l=a[s];t.indexOf(l)===-1&&(t.push(l),e[l.id]=!0)}return{plugins:t,localIds:e}}function xf(n,e){return!e&&n===!1?null:n===!0?{}:n}function wf(n,{plugins:e,localIds:t},o,a){const s=[],l=n.getContext();for(const r of e){const c=r.id,d=xf(o[c],a);d!==null&&s.push({plugin:r,options:Cf(n.config,{plugin:r,local:t[c]},d,l)})}return s}function Cf(n,{plugin:e,local:t},o,a){const s=n.pluginScopeKeys(e),l=n.getOptionScopes(o,s);return t&&e.defaults&&l.push(e.defaults),n.createResolver(l,a,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function fo(n,e){const t=Ee.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function Bf(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function Sf(n,e){return n===e?"_index_":"_value_"}function Ms(n){if(n==="x"||n==="y"||n==="r")return n}function Ef(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function mo(n,...e){if(Ms(n))return n;for(const t of e){const o=t.axis||Ef(t.position)||n.length>1&&Ms(n[0].toLowerCase());if(o)return o}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function vs(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function Mf(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(o=>o.xAxisID===n||o.yAxisID===n);if(t.length)return vs(n,"x",t[0])||vs(n,"y",t[0])}return{}}function vf(n,e){const t=vt[n.type]||{scales:{}},o=e.scales||{},a=fo(n.type,e),s=Object.create(null);return Object.keys(o).forEach(l=>{const r=o[l];if(!se(r))return console.error(`Invalid scale configuration for scale: ${l}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${l}`);const c=mo(l,r,Mf(l,n),Ee.scales[r.type]),d=Sf(c,a),u=t.scales||{};s[l]=an(Object.create(null),[{axis:c},r,u[c],u[d]])}),n.data.datasets.forEach(l=>{const r=l.type||n.type,c=l.indexAxis||fo(r,e),u=(vt[r]||{}).scales||{};Object.keys(u).forEach(h=>{const f=Bf(h,c),m=l[f+"AxisID"]||f;s[m]=s[m]||Object.create(null),an(s[m],[{axis:f},o[m],u[h]])})}),Object.keys(s).forEach(l=>{const r=s[l];an(r,[Ee.scales[r.type],Ee.scale])}),s}function Vs(n){const e=n.options||(n.options={});e.plugins=ie(e.plugins,{}),e.scales=vf(n,e)}function Ds(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function Vf(n){return n=n||{},n.data=Ds(n.data),Vs(n),n}const $s=new Map,Ts=new Set;function ci(n,e){let t=$s.get(n);return t||(t=e(),$s.set(n,t),Ts.add(t)),t}const xn=(n,e,t)=>{const o=bt(e,t);o!==void 0&&n.add(o)};class Df{constructor(e){this._config=Vf(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=Ds(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){const e=this._config;this.clearCache(),Vs(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return ci(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return ci(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return ci(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,o=this.type;return ci(`${o}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const o=this._scopeCache;let a=o.get(e);return(!a||t)&&(a=new Map,o.set(e,a)),a}getOptionScopes(e,t,o){const{options:a,type:s}=this,l=this._cachedScopes(e,o),r=l.get(t);if(r)return r;const c=new Set;t.forEach(u=>{e&&(c.add(e),u.forEach(h=>xn(c,e,h))),u.forEach(h=>xn(c,a,h)),u.forEach(h=>xn(c,vt[s]||{},h)),u.forEach(h=>xn(c,Ee,h)),u.forEach(h=>xn(c,Ki,h))});const d=Array.from(c);return d.length===0&&d.push(Object.create(null)),Ts.has(t)&&l.set(t,d),d}chartOptionScopes(){const{options:e,type:t}=this;return[e,vt[t]||{},Ee.datasets[t]||{},{type:t},Ee,Ki]}resolveNamedOptions(e,t,o,a=[""]){const s={$shared:!0},{resolver:l,subPrefixes:r}=Is(this._resolverCache,e,a);let c=l;if(Tf(l,t)){s.$shared=!1,o=_t(o)?o():o;const d=this.createResolver(e,o,r);c=Yt(l,o,d)}for(const d of t)s[d]=c[d];return s}createResolver(e,t,o=[""],a){const{resolver:s}=Is(this._resolverCache,e,o);return se(t)?Yt(s,t,void 0,a):s}}function Is(n,e,t){let o=n.get(e);o||(o=new Map,n.set(e,o));const a=t.join();let s=o.get(a);return s||(s={resolver:Zi(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},o.set(a,s)),s}const $f=n=>se(n)&&Object.getOwnPropertyNames(n).some(e=>_t(n[e]));function Tf(n,e){const{isScriptable:t,isIndexable:o}=za(n);for(const a of e){const s=t(a),l=o(a),r=(l||s)&&n[a];if(s&&(_t(r)||$f(r))||l&&Se(r))return!0}return!1}var If="4.5.1";const Lf=["top","bottom","left","right","chartArea"];function Ls(n,e){return n==="top"||n==="bottom"||Lf.indexOf(n)===-1&&e==="x"}function zs(n,e){return function(t,o){return t[n]===o[n]?t[e]-o[e]:t[n]-o[n]}}function Ns(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),ke(t&&t.onComplete,[n],e)}function zf(n){const e=n.chart,t=e.options.animation;ke(t&&t.onProgress,[n],e)}function Ps(n){return to()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const di={},As=n=>{const e=Ps(n);return Object.values(di).filter(t=>t.canvas===e).pop()};function Nf(n,e,t){const o=Object.keys(n);for(const a of o){const s=+a;if(s>=e){const l=n[a];delete n[a],(t>0||s>e)&&(n[s+t]=l)}}}function Pf(n,e,t,o){return!t||n.type==="mouseout"?null:o?e:n}class ut{static register(...e){it.add(...e),Rs()}static unregister(...e){it.remove(...e),Rs()}constructor(e,t){const o=this.config=new Df(t),a=Ps(e),s=As(a);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const l=o.createResolver(o.chartOptionScopes(),this.getContext());this.platform=new(o.platform||ef(a)),this.platform.updateConfig(o);const r=this.platform.acquireContext(a,l.aspectRatio),c=r&&r.canvas,d=c&&c.height,u=c&&c.width;if(this.id=Pd(),this.ctx=r,this.canvas=c,this.width=u,this.height=d,this._options=l,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 yf,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=eu(h=>this.update(h),l.resizeDelay||0),this._dataChanges=[],di[this.id]=this,!r||!c){console.error("Failed to create chart: can't acquire context from the given item");return}dt.listen(this,"complete",Ns),dt.listen(this,"progress",zf),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:o,height:a,_aspectRatio:s}=this;return ae(e)?t&&s?s:a?o/a:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return it}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ha(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ta(this.canvas,this.ctx),this}stop(){return dt.stop(this),this}resize(e,t){dt.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const o=this.options,a=this.canvas,s=o.maintainAspectRatio&&this.aspectRatio,l=this.platform.getMaximumSize(a,e,t,s),r=o.devicePixelRatio||this.platform.getDevicePixelRatio(),c=this.width?"resize":"attach";this.width=l.width,this.height=l.height,this._aspectRatio=this.aspectRatio,Ha(this,r,!0)&&(this.notifyPlugins("resize",{size:l}),ke(o.onResize,[this,l],this),this.attached&&this._doResize(c)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};pe(t,(o,a)=>{o.id=a})}buildOrUpdateScales(){const e=this.options,t=e.scales,o=this.scales,a=Object.keys(o).reduce((l,r)=>(l[r]=!1,l),{});let s=[];t&&(s=s.concat(Object.keys(t).map(l=>{const r=t[l],c=mo(l,r),d=c==="r",u=c==="x";return{options:r,dposition:d?"chartArea":u?"bottom":"left",dtype:d?"radialLinear":u?"category":"linear"}}))),pe(s,l=>{const r=l.options,c=r.id,d=mo(c,r),u=ie(r.type,l.dtype);(r.position===void 0||Ls(r.position,d)!==Ls(l.dposition))&&(r.position=l.dposition),a[c]=!0;let h=null;if(c in o&&o[c].type===u)h=o[c];else{const f=it.getScale(u);h=new f({id:c,type:u,ctx:this.ctx,chart:this}),o[h.id]=h}h.init(r,e)}),pe(a,(l,r)=>{l||delete o[r]}),pe(o,l=>{He.configure(this,l,l.options),He.addBox(this,l)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,o=e.length;if(e.sort((a,s)=>a.index-s.index),o>t){for(let a=t;a<o;++a)this._destroyDatasetMeta(a);e.splice(t,o-t)}this._sortedMetasets=e.slice(0).sort(zs("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((o,a)=>{t.filter(s=>s===o._dataset).length===0&&this._destroyDatasetMeta(a)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let o,a;for(this._removeUnreferencedMetasets(),o=0,a=t.length;o<a;o++){const s=t[o];let l=this.getDatasetMeta(o);const r=s.type||this.config.type;if(l.type&&l.type!==r&&(this._destroyDatasetMeta(o),l=this.getDatasetMeta(o)),l.type=r,l.indexAxis=s.indexAxis||fo(r,this.options),l.order=s.order||0,l.index=o,l.label=""+s.label,l.visible=this.isDatasetVisible(o),l.controller)l.controller.updateIndex(o),l.controller.linkScales();else{const c=it.getController(r),{datasetElementType:d,dataElementType:u}=Ee.datasets[r];Object.assign(c,{dataElementType:it.getElement(u),datasetElementType:d&&it.getElement(d)}),l.controller=new c(this,o),e.push(l.controller)}}return this._updateMetasets(),e}_resetElements(){pe(this.data.datasets,(e,t)=>{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(e){const t=this.config;t.update();const o=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),a=this._animationsDisabled=!o.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let l=0;for(let d=0,u=this.data.datasets.length;d<u;d++){const{controller:h}=this.getDatasetMeta(d),f=!a&&s.indexOf(h)===-1;h.buildOrUpdateElements(f),l=Math.max(+h.getMaxOverflow(),l)}l=this._minPadding=o.layout.autoPadding?l:0,this._updateLayout(l),a||pe(s,d=>{d.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(zs("z","_idx"));const{_active:r,_lastEvent:c}=this;c?this._eventHandler(c,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){pe(this.scales,e=>{He.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),o=new Set(e.events);(!ma(t,o)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:o,start:a,count:s}of t){const l=o==="_removeElements"?-s:s;Nf(e,a,l)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,o=s=>new Set(e.filter(l=>l[0]===s).map((l,r)=>r+","+l.splice(1).join(","))),a=o(0);for(let s=1;s<t;s++)if(!ma(a,o(s)))return;return Array.from(a).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;He.update(this,this.width,this.height,e);const t=this.chartArea,o=t.width<=0||t.height<=0;this._layers=[],pe(this.boxes,a=>{o&&a.position==="chartArea"||(a.configure&&a.configure(),this._layers.push(...a._layers()))},this),this._layers.forEach((a,s)=>{a._idx=s}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,o=this.data.datasets.length;t<o;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,o=this.data.datasets.length;t<o;++t)this._updateDataset(t,_t(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const o=this.getDatasetMeta(e),a={meta:o,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",a)!==!1&&(o.controller._update(t),a.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",a))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(dt.has(this)?this.attached&&!dt.running(this)&&dt.start(this):(this.draw(),Ns({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:o,height:a}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(o,a)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,o=[];let a,s;for(a=0,s=t.length;a<s;++a){const l=t[a];(!e||l.visible)&&o.push(l)}return o}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,o={meta:e,index:e.index,cancelable:!0},a=Qa(this,e);this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(a&&Un(t,a),e.controller.draw(),a&&Xn(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return ct(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,o,a){const s=Ih.modes[t];return typeof s=="function"?s(this,e,o,a):[]}getDatasetMeta(e){const t=this.data.datasets[e],o=this._metasets;let a=o.filter(s=>s&&s._dataset===t).pop();return a||(a={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},o.push(a)),a}getContext(){return this.$context||(this.$context=kt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){const t=this.data.datasets[e];if(!t)return!1;const o=this.getDatasetMeta(e);return typeof o.hidden=="boolean"?!o.hidden:!t.hidden}setDatasetVisibility(e,t){const o=this.getDatasetMeta(e);o.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,o){const a=o?"show":"hide",s=this.getDatasetMeta(e),l=s.controller._resolveAnimations(void 0,a);sn(t)?(s.data[t].hidden=!o,this.update()):(this.setDatasetVisibility(e,o),l.update(s,{visible:o}),this.update(r=>r.datasetIndex===e?a:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){const t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),dt.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Ta(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete di[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,o=(s,l)=>{t.addEventListener(this,s,l),e[s]=l},a=(s,l,r)=>{s.offsetX=l,s.offsetY=r,this._eventHandler(s)};pe(this.options.events,s=>o(s,a))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,o=(c,d)=>{t.addEventListener(this,c,d),e[c]=d},a=(c,d)=>{e[c]&&(t.removeEventListener(this,c,d),delete e[c])},s=(c,d)=>{this.canvas&&this.resize(c,d)};let l;const r=()=>{a("attach",r),this.attached=!0,this.resize(),o("resize",s),o("detach",l)};l=()=>{this.attached=!1,a("resize",s),this._stop(),this._resize(0,0),o("attach",r)},t.isAttached(this.canvas)?r():l()}unbindEvents(){pe(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},pe(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,o){const a=o?"set":"remove";let s,l,r,c;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+a+"DatasetHoverStyle"]()),r=0,c=e.length;r<c;++r){l=e[r];const d=l&&this.getDatasetMeta(l.datasetIndex).controller;d&&d[a+"HoverStyle"](l.element,l.datasetIndex,l.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],o=e.map(({datasetIndex:s,index:l})=>{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[l],index:l}});!On(o,t)&&(this._active=o,this._lastEvent=null,this._updateHoverStyles(o,t))}notifyPlugins(e,t,o){return this._plugins.notify(this,e,t,o)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,o){const a=this.options.hover,s=(c,d)=>c.filter(u=>!d.some(h=>u.datasetIndex===h.datasetIndex&&u.index===h.index)),l=s(t,e),r=o?e:s(e,t);l.length&&this.updateHoverStyle(l,a.mode,!1),r.length&&a.mode&&this.updateHoverStyle(r,a.mode,!0)}_eventHandler(e,t){const o={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},a=l=>(l.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",o,a)===!1)return;const s=this._handleEvent(e,t,o.inChartArea);return o.cancelable=!1,this.notifyPlugins("afterEvent",o,a),(s||o.changed)&&this.render(),this}_handleEvent(e,t,o){const{_active:a=[],options:s}=this,l=t,r=this._getActiveElements(e,a,o,l),c=Hd(e),d=Pf(e,this._lastEvent,o,c);o&&(this._lastEvent=null,ke(s.onHover,[e,r,this],this),c&&ke(s.onClick,[e,r,this],this));const u=!On(r,a);return(u||t)&&(this._active=r,this._updateHoverStyles(r,a,t)),this._lastEvent=d,u}_getActiveElements(e,t,o,a){if(e.type==="mouseout")return[];if(!o)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,a)}}W(ut,"defaults",Ee),W(ut,"instances",di),W(ut,"overrides",vt),W(ut,"registry",it),W(ut,"version",If),W(ut,"getChart",As);function Rs(){return pe(ut.instances,n=>n._plugins.invalidate())}function Af(n,e,t){const{startAngle:o,x:a,y:s,outerRadius:l,innerRadius:r,options:c}=e,{borderWidth:d,borderJoinStyle:u}=c,h=Math.min(d/l,Oe(o-t));if(n.beginPath(),n.arc(a,s,l-d/2,o+h/2,t-h/2),r>0){const f=Math.min(d/r,Oe(o-t));n.arc(a,s,r+d/2,t-f/2,o+f/2,!0)}else{const f=Math.min(d/2,l*Oe(o-t));if(u==="round")n.arc(a,s,f,t-de/2,o+de/2,!0);else if(u==="bevel"){const m=2*f*f,p=-m*Math.cos(t+de/2)+a,g=-m*Math.sin(t+de/2)+s,b=m*Math.cos(o+de/2)+a,_=m*Math.sin(o+de/2)+s;n.lineTo(p,g),n.lineTo(b,_)}}n.closePath(),n.moveTo(0,0),n.rect(0,0,n.canvas.width,n.canvas.height),n.clip("evenodd")}function Rf(n,e,t){const{startAngle:o,pixelMargin:a,x:s,y:l,outerRadius:r,innerRadius:c}=e;let d=a/r;n.beginPath(),n.arc(s,l,r,o-d,t+d),c>a?(d=a/c,n.arc(s,l,c,t+d,o-d,!0)):n.arc(s,l,a,t+Ve,o-Ve),n.closePath(),n.clip()}function Of(n){return Ji(n,["outerStart","outerEnd","innerStart","innerEnd"])}function Ff(n,e,t,o){const a=Of(n.options.borderRadius),s=(t-e)/2,l=Math.min(s,o*e/2),r=c=>{const d=(t-Math.min(s,c))*o/2;return Ie(c,0,Math.min(s,d))};return{outerStart:r(a.outerStart),outerEnd:r(a.outerEnd),innerStart:Ie(a.innerStart,0,l),innerEnd:Ie(a.innerEnd,0,l)}}function Kt(n,e,t,o){return{x:t+n*Math.cos(e),y:o+n*Math.sin(e)}}function ui(n,e,t,o,a,s){const{x:l,y:r,startAngle:c,pixelMargin:d,innerRadius:u}=e,h=Math.max(e.outerRadius+o+t-d,0),f=u>0?u+o+t+d:0;let m=0;const p=a-c;if(o){const A=u>0?u-o:0,R=h>0?h-o:0,q=(A+R)/2,Q=q!==0?p*q/(q+o):p;m=(p-Q)/2}const g=Math.max(.001,p*h-t/de)/h,b=(p-g)/2,_=c+b+m,k=a-b-m,{outerStart:B,outerEnd:C,innerStart:y,innerEnd:x}=Ff(e,f,h,k-_),S=h-B,w=h-C,M=_+B/S,N=k-C/w,T=f+y,$=f+x,K=_+y/T,P=k-x/$;if(n.beginPath(),s){const A=(M+N)/2;if(n.arc(l,r,h,M,A),n.arc(l,r,h,A,N),C>0){const ee=Kt(w,N,l,r);n.arc(ee.x,ee.y,C,N,k+Ve)}const R=Kt($,k,l,r);if(n.lineTo(R.x,R.y),x>0){const ee=Kt($,P,l,r);n.arc(ee.x,ee.y,x,k+Ve,P+Math.PI)}const q=(k-x/f+(_+y/f))/2;if(n.arc(l,r,f,k-x/f,q,!0),n.arc(l,r,f,q,_+y/f,!0),y>0){const ee=Kt(T,K,l,r);n.arc(ee.x,ee.y,y,K+Math.PI,_-Ve)}const Q=Kt(S,_,l,r);if(n.lineTo(Q.x,Q.y),B>0){const ee=Kt(S,M,l,r);n.arc(ee.x,ee.y,B,_-Ve,M)}}else{n.moveTo(l,r);const A=Math.cos(M)*h+l,R=Math.sin(M)*h+r;n.lineTo(A,R);const q=Math.cos(N)*h+l,Q=Math.sin(N)*h+r;n.lineTo(q,Q)}n.closePath()}function Wf(n,e,t,o,a){const{fullCircles:s,startAngle:l,circumference:r}=e;let c=e.endAngle;if(s){ui(n,e,t,o,c,a);for(let d=0;d<s;++d)n.fill();isNaN(r)||(c=l+(r%Ce||Ce))}return ui(n,e,t,o,c,a),n.fill(),c}function Hf(n,e,t,o,a){const{fullCircles:s,startAngle:l,circumference:r,options:c}=e,{borderWidth:d,borderJoinStyle:u,borderDash:h,borderDashOffset:f,borderRadius:m}=c,p=c.borderAlign==="inner";if(!d)return;n.setLineDash(h||[]),n.lineDashOffset=f,p?(n.lineWidth=d*2,n.lineJoin=u||"round"):(n.lineWidth=d,n.lineJoin=u||"bevel");let g=e.endAngle;if(s){ui(n,e,t,o,g,a);for(let b=0;b<s;++b)n.stroke();isNaN(r)||(g=l+(r%Ce||Ce))}p&&Rf(n,e,g),c.selfJoin&&g-l>=de&&m===0&&u!=="miter"&&Af(n,e,g),s||(ui(n,e,t,o,g,a),n.stroke())}class wn extends et{constructor(t){super();W(this,"circumference");W(this,"endAngle");W(this,"fullCircles");W(this,"innerRadius");W(this,"outerRadius");W(this,"pixelMargin");W(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,o,a){const s=this.getProps(["x","y"],a),{angle:l,distance:r}=ya(s,{x:t,y:o}),{startAngle:c,endAngle:d,innerRadius:u,outerRadius:h,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],a),m=(this.options.spacing+this.options.borderWidth)/2,p=ie(f,d-c),g=rn(l,c,d)&&c!==d,b=p>=Ce||g,_=lt(r,u+m,h+m);return b&&_}getCenterPoint(t){const{x:o,y:a,startAngle:s,endAngle:l,innerRadius:r,outerRadius:c}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:d,spacing:u}=this.options,h=(s+l)/2,f=(r+c+u+d)/2;return{x:o+Math.cos(h)*f,y:a+Math.sin(h)*f}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:o,circumference:a}=this,s=(o.offset||0)/4,l=(o.spacing||0)/2,r=o.circular;if(this.pixelMargin=o.borderAlign==="inner"?.33:0,this.fullCircles=a>Ce?Math.floor(a/Ce):0,a===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*s,Math.sin(c)*s);const d=1-Math.sin(Math.min(de,a||0)),u=s*d;t.fillStyle=o.backgroundColor,t.strokeStyle=o.borderColor,Wf(t,this,u,l,r),Hf(t,this,u,l,r),t.restore()}}W(wn,"id","arc"),W(wn,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),W(wn,"defaultRoutes",{backgroundColor:"backgroundColor"}),W(wn,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"});function Os(n,e,t=e){n.lineCap=ie(t.borderCapStyle,e.borderCapStyle),n.setLineDash(ie(t.borderDash,e.borderDash)),n.lineDashOffset=ie(t.borderDashOffset,e.borderDashOffset),n.lineJoin=ie(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=ie(t.borderWidth,e.borderWidth),n.strokeStyle=ie(t.borderColor,e.borderColor)}function jf(n,e,t){n.lineTo(t.x,t.y)}function Yf(n){return n.stepped?hu:n.tension||n.cubicInterpolationMode==="monotone"?fu:jf}function Fs(n,e,t={}){const o=n.length,{start:a=0,end:s=o-1}=t,{start:l,end:r}=e,c=Math.max(a,l),d=Math.min(s,r),u=a<l&&s<l||a>r&&s>r;return{count:o,start:c,loop:e.loop,ilen:d<c&&!u?o+d-c:d-c}}function Uf(n,e,t,o){const{points:a,options:s}=e,{count:l,start:r,loop:c,ilen:d}=Fs(a,t,o),u=Yf(s);let{move:h=!0,reverse:f}=o||{},m,p,g;for(m=0;m<=d;++m)p=a[(r+(f?d-m:m))%l],!p.skip&&(h?(n.moveTo(p.x,p.y),h=!1):u(n,g,p,f,s.stepped),g=p);return c&&(p=a[(r+(f?d:0))%l],u(n,g,p,f,s.stepped)),!!c}function Xf(n,e,t,o){const a=e.points,{count:s,start:l,ilen:r}=Fs(a,t,o),{move:c=!0,reverse:d}=o||{};let u=0,h=0,f,m,p,g,b,_;const k=C=>(l+(d?r-C:C))%s,B=()=>{g!==b&&(n.lineTo(u,b),n.lineTo(u,g),n.lineTo(u,_))};for(c&&(m=a[k(0)],n.moveTo(m.x,m.y)),f=0;f<=r;++f){if(m=a[k(f)],m.skip)continue;const C=m.x,y=m.y,x=C|0;x===p?(y<g?g=y:y>b&&(b=y),u=(h*u+C)/++h):(B(),n.lineTo(C,y),p=x,h=0,g=b=y),_=y}B()}function po(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?Xf:Uf}function Kf(n){return n.stepped?Yu:n.tension||n.cubicInterpolationMode==="monotone"?Uu:Lt}function qf(n,e,t,o){let a=e._path;a||(a=e._path=new Path2D,e.path(a,t,o)&&a.closePath()),Os(n,e.options),n.stroke(a)}function Gf(n,e,t,o){const{segments:a,options:s}=e,l=po(e);for(const r of a)Os(n,s,r.style),n.beginPath(),l(n,e,r,{start:t,end:t+o-1})&&n.closePath(),n.stroke()}const Jf=typeof Path2D=="function";function Zf(n,e,t,o){Jf&&!e.options.segment?qf(n,e,t,o):Gf(n,e,t,o)}class wt extends et{constructor(e){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,e&&Object.assign(this,e)}updateControlPoints(e,t){const o=this.options;if((o.tension||o.cubicInterpolationMode==="monotone")&&!o.stepped&&!this._pointsUpdated){const a=o.spanGaps?this._loop:this._fullLoop;Pu(this._points,o,e,a,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Zu(this,this.options.segment))}first(){const e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){const e=this.segments,t=this.points,o=e.length;return o&&t[e[o-1].end]}interpolate(e,t){const o=this.options,a=e[t],s=this.points,l=Ga(this,{property:t,start:a,end:a});if(!l.length)return;const r=[],c=Kf(o);let d,u;for(d=0,u=l.length;d<u;++d){const{start:h,end:f}=l[d],m=s[h],p=s[f];if(m===p){r.push(m);continue}const g=Math.abs((a-m[t])/(p[t]-m[t])),b=c(m,p,g,o.stepped);b[t]=e[t],r.push(b)}return r.length===1?r[0]:r}pathSegment(e,t,o){return po(this)(e,this,t,o)}path(e,t,o){const a=this.segments,s=po(this);let l=this._loop;t=t||0,o=o||this.points.length-t;for(const r of a)l&=s(e,this,r,{start:t,end:t+o-1});return!!l}draw(e,t,o,a){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),Zf(e,this,o,a),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}W(wt,"id","line"),W(wt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),W(wt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),W(wt,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function Ws(n,e,t,o){const a=n.options,{[t]:s}=n.getProps([t],o);return Math.abs(e-s)<a.radius+a.hitRadius}class hi extends et{constructor(t){super();W(this,"parsed");W(this,"skip");W(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,o,a){const s=this.options,{x:l,y:r}=this.getProps(["x","y"],a);return Math.pow(t-l,2)+Math.pow(o-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,o){return Ws(this,t,"x",o)}inYRange(t,o){return Ws(this,t,"y",o)}getCenterPoint(t){const{x:o,y:a}=this.getProps(["x","y"],t);return{x:o,y:a}}size(t){t=t||this.options||{};let o=t.radius||0;o=Math.max(o,o&&t.hoverRadius||0);const a=o&&t.borderWidth||0;return(o+a)*2}draw(t,o){const a=this.options;this.skip||a.radius<.1||!ct(this,o,this.size(a)/2)||(t.strokeStyle=a.borderColor,t.lineWidth=a.borderWidth,t.fillStyle=a.backgroundColor,Gi(t,a,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}W(hi,"id","point"),W(hi,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),W(hi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function Hs(n,e){const{x:t,y:o,base:a,width:s,height:l}=n.getProps(["x","y","base","width","height"],e);let r,c,d,u,h;return n.horizontal?(h=l/2,r=Math.min(t,a),c=Math.max(t,a),d=o-h,u=o+h):(h=s/2,r=t-h,c=t+h,d=Math.min(o,a),u=Math.max(o,a)),{left:r,top:d,right:c,bottom:u}}function Ct(n,e,t,o){return n?0:Ie(e,t,o)}function Qf(n,e,t){const o=n.options.borderWidth,a=n.borderSkipped,s=La(o);return{t:Ct(a.top,s.top,0,t),r:Ct(a.right,s.right,0,e),b:Ct(a.bottom,s.bottom,0,t),l:Ct(a.left,s.left,0,e)}}function em(n,e,t){const{enableBorderRadius:o}=n.getProps(["enableBorderRadius"]),a=n.options.borderRadius,s=$t(a),l=Math.min(e,t),r=n.borderSkipped,c=o||se(a);return{topLeft:Ct(!c||r.top||r.left,s.topLeft,0,l),topRight:Ct(!c||r.top||r.right,s.topRight,0,l),bottomLeft:Ct(!c||r.bottom||r.left,s.bottomLeft,0,l),bottomRight:Ct(!c||r.bottom||r.right,s.bottomRight,0,l)}}function tm(n){const e=Hs(n),t=e.right-e.left,o=e.bottom-e.top,a=Qf(n,t/2,o/2),s=em(n,t/2,o/2);return{outer:{x:e.left,y:e.top,w:t,h:o,radius:s},inner:{x:e.left+a.l,y:e.top+a.t,w:t-a.l-a.r,h:o-a.t-a.b,radius:{topLeft:Math.max(0,s.topLeft-Math.max(a.t,a.l)),topRight:Math.max(0,s.topRight-Math.max(a.t,a.r)),bottomLeft:Math.max(0,s.bottomLeft-Math.max(a.b,a.l)),bottomRight:Math.max(0,s.bottomRight-Math.max(a.b,a.r))}}}}function go(n,e,t,o){const a=e===null,s=t===null,r=n&&!(a&&s)&&Hs(n,o);return r&&(a||lt(e,r.left,r.right))&&(s||lt(t,r.top,r.bottom))}function nm(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function im(n,e){n.rect(e.x,e.y,e.w,e.h)}function bo(n,e,t={}){const o=n.x!==t.x?-e:0,a=n.y!==t.y?-e:0,s=(n.x+n.w!==t.x+t.w?e:0)-o,l=(n.y+n.h!==t.y+t.h?e:0)-a;return{x:n.x+o,y:n.y+a,w:n.w+s,h:n.h+l,radius:n.radius}}class fi extends et{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:o,backgroundColor:a}}=this,{inner:s,outer:l}=tm(this),r=nm(l.radius)?hn:im;e.save(),(l.w!==s.w||l.h!==s.h)&&(e.beginPath(),r(e,bo(l,t,s)),e.clip(),r(e,bo(s,-t,l)),e.fillStyle=o,e.fill("evenodd")),e.beginPath(),r(e,bo(s,t)),e.fillStyle=a,e.fill(),e.restore()}inRange(e,t,o){return go(this,e,t,o)}inXRange(e,t){return go(this,e,null,t)}inYRange(e,t){return go(this,null,e,t)}getCenterPoint(e){const{x:t,y:o,base:a,horizontal:s}=this.getProps(["x","y","base","horizontal"],e);return{x:s?(t+a)/2:t,y:s?o:(o+a)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}W(fi,"id","bar"),W(fi,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),W(fi,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var om=Object.freeze({__proto__:null,ArcElement:wn,BarElement:fi,LineElement:wt,PointElement:hi});const _o=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],js=_o.map(n=>n.replace("rgb(","rgba(").replace(")",", 0.5)"));function Ys(n){return _o[n%_o.length]}function Us(n){return js[n%js.length]}function am(n,e){return n.borderColor=Ys(e),n.backgroundColor=Us(e),++e}function sm(n,e){return n.backgroundColor=n.data.map(()=>Ys(e++)),e}function lm(n,e){return n.backgroundColor=n.data.map(()=>Us(e++)),e}function rm(n){let e=0;return(t,o)=>{const a=n.getDatasetMeta(o).controller;a instanceof zt?e=sm(t,e):a instanceof pn?e=lm(t,e):a&&(e=am(t,e))}}function Xs(n){let e;for(e in n)if(n[e].borderColor||n[e].backgroundColor)return!0;return!1}function cm(n){return n&&(n.borderColor||n.backgroundColor)}function dm(){return Ee.borderColor!=="rgba(0,0,0,0.1)"||Ee.backgroundColor!=="rgba(0,0,0,0.1)"}var um={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(n,e,t){if(!t.enabled)return;const{data:{datasets:o},options:a}=n.config,{elements:s}=a,l=Xs(o)||cm(a)||s&&Xs(s)||dm();if(!t.forceOverride&&l)return;const r=rm(n);o.forEach(r)}};function hm(n,e,t,o,a){const s=a.samples||o;if(s>=t)return n.slice(e,e+t);const l=[],r=(t-2)/(s-2);let c=0;const d=e+t-1;let u=e,h,f,m,p,g;for(l[c++]=n[u],h=0;h<s-2;h++){let b=0,_=0,k;const B=Math.floor((h+1)*r)+1+e,C=Math.min(Math.floor((h+2)*r)+1,t)+e,y=C-B;for(k=B;k<C;k++)b+=n[k].x,_+=n[k].y;b/=y,_/=y;const x=Math.floor(h*r)+1+e,S=Math.min(Math.floor((h+1)*r)+1,t)+e,{x:w,y:M}=n[u];for(m=p=-1,k=x;k<S;k++)p=.5*Math.abs((w-b)*(n[k].y-M)-(w-n[k].x)*(_-M)),p>m&&(m=p,f=n[k],g=k);l[c++]=f,u=g}return l[c++]=n[d],l}function fm(n,e,t,o){let a=0,s=0,l,r,c,d,u,h,f,m,p,g;const b=[],_=e+t-1,k=n[e].x,C=n[_].x-k;for(l=e;l<e+t;++l){r=n[l],c=(r.x-k)/C*o,d=r.y;const y=c|0;if(y===u)d<p?(p=d,h=l):d>g&&(g=d,f=l),a=(s*a+r.x)/++s;else{const x=l-1;if(!ae(h)&&!ae(f)){const S=Math.min(h,f),w=Math.max(h,f);S!==m&&S!==x&&b.push({...n[S],x:a}),w!==m&&w!==x&&b.push({...n[w],x:a})}l>0&&x!==m&&b.push(n[x]),b.push(r),u=y,s=0,p=g=d,h=f=m=l}}return b}function Ks(n){if(n._decimated){const e=n._data;delete n._decimated,delete n._data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,writable:!0,value:e})}}function qs(n){n.data.datasets.forEach(e=>{Ks(e)})}function mm(n,e){const t=e.length;let o=0,a;const{iScale:s}=n,{min:l,max:r,minDefined:c,maxDefined:d}=s.getUserBounds();return c&&(o=Ie(rt(e,s.axis,l).lo,0,t-1)),d?a=Ie(rt(e,s.axis,r).hi+1,o,t)-o:a=t-o,{start:o,count:a}}var pm={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(n,e,t)=>{if(!t.enabled){qs(n);return}const o=n.width;n.data.datasets.forEach((a,s)=>{const{_data:l,indexAxis:r}=a,c=n.getDatasetMeta(s),d=l||a.data;if(fn([r,n.options.indexAxis])==="y"||!c.controller.supportsDecimation)return;const u=n.scales[c.xAxisID];if(u.type!=="linear"&&u.type!=="time"||n.options.parsing)return;let{start:h,count:f}=mm(c,d);const m=t.threshold||4*o;if(f<=m){Ks(a);return}ae(l)&&(a._data=d,delete a.data,Object.defineProperty(a,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(g){this._data=g}}));let p;switch(t.algorithm){case"lttb":p=hm(d,h,f,o,t);break;case"min-max":p=fm(d,h,f,o);break;default:throw new Error(`Unsupported decimation algorithm '${t.algorithm}'`)}a._decimated=p})},destroy(n){qs(n)}};function gm(n,e,t){const o=n.segments,a=n.points,s=e.points,l=[];for(const r of o){let{start:c,end:d}=r;d=mi(c,d,a);const u=yo(t,a[c],a[d],r.loop);if(!e.segments){l.push({source:r,target:u,start:a[c],end:a[d]});continue}const h=Ga(e,u);for(const f of h){const m=yo(t,s[f.start],s[f.end],f.loop),p=qa(r,a,m);for(const g of p)l.push({source:g,target:f,start:{[t]:Gs(u,m,"start",Math.max)},end:{[t]:Gs(u,m,"end",Math.min)}})}}return l}function yo(n,e,t,o){if(o)return;let a=e[n],s=t[n];return n==="angle"&&(a=Oe(a),s=Oe(s)),{property:n,start:a,end:s}}function bm(n,e){const{x:t=null,y:o=null}=n||{},a=e.points,s=[];return e.segments.forEach(({start:l,end:r})=>{r=mi(l,r,a);const c=a[l],d=a[r];o!==null?(s.push({x:c.x,y:o}),s.push({x:d.x,y:o})):t!==null&&(s.push({x:t,y:c.y}),s.push({x:t,y:d.y}))}),s}function mi(n,e,t){for(;e>n;e--){const o=t[e];if(!isNaN(o.x)&&!isNaN(o.y))break}return e}function Gs(n,e,t,o){return n&&e?o(n[t],e[t]):n?n[t]:e?e[t]:0}function Js(n,e){let t=[],o=!1;return Se(n)?(o=!0,t=n):t=bm(n,e),t.length?new wt({points:t,options:{tension:0},_loop:o,_fullLoop:o}):null}function Zs(n){return n&&n.fill!==!1}function _m(n,e,t){let a=n[e].fill;const s=[e];let l;if(!t)return a;for(;a!==!1&&s.indexOf(a)===-1;){if(!Me(a))return a;if(l=n[a],!l)return!1;if(l.visible)return a;s.push(a),a=l.fill}return!1}function ym(n,e,t){const o=Cm(n);if(se(o))return isNaN(o.value)?!1:o;let a=parseFloat(o);return Me(a)&&Math.floor(a)===a?km(o[0],e,a,t):["origin","start","end","stack","shape"].indexOf(o)>=0&&o}function km(n,e,t,o){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=o?!1:t}function xm(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:se(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function wm(n,e,t){let o;return n==="start"?o=t:n==="end"?o=e.options.reverse?e.min:e.max:se(n)?o=n.value:o=e.getBaseValue(),o}function Cm(n){const e=n.options,t=e.fill;let o=ie(t&&t.target,t);return o===void 0&&(o=!!e.backgroundColor),o===!1||o===null?!1:o===!0?"origin":o}function Bm(n){const{scale:e,index:t,line:o}=n,a=[],s=o.segments,l=o.points,r=Sm(e,t);r.push(Js({x:null,y:e.bottom},o));for(let c=0;c<s.length;c++){const d=s[c];for(let u=d.start;u<=d.end;u++)Em(a,l[u],r)}return new wt({points:a,options:{}})}function Sm(n,e){const t=[],o=n.getMatchingVisibleMetas("line");for(let a=0;a<o.length;a++){const s=o[a];if(s.index===e)break;s.hidden||t.unshift(s.dataset)}return t}function Em(n,e,t){const o=[];for(let a=0;a<t.length;a++){const s=t[a],{first:l,last:r,point:c}=Mm(s,e,"x");if(!(!c||l&&r)){if(l)o.unshift(c);else if(n.push(c),!r)break}}n.push(...o)}function Mm(n,e,t){const o=n.interpolate(e,t);if(!o)return{};const a=o[t],s=n.segments,l=n.points;let r=!1,c=!1;for(let d=0;d<s.length;d++){const u=s[d],h=l[u.start][t],f=l[u.end][t];if(lt(a,h,f)){r=a===h,c=a===f;break}}return{first:r,last:c,point:o}}class Qs{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,o){const{x:a,y:s,radius:l}=this;return t=t||{start:0,end:Ce},e.arc(a,s,l,t.end,t.start,!0),!o.bounds}interpolate(e){const{x:t,y:o,radius:a}=this,s=e.angle;return{x:t+Math.cos(s)*a,y:o+Math.sin(s)*a,angle:s}}}function vm(n){const{chart:e,fill:t,line:o}=n;if(Me(t))return Vm(e,t);if(t==="stack")return Bm(n);if(t==="shape")return!0;const a=Dm(n);return a instanceof Qs?a:Js(a,o)}function Vm(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function Dm(n){return(n.scale||{}).getPointPositionForValue?Tm(n):$m(n)}function $m(n){const{scale:e={},fill:t}=n,o=xm(t,e);if(Me(o)){const a=e.isHorizontal();return{x:a?o:null,y:a?null:o}}return null}function Tm(n){const{scale:e,fill:t}=n,o=e.options,a=e.getLabels().length,s=o.reverse?e.max:e.min,l=wm(t,e,s),r=[];if(o.grid.circular){const c=e.getPointPositionForValue(0,s);return new Qs({x:c.x,y:c.y,radius:e.getDistanceFromCenterForValue(l)})}for(let c=0;c<a;++c)r.push(e.getPointPositionForValue(c,l));return r}function ko(n,e,t){const o=vm(e),{chart:a,index:s,line:l,scale:r,axis:c}=e,d=l.options,u=d.fill,h=d.backgroundColor,{above:f=h,below:m=h}=u||{},p=a.getDatasetMeta(s),g=Qa(a,p);o&&l.points.length&&(Un(n,t),Im(n,{line:l,target:o,above:f,below:m,area:t,scale:r,axis:c,clip:g}),Xn(n))}function Im(n,e){const{line:t,target:o,above:a,below:s,area:l,scale:r,clip:c}=e,d=t._loop?"angle":e.axis;n.save();let u=s;s!==a&&(d==="x"?(el(n,o,l.top),xo(n,{line:t,target:o,color:a,scale:r,property:d,clip:c}),n.restore(),n.save(),el(n,o,l.bottom)):d==="y"&&(tl(n,o,l.left),xo(n,{line:t,target:o,color:s,scale:r,property:d,clip:c}),n.restore(),n.save(),tl(n,o,l.right),u=a)),xo(n,{line:t,target:o,color:u,scale:r,property:d,clip:c}),n.restore()}function el(n,e,t){const{segments:o,points:a}=e;let s=!0,l=!1;n.beginPath();for(const r of o){const{start:c,end:d}=r,u=a[c],h=a[mi(c,d,a)];s?(n.moveTo(u.x,u.y),s=!1):(n.lineTo(u.x,t),n.lineTo(u.x,u.y)),l=!!e.pathSegment(n,r,{move:l}),l?n.closePath():n.lineTo(h.x,t)}n.lineTo(e.first().x,t),n.closePath(),n.clip()}function tl(n,e,t){const{segments:o,points:a}=e;let s=!0,l=!1;n.beginPath();for(const r of o){const{start:c,end:d}=r,u=a[c],h=a[mi(c,d,a)];s?(n.moveTo(u.x,u.y),s=!1):(n.lineTo(t,u.y),n.lineTo(u.x,u.y)),l=!!e.pathSegment(n,r,{move:l}),l?n.closePath():n.lineTo(t,h.y)}n.lineTo(t,e.first().y),n.closePath(),n.clip()}function xo(n,e){const{line:t,target:o,property:a,color:s,scale:l,clip:r}=e,c=gm(t,o,a);for(const{source:d,target:u,start:h,end:f}of c){const{style:{backgroundColor:m=s}={}}=d,p=o!==!0;n.save(),n.fillStyle=m,Lm(n,l,r,p&&yo(a,h,f)),n.beginPath();const g=!!t.pathSegment(n,d);let b;if(p){g?n.closePath():nl(n,o,f,a);const _=!!o.pathSegment(n,u,{move:g,reverse:!0});b=g&&_,b||nl(n,o,h,a)}n.closePath(),n.fill(b?"evenodd":"nonzero"),n.restore()}}function Lm(n,e,t,o){const a=e.chart.chartArea,{property:s,start:l,end:r}=o||{};if(s==="x"||s==="y"){let c,d,u,h;s==="x"?(c=l,d=a.top,u=r,h=a.bottom):(c=a.left,d=l,u=a.right,h=r),n.beginPath(),t&&(c=Math.max(c,t.left),u=Math.min(u,t.right),d=Math.max(d,t.top),h=Math.min(h,t.bottom)),n.rect(c,d,u-c,h-d),n.clip()}}function nl(n,e,t,o){const a=e.interpolate(t,o);a&&n.lineTo(a.x,a.y)}var zm={id:"filler",afterDatasetsUpdate(n,e,t){const o=(n.data.datasets||[]).length,a=[];let s,l,r,c;for(l=0;l<o;++l)s=n.getDatasetMeta(l),r=s.dataset,c=null,r&&r.options&&r instanceof wt&&(c={visible:n.isDatasetVisible(l),index:l,fill:ym(r,l,o),chart:n,axis:s.controller.options.indexAxis,scale:s.vScale,line:r}),s.$filler=c,a.push(c);for(l=0;l<o;++l)c=a[l],!(!c||c.fill===!1)&&(c.fill=_m(a,l,t.propagate))},beforeDraw(n,e,t){const o=t.drawTime==="beforeDraw",a=n.getSortedVisibleDatasetMetas(),s=n.chartArea;for(let l=a.length-1;l>=0;--l){const r=a[l].$filler;r&&(r.line.updateControlPoints(s,r.axis),o&&r.fill&&ko(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const o=n.getSortedVisibleDatasetMetas();for(let a=o.length-1;a>=0;--a){const s=o[a].$filler;Zs(s)&&ko(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const o=e.meta.$filler;!Zs(o)||t.drawTime!=="beforeDatasetDraw"||ko(n.ctx,o,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const il=(n,e)=>{let{boxHeight:t=e,boxWidth:o=e}=n;return n.usePointStyle&&(t=Math.min(t,e),o=n.pointStyleWidth||Math.min(o,e)),{boxWidth:o,boxHeight:t,itemHeight:Math.max(e,t)}},Nm=(n,e)=>n!==null&&e!==null&&n.datasetIndex===e.datasetIndex&&n.index===e.index;class ol extends et{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,o){this.maxWidth=e,this.maxHeight=t,this._margins=o,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 e=this.options.labels||{};let t=ke(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(o=>e.filter(o,this.chart.data))),e.sort&&(t=t.sort((o,a)=>e.sort(o,a,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){const{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}const o=e.labels,a=$e(o.font),s=a.size,l=this._computeTitleHeight(),{boxWidth:r,itemHeight:c}=il(o,s);let d,u;t.font=a.string,this.isHorizontal()?(d=this.maxWidth,u=this._fitRows(l,s,r,c)+10):(u=this.maxHeight,d=this._fitCols(l,a,r,c)+10),this.width=Math.min(d,e.maxWidth||this.maxWidth),this.height=Math.min(u,e.maxHeight||this.maxHeight)}_fitRows(e,t,o,a){const{ctx:s,maxWidth:l,options:{labels:{padding:r}}}=this,c=this.legendHitBoxes=[],d=this.lineWidths=[0],u=a+r;let h=e;s.textAlign="left",s.textBaseline="middle";let f=-1,m=-u;return this.legendItems.forEach((p,g)=>{const b=o+t/2+s.measureText(p.text).width;(g===0||d[d.length-1]+b+2*r>l)&&(h+=u,d[d.length-(g>0?0:1)]=0,m+=u,f++),c[g]={left:0,top:m,row:f,width:b,height:a},d[d.length-1]+=b+r}),h}_fitCols(e,t,o,a){const{ctx:s,maxHeight:l,options:{labels:{padding:r}}}=this,c=this.legendHitBoxes=[],d=this.columnSizes=[],u=l-e;let h=r,f=0,m=0,p=0,g=0;return this.legendItems.forEach((b,_)=>{const{itemWidth:k,itemHeight:B}=Pm(o,t,s,b,a);_>0&&m+B+2*r>u&&(h+=f+r,d.push({width:f,height:m}),p+=f+r,g++,f=m=0),c[_]={left:p,top:m,col:g,width:k,height:B},f=Math.max(f,k),m+=B+r}),h+=f,d.push({width:f,height:m}),h}adjustHitBoxes(){if(!this.options.display)return;const e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:o,labels:{padding:a},rtl:s}}=this,l=Xt(s,this.left,this.width);if(this.isHorizontal()){let r=0,c=Fe(o,this.left+a,this.right-this.lineWidths[r]);for(const d of t)r!==d.row&&(r=d.row,c=Fe(o,this.left+a,this.right-this.lineWidths[r])),d.top+=this.top+e+a,d.left=l.leftForLtr(l.x(c),d.width),c+=d.width+a}else{let r=0,c=Fe(o,this.top+e+a,this.bottom-this.columnSizes[r].height);for(const d of t)d.col!==r&&(r=d.col,c=Fe(o,this.top+e+a,this.bottom-this.columnSizes[r].height)),d.top=c,d.left+=this.left+a,d.left=l.leftForLtr(l.x(d.left),d.width),c+=d.height+a}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const e=this.ctx;Un(e,this),this._draw(),Xn(e)}}_draw(){const{options:e,columnSizes:t,lineWidths:o,ctx:a}=this,{align:s,labels:l}=e,r=Ee.color,c=Xt(e.rtl,this.left,this.width),d=$e(l.font),{padding:u}=l,h=d.size,f=h/2;let m;this.drawTitle(),a.textAlign=c.textAlign("left"),a.textBaseline="middle",a.lineWidth=.5,a.font=d.string;const{boxWidth:p,boxHeight:g,itemHeight:b}=il(l,h),_=function(x,S,w){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;a.save();const M=ie(w.lineWidth,1);if(a.fillStyle=ie(w.fillStyle,r),a.lineCap=ie(w.lineCap,"butt"),a.lineDashOffset=ie(w.lineDashOffset,0),a.lineJoin=ie(w.lineJoin,"miter"),a.lineWidth=M,a.strokeStyle=ie(w.strokeStyle,r),a.setLineDash(ie(w.lineDash,[])),l.usePointStyle){const N={radius:g*Math.SQRT2/2,pointStyle:w.pointStyle,rotation:w.rotation,borderWidth:M},T=c.xPlus(x,p/2),$=S+f;Ia(a,N,T,$,l.pointStyleWidth&&p)}else{const N=S+Math.max((h-g)/2,0),T=c.leftForLtr(x,p),$=$t(w.borderRadius);a.beginPath(),Object.values($).some(K=>K!==0)?hn(a,{x:T,y:N,w:p,h:g,radius:$}):a.rect(T,N,p,g),a.fill(),M!==0&&a.stroke()}a.restore()},k=function(x,S,w){Dt(a,w.text,x,S+b/2,d,{strikethrough:w.hidden,textAlign:c.textAlign(w.textAlign)})},B=this.isHorizontal(),C=this._computeTitleHeight();B?m={x:Fe(s,this.left+u,this.right-o[0]),y:this.top+u+C,line:0}:m={x:this.left+u,y:Fe(s,this.top+C+u,this.bottom-t[0].height),line:0},Ya(this.ctx,e.textDirection);const y=b+u;this.legendItems.forEach((x,S)=>{a.strokeStyle=x.fontColor,a.fillStyle=x.fontColor;const w=a.measureText(x.text).width,M=c.textAlign(x.textAlign||(x.textAlign=l.textAlign)),N=p+f+w;let T=m.x,$=m.y;c.setWidth(this.width),B?S>0&&T+N+u>this.right&&($=m.y+=y,m.line++,T=m.x=Fe(s,this.left+u,this.right-o[m.line])):S>0&&$+y>this.bottom&&(T=m.x=T+t[m.line].width+u,m.line++,$=m.y=Fe(s,this.top+C+u,this.bottom-t[m.line].height));const K=c.x(T);if(_(K,$,x),T=tu(M,T+p+f,B?T+N:this.right,e.rtl),k(c.x(T),$,x),B)m.x+=N+u;else if(typeof x.text!="string"){const P=d.lineHeight;m.y+=al(x,P)+u}else m.y+=y}),Ua(this.ctx,e.textDirection)}drawTitle(){const e=this.options,t=e.title,o=$e(t.font),a=We(t.padding);if(!t.display)return;const s=Xt(e.rtl,this.left,this.width),l=this.ctx,r=t.position,c=o.size/2,d=a.top+c;let u,h=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),u=this.top+d,h=Fe(e.align,h,this.right-f);else{const p=this.columnSizes.reduce((g,b)=>Math.max(g,b.height),0);u=d+Fe(e.align,this.top,this.bottom-p-e.labels.padding-this._computeTitleHeight())}const m=Fe(r,h,h+f);l.textAlign=s.textAlign(Yi(r)),l.textBaseline="middle",l.strokeStyle=t.color,l.fillStyle=t.color,l.font=o.string,Dt(l,t.text,m,u,o)}_computeTitleHeight(){const e=this.options.title,t=$e(e.font),o=We(e.padding);return e.display?t.lineHeight+o.height:0}_getLegendItemAt(e,t){let o,a,s;if(lt(e,this.left,this.right)&&lt(t,this.top,this.bottom)){for(s=this.legendHitBoxes,o=0;o<s.length;++o)if(a=s[o],lt(e,a.left,a.left+a.width)&&lt(t,a.top,a.top+a.height))return this.legendItems[o]}return null}handleEvent(e){const t=this.options;if(!Om(e.type,t))return;const o=this._getLegendItemAt(e.x,e.y);if(e.type==="mousemove"||e.type==="mouseout"){const a=this._hoveredItem,s=Nm(a,o);a&&!s&&ke(t.onLeave,[e,a,this],this),this._hoveredItem=o,o&&!s&&ke(t.onHover,[e,o,this],this)}else o&&ke(t.onClick,[e,o,this],this)}}function Pm(n,e,t,o,a){const s=Am(o,n,e,t),l=Rm(a,o,e.lineHeight);return{itemWidth:s,itemHeight:l}}function Am(n,e,t,o){let a=n.text;return a&&typeof a!="string"&&(a=a.reduce((s,l)=>s.length>l.length?s:l)),e+t.size/2+o.measureText(a).width}function Rm(n,e,t){let o=n;return typeof e.text!="string"&&(o=al(e,t)),o}function al(n,e){const t=n.text?n.text.length:0;return e*t}function Om(n,e){return!!((n==="mousemove"||n==="mouseout")&&(e.onHover||e.onLeave)||e.onClick&&(n==="click"||n==="mouseup"))}var Fm={id:"legend",_element:ol,start(n,e,t){const o=n.legend=new ol({ctx:n.ctx,options:t,chart:n});He.configure(n,o,t),He.addBox(n,o)},stop(n){He.removeBox(n,n.legend),delete n.legend},beforeUpdate(n,e,t){const o=n.legend;He.configure(n,o,t),o.options=t},afterUpdate(n){const e=n.legend;e.buildLabels(),e.adjustHitBoxes()},afterEvent(n,e){e.replay||n.legend.handleEvent(e.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(n,e,t){const o=e.datasetIndex,a=t.chart;a.isDatasetVisible(o)?(a.hide(o),e.hidden=!0):(a.show(o),e.hidden=!1)},onHover:null,onLeave:null,labels:{color:n=>n.chart.options.color,boxWidth:40,padding:10,generateLabels(n){const e=n.data.datasets,{labels:{usePointStyle:t,pointStyle:o,textAlign:a,color:s,useBorderRadius:l,borderRadius:r}}=n.legend.options;return n._getSortedDatasetMetas().map(c=>{const d=c.controller.getStyle(t?0:void 0),u=We(d.borderWidth);return{text:e[c.index].label,fillStyle:d.backgroundColor,fontColor:s,hidden:!c.visible,lineCap:d.borderCapStyle,lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:(u.width+u.height)/4,strokeStyle:d.borderColor,pointStyle:o||d.pointStyle,rotation:d.rotation,textAlign:a||d.textAlign,borderRadius:l&&(r||d.borderRadius),datasetIndex:c.index}},this)}},title:{color:n=>n.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:n=>!n.startsWith("on"),labels:{_scriptable:n=>!["generateLabels","filter","sort"].includes(n)}}};class wo extends et{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){const o=this.options;if(this.left=0,this.top=0,!o.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;const a=Se(o.text)?o.text.length:1;this._padding=We(o.padding);const s=a*$e(o.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=s:this.width=s}isHorizontal(){const e=this.options.position;return e==="top"||e==="bottom"}_drawArgs(e){const{top:t,left:o,bottom:a,right:s,options:l}=this,r=l.align;let c=0,d,u,h;return this.isHorizontal()?(u=Fe(r,o,s),h=t+e,d=s-o):(l.position==="left"?(u=o+e,h=Fe(r,a,t),c=de*-.5):(u=s-e,h=Fe(r,t,a),c=de*.5),d=a-t),{titleX:u,titleY:h,maxWidth:d,rotation:c}}draw(){const e=this.ctx,t=this.options;if(!t.display)return;const o=$e(t.font),s=o.lineHeight/2+this._padding.top,{titleX:l,titleY:r,maxWidth:c,rotation:d}=this._drawArgs(s);Dt(e,t.text,0,0,o,{color:t.color,maxWidth:c,rotation:d,textAlign:Yi(t.align),textBaseline:"middle",translation:[l,r]})}}function Wm(n,e){const t=new wo({ctx:n.ctx,options:e,chart:n});He.configure(n,t,e),He.addBox(n,t),n.titleBlock=t}var Hm={id:"title",_element:wo,start(n,e,t){Wm(n,t)},stop(n){const e=n.titleBlock;He.removeBox(n,e),delete n.titleBlock},beforeUpdate(n,e,t){const o=n.titleBlock;He.configure(n,o,t),o.options=t},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const pi=new WeakMap;var jm={id:"subtitle",start(n,e,t){const o=new wo({ctx:n.ctx,options:t,chart:n});He.configure(n,o,t),He.addBox(n,o),pi.set(n,o)},stop(n){He.removeBox(n,pi.get(n)),pi.delete(n)},beforeUpdate(n,e,t){const o=pi.get(n);He.configure(n,o,t),o.options=t},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Cn={average(n){if(!n.length)return!1;let e,t,o=new Set,a=0,s=0;for(e=0,t=n.length;e<t;++e){const r=n[e].element;if(r&&r.hasValue()){const c=r.tooltipPosition();o.add(c.x),a+=c.y,++s}}return s===0||o.size===0?!1:{x:[...o].reduce((r,c)=>r+c)/o.size,y:a/s}},nearest(n,e){if(!n.length)return!1;let t=e.x,o=e.y,a=Number.POSITIVE_INFINITY,s,l,r;for(s=0,l=n.length;s<l;++s){const c=n[s].element;if(c&&c.hasValue()){const d=c.getCenterPoint(),u=Hi(e,d);u<a&&(a=u,r=c)}}if(r){const c=r.tooltipPosition();t=c.x,o=c.y}return{x:t,y:o}}};function ot(n,e){return e&&(Se(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function ht(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
44
+ `)>-1?n.split(`
45
+ `):n}function Ym(n,e){const{element:t,datasetIndex:o,index:a}=e,s=n.getDatasetMeta(o).controller,{label:l,value:r}=s.getLabelAndValue(a);return{chart:n,label:l,parsed:s.getParsed(a),raw:n.data.datasets[o].data[a],formattedValue:r,dataset:s.getDataset(),dataIndex:a,datasetIndex:o,element:t}}function sl(n,e){const t=n.chart.ctx,{body:o,footer:a,title:s}=n,{boxWidth:l,boxHeight:r}=e,c=$e(e.bodyFont),d=$e(e.titleFont),u=$e(e.footerFont),h=s.length,f=a.length,m=o.length,p=We(e.padding);let g=p.height,b=0,_=o.reduce((C,y)=>C+y.before.length+y.lines.length+y.after.length,0);if(_+=n.beforeBody.length+n.afterBody.length,h&&(g+=h*d.lineHeight+(h-1)*e.titleSpacing+e.titleMarginBottom),_){const C=e.displayColors?Math.max(r,c.lineHeight):c.lineHeight;g+=m*C+(_-m)*c.lineHeight+(_-1)*e.bodySpacing}f&&(g+=e.footerMarginTop+f*u.lineHeight+(f-1)*e.footerSpacing);let k=0;const B=function(C){b=Math.max(b,t.measureText(C).width+k)};return t.save(),t.font=d.string,pe(n.title,B),t.font=c.string,pe(n.beforeBody.concat(n.afterBody),B),k=e.displayColors?l+2+e.boxPadding:0,pe(o,C=>{pe(C.before,B),pe(C.lines,B),pe(C.after,B)}),k=0,t.font=u.string,pe(n.footer,B),t.restore(),b+=p.width,{width:b,height:g}}function Um(n,e){const{y:t,height:o}=e;return t<o/2?"top":t>n.height-o/2?"bottom":"center"}function Xm(n,e,t,o){const{x:a,width:s}=o,l=t.caretSize+t.caretPadding;if(n==="left"&&a+s+l>e.width||n==="right"&&a-s-l<0)return!0}function Km(n,e,t,o){const{x:a,width:s}=t,{width:l,chartArea:{left:r,right:c}}=n;let d="center";return o==="center"?d=a<=(r+c)/2?"left":"right":a<=s/2?d="left":a>=l-s/2&&(d="right"),Xm(d,n,e,t)&&(d="center"),d}function ll(n,e,t){const o=t.yAlign||e.yAlign||Um(n,t);return{xAlign:t.xAlign||e.xAlign||Km(n,e,t,o),yAlign:o}}function qm(n,e){let{x:t,width:o}=n;return e==="right"?t-=o:e==="center"&&(t-=o/2),t}function Gm(n,e,t){let{y:o,height:a}=n;return e==="top"?o+=t:e==="bottom"?o-=a+t:o-=a/2,o}function rl(n,e,t,o){const{caretSize:a,caretPadding:s,cornerRadius:l}=n,{xAlign:r,yAlign:c}=t,d=a+s,{topLeft:u,topRight:h,bottomLeft:f,bottomRight:m}=$t(l);let p=qm(e,r);const g=Gm(e,c,d);return c==="center"?r==="left"?p+=d:r==="right"&&(p-=d):r==="left"?p-=Math.max(u,f)+a:r==="right"&&(p+=Math.max(h,m)+a),{x:Ie(p,0,o.width-e.width),y:Ie(g,0,o.height-e.height)}}function gi(n,e,t){const o=We(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-o.right:n.x+o.left}function cl(n){return ot([],ht(n))}function Jm(n,e,t){return kt(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function dl(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const ul={beforeTitle:st,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,o=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(o>0&&e.dataIndex<o)return t[e.dataIndex]}return""},afterTitle:st,beforeBody:st,beforeLabel:st,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return ae(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:st,afterBody:st,beforeFooter:st,footer:st,afterFooter:st};function Xe(n,e,t,o){const a=n[e].call(t,o);return typeof a>"u"?ul[e].call(t,o):a}let hl=(Ro=class extends et{constructor(e){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=e.chart,this.options=e.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(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,o=this.options.setContext(this.getContext()),a=o.enabled&&t.options.animation&&o.animations,s=new ts(this.chart,a);return a._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=Jm(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:o}=t,a=Xe(o,"beforeTitle",this,e),s=Xe(o,"title",this,e),l=Xe(o,"afterTitle",this,e);let r=[];return r=ot(r,ht(a)),r=ot(r,ht(s)),r=ot(r,ht(l)),r}getBeforeBody(e,t){return cl(Xe(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:o}=t,a=[];return pe(e,s=>{const l={before:[],lines:[],after:[]},r=dl(o,s);ot(l.before,ht(Xe(r,"beforeLabel",this,s))),ot(l.lines,Xe(r,"label",this,s)),ot(l.after,ht(Xe(r,"afterLabel",this,s))),a.push(l)}),a}getAfterBody(e,t){return cl(Xe(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:o}=t,a=Xe(o,"beforeFooter",this,e),s=Xe(o,"footer",this,e),l=Xe(o,"afterFooter",this,e);let r=[];return r=ot(r,ht(a)),r=ot(r,ht(s)),r=ot(r,ht(l)),r}_createItems(e){const t=this._active,o=this.chart.data,a=[],s=[],l=[];let r=[],c,d;for(c=0,d=t.length;c<d;++c)r.push(Ym(this.chart,t[c]));return e.filter&&(r=r.filter((u,h,f)=>e.filter(u,h,f,o))),e.itemSort&&(r=r.sort((u,h)=>e.itemSort(u,h,o))),pe(r,u=>{const h=dl(e.callbacks,u);a.push(Xe(h,"labelColor",this,u)),s.push(Xe(h,"labelPointStyle",this,u)),l.push(Xe(h,"labelTextColor",this,u))}),this.labelColors=a,this.labelPointStyles=s,this.labelTextColors=l,this.dataPoints=r,r}update(e,t){const o=this.options.setContext(this.getContext()),a=this._active;let s,l=[];if(!a.length)this.opacity!==0&&(s={opacity:0});else{const r=Cn[o.position].call(this,a,this._eventPosition);l=this._createItems(o),this.title=this.getTitle(l,o),this.beforeBody=this.getBeforeBody(l,o),this.body=this.getBody(l,o),this.afterBody=this.getAfterBody(l,o),this.footer=this.getFooter(l,o);const c=this._size=sl(this,o),d=Object.assign({},r,c),u=ll(this.chart,o,d),h=rl(o,d,u,this.chart);this.xAlign=u.xAlign,this.yAlign=u.yAlign,s={opacity:1,x:h.x,y:h.y,width:c.width,height:c.height,caretX:r.x,caretY:r.y}}this._tooltipItems=l,this.$context=void 0,s&&this._resolveAnimations().update(this,s),e&&o.external&&o.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,o,a){const s=this.getCaretPosition(e,o,a);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,o){const{xAlign:a,yAlign:s}=this,{caretSize:l,cornerRadius:r}=o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:h}=$t(r),{x:f,y:m}=e,{width:p,height:g}=t;let b,_,k,B,C,y;return s==="center"?(C=m+g/2,a==="left"?(b=f,_=b-l,B=C+l,y=C-l):(b=f+p,_=b+l,B=C-l,y=C+l),k=b):(a==="left"?_=f+Math.max(c,u)+l:a==="right"?_=f+p-Math.max(d,h)-l:_=this.caretX,s==="top"?(B=m,C=B-l,b=_-l,k=_+l):(B=m+g,C=B+l,b=_+l,k=_-l),y=B),{x1:b,x2:_,x3:k,y1:B,y2:C,y3:y}}drawTitle(e,t,o){const a=this.title,s=a.length;let l,r,c;if(s){const d=Xt(o.rtl,this.x,this.width);for(e.x=gi(this,o.titleAlign,o),t.textAlign=d.textAlign(o.titleAlign),t.textBaseline="middle",l=$e(o.titleFont),r=o.titleSpacing,t.fillStyle=o.titleColor,t.font=l.string,c=0;c<s;++c)t.fillText(a[c],d.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+r,c+1===s&&(e.y+=o.titleMarginBottom-r)}}_drawColorBox(e,t,o,a,s){const l=this.labelColors[o],r=this.labelPointStyles[o],{boxHeight:c,boxWidth:d}=s,u=$e(s.bodyFont),h=gi(this,"left",s),f=a.x(h),m=c<u.lineHeight?(u.lineHeight-c)/2:0,p=t.y+m;if(s.usePointStyle){const g={radius:Math.min(d,c)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},b=a.leftForLtr(f,d)+d/2,_=p+c/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,Gi(e,g,b,_),e.strokeStyle=l.borderColor,e.fillStyle=l.backgroundColor,Gi(e,g,b,_)}else{e.lineWidth=se(l.borderWidth)?Math.max(...Object.values(l.borderWidth)):l.borderWidth||1,e.strokeStyle=l.borderColor,e.setLineDash(l.borderDash||[]),e.lineDashOffset=l.borderDashOffset||0;const g=a.leftForLtr(f,d),b=a.leftForLtr(a.xPlus(f,1),d-2),_=$t(l.borderRadius);Object.values(_).some(k=>k!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,hn(e,{x:g,y:p,w:d,h:c,radius:_}),e.fill(),e.stroke(),e.fillStyle=l.backgroundColor,e.beginPath(),hn(e,{x:b,y:p+1,w:d-2,h:c-2,radius:_}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(g,p,d,c),e.strokeRect(g,p,d,c),e.fillStyle=l.backgroundColor,e.fillRect(b,p+1,d-2,c-2))}e.fillStyle=this.labelTextColors[o]}drawBody(e,t,o){const{body:a}=this,{bodySpacing:s,bodyAlign:l,displayColors:r,boxHeight:c,boxWidth:d,boxPadding:u}=o,h=$e(o.bodyFont);let f=h.lineHeight,m=0;const p=Xt(o.rtl,this.x,this.width),g=function(w){t.fillText(w,p.x(e.x+m),e.y+f/2),e.y+=f+s},b=p.textAlign(l);let _,k,B,C,y,x,S;for(t.textAlign=l,t.textBaseline="middle",t.font=h.string,e.x=gi(this,b,o),t.fillStyle=o.bodyColor,pe(this.beforeBody,g),m=r&&b!=="right"?l==="center"?d/2+u:d+2+u:0,C=0,x=a.length;C<x;++C){for(_=a[C],k=this.labelTextColors[C],t.fillStyle=k,pe(_.before,g),B=_.lines,r&&B.length&&(this._drawColorBox(t,e,C,p,o),f=Math.max(h.lineHeight,c)),y=0,S=B.length;y<S;++y)g(B[y]),f=h.lineHeight;pe(_.after,g)}m=0,f=h.lineHeight,pe(this.afterBody,g),e.y-=s}drawFooter(e,t,o){const a=this.footer,s=a.length;let l,r;if(s){const c=Xt(o.rtl,this.x,this.width);for(e.x=gi(this,o.footerAlign,o),e.y+=o.footerMarginTop,t.textAlign=c.textAlign(o.footerAlign),t.textBaseline="middle",l=$e(o.footerFont),t.fillStyle=o.footerColor,t.font=l.string,r=0;r<s;++r)t.fillText(a[r],c.x(e.x),e.y+l.lineHeight/2),e.y+=l.lineHeight+o.footerSpacing}}drawBackground(e,t,o,a){const{xAlign:s,yAlign:l}=this,{x:r,y:c}=e,{width:d,height:u}=o,{topLeft:h,topRight:f,bottomLeft:m,bottomRight:p}=$t(a.cornerRadius);t.fillStyle=a.backgroundColor,t.strokeStyle=a.borderColor,t.lineWidth=a.borderWidth,t.beginPath(),t.moveTo(r+h,c),l==="top"&&this.drawCaret(e,t,o,a),t.lineTo(r+d-f,c),t.quadraticCurveTo(r+d,c,r+d,c+f),l==="center"&&s==="right"&&this.drawCaret(e,t,o,a),t.lineTo(r+d,c+u-p),t.quadraticCurveTo(r+d,c+u,r+d-p,c+u),l==="bottom"&&this.drawCaret(e,t,o,a),t.lineTo(r+m,c+u),t.quadraticCurveTo(r,c+u,r,c+u-m),l==="center"&&s==="left"&&this.drawCaret(e,t,o,a),t.lineTo(r,c+h),t.quadraticCurveTo(r,c,r+h,c),t.closePath(),t.fill(),a.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,o=this.$animations,a=o&&o.x,s=o&&o.y;if(a||s){const l=Cn[e.position].call(this,this._active,this._eventPosition);if(!l)return;const r=this._size=sl(this,e),c=Object.assign({},l,this._size),d=ll(t,e,c),u=rl(e,c,d,t);(a._to!==u.x||s._to!==u.y)&&(this.xAlign=d.xAlign,this.yAlign=d.yAlign,this.width=r.width,this.height=r.height,this.caretX=l.x,this.caretY=l.y,this._resolveAnimations().update(this,u))}}_willRender(){return!!this.opacity}draw(e){const t=this.options.setContext(this.getContext());let o=this.opacity;if(!o)return;this._updateAnimationTarget(t);const a={width:this.width,height:this.height},s={x:this.x,y:this.y};o=Math.abs(o)<.001?0:o;const l=We(t.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&r&&(e.save(),e.globalAlpha=o,this.drawBackground(s,e,a,t),Ya(e,t.textDirection),s.y+=l.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),Ua(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const o=this._active,a=e.map(({datasetIndex:r,index:c})=>{const d=this.chart.getDatasetMeta(r);if(!d)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:d.data[c],index:c}}),s=!On(o,a),l=this._positionChanged(a,t);(s||l)&&(this._active=a,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,o=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const a=this.options,s=this._active||[],l=this._getActiveElements(e,s,t,o),r=this._positionChanged(l,e),c=t||!On(l,s)||r;return c&&(this._active=l,(a.enabled||a.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),c}_getActiveElements(e,t,o,a){const s=this.options;if(e.type==="mouseout")return[];if(!a)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const l=this.chart.getElementsAtEventForMode(e,s.mode,s,o);return s.reverse&&l.reverse(),l}_positionChanged(e,t){const{caretX:o,caretY:a,options:s}=this,l=Cn[s.position].call(this,e,t);return l!==!1&&(o!==l.x||a!==l.y)}},W(Ro,"positioners",Cn),Ro);var Zm={id:"tooltip",_element:hl,positioners:Cn,afterInit(n,e,t){t&&(n.tooltip=new hl({chart:n,options:t}))},beforeUpdate(n,e,t){n.tooltip&&n.tooltip.initialize(t)},reset(n,e,t){n.tooltip&&n.tooltip.initialize(t)},afterDraw(n){const e=n.tooltip;if(e&&e._willRender()){const t={tooltip:e};if(n.notifyPlugins("beforeTooltipDraw",{...t,cancelable:!0})===!1)return;e.draw(n.ctx),n.notifyPlugins("afterTooltipDraw",t)}},afterEvent(n,e){if(n.tooltip){const t=e.replay;n.tooltip.handleEvent(e.event,t,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(n,e)=>e.bodyFont.size,boxWidth:(n,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:ul},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:n=>n!=="filter"&&n!=="itemSort"&&n!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Qm=Object.freeze({__proto__:null,Colors:um,Decimation:pm,Filler:zm,Legend:Fm,SubTitle:jm,Title:Hm,Tooltip:Zm});const ep=(n,e,t,o)=>(typeof e=="string"?(t=n.push(e)-1,o.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function tp(n,e,t,o){const a=n.indexOf(e);if(a===-1)return ep(n,e,t,o);const s=n.lastIndexOf(e);return a!==s?t:a}const np=(n,e)=>n===null?null:Ie(Math.round(n),0,e);function fl(n){const e=this.getLabels();return n>=0&&n<e.length?e[n]:n}class Co extends Pt{constructor(e){super(e),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(e){const t=this._addedLabels;if(t.length){const o=this.getLabels();for(const{index:a,label:s}of t)o[a]===s&&o.splice(a,1);this._addedLabels=[]}super.init(e)}parse(e,t){if(ae(e))return null;const o=this.getLabels();return t=isFinite(t)&&o[t]===e?t:tp(o,e,ie(t,e),this._addedLabels),np(t,o.length-1)}determineDataLimits(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let{min:o,max:a}=this.getMinMax(!0);this.options.bounds==="ticks"&&(e||(o=0),t||(a=this.getLabels().length-1)),this.min=o,this.max=a}buildTicks(){const e=this.min,t=this.max,o=this.options.offset,a=[];let s=this.getLabels();s=e===0&&t===s.length-1?s:s.slice(e,t+1),this._valueRange=Math.max(s.length-(o?0:1),1),this._startValue=this.min-(o?.5:0);for(let l=e;l<=t;l++)a.push({value:l});return a}getLabelForValue(e){return fl.call(this,e)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(e){return typeof e!="number"&&(e=this.parse(e)),e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getPixelForTick(e){const t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}}W(Co,"id","category"),W(Co,"defaults",{ticks:{callback:fl}});function ip(n,e){const t=[],{bounds:a,step:s,min:l,max:r,precision:c,count:d,maxTicks:u,maxDigits:h,includeBounds:f}=n,m=s||1,p=u-1,{min:g,max:b}=e,_=!ae(l),k=!ae(r),B=!ae(d),C=(b-g)/(h+1);let y=ga((b-g)/p/m)*m,x,S,w,M;if(y<1e-14&&!_&&!k)return[{value:g},{value:b}];M=Math.ceil(b/y)-Math.floor(g/y),M>p&&(y=ga(M*y/p/m)*m),ae(c)||(x=Math.pow(10,c),y=Math.ceil(y*x)/x),a==="ticks"?(S=Math.floor(g/y)*y,w=Math.ceil(b/y)*y):(S=g,w=b),_&&k&&s&&Kd((r-l)/s,y/1e3)?(M=Math.round(Math.min((r-l)/y,u)),y=(r-l)/M,S=l,w=r):B?(S=_?l:S,w=k?r:w,M=d-1,y=(w-S)/M):(M=(w-S)/y,ln(M,Math.round(M),y/1e3)?M=Math.round(M):M=Math.ceil(M));const N=Math.max(_a(y),_a(S));x=Math.pow(10,ae(c)?N:c),S=Math.round(S*x)/x,w=Math.round(w*x)/x;let T=0;for(_&&(f&&S!==l?(t.push({value:l}),S<l&&T++,ln(Math.round((S+T*y)*x)/x,l,ml(l,C,n))&&T++):S<l&&T++);T<M;++T){const $=Math.round((S+T*y)*x)/x;if(k&&$>r)break;t.push({value:$})}return k&&f&&w!==r?t.length&&ln(t[t.length-1].value,r,ml(r,C,n))?t[t.length-1].value=r:t.push({value:r}):(!k||w===r)&&t.push({value:w}),t}function ml(n,e,{horizontal:t,minRotation:o}){const a=Ze(o),s=(t?Math.sin(a):Math.cos(a))||.001,l=.75*e*(""+n).length;return Math.min(e/s,l)}class bi extends Pt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return ae(e)||(typeof e=="number"||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){const{beginAtZero:e}=this.options,{minDefined:t,maxDefined:o}=this.getUserBounds();let{min:a,max:s}=this;const l=c=>a=t?a:c,r=c=>s=o?s:c;if(e){const c=nt(a),d=nt(s);c<0&&d<0?r(0):c>0&&d>0&&l(0)}if(a===s){let c=s===0?1:Math.abs(s*.05);r(s+c),e||l(a-c)}this.min=a,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:o}=e,a;return o?(a=Math.ceil(this.max/o)-Math.floor(this.min/o)+1,a>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${o} would result generating up to ${a} ticks. Limiting to 1000.`),a=1e3)):(a=this.computeTickLimit(),t=t||11),t&&(a=Math.min(t,a)),a}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let o=this.getTickLimit();o=Math.max(2,o);const a={maxTicks:o,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},s=this._range||this,l=ip(a,s);return e.bounds==="ticks"&&ba(l,this,"value"),e.reverse?(l.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),l}configure(){const e=this.ticks;let t=this.min,o=this.max;if(super.configure(),this.options.offset&&e.length){const a=(o-t)/Math.max(e.length-1,1)/2;t-=a,o+=a}this._startValue=t,this._endValue=o,this._valueRange=o-t}getLabelForValue(e){return dn(e,this.chart.options.locale,this.options.ticks.format)}}class Bo extends bi{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Me(e)?e:0,this.max=Me(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,o=Ze(this.options.ticks.minRotation),a=(e?Math.sin(o):Math.cos(o))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/a))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}W(Bo,"id","linear"),W(Bo,"defaults",{ticks:{callback:jn.formatters.numeric}});const Bn=n=>Math.floor(yt(n)),At=(n,e)=>Math.pow(10,Bn(n)+e);function pl(n){return n/Math.pow(10,Bn(n))===1}function gl(n,e,t){const o=Math.pow(10,t),a=Math.floor(n/o);return Math.ceil(e/o)-a}function op(n,e){const t=e-n;let o=Bn(t);for(;gl(n,e,o)>10;)o++;for(;gl(n,e,o)<10;)o--;return Math.min(o,Bn(n))}function ap(n,{min:e,max:t}){e=qe(n.min,e);const o=[],a=Bn(e);let s=op(e,t),l=s<0?Math.pow(10,Math.abs(s)):1;const r=Math.pow(10,s),c=a>s?Math.pow(10,a):0,d=Math.round((e-c)*l)/l,u=Math.floor((e-c)/r/10)*r*10;let h=Math.floor((d-u)/Math.pow(10,s)),f=qe(n.min,Math.round((c+u+h*Math.pow(10,s))*l)/l);for(;f<t;)o.push({value:f,major:pl(f),significand:h}),h>=10?h=h<15?15:20:h++,h>=20&&(s++,h=2,l=s>=0?1:l),f=Math.round((c+u+h*Math.pow(10,s))*l)/l;const m=qe(n.max,f);return o.push({value:m,major:pl(m),significand:h}),o}class So extends Pt{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const o=bi.prototype.parse.apply(this,[e,t]);if(o===0){this._zero=!0;return}return Me(o)&&o>0?o:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Me(e)?Math.max(0,e):null,this.max=Me(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!Me(this._userMin)&&(this.min=e===At(this.min,0)?At(this.min,-1):At(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:e,maxDefined:t}=this.getUserBounds();let o=this.min,a=this.max;const s=r=>o=e?o:r,l=r=>a=t?a:r;o===a&&(o<=0?(s(1),l(10)):(s(At(o,-1)),l(At(a,1)))),o<=0&&s(At(a,-1)),a<=0&&l(At(o,1)),this.min=o,this.max=a}buildTicks(){const e=this.options,t={min:this._userMin,max:this._userMax},o=ap(t,this);return e.bounds==="ticks"&&ba(o,this,"value"),e.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}getLabelForValue(e){return e===void 0?"0":dn(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=yt(e),this._valueRange=yt(this.max)-yt(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(yt(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}W(So,"id","logarithmic"),W(So,"defaults",{ticks:{callback:jn.formatters.logarithmic,major:{enabled:!0}}});function Eo(n){const e=n.ticks;if(e.display&&n.display){const t=We(e.backdropPadding);return ie(e.font&&e.font.size,Ee.font.size)+t.height}return 0}function sp(n,e,t){return t=Se(t)?t:[t],{w:uu(n,e.string,t),h:t.length*e.lineHeight}}function bl(n,e,t,o,a){return n===o||n===a?{start:e-t/2,end:e+t/2}:n<o||n>a?{start:e-t,end:e}:{start:e,end:e+t}}function lp(n){const e={l:n.left+n._padding.left,r:n.right-n._padding.right,t:n.top+n._padding.top,b:n.bottom-n._padding.bottom},t=Object.assign({},e),o=[],a=[],s=n._pointLabels.length,l=n.options.pointLabels,r=l.centerPointLabels?de/s:0;for(let c=0;c<s;c++){const d=l.setContext(n.getPointLabelContext(c));a[c]=d.padding;const u=n.getPointPosition(c,n.drawingArea+a[c],r),h=$e(d.font),f=sp(n.ctx,h,n._pointLabels[c]);o[c]=f;const m=Oe(n.getIndexAngle(c)+r),p=Math.round(Wi(m)),g=bl(p,u.x,f.w,0,180),b=bl(p,u.y,f.h,90,270);rp(t,e,m,g,b)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=up(n,o,a)}function rp(n,e,t,o,a){const s=Math.abs(Math.sin(t)),l=Math.abs(Math.cos(t));let r=0,c=0;o.start<e.l?(r=(e.l-o.start)/s,n.l=Math.min(n.l,e.l-r)):o.end>e.r&&(r=(o.end-e.r)/s,n.r=Math.max(n.r,e.r+r)),a.start<e.t?(c=(e.t-a.start)/l,n.t=Math.min(n.t,e.t-c)):a.end>e.b&&(c=(a.end-e.b)/l,n.b=Math.max(n.b,e.b+c))}function cp(n,e,t){const o=n.drawingArea,{extra:a,additionalAngle:s,padding:l,size:r}=t,c=n.getPointPosition(e,o+a+l,s),d=Math.round(Wi(Oe(c.angle+Ve))),u=mp(c.y,r.h,d),h=hp(d),f=fp(c.x,r.w,h);return{visible:!0,x:c.x,y:u,textAlign:h,left:f,top:u,right:f+r.w,bottom:u+r.h}}function dp(n,e){if(!e)return!0;const{left:t,top:o,right:a,bottom:s}=n;return!(ct({x:t,y:o},e)||ct({x:t,y:s},e)||ct({x:a,y:o},e)||ct({x:a,y:s},e))}function up(n,e,t){const o=[],a=n._pointLabels.length,s=n.options,{centerPointLabels:l,display:r}=s.pointLabels,c={extra:Eo(s)/2,additionalAngle:l?de/a:0};let d;for(let u=0;u<a;u++){c.padding=t[u],c.size=e[u];const h=cp(n,u,c);o.push(h),r==="auto"&&(h.visible=dp(h,d),h.visible&&(d=h))}return o}function hp(n){return n===0||n===180?"center":n<180?"left":"right"}function fp(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function mp(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function pp(n,e,t){const{left:o,top:a,right:s,bottom:l}=t,{backdropColor:r}=e;if(!ae(r)){const c=$t(e.borderRadius),d=We(e.backdropPadding);n.fillStyle=r;const u=o-d.left,h=a-d.top,f=s-o+d.width,m=l-a+d.height;Object.values(c).some(p=>p!==0)?(n.beginPath(),hn(n,{x:u,y:h,w:f,h:m,radius:c}),n.fill()):n.fillRect(u,h,f,m)}}function gp(n,e){const{ctx:t,options:{pointLabels:o}}=n;for(let a=e-1;a>=0;a--){const s=n._pointLabelItems[a];if(!s.visible)continue;const l=o.setContext(n.getPointLabelContext(a));pp(t,l,s);const r=$e(l.font),{x:c,y:d,textAlign:u}=s;Dt(t,n._pointLabels[a],c,d+r.lineHeight/2,r,{color:l.color,textAlign:u,textBaseline:"middle"})}}function _l(n,e,t,o){const{ctx:a}=n;if(t)a.arc(n.xCenter,n.yCenter,e,0,Ce);else{let s=n.getPointPosition(0,e);a.moveTo(s.x,s.y);for(let l=1;l<o;l++)s=n.getPointPosition(l,e),a.lineTo(s.x,s.y)}}function bp(n,e,t,o,a){const s=n.ctx,l=e.circular,{color:r,lineWidth:c}=e;!l&&!o||!r||!c||t<0||(s.save(),s.strokeStyle=r,s.lineWidth=c,s.setLineDash(a.dash||[]),s.lineDashOffset=a.dashOffset,s.beginPath(),_l(n,t,l,o),s.closePath(),s.stroke(),s.restore())}function _p(n,e,t){return kt(n,{label:t,index:e,type:"pointLabel"})}class Sn extends bi{constructor(e){super(e),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const e=this._padding=We(Eo(this.options)/2),t=this.width=this.maxWidth-e.width,o=this.height=this.maxHeight-e.height;this.xCenter=Math.floor(this.left+t/2+e.left),this.yCenter=Math.floor(this.top+o/2+e.top),this.drawingArea=Math.floor(Math.min(t,o)/2)}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!1);this.min=Me(e)&&!isNaN(e)?e:0,this.max=Me(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Eo(this.options))}generateTickLabels(e){bi.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,o)=>{const a=ke(this.options.pointLabels.callback,[t,o],this);return a||a===0?a:""}).filter((t,o)=>this.chart.getDataVisibility(o))}fit(){const e=this.options;e.display&&e.pointLabels.display?lp(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,o,a){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((o-a)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,o,a))}getIndexAngle(e){const t=Ce/(this._pointLabels.length||1),o=this.options.startAngle||0;return Oe(e*t+Ze(o))}getDistanceFromCenterForValue(e){if(ae(e))return NaN;const t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(ae(e))return NaN;const t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){const t=this._pointLabels||[];if(e>=0&&e<t.length){const o=t[e];return _p(this.getContext(),e,o)}}getPointPosition(e,t,o=0){const a=this.getIndexAngle(e)-Ve+o;return{x:Math.cos(a)*t+this.xCenter,y:Math.sin(a)*t+this.yCenter,angle:a}}getPointPositionForValue(e,t){return this.getPointPosition(e,this.getDistanceFromCenterForValue(t))}getBasePosition(e){return this.getPointPositionForValue(e||0,this.getBaseValue())}getPointLabelPosition(e){const{left:t,top:o,right:a,bottom:s}=this._pointLabelItems[e];return{left:t,top:o,right:a,bottom:s}}drawBackground(){const{backgroundColor:e,grid:{circular:t}}=this.options;if(e){const o=this.ctx;o.save(),o.beginPath(),_l(this,this.getDistanceFromCenterForValue(this._endValue),t,this._pointLabels.length),o.closePath(),o.fillStyle=e,o.fill(),o.restore()}}drawGrid(){const e=this.ctx,t=this.options,{angleLines:o,grid:a,border:s}=t,l=this._pointLabels.length;let r,c,d;if(t.pointLabels.display&&gp(this,l),a.display&&this.ticks.forEach((u,h)=>{if(h!==0||h===0&&this.min<0){c=this.getDistanceFromCenterForValue(u.value);const f=this.getContext(h),m=a.setContext(f),p=s.setContext(f);bp(this,m,c,l,p)}}),o.display){for(e.save(),r=l-1;r>=0;r--){const u=o.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:f}=u;!f||!h||(e.lineWidth=f,e.strokeStyle=h,e.setLineDash(u.borderDash),e.lineDashOffset=u.borderDashOffset,c=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),d=this.getPointPosition(r,c),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(d.x,d.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){const e=this.ctx,t=this.options,o=t.ticks;if(!o.display)return;const a=this.getIndexAngle(0);let s,l;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(a),e.textAlign="center",e.textBaseline="middle",this.ticks.forEach((r,c)=>{if(c===0&&this.min>=0&&!t.reverse)return;const d=o.setContext(this.getContext(c)),u=$e(d.font);if(s=this.getDistanceFromCenterForValue(this.ticks[c].value),d.showLabelBackdrop){e.font=u.string,l=e.measureText(r.label).width,e.fillStyle=d.backdropColor;const h=We(d.backdropPadding);e.fillRect(-l/2-h.left,-s-u.size/2-h.top,l+h.width,u.size+h.height)}Dt(e,r.label,0,-s,u,{color:d.color,strokeColor:d.textStrokeColor,strokeWidth:d.textStrokeWidth})}),e.restore()}drawTitle(){}}W(Sn,"id","radialLinear"),W(Sn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:jn.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(e){return e},padding:5,centerPointLabels:!1}}),W(Sn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),W(Sn,"descriptors",{angleLines:{_fallback:"grid"}});const _i={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}},Ke=Object.keys(_i);function yl(n,e){return n-e}function kl(n,e){if(ae(e))return null;const t=n._adapter,{parser:o,round:a,isoWeekday:s}=n._parseOpts;let l=e;return typeof o=="function"&&(l=o(l)),Me(l)||(l=typeof o=="string"?t.parse(l,o):t.parse(l)),l===null?null:(a&&(l=a==="week"&&(jt(s)||s===!0)?t.startOf(l,"isoWeek",s):t.startOf(l,a)),+l)}function xl(n,e,t,o){const a=Ke.length;for(let s=Ke.indexOf(n);s<a-1;++s){const l=_i[Ke[s]],r=l.steps?l.steps:Number.MAX_SAFE_INTEGER;if(l.common&&Math.ceil((t-e)/(r*l.size))<=o)return Ke[s]}return Ke[a-1]}function yp(n,e,t,o,a){for(let s=Ke.length-1;s>=Ke.indexOf(t);s--){const l=Ke[s];if(_i[l].common&&n._adapter.diff(a,o,l)>=e-1)return l}return Ke[t?Ke.indexOf(t):0]}function kp(n){for(let e=Ke.indexOf(n)+1,t=Ke.length;e<t;++e)if(_i[Ke[e]].common)return Ke[e]}function wl(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:o,hi:a}=ji(t,e),s=t[o]>=e?t[o]:t[a];n[s]=!0}}function xp(n,e,t,o){const a=n._adapter,s=+a.startOf(e[0].value,o),l=e[e.length-1].value;let r,c;for(r=s;r<=l;r=+a.add(r,1,o))c=t[r],c>=0&&(e[c].major=!0);return e}function Cl(n,e,t){const o=[],a={},s=e.length;let l,r;for(l=0;l<s;++l)r=e[l],a[r]=l,o.push({value:r,major:!1});return s===0||!t?o:xp(n,o,a,t)}class En extends Pt{constructor(e){super(e),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(e,t={}){const o=e.time||(e.time={}),a=this._adapter=new vh._date(e.adapters.date);a.init(t),an(o.displayFormats,a.formats()),this._parseOpts={parser:o.parser,round:o.round,isoWeekday:o.isoWeekday},super.init(e),this._normalized=t.normalized}parse(e,t){return e===void 0?null:kl(this,e)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const e=this.options,t=this._adapter,o=e.time.unit||"day";let{min:a,max:s,minDefined:l,maxDefined:r}=this.getUserBounds();function c(d){!l&&!isNaN(d.min)&&(a=Math.min(a,d.min)),!r&&!isNaN(d.max)&&(s=Math.max(s,d.max))}(!l||!r)&&(c(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&c(this.getMinMax(!1))),a=Me(a)&&!isNaN(a)?a:+t.startOf(Date.now(),o),s=Me(s)&&!isNaN(s)?s:+t.endOf(Date.now(),o)+1,this.min=Math.min(a,s-1),this.max=Math.max(a+1,s)}_getLabelBounds(){const e=this.getLabelTimestamps();let t=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;return e.length&&(t=e[0],o=e[e.length-1]),{min:t,max:o}}buildTicks(){const e=this.options,t=e.time,o=e.ticks,a=o.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&a.length&&(this.min=this._userMin||a[0],this.max=this._userMax||a[a.length-1]);const s=this.min,l=this.max,r=Zd(a,s,l);return this._unit=t.unit||(o.autoSkip?xl(t.minUnit,this.min,this.max,this._getLabelCapacity(s)):yp(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!o.major.enabled||this._unit==="year"?void 0:kp(this._unit),this.initOffsets(a),e.reverse&&r.reverse(),Cl(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,o=0,a,s;this.options.offset&&e.length&&(a=this.getDecimalForValue(e[0]),e.length===1?t=1-a:t=(this.getDecimalForValue(e[1])-a)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?o=s:o=(s-this.getDecimalForValue(e[e.length-2]))/2);const l=e.length<3?.5:.25;t=Ie(t,0,l),o=Ie(o,0,l),this._offsets={start:t,end:o,factor:1/(t+1+o)}}_generate(){const e=this._adapter,t=this.min,o=this.max,a=this.options,s=a.time,l=s.unit||xl(s.minUnit,t,o,this._getLabelCapacity(t)),r=ie(a.ticks.stepSize,1),c=l==="week"?s.isoWeekday:!1,d=jt(c)||c===!0,u={};let h=t,f,m;if(d&&(h=+e.startOf(h,"isoWeek",c)),h=+e.startOf(h,d?"day":l),e.diff(o,t,l)>1e5*r)throw new Error(t+" and "+o+" are too far apart with stepSize of "+r+" "+l);const p=a.ticks.source==="data"&&this.getDataTimestamps();for(f=h,m=0;f<o;f=+e.add(f,r,l),m++)wl(u,f,p);return(f===o||a.bounds==="ticks"||m===1)&&wl(u,f,p),Object.keys(u).sort(yl).map(g=>+g)}getLabelForValue(e){const t=this._adapter,o=this.options.time;return o.tooltipFormat?t.format(e,o.tooltipFormat):t.format(e,o.displayFormats.datetime)}format(e,t){const a=this.options.time.displayFormats,s=this._unit,l=t||a[s];return this._adapter.format(e,l)}_tickFormatFunction(e,t,o,a){const s=this.options,l=s.ticks.callback;if(l)return ke(l,[e,t,o],this);const r=s.time.displayFormats,c=this._unit,d=this._majorUnit,u=c&&r[c],h=d&&r[d],f=o[t],m=d&&h&&f&&f.major;return this._adapter.format(e,a||(m?h:u))}generateTickLabels(e){let t,o,a;for(t=0,o=e.length;t<o;++t)a=e[t],a.label=this._tickFormatFunction(a.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,o=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+o)*t.factor)}getValueForPixel(e){const t=this._offsets,o=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+o*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,o=this.ctx.measureText(e).width,a=Ze(this.isHorizontal()?t.maxRotation:t.minRotation),s=Math.cos(a),l=Math.sin(a),r=this._resolveTickFontOptions(0).size;return{w:o*s+r*l,h:o*l+r*s}}_getLabelCapacity(e){const t=this.options.time,o=t.displayFormats,a=o[t.unit]||o.millisecond,s=this._tickFormatFunction(e,0,Cl(this,[e],this._majorUnit),a),l=this._getLabelSize(s),r=Math.floor(this.isHorizontal()?this.width/l.w:this.height/l.h)-1;return r>0?r:1}getDataTimestamps(){let e=this._cache.data||[],t,o;if(e.length)return e;const a=this.getMatchingVisibleMetas();if(this._normalized&&a.length)return this._cache.data=a[0].controller.getAllParsedValues(this);for(t=0,o=a.length;t<o;++t)e=e.concat(a[t].controller.getAllParsedValues(this));return this._cache.data=this.normalize(e)}getLabelTimestamps(){const e=this._cache.labels||[];let t,o;if(e.length)return e;const a=this.getLabels();for(t=0,o=a.length;t<o;++t)e.push(kl(this,a[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return wa(e.sort(yl))}}W(En,"id","time"),W(En,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function yi(n,e,t){let o=0,a=n.length-1,s,l,r,c;t?(e>=n[o].pos&&e<=n[a].pos&&({lo:o,hi:a}=rt(n,"pos",e)),{pos:s,time:r}=n[o],{pos:l,time:c}=n[a]):(e>=n[o].time&&e<=n[a].time&&({lo:o,hi:a}=rt(n,"time",e)),{time:s,pos:r}=n[o],{time:l,pos:c}=n[a]);const d=l-s;return d?r+(c-r)*(e-s)/d:r}class Mo extends En{constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=yi(t,this.min),this._tableRange=yi(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:o}=this,a=[],s=[];let l,r,c,d,u;for(l=0,r=e.length;l<r;++l)d=e[l],d>=t&&d<=o&&a.push(d);if(a.length<2)return[{time:t,pos:0},{time:o,pos:1}];for(l=0,r=a.length;l<r;++l)u=a[l+1],c=a[l-1],d=a[l],Math.round((u+c)/2)!==d&&s.push({time:d,pos:l/(r-1)});return s}_generate(){const e=this.min,t=this.max;let o=super.getDataTimestamps();return(!o.includes(e)||!o.length)&&o.splice(0,0,e),(!o.includes(t)||o.length===1)&&o.push(t),o.sort((a,s)=>a-s)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;const t=this.getDataTimestamps(),o=this.getLabelTimestamps();return t.length&&o.length?e=this.normalize(t.concat(o)):e=t.length?t:o,e=this._cache.all=e,e}getDecimalForValue(e){return(yi(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,o=this.getDecimalForPixel(e)/t.factor-t.end;return yi(this._table,o*this._tableRange+this._minPos,!0)}}W(Mo,"id","timeseries"),W(Mo,"defaults",En.defaults);var wp=Object.freeze({__proto__:null,CategoryScale:Co,LinearScale:Bo,LogarithmicScale:So,RadialLinearScale:Sn,TimeScale:En,TimeSeriesScale:Mo});const Cp=[Mh,om,Qm,wp];function ue(n){return typeof window>"u"?"":getComputedStyle(document.documentElement).getPropertyValue(n).trim()}function Bl(){const n={primary:ue("--chart-1")||ue("--action-primary")||"#6366f1",success:ue("--chart-2")||ue("--status-success")||"#14b8a6",warning:ue("--chart-3")||ue("--status-warning")||"#f59e0b",error:ue("--chart-4")||ue("--status-error")||"#f87171",info:ue("--chart-5")||ue("--status-info")||"#3b82f6",text:ue("--chart-text")||ue("--text-primary")||"#1c1917",textMuted:ue("--chart-text-muted")||ue("--text-secondary")||"#78716c",gridLines:ue("--chart-grid")||ue("--border-default")||"#e7e5e4",tooltipBg:ue("--chart-tooltip-bg")||ue("--tooltip-bg")||"#1c1917",tooltipText:ue("--chart-tooltip-text")||ue("--tooltip-text")||"#fafaf9",tooltipBorder:ue("--chart-tooltip-border")||"transparent",legendText:ue("--chart-legend-text")||ue("--text-secondary")||"#78716c"},e=ue("--font-sans")||"system-ui, -apple-system, sans-serif",t=[ue("--chart-1")||n.primary,ue("--chart-2")||n.success,ue("--chart-3")||n.warning,ue("--chart-4")||n.error,ue("--chart-5")||n.info,ue("--chart-6")||"#8b5cf6",ue("--chart-7")||"#ec4899",ue("--chart-8")||"#06b6d4"];return{colors:n,fontFamily:e,palette:t}}function Mn(){const n=i.ref(Bl()),e=i.ref(0);let t=null;function o(){n.value=Bl(),e.value++}i.onMounted(()=>{o();let u=null;t=new MutationObserver(h=>{for(const f of h)if(f.type==="attributes"&&(f.attributeName==="data-theme"||f.attributeName==="class")){u!==null&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{requestAnimationFrame(()=>{o(),u=null})});break}}),t.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class"]})}),i.onUnmounted(()=>{t==null||t.disconnect()});const a=i.computed(()=>n.value.colors.gridLines),s=i.computed(()=>n.value.colors.text),l=i.computed(()=>n.value.colors.textMuted);function r(){return{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1},tooltip:{enabled:!1}},scales:{x:{grid:{display:!1},border:{display:!1},ticks:{color:n.value.colors.textMuted,font:{family:n.value.fontFamily,size:12}}},y:{grid:{color:n.value.colors.gridLines},border:{display:!1},ticks:{color:n.value.colors.textMuted,font:{family:n.value.fontFamily,size:12}}}}}}function c(u){return n.value.palette[u%n.value.palette.length]}function d(u,h){const f=c(u);if(f.startsWith("oklch")||f.startsWith("rgb"))return f.replace(")",` / ${h})`).replace("rgb(","rgba(").replace("oklch(","oklch(");if(f.startsWith("#")){const m=f.slice(1),p=parseInt(m.slice(0,2),16),g=parseInt(m.slice(2,4),16),b=parseInt(m.slice(4,6),16);return`rgba(${p}, ${g}, ${b}, ${h})`}return f}return{theme:n,themeVersion:e,gridColor:a,textColor:s,mutedTextColor:l,getDefaultOptions:r,getColor:c,getColorWithOpacity:d,updateTheme:o}}const Bp=["aria-label"],Sp={class:"ui-chart__sr-table"},Ep={scope:"row"},Mp={key:0,class:"ui-chart__tooltip-title"},vp={class:"ui-chart__tooltip-label"},Vp={class:"ui-chart__tooltip-value"},ki=O(i.defineComponent({__name:"BaseChart",props:{type:{},data:{},options:{},height:{default:300},ariaLabel:{}},emits:["legendClick","pointClick"],setup(n,{expose:e,emit:t}){ut.register(...Cp);const o=n,a=t,s=i.ref(null),l=i.ref(null),r=i.shallowRef(null),{theme:c,themeVersion:d,getDefaultOptions:u}=Mn(),h=i.ref(null),f=i.ref([]),m=i.computed(()=>typeof o.height=="number"?`${o.height}px`:o.height);function p(){if(!r.value)return[];const x=r.value;return x.data.datasets.map((w,M)=>({label:w.label||`Dataset ${M+1}`,color:Array.isArray(w.backgroundColor)?w.backgroundColor[0]:w.backgroundColor||w.borderColor||c.value.palette[M],hidden:!x.isDatasetVisible(M),datasetIndex:M}))}function g(x){if(!r.value)return;const S=r.value,w=S.isDatasetVisible(x);S.setDatasetVisibility(x,!w),S.update(),f.value=p(),a("legendClick",f.value[x],x)}function b(x){var T,$;const{chart:S,tooltip:w}=x;if(w.opacity===0||!((T=w.dataPoints)!=null&&T.length)){h.value=null;return}const M=S.canvas.getBoundingClientRect(),N=w.dataPoints.map(K=>({label:K.dataset.label||"",value:String(K.formattedValue),color:K.dataset.borderColor||(Array.isArray(K.dataset.backgroundColor)?K.dataset.backgroundColor[K.dataIndex]:K.dataset.backgroundColor)||""}));h.value={title:(($=w.title)==null?void 0:$[0])||"",items:N,x:M.left+w.caretX,y:M.top+w.caretY}}function _(x){if(!r.value||!s.value)return;const S=r.value,w=S.getElementsAtEventForMode(x,"nearest",{intersect:!0},!1);if(w.length>0){const M=w[0],N=M.datasetIndex,T=M.index,$=S.data.datasets[N],K=S.data.labels||[],P=(Array.isArray($.data[T]),$.data[T]);a("pointClick",{datasetIndex:N,index:T,label:String(K[T]||""),value:P,datasetLabel:$.label||""})}}function k(){const x=u(),S=o.options||{},w=x.plugins||{},M=S.plugins||{},N={...x,...S,plugins:{...w,...M,tooltip:{enabled:!1,external:b,mode:"index",intersect:!1,animation:!1,...M.tooltip||{}}},interaction:{mode:"index",intersect:!1,...S.interaction||{}}};return o.type!=="doughnut"&&o.type!=="pie"&&(N.scales={...x.scales||{},...S.scales||{}}),N}function B(){s.value&&(r.value&&r.value.destroy(),r.value=new ut(s.value,{type:o.type,data:o.data,options:k()}),f.value=p())}function C(){r.value&&(r.value.data=o.data,r.value.options=k(),r.value.update(),f.value=p())}let y=null;return i.onMounted(()=>{B(),l.value&&(y=new ResizeObserver(()=>{var x;(x=r.value)==null||x.resize()}),y.observe(l.value))}),i.onUnmounted(()=>{var x;y==null||y.disconnect(),(x=r.value)==null||x.destroy(),r.value=null}),i.watch(()=>o.data,C,{deep:!0}),i.watch(()=>o.type,B),i.watch(d,()=>{i.nextTick(C)}),e({chart:r,toggleDataset:g,legendItems:f}),(x,S)=>(i.openBlock(),i.createElementBlock("div",{class:"ui-chart",ref_key:"containerRef",ref:l},[i.renderSlot(x.$slots,"legend",{items:f.value,toggle:g},void 0,!0),i.createElementVNode("div",{class:"ui-chart__canvas-container",style:i.normalizeStyle({height:m.value})},[i.createElementVNode("canvas",{ref_key:"canvasRef",ref:s,"aria-label":n.ariaLabel,role:"img",onClick:_},[i.renderSlot(x.$slots,"fallback",{},()=>[i.createElementVNode("table",Sp,[i.createElementVNode("caption",null,i.toDisplayString(n.ariaLabel||"Chart data"),1),i.createElementVNode("thead",null,[i.createElementVNode("tr",null,[S[0]||(S[0]=i.createElementVNode("th",{scope:"col"},"Label",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.data.datasets||[],(w,M)=>(i.openBlock(),i.createElementBlock("th",{key:M,scope:"col"},i.toDisplayString(w.label||`Series ${M+1}`),1))),128))])]),i.createElementVNode("tbody",null,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.data.labels||[],(w,M)=>(i.openBlock(),i.createElementBlock("tr",{key:M},[i.createElementVNode("th",Ep,i.toDisplayString(w),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.data.datasets||[],(N,T)=>{var $;return i.openBlock(),i.createElementBlock("td",{key:T},i.toDisplayString(($=N.data)==null?void 0:$[M]),1)}),128))]))),128))])])],!0)],8,Bp)],4),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.renderSlot(x.$slots,"tooltip",{data:h.value},()=>[h.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-chart__tooltip",style:i.normalizeStyle({left:`${h.value.x}px`,top:`${h.value.y}px`})},[h.value.title?(i.openBlock(),i.createElementBlock("div",Mp,i.toDisplayString(h.value.title),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value.items,(w,M)=>(i.openBlock(),i.createElementBlock("div",{key:M,class:"ui-chart__tooltip-item"},[i.createElementVNode("span",{class:"ui-chart__tooltip-color",style:i.normalizeStyle({backgroundColor:w.color})},null,4),i.createElementVNode("span",vp,i.toDisplayString(w.label),1),i.createElementVNode("span",Vp,i.toDisplayString(w.value),1)]))),128))],4)):i.createCommentVNode("",!0)],!0)]))],512))}}),[["__scopeId","data-v-b70ab7bc"]]),Dp={class:"ui-line-chart__legend"},$p=["onClick"],Tp={class:"ui-line-chart__legend-label"},Ip=O(i.defineComponent({__name:"LineChart",props:{labels:{},series:{},height:{default:300},fill:{type:Boolean,default:!1},tension:{default:.4},showPoints:{type:Boolean,default:!0},pointRadius:{default:4},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},ariaLabel:{},showLegend:{type:Boolean,default:!0}},emits:["pointClick"],setup(n,{emit:e}){const t=n,o=e,{theme:a,getColor:s,getColorWithOpacity:l}=Mn(),r=i.computed(()=>({labels:t.labels,datasets:t.series.map((d,u)=>({label:d.name,data:d.data,borderColor:s(u),backgroundColor:t.fill?l(u,.1):"transparent",borderWidth:2,fill:t.fill,tension:t.tension,pointRadius:t.showPoints?t.pointRadius:0,pointHoverRadius:t.showPoints?t.pointRadius+2:4,pointBackgroundColor:s(u),pointBorderColor:a.value.colors.tooltipText,pointBorderWidth:2}))})),c=i.computed(()=>({scales:{x:{display:t.showXAxis,grid:{display:!1},border:{display:!1},ticks:{color:a.value.colors.textMuted,font:{family:a.value.fontFamily,size:12}}},y:{display:t.showYAxis,grid:{display:t.showGrid,color:a.value.colors.gridLines},border:{display:!1},ticks:{color:a.value.colors.textMuted,font:{family:a.value.fontFamily,size:12}}}},interaction:{mode:"index",intersect:!1}}));return(d,u)=>(i.openBlock(),i.createBlock(ki,{type:"line",data:r.value,options:c.value,height:n.height,"aria-label":n.ariaLabel,onPointClick:u[0]||(u[0]=h=>o("pointClick",h))},i.createSlots({tooltip:i.withCtx(({data:h})=>[i.renderSlot(d.$slots,"tooltip",{data:h},void 0,!0)]),_:2},[n.showLegend||d.$slots.legend?{name:"legend",fn:i.withCtx(({items:h,toggle:f})=>[i.renderSlot(d.$slots,"legend",{items:h,toggle:f},()=>[i.createElementVNode("div",Dp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h,(m,p)=>(i.openBlock(),i.createElementBlock("button",{key:p,type:"button",class:i.normalizeClass(["ui-line-chart__legend-item",{"ui-line-chart__legend-item--hidden":m.hidden}]),onClick:g=>f(p)},[i.createElementVNode("span",{class:"ui-line-chart__legend-color",style:i.normalizeStyle({backgroundColor:m.color})},null,4),i.createElementVNode("span",Tp,i.toDisplayString(m.label),1)],10,$p))),128))])],!0)]),key:"0"}:void 0]),1032,["data","options","height","aria-label"]))}}),[["__scopeId","data-v-2e8f34b7"]]),Lp={class:"ui-bar-chart__legend"},zp=["onClick"],Np={class:"ui-bar-chart__legend-label"},Pp=O(i.defineComponent({__name:"BarChart",props:{labels:{},series:{},height:{default:300},horizontal:{type:Boolean,default:!1},stacked:{type:Boolean,default:!1},borderRadius:{default:4},showGrid:{type:Boolean,default:!0},showXAxis:{type:Boolean,default:!0},showYAxis:{type:Boolean,default:!0},ariaLabel:{},showLegend:{type:Boolean,default:!0}},emits:["pointClick"],setup(n,{emit:e}){const t=n,o=e,{theme:a,getColor:s}=Mn(),l=i.computed(()=>({labels:t.labels,datasets:t.series.map((c,d)=>({label:c.name,data:c.data,backgroundColor:s(d),borderColor:"transparent",borderWidth:0,borderRadius:t.borderRadius,borderSkipped:!1}))})),r=i.computed(()=>({indexAxis:t.horizontal?"y":"x",scales:{x:{display:t.showXAxis,stacked:t.stacked,grid:{display:t.horizontal?t.showGrid:!1,color:a.value.colors.gridLines},border:{display:!1},ticks:{color:a.value.colors.textMuted,font:{family:a.value.fontFamily,size:12}}},y:{display:t.showYAxis,stacked:t.stacked,grid:{display:t.horizontal?!1:t.showGrid,color:a.value.colors.gridLines},border:{display:!1},ticks:{color:a.value.colors.textMuted,font:{family:a.value.fontFamily,size:12}}}},interaction:{mode:"index",axis:t.horizontal?"y":"x",intersect:!1}}));return(c,d)=>(i.openBlock(),i.createBlock(ki,{type:"bar",data:l.value,options:r.value,height:n.height,"aria-label":n.ariaLabel,onPointClick:d[0]||(d[0]=u=>o("pointClick",u))},i.createSlots({tooltip:i.withCtx(({data:u})=>[i.renderSlot(c.$slots,"tooltip",{data:u},void 0,!0)]),_:2},[n.showLegend||c.$slots.legend?{name:"legend",fn:i.withCtx(({items:u,toggle:h})=>[i.renderSlot(c.$slots,"legend",{items:u,toggle:h},()=>[i.createElementVNode("div",Lp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u,(f,m)=>(i.openBlock(),i.createElementBlock("button",{key:m,type:"button",class:i.normalizeClass(["ui-bar-chart__legend-item",{"ui-bar-chart__legend-item--hidden":f.hidden}]),onClick:p=>h(m)},[i.createElementVNode("span",{class:"ui-bar-chart__legend-color",style:i.normalizeStyle({backgroundColor:f.color})},null,4),i.createElementVNode("span",Np,i.toDisplayString(f.label),1)],10,zp))),128))])],!0)]),key:"0"}:void 0]),1032,["data","options","height","aria-label"]))}}),[["__scopeId","data-v-bdd7ef89"]]),Ap={class:"ui-donut-chart__legend"},Rp={class:"ui-donut-chart__legend-label"},Op={class:"ui-donut-chart__legend-value"},Fp={class:"ui-donut-chart__container"},Wp={key:0,class:"ui-donut-chart__center"},Hp={key:0,class:"ui-donut-chart__center-value"},jp={key:1,class:"ui-donut-chart__center-label"},Yp={class:"ui-donut-chart__legend"},Up={class:"ui-donut-chart__legend-label"},Xp={class:"ui-donut-chart__legend-value"},Kp=O(i.defineComponent({__name:"DonutChart",props:{segments:{},height:{default:300},cutout:{default:65},ariaLabel:{},showLegend:{type:Boolean,default:!0},legendPosition:{default:"right"},centerLabel:{},centerValue:{}},emits:["segmentClick"],setup(n,{emit:e}){const t=n,o=e,{getColor:a}=Mn(),s=i.computed(()=>({labels:t.segments.map(h=>h.label),datasets:[{data:t.segments.map(h=>h.value),backgroundColor:t.segments.map((h,f)=>h.color||a(f)),borderWidth:0,hoverOffset:4}]})),l=i.computed(()=>({cutout:`${t.cutout}%`,plugins:{legend:{display:!1}},interaction:{mode:"nearest",intersect:!0}})),r=i.computed(()=>t.segments.reduce((h,f)=>h+f.value,0)),c=i.computed(()=>t.segments.map((h,f)=>({label:h.label,color:h.color||a(f),hidden:!1,datasetIndex:f})));function d(h){return`${Math.round(h/r.value*100)}%`}function u(h){const f=h.index,m=t.segments[f];m&&o("segmentClick",{segment:m,index:f,percentage:Math.round(m.value/r.value*100)})}return(h,f)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-donut-chart",[`ui-donut-chart--legend-${n.legendPosition}`]])},[n.showLegend&&(n.legendPosition==="top"||n.legendPosition==="left")?i.renderSlot(h.$slots,"legend",{key:0,items:c.value,toggle:()=>{}},()=>[i.createElementVNode("div",Ap,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.segments,(m,p)=>(i.openBlock(),i.createElementBlock("div",{key:p,class:"ui-donut-chart__legend-item"},[i.createElementVNode("span",{class:"ui-donut-chart__legend-color",style:i.normalizeStyle({backgroundColor:m.color||i.unref(a)(p)})},null,4),i.createElementVNode("span",Rp,i.toDisplayString(m.label),1),i.createElementVNode("span",Op,i.toDisplayString(d(m.value)),1)]))),128))])],!0):i.createCommentVNode("",!0),i.createElementVNode("div",Fp,[i.createVNode(ki,{type:"doughnut",data:s.value,options:l.value,height:n.height,"aria-label":n.ariaLabel,onPointClick:u},{legend:i.withCtx(()=>[...f[0]||(f[0]=[])]),tooltip:i.withCtx(({data:m})=>[i.renderSlot(h.$slots,"tooltip",{data:m},void 0,!0)]),_:3},8,["data","options","height","aria-label"]),n.centerLabel||n.centerValue||h.$slots.center?(i.openBlock(),i.createElementBlock("div",Wp,[i.renderSlot(h.$slots,"center",{},()=>[n.centerValue?(i.openBlock(),i.createElementBlock("div",Hp,i.toDisplayString(n.centerValue),1)):i.createCommentVNode("",!0),n.centerLabel?(i.openBlock(),i.createElementBlock("div",jp,i.toDisplayString(n.centerLabel),1)):i.createCommentVNode("",!0)],!0)])):i.createCommentVNode("",!0)]),n.showLegend&&(n.legendPosition==="bottom"||n.legendPosition==="right")?i.renderSlot(h.$slots,"legend",{key:1,items:c.value,toggle:()=>{}},()=>[i.createElementVNode("div",Yp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.segments,(m,p)=>(i.openBlock(),i.createElementBlock("div",{key:p,class:"ui-donut-chart__legend-item"},[i.createElementVNode("span",{class:"ui-donut-chart__legend-color",style:i.normalizeStyle({backgroundColor:m.color||i.unref(a)(p)})},null,4),i.createElementVNode("span",Up,i.toDisplayString(m.label),1),i.createElementVNode("span",Xp,i.toDisplayString(d(m.value)),1)]))),128))])],!0):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-1af3565d"]]);function Le(n,e="0 0 24 24"){return t=>i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:e,fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",class:t.class},n.map(o=>i.h("path",{d:o})))}function qp(n,e="0 0 24 24"){return t=>i.h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:e,fill:"currentColor",class:t.class},n.map(o=>i.h("path",{d:o})))}const Sl={sortAsc:Le(["M4 10l4-4 4 4"],"0 0 16 16"),sortDesc:Le(["M4 6l4 4 4-4"],"0 0 16 16"),sortNeutral:Le(["M4 6l4-3 4 3","M4 10l4 3 4-3"],"0 0 16 16"),expand:Le(["M6 9l6 6 6-6"]),collapse:Le(["M18 15l-6-6-6 6"]),close:Le(["M18 6L6 18","M6 6l12 12"]),search:Le(["M11 19a8 8 0 100-16 8 8 0 000 16z","M21 21l-4.35-4.35"]),check:Le(["M20 6L9 17l-5-5"]),info:Le(["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M12 16v-4","M12 8h.01"]),success:Le(["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M9 12l2 2 4-4"]),warning:Le(["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M12 8v4","M12 16h.01"]),error:Le(["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M15 9l-6 6","M9 9l6 6"]),emptyData:Le(["M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"]),emptySearch:Le(["M11 19a8 8 0 100-16 8 8 0 000 16z","M21 21l-4.35-4.35"]),calendar:Le(["M8 2v4","M16 2v4","M3 10h18","M5 4h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2z"]),chevronLeft:Le(["M15 18l-6-6 6-6"]),chevronRight:Le(["M9 18l6-6-6-6"]),star:Le(["M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"]),starFilled:qp(["M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"])},xi=i.shallowRef({...Sl});function Gp(n){xi.value={...xi.value,...n}}function Jp(){xi.value={...Sl}}function ve(n){return xi.value[n]}const Zp={class:"ui-empty-state__content"},Qp={key:0,class:"ui-empty-state__icon"},eg={key:1,class:"ui-empty-state__icon ui-empty-state__icon--default"},tg={key:2,class:"ui-empty-state__title"},ng={key:3,class:"ui-empty-state__description"},ig={key:4,class:"ui-empty-state__action"},El=O(i.defineComponent({__name:"EmptyState",props:{title:{},description:{},icon:{},variant:{default:"default"},compact:{type:Boolean,default:!1}},setup(n){const e=n,t=i.useSlots(),o=i.computed(()=>{if(e.icon)return null;switch(e.variant){case"search":return ve("emptySearch");case"error":return ve("error");default:return ve("emptyData")}}),a=i.computed(()=>!!e.icon),s=i.computed(()=>!!e.title),l=i.computed(()=>!!e.description),r=i.computed(()=>!!t.default);return(c,d)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-empty-state",[`ui-empty-state--${n.variant}`,{"ui-empty-state--compact":n.compact}]])},[i.createElementVNode("div",Zp,[a.value?(i.openBlock(),i.createElementBlock("div",Qp,[i.createVNode(je,{icon:n.icon,size:"48px"},null,8,["icon"])])):(i.openBlock(),i.createElementBlock("div",eg,[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(o.value),{class:"ui-empty-state__icon-svg"}))])),s.value?(i.openBlock(),i.createElementBlock("div",tg,i.toDisplayString(n.title),1)):i.createCommentVNode("",!0),l.value?(i.openBlock(),i.createElementBlock("div",ng,i.toDisplayString(n.description),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("div",ig,[i.renderSlot(c.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-ef3bb591"]]),wi=O(i.defineComponent({__name:"Skeleton",props:{variant:{default:"text"},width:{},height:{},animation:{default:"shimmer"}},setup(n){const e=n,t=a=>{if(a!==void 0)return typeof a=="number"?`${a}px`:/^\d+(\.\d+)?$/.test(a)?`${a}px`:a},o=i.computed(()=>({width:t(e.width),height:t(e.height)}));return(a,s)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass(["ui-skeleton",[`ui-skeleton--${n.variant}`,`ui-skeleton--${n.animation}`]]),style:i.normalizeStyle(o.value),"aria-hidden":"true"},null,6))}}),[["__scopeId","data-v-656e0ee8"]]);function Ml(n,e,t=1,o=!0){if(e<=0)return[];if(e===1)return[1];const a=Math.max(1,Math.min(n,e)),s=Math.max(a-t,1),l=Math.min(a+t,e);if(!o){const m=[],p=s>1,g=l<e;p&&m.push("ellipsis");for(let b=s;b<=l;b++)m.push(b);return g&&m.push("ellipsis"),m}const r=t*2+5;if(e<=r){const m=[];for(let p=1;p<=e;p++)m.push(p);return m}const c=s>2,d=l<e-1,u=[];u.push(1),c&&u.push("ellipsis");const h=c?s:2,f=d?l:e-1;for(let m=h;m<=f;m++)u.push(m);return d&&u.push("ellipsis"),e>1&&u.push(e),u}const og={class:"ui-pagination__list",role:"list"},ag={key:0,class:"ui-pagination__ellipsis","aria-hidden":"true"},vl=O(i.defineComponent({__name:"Pagination",props:{modelValue:{},total:{},pageSize:{default:10},siblingCount:{default:1},showEdges:{type:Boolean,default:!0},size:{default:"md"},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=ve("chevronLeft"),o=ve("chevronRight"),a=n,s=e,l=i.computed(()=>a.total<=0||a.pageSize<=0?0:Math.ceil(a.total/a.pageSize)),r=i.computed(()=>Math.max(1,Math.min(a.modelValue,l.value))),c=i.computed(()=>Ml(r.value,l.value,a.siblingCount,a.showEdges)),d=i.computed(()=>r.value<=1),u=i.computed(()=>r.value>=l.value);function h(g){if(a.disabled)return;const b=Math.max(1,Math.min(g,l.value));b!==a.modelValue&&s("update:modelValue",b)}function f(){d.value||h(r.value-1)}function m(){u.value||h(r.value+1)}const p=i.computed(()=>a.size==="sm"?"xs":a.size==="lg"?"md":"sm");return(g,b)=>(i.openBlock(),i.createElementBlock("nav",{class:i.normalizeClass(["ui-pagination",[`ui-pagination--${n.size}`,{"ui-pagination--disabled":n.disabled}]]),role:"navigation","aria-label":"Pagination"},[i.createVNode(Je,{variant:"ghost",size:p.value,disabled:n.disabled||d.value,"icon-left":i.unref(t),"aria-label":"Go to previous page",onClick:f},null,8,["size","disabled","icon-left"]),i.createElementVNode("ul",og,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(c.value,(_,k)=>(i.openBlock(),i.createElementBlock("li",{key:_==="ellipsis"?`ellipsis-${k}`:_,class:"ui-pagination__item"},[_==="ellipsis"?(i.openBlock(),i.createElementBlock("span",ag," … ")):(i.openBlock(),i.createBlock(Je,{key:1,variant:_===r.value?"secondary":"ghost",size:p.value,disabled:n.disabled,"aria-label":`Go to page ${_}`,"aria-current":_===r.value?"page":void 0,class:i.normalizeClass(["ui-pagination__button",{"ui-pagination__button--current":_===r.value}]),onClick:B=>h(_)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(_),1)]),_:2},1032,["variant","size","disabled","aria-label","aria-current","class","onClick"]))]))),128))]),i.createVNode(Je,{variant:"ghost",size:p.value,disabled:n.disabled||u.value,"icon-left":i.unref(o),"aria-label":"Go to next page",onClick:m},null,8,["size","disabled","icon-left"])],2))}}),[["__scopeId","data-v-686c5710"]]),sg=["for"],lg={key:0,class:"ui-select__required","aria-hidden":"true"},rg=["id","disabled","aria-expanded","aria-controls","aria-activedescendant","aria-invalid","aria-describedby","aria-required"],cg={class:"ui-select__value"},dg=["name","value","required","disabled"],ug={value:"",disabled:""},hg=["value","disabled"],fg=["id","aria-labelledby"],mg=["id","aria-selected","aria-disabled","onMouseenter","onClick"],pg={key:0,class:"ui-select__check",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},gg=["id"],bg=["id"],Vl=O(i.defineComponent({__name:"Select",props:{modelValue:{default:null},options:{},label:{},placeholder:{default:"Select an option"},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},block:{type:Boolean,default:!1},id:{},name:{}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(null),s=i.ref(null),l=i.ref(!1),r=i.ref(-1),c=ye("select"),d=i.computed(()=>t.id||c),u=i.computed(()=>`${d.value}-listbox`),h=i.computed(()=>`${d.value}-hint`),f=i.computed(()=>`${d.value}-error`);function m(P){return`${d.value}-option-${P}`}const p=i.computed(()=>{if(t.error)return f.value;if(t.hint)return h.value}),g=i.computed(()=>t.options.find(P=>P.value===t.modelValue)),b=i.computed(()=>{var P;return((P=g.value)==null?void 0:P.label)||""}),_=i.computed(()=>{if(!(!l.value||r.value<0))return m(r.value)}),k=i.ref({});function B(){if(!a.value)return;const P=a.value.getBoundingClientRect();k.value={position:"fixed",top:`${P.bottom+4}px`,left:`${P.left}px`,minWidth:`${P.width}px`,maxWidth:`${Math.max(P.width,300)}px`}}function C(){if(t.disabled||l.value)return;l.value=!0,B();const P=t.options.findIndex(A=>A.value===t.modelValue);P>=0&&!t.options[P].disabled?r.value=P:r.value=t.options.findIndex(A=>!A.disabled),i.nextTick(()=>{M()}),document.addEventListener("mousedown",S),window.addEventListener("resize",y),window.addEventListener("scroll",B,!0)}function y(){l.value&&(l.value=!1,r.value=-1,document.removeEventListener("mousedown",S),window.removeEventListener("resize",y),window.removeEventListener("scroll",B,!0))}function x(){l.value?y():C()}function S(P){var R,q;const A=P.target;(R=a.value)!=null&&R.contains(A)||(q=s.value)!=null&&q.contains(A)||y()}function w(P){var A;P.disabled||(o("update:modelValue",P.value),o("change",P.value),y(),(A=a.value)==null||A.focus())}function M(){if(!s.value||r.value<0)return;const P=s.value.children[r.value];P&&P.scrollIntoView({block:"nearest"})}function N(P){const A=t.options.length;let R=r.value;do R=(R+P+A)%A;while(t.options[R].disabled&&R!==r.value);t.options[R].disabled||(r.value=R,i.nextTick(M))}function T(P){switch(P.key){case"Enter":case" ":P.preventDefault(),l.value&&r.value>=0?w(t.options[r.value]):C();break;case"ArrowDown":P.preventDefault(),l.value?N(1):C();break;case"ArrowUp":P.preventDefault(),l.value?N(-1):C();break;case"Home":P.preventDefault(),l.value&&(r.value=t.options.findIndex(A=>!A.disabled),i.nextTick(M));break;case"End":if(P.preventDefault(),l.value){for(let A=t.options.length-1;A>=0;A--)if(!t.options[A].disabled){r.value=A;break}i.nextTick(M)}break;case"Escape":P.preventDefault(),y();break;case"Tab":y();break}}function $(P){t.options[P].disabled||(r.value=P)}function K(P,A){A.preventDefault(),w(P)}return i.onBeforeUnmount(()=>{document.removeEventListener("mousedown",S),window.removeEventListener("resize",y),window.removeEventListener("scroll",B,!0)}),(P,A)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-select",[`ui-select--${n.size}`,{"ui-select--block":n.block,"ui-select--disabled":n.disabled,"ui-select--error":n.error,"ui-select--open":l.value}]])},[n.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:d.value,class:"ui-select__label"},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),n.required?(i.openBlock(),i.createElementBlock("span",lg,"*")):i.createCommentVNode("",!0)],8,sg)):i.createCommentVNode("",!0),i.createElementVNode("button",{id:d.value,ref_key:"triggerRef",ref:a,type:"button",role:"combobox",class:i.normalizeClass(["ui-select__trigger",[`ui-select__trigger--${n.size}`,{"ui-select__trigger--error":n.error,"ui-select__trigger--placeholder":!g.value}]]),disabled:n.disabled,"aria-expanded":l.value,"aria-controls":u.value,"aria-activedescendant":_.value,"aria-invalid":n.error?"true":void 0,"aria-describedby":p.value,"aria-required":n.required,"aria-haspopup":"listbox",onClick:x,onKeydown:T},[i.createElementVNode("span",cg,i.toDisplayString(b.value||n.placeholder),1),(i.openBlock(),i.createElementBlock("svg",{class:i.normalizeClass(["ui-select__chevron",{"ui-select__chevron--open":l.value}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...A[0]||(A[0]=[i.createElementVNode("path",{d:"M6 9l6 6 6-6"},null,-1)])],2))],42,rg),n.name?(i.openBlock(),i.createElementBlock("select",{key:1,name:n.name,value:n.modelValue??"",required:n.required,disabled:n.disabled,class:"ui-select__native",tabindex:"-1","aria-hidden":"true"},[i.createElementVNode("option",ug,i.toDisplayString(n.placeholder),1),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.options,R=>(i.openBlock(),i.createElementBlock("option",{key:R.value,value:R.value,disabled:R.disabled},i.toDisplayString(R.label),9,hg))),128))],8,dg)):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ui-select-menu"},{default:i.withCtx(()=>[l.value?(i.openBlock(),i.createElementBlock("ul",{key:0,id:u.value,ref_key:"listboxRef",ref:s,role:"listbox",class:"ui-select__listbox",style:i.normalizeStyle(k.value),"aria-labelledby":d.value},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.options,(R,q)=>(i.openBlock(),i.createElementBlock("li",{key:R.value,id:m(q),role:"option",class:i.normalizeClass(["ui-select__option",{"ui-select__option--selected":R.value===n.modelValue,"ui-select__option--highlighted":q===r.value,"ui-select__option--disabled":R.disabled}]),"aria-selected":R.value===n.modelValue,"aria-disabled":R.disabled,onMouseenter:Q=>$(q),onClick:Q=>K(R,Q)},[i.createTextVNode(i.toDisplayString(R.label)+" ",1),R.value===n.modelValue?(i.openBlock(),i.createElementBlock("svg",pg,[...A[1]||(A[1]=[i.createElementVNode("path",{d:"M5 12l5 5L20 7"},null,-1)])])):i.createCommentVNode("",!0)],42,mg))),128))],12,fg)):i.createCommentVNode("",!0)]),_:1})])),n.error?(i.openBlock(),i.createElementBlock("p",{key:2,id:f.value,class:"ui-select__message ui-select__message--error",role:"alert"},i.toDisplayString(n.error),9,gg)):n.hint?(i.openBlock(),i.createElementBlock("p",{key:3,id:h.value,class:"ui-select__message ui-select__message--hint"},i.toDisplayString(n.hint),9,bg)):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1f24efa"]]),vo=O(i.defineComponent({__name:"Text",props:{as:{default:"p"},size:{default:"base"},weight:{default:"regular"},align:{default:"left"},muted:{type:Boolean},truncate:{type:Boolean},clamp:{}},setup(n){const e=n,t=i.computed(()=>["ui-text",`ui-text--${e.size}`,`ui-text--${e.weight}`,`ui-text--${e.align}`,{"ui-text--muted":e.muted,"ui-text--truncate":e.truncate&&!e.clamp,"ui-text--clamp":e.clamp}]),o=i.computed(()=>e.clamp?{WebkitLineClamp:e.clamp}:void 0);return(a,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{class:i.normalizeClass(t.value),style:i.normalizeStyle(o.value)},{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"]))}}),[["__scopeId","data-v-17686709"]]);function Dl(n,e){if(e)return e.split(".").reduce((t,o)=>{if(t&&typeof t=="object"&&Object.hasOwn(t,o))return t[o]},n)}const _g={key:0,class:"ui-table__toolbar"},yg={class:"ui-table__search"},kg={class:"ui-table__wrapper"},xg=["aria-busy"],wg={class:"ui-table__header"},Cg={class:"ui-table__header-row"},Bg={key:0,class:"ui-table__header-cell ui-table__header-cell--expand"},Sg={key:1,class:"ui-table__header-cell ui-table__header-cell--checkbox"},Eg=["aria-sort","tabindex","role","onClick","onKeydown"],Mg={class:"ui-table__header-content"},vg={class:"ui-table__header-text"},Vg=["onMousedown"],Dg={key:0,class:"ui-table__filter-row"},$g={key:0,class:"ui-table__filter-cell"},Tg={key:1,class:"ui-table__filter-cell"},Ig={class:"ui-table__body"},Lg={key:0,class:"ui-table__cell ui-table__cell--expand"},zg={key:1,class:"ui-table__cell ui-table__cell--checkbox"},Ng={key:1,class:"ui-table__row ui-table__row--empty"},Pg=["colspan"],Ag=["onClick"],Rg=["aria-expanded","aria-label","onClick"],Og=["data-label"],Fg=["colspan"],Wg={class:"ui-table__expansion-content"},Hg={key:1,class:"ui-table__footer"},jg={class:"ui-table__footer-summary"},Yg={class:"ui-table__footer-controls"},Ug={class:"ui-table__page-size"},Xg=O(i.defineComponent({__name:"DataTable",props:{data:{},columns:{},selectable:{type:Boolean,default:!1},selectedIds:{default:()=>[]},rowKey:{default:"id"},loading:{type:Boolean,default:!1},skeletonRows:{default:5},striped:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!0},size:{default:"md"},emptyMessage:{default:"No data available"},bordered:{type:Boolean,default:!1},stickyHeader:{type:Boolean,default:!1},pagination:{type:[Boolean,Object],default:!1},page:{default:1},pageSize:{default:10},total:{},serverSide:{type:Boolean,default:!1},searchable:{type:Boolean,default:!1},search:{default:""},searchPlaceholder:{default:"Search..."},filterable:{type:Boolean,default:!1},filters:{default:()=>({})},resizable:{type:Boolean,default:!1},expandable:{type:Boolean,default:!1},expandedIds:{default:()=>[]}},emits:["update:selectedIds","sort-change","row-click","update:page","update:pageSize","pagination-change","update:search","update:filters","filter-change","update:expandedIds","row-expand","column-resize"],setup(n,{emit:e}){const t=["60%","75%","90%","70%","85%","65%","80%","55%"];function o(I,U){return t[(I*3+U)%t.length]}const a=ve("sortAsc"),s=ve("sortDesc"),l=ve("sortNeutral"),r=ve("expand"),c=ve("collapse"),d=ve("search"),u=ve("close"),h=n,f=e,m=i.ref({key:null,direction:null}),p=ye("datatable"),g=i.computed(()=>!!h.pagination),b=i.computed(()=>typeof h.pagination=="object"?h.pagination:{}),_=[10,20,50,100],k=i.computed(()=>b.value.pageSizeOptions||_),B=i.ref(h.page),C=i.ref(b.value.pageSize||h.pageSize);i.watch(()=>h.page,I=>{B.value=I}),i.watch(()=>h.pageSize,I=>{C.value=I});const y=i.computed(()=>h.serverSide&&h.total!==void 0?h.total:me.value.length),x=i.computed(()=>y.value<=0||C.value<=0?0:Math.ceil(y.value/C.value));function S(I){B.value=I,f("update:page",I),f("pagination-change",{page:I,pageSize:C.value})}function w(I){if(I===null)return;const U=typeof I=="string"?parseInt(I,10):I;C.value=U,B.value=1,f("update:pageSize",U),f("update:page",1),f("pagination-change",{page:1,pageSize:U})}const M=i.computed(()=>k.value.map(I=>({label:String(I),value:I}))),N=i.computed(()=>y.value===0?0:(B.value-1)*C.value+1),T=i.computed(()=>Math.min(B.value*C.value,y.value));function $(I){const U=I[h.rowKey];return typeof U=="string"||typeof U=="number"?U:(console.warn(`DataTable: Row key "${h.rowKey}" must be string or number`),String(U))}function K(I,U){return Dl(I,U)}const P=i.computed(()=>h.data.length===0?!1:h.data.every(I=>h.selectedIds.includes($(I)))),A=i.computed(()=>h.data.length===0?!1:h.selectedIds.length>0&&!P.value);function R(I){if(I){const U=h.data.map(H=>$(H));f("update:selectedIds",U)}else f("update:selectedIds",[])}function q(I,U){const H=$(I);U?f("update:selectedIds",[...h.selectedIds,H]):f("update:selectedIds",h.selectedIds.filter(re=>re!==H))}function Q(I){return h.selectedIds.includes($(I))}function ee(I){if(!I.sortable)return;let U;if(m.value.key!==I.key)U="asc";else{const H=[null,"asc","desc"],re=H.indexOf(m.value.direction);U=H[(re+1)%3]}m.value={key:U?I.key:null,direction:U},f("sort-change",m.value)}function ge(I,U){(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),ee(U))}const fe=i.ref(h.search),be=i.ref({...h.filters});i.watch(()=>h.search,I=>{fe.value=I}),i.watch(()=>h.filters,I=>{be.value={...I}},{deep:!0});function xe(I){const U=I===null?"":String(I);fe.value=U,B.value=1,f("update:search",U),f("update:page",1),f("filter-change",{search:U,filters:be.value})}function F(){xe("")}function v(I,U){const H={...be.value,[I]:U};U||delete H[I],be.value=H,B.value=1,f("update:filters",H),f("update:page",1),f("filter-change",{search:fe.value,filters:H})}function D(I,U){return U?String(I??"").toLowerCase().includes(U.toLowerCase()):!0}const G=i.computed(()=>fe.value!==""||Object.keys(be.value).length>0),ce=i.computed(()=>h.filterable?h.columns.filter(I=>I.filterable!==!1):[]),ze=i.ref({}),L=i.ref(null),j=i.ref(0),X=i.ref(0),ne=i.ref(null);function he(I){return ze.value[I.key]?`${ze.value[I.key]}px`:I.width}function Ae(I,U){if(!h.resizable||U.resizable===!1)return;I.preventDefault(),L.value=U.key,j.value=I.clientX;const H=I.target.closest("th");H&&(X.value=H.offsetWidth),document.addEventListener("mousemove",Re),document.addEventListener("mouseup",Ye),document.body.style.cursor="col-resize",document.body.style.userSelect="none"}function Re(I){if(!L.value)return;const U=h.columns.find(Pe=>Pe.key===L.value),H=U!=null&&U.minWidth?parseInt(U.minWidth):50,re=I.clientX-j.value,te=Math.max(H,X.value+re);ze.value={...ze.value,[L.value]:te}}function Ye(){L.value&&f("column-resize",L.value,ze.value[L.value]),L.value=null,document.removeEventListener("mousemove",Re),document.removeEventListener("mouseup",Ye),document.body.style.cursor="",document.body.style.userSelect=""}i.onUnmounted(()=>{document.removeEventListener("mousemove",Re),document.removeEventListener("mouseup",Ye)});function V(I){return h.expandedIds.includes($(I))}function Z(I){const U=$(I),H=h.expandedIds.includes(U);H?f("update:expandedIds",h.expandedIds.filter(re=>re!==U)):f("update:expandedIds",[...h.expandedIds,U]),f("row-expand",I,!H)}function Te(I){return I==null?4:typeof I=="number"?1:typeof I=="string"?2:typeof I=="boolean"?3:5}const me=i.computed(()=>{if(h.serverSide)return h.data;let I=[...h.data];if(fe.value){const U=fe.value.toLowerCase();I=I.filter(H=>h.columns.some(re=>{const te=K(H,re.key);return String(te??"").toLowerCase().includes(U)}))}return Object.keys(be.value).length>0&&(I=I.filter(U=>Object.entries(be.value).every(([H,re])=>{if(!re)return!0;const te=h.columns.find(Ft=>Ft.key===H),Pe=K(U,H);return((te==null?void 0:te.filterFn)||D)(Pe,re,U)}))),I}),we=i.computed(()=>{if(!m.value.key||!m.value.direction)return me.value;const I=m.value.key,U=m.value.direction==="asc"?1:-1;return[...me.value].sort((H,re)=>{const te=K(H,I),Pe=K(re,I),$n=Te(te),Ft=Te(Pe);return $n!==Ft?($n-Ft)*U:te==null&&Pe==null?0:typeof te=="string"&&typeof Pe=="string"?te.localeCompare(Pe)*U:typeof te=="number"&&typeof Pe=="number"?(te-Pe)*U:typeof te=="boolean"&&typeof Pe=="boolean"?(te===Pe?0:te?-1:1)*U:(String(te)<String(Pe)?-1:String(te)>String(Pe)?1:0)*U})}),le=i.computed(()=>{if(!g.value||h.serverSide)return we.value;const I=(B.value-1)*C.value,U=I+C.value;return we.value.slice(I,U)});function Ne(I,U){f("row-click",I,U)}const De=i.computed(()=>{let I=h.columns.length;return h.selectable&&I++,h.expandable&&I++,I});i.computed(()=>h.serverSide&&h.total!==void 0?h.total:me.value.length);const tt=i.computed(()=>Array.from({length:h.skeletonRows}));return(I,U)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"tableRef",ref:ne,class:i.normalizeClass(["ui-table",[`ui-table--${n.size}`,{"ui-table--striped":n.striped,"ui-table--hoverable":n.hoverable,"ui-table--bordered":n.bordered,"ui-table--loading":n.loading,"ui-table--sticky-header":n.stickyHeader,"ui-table--resizable":n.resizable,"ui-table--resizing":L.value!==null}]])},[n.searchable?(i.openBlock(),i.createElementBlock("div",_g,[i.createElementVNode("div",yg,[i.createVNode(Jt,{"model-value":fe.value,placeholder:n.searchPlaceholder,size:"sm",type:"search","onUpdate:modelValue":xe},i.createSlots({left:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(d)),{class:"ui-table__search-icon"}))]),_:2},[fe.value?{name:"right",fn:i.withCtx(()=>[i.createElementVNode("button",{type:"button",class:"ui-table__search-clear","aria-label":"Clear search",onClick:F},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(u)),{class:"ui-table__search-clear-icon"}))])]),key:"0"}:void 0]),1032,["model-value","placeholder"])]),i.renderSlot(I.$slots,"toolbar",{},void 0,!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",kg,[i.createElementVNode("table",{class:"ui-table__table","aria-busy":n.loading||void 0},[i.createElementVNode("thead",wg,[i.createElementVNode("tr",Cg,[n.expandable?(i.openBlock(),i.createElementBlock("th",Bg,[...U[2]||(U[2]=[i.createElementVNode("span",{class:"ui-table__header-text sr-only"},"Expand",-1)])])):i.createCommentVNode("",!0),n.selectable?(i.openBlock(),i.createElementBlock("th",Sg,[i.createVNode(Vi,{"model-value":P.value,indeterminate:A.value,size:"sm","aria-label":"Select all rows","onUpdate:modelValue":R},null,8,["model-value","indeterminate"])])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.columns,(H,re)=>(i.openBlock(),i.createElementBlock("th",{key:H.key,class:i.normalizeClass(["ui-table__header-cell",[`ui-table__header-cell--${H.align||"left"}`,{"ui-table__header-cell--sortable":H.sortable,"ui-table__header-cell--sorted":m.value.key===H.key,"ui-table__header-cell--resizable":n.resizable&&H.resizable!==!1}]]),style:i.normalizeStyle(he(H)?{width:he(H)}:void 0),"aria-sort":H.sortable?m.value.key===H.key?m.value.direction==="asc"?"ascending":m.value.direction==="desc"?"descending":"none":"none":void 0,tabindex:H.sortable?0:void 0,role:H.sortable?"button":void 0,onClick:te=>ee(H),onKeydown:te=>ge(te,H)},[i.createElementVNode("div",Mg,[i.renderSlot(I.$slots,`header-${H.key}`,{column:H},()=>[i.createElementVNode("span",vg,i.toDisplayString(H.label),1)],!0),H.sortable?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(["ui-table__sort-icon",{"ui-table__sort-icon--asc":m.value.key===H.key&&m.value.direction==="asc","ui-table__sort-icon--desc":m.value.key===H.key&&m.value.direction==="desc"}]),"aria-hidden":"true"},[m.value.key!==H.key||!m.value.direction?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(l)),{key:0,class:"ui-table__sort-svg ui-table__sort-svg--neutral"})):m.value.direction==="asc"?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(a)),{key:1,class:"ui-table__sort-svg"})):(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(s)),{key:2,class:"ui-table__sort-svg"}))],2)):i.createCommentVNode("",!0)]),n.resizable&&H.resizable!==!1&&re<n.columns.length-1?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-table__resize-handle",onMousedown:te=>Ae(te,H)},null,40,Vg)):i.createCommentVNode("",!0)],46,Eg))),128))]),n.filterable&&ce.value.length>0?(i.openBlock(),i.createElementBlock("tr",Dg,[n.expandable?(i.openBlock(),i.createElementBlock("th",$g)):i.createCommentVNode("",!0),n.selectable?(i.openBlock(),i.createElementBlock("th",Tg)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.columns,H=>(i.openBlock(),i.createElementBlock("th",{key:`filter-${H.key}`,class:"ui-table__filter-cell"},[H.filterable!==!1?(i.openBlock(),i.createBlock(Jt,{key:0,"model-value":be.value[H.key]||"",placeholder:`Filter ${H.label}...`,size:"sm","onUpdate:modelValue":re=>v(H.key,String(re??""))},null,8,["model-value","placeholder","onUpdate:modelValue"])):i.createCommentVNode("",!0)]))),128))])):i.createCommentVNode("",!0)]),i.createElementVNode("tbody",Ig,[n.loading?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList(tt.value,(H,re)=>(i.openBlock(),i.createElementBlock("tr",{key:`skeleton-${re}`,class:"ui-table__row ui-table__row--skeleton"},[n.expandable?(i.openBlock(),i.createElementBlock("td",Lg,[i.createVNode(wi,{variant:"rect",width:16,height:16})])):i.createCommentVNode("",!0),n.selectable?(i.openBlock(),i.createElementBlock("td",zg,[i.createVNode(wi,{variant:"rect",width:16,height:16})])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.columns,(te,Pe)=>(i.openBlock(),i.createElementBlock("td",{key:te.key,class:i.normalizeClass(["ui-table__cell",[`ui-table__cell--${te.align||"left"}`]])},[i.createVNode(wi,{variant:"text",width:o(re,Pe),height:16},null,8,["width"])],2))),128))]))),128)):le.value.length===0?(i.openBlock(),i.createElementBlock("tr",Ng,[i.createElementVNode("td",{colspan:De.value,class:"ui-table__cell ui-table__cell--empty"},[i.renderSlot(I.$slots,"empty",{},()=>[i.createVNode(El,{title:G.value?"No matching results":n.emptyMessage,description:G.value?"Try adjusting your search or filters":void 0,compact:""},null,8,["title","description"])],!0)],8,Pg)])):(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:2},i.renderList(le.value,(H,re)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:$(H)},[i.createElementVNode("tr",{class:i.normalizeClass(["ui-table__row",{"ui-table__row--selected":Q(H),"ui-table__row--clickable":I.$attrs.onRowClick,"ui-table__row--expanded":n.expandable&&V(H)}]),onClick:te=>Ne(H,re)},[n.expandable?(i.openBlock(),i.createElementBlock("td",{key:0,class:"ui-table__cell ui-table__cell--expand",onClick:U[0]||(U[0]=i.withModifiers(()=>{},["stop"]))},[i.createElementVNode("button",{type:"button",class:i.normalizeClass(["ui-table__expand-button",{"ui-table__expand-button--expanded":V(H)}]),"aria-expanded":V(H),"aria-label":V(H)?"Collapse row":"Expand row",onClick:te=>Z(H)},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(V(H)?i.unref(c):i.unref(r)),{class:"ui-table__expand-icon"}))],10,Rg)])):i.createCommentVNode("",!0),n.selectable?(i.openBlock(),i.createElementBlock("td",{key:1,class:"ui-table__cell ui-table__cell--checkbox",onClick:U[1]||(U[1]=i.withModifiers(()=>{},["stop"]))},[i.createVNode(Vi,{"model-value":Q(H),size:"sm","aria-label":`Select row ${re+1}`,"onUpdate:modelValue":te=>q(H,te)},null,8,["model-value","aria-label","onUpdate:modelValue"])])):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.columns,te=>(i.openBlock(),i.createElementBlock("td",{key:te.key,class:i.normalizeClass(["ui-table__cell",[`ui-table__cell--${te.align||"left"}`]]),"data-label":te.label,style:i.normalizeStyle(he(te)?{width:he(te)}:void 0)},[i.renderSlot(I.$slots,`cell-${te.key}`,{value:K(H,te.key),row:H,column:te,index:re},()=>[i.createTextVNode(i.toDisplayString(K(H,te.key)??""),1)],!0)],14,Og))),128))],10,Ag),n.expandable&&V(H)?(i.openBlock(),i.createElementBlock("tr",{key:`expanded-${$(H)}`,class:"ui-table__row ui-table__row--expansion"},[i.createElementVNode("td",{colspan:De.value,class:"ui-table__cell ui-table__cell--expansion"},[i.renderSlot(I.$slots,"expanded",{row:H,index:re},()=>[i.createElementVNode("div",Wg,[i.createElementVNode("pre",null,i.toDisplayString(JSON.stringify(H,null,2)),1)])],!0)],8,Fg)])):i.createCommentVNode("",!0)],64))),128))])],8,xg)]),g.value&&x.value>0?(i.openBlock(),i.createElementBlock("div",Hg,[i.createElementVNode("div",jg,[i.createVNode(vo,{size:"sm",muted:""},{default:i.withCtx(()=>[i.createTextVNode(" Showing "+i.toDisplayString(N.value)+" to "+i.toDisplayString(T.value)+" of "+i.toDisplayString(y.value)+" results ",1)]),_:1})]),i.createElementVNode("div",Yg,[i.createElementVNode("div",Ug,[i.createVNode(vo,{size:"sm",muted:"",as:"label",for:`${i.unref(p)}-page-size`},{default:i.withCtx(()=>[...U[3]||(U[3]=[i.createTextVNode(" Rows per page ",-1)])]),_:1},8,["for"]),i.createVNode(Vl,{id:`${i.unref(p)}-page-size`,"model-value":C.value,options:M.value,size:"sm","onUpdate:modelValue":w},null,8,["id","model-value","options"])]),i.createVNode(vl,{"model-value":B.value,total:y.value,"page-size":C.value,"sibling-count":b.value.siblingCount??1,"show-edges":b.value.showEdges??!0,size:n.size==="lg"?"lg":n.size==="sm"?"sm":"md","onUpdate:modelValue":S},null,8,["model-value","total","page-size","sibling-count","show-edges","size"])])])):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-7c8fff0a"]]);function $l(n,e){const t=[],a=new Date(n,e,1).getDay(),s=new Date(n,e,1-a);for(let l=0;l<42;l++){const r=new Date(s);r.setDate(s.getDate()+l),t.push({date:r,day:r.getDate(),currentMonth:r.getMonth()===e})}return t}function Kg(n,e){return new Date(n,e+1,0).getDate()}function Bt(n){const e=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),o=String(n.getDate()).padStart(2,"0");return`${e}-${t}-${o}`}function ft(n){if(!n||!/^\d{4}-\d{2}-\d{2}$/.test(n))return null;const[e,t,o]=n.split("-").map(Number),a=new Date(e,t-1,o);return a.getFullYear()!==e||a.getMonth()!==t-1||a.getDate()!==o?null:a}function mt(n,e){return!n||!e?!1:n.getFullYear()===e.getFullYear()&&n.getMonth()===e.getMonth()&&n.getDate()===e.getDate()}function Tl(n,e){const t=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=new Date(e.getFullYear(),e.getMonth(),e.getDate());return t.getTime()<o.getTime()}function Il(n,e){const t=new Date(n.getFullYear(),n.getMonth(),n.getDate()),o=new Date(e.getFullYear(),e.getMonth(),e.getDate());return t.getTime()>o.getTime()}function Ll(n,e){return new Date(2e3,n,1).toLocaleDateString(e,{month:"long"})}function zl(n){const e=[],t=new Date(2024,0,7);for(let o=0;o<7;o++){const a=new Date(t);a.setDate(t.getDate()+o),e.push(a.toLocaleDateString(n,{weekday:"short"}))}return e}function Ci(n,e,t){return!(e&&Tl(n,e)||t&&Il(n,t))}function qg(n,e,t){if(!e||!t)return!1;const o=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),a=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),s=new Date(t.getFullYear(),t.getMonth(),t.getDate()).getTime();return o>Math.min(a,s)&&o<Math.max(a,s)}function Vo(n,e,t,o){if(!e)return null;const a=t||o;if(!a)return mt(n,e)?"start":null;const s=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),l=new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime(),r=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),c=Math.min(s,l),d=Math.max(s,l);return r===c?"start":r===d?"end":r>c&&r<d?"in-range":null}function Do(n,e){const t=new Date(n.getFullYear(),n.getMonth(),n.getDate()).getTime(),o=new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime();return t<=o?[n,e]:[e,n]}function Nl(n){const e=[];for(let t=0;t<12;t++){const o=new Date(2e3,t,1);e.push(o.toLocaleDateString(n,{month:"short"}))}return e}function Pl(n){const e=Math.floor(n/20)*20;return Array.from({length:20},(t,o)=>e+o)}function Gg(n){const e=new Date,t=new Date(e.getFullYear(),e.getMonth(),e.getDate());switch(n){case"today":return[t,t];case"yesterday":{const o=new Date(t);return o.setDate(o.getDate()-1),[o,o]}case"last7days":{const o=new Date(t);return o.setDate(o.getDate()-6),[o,t]}case"last30days":{const o=new Date(t);return o.setDate(o.getDate()-29),[o,t]}case"thisMonth":{const o=new Date(e.getFullYear(),e.getMonth(),1),a=new Date(e.getFullYear(),e.getMonth()+1,0);return[o,a]}case"lastMonth":{const o=new Date(e.getFullYear(),e.getMonth()-1,1),a=new Date(e.getFullYear(),e.getMonth(),0);return[o,a]}case"thisYear":{const o=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),11,31);return[o,a]}default:return[t,t]}}const Jg=["for"],Zg={key:0,class:"ui-datepicker-field__required","aria-hidden":"true"},Qg=["id","value","placeholder","disabled","aria-describedby","aria-invalid"],eb=["id","aria-controls","aria-describedby","aria-invalid","aria-disabled"],tb={class:"ui-datepicker-trigger__value"},nb=["name","value","required"],ib=["name","value"],ob=["name","value"],ab={key:0,class:"ui-datepicker-sidebar"},sb={class:"ui-datepicker",role:"application","aria-label":"Date picker"},lb={class:"ui-datepicker__header"},rb={key:0,class:"ui-datepicker__year-grid"},cb=["disabled","onClick"],db={key:1,class:"ui-datepicker__month-grid"},ub=["disabled","onClick"],hb={class:"ui-datepicker__weekdays",role:"row"},fb=["abbr"],mb=["id","aria-label"],pb=["disabled","aria-selected","aria-current","aria-disabled","tabindex","onClick","onMouseenter"],gb={key:0,class:"ui-datepicker__hint"},bb=["id","aria-expanded","aria-controls","aria-describedby","aria-invalid","aria-disabled"],_b={class:"ui-datepicker-trigger__value"},yb=["name","value","required"],kb=["name","value"],xb=["name","value"],wb={class:"ui-datepicker-sheet",role:"dialog","aria-modal":"true","aria-label":"Date picker"},Cb={class:"ui-datepicker-sheet__header"},Bb={class:"ui-datepicker-sheet__title"},Sb={key:0,class:"ui-datepicker-sheet__presets"},Eb={class:"ui-datepicker ui-datepicker--mobile"},Mb={class:"ui-datepicker__header"},vb={key:0,class:"ui-datepicker__year-grid ui-datepicker__year-grid--mobile"},Vb=["disabled","onClick"],Db={key:1,class:"ui-datepicker__month-grid ui-datepicker__month-grid--mobile"},$b=["disabled","onClick"],Tb={class:"ui-datepicker__weekdays",role:"row"},Ib=["abbr"],Lb=["id","aria-label"],zb=["disabled","aria-selected","aria-current","aria-disabled","tabindex","onClick"],Nb={key:0,class:"ui-datepicker__hint"},Pb=["id"],Ab=["id"],Rb=O(i.defineComponent({__name:"DatePicker",props:{modelValue:{},mode:{default:"single"},min:{},max:{},label:{},placeholder:{default:"Select date"},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},id:{},name:{},block:{type:Boolean,default:!1},locale:{},formatDisplay:{},formatRangeDisplay:{}},emits:["update:modelValue"],setup(n,{expose:e,emit:t}){const o=n,a=t,s=i.ref(null),l=i.ref(null),r=i.ref(null),c=i.ref(null),d=ye("datepicker"),u=i.computed(()=>o.id||d),h=i.computed(()=>`${u.value}-hint`),f=i.computed(()=>`${u.value}-error`),m=i.computed(()=>`${u.value}-grid`),p=i.computed(()=>{if(o.error)return f.value;if(o.hint)return h.value}),g=ve("calendar"),b=ve("chevronLeft"),_=ve("chevronRight"),k=ve("close"),B=i.ref(!1),C=i.ref(!1),y=i.ref(!1),x=i.ref(""),S=i.ref("");function w(){typeof window>"u"||(B.value=window.matchMedia("(max-width: 640px)").matches,C.value=window.matchMedia("(any-hover: hover)").matches)}w(),i.onMounted(()=>{window.addEventListener("resize",w)}),i.onUnmounted(()=>{window.removeEventListener("resize",w)});const M=i.ref(new Date),N=new Date,T=i.ref("day"),$=i.ref("idle"),K=i.ref(null),P=i.ref(null),A=i.computed(()=>o.mode==="range"?null:ft(o.modelValue||"")),R=i.computed(()=>{if(o.mode!=="range")return{start:null,end:null};const z=o.modelValue;return!z||!Array.isArray(z)?{start:null,end:null}:{start:ft(z[0]||""),end:ft(z[1]||"")}}),q=i.computed(()=>ft(o.min||"")),Q=i.computed(()=>ft(o.max||"")),ee=i.computed(()=>M.value.getFullYear()),ge=i.computed(()=>M.value.getMonth()),fe=i.computed(()=>Ll(ge.value,o.locale)),be=i.computed(()=>zl(o.locale)),xe=i.computed(()=>Nl(o.locale)),F=i.computed(()=>Pl(ee.value)),v=i.computed(()=>{const z=F.value;return`${z[0]}–${z[z.length-1]}`}),D=i.computed(()=>$l(ee.value,ge.value)),G=i.computed(()=>{if(o.mode==="range"){const{start:z,end:Y}=R.value;if(!z||!Y)return"";if(o.formatRangeDisplay)return o.formatRangeDisplay(z,Y);const oe={month:"short",day:"numeric"},_e=z.toLocaleDateString(o.locale,oe),J=Y.toLocaleDateString(o.locale,{...oe,year:"numeric"});return`${_e} – ${J}`}return A.value?o.formatDisplay?o.formatDisplay(A.value):A.value.toLocaleDateString(o.locale,{year:"numeric",month:"short",day:"numeric"}):""}),ce=i.computed(()=>o.mode==="range"?R.value.start!==null&&R.value.end!==null:A.value!==null),ze=i.computed(()=>{if(T.value==="year")return!0;if(T.value==="month")return q.value?ee.value>q.value.getFullYear():!0;if(!q.value)return!0;const z=new Date(ee.value,ge.value,1),Y=new Date(q.value.getFullYear(),q.value.getMonth(),1);return z>Y}),L=i.computed(()=>{if(T.value==="year")return!0;if(T.value==="month")return Q.value?ee.value<Q.value.getFullYear():!0;if(!Q.value)return!0;const z=new Date(ee.value,ge.value,1),Y=new Date(Q.value.getFullYear(),Q.value.getMonth(),1);return z<Y});i.watch(()=>o.modelValue,z=>{if(o.mode==="range"){const Y=z;if(Y&&Array.isArray(Y)&&Y[0]){const oe=ft(Y[0]);oe&&(M.value=new Date(oe))}}else{const Y=ft(z||"");Y&&(M.value=new Date(Y))}},{immediate:!0});function j(z){const Y=new Date(M.value);Y.setMonth(Y.getMonth()+z),M.value=Y}function X(z){const Y=new Date(M.value);Y.setFullYear(Y.getFullYear()+z),M.value=Y}function ne(z){const Y=new Date(M.value);Y.setFullYear(Y.getFullYear()+z*20),M.value=Y}function he(){ze.value&&(T.value==="year"?ne(-1):T.value==="month"?X(-1):j(-1))}function Ae(){L.value&&(T.value==="year"?ne(1):T.value==="month"?X(1):j(1))}function Re(){T.value==="day"?T.value="year":(T.value,T.value="day")}function Ye(z){M.value=new Date(z,ge.value,1),T.value="month"}function V(z){M.value=new Date(ee.value,z,1),T.value="day"}function Z(z){return!!(q.value&&z<q.value.getFullYear()||Q.value&&z>Q.value.getFullYear())}function Te(z){return!!(q.value&&(ee.value<q.value.getFullYear()||ee.value===q.value.getFullYear()&&z<q.value.getMonth())||Q.value&&(ee.value>Q.value.getFullYear()||ee.value===Q.value.getFullYear()&&z>Q.value.getMonth()))}function me(z){if(Ci(z.date,q.value,Q.value))if(o.mode==="range")if($.value==="idle")$.value="selecting",K.value=z.date;else{const[Y,oe]=Do(K.value,z.date);a("update:modelValue",[Bt(Y),Bt(oe)]),$.value="idle",K.value=null,P.value=null,te()}else a("update:modelValue",Bt(z.date)),te()}function we(z,Y){if(o.mode==="range"){const[oe,_e]=Do(z,Y);a("update:modelValue",[Bt(oe),Bt(_e)]),te()}}function le(z){o.mode==="range"&&$.value==="selecting"&&(P.value=z.date)}function Ne(){o.mode==="range"&&(P.value=null)}function De(z){return!Ci(z.date,q.value,Q.value)}function tt(z){if(o.mode==="range"){const{start:Y,end:oe}=R.value;return mt(z.date,Y)||mt(z.date,oe)}return mt(z.date,A.value)}function I(z){return mt(z.date,N)}function U(z){if(o.mode!=="range")return null;if($.value==="selecting"&&K.value)return Vo(z.date,K.value,null,P.value);const{start:Y,end:oe}=R.value;return Vo(z.date,Y,oe,null)}function H(z){if(!l.value||T.value!=="day")return;const Y=Array.from(l.value.querySelectorAll(".ui-datepicker__day:not([disabled])")),oe=Y.findIndex(J=>J===document.activeElement);if(oe===-1)return;let _e=-1;switch(z.key){case"ArrowLeft":z.preventDefault(),_e=oe>0?oe-1:Y.length-1;break;case"ArrowRight":z.preventDefault(),_e=oe<Y.length-1?oe+1:0;break;case"ArrowUp":for(z.preventDefault(),_e=oe>=7?oe-7:oe+35;_e>=Y.length;)_e-=7;break;case"ArrowDown":for(z.preventDefault(),_e=oe+7<Y.length?oe+7:oe-35;_e<0;)_e+=7;break;case"Home":z.preventDefault(),_e=0;break;case"End":z.preventDefault(),_e=Y.length-1;break;case"Escape":z.preventDefault(),te();return}_e>=0&&_e<Y.length&&Y[_e].focus()}function re(){var z;if(!o.disabled){if(T.value="day",$.value="idle",K.value=null,P.value=null,S.value="",o.mode==="range"){const{start:Y}=R.value;M.value=Y?new Date(Y):new Date,x.value=""}else M.value=A.value?new Date(A.value):new Date,x.value=A.value?Bt(A.value):"";B.value?(y.value=!0,document.body.style.overflow="hidden",i.nextTick(()=>Ft())):(z=s.value)==null||z.open()}}function te(){var z,Y;T.value="day",$.value="idle",K.value=null,P.value=null,S.value="",B.value?(y.value=!1,document.body.style.overflow="",(z=r.value)==null||z.focus()):(Y=s.value)==null||Y.close()}function Pe(){i.nextTick(()=>Ft())}function $n(){T.value="day",$.value="idle",K.value=null,P.value=null,S.value=""}function Ft(){var _e,J,Be,Wt;if(T.value!=="day")return;const z=(_e=l.value)==null?void 0:_e.querySelector(".ui-datepicker__day--selected, .ui-datepicker__day--range-start"),Y=(J=l.value)==null?void 0:J.querySelector(".ui-datepicker__day--today"),oe=(Be=l.value)==null?void 0:Be.querySelector(".ui-datepicker__day:not([disabled])");(Wt=z||Y||oe)==null||Wt.focus()}function u0(z){z.target.classList.contains("ui-datepicker-sheet__overlay")&&te()}function h0(){y.value?te():re()}function jl(z){(z.key==="Enter"||z.key===" ")&&(z.preventDefault(),re())}function f0(){y.value||re()}function m0(z){const Y=z.target;x.value=Y.value}function p0(z){var _e;const Y=z.relatedTarget,oe=(_e=l.value)==null?void 0:_e.closest(".ui-popover__content");oe&&Y&&oe.contains(Y)||Yl(!1)}function g0(z){z.key==="Enter"?(z.preventDefault(),Yl(!0)):z.key==="Escape"&&(z.preventDefault(),te())}function Yl(z){if(!x.value){S.value="";return}const Y=ft(x.value);if(!Y){S.value="Invalid date format (use YYYY-MM-DD)";return}if(!Ci(Y,q.value,Q.value)){S.value="Date is outside allowed range";return}S.value="",a("update:modelValue",Bt(Y)),M.value=new Date(Y),z&&te()}const b0={xs:"var(--text-xs)",sm:"var(--text-sm)",md:"var(--text-md)",lg:"var(--text-lg)",xl:"var(--text-xl)"},Ul=i.computed(()=>b0[o.size]);function Xl(){if(o.mode==="range"){const{start:Y}=R.value;if(Y){const oe=D.value.findIndex(_e=>mt(_e.date,Y));if(oe!==-1)return oe}}else if(A.value){const Y=D.value.findIndex(oe=>mt(oe.date,A.value));if(Y!==-1)return Y}const z=D.value.findIndex(Y=>mt(Y.date,N));return z!==-1?z:D.value.findIndex(Y=>Y.currentMonth)}const Kl=i.computed(()=>T.value==="year"?v.value:T.value==="month"?String(ee.value):`${fe.value} ${ee.value}`);return e({open:re,close:te,toggle:()=>y.value||s.value?te():re(),applyPreset:we}),(z,Y)=>{var oe,_e;return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-datepicker-field",[`ui-datepicker-field--${n.size}`,{"ui-datepicker-field--block":n.block,"ui-datepicker-field--disabled":n.disabled,"ui-datepicker-field--error":n.error||S.value}]])},[n.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:u.value,class:"ui-datepicker-field__label"},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),n.required?(i.openBlock(),i.createElementBlock("span",Zg,"*")):i.createCommentVNode("",!0)],8,Jg)):i.createCommentVNode("",!0),B.value?(i.openBlock(),i.createElementBlock("div",{key:2,ref_key:"triggerRef",ref:r,id:u.value,class:i.normalizeClass(["ui-datepicker-trigger",[`ui-datepicker-trigger--${n.size}`,{"ui-datepicker-trigger--disabled":n.disabled,"ui-datepicker-trigger--error":n.error,"ui-datepicker-trigger--has-value":ce.value}]]),role:"combobox","aria-haspopup":"dialog","aria-expanded":y.value,"aria-controls":m.value,"aria-describedby":p.value,"aria-invalid":n.error?"true":void 0,"aria-disabled":n.disabled,tabindex:"0",onClick:h0,onKeydown:jl},[i.createElementVNode("span",_b,i.toDisplayString(G.value||n.placeholder),1),i.createVNode(je,{icon:i.unref(g),size:Ul.value,class:"ui-datepicker-trigger__icon"},null,8,["icon","size"]),n.mode==="single"?(i.openBlock(),i.createElementBlock("input",{key:0,type:"hidden",name:n.name,value:n.modelValue,required:n.required},null,8,yb)):n.name?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("input",{type:"hidden",name:`${n.name}[0]`,value:((oe=n.modelValue)==null?void 0:oe[0])||""},null,8,kb),i.createElementVNode("input",{type:"hidden",name:`${n.name}[1]`,value:((_e=n.modelValue)==null?void 0:_e[1])||""},null,8,xb)],64)):i.createCommentVNode("",!0)],42,bb)):(i.openBlock(),i.createBlock(Ln,{key:1,ref_key:"popoverRef",ref:s,placement:"bottom-start",disabled:n.disabled,width:n.mode==="range"?"auto":308,"close-on-escape":!0,"close-on-click-outside":!0,"trap-focus":!0,onOpen:Pe,onClose:$n},{trigger:i.withCtx(()=>{var J,Be;return[i.createElementVNode("div",{ref_key:"triggerRef",ref:r,class:i.normalizeClass(["ui-datepicker-trigger",[`ui-datepicker-trigger--${n.size}`,{"ui-datepicker-trigger--disabled":n.disabled,"ui-datepicker-trigger--error":n.error||S.value,"ui-datepicker-trigger--has-value":ce.value}]])},[C.value&&n.mode==="single"?(i.openBlock(),i.createElementBlock("input",{key:0,ref_key:"inputRef",ref:c,id:u.value,type:"text",class:"ui-datepicker-trigger__input",value:x.value||G.value,placeholder:n.placeholder,disabled:n.disabled,"aria-describedby":p.value,"aria-invalid":n.error||S.value?"true":void 0,autocomplete:"off",onClick:Y[0]||(Y[0]=i.withModifiers(()=>{},["stop"])),onFocus:f0,onInput:m0,onBlur:p0,onKeydown:g0},null,40,Qg)):(i.openBlock(),i.createElementBlock("div",{key:1,id:u.value,role:"combobox","aria-haspopup":"grid","aria-expanded":!1,"aria-controls":m.value,"aria-describedby":p.value,"aria-invalid":n.error||S.value?"true":void 0,"aria-disabled":n.disabled,tabindex:"0",class:"ui-datepicker-trigger__value-wrapper",onClick:i.withModifiers(re,["stop"]),onKeydown:jl},[i.createElementVNode("span",tb,i.toDisplayString(G.value||n.placeholder),1)],40,eb)),i.createVNode(je,{icon:i.unref(g),size:Ul.value,class:"ui-datepicker-trigger__icon",onClick:i.withModifiers(re,["stop"])},null,8,["icon","size"]),n.mode==="single"?(i.openBlock(),i.createElementBlock("input",{key:2,type:"hidden",name:n.name,value:n.modelValue,required:n.required},null,8,nb)):n.name?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[i.createElementVNode("input",{type:"hidden",name:`${n.name}[0]`,value:((J=n.modelValue)==null?void 0:J[0])||""},null,8,ib),i.createElementVNode("input",{type:"hidden",name:`${n.name}[1]`,value:((Be=n.modelValue)==null?void 0:Be[1])||""},null,8,ob)],64)):i.createCommentVNode("",!0)],2)]}),default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["ui-datepicker-content",{"ui-datepicker-content--with-sidebar":n.mode==="range"&&z.$slots.sidebar}])},[n.mode==="range"&&z.$slots.sidebar?(i.openBlock(),i.createElementBlock("div",ab,[i.renderSlot(z.$slots,"sidebar",{applyPreset:we},void 0,!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",sb,[i.createElementVNode("div",lb,[i.createVNode(Je,{variant:"ghost",size:"sm","icon-left":i.unref(b),disabled:!ze.value,"aria-label":"Previous",onClick:he},null,8,["icon-left","disabled"]),i.createElementVNode("button",{type:"button",class:"ui-datepicker__title-btn","aria-live":"polite",onClick:Re},i.toDisplayString(Kl.value),1),i.createVNode(Je,{variant:"ghost",size:"sm","icon-left":i.unref(_),disabled:!L.value,"aria-label":"Next",onClick:Ae},null,8,["icon-left","disabled"])]),T.value==="year"?(i.openBlock(),i.createElementBlock("div",rb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(F.value,J=>(i.openBlock(),i.createElementBlock("button",{key:J,type:"button",class:i.normalizeClass(["ui-datepicker__year",{"ui-datepicker__year--selected":J===ee.value,"ui-datepicker__year--current":J===i.unref(N).getFullYear()}]),disabled:Z(J),onClick:Be=>Ye(J)},i.toDisplayString(J),11,cb))),128))])):T.value==="month"?(i.openBlock(),i.createElementBlock("div",db,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(xe.value,(J,Be)=>(i.openBlock(),i.createElementBlock("button",{key:Be,type:"button",class:i.normalizeClass(["ui-datepicker__month",{"ui-datepicker__month--selected":Be===ge.value,"ui-datepicker__month--current":Be===i.unref(N).getMonth()&&ee.value===i.unref(N).getFullYear()}]),disabled:Te(Be),onClick:Wt=>V(Be)},i.toDisplayString(J),11,ub))),128))])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createElementVNode("div",hb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(be.value,J=>(i.openBlock(),i.createElementBlock("span",{key:J,class:"ui-datepicker__weekday",role:"columnheader",abbr:J},i.toDisplayString(J),9,fb))),128))]),i.createElementVNode("div",{ref_key:"calendarRef",ref:l,id:m.value,class:"ui-datepicker__grid",role:"grid","aria-label":`${fe.value} ${ee.value}`,onKeydown:H},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(D.value,(J,Be)=>(i.openBlock(),i.createElementBlock("button",{key:Be,type:"button",class:i.normalizeClass(["ui-datepicker__day",[{"ui-datepicker__day--other-month":!J.currentMonth,"ui-datepicker__day--selected":tt(J),"ui-datepicker__day--today":I(J),"ui-datepicker__day--disabled":De(J)},U(J)?`ui-datepicker__day--range-${U(J)}`:""]]),role:"gridcell",disabled:De(J),"aria-selected":tt(J)||void 0,"aria-current":I(J)?"date":void 0,"aria-disabled":De(J)||void 0,tabindex:Be===Xl()?0:-1,onClick:Wt=>me(J),onMouseenter:Wt=>le(J),onMouseleave:Ne},i.toDisplayString(J.day),43,pb))),128))],40,mb),n.mode==="range"&&$.value==="selecting"?(i.openBlock(),i.createElementBlock("div",gb," Select end date ")):i.createCommentVNode("",!0)],64))])],2)]),_:3},8,["disabled","width"])),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ui-datepicker-sheet"},{default:i.withCtx(()=>[B.value&&y.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-datepicker-sheet__overlay",onClick:u0},[i.createElementVNode("div",wb,[i.createElementVNode("div",Cb,[i.createElementVNode("span",Bb,i.toDisplayString(n.label||(n.mode==="range"?"Select dates":"Select date")),1),i.createVNode(Je,{variant:"ghost",size:"sm","icon-left":i.unref(k),"aria-label":"Close",onClick:te},null,8,["icon-left"])]),n.mode==="range"&&z.$slots.sidebar?(i.openBlock(),i.createElementBlock("div",Sb,[i.renderSlot(z.$slots,"sidebar",{applyPreset:we},void 0,!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",Eb,[i.createElementVNode("div",Mb,[i.createVNode(Je,{variant:"ghost",size:"md","icon-left":i.unref(b),disabled:!ze.value,"aria-label":"Previous",onClick:he},null,8,["icon-left","disabled"]),i.createElementVNode("button",{type:"button",class:"ui-datepicker__title-btn","aria-live":"polite",onClick:Re},i.toDisplayString(Kl.value),1),i.createVNode(Je,{variant:"ghost",size:"md","icon-left":i.unref(_),disabled:!L.value,"aria-label":"Next",onClick:Ae},null,8,["icon-left","disabled"])]),T.value==="year"?(i.openBlock(),i.createElementBlock("div",vb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(F.value,J=>(i.openBlock(),i.createElementBlock("button",{key:J,type:"button",class:i.normalizeClass(["ui-datepicker__year",{"ui-datepicker__year--selected":J===ee.value,"ui-datepicker__year--current":J===i.unref(N).getFullYear()}]),disabled:Z(J),onClick:Be=>Ye(J)},i.toDisplayString(J),11,Vb))),128))])):T.value==="month"?(i.openBlock(),i.createElementBlock("div",Db,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(xe.value,(J,Be)=>(i.openBlock(),i.createElementBlock("button",{key:Be,type:"button",class:i.normalizeClass(["ui-datepicker__month",{"ui-datepicker__month--selected":Be===ge.value,"ui-datepicker__month--current":Be===i.unref(N).getMonth()&&ee.value===i.unref(N).getFullYear()}]),disabled:Te(Be),onClick:Wt=>V(Be)},i.toDisplayString(J),11,$b))),128))])):(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createElementVNode("div",Tb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(be.value,J=>(i.openBlock(),i.createElementBlock("span",{key:J,class:"ui-datepicker__weekday",role:"columnheader",abbr:J},i.toDisplayString(J),9,Ib))),128))]),i.createElementVNode("div",{ref_key:"calendarRef",ref:l,id:m.value,class:"ui-datepicker__grid",role:"grid","aria-label":`${fe.value} ${ee.value}`,onKeydown:H},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(D.value,(J,Be)=>(i.openBlock(),i.createElementBlock("button",{key:Be,type:"button",class:i.normalizeClass(["ui-datepicker__day",[{"ui-datepicker__day--other-month":!J.currentMonth,"ui-datepicker__day--selected":tt(J),"ui-datepicker__day--today":I(J),"ui-datepicker__day--disabled":De(J)},U(J)?`ui-datepicker__day--range-${U(J)}`:""]]),role:"gridcell",disabled:De(J),"aria-selected":tt(J)||void 0,"aria-current":I(J)?"date":void 0,"aria-disabled":De(J)||void 0,tabindex:Be===Xl()?0:-1,onClick:Wt=>me(J)},i.toDisplayString(J.day),11,zb))),128))],40,Lb),n.mode==="range"&&$.value==="selecting"?(i.openBlock(),i.createElementBlock("div",Nb," Select end date ")):i.createCommentVNode("",!0)],64))])])])):i.createCommentVNode("",!0)]),_:3})])),n.error||S.value?(i.openBlock(),i.createElementBlock("p",{key:3,id:f.value,class:"ui-datepicker-field__message ui-datepicker-field__message--error",role:"alert"},i.toDisplayString(n.error||S.value),9,Pb)):n.hint?(i.openBlock(),i.createElementBlock("p",{key:4,id:h.value,class:"ui-datepicker-field__message ui-datepicker-field__message--hint"},i.toDisplayString(n.hint),9,Ab)):i.createCommentVNode("",!0)],2)}}}),[["__scopeId","data-v-4075d941"]]),Ob=["id","aria-labelledby"],Fb={key:0,class:"ui-drawer__header"},Wb=["id"],Hb={class:"ui-drawer__body"},jb={key:1,class:"ui-drawer__footer"},Al='a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])',Yb=O(i.defineComponent({__name:"Drawer",props:{modelValue:{type:Boolean,default:!1},title:{},variant:{default:"default"},placement:{default:"right"},size:{default:"md"},maskClosable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0}},emits:["update:modelValue","open","close"],setup(n,{expose:e,emit:t}){const o=n,a=t,s=i.ref(null),l=ye("drawer"),r=ye("drawer-title"),c=i.computed({get:()=>o.modelValue,set:x=>a("update:modelValue",x)}),d=i.ref(!1);function u(){d.value=window.innerWidth<640}i.onMounted(()=>{u(),window.addEventListener("resize",u)}),i.onUnmounted(()=>{window.removeEventListener("resize",u)});const h=i.computed(()=>d.value?"bottom":o.placement),f=i.computed(()=>c.value);Tn(f);function m(x){if(!s.value||x.key!=="Tab")return;const S=s.value.querySelectorAll(Al);if(S.length===0)return;const w=S[0],M=S[S.length-1];x.shiftKey?document.activeElement===w&&(x.preventDefault(),M.focus()):document.activeElement===M&&(x.preventDefault(),w.focus())}function p(){s.value&&i.nextTick(()=>{var S;const x=(S=s.value)==null?void 0:S.querySelector(Al);x==null||x.focus()})}let g=null;function b(){g=document.activeElement,a("open"),i.nextTick(()=>{p(),window.addEventListener("keydown",m)})}function _(){c.value=!1,window.removeEventListener("keydown",m),a("close"),i.nextTick(()=>{g==null||g.focus()})}function k(){o.maskClosable&&_()}function B(x){x.key==="Escape"&&o.closeOnEscape&&(x.preventDefault(),_())}i.watch(c,x=>{x&&b()}),i.onUnmounted(()=>{window.removeEventListener("keydown",m)});const C=i.computed(()=>["ui-drawer__panel",`ui-drawer__panel--${h.value}`,`ui-drawer__panel--${o.variant}`,`ui-drawer__panel--${o.size}`,{"ui-drawer__panel--mobile":d.value}]),y=i.computed(()=>`ui-drawer-${h.value}`);return e({close:_}),(x,S)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:y.value},{default:i.withCtx(()=>[c.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-drawer",onKeydown:B},[i.createElementVNode("div",{class:"ui-drawer__backdrop",onClick:k}),i.createElementVNode("div",{ref_key:"drawerRef",ref:s,class:i.normalizeClass(C.value),id:i.unref(l),role:"dialog","aria-modal":"true","aria-labelledby":n.title?i.unref(r):void 0},[n.title||n.showClose||x.$slots.header?(i.openBlock(),i.createElementBlock("header",Fb,[i.renderSlot(x.$slots,"header",{},()=>[n.title?(i.openBlock(),i.createElementBlock("h2",{key:0,id:i.unref(r),class:"ui-drawer__title"},i.toDisplayString(n.title),9,Wb)):i.createCommentVNode("",!0)],!0),n.showClose?(i.openBlock(),i.createElementBlock("button",{key:0,type:"button",class:"ui-drawer__close","aria-label":"Close drawer",onClick:_},[...S[0]||(S[0]=[i.createElementVNode("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[i.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("div",Hb,[i.renderSlot(x.$slots,"default",{},void 0,!0)]),x.$slots.footer?(i.openBlock(),i.createElementBlock("footer",jb,[i.renderSlot(x.$slots,"footer",{close:_},void 0,!0)])):i.createCommentVNode("",!0)],10,Ob)],32)):i.createCommentVNode("",!0)]),_:3},8,["name"])]))}}),[["__scopeId","data-v-71721004"]]),Ub=["for"],Xb={key:0,class:"ui-combobox__required","aria-hidden":"true"},Kb=["onClick"],qb={key:0,class:"ui-combobox__overflow"},Gb=["id","value","placeholder","disabled","aria-expanded","aria-controls","aria-activedescendant","aria-invalid","aria-describedby","aria-required"],Jb=["name","multiple","required","disabled"],Zb={key:0,value:"",disabled:""},Qb=["value","selected","disabled"],e_=["id","aria-labelledby","aria-multiselectable"],t_={key:0,class:"ui-combobox__empty"},n_=["id","aria-selected","aria-disabled","onMouseenter","onClick"],i_={key:0,class:"ui-combobox__checkbox"},o_={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.5"},a_=["innerHTML"],s_={key:1,class:"ui-combobox__check",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},l_=["id"],r_=["id"],c_=O(i.defineComponent({__name:"Combobox",props:{modelValue:{default:null},options:{},multiple:{type:Boolean,default:!1},label:{},placeholder:{default:"Search..."},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},block:{type:Boolean,default:!1},allowCreate:{type:Boolean,default:!1},maxDisplayedChips:{default:3},id:{},name:{}},emits:["update:modelValue","create"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(null),s=i.ref(null),l=i.ref(null),r=i.ref(!1),c=i.ref(""),d=i.ref(-1),u=i.ref(-1),h=ye("combobox"),f=i.computed(()=>t.id||h),m=i.computed(()=>`${f.value}-listbox`),p=i.computed(()=>`${f.value}-hint`),g=i.computed(()=>`${f.value}-error`);function b(F){return`${f.value}-option-${F}`}const _=i.computed(()=>{if(t.error)return g.value;if(t.hint)return p.value}),k=i.computed(()=>t.modelValue===null||t.modelValue===void 0?[]:Array.isArray(t.modelValue)?t.modelValue:[t.modelValue]),B=i.computed(()=>k.value.map(F=>t.options.find(v=>v.value===F)).filter(F=>F!==void 0)),C=i.computed(()=>{const F=c.value.toLowerCase().trim();return F?t.options.filter(v=>v.label.toLowerCase().includes(F)):t.options}),y=i.computed(()=>{if(!t.allowCreate)return!1;const F=c.value.trim();return F?!t.options.some(D=>D.label.toLowerCase()===F.toLowerCase()):!1}),x=i.computed(()=>{if(!(!r.value||d.value<0))return b(d.value)}),S=i.ref({});function w(){if(!a.value)return;const F=a.value.getBoundingClientRect();S.value={position:"fixed",top:`${F.bottom+4}px`,left:`${F.left}px`,minWidth:`${F.width}px`,maxWidth:`${Math.max(F.width,300)}px`}}function M(){t.disabled||r.value||(r.value=!0,w(),d.value=C.value.findIndex(F=>!F.disabled),u.value=-1,document.addEventListener("mousedown",T),window.addEventListener("resize",N),window.addEventListener("scroll",w,!0))}function N(){r.value&&(r.value=!1,d.value=-1,u.value=-1,!t.multiple&&B.value.length>0?c.value=B.value[0].label:t.multiple||(c.value=""),document.removeEventListener("mousedown",T),window.removeEventListener("resize",N),window.removeEventListener("scroll",w,!0))}function T(F){var D,G;const v=F.target;(D=a.value)!=null&&D.contains(v)||(G=l.value)!=null&&G.contains(v)||N()}function $(F){const v=F.target;c.value=v.value,u.value=-1,r.value?(d.value=C.value.findIndex(D=>!D.disabled),i.nextTick(q)):M()}function K(){var F;(F=s.value)==null||F.select(),!r.value&&!t.disabled&&M()}function P(F){var v;if(!F.disabled)if(t.multiple){const D=[...k.value],G=D.indexOf(F.value);G>=0?D.splice(G,1):D.push(F.value),o("update:modelValue",D),c.value="",(v=s.value)==null||v.focus()}else o("update:modelValue",F.value),c.value=F.label,N()}function A(F,v){var G;v==null||v.stopPropagation();const D=k.value.filter(ce=>ce!==F);o("update:modelValue",D.length>0?D:null),(G=s.value)==null||G.focus()}function R(){const F=c.value.trim();F&&(o("create",F),c.value="",t.multiple||N())}function q(){if(!l.value||d.value<0)return;const F=l.value.children[d.value];F==null||F.scrollIntoView({block:"nearest"})}function Q(F){var G,ce;const v=C.value.length;if(v===0)return;let D=d.value;do D=(D+F+v)%v;while((G=C.value[D])!=null&&G.disabled&&D!==d.value);(ce=C.value[D])!=null&&ce.disabled||(d.value=D,i.nextTick(q))}function ee(F){switch(F.key){case"ArrowDown":F.preventDefault(),r.value?Q(1):M();break;case"ArrowUp":F.preventDefault(),r.value?Q(-1):M();break;case"Enter":F.preventDefault(),r.value&&d.value>=0&&C.value[d.value]?P(C.value[d.value]):y.value&&R();break;case"Escape":F.preventDefault(),N();break;case"Backspace":if(t.multiple&&c.value===""&&k.value.length>0){F.preventDefault();const v=k.value.length-1;u.value===v?(A(k.value[v]),u.value=-1):u.value=v}break;case"Home":r.value&&(F.preventDefault(),d.value=C.value.findIndex(v=>!v.disabled),i.nextTick(q));break;case"End":if(r.value){F.preventDefault();for(let v=C.value.length-1;v>=0;v--)if(!C.value[v].disabled){d.value=v;break}i.nextTick(q)}break;case"Tab":N();break}}function ge(F){const v=c.value.trim();if(!v)return F;const D=new RegExp(`(${v.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi");return F.replace(D,"<mark>$1</mark>")}function fe(F){return k.value.includes(F)}const be=i.computed(()=>t.multiple?B.value.slice(0,t.maxDisplayedChips):[]),xe=i.computed(()=>t.multiple?Math.max(0,B.value.length-t.maxDisplayedChips):0);return i.watch(()=>t.modelValue,F=>{if(!t.multiple&&F!==null&&F!==void 0){const v=t.options.find(D=>D.value===F);v&&(c.value=v.label)}},{immediate:!0}),i.onBeforeUnmount(()=>{document.removeEventListener("mousedown",T),window.removeEventListener("resize",N),window.removeEventListener("scroll",w,!0)}),(F,v)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-combobox",[`ui-combobox--${n.size}`,{"ui-combobox--block":n.block,"ui-combobox--disabled":n.disabled,"ui-combobox--error":n.error,"ui-combobox--open":r.value,"ui-combobox--multiple":n.multiple}]])},[n.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:f.value,class:"ui-combobox__label"},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),n.required?(i.openBlock(),i.createElementBlock("span",Xb,"*")):i.createCommentVNode("",!0)],8,Ub)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"containerRef",ref:a,class:i.normalizeClass(["ui-combobox__trigger",[`ui-combobox__trigger--${n.size}`,{"ui-combobox__trigger--error":n.error,"ui-combobox__trigger--multiple":n.multiple}]]),onClick:v[0]||(v[0]=D=>{var G;return(G=s.value)==null?void 0:G.focus()})},[n.multiple?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(be.value,(D,G)=>(i.openBlock(),i.createElementBlock("span",{key:D.value,class:i.normalizeClass(["ui-combobox__chip",{"ui-combobox__chip--marked":u.value===k.value.indexOf(D.value)}])},[i.createTextVNode(i.toDisplayString(D.label)+" ",1),i.createElementVNode("button",{type:"button",class:"ui-combobox__chip-remove",tabindex:"-1","aria-label":"Remove",onClick:ce=>A(D.value,ce)},[...v[1]||(v[1]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[i.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12"})],-1)])],8,Kb)],2))),128)),xe.value>0?(i.openBlock(),i.createElementBlock("span",qb," +"+i.toDisplayString(xe.value),1)):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),i.createElementVNode("input",{id:f.value,ref_key:"inputRef",ref:s,type:"text",role:"combobox",class:"ui-combobox__input",value:c.value,placeholder:n.multiple&&k.value.length>0?"":n.placeholder,disabled:n.disabled,"aria-expanded":r.value,"aria-controls":m.value,"aria-activedescendant":x.value,"aria-invalid":n.error?"true":void 0,"aria-describedby":_.value,"aria-required":n.required,"aria-autocomplete":"list",autocomplete:"off",onInput:$,onFocus:K,onKeydown:ee},null,40,Gb),(i.openBlock(),i.createElementBlock("svg",{class:i.normalizeClass(["ui-combobox__chevron",{"ui-combobox__chevron--open":r.value}]),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","aria-hidden":"true"},[...v[2]||(v[2]=[i.createElementVNode("path",{d:"M6 9l6 6 6-6"},null,-1)])],2))],2),n.name?(i.openBlock(),i.createElementBlock("select",{key:1,name:n.name,multiple:n.multiple,required:n.required,disabled:n.disabled,class:"ui-combobox__native",tabindex:"-1","aria-hidden":"true"},[n.multiple?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("option",Zb,i.toDisplayString(n.placeholder),1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.options,D=>(i.openBlock(),i.createElementBlock("option",{key:D.value,value:D.value,selected:fe(D.value),disabled:D.disabled},i.toDisplayString(D.label),9,Qb))),128))],8,Jb)):i.createCommentVNode("",!0),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:"ui-combobox-menu"},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("ul",{key:0,id:m.value,ref_key:"listboxRef",ref:l,role:"listbox",class:i.normalizeClass(["ui-combobox__listbox",{"ui-combobox__listbox--multi":n.multiple}]),style:i.normalizeStyle(S.value),"aria-labelledby":f.value,"aria-multiselectable":n.multiple},[C.value.length===0&&!y.value?(i.openBlock(),i.createElementBlock("li",t_," No results found ")):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(C.value,(D,G)=>(i.openBlock(),i.createElementBlock("li",{key:D.value,id:b(G),role:"option",class:i.normalizeClass(["ui-combobox__option",{"ui-combobox__option--selected":fe(D.value),"ui-combobox__option--highlighted":G===d.value,"ui-combobox__option--disabled":D.disabled}]),"aria-selected":fe(D.value),"aria-disabled":D.disabled,onMouseenter:ce=>!D.disabled&&(d.value=G),onClick:ce=>P(D)},[n.multiple?(i.openBlock(),i.createElementBlock("span",i_,[fe(D.value)?(i.openBlock(),i.createElementBlock("svg",o_,[...v[3]||(v[3]=[i.createElementVNode("path",{d:"M5 12l5 5L20 7"},null,-1)])])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:"ui-combobox__option-label",innerHTML:ge(D.label)},null,8,a_),!n.multiple&&fe(D.value)?(i.openBlock(),i.createElementBlock("svg",s_,[...v[4]||(v[4]=[i.createElementVNode("path",{d:"M5 12l5 5L20 7"},null,-1)])])):i.createCommentVNode("",!0)],42,n_))),128)),y.value?(i.openBlock(),i.createElementBlock("li",{key:1,class:i.normalizeClass(["ui-combobox__option ui-combobox__option--create",{"ui-combobox__option--highlighted":C.value.length===0}]),onClick:R},[v[5]||(v[5]=i.createTextVNode(' Create "',-1)),i.createElementVNode("strong",null,i.toDisplayString(c.value.trim()),1),v[6]||(v[6]=i.createTextVNode('" ',-1))],2)):i.createCommentVNode("",!0)],14,e_)):i.createCommentVNode("",!0)]),_:1})])),n.error?(i.openBlock(),i.createElementBlock("p",{key:2,id:g.value,class:"ui-combobox__message ui-combobox__message--error",role:"alert"},i.toDisplayString(n.error),9,l_)):n.hint?(i.openBlock(),i.createElementBlock("p",{key:3,id:p.value,class:"ui-combobox__message ui-combobox__message--hint"},i.toDisplayString(n.hint),9,r_)):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-b1b692de"]]),d_=["id","checked","disabled"],u_={class:"ui-choice-chip__label"},h_=O(i.defineComponent({__name:"ChoiceChip",props:{modelValue:{type:Boolean},value:{},label:{},icon:{},disabled:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,o=e,a=i.inject("choiceChipGroup",null),s=i.computed(()=>a!==null&&t.value!==void 0),l=i.computed(()=>t.disabled||(a==null?void 0:a.disabled)),r=i.computed(()=>{if(s.value&&a&&t.value!==void 0){const u=a.modelValue.value;return Array.isArray(u)?u.includes(t.value):u===t.value}return t.modelValue??!1}),c=ye("chip");function d(){if(!l.value)if(s.value&&a&&t.value!==void 0)a.toggle(t.value);else{const u=!t.modelValue;o("update:modelValue",u),o("change",u)}}return(u,h)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ui-choice-chip",{"ui-choice-chip--selected":r.value,"ui-choice-chip--disabled":l.value}])},[i.createElementVNode("input",{id:i.unref(c),type:"checkbox",checked:r.value,disabled:l.value,class:"ui-choice-chip__input",onChange:d},null,40,d_),h[0]||(h[0]=i.createElementVNode("span",{class:"ui-choice-chip__check","aria-hidden":"true"},[i.createElementVNode("svg",{class:"ui-choice-chip__check-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round"},[i.createElementVNode("path",{d:"M3.5 8.5L6.5 11L12.5 5"})])],-1)),n.icon?(i.openBlock(),i.createBlock(je,{key:0,icon:n.icon,class:"ui-choice-chip__icon"},null,8,["icon"])):i.createCommentVNode("",!0),i.createElementVNode("span",u_,i.toDisplayString(n.label),1)],2))}}),[["__scopeId","data-v-f6532f10"]]),f_=["aria-label","aria-disabled"],m_=O(i.defineComponent({__name:"ChoiceChipGroup",props:{modelValue:{},type:{default:"multiple"},disabled:{type:Boolean,default:!1},label:{}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,o=e;function a(s){if(t.type==="single"){const l=t.modelValue===s?void 0:s;o("update:modelValue",l),o("change",l)}else{const l=Array.isArray(t.modelValue)?t.modelValue:[],r=l.includes(s)?l.filter(c=>c!==s):[...l,s];o("update:modelValue",r),o("change",r)}}return i.provide("choiceChipGroup",{modelValue:i.toRef(t,"modelValue"),toggle:a,type:t.type,disabled:t.disabled}),(s,l)=>(i.openBlock(),i.createElementBlock("div",{role:"group","aria-label":n.label,"aria-disabled":n.disabled||void 0,class:i.normalizeClass(["ui-choice-chip-group",{"ui-choice-chip-group--disabled":n.disabled}])},[i.renderSlot(s.$slots,"default",{},void 0,!0)],10,f_))}}),[["__scopeId","data-v-3bf6d709"]]),p_=["for"],g_=["aria-disabled","aria-describedby"],b_=["id","accept","multiple","disabled"],__={class:"ui-file-upload__content"},y_={class:"ui-file-upload__text"},k_={key:0,class:"ui-file-upload__drop-text"},x_={key:0,class:"ui-file-upload__secondary-text"},w_={key:0,class:"ui-file-upload__paste-indicator"},C_={key:1,class:"ui-file-upload__list",role:"list"},B_={class:"ui-file-upload__file-preview"},S_=["src","alt"],E_=["data-type"],M_={class:"ui-file-upload__file-info"},v_={class:"ui-file-upload__file-name"},V_={class:"ui-file-upload__file-meta"},D_={class:"ui-file-upload__file-error"},$_={key:0,class:"ui-file-upload__progress"},T_={class:"ui-file-upload__file-status"},I_={key:0,class:"ui-file-upload__status-icon ui-file-upload__status-icon--success",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},L_={key:1,class:"ui-file-upload__status-icon ui-file-upload__status-icon--error",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},z_={key:2,class:"ui-file-upload__spinner"},N_={key:0,class:"ui-file-upload__actions"},P_=["id"],A_=["id"],R_=O(i.defineComponent({__name:"FileUpload",props:{modelValue:{default:()=>[]},accept:{},multiple:{type:Boolean,default:!1},maxSize:{},maxFiles:{},disabled:{type:Boolean,default:!1},label:{},hint:{},error:{},showPreviews:{type:Boolean,default:!0},compact:{type:Boolean,default:!1},allowPaste:{type:Boolean,default:!0}},emits:["update:modelValue","files-added","file-removed","file-rejected","files-pasted","file-replaced"],setup(n,{expose:e,emit:t}){const o=n,a=t,s=i.ref(null),l=i.ref(null),r=i.ref(null),c=i.ref(!1),d=i.ref(0),u=i.ref(!1),h=i.ref(!1),f=i.ref(!1),m=ye("file-upload"),p=i.computed(()=>m),g=i.computed(()=>`${m}-hint`),b=i.computed(()=>`${m}-error`),_=i.computed(()=>{if(o.error)return b.value;if(o.hint)return g.value}),k=i.ref(new Map);function B(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function C(L){if(L===0)return"0 B";const j=1024,X=["B","KB","MB","GB"],ne=Math.floor(Math.log(L)/Math.log(j));return`${parseFloat((L/Math.pow(j,ne)).toFixed(1))} ${X[ne]}`}function y(L){if(!o.accept)return!0;const j=o.accept.split(",").map(X=>X.trim().toLowerCase());for(const X of j){if(X===L.type.toLowerCase())return!0;if(X.endsWith("/*")){const ne=X.slice(0,-2);if(L.type.toLowerCase().startsWith(ne+"/"))return!0}if(X.startsWith(".")&&L.name.toLowerCase().slice(L.name.lastIndexOf("."))===X)return!0}return!1}function x(L){return y(L)?o.maxSize&&L.size>o.maxSize?`File exceeds maximum size of ${C(o.maxSize)}`:null:`File type "${L.type||"unknown"}" is not accepted`}function S(L){return!o.showPreviews||!L.type.startsWith("image/")?void 0:URL.createObjectURL(L)}function w(L){const j=Array.from(L),X=o.modelValue.length,ne=[];for(const he of j){if(o.maxFiles&&X+ne.length>=o.maxFiles){a("file-rejected",he,`Maximum ${o.maxFiles} files allowed`);continue}const Ae=x(he);if(Ae){a("file-rejected",he,Ae);continue}const Re=B(),Ye=S(he);Ye&&k.value.set(Re,Ye),ne.push({id:Re,file:he,name:he.name,size:he.size,type:he.type,preview:Ye,progress:0,status:"pending"})}if(ne.length>0){const he=o.multiple?[...o.modelValue,...ne]:ne.slice(0,1);a("update:modelValue",he),a("files-added",ne)}return ne}function M(L){const j=L.target;j.files&&j.files.length>0&&(r.value?N(j.files[0]):w(j.files)),j.value="",r.value=null}function N(L){if(!r.value)return;const j=o.modelValue.findIndex(Z=>Z.id===r.value);if(j===-1)return;const X=o.modelValue[j],ne=x(L);if(ne){a("file-rejected",L,ne);return}const he=k.value.get(X.id);he&&(URL.revokeObjectURL(he),k.value.delete(X.id));const Ae=B(),Re=S(L);Re&&k.value.set(Ae,Re);const Ye={id:Ae,file:L,name:L.name,size:L.size,type:L.type,preview:Re,progress:0,status:"pending"},V=[...o.modelValue];V[j]=Ye,a("update:modelValue",V),a("file-replaced",X,Ye)}function T(L){const j=k.value.get(L.id);j&&(URL.revokeObjectURL(j),k.value.delete(L.id));const X=o.modelValue.filter(ne=>ne.id!==L.id);a("update:modelValue",X),a("file-removed",L)}function $(L){var j;o.disabled||(r.value=L.id,(j=s.value)==null||j.click())}function K(){var L;o.disabled||(L=s.value)==null||L.click()}function P(L){(L.key==="Enter"||L.key===" ")&&(L.preventDefault(),K())}function A(L){L.preventDefault(),!o.disabled&&(d.value++,c.value=!0)}function R(L){L.preventDefault()}function q(L){L.preventDefault(),!o.disabled&&(d.value--,d.value===0&&(c.value=!1))}function Q(L){var j;L.preventDefault(),!o.disabled&&(d.value=0,c.value=!1,(j=L.dataTransfer)!=null&&j.files&&L.dataTransfer.files.length>0&&w(L.dataTransfer.files))}function ee(){h.value=!0}function ge(){h.value=!1}function fe(){f.value=!0}function be(){f.value=!1}function xe(L){var ne;if(!o.allowPaste||o.disabled||!h.value&&!f.value)return;const j=(ne=L.clipboardData)==null?void 0:ne.items;if(!j)return;const X=[];for(const he of Array.from(j))if(he.kind==="file"){const Ae=he.getAsFile();Ae&&X.push(Ae)}if(X.length>0){const he=w(X);he.length>0&&(u.value=!0,setTimeout(()=>{u.value=!1},1500),a("files-pasted",he))}}function F(L,j){const X=o.modelValue.find(ne=>ne.id===L);X&&(X.progress=Math.min(100,Math.max(0,j)),X.status==="pending"&&(X.status="uploading"))}function v(L){const j=o.modelValue.find(X=>X.id===L);j&&(j.progress=100,j.status="success")}function D(L,j){const X=o.modelValue.find(ne=>ne.id===L);X&&(X.status="error",X.error=j)}function G(){for(const L of k.value.values())URL.revokeObjectURL(L);k.value.clear(),a("update:modelValue",[])}e({updateProgress:F,markSuccess:v,markError:D,clearAll:G,triggerInput:K,replaceFile:$}),i.onMounted(()=>{o.allowPaste&&document.addEventListener("paste",xe)}),i.watch(()=>o.allowPaste,L=>{L?document.addEventListener("paste",xe):document.removeEventListener("paste",xe)}),i.onBeforeUnmount(()=>{document.removeEventListener("paste",xe);for(const L of k.value.values())URL.revokeObjectURL(L);k.value.clear()}),i.watch(()=>o.modelValue,(L,j)=>{if(!j)return;const X=new Set(L.map(ne=>ne.id));for(const ne of j)if(!X.has(ne.id)){const he=k.value.get(ne.id);he&&(URL.revokeObjectURL(he),k.value.delete(ne.id))}},{deep:!0});const ce=i.computed(()=>o.modelValue.length>0);i.computed(()=>o.modelValue.some(L=>L.status==="uploading"));function ze(L){return L.startsWith("image/")?"image":L.startsWith("video/")?"video":L.startsWith("audio/")?"audio":L==="application/pdf"?"pdf":L.includes("spreadsheet")||L.includes("excel")?"spreadsheet":L.includes("document")||L.includes("word")?"document":L.includes("zip")||L.includes("compressed")?"archive":"file"}return(L,j)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-file-upload",{"ui-file-upload--disabled":n.disabled,"ui-file-upload--error":n.error,"ui-file-upload--compact":n.compact}])},[n.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:p.value,class:"ui-file-upload__label"},i.toDisplayString(n.label),9,p_)):i.createCommentVNode("",!0),i.createElementVNode("div",{ref_key:"dropzoneRef",ref:l,class:i.normalizeClass(["ui-file-upload__dropzone",{"ui-file-upload__dropzone--active":c.value,"ui-file-upload__dropzone--disabled":n.disabled,"ui-file-upload__dropzone--error":n.error,"ui-file-upload__dropzone--has-files":ce.value&&!n.compact}]),role:"button",tabindex:"0","aria-disabled":n.disabled,"aria-describedby":_.value,onClick:K,onKeydown:P,onDragenter:A,onDragover:R,onDragleave:q,onDrop:Q,onMouseenter:ee,onMouseleave:ge,onFocus:fe,onBlur:be},[i.createElementVNode("input",{id:p.value,ref_key:"inputRef",ref:s,type:"file",class:"ui-file-upload__input",accept:n.accept,multiple:n.multiple,disabled:n.disabled,tabindex:"-1",onChange:M},null,40,b_),i.createElementVNode("div",__,[j[1]||(j[1]=i.createElementVNode("div",{class:"ui-file-upload__icon","aria-hidden":"true"},[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[i.createElementVNode("path",{d:"M12 16V4m0 0l-4 4m4-4l4 4","stroke-linecap":"round","stroke-linejoin":"round"}),i.createElementVNode("path",{d:"M3 15v4a2 2 0 002 2h14a2 2 0 002-2v-4","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)),i.createElementVNode("div",y_,[c.value?(i.openBlock(),i.createElementBlock("span",k_," Drop files here ")):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[j[0]||(j[0]=i.createElementVNode("span",{class:"ui-file-upload__primary-text"},[i.createElementVNode("span",{class:"ui-file-upload__link"},"Click to upload"),i.createTextVNode(" or drag and drop ")],-1)),n.accept||n.maxSize||n.allowPaste?(i.openBlock(),i.createElementBlock("span",x_,[n.accept?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(i.toDisplayString(n.accept),1)],64)):i.createCommentVNode("",!0),n.accept&&(n.maxSize||n.allowPaste)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode(" · ")],64)):i.createCommentVNode("",!0),n.maxSize?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createTextVNode("Max "+i.toDisplayString(C(n.maxSize)),1)],64)):i.createCommentVNode("",!0),n.maxSize&&n.allowPaste?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[i.createTextVNode(" · ")],64)):i.createCommentVNode("",!0),n.allowPaste?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[i.createTextVNode("Paste (Ctrl+V)")],64)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],64))])]),i.createVNode(i.Transition,{name:"ui-file-upload-fade"},{default:i.withCtx(()=>[u.value?(i.openBlock(),i.createElementBlock("div",w_,[...j[2]||(j[2]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[i.createElementVNode("path",{d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2"}),i.createElementVNode("rect",{x:"9",y:"3",width:"6",height:"4",rx:"1"})],-1),i.createElementVNode("span",null,"Files pasted",-1)])])):i.createCommentVNode("",!0)]),_:1})],42,g_),ce.value?(i.openBlock(),i.createElementBlock("ul",C_,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.modelValue,X=>(i.openBlock(),i.createElementBlock("li",{key:X.id,class:i.normalizeClass(["ui-file-upload__file",{"ui-file-upload__file--uploading":X.status==="uploading","ui-file-upload__file--success":X.status==="success","ui-file-upload__file--error":X.status==="error"}])},[i.createElementVNode("div",B_,[X.preview?(i.openBlock(),i.createElementBlock("img",{key:0,src:X.preview,alt:X.name,class:"ui-file-upload__file-image"},null,8,S_)):(i.openBlock(),i.createElementBlock("div",{key:1,class:"ui-file-upload__file-icon","data-type":ze(X.type)},[...j[3]||(j[3]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5"},[i.createElementVNode("path",{d:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"}),i.createElementVNode("polyline",{points:"14 2 14 8 20 8"})],-1)])],8,E_))]),i.createElementVNode("div",M_,[i.createElementVNode("span",v_,i.toDisplayString(X.name),1),i.createElementVNode("span",V_,[i.createTextVNode(i.toDisplayString(C(X.size))+" ",1),X.status==="error"&&X.error?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[j[4]||(j[4]=i.createTextVNode(" · ",-1)),i.createElementVNode("span",D_,i.toDisplayString(X.error),1)],64)):X.status==="success"?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[j[5]||(j[5]=i.createTextVNode(" · ",-1)),j[6]||(j[6]=i.createElementVNode("span",{class:"ui-file-upload__file-success"},"Uploaded",-1))],64)):i.createCommentVNode("",!0)]),X.status==="uploading"?(i.openBlock(),i.createElementBlock("div",$_,[i.createElementVNode("div",{class:"ui-file-upload__progress-bar",style:i.normalizeStyle({width:`${X.progress}%`})},null,4)])):i.createCommentVNode("",!0)]),i.createElementVNode("div",T_,[X.status==="success"?(i.openBlock(),i.createElementBlock("svg",I_,[...j[7]||(j[7]=[i.createElementVNode("path",{d:"M5 12l5 5L20 7"},null,-1)])])):X.status==="error"?(i.openBlock(),i.createElementBlock("svg",L_,[...j[8]||(j[8]=[i.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),i.createElementVNode("line",{x1:"12",y1:"8",x2:"12",y2:"12"},null,-1),i.createElementVNode("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"},null,-1)])])):X.status==="uploading"?(i.openBlock(),i.createElementBlock("div",z_)):i.createCommentVNode("",!0)]),X.status!=="uploading"?(i.openBlock(),i.createElementBlock("div",N_,[i.createVNode(Je,{variant:"ghost",size:"xs","aria-label":`Replace ${X.name}`,onClick:i.withModifiers(ne=>$(X),["stop"])},{default:i.withCtx(()=>[...j[9]||(j[9]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",width:"16",height:"16"},[i.createElementVNode("path",{d:"M4 12v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l4 4m0 0l-4 4m4-4H9","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]),_:1},8,["aria-label","onClick"]),i.createVNode(Je,{variant:"ghost",size:"xs",class:"ui-file-upload__remove-btn","aria-label":`Remove ${X.name}`,onClick:i.withModifiers(ne=>T(X),["stop"])},{default:i.withCtx(()=>[...j[10]||(j[10]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.5",width:"16",height:"16"},[i.createElementVNode("path",{d:"M18 6L6 18M6 6l12 12","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]),_:1},8,["aria-label","onClick"])])):i.createCommentVNode("",!0)],2))),128))])):i.createCommentVNode("",!0),n.error?(i.openBlock(),i.createElementBlock("p",{key:2,id:b.value,class:"ui-file-upload__message ui-file-upload__message--error",role:"alert"},i.toDisplayString(n.error),9,P_)):n.hint?(i.openBlock(),i.createElementBlock("p",{key:3,id:g.value,class:"ui-file-upload__message ui-file-upload__message--hint"},i.toDisplayString(n.hint),9,A_)):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-d7977cee"]]),O_=O(i.defineComponent({__name:"Heading",props:{as:{default:"h2"},size:{default:"2xl"},align:{default:"left"},truncate:{type:Boolean}},setup(n){const e=n,t=i.computed(()=>["ui-heading",`ui-heading--${e.size}`,`ui-heading--${e.align}`,{"ui-heading--truncate":e.truncate}]);return(o,a)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{class:i.normalizeClass(t.value)},{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-e911d31f"]]),F_={class:"ui-modal__box"},W_={key:0,class:"ui-modal__header"},H_={class:"ui-modal__title"},j_={class:"ui-modal__body"},Y_={key:1,class:"ui-modal__footer"},U_=O(i.defineComponent({__name:"Modal",props:{modelValue:{type:Boolean,default:!1},title:{},size:{default:"md"},persistent:{type:Boolean,default:!1}},emits:["update:modelValue","close"],setup(n,{emit:e}){const t=n,o=e,a=i.useSlots(),s=i.ref(null),l=i.computed(()=>t.modelValue);Tn(l);function r(){o("update:modelValue",!1)}function c(m){t.persistent||m.target===s.value&&r()}function d(m){if(t.persistent){m.preventDefault();return}o("update:modelValue",!1)}function u(){o("update:modelValue",!1),o("close")}function h(m){const p=s.value;p&&(m&&!p.open?p.showModal():!m&&p.open&&p.close())}i.onMounted(()=>{t.modelValue&&h(!0)}),i.watch(()=>t.modelValue,m=>{h(m)});const f=()=>t.title||a.header;return(m,p)=>(i.openBlock(),i.createElementBlock("dialog",{ref_key:"dialogRef",ref:s,class:i.normalizeClass(["ui-modal",[`ui-modal--${n.size}`]]),onClick:c,onCancel:d,onClose:u},[i.createElementVNode("div",F_,[f()?(i.openBlock(),i.createElementBlock("header",W_,[i.renderSlot(m.$slots,"header",{},()=>[i.createElementVNode("h3",H_,i.toDisplayString(n.title),1)],!0),i.createElementVNode("button",{type:"button",class:"ui-modal__close","aria-label":"Close modal",onClick:r},[...p[0]||(p[0]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[i.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12"})],-1)])])])):i.createCommentVNode("",!0),i.createElementVNode("div",j_,[i.renderSlot(m.$slots,"default",{},void 0,!0)]),m.$slots.footer?(i.openBlock(),i.createElementBlock("footer",Y_,[i.renderSlot(m.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)])],34))}}),[["__scopeId","data-v-527b557c"]]),X_={class:"ui-progress-linear__track"},K_={key:0,class:"ui-progress-linear__value"},q_=["width","height","viewBox"],G_=["cx","cy","r","stroke-width"],J_=["cx","cy","r","stroke-width","stroke-dasharray","stroke-dashoffset"],Z_={key:0,class:"ui-progress-circular__value"},Q_=O(i.defineComponent({__name:"Progress",props:{value:{default:0},variant:{default:"linear"},size:{default:"md"},color:{default:"primary"},indeterminate:{type:Boolean,default:!1},striped:{type:Boolean,default:!1},animated:{type:Boolean,default:!1},showValue:{type:Boolean,default:!1},label:{},strokeWidth:{}},setup(n){const e=n,t=i.computed(()=>Math.min(100,Math.max(0,e.value))),o=i.computed(()=>["ui-progress-linear",`ui-progress-linear--${e.size}`,`ui-progress-linear--${e.color}`,{"ui-progress-linear--indeterminate":e.indeterminate,"ui-progress-linear--striped":e.striped&&!e.indeterminate,"ui-progress-linear--animated":e.animated&&e.striped&&!e.indeterminate}]),a=i.computed(()=>["ui-progress-circular",`ui-progress-circular--${e.size}`,`ui-progress-circular--${e.color}`,{"ui-progress-circular--indeterminate":e.indeterminate}]),s=i.computed(()=>({sm:32,md:48,lg:64})[e.size]),l=i.computed(()=>e.strokeWidth?e.strokeWidth:{sm:3,md:4,lg:5}[e.size]),r=i.computed(()=>(s.value-l.value)/2),c=i.computed(()=>2*Math.PI*r.value),d=i.computed(()=>c.value-t.value/100*c.value),u=i.computed(()=>{const f={role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-label":e.label};return e.indeterminate||(f["aria-valuenow"]=t.value),f}),h=i.computed(()=>({width:`${t.value}%`}));return(f,m)=>n.variant==="linear"?(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:0,class:o.value},u.value),[i.createElementVNode("div",X_,[i.createElementVNode("div",{class:"ui-progress-linear__indicator",style:i.normalizeStyle(n.indeterminate?void 0:h.value)},null,4)]),n.showValue&&!n.indeterminate?(i.openBlock(),i.createElementBlock("span",K_,i.toDisplayString(t.value)+"% ",1)):i.createCommentVNode("",!0)],16)):(i.openBlock(),i.createElementBlock("div",i.mergeProps({key:1,class:a.value},u.value),[(i.openBlock(),i.createElementBlock("svg",{width:s.value,height:s.value,viewBox:`0 0 ${s.value} ${s.value}`,class:"ui-progress-circular__svg"},[i.createElementVNode("circle",{class:"ui-progress-circular__track",cx:s.value/2,cy:s.value/2,r:r.value,fill:"none","stroke-width":l.value},null,8,G_),i.createElementVNode("circle",{class:"ui-progress-circular__indicator",cx:s.value/2,cy:s.value/2,r:r.value,fill:"none","stroke-width":l.value,"stroke-dasharray":c.value,"stroke-dashoffset":n.indeterminate?c.value*.75:d.value,"stroke-linecap":"round"},null,8,J_)],8,q_)),n.showValue&&!n.indeterminate?(i.openBlock(),i.createElementBlock("span",Z_,i.toDisplayString(t.value)+"% ",1)):i.createCommentVNode("",!0)],16))}}),[["__scopeId","data-v-3da63736"]]),ey=["id","checked","disabled","name","value"],ty={class:"ui-radio__box","aria-hidden":"true"},ny={key:0,class:"ui-radio__dot"},iy={key:0,class:"ui-radio__content"},oy={key:0,class:"ui-radio__label"},ay={key:1,class:"ui-radio__description"},sy=O(i.defineComponent({__name:"Radio",props:{modelValue:{type:[String,Number,Boolean]},value:{type:[String,Number,Boolean]},size:{default:"md"},disabled:{type:Boolean,default:!1},label:{},description:{},name:{},id:{}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,o=e,a=ye("radio"),s=i.computed(()=>t.id||a),l=i.computed(()=>t.modelValue===t.value);function r(){t.disabled||(o("update:modelValue",t.value),o("change",t.value))}return(c,d)=>(i.openBlock(),i.createElementBlock("label",{class:i.normalizeClass(["ui-radio",[`ui-radio--${n.size}`,{"ui-radio--disabled":n.disabled,"ui-radio--checked":l.value}]])},[i.createElementVNode("input",{id:s.value,type:"radio",checked:l.value,disabled:n.disabled,name:n.name,value:n.value,class:"ui-radio__input",onChange:r},null,40,ey),i.createElementVNode("span",ty,[l.value?(i.openBlock(),i.createElementBlock("span",ny)):i.createCommentVNode("",!0)]),n.label||n.description?(i.openBlock(),i.createElementBlock("span",iy,[n.label?(i.openBlock(),i.createElementBlock("span",oy,i.toDisplayString(n.label),1)):i.createCommentVNode("",!0),n.description?(i.openBlock(),i.createElementBlock("span",ay,i.toDisplayString(n.description),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-bc19dbee"]]),ly=["aria-label","aria-valuemax","aria-valuenow","aria-readonly","tabindex"],ry=["onMousemove","onClick"],cy=O(i.defineComponent({__name:"Rating",props:{modelValue:{},max:{default:5},readonly:{type:Boolean,default:!1},allowHalf:{type:Boolean,default:!1},size:{default:"md"},label:{default:"Rating"}},emits:["update:modelValue","hover"],setup(n,{emit:e}){const t=ve("star"),o=ve("starFilled"),a=n,s=e,l=i.ref(null),r=i.computed(()=>l.value??a.modelValue);function c(p){const g=r.value;return g>=p?"full":a.allowHalf&&g>=p-.5?"half":"empty"}function d(p,g){if(a.readonly)return;const _=p.currentTarget.getBoundingClientRect(),B=p.clientX-_.left<_.width/2;let C;a.allowHalf&&B?C=g-.5:C=g,l.value=C,s("hover",C)}function u(){l.value=null,s("hover",null)}function h(p,g){if(a.readonly)return;const _=p.currentTarget.getBoundingClientRect(),B=p.clientX-_.left<_.width/2;let C;a.allowHalf&&B?C=g-.5:C=g,s("update:modelValue",C)}function f(p){if(a.readonly)return;const g=a.allowHalf?.5:1;let b=a.modelValue;switch(p.key){case"ArrowRight":case"ArrowUp":p.preventDefault(),b=Math.min(a.modelValue+g,a.max);break;case"ArrowLeft":case"ArrowDown":p.preventDefault(),b=Math.max(a.modelValue-g,0);break;case"Home":p.preventDefault(),b=0;break;case"End":p.preventDefault(),b=a.max;break;default:return}b!==a.modelValue&&s("update:modelValue",b)}const m=i.computed(()=>{switch(a.size){case"sm":return"16px";case"lg":return"28px";default:return"22px"}});return(p,g)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-rating",[`ui-rating--${n.size}`,{"ui-rating--readonly":n.readonly}]]),role:"slider","aria-label":n.label,"aria-valuemin":0,"aria-valuemax":n.max,"aria-valuenow":n.modelValue,"aria-readonly":n.readonly||void 0,tabindex:n.readonly?-1:0,onMouseleave:u,onKeydown:f},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.max,b=>(i.openBlock(),i.createElementBlock("span",{key:b,class:i.normalizeClass(["ui-rating__star",[`ui-rating__star--${c(b)}`]]),onMousemove:_=>d(_,b),onClick:_=>h(_,b)},[i.createVNode(je,{icon:i.unref(t),size:m.value,class:"ui-rating__icon ui-rating__icon--empty"},null,8,["icon","size"]),i.createVNode(je,{icon:i.unref(o),size:m.value,class:"ui-rating__icon ui-rating__icon--filled"},null,8,["icon","size"])],42,ry))),128))],42,ly))}}),[["__scopeId","data-v-200913f2"]]),dy=["id","aria-label","aria-disabled"],uy=["aria-checked","disabled","tabindex","onClick","onKeydown"],hy=["name","value"],fy=O(i.defineComponent({__name:"SegmentedControl",props:{options:{},modelValue:{},size:{default:"md"},disabled:{type:Boolean,default:!1},label:{},name:{},id:{}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(null),s=i.ref([]),l=ye("segmented"),r=i.computed(()=>t.id||l),c=i.ref({transform:"translateX(0px)",width:"0px",opacity:0}),d=i.computed(()=>t.options.findIndex(p=>p.value===t.modelValue));function u(){const p=d.value;if(p===-1||!s.value[p]){c.value.opacity=0;return}const g=s.value[p],b=a.value;if(!b)return;const _=b.getBoundingClientRect(),B=g.getBoundingClientRect().left-_.left,C=g.offsetWidth;c.value={transform:`translateX(${B}px)`,width:`${C}px`,opacity:1}}i.watch(()=>t.modelValue,()=>{i.nextTick(u)}),i.watch(()=>t.options,()=>{i.nextTick(u)},{deep:!0}),i.onMounted(()=>{requestAnimationFrame(()=>{u()})});function h(p){t.disabled||p.disabled||(o("update:modelValue",p.value),o("change",p.value))}function f(p,g){const b=t.options.map((B,C)=>({opt:B,i:C})).filter(({opt:B})=>!B.disabled),_=b.findIndex(({i:B})=>B===g);if(_===-1)return;let k=-1;switch(p.key){case"ArrowRight":case"ArrowDown":p.preventDefault(),k=b[(_+1)%b.length].i;break;case"ArrowLeft":case"ArrowUp":p.preventDefault(),k=b[(_-1+b.length)%b.length].i;break;case"Home":p.preventDefault(),k=b[0].i;break;case"End":p.preventDefault(),k=b[b.length-1].i;break}k!==-1&&s.value[k]&&(s.value[k].focus(),h(t.options[k]))}function m(p,g){p&&(s.value[g]=p)}return(p,g)=>(i.openBlock(),i.createElementBlock("div",{ref_key:"containerRef",ref:a,id:r.value,role:"radiogroup","aria-label":n.label,"aria-disabled":n.disabled||void 0,class:i.normalizeClass(["ui-segmented",[`ui-segmented--${n.size}`,{"ui-segmented--disabled":n.disabled}]])},[i.createElementVNode("div",{class:"ui-segmented__glider",style:i.normalizeStyle(c.value),"aria-hidden":"true"},null,4),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.options,(b,_)=>(i.openBlock(),i.createElementBlock("button",{key:b.value,ref_for:!0,ref:k=>m(k,_),type:"button",role:"radio","aria-checked":n.modelValue===b.value,disabled:n.disabled||b.disabled,tabindex:n.modelValue===b.value?0:-1,class:i.normalizeClass(["ui-segmented__item",{"ui-segmented__item--selected":n.modelValue===b.value,"ui-segmented__item--disabled":b.disabled}]),onClick:k=>h(b),onKeydown:k=>f(k,_)},i.toDisplayString(b.label),43,uy))),128)),n.name?(i.openBlock(),i.createElementBlock("input",{key:0,type:"hidden",name:n.name,value:n.modelValue},null,8,hy)):i.createCommentVNode("",!0)],10,dy))}}),[["__scopeId","data-v-d2d81e0b"]]);function $o(n,e,t){return t===e?0:(n-e)/(t-e)*100}function my(n,e,t){return n/100*(t-e)+e}function vn(n,e,t){const o=n-t;return Math.round(o/e)*e+t}function Rt(n,e,t){return Math.min(Math.max(n,e),t)}function Rl(n,e,t,o,a){const s=(n-e.left)/e.width*100,l=Rt(s,0,100),r=my(l,t,o);return Rt(vn(r,a,t),t,o)}function py(n,e,t){const o=Math.abs(n-e),a=Math.abs(n-t);return o<=a?"min":"max"}const gy={key:0,class:"ui-slider__ticks"},by=["aria-valuemin","aria-valuemax","aria-valuenow","aria-disabled"],_y={key:0,class:"ui-slider__tooltip"},yy=["aria-valuemin","aria-valuemax","aria-valuenow","aria-disabled","aria-label"],ky={key:0,class:"ui-slider__tooltip"},xy=O(i.defineComponent({__name:"Slider",props:{modelValue:{},min:{default:0},max:{default:100},step:{default:1},disabled:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!1},showTicks:{type:Boolean,default:!1},size:{default:"md"}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(null),s=i.ref(!1),l=i.ref(null),r=i.computed(()=>Array.isArray(t.modelValue)),c=i.computed(()=>r.value?t.modelValue[0]:t.modelValue),d=i.computed(()=>r.value?t.modelValue[1]:t.modelValue),u=i.computed(()=>r.value?$o(c.value,t.min,t.max):0),h=i.computed(()=>$o(d.value,t.min,t.max)),f=i.computed(()=>r.value?{left:`${u.value}%`,right:`${100-h.value}%`}:{left:"0%",right:`${100-h.value}%`}),m=i.computed(()=>{if(!t.showTicks||t.step<=0)return[];const y=[],x=t.max-t.min,S=Math.floor(x/t.step);if(S>100||S<2)return[];for(let w=1;w<S;w++){const M=t.min+w*t.step;y.push($o(M,t.min,t.max))}return y});function p(y,x){r.value?o("update:modelValue",[y,x]):o("update:modelValue",x)}function g(y,x){r.value?o("change",[y,x]):o("change",x)}function b(y,x){if(t.disabled)return;y.preventDefault();const S=a.value;if(!S)return;const w=S.getBoundingClientRect(),M=Rl(y.clientX,w,t.min,t.max,t.step);x?l.value=x:r.value?l.value=py(M,c.value,d.value):l.value="max",s.value=!0,B(M),document.addEventListener("pointermove",_),document.addEventListener("pointerup",k)}function _(y){if(!s.value||!a.value)return;const x=a.value.getBoundingClientRect(),S=Rl(y.clientX,x,t.min,t.max,t.step);B(S)}function k(){s.value&&g(c.value,d.value),s.value=!1,l.value=null,document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",k)}function B(y){if(r.value)if(l.value==="min"){const x=Rt(y,t.min,d.value);p(x,d.value)}else{const x=Rt(y,c.value,t.max);p(c.value,x)}else p(t.min,y)}function C(y,x){if(t.disabled)return;const S=x==="min"?c.value:d.value;let w=S;switch(y.key){case"ArrowRight":case"ArrowUp":y.preventDefault(),w=vn(S+t.step,t.step,t.min);break;case"ArrowLeft":case"ArrowDown":y.preventDefault(),w=vn(S-t.step,t.step,t.min);break;case"Home":y.preventDefault(),w=t.min;break;case"End":y.preventDefault(),w=t.max;break;case"PageUp":y.preventDefault(),w=vn(S+t.step*10,t.step,t.min);break;case"PageDown":y.preventDefault(),w=vn(S-t.step*10,t.step,t.min);break;default:return}r.value?x==="min"?(w=Rt(w,t.min,d.value),p(w,d.value)):(w=Rt(w,c.value,t.max),p(c.value,w)):(w=Rt(w,t.min,t.max),p(t.min,w)),g(c.value,d.value)}return i.onUnmounted(()=>{document.removeEventListener("pointermove",_),document.removeEventListener("pointerup",k)}),(y,x)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-slider",[`ui-slider--${n.size}`,{"ui-slider--disabled":n.disabled,"ui-slider--dragging":s.value,"ui-slider--range":r.value}]])},[i.createElementVNode("div",{ref_key:"trackRef",ref:a,class:"ui-slider__track",onPointerdown:x[4]||(x[4]=S=>b(S))},[i.createElementVNode("div",{class:"ui-slider__range",style:i.normalizeStyle(f.value)},null,4),n.showTicks?(i.openBlock(),i.createElementBlock("div",gy,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(m.value,(S,w)=>(i.openBlock(),i.createElementBlock("span",{key:w,class:"ui-slider__tick",style:i.normalizeStyle({left:`${S}%`})},null,4))),128))])):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(["ui-slider__thumb",{"ui-slider__thumb--active":l.value==="min"}]),style:i.normalizeStyle({left:`${u.value}%`}),role:"slider",tabindex:"0","aria-valuemin":n.min,"aria-valuemax":d.value,"aria-valuenow":c.value,"aria-disabled":n.disabled||void 0,"aria-label":"Minimum value",onPointerdown:x[0]||(x[0]=i.withModifiers(S=>b(S,"min"),["stop"])),onKeydown:x[1]||(x[1]=S=>C(S,"min"))},[n.showTooltip&&s.value&&l.value==="min"?(i.openBlock(),i.createElementBlock("div",_y,i.toDisplayString(c.value),1)):i.createCommentVNode("",!0)],46,by)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ui-slider__thumb",{"ui-slider__thumb--active":l.value==="max"}]),style:i.normalizeStyle({left:`${h.value}%`}),role:"slider",tabindex:"0","aria-valuemin":r.value?c.value:n.min,"aria-valuemax":n.max,"aria-valuenow":d.value,"aria-disabled":n.disabled||void 0,"aria-label":r.value?"Maximum value":"Value",onPointerdown:x[2]||(x[2]=i.withModifiers(S=>b(S,"max"),["stop"])),onKeydown:x[3]||(x[3]=S=>C(S,"max"))},[n.showTooltip&&s.value&&l.value==="max"?(i.openBlock(),i.createElementBlock("div",ky,i.toDisplayString(d.value),1)):i.createCommentVNode("",!0)],46,yy)],544)],2))}}),[["__scopeId","data-v-55435b60"]]),wy={class:"ui-sidebar-layout__main"},Cy=O(i.defineComponent({__name:"SidebarLayout",props:{sidebarPosition:{default:"left"}},setup(n){return(e,t)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-sidebar-layout",[`ui-sidebar-layout--${n.sidebarPosition}`]])},[i.renderSlot(e.$slots,"sidebar",{},void 0,!0),i.createElementVNode("main",wy,[i.renderSlot(e.$slots,"default",{},void 0,!0)])],2))}}),[["__scopeId","data-v-12f99250"]]),Bi=Symbol("sidebar"),Ol=Symbol("sidebar-group"),By={key:0,class:"ui-sidebar__header"},Sy={class:"ui-sidebar__nav"},Ey={key:1,class:"ui-sidebar__footer"},My=O(i.defineComponent({__name:"SidebarRoot",props:{modelValue:{type:Boolean,default:!1},expandedWidth:{default:"240px"},collapsedWidth:{default:"64px"}},emits:["update:modelValue"],setup(n,{expose:e,emit:t}){const o=n,a=t,s=i.ref(o.modelValue);i.watch(()=>o.modelValue,u=>{s.value=u});const l=i.computed(()=>o.modelValue!==void 0),r=i.computed(()=>l.value?o.modelValue:s.value),c=i.computed(()=>r.value?o.collapsedWidth:o.expandedWidth);function d(){const u=!r.value;s.value=u,a("update:modelValue",u)}return i.provide(Bi,{collapsed:r,expandedWidth:i.toRef(o,"expandedWidth"),collapsedWidth:i.toRef(o,"collapsedWidth")}),e({toggle:d,collapsed:r}),(u,h)=>(i.openBlock(),i.createElementBlock("aside",{class:i.normalizeClass(["ui-sidebar",{"ui-sidebar--collapsed":r.value}]),style:i.normalizeStyle({"--sidebar-current-width":c.value}),role:"navigation"},[u.$slots.header?(i.openBlock(),i.createElementBlock("div",By,[i.renderSlot(u.$slots,"header",{},void 0,!0)])):i.createCommentVNode("",!0),i.createElementVNode("nav",Sy,[i.renderSlot(u.$slots,"default",{},void 0,!0)]),u.$slots.footer?(i.openBlock(),i.createElementBlock("div",Ey,[i.renderSlot(u.$slots,"footer",{},void 0,!0)])):i.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-765b4324"]]),vy=["aria-describedby"],Vy=["id"],Fl=O(i.defineComponent({__name:"Tooltip",props:{text:{},placement:{default:"top"},delay:{default:200},offset:{default:8},disabled:{type:Boolean,default:!1}},setup(n){const e=n,t=ye("tooltip"),o=i.ref(null),a=i.ref(null),s=i.ref(!1);let l=null,r=null;const{coords:c,updatePosition:d,getPlacement:u}=Wo(o,a,()=>e.placement,e.offset);function h(_){if(!o.value)return;const k=Fo(o.value,_,u(),e.offset);c.value=k}const f=i.computed(()=>({top:`${c.value.top}px`,left:`${c.value.left}px`})),m=i.computed(()=>`ui-tooltip__arrow--${c.value.actualPlacement}`);function p(){e.disabled||(r&&(clearTimeout(r),r=null),l&&clearTimeout(l),l=setTimeout(()=>{s.value=!0},e.delay))}function g(){l&&(clearTimeout(l),l=null),r=setTimeout(()=>{s.value=!1},50)}function b(_){_.key==="Escape"&&s.value&&g()}return i.onUnmounted(()=>{l&&clearTimeout(l),r&&clearTimeout(r)}),(_,k)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",{ref_key:"triggerRef",ref:o,class:"ui-tooltip-trigger","aria-describedby":s.value?i.unref(t):void 0,onMouseenter:p,onMouseleave:g,onFocusin:p,onFocusout:g,onKeydown:b},[i.renderSlot(_.$slots,"default",{},void 0,!0)],40,vy),(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createVNode(i.Transition,{name:`ui-tooltip-${i.unref(c).actualPlacement}`,onEnter:h},{default:i.withCtx(()=>[s.value&&!n.disabled?(i.openBlock(),i.createElementBlock("div",{key:0,id:i.unref(t),ref_key:"contentRef",ref:a,role:"tooltip",class:"ui-tooltip",style:i.normalizeStyle(f.value)},[i.createTextVNode(i.toDisplayString(n.text)+" ",1),i.createElementVNode("span",{class:i.normalizeClass(["ui-tooltip__arrow",m.value])},null,2)],12,Vy)):i.createCommentVNode("",!0)]),_:1},8,["name"])]))],64))}}),[["__scopeId","data-v-46895466"]]),Dy={key:0,class:"ui-sidebar-item__icon","aria-hidden":"true"},$y={class:"ui-sidebar-item__label"},Ty={key:1,class:"ui-sidebar-item__badge"},Iy=O(i.defineComponent({__name:"SidebarItem",props:{label:{},icon:{},active:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},as:{default:"button"},href:{},target:{},to:{}},setup(n){const e=n,t=i.inject(Bi);if(!t)throw new Error("SidebarItem must be used within SidebarRoot");const o=i.computed(()=>t.collapsed.value),a=i.computed(()=>["ui-sidebar-item",{"ui-sidebar-item--active":e.active,"ui-sidebar-item--disabled":e.disabled,"ui-sidebar-item--collapsed":o.value}]),s=i.computed(()=>{const l={class:a.value,disabled:e.disabled||void 0,"aria-current":e.active?"page":void 0,"aria-label":o.value?e.label:void 0};return e.href&&(l.href=e.disabled?void 0:e.href,l.target=e.target),e.to&&(l.to=e.disabled?void 0:e.to),l});return(l,r)=>(i.openBlock(),i.createBlock(Fl,{text:n.label,disabled:!o.value,placement:"right"},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),i.normalizeProps(i.guardReactiveProps(s.value)),{default:i.withCtx(()=>[n.icon?(i.openBlock(),i.createElementBlock("span",Dy,[i.createVNode(je,{icon:n.icon,size:"md"},null,8,["icon"])])):i.createCommentVNode("",!0),i.createElementVNode("span",$y,i.toDisplayString(n.label),1),l.$slots.badge?(i.openBlock(),i.createElementBlock("span",Ty,[i.renderSlot(l.$slots,"badge",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3},16))]),_:3},8,["text","disabled"]))}}),[["__scopeId","data-v-07758eb1"]]),Ly=["id"],zy=["aria-labelledby"],Ny=O(i.defineComponent({__name:"SidebarGroup",props:{label:{},showSeparator:{type:Boolean,default:!0}},setup(n){const e=n,t=i.inject(Bi);if(!t)throw new Error("SidebarGroup must be used within SidebarRoot");const o=ye("sidebar-group"),a=i.computed(()=>t.collapsed.value);i.provide(Ol,{groupId:o});const s=i.computed(()=>["ui-sidebar-group",{"ui-sidebar-group--collapsed":a.value,"ui-sidebar-group--separator":e.showSeparator&&a.value}]);return(l,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(s.value)},[n.label?(i.openBlock(),i.createElementBlock("div",{key:0,class:"ui-sidebar-group__label",id:i.unref(o)},i.toDisplayString(n.label),9,Ly)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"ui-sidebar-group__content","aria-labelledby":n.label?i.unref(o):void 0,role:"group"},[i.renderSlot(l.$slots,"default",{},void 0,!0)],8,zy)],2))}}),[["__scopeId","data-v-de5bdf6e"]]),qt=Symbol("stepper"),Vn=Symbol("stepper-item"),Py=["aria-orientation"],Ay=O(i.defineComponent({__name:"StepperRoot",props:{modelValue:{default:0},orientation:{default:"horizontal"},linear:{type:Boolean,default:!1},errorSteps:{default:()=>[]}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(t.modelValue),s=i.ref(0),l=i.ref(new Set);i.watch(()=>t.modelValue,m=>{a.value=m});const r=i.computed(()=>t.modelValue!==void 0),c=i.computed(()=>r.value?t.modelValue:a.value);function d(m){h(m)&&(a.value=m,o("update:modelValue",m))}function u(m){return t.errorSteps.includes(m)?"error":m<c.value?"completed":m===c.value?"current":"pending"}function h(m){return t.linear?m<=c.value+1:!0}function f(m){l.value.add(m),s.value=l.value.size}return i.provide(qt,{orientation:i.toRef(t,"orientation"),linear:i.toRef(t,"linear"),currentStep:c,goToStep:d,getStepState:u,canNavigateTo:h,registerStep:f,stepCount:s}),(m,p)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-stepper",[`ui-stepper--${n.orientation}`]]),role:"tablist","aria-orientation":n.orientation},[i.renderSlot(m.$slots,"default",{},void 0,!0)],10,Py))}}),[["__scopeId","data-v-947638ec"]]),Ry=["data-state"],Oy=O(i.defineComponent({__name:"StepperItem",props:{index:{},disabled:{type:Boolean,default:!1}},setup(n){const e=n,t=i.inject(qt);if(!t)throw new Error("StepperItem must be used within StepperRoot");const o=t,a=ye("stepper-trigger"),s=ye("stepper-content"),l=i.computed(()=>o.getStepState(e.index)),r=i.computed(()=>e.disabled||!o.canNavigateTo(e.index));function c(){r.value||o.goToStep(e.index)}i.onMounted(()=>{o.registerStep(e.index)}),i.provide(Vn,{index:e.index,state:l,isDisabled:r,triggerId:a,contentId:s,goToStep:c});const d=i.computed(()=>["ui-stepper__item",`ui-stepper__item--${o.orientation.value}`,`ui-stepper__item--${l.value}`,{"ui-stepper__item--disabled":r.value}]);return(u,h)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(d.value),"data-state":l.value},[i.renderSlot(u.$slots,"default",{},void 0,!0)],10,Ry))}}),[["__scopeId","data-v-0f21dabd"]]),Fy=["id","aria-selected","aria-controls","aria-disabled","disabled","tabindex"],Wy={class:"ui-stepper__label"},Hy=O(i.defineComponent({__name:"StepperTrigger",props:{icon:{}},setup(n){const e=i.inject(qt),t=i.inject(Vn);if(!e||!t)throw new Error("StepperTrigger must be used within StepperItem");const o=ve("check"),a=i.computed(()=>["ui-stepper__trigger",`ui-stepper__trigger--${t.state.value}`]),s=i.computed(()=>["ui-stepper__indicator",`ui-stepper__indicator--${t.state.value}`]);return(l,r)=>(i.openBlock(),i.createElementBlock("button",{id:i.unref(t).triggerId,class:i.normalizeClass(a.value),type:"button",role:"tab","aria-selected":i.unref(t).state.value==="current","aria-controls":i.unref(t).contentId,"aria-disabled":i.unref(t).isDisabled.value,disabled:i.unref(t).isDisabled.value,tabindex:i.unref(t).state.value==="current"?0:-1,onClick:r[0]||(r[0]=(...c)=>i.unref(t).goToStep&&i.unref(t).goToStep(...c))},[i.createElementVNode("span",{class:i.normalizeClass(s.value)},[i.renderSlot(l.$slots,"indicator",{},()=>[i.unref(t).state.value==="completed"?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(o)),{key:0,class:"ui-stepper__check-icon"})):n.icon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.icon),{key:1,class:"ui-stepper__custom-icon"})):(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createTextVNode(i.toDisplayString(i.unref(t).index+1),1)],64))],!0)],2),i.createElementVNode("span",Wy,[i.renderSlot(l.$slots,"default",{},void 0,!0)])],10,Fy))}}),[["__scopeId","data-v-6d18e954"]]),jy=["id","aria-labelledby","aria-hidden"],Yy=O(i.defineComponent({__name:"StepperContent",setup(n){const e=i.inject(qt),t=i.inject(Vn);if(!e||!t)throw new Error("StepperContent must be used within StepperItem");const o=i.computed(()=>t.state.value==="current"),a=i.computed(()=>["ui-stepper__content",`ui-stepper__content--${e.orientation.value}`,{"ui-stepper__content--active":o.value}]);return(s,l)=>i.withDirectives((i.openBlock(),i.createElementBlock("div",{id:i.unref(t).contentId,class:i.normalizeClass(a.value),role:"tabpanel","aria-labelledby":i.unref(t).triggerId,"aria-hidden":!o.value},[i.renderSlot(s.$slots,"default",{},void 0,!0)],10,jy)),[[i.vShow,o.value]])}}),[["__scopeId","data-v-6e79a9a5"]]),Uy=O(i.defineComponent({__name:"StepperSeparator",setup(n){const e=i.inject(qt),t=i.inject(Vn);if(!e||!t)throw new Error("StepperSeparator must be used within StepperItem");const o=i.computed(()=>t.state.value==="completed"),a=i.computed(()=>["ui-stepper__separator",`ui-stepper__separator--${e.orientation.value}`,{"ui-stepper__separator--completed":o.value}]);return(s,l)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(a.value),"aria-hidden":"true"},null,2))}}),[["__scopeId","data-v-b9092a20"]]),Xy=["id","aria-checked","aria-label","disabled"],Ky={class:"ui-switch__track","aria-hidden":"true"},qy={class:"ui-switch__thumb"},Gy=["name","checked","disabled"],Jy=O(i.defineComponent({__name:"Switch",props:{modelValue:{type:Boolean,default:!1},size:{default:"md"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},label:{},name:{},id:{}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,o=e,a=ye("switch"),s=i.computed(()=>t.id||a),l=i.computed(()=>t.disabled||t.loading);function r(){if(l.value)return;const h=!t.modelValue;o("update:modelValue",h),o("change",h)}function c(h){h.key==="Enter"&&(h.preventDefault(),r())}const d={sm:"0.625rem",md:"0.75rem",lg:"0.875rem"},u=i.computed(()=>d[t.size]);return(h,f)=>(i.openBlock(),i.createElementBlock("button",{id:s.value,type:"button",role:"switch","aria-checked":n.modelValue,"aria-label":n.label,disabled:l.value,class:i.normalizeClass(["ui-switch",[`ui-switch--${n.size}`,{"ui-switch--checked":n.modelValue,"ui-switch--disabled":l.value,"ui-switch--loading":n.loading}]]),onClick:r,onKeydown:c},[i.createElementVNode("span",Ky,[i.createElementVNode("span",qy,[n.loading?(i.openBlock(),i.createBlock(In,{key:0,size:u.value,class:"ui-switch__spinner"},null,8,["size"])):i.createCommentVNode("",!0)])]),n.name?(i.openBlock(),i.createElementBlock("input",{key:0,type:"checkbox",name:n.name,checked:n.modelValue,disabled:n.disabled,class:"ui-switch__input",tabindex:"-1","aria-hidden":"true"},null,8,Gy)):i.createCommentVNode("",!0)],42,Xy))}}),[["__scopeId","data-v-8f7786c9"]]),Zy={class:"ui-tabs"},Qy=["aria-selected","aria-controls","disabled","tabindex","onClick","onKeydown"],ek={class:"ui-tabs__panels"},tk=["id"],nk=O(i.defineComponent({__name:"Tabs",props:{modelValue:{},items:{},variant:{default:"line"},block:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(null),s=i.ref([]),l=i.ref({width:"0px",transform:"translateX(0px)"});let r=null;function c(){const f=t.items.findIndex(b=>b.value===t.modelValue);if(f===-1||!s.value[f])return;const m=s.value[f],p=m.offsetWidth,g=m.offsetLeft;l.value={width:`${p}px`,transform:`translateX(${g}px)`}}function d(f){f.disabled||o("update:modelValue",f.value)}function u(f,m){var C;const p=f.key==="ArrowRight",g=f.key==="ArrowLeft",b=f.key==="Home",_=f.key==="End";if(!p&&!g&&!b&&!_)return;f.preventDefault();let k;if(b)k=t.items.findIndex(y=>!y.disabled);else if(_)k=t.items.length-1-[...t.items].reverse().findIndex(y=>!y.disabled);else{const y=p?1:-1;k=m;do k=(k+y+t.items.length)%t.items.length;while(t.items[k].disabled&&k!==m)}const B=t.items[k];B.disabled||((C=s.value[k])==null||C.focus(),o("update:modelValue",B.value))}function h(f,m){f&&(s.value[m]=f)}return i.watch(()=>t.modelValue,async()=>{await i.nextTick(),c()}),i.onMounted(()=>{c(),r=new ResizeObserver(()=>{c()}),a.value&&r.observe(a.value),window.addEventListener("resize",c)}),i.onBeforeUnmount(()=>{r==null||r.disconnect(),window.removeEventListener("resize",c)}),(f,m)=>(i.openBlock(),i.createElementBlock("div",Zy,[i.createElementVNode("div",{ref_key:"tabListRef",ref:a,class:i.normalizeClass(["ui-tabs__list",[`ui-tabs__list--${n.variant}`,{"ui-tabs__list--block":n.block}]]),role:"tablist"},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.items,(p,g)=>(i.openBlock(),i.createElementBlock("button",{key:p.value,ref_for:!0,ref:b=>h(b,g),type:"button",role:"tab",class:i.normalizeClass(["ui-tabs__tab",{"ui-tabs__tab--active":n.modelValue===p.value}]),"aria-selected":n.modelValue===p.value,"aria-controls":`tabpanel-${p.value}`,disabled:p.disabled,tabindex:n.modelValue===p.value?0:-1,onClick:b=>d(p),onKeydown:b=>u(b,g)},[p.icon?(i.openBlock(),i.createBlock(je,{key:0,icon:p.icon,size:"sm",class:"ui-tabs__icon"},null,8,["icon"])):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(p.label),1)],42,Qy))),128)),i.createElementVNode("div",{class:"ui-tabs__indicator",style:i.normalizeStyle(l.value),"aria-hidden":"true"},null,4)],2),i.createElementVNode("div",ek,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(n.items,p=>i.withDirectives((i.openBlock(),i.createElementBlock("div",{key:p.value,id:`tabpanel-${p.value}`,role:"tabpanel",class:"ui-tabs__panel",tabindex:0},[i.renderSlot(f.$slots,p.value,{},void 0,!0)],8,tk)),[[i.vShow,n.modelValue===p.value]])),128))])]))}}),[["__scopeId","data-v-937bd79d"]]),ik=["for"],ok={key:0,class:"ui-textarea-field__required","aria-hidden":"true"},ak={key:0,class:"ui-textarea-wrapper__addon ui-textarea-wrapper__addon--left"},sk=["id","value","name","placeholder","disabled","readonly","required","rows","maxlength","aria-invalid","aria-describedby"],lk={class:"ui-textarea-field__footer"},rk={class:"ui-textarea-field__messages"},ck=["id"],dk=["id"],uk=["id"],hk=O(i.defineComponent({__name:"Textarea",props:{modelValue:{},label:{},placeholder:{},hint:{},error:{},rows:{default:3},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},autosize:{type:Boolean,default:!1},maxHeight:{},maxLength:{},showCount:{type:Boolean,default:!1},iconLeft:{},id:{},name:{},block:{type:Boolean,default:!1}},emits:["update:modelValue","focus","blur"],setup(n,{expose:e,emit:t}){const o=n,a=t,s=i.useSlots(),l=i.ref(null),r=ye("textarea"),c=i.computed(()=>o.id||r),d=i.computed(()=>`${c.value}-hint`),u=i.computed(()=>`${c.value}-error`),h=i.computed(()=>`${c.value}-counter`),f=i.computed(()=>{const S=[];return o.error?S.push(u.value):o.hint&&S.push(d.value),o.showCount&&o.maxLength&&S.push(h.value),S.length>0?S.join(" "):void 0}),m=i.computed(()=>o.iconLeft||s.left),p=i.computed(()=>(o.modelValue??"").length),g=i.computed(()=>o.maxLength?p.value>o.maxLength:!1),b=i.computed(()=>o.maxLength?p.value>=o.maxLength*.9:!1),_=i.computed(()=>o.maxLength?`${p.value} / ${o.maxLength}`:`${p.value}`),k=i.computed(()=>g.value?"error":b.value?"warning":"default");function B(){if(!o.autosize||!l.value)return;const S=l.value;S.style.height="auto";let w=S.scrollHeight;o.maxHeight&&w>o.maxHeight?(w=o.maxHeight,S.style.overflowY="auto"):S.style.overflowY="hidden",S.style.height=`${w}px`}function C(S){const w=S.target;a("update:modelValue",w.value),o.autosize&&B()}function y(S){a("focus",S)}function x(S){a("blur",S)}return i.watch(()=>o.modelValue,()=>{o.autosize&&i.nextTick(B)}),i.onMounted(()=>{o.autosize&&i.nextTick(B)}),e({focus:()=>{var S;return(S=l.value)==null?void 0:S.focus()},blur:()=>{var S;return(S=l.value)==null?void 0:S.blur()},select:()=>{var S;return(S=l.value)==null?void 0:S.select()}}),(S,w)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-textarea-field",{"ui-textarea-field--block":n.block,"ui-textarea-field--disabled":n.disabled,"ui-textarea-field--error":n.error||g.value,"ui-textarea-field--readonly":n.readonly}])},[n.label?(i.openBlock(),i.createElementBlock("label",{key:0,for:c.value,class:"ui-textarea-field__label"},[i.createTextVNode(i.toDisplayString(n.label)+" ",1),n.required?(i.openBlock(),i.createElementBlock("span",ok,"*")):i.createCommentVNode("",!0)],8,ik)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["ui-textarea-wrapper",{"ui-textarea-wrapper--disabled":n.disabled,"ui-textarea-wrapper--error":n.error||g.value,"ui-textarea-wrapper--readonly":n.readonly,"ui-textarea-wrapper--has-left":m.value,"ui-textarea-wrapper--autosize":n.autosize}])},[m.value?(i.openBlock(),i.createElementBlock("span",ak,[i.renderSlot(S.$slots,"left",{},()=>[n.iconLeft?(i.openBlock(),i.createBlock(je,{key:0,icon:n.iconLeft,size:"var(--text-md)"},null,8,["icon"])):i.createCommentVNode("",!0)],!0)])):i.createCommentVNode("",!0),i.createElementVNode("textarea",{id:c.value,ref_key:"textareaRef",ref:l,value:n.modelValue,name:n.name,placeholder:n.placeholder,disabled:n.disabled,readonly:n.readonly,required:n.required,rows:n.rows,maxlength:n.maxLength,"aria-invalid":n.error||g.value?"true":void 0,"aria-describedby":f.value,class:i.normalizeClass(["ui-textarea-wrapper__textarea",{"ui-textarea-wrapper__textarea--autosize":n.autosize}]),onInput:C,onFocus:y,onBlur:x},null,42,sk)],2),i.createElementVNode("div",lk,[i.createElementVNode("div",rk,[n.error?(i.openBlock(),i.createElementBlock("p",{key:0,id:u.value,class:"ui-textarea-field__message ui-textarea-field__message--error",role:"alert"},i.toDisplayString(n.error),9,ck)):n.hint?(i.openBlock(),i.createElementBlock("p",{key:1,id:d.value,class:"ui-textarea-field__message ui-textarea-field__message--hint"},i.toDisplayString(n.hint),9,dk)):i.createCommentVNode("",!0)]),n.showCount?(i.openBlock(),i.createElementBlock("span",{key:0,id:h.value,class:i.normalizeClass(["ui-textarea-field__counter",`ui-textarea-field__counter--${k.value}`]),"aria-live":"polite"},i.toDisplayString(_.value),11,uk)):i.createCommentVNode("",!0)])],2))}}),[["__scopeId","data-v-65afca71"]]),To=Symbol("timeline"),fk=O(i.defineComponent({__name:"Timeline",props:{align:{default:"left"},lineStyle:{default:"solid"}},setup(n){const e=n,t=i.ref(0);let o=0;i.onBeforeUpdate(()=>{o=0});function a(){const l=o++;return t.value=Math.max(t.value,l+1),l}i.provide(To,{align:i.toRef(e,"align"),lineStyle:i.toRef(e,"lineStyle"),registerItem:a,itemCount:t});const s=i.computed(()=>["ui-timeline",`ui-timeline--${e.align}`,`ui-timeline--line-${e.lineStyle}`]);return(l,r)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(s.value),role:"list"},[i.renderSlot(l.$slots,"default",{},void 0,!0)],2))}}),[["__scopeId","data-v-23e1c9a4"]]),mk={class:"ui-timeline__content"},pk={key:0,class:"ui-timeline__opposite"},gk=O(i.defineComponent({__name:"TimelineItem",props:{dotColor:{default:"primary"},dotIcon:{}},setup(n){const e=n,t=i.inject(To);if(!t)throw new Error("TimelineItem must be used within Timeline");const o=i.ref(-1);i.onMounted(()=>{o.value=t.registerItem()});const a=i.computed(()=>o.value===0),s=i.computed(()=>o.value===t.itemCount.value-1),l=i.computed(()=>t.align.value==="alternate"?o.value%2===0?"left":"right":t.align.value),r=i.computed(()=>["ui-timeline__item",`ui-timeline__item--${t.align.value}`,`ui-timeline__item--position-${l.value}`,{"ui-timeline__item--first":a.value,"ui-timeline__item--last":s.value}]),c=i.computed(()=>["ui-timeline__dot",`ui-timeline__dot--${e.dotColor}`]);return(d,u)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(r.value),role:"listitem"},[i.createElementVNode("div",{class:i.normalizeClass(c.value)},[i.renderSlot(d.$slots,"dot",{},()=>[n.dotIcon?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.dotIcon),{key:0,class:"ui-timeline__dot-icon"})):i.createCommentVNode("",!0)],!0)],2),i.createElementVNode("div",mk,[i.renderSlot(d.$slots,"default",{},void 0,!0)]),i.unref(t).align.value==="alternate"?(i.openBlock(),i.createElementBlock("div",pk,[i.renderSlot(d.$slots,"opposite",{},void 0,!0)])):i.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-276adb4d"]]);function Io(n){if(!n||typeof n!="string")return null;const e=n.toLowerCase().replace(/\s+/g,"").trim();if(!e)return null;const t=/p|pm$/.test(e),o=/a|am$/.test(e),a=e.replace(/[ap]m?$/i,"");let s=0,l=0;if(a.includes(":")){const r=a.split(":");s=parseInt(r[0],10),l=parseInt(r[1],10)||0}else{const r=parseInt(a,10);if(isNaN(r))return null;if(r<=12)s=r,l=0;else if(r<=99)s=Math.floor(r/10),l=r%10*10;else if(r<=2359)s=Math.floor(r/100),l=r%100;else return null}return isNaN(s)||isNaN(l)?null:(t&&s<12?s+=12:o&&s===12&&(s=0),s=Math.max(0,Math.min(23,s)),l=Math.max(0,Math.min(59,l)),{hours:s,minutes:l})}function Lo(n,e,t="24h"){const o=Math.max(0,Math.min(23,n)),a=Math.max(0,Math.min(59,e));if(t==="24h")return`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;const s=o>=12?"PM":"AM";return`${(o===0?12:o>12?o-12:o).toString().padStart(2,"0")}:${a.toString().padStart(2,"0")} ${s}`}function Si(n,e,t=1){const o=[];for(let a=n;a<=e;a+=t)o.push(a);return o}function zo(n){const e=n>=12?"PM":"AM";let t=n%12;return t===0&&(t=12),{hour:t,period:e}}function No(n,e){return e==="AM"?n===12?0:n:n===12?12:n+12}function Wl(n){if(!n||typeof n!="string")return!1;const e=n.match(/^(\d{1,2}):(\d{2})$/);if(!e)return!1;const t=parseInt(e[1],10),o=parseInt(e[2],10);return t>=0&&t<=23&&o>=0&&o<=59}const bk={class:"ui-timepicker__panel"},_k={class:"ui-timepicker__columns"},yk=["data-value","onClick"],kk=["data-value","onClick"],xk=["data-value","onClick"],Po=40,wk=5,Ck=O(i.defineComponent({__name:"TimePicker",props:{modelValue:{},format:{default:"12h"},minuteStep:{default:1},label:{},placeholder:{},hint:{},error:{},size:{default:"md"},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},id:{},name:{},block:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!0}},emits:["update:modelValue","focus","blur"],setup(n,{expose:e,emit:t}){const o=n,a=t,s=ye("timepicker"),l=i.computed(()=>o.id||s),r=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(""),f=i.ref(12),m=i.ref(0),p=i.ref("AM"),g=i.ref(!1),b=i.ref(null),_=ve("calendar"),k=i.computed(()=>o.format==="12h"?Si(1,12):Si(0,23)),B=i.computed(()=>Si(0,59,o.minuteStep)),C=["AM","PM"],y=Po*wk;function x(){if(o.modelValue&&Wl(o.modelValue)){const v=Io(o.modelValue);if(v){if(o.format==="12h"){const D=zo(v.hours);f.value=D.hour,p.value=D.period}else f.value=v.hours;m.value=S(v.minutes),w()}}}function S(v){return B.value.reduce((G,ce)=>Math.abs(ce-v)<Math.abs(G-v)?ce:G)}function w(){const v=o.format==="12h"?No(f.value,p.value):f.value;h.value=Lo(v,m.value,o.format)}function M(){const v=o.format==="12h"?No(f.value,p.value):f.value,D=Lo(v,m.value,"24h");a("update:modelValue",D)}function N(v){const D=String(v);h.value=D;const G=Io(D);if(G){if(o.format==="12h"){const ce=zo(G.hours);f.value=ce.hour,p.value=ce.period}else f.value=G.hours;m.value=S(G.minutes),M(),K()}}function T(v){w(),a("blur",v)}function $(v){a("focus",v)}function K(){i.nextTick(()=>{P(c.value,f.value,k.value),P(d.value,m.value,B.value),o.format==="12h"&&u.value&&P(u.value,p.value,C)})}function P(v,D,G){if(!v)return;const ce=G.indexOf(D);if(ce===-1)return;const ze=ce*Po;v.scrollTop=ze}function A(v,D,G){if(!v)return()=>{};const ce=v.querySelectorAll("[data-value]");if(ce.length===0)return()=>{};const ze=new IntersectionObserver(L=>{if(!g.value){for(const j of L)if(j.isIntersecting&&j.intersectionRatio>=.5){const X=j.target.getAttribute("data-value");if(X!==null){const ne=isNaN(Number(X))?X:Number(X);G(ne)}}}},{root:v,rootMargin:`-${y/2-Po/2}px 0px`,threshold:.5});return ce.forEach(L=>ze.observe(L)),()=>ze.disconnect()}let R=()=>{},q=()=>{},Q=()=>{};function ee(){R(),q(),Q(),R=A(c.value,k.value,v=>{f.value=v,w(),M()}),q=A(d.value,B.value,v=>{m.value=v,w(),M()}),o.format==="12h"&&(Q=A(u.value,C,v=>{p.value=v,w(),M()}))}function ge(){g.value=!0,b.value&&clearTimeout(b.value),b.value=window.setTimeout(()=>{g.value=!1},150)}function fe(v,D){var G;v==="hour"?(f.value=D,P(c.value,D,k.value)):v==="minute"?(m.value=D,P(d.value,D,B.value)):v==="period"&&(p.value=D,P(u.value,D,C)),w(),M(),o.closeOnSelect&&v==="minute"&&((G=r.value)==null||G.close())}function be(){i.nextTick(()=>{K(),ee()})}function xe(){R(),q(),Q()}function F(v){return v.toString().padStart(2,"0")}return i.watch(()=>o.modelValue,()=>{x()},{immediate:!0}),i.onMounted(()=>{x()}),i.onUnmounted(()=>{R(),q(),Q(),b.value&&clearTimeout(b.value)}),e({open:()=>{var v;return(v=r.value)==null?void 0:v.open()},close:()=>{var v;return(v=r.value)==null?void 0:v.close()},toggle:()=>{var v;return(v=r.value)==null?void 0:v.toggle()}}),(v,D)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-timepicker",[`ui-timepicker--${n.size}`,{"ui-timepicker--block":n.block,"ui-timepicker--disabled":n.disabled}]])},[i.createVNode(Ln,{ref_key:"popoverRef",ref:r,placement:"bottom-start",disabled:n.disabled,"close-on-click-outside":!0,"close-on-escape":!0,"trap-focus":!0,onOpen:be,onClose:xe},{trigger:i.withCtx(()=>[i.createVNode(Jt,{id:l.value,modelValue:h.value,"onUpdate:modelValue":[D[0]||(D[0]=G=>h.value=G),N],label:n.label,placeholder:n.placeholder||(n.format==="12h"?"hh:mm AM/PM":"HH:mm"),hint:n.hint,error:n.error,size:n.size,disabled:n.disabled,required:n.required,name:n.name,block:n.block,"icon-right":i.unref(_),autocomplete:"off",onBlur:T,onFocus:$},null,8,["id","modelValue","label","placeholder","hint","error","size","disabled","required","name","block","icon-right"])]),default:i.withCtx(()=>[i.createElementVNode("div",bk,[i.createElementVNode("div",_k,[D[7]||(D[7]=i.createElementVNode("div",{class:"ui-timepicker__highlight"},null,-1)),i.createElementVNode("div",{ref_key:"hourColumnRef",ref:c,class:"ui-timepicker__column",onScroll:ge},[D[1]||(D[1]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(k.value,G=>(i.openBlock(),i.createElementBlock("div",{key:G,"data-value":G,class:i.normalizeClass(["ui-timepicker__item",{"ui-timepicker__item--selected":G===f.value}]),onClick:ce=>fe("hour",G)},i.toDisplayString(F(G)),11,yk))),128)),D[2]||(D[2]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1))],544),D[8]||(D[8]=i.createElementVNode("div",{class:"ui-timepicker__separator"},":",-1)),i.createElementVNode("div",{ref_key:"minuteColumnRef",ref:d,class:"ui-timepicker__column",onScroll:ge},[D[3]||(D[3]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(B.value,G=>(i.openBlock(),i.createElementBlock("div",{key:G,"data-value":G,class:i.normalizeClass(["ui-timepicker__item",{"ui-timepicker__item--selected":G===m.value}]),onClick:ce=>fe("minute",G)},i.toDisplayString(F(G)),11,kk))),128)),D[4]||(D[4]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1))],544),n.format==="12h"?(i.openBlock(),i.createElementBlock("div",{key:0,ref_key:"periodColumnRef",ref:u,class:"ui-timepicker__column ui-timepicker__column--period",onScroll:ge},[D[5]||(D[5]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1)),(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(C,G=>i.createElementVNode("div",{key:G,"data-value":G,class:i.normalizeClass(["ui-timepicker__item",{"ui-timepicker__item--selected":G===p.value}]),onClick:ce=>fe("period",G)},i.toDisplayString(G),11,xk)),64)),D[6]||(D[6]=i.createElementVNode("div",{class:"ui-timepicker__spacer"},null,-1))],544)):i.createCommentVNode("",!0)])])]),_:1},8,["disabled"])],2))}}),[["__scopeId","data-v-7c4d962e"]]),Bk=["aria-pressed","aria-label","disabled"],Sk={key:1,class:"ui-toggle-button__label"},Ek=O(i.defineComponent({__name:"ToggleButton",props:{modelValue:{type:Boolean},value:{},size:{default:"md"},disabled:{type:Boolean,default:!1},icon:{},label:{}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,o=e,a=i.inject("toggleGroup",null),s=i.computed(()=>a!==null&&t.value!==void 0),l=i.computed(()=>(a==null?void 0:a.size)||t.size),r=i.computed(()=>t.disabled||(a==null?void 0:a.disabled)),c=i.computed(()=>{if(s.value&&a&&t.value!==void 0){const h=a.modelValue.value;return Array.isArray(h)?h.includes(t.value):h===t.value}return t.modelValue??!1});function d(){if(!r.value)if(s.value&&a&&t.value!==void 0)a.toggle(t.value);else{const h=!t.modelValue;o("update:modelValue",h),o("change",h)}}const u=i.computed(()=>t.icon&&!t.label);return(h,f)=>(i.openBlock(),i.createElementBlock("button",{type:"button","aria-pressed":c.value,"aria-label":u.value?n.label:void 0,disabled:r.value,class:i.normalizeClass(["ui-toggle-button",[`ui-toggle-button--${l.value}`,{"ui-toggle-button--pressed":c.value,"ui-toggle-button--disabled":r.value,"ui-toggle-button--icon-only":u.value}]]),onClick:d},[n.icon?(i.openBlock(),i.createBlock(je,{key:0,icon:n.icon,class:"ui-toggle-button__icon"},null,8,["icon"])):i.createCommentVNode("",!0),n.label&&!u.value?(i.openBlock(),i.createElementBlock("span",Sk,i.toDisplayString(n.label),1)):i.createCommentVNode("",!0),!n.icon&&!n.label?i.renderSlot(h.$slots,"default",{key:2},void 0,!0):i.createCommentVNode("",!0)],10,Bk))}}),[["__scopeId","data-v-1f682975"]]),Mk=["role","aria-label","aria-orientation","aria-disabled"],vk=O(i.defineComponent({__name:"ToggleGroup",props:{modelValue:{},type:{default:"single"},size:{default:"md"},disabled:{type:Boolean,default:!1},label:{},orientation:{default:"horizontal"}},emits:["update:modelValue","change"],setup(n,{emit:e}){const t=n,o=e;function a(l){if(t.type==="single"){const r=t.modelValue===l?void 0:l;o("update:modelValue",r),o("change",r)}else{const r=Array.isArray(t.modelValue)?t.modelValue:[],c=r.includes(l)?r.filter(d=>d!==l):[...r,l];o("update:modelValue",c),o("change",c)}}i.provide("toggleGroup",{modelValue:i.toRef(t,"modelValue"),toggle:a,type:t.type,size:t.size,disabled:t.disabled});const s=i.computed(()=>t.type==="single"?"radiogroup":"group");return(l,r)=>(i.openBlock(),i.createElementBlock("div",{role:s.value,"aria-label":n.label,"aria-orientation":n.orientation,"aria-disabled":n.disabled||void 0,class:i.normalizeClass(["ui-toggle-group",[`ui-toggle-group--${n.orientation}`,{"ui-toggle-group--disabled":n.disabled}]])},[i.renderSlot(l.$slots,"default")],10,Mk))}}),[["__scopeId","data-v-aa1233fc"]]),Vk=5,Dk=5e3,$k=8e3;let Tk=0;function Ik(){return`toast-${++Tk}-${Date.now().toString(36)}`}const St=i.reactive({toasts:[]});function Dn(n){const e=Ik(),t=n.action?$k:Dk,o={id:e,title:n.title,message:n.message,variant:n.variant,duration:n.duration??t,createdAt:Date.now(),action:n.action,onClick:n.onClick,avatar:n.avatar};for(St.toasts.push(o);St.toasts.length>Vk;)St.toasts.shift();return e}function Lk(n){const e=St.toasts.findIndex(t=>t.id===n);e!==-1&&St.toasts.splice(e,1)}function zk(){St.toasts.splice(0,St.toasts.length)}function Nk(n,e){return Dn({...e,title:n,variant:"success"})}function Pk(n,e){return Dn({...e,title:n,variant:"error"})}function Ak(n,e){return Dn({...e,title:n,variant:"warning"})}function Rk(n,e){return Dn({...e,title:n,variant:"info"})}const Ok=i.readonly(St).toasts,Ot={add:Dn,remove:Lk,clear:zk,success:Nk,error:Pk,warning:Ak,info:Rk},Fk=["role","aria-live"],Wk={key:0,class:"ui-toast__avatar"},Hk={key:1,class:"ui-toast__icon","aria-hidden":"true"},jk={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Yk=["d"],Uk={class:"ui-toast__content"},Xk={key:0,class:"ui-toast__title"},Kk={key:1,class:"ui-toast__message"},Hl=O(i.defineComponent({__name:"ToastItem",props:{toast:{}},emits:["dismiss"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(!1),s=i.ref(t.toast.duration);let l=null,r=0;const c=i.computed(()=>!!t.toast.onClick),d=i.computed(()=>!!t.toast.avatar),u=i.computed(()=>t.toast.variant==="error"?"alert":"status"),h=i.computed(()=>t.toast.variant==="error"?"assertive":"polite");function f(){t.toast.duration<=0||s.value<=0||(r=Date.now(),l=setTimeout(()=>{o("dismiss",t.toast.id)},s.value))}function m(){if(l){clearTimeout(l),l=null;const C=Date.now()-r;s.value=Math.max(0,s.value-C)}}function p(){a.value=!0,m()}function g(){a.value=!1,f()}function b(C){C.stopPropagation(),o("dismiss",t.toast.id)}function _(){t.toast.onClick&&(t.toast.onClick(),o("dismiss",t.toast.id))}function k(C){C.stopPropagation(),t.toast.action&&(t.toast.action.onClick(),o("dismiss",t.toast.id))}i.onMounted(()=>{f()}),i.onUnmounted(()=>{l&&clearTimeout(l)});const B={success:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",error:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",warning:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",info:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"};return(C,y)=>{var x,S;return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["ui-toast",[`ui-toast--${n.toast.variant}`,{"ui-toast--clickable":c.value}]]),role:u.value,"aria-live":h.value,onMouseenter:p,onMouseleave:g,onClick:_},[d.value?(i.openBlock(),i.createElementBlock("div",Wk,[i.createVNode(Yo,{src:(x=n.toast.avatar)==null?void 0:x.src,name:(S=n.toast.avatar)==null?void 0:S.name,size:"sm"},null,8,["src","name"])])):(i.openBlock(),i.createElementBlock("div",Hk,[(i.openBlock(),i.createElementBlock("svg",jk,[i.createElementVNode("path",{d:B[n.toast.variant]},null,8,Yk)]))])),i.createElementVNode("div",Uk,[n.toast.title?(i.openBlock(),i.createElementBlock("div",Xk,i.toDisplayString(n.toast.title),1)):i.createCommentVNode("",!0),n.toast.message?(i.openBlock(),i.createElementBlock("div",Kk,i.toDisplayString(n.toast.message),1)):i.createCommentVNode("",!0),n.toast.action?(i.openBlock(),i.createElementBlock("button",{key:2,type:"button",class:"ui-toast__action",onClick:k},i.toDisplayString(n.toast.action.label),1)):i.createCommentVNode("",!0)]),i.createElementVNode("button",{type:"button",class:"ui-toast__close","aria-label":"Dismiss notification",onClick:b},[...y[0]||(y[0]=[i.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[i.createElementVNode("path",{d:"M6 18L18 6M6 6l12 12"})],-1)])]),n.toast.duration>0?(i.openBlock(),i.createElementBlock("div",{key:2,class:i.normalizeClass(["ui-toast__progress",{"ui-toast__progress--paused":a.value}]),style:i.normalizeStyle({"--toast-duration":`${n.toast.duration}ms`})},null,6)):i.createCommentVNode("",!0)],42,Fk)}}}),[["__scopeId","data-v-4a2866d8"]]),qk=O(i.defineComponent({__name:"ToastProvider",props:{position:{default:"top-right"}},setup(n){function e(t){Ot.remove(t)}return(t,o)=>(i.openBlock(),i.createBlock(i.Teleport,{to:"body"},[i.createElementVNode("div",{class:i.normalizeClass(["ui-toast-provider",[`ui-toast-provider--${n.position}`]]),role:"region","aria-label":"Notifications"},[i.createVNode(i.TransitionGroup,{name:"toast"},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Ok),a=>(i.openBlock(),i.createBlock(Hl,{key:a.id,toast:a,onDismiss:e},null,8,["toast"]))),128))]),_:1})],2)]))}}),[["__scopeId","data-v-69fc4e70"]]);function Gk(){return{success:Ot.success,error:Ot.error,warning:Ot.warning,info:Ot.info,dismiss:Ot.remove,clear:Ot.clear}}const Ao=Symbol("treeview"),Ei=Symbol("treeview-item"),Jk=["aria-multiselectable"],Zk=O(i.defineComponent({__name:"TreeView",props:{data:{},modelValue:{},expandedIds:{default:()=>[]},multiSelect:{type:Boolean,default:!1},loadChildren:{}},emits:["update:modelValue","update:expandedIds"],setup(n,{emit:e}){const t=n,o=e,a=i.ref(new Set),s=i.ref(new Set(t.expandedIds)),l=i.ref(null),r=i.ref(new Set),c=i.ref(new Map),d=i.ref(new Map);i.watch(()=>t.modelValue,y=>{y===void 0?a.value=new Set:Array.isArray(y)?a.value=new Set(y):a.value=new Set([y])},{immediate:!0}),i.watch(()=>t.expandedIds,y=>{s.value=new Set(y)},{immediate:!0});const u=i.computed(()=>a.value),h=i.computed(()=>s.value);function f(y){if(t.multiSelect){const x=new Set(a.value);x.has(y)?x.delete(y):x.add(y),a.value=x,o("update:modelValue",Array.from(x))}else a.value.has(y)?(a.value=new Set,o("update:modelValue",void 0)):(a.value=new Set([y]),o("update:modelValue",y))}function m(y){const x=new Set(s.value);x.has(y)?x.delete(y):x.add(y),s.value=x,o("update:expandedIds",Array.from(x))}function p(y){l.value=y}function g(y,x,S){c.value.set(y,{parentId:x,hasChildren:S}),d.value.has(x)||d.value.set(x,[]);const w=d.value.get(x);w.includes(y)||w.push(y)}function b(y){var x;return((x=c.value.get(y))==null?void 0:x.parentId)??null}function _(y){return d.value.get(y)??[]}function k(y){var x;return((x=c.value.get(y))==null?void 0:x.hasChildren)??!1}function B(){const y=[];function x(S,w){for(const M of S)y.push(M.id),M.children&&h.value.has(M.id)&&x(M.children)}return x(t.data),y}function C(y){const x=B(),S=l.value?x.indexOf(l.value):-1;switch(y.key){case"ArrowDown":{y.preventDefault();const w=S<x.length-1?S+1:0;l.value=x[w];break}case"ArrowUp":{y.preventDefault();const w=S>0?S-1:x.length-1;l.value=x[w];break}case"ArrowRight":{if(y.preventDefault(),l.value&&k(l.value))if(!h.value.has(l.value))m(l.value);else{const w=_(l.value);w.length>0&&(l.value=w[0])}break}case"ArrowLeft":{if(y.preventDefault(),l.value)if(h.value.has(l.value))m(l.value);else{const w=b(l.value);w&&(l.value=w)}break}case"Home":{y.preventDefault(),x.length>0&&(l.value=x[0]);break}case"End":{y.preventDefault(),x.length>0&&(l.value=x[x.length-1]);break}case"Enter":case" ":{y.preventDefault(),l.value&&f(l.value);break}}}return i.provide(Ao,{selectedIds:u,expandedIds:h,focusedId:l,multiSelect:i.toRef(t,"multiSelect"),selectNode:f,toggleExpand:m,setFocusedId:p,loadChildren:t.loadChildren??null,loadingIds:r,registerNode:g,getVisibleNodes:B,getParentId:b,getChildIds:_,hasChildren:k}),i.provide(Ei,{depth:0,parentId:null}),(y,x)=>(i.openBlock(),i.createElementBlock("div",{class:"ui-treeview",role:"tree","aria-multiselectable":n.multiSelect,tabindex:"0",onKeydown:C,onFocus:x[0]||(x[0]=()=>{!l.value&&n.data.length>0&&(l.value=n.data[0].id)})},[i.renderSlot(y.$slots,"default",{},void 0,!0)],40,Jk))}}),[["__scopeId","data-v-1a85f707"]]),Qk=["aria-selected","aria-expanded","aria-disabled","data-focused"],e0=["aria-label"],t0={key:1,class:"ui-treeview__chevron-placeholder"},n0={key:2,class:"ui-treeview__spinner"},i0={class:"ui-treeview__label"},o0={key:0,class:"ui-treeview__children",role:"group"},a0=O(i.defineComponent({__name:"TreeViewItem",props:{node:{}},setup(n){const e=n,t=i.inject(Ao),o=i.inject(Ei);if(!t||!o)throw new Error("TreeViewItem must be used within TreeView");const a=t,s=o,l=s.depth,r=s.parentId,c=ve("expand"),d=ve("collapse"),u=i.ref(e.node.children),h=i.computed(()=>a.loadingIds.value.has(e.node.id)),f=i.computed(()=>a.selectedIds.value.has(e.node.id)),m=i.computed(()=>a.expandedIds.value.has(e.node.id)),p=i.computed(()=>a.focusedId.value===e.node.id),g=i.computed(()=>e.node.isLeaf?!1:!!(u.value&&u.value.length>0||a.loadChildren&&!e.node.isLeaf));i.onMounted(()=>{a.registerNode(e.node.id,r,g.value)}),i.watch(g,x=>{a.registerNode(e.node.id,r,x)});async function b(){var x;if(g.value){if(!m.value&&a.loadChildren&&!((x=u.value)!=null&&x.length)){a.loadingIds.value.add(e.node.id);try{u.value=await a.loadChildren(e.node)}finally{a.loadingIds.value.delete(e.node.id)}}a.toggleExpand(e.node.id)}}function _(){e.node.disabled||a.selectNode(e.node.id)}function k(){a.setFocusedId(e.node.id),_()}function B(x){x.stopPropagation(),a.setFocusedId(e.node.id),b()}i.provide(Ei,{depth:l+1,parentId:e.node.id});const C=i.computed(()=>["ui-treeview__item",{"ui-treeview__item--selected":f.value,"ui-treeview__item--focused":p.value,"ui-treeview__item--disabled":e.node.disabled,"ui-treeview__item--loading":h.value}]),y=i.computed(()=>({paddingLeft:`calc(var(--tree-indent) * ${l})`}));return(x,S)=>{const w=i.resolveComponent("TreeViewItem",!0);return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(C.value),role:"treeitem","aria-selected":f.value,"aria-expanded":g.value?m.value:void 0,"aria-disabled":n.node.disabled,"data-focused":p.value},[i.createElementVNode("div",{class:"ui-treeview__content",style:i.normalizeStyle(y.value),onClick:k},[g.value?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["ui-treeview__chevron",{"ui-treeview__chevron--expanded":m.value}]),type:"button",tabindex:"-1","aria-label":m.value?"Collapse":"Expand",onClick:B},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(m.value?i.unref(d):i.unref(c)),{class:"ui-treeview__chevron-icon"}))],10,e0)):(i.openBlock(),i.createElementBlock("span",t0)),h.value?(i.openBlock(),i.createElementBlock("span",n0)):i.createCommentVNode("",!0),n.node.icon&&!h.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.node.icon),{key:3,class:"ui-treeview__icon"})):i.createCommentVNode("",!0),i.createElementVNode("span",i0,[i.renderSlot(x.$slots,"default",{},()=>[i.createTextVNode(i.toDisplayString(n.node.label),1)],!0)])],4),i.createVNode(i.Transition,{name:"ui-treeview-expand"},{default:i.withCtx(()=>[g.value&&m.value&&u.value?(i.openBlock(),i.createElementBlock("div",o0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.value,M=>(i.openBlock(),i.createBlock(w,{key:M.id,node:M},null,8,["node"]))),128))])):i.createCommentVNode("",!0)]),_:1})],10,Qk)}}}),[["__scopeId","data-v-b483e83c"]]),s0=O(i.defineComponent({__name:"Container",props:{fluid:{type:Boolean,default:!1},centered:{type:Boolean,default:!0},as:{default:"div"}},setup(n){const e=n,t=i.computed(()=>["ui-container",{"ui-container--fluid":e.fluid,"ui-container--centered":e.centered}]);return(o,a)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{class:i.normalizeClass(t.value)},{default:i.withCtx(()=>[i.renderSlot(o.$slots,"default",{},void 0,!0)]),_:3},8,["class"]))}}),[["__scopeId","data-v-2f68ccaa"]]),l0=O(i.defineComponent({__name:"Stack",props:{direction:{default:"column"},gap:{default:0},align:{default:"stretch"},justify:{default:"start"},wrap:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},as:{default:"div"}},setup(n){const e=n,t=i.computed(()=>["ui-stack",`ui-stack--${e.direction}`,`ui-stack--align-${e.align}`,`ui-stack--justify-${e.justify}`,{"ui-stack--wrap":e.wrap,"ui-stack--inline":e.inline}]),o=i.computed(()=>({"--stack-gap":`var(--space-${e.gap})`}));return(a,s)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{class:i.normalizeClass(t.value),style:i.normalizeStyle(o.value)},{default:i.withCtx(()=>[i.renderSlot(a.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"]))}}),[["__scopeId","data-v-3d1c3188"]]),r0=Symbol("Grid"),c0=O(i.defineComponent({__name:"Grid",props:{columns:{default:1},gap:{default:4},gapX:{},gapY:{},as:{default:"div"}},setup(n){const e=n,t=i.computed(()=>typeof e.columns=="object"),o=i.computed(()=>{const s=["ui-grid"];if(t.value){const l=e.columns;l.default&&s.push(`ui-grid--cols-${l.default}`),l.sm&&s.push(`ui-grid--cols-sm-${l.sm}`),l.md&&s.push(`ui-grid--cols-md-${l.md}`),l.lg&&s.push(`ui-grid--cols-lg-${l.lg}`),l.xl&&s.push(`ui-grid--cols-xl-${l.xl}`)}else s.push(`ui-grid--cols-${e.columns}`);return s}),a=i.computed(()=>{const s={"--grid-gap":`var(--space-${e.gap})`};return e.gapX!==void 0&&(s["--grid-gap-x"]=`var(--space-${e.gapX})`),e.gapY!==void 0&&(s["--grid-gap-y"]=`var(--space-${e.gapY})`),s});return i.provide(r0,{gap:i.toRef(e,"gap")}),(s,l)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{class:i.normalizeClass(o.value),style:i.normalizeStyle(a.value)},{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"]))}}),[["__scopeId","data-v-f4881c4d"]]),d0=O(i.defineComponent({__name:"GridItem",props:{span:{default:1},start:{},end:{},rowSpan:{},as:{default:"div"}},setup(n){const e=n,t=i.computed(()=>typeof e.span=="object"),o=i.computed(()=>{const s=["ui-grid-item"];if(t.value){const l=e.span;l.default&&s.push(`ui-grid-item--span-${l.default}`),l.sm&&s.push(`ui-grid-item--span-sm-${l.sm}`),l.md&&s.push(`ui-grid-item--span-md-${l.md}`),l.lg&&s.push(`ui-grid-item--span-lg-${l.lg}`),l.xl&&s.push(`ui-grid-item--span-xl-${l.xl}`)}else s.push(`ui-grid-item--span-${e.span}`);return s}),a=i.computed(()=>{const s={};return e.start!==void 0&&(s["grid-column-start"]=e.start),e.end!==void 0&&(s["grid-column-end"]=e.end),e.rowSpan!==void 0&&(s["grid-row"]=`span ${e.rowSpan} / span ${e.rowSpan}`),s});return(s,l)=>(i.openBlock(),i.createBlock(i.resolveDynamicComponent(n.as),{class:i.normalizeClass(o.value),style:i.normalizeStyle(a.value)},{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default",{},void 0,!0)]),_:3},8,["class","style"]))}}),[["__scopeId","data-v-835ed31a"]]);E.AccordionContent=yr,E.AccordionItem=cr,E.AccordionRoot=Gl,E.AccordionTrigger=mr,E.Avatar=Yo,E.Badge=Sr,E.BadgeContainer=Mr,E.BarChart=Pp,E.BaseChart=ki,E.BreadcrumbEllipsis=hc,E.BreadcrumbItem=Pr,E.BreadcrumbLink=Ar,E.BreadcrumbList=Ir,E.BreadcrumbPage=Wr,E.BreadcrumbRoot=Vr,E.BreadcrumbSeparator=jr,E.Button=Je,E.Callout=Vc,E.Card=$c,E.CardContent=Pc,E.CardFooter=Ac,E.CardHeader=Nc,E.CardImage=Oc,E.Checkbox=Vi,E.ChoiceChip=h_,E.ChoiceChipGroup=m_,E.ColorArea=ia,E.ColorPicker=md,E.ColorSlider=zi,E.Combobox=c_,E.Container=s0,E.DataTable=Xg,E.DatePicker=Rb,E.DonutChart=Kp,E.Drawer=Yb,E.Dropdown=Xo,E.DropdownItem=Ko,E.DropdownSeparator=nc,E.DropdownSub=oc,E.DropdownSubContent=cc,E.DropdownSubTrigger=rc,E.EmptyState=El,E.FileUpload=R_,E.Grid=c0,E.GridItem=d0,E.Heading=O_,E.Icon=je,E.Input=Jt,E.LineChart=Ip,E.Modal=U_,E.Pagination=vl,E.Popover=Ln,E.Progress=Q_,E.Radio=sy,E.Rating=cy,E.SegmentedControl=fy,E.Select=Vl,E.SidebarGroup=Ny,E.SidebarGroupKey=Ol,E.SidebarItem=Iy,E.SidebarKey=Bi,E.SidebarLayout=Cy,E.SidebarRoot=My,E.Skeleton=wi,E.Slider=xy,E.Spinner=In,E.SpireProvider=ar,E.Stack=l0,E.StepperContent=Yy,E.StepperItem=Oy,E.StepperItemKey=Vn,E.StepperKey=qt,E.StepperRoot=Ay,E.StepperSeparator=Uy,E.StepperTrigger=Hy,E.Switch=Jy,E.Tabs=nk,E.Text=vo,E.Textarea=hk,E.TimePicker=Ck,E.Timeline=fk,E.TimelineItem=gk,E.TimelineKey=To,E.ToastItem=Hl,E.ToastProvider=qk,E.ToggleButton=Ek,E.ToggleGroup=vk,E.Tooltip=Fl,E.TreeView=Zk,E.TreeViewItem=a0,E.TreeViewItemKey=Ei,E.TreeViewKey=Ao,E.configureIcons=Gp,E.formatColor=Li,E.formatDate=Bt,E.formatOklch=na,E.formatRgb=Ii,E.formatTime=Lo,E.generateCalendarGrid=$l,E.generatePageRange=Ml,E.generateRange=Si,E.generateYearGrid=Pl,E.getDaysInMonth=Kg,E.getInitials=jo,E.getMonthName=Ll,E.getMonthNamesShort=Nl,E.getNestedValue=Dl,E.getPresetRange=Gg,E.getRangeClass=Vo,E.getStaggerStyle=lr,E.getWeekdayNames=zl,E.hexToHsv=Di,E.hexToRgb=Go,E.hsvToHex=Nn,E.hsvToOklch=ea,E.hsvToRgb=Zt,E.isDateAfter=Il,E.isDateBefore=Tl,E.isDateBetween=qg,E.isDateInRange=Ci,E.isSameDate=mt,E.isValidTimeString=Wl,E.normalizeRange=Do,E.oklchToHsv=ta,E.oklchToRgb=Zo,E.parseColorString=Qt,E.parseDate=ft,E.parseTime=Io,E.resetIcons=Jp,E.rgbToHex=Jo,E.rgbToHsv=zn,E.rgbToOklch=Qo,E.spireConfigKey=Ho,E.to12Hour=zo,E.to24Hour=No,E.useChartTheme=Mn,E.useClickOutside=Jl,E.useClipboard=Zl,E.useEventListener=Ql,E.useFocusTrap=er,E.useHoverReveal=tr,E.useId=ye,E.useMagnetic=ir,E.useRelativePosition=Wo,E.useRipple=or,E.useScrollLock=Tn,E.useStagger=sr,E.useToast=Gk,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})}));