@ngrok/mantle 0.79.3 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/dist/accordion.d.ts +158 -19
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +5 -1
  4. package/dist/alert-dialog.d.ts +465 -32
  5. package/dist/alert-dialog.js +1 -1
  6. package/dist/alert.d.ts +116 -14
  7. package/dist/alert.js +1 -1
  8. package/dist/anchor-DfeXTpKW.js +1 -0
  9. package/dist/anchor.d.ts +2 -2
  10. package/dist/anchor.js +1 -1
  11. package/dist/area-chart.d.ts +504 -0
  12. package/dist/area-chart.js +1 -0
  13. package/dist/as-child-D23mGo4f.d.ts +49 -0
  14. package/dist/badge.d.ts +44 -5
  15. package/dist/badge.js +1 -1
  16. package/dist/bar-chart.d.ts +491 -0
  17. package/dist/bar-chart.js +1 -0
  18. package/dist/breadcrumb.d.ts +196 -14
  19. package/dist/breadcrumb.js +1 -1
  20. package/dist/button-BAno7KIU.js +1 -0
  21. package/dist/{index-BSAizFod.d.ts → button-C-gMbPso.d.ts} +5 -5
  22. package/dist/{icon-button-BvQvT790.d.ts → button-C7vAl6lS.d.ts} +22 -63
  23. package/dist/button-D9n09xUg.js +1 -0
  24. package/dist/{button-DcXOWUYo.d.ts → button-DARFK2KJ.d.ts} +4 -4
  25. package/dist/button-DjpEKt2X.js +1 -0
  26. package/dist/button-DvHMWAPl.js +1 -0
  27. package/dist/button.d.ts +5 -5
  28. package/dist/button.js +1 -1
  29. package/dist/calendar.d.ts +0 -3
  30. package/dist/calendar.js +1 -1
  31. package/dist/card.d.ts +131 -9
  32. package/dist/card.js +1 -1
  33. package/dist/centered-layout.d.ts +209 -8
  34. package/dist/centered-layout.js +1 -1
  35. package/dist/chart-BROa2gqt.js +2 -0
  36. package/dist/chart-BcOC6Qj0.d.ts +275 -0
  37. package/dist/checkbox-0EoxOyMA.js +1 -0
  38. package/dist/checkbox.d.ts +13 -11
  39. package/dist/checkbox.js +1 -1
  40. package/dist/choice-BHwFSSyv.js +1 -0
  41. package/dist/choice-BNRQXszu.d.ts +254 -0
  42. package/dist/choice.d.ts +1 -252
  43. package/dist/choice.js +1 -1
  44. package/dist/code-block.d.ts +242 -52
  45. package/dist/code-block.js +6 -6
  46. package/dist/code-block_highlight-utils.d.ts +1 -1
  47. package/dist/code-block_highlight-utils.js +1 -1
  48. package/dist/code.d.ts +3 -2
  49. package/dist/code.js +1 -1
  50. package/dist/combobox.d.ts +171 -16
  51. package/dist/combobox.js +1 -1
  52. package/dist/command.d.ts +279 -81
  53. package/dist/command.js +1 -1
  54. package/dist/compose-refs-BdBMM9ga.js +1 -0
  55. package/dist/data-table.d.ts +28 -6
  56. package/dist/data-table.js +1 -1
  57. package/dist/description-list.d.ts +67 -6
  58. package/dist/description-list.js +1 -1
  59. package/dist/dialog-BM4wPCft.d.ts +24 -0
  60. package/dist/dialog-DWZWd5Jt.js +1 -0
  61. package/dist/dialog.d.ts +226 -35
  62. package/dist/dialog.js +1 -1
  63. package/dist/{dropdown-menu-DP_Ne9Mr.d.ts → dropdown-menu-DZg-Cd69.d.ts} +137 -32
  64. package/dist/dropdown-menu-Dw-OtXPm.d.ts +1 -0
  65. package/dist/dropdown-menu-RyDWoKHx.js +1 -0
  66. package/dist/dropdown-menu.d.ts +2 -2
  67. package/dist/dropdown-menu.js +1 -1
  68. package/dist/empty.d.ts +7 -22
  69. package/dist/empty.js +1 -1
  70. package/dist/field-B1wqeZr4.js +1 -0
  71. package/dist/field.d.ts +568 -47
  72. package/dist/field.js +1 -1
  73. package/dist/flag.d.ts +0 -3
  74. package/dist/flag.js +1 -1
  75. package/dist/hooks.d.ts +3 -4
  76. package/dist/hooks.js +1 -1
  77. package/dist/hover-card.d.ts +48 -7
  78. package/dist/hover-card.js +1 -1
  79. package/dist/{svg-only-BFeFS1aa.d.ts → icon-CX_gj6sW.d.ts} +2 -2
  80. package/dist/icon-d-nMCfAI.js +1 -0
  81. package/dist/{icon-Cevjo93X.d.ts → icon-k4E9yNWD.d.ts} +2 -2
  82. package/dist/icon-lZ48P8Nn.js +1 -0
  83. package/dist/icon.d.ts +3 -3
  84. package/dist/icon.js +1 -1
  85. package/dist/{sort-BPX2Fk9t.js → icons-B_DDQcVD.js} +1 -1
  86. package/dist/{traffic-policy-file-0g5RXFqu.js → icons-CF1lbWtp.js} +1 -1
  87. package/dist/icons-DLCs1hLP.js +1 -0
  88. package/dist/icons.d.ts +7 -15
  89. package/dist/icons.js +1 -1
  90. package/dist/{in-view-nkSOdED2.d.ts → in-view-DDEGUKDR.d.ts} +17 -9
  91. package/dist/{index-D47aqlpz.d.ts → index-DA4ig3gj.d.ts} +1 -1
  92. package/dist/input-BnlpQF0c.js +1 -0
  93. package/dist/{types-C19IR7jf.d.ts → input-BuYDU6CF.d.ts} +42 -2
  94. package/dist/input.d.ts +5 -56
  95. package/dist/input.js +1 -1
  96. package/dist/{label-v2-bv98k.d.ts → label-C6YH9skg.d.ts} +8 -6
  97. package/dist/label-D-D11mlp.js +1 -0
  98. package/dist/label.d.ts +1 -1
  99. package/dist/label.js +1 -1
  100. package/dist/line-chart.d.ts +490 -0
  101. package/dist/line-chart.js +1 -0
  102. package/dist/list-51KQvENW.js +1 -0
  103. package/dist/list.d.ts +135 -6
  104. package/dist/list.js +1 -1
  105. package/dist/llms.txt +5 -1
  106. package/dist/main.d.ts +20 -4
  107. package/dist/main.js +1 -1
  108. package/dist/mantle-dark-high-contrast.css +17 -0
  109. package/dist/mantle-dark.css +13 -0
  110. package/dist/mantle-light-high-contrast.css +15 -0
  111. package/dist/mantle.css +29 -0
  112. package/dist/media-object.d.ts +18 -4
  113. package/dist/media-object.js +1 -1
  114. package/dist/multi-select.d.ts +282 -24
  115. package/dist/multi-select.js +1 -1
  116. package/dist/otp-input.d.ts +118 -6
  117. package/dist/otp-input.js +1 -1
  118. package/dist/pagination.d.ts +61 -6
  119. package/dist/pagination.js +1 -1
  120. package/dist/popover-CE4OlWkd.d.ts +208 -0
  121. package/dist/popover-CQ9s7jG5.js +1 -0
  122. package/dist/popover.d.ts +1 -181
  123. package/dist/popover.js +1 -1
  124. package/dist/primitive-trJDqIXJ.js +1 -0
  125. package/dist/progress.d.ts +2 -8
  126. package/dist/progress.js +1 -1
  127. package/dist/qr-code.d.ts +101 -5
  128. package/dist/qr-code.js +1 -1
  129. package/dist/radio-group.d.ts +110 -35
  130. package/dist/radio-group.js +1 -1
  131. package/dist/sandboxed-on-click.d.ts +2 -2
  132. package/dist/sandboxed-on-click.js +1 -1
  133. package/dist/scatter-plot.d.ts +495 -0
  134. package/dist/scatter-plot.js +1 -0
  135. package/dist/select-0z7HVS6r.d.ts +579 -0
  136. package/dist/select-BCHWvmyC.js +1 -0
  137. package/dist/select.d.ts +1 -1
  138. package/dist/select.js +1 -1
  139. package/dist/selectable-list.d.ts +225 -298
  140. package/dist/selectable-list.js +1 -1
  141. package/dist/separator-B5UmkVRL.d.ts +75 -0
  142. package/dist/separator-bpE_kooz.js +1 -0
  143. package/dist/separator.d.ts +1 -52
  144. package/dist/separator.js +1 -1
  145. package/dist/sheet.d.ts +285 -38
  146. package/dist/sheet.js +1 -1
  147. package/dist/skeleton-CsbUHbBA.js +1 -0
  148. package/dist/skeleton.d.ts +4 -7
  149. package/dist/skeleton.js +1 -1
  150. package/dist/skip-to-main-link.d.ts +24 -4
  151. package/dist/skip-to-main-link.js +1 -1
  152. package/dist/slider.js +1 -1
  153. package/dist/{index-Rv8RL7xy.d.ts → slot-BtwKJTLq.d.ts} +1 -1
  154. package/dist/slot-CDk0Bb9z.js +1 -0
  155. package/dist/slot.d.ts +1 -1
  156. package/dist/slot.js +1 -1
  157. package/dist/split-button.d.ts +14 -14
  158. package/dist/split-button.js +1 -1
  159. package/dist/switch.d.ts +10 -7
  160. package/dist/switch.js +1 -1
  161. package/dist/table-Bo0vNxIJ.d.ts +848 -0
  162. package/dist/table-CGxJwtbL.js +1 -0
  163. package/dist/table.d.ts +1 -1
  164. package/dist/table.js +1 -1
  165. package/dist/tabs.d.ts +124 -25
  166. package/dist/tabs.js +1 -1
  167. package/dist/text-area.d.ts +2 -2
  168. package/dist/text-area.js +1 -1
  169. package/dist/theme-C26-Xolp.js +1 -0
  170. package/dist/theme-switcher.d.ts +105 -33
  171. package/dist/theme-switcher.js +1 -1
  172. package/dist/theme.d.ts +54 -15
  173. package/dist/theme.js +1 -1
  174. package/dist/toast.d.ts +86 -10
  175. package/dist/toast.js +1 -1
  176. package/dist/tooltip.d.ts +50 -5
  177. package/dist/tooltip.js +1 -1
  178. package/dist/types.d.ts +2 -2
  179. package/dist/utils.d.ts +1 -1
  180. package/dist/utils.js +1 -1
  181. package/dist/well.d.ts +3 -3
  182. package/dist/well.js +1 -1
  183. package/package.json +9 -3
  184. package/dist/anchor-C_tjSVy6.js +0 -1
  185. package/dist/as-child-CYEVu1WY.d.ts +0 -23
  186. package/dist/button-5t6-JS_I.js +0 -1
  187. package/dist/button-ClC60Nzg.js +0 -1
  188. package/dist/checkbox-DJ2xl7Rc.js +0 -1
  189. package/dist/choice-DOdyNzFC.js +0 -1
  190. package/dist/compose-refs-Cjf2gfB8.js +0 -1
  191. package/dist/dialog-vxLIvB8M.js +0 -1
  192. package/dist/dropdown-menu-Bt1aKF1g.js +0 -1
  193. package/dist/field-context-BR01g789.js +0 -1
  194. package/dist/icon-CDtYjF_H.js +0 -1
  195. package/dist/icon-button-DV2-GZHf.js +0 -1
  196. package/dist/index-g2rfwNCH.d.ts +0 -1
  197. package/dist/input-Ct1YOqSy.js +0 -1
  198. package/dist/label-BMlHW_2D.js +0 -1
  199. package/dist/popover-D5WxxnBY.js +0 -1
  200. package/dist/primitive-C64-m48O.d.ts +0 -13
  201. package/dist/primitive-IKruV2iB.js +0 -1
  202. package/dist/select-Bwt2YduR.d.ts +0 -345
  203. package/dist/select-D-5u0Blc.js +0 -1
  204. package/dist/separator-kBnnv3Cw.js +0 -1
  205. package/dist/skeleton-Bu3tgNcW.js +0 -1
  206. package/dist/slot-DmPrjM7N.js +0 -1
  207. package/dist/svg-only-DDx6FtJd.js +0 -1
  208. package/dist/table-CPH2md2-.js +0 -1
  209. package/dist/table-CwFHXC-G.d.ts +0 -414
  210. package/dist/theme-D3MDng6U.js +0 -1
  211. package/dist/theme-provider-C9zpDyJW.js +0 -1
  212. package/dist/toast-BsCjaMVS.js +0 -1
  213. package/dist/virtual-DZMBu7Ch.js +0 -1
  214. /package/dist/{sizes-BCoI4bhP.d.ts → button-BCoI4bhP.d.ts} +0 -0
  215. /package/dist/{intents-DdSKSj1c.d.ts → button-DdSKSj1c.d.ts} +0 -0
  216. /package/dist/{resolve-pre-rendered-props-B6OlZrSI.d.ts → code-block-B6OlZrSI.d.ts} +0 -0
  217. /package/dist/{resolve-pre-rendered-props-C9uaM9-V.js → code-block-C9uaM9-V.js} +0 -0
  218. /package/dist/{validation-7QeiTFwl.d.ts → field-7QeiTFwl.d.ts} +0 -0
  219. /package/dist/{validation-Bpptk_9t.js → field-Bpptk_9t.js} +0 -0
  220. /package/dist/{types-D1RY5Tcj.d.ts → icon-D1RY5Tcj.d.ts} +0 -0
  221. /package/dist/{is-input-CXmS0OFN.js → input-CXmS0OFN.js} +0 -0
  222. /package/dist/{themes-CYNpplwN.d.ts → theme-CYNpplwN.d.ts} +0 -0
package/dist/card.d.ts CHANGED
@@ -1,9 +1,131 @@
1
- import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
2
- import "./index-D47aqlpz.js";
3
- import { ComponentProps, HTMLAttributes } from "react";
1
+ import { n as WithAsChild } from "./as-child-D23mGo4f.js";
2
+ import "./index-DA4ig3gj.js";
3
+ import { ComponentProps } from "react";
4
4
  //#region src/components/card/card.d.ts
5
5
  type CardProps = ComponentProps<"div"> & WithAsChild;
6
- type CardTitleProps = HTMLAttributes<HTMLHeadingElement> & WithAsChild;
6
+ /**
7
+ * A container that can be used to display content in a box resembling a
8
+ * physical card. The root component of the all Card components.
9
+ *
10
+ * @see https://mantle.ngrok.com/components/structure/card#cardroot
11
+ *
12
+ * @example
13
+ * ```tsx
14
+ * <Card.Root>
15
+ * <Card.Body>
16
+ * <p>Laborum in aute officia adipisicing elit velit.</p>
17
+ * </Card.Body>
18
+ * </Card.Root>
19
+ *
20
+ * <Card.Root>
21
+ * <Card.Header>
22
+ * <Card.Title>Card Title Here</Card.Title>
23
+ * </Card.Header>
24
+ * <Card.Body>
25
+ * <p>Laborum in aute officia adipisicing elit velit.</p>
26
+ * </Card.Body>
27
+ * <Card.Footer>
28
+ * <p>Card footer</p>
29
+ * </Card.Footer>
30
+ * </Card.Root>
31
+ * ```
32
+ */
33
+ declare const Root: ({ asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
34
+ /**
35
+ * The main content of a card. Usually composed as a direct child of a `Card` component.
36
+ *
37
+ * @see https://mantle.ngrok.com/components/structure/card#cardbody
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * <Card.Root>
42
+ * <Card.Body>
43
+ * <p>Laborum in aute officia adipisicing elit velit.</p>
44
+ * </Card.Body>
45
+ * </Card.Root>
46
+ *
47
+ * <Card.Root>
48
+ * <Card.Header>
49
+ * <Card.Title>Card Title Here</Card.Title>
50
+ * </Card.Header>
51
+ * <Card.Body>
52
+ * <p>Laborum in aute officia adipisicing elit velit.</p>
53
+ * </Card.Body>
54
+ * <Card.Footer>
55
+ * <p>Card footer</p>
56
+ * </Card.Footer>
57
+ * </Card.Root>
58
+ * ```
59
+ */
60
+ declare const Body: ({ asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
61
+ /**
62
+ * The footer container of a card. Usually composed as a direct child of a `Card` component.
63
+ *
64
+ * @see https://mantle.ngrok.com/components/structure/card#cardfooter
65
+ *
66
+ * @example
67
+ * ```tsx
68
+ * <Card.Root>
69
+ * <Card.Header>
70
+ * <Card.Title>Card Title Here</Card.Title>
71
+ * </Card.Header>
72
+ * <Card.Body>
73
+ * <p>Laborum in aute officia adipisicing elit velit.</p>
74
+ * </Card.Body>
75
+ * <Card.Footer>
76
+ * <p>Card footer</p>
77
+ * </Card.Footer>
78
+ * </Card.Root>
79
+ * ```
80
+ */
81
+ declare const Footer: ({ asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
82
+ /**
83
+ * The header container of a card. Usually composed as a direct child of a `Card` component.
84
+ *
85
+ * @see https://mantle.ngrok.com/components/structure/card#cardheader
86
+ *
87
+ * @example
88
+ * ```tsx
89
+ * <Card.Root>
90
+ * <Card.Header>
91
+ * <Card.Title>Card Title Here</Card.Title>
92
+ * </Card.Header>
93
+ * <Card.Body>
94
+ * <p>Laborum in aute officia adipisicing elit velit.</p>
95
+ * </Card.Body>
96
+ * <Card.Footer>
97
+ * <p>Card footer</p>
98
+ * </Card.Footer>
99
+ * </Card.Root>
100
+ * ```
101
+ */
102
+ declare const Header: ({ asChild, className, children, ref, ...rest }: CardProps) => import("react").JSX.Element;
103
+ type CardTitleProps = ComponentProps<"h3"> & WithAsChild;
104
+ /**
105
+ * The title of a card. Usually composed as a direct child of a `Card.Header`
106
+ * component.
107
+ * Renders as an `h3` element by default, but can be changed to any other
108
+ * element by using the `asChild` prop. It is preferred to use a heading element
109
+ * (h1-h6) for accessibility reasons.
110
+ *
111
+ * @see https://mantle.ngrok.com/components/structure/card#cardtitle
112
+ *
113
+ * @example
114
+ * ```tsx
115
+ * <Card.Root>
116
+ * <Card.Header>
117
+ * <Card.Title>Card Title Here</Card.Title>
118
+ * </Card.Header>
119
+ * <Card.Body>
120
+ * <p>Laborum in aute officia adipisicing elit velit.</p>
121
+ * </Card.Body>
122
+ * <Card.Footer>
123
+ * <p>Card footer</p>
124
+ * </Card.Footer>
125
+ * </Card.Root>
126
+ * ```
127
+ */
128
+ declare const Title: ({ className, asChild, ref, ...props }: CardTitleProps) => import("react").JSX.Element;
7
129
  /**
8
130
  * A container that can be used to display content in a box resembling a
9
131
  * physical card.
@@ -56,7 +178,7 @@ declare const Card: {
56
178
  * </Card.Root>
57
179
  * ```
58
180
  */
59
- readonly Root: import("react").ForwardRefExoticComponent<Omit<CardProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
181
+ readonly Root: typeof Root;
60
182
  /**
61
183
  * The main content of a card.
62
184
  *
@@ -71,7 +193,7 @@ declare const Card: {
71
193
  * </Card.Root>
72
194
  * ```
73
195
  */
74
- readonly Body: import("react").ForwardRefExoticComponent<Omit<CardProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
196
+ readonly Body: typeof Body;
75
197
  /**
76
198
  * The footer container of a card.
77
199
  *
@@ -92,7 +214,7 @@ declare const Card: {
92
214
  * </Card.Root>
93
215
  * ```
94
216
  */
95
- readonly Footer: import("react").ForwardRefExoticComponent<Omit<CardProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
217
+ readonly Footer: typeof Footer;
96
218
  /**
97
219
  * The header container of a card.
98
220
  *
@@ -113,7 +235,7 @@ declare const Card: {
113
235
  * </Card.Root>
114
236
  * ```
115
237
  */
116
- readonly Header: import("react").ForwardRefExoticComponent<Omit<CardProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
238
+ readonly Header: typeof Header;
117
239
  /**
118
240
  * The title of a card.
119
241
  *
@@ -134,7 +256,7 @@ declare const Card: {
134
256
  * </Card.Root>
135
257
  * ```
136
258
  */
137
- readonly Title: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLHeadingElement> & WithAsChild & import("react").RefAttributes<HTMLHeadingElement>>;
259
+ readonly Title: typeof Title;
138
260
  };
139
261
  //#endregion
140
262
  export { Card, type CardProps, type CardTitleProps };
package/dist/card.js CHANGED
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-DmPrjM7N.js";import{forwardRef as n}from"react";import{jsx as r}from"react/jsx-runtime";const i=n(({asChild:n=!1,className:i,children:a,...o},s)=>r(n?t:`div`,{ref:s,"data-slot":`card`,className:e(`border-card bg-card relative rounded-md border`,i),...o,children:a}));i.displayName=`Card`;const a=n(({asChild:n=!1,className:i,children:a,...o},s)=>r(n?t:`div`,{ref:s,"data-slot":`card-body`,className:e(`p-6 border-t border-card-muted first:border-t-0`,i),...o,children:a}));a.displayName=`CardBody`;const o=n(({asChild:n=!1,className:i,children:a,...o},s)=>r(n?t:`div`,{ref:s,"data-slot":`card-footer`,className:e(`px-6 py-3 border-t border-card-muted first:border-t-0`,i),...o,children:a}));o.displayName=`CardFooter`;const s=n(({asChild:n=!1,className:i,children:a,...o},s)=>r(n?t:`div`,{ref:s,"data-slot":`card-header`,className:e(`px-6 py-3 border-t border-card-muted first:border-t-0`,i),...o,children:a}));s.displayName=`CardHeader`;const c=n(({className:n,asChild:i,...a},o)=>r(i?t:`h3`,{ref:o,"data-slot":`card-title`,className:e(`text-strong text-base font-medium`,n),...a}));c.displayName=`CardTitle`;const l={Root:i,Body:a,Footer:o,Header:s,Title:c};export{l as Card};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{t}from"./slot-CDk0Bb9z.js";import{jsx as n}from"react/jsx-runtime";const r={Root:({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`div`,{ref:o,"data-slot":`card`,className:e(`border-card bg-card relative rounded-md border`,i),...s,children:a}),Body:({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`div`,{ref:o,"data-slot":`card-body`,className:e(`p-6 border-t border-card-muted first:border-t-0`,i),...s,children:a}),Footer:({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`div`,{ref:o,"data-slot":`card-footer`,className:e(`px-6 py-3 border-t border-card-muted first:border-t-0`,i),...s,children:a}),Header:({asChild:r=!1,className:i,children:a,ref:o,...s})=>n(r?t:`div`,{ref:o,"data-slot":`card-header`,className:e(`px-6 py-3 border-t border-card-muted first:border-t-0`,i),...s,children:a}),Title:({className:r,asChild:i,ref:a,...o})=>n(i?t:`h3`,{ref:a,"data-slot":`card-title`,className:e(`text-strong text-base font-medium`,r),...o})};export{r as Card};
@@ -1,6 +1,177 @@
1
- import { t as WithAsChild } from "./as-child-CYEVu1WY.js";
1
+ import { n as WithAsChild } from "./as-child-D23mGo4f.js";
2
2
  import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
3
+ import { ComponentProps } from "react";
3
4
  //#region src/components/centered-layout/centered-layout.d.ts
5
+ /**
6
+ * The outer frame of a centered page flow. Renders a `<div>` with
7
+ * `flex min-h-full flex-col` so it fills its nearest sized ancestor and stacks
8
+ * `CenteredLayout.Notice` and `CenteredLayout.Header` (pinned top),
9
+ * `CenteredLayout.Body` (which grows), and `CenteredLayout.Footer` (pinned
10
+ * bottom). Consumers whose host requires an exact height can merge `h-full`
11
+ * via `className` — `cx` is tailwind-merge-backed, so the override is
12
+ * deterministic.
13
+ *
14
+ * @see https://mantle.ngrok.com/layouts/centered-layout
15
+ *
16
+ * @example
17
+ * ```tsx
18
+ * <CenteredLayout.Root>
19
+ * <SkipToMainLink />
20
+ * <CenteredLayout.Body>
21
+ * <a href="https://ngrok.com">
22
+ * <NgrokWordmarkIcon className="h-auto w-24" />
23
+ * </a>
24
+ * <Main>
25
+ * <SignInCard />
26
+ * </Main>
27
+ * </CenteredLayout.Body>
28
+ * <CenteredLayout.Footer>
29
+ * <ThemeSwitcher.Root>
30
+ * <ThemeSwitcher.Trigger />
31
+ * <ThemeSwitcher.Content />
32
+ * </ThemeSwitcher.Root>
33
+ * </CenteredLayout.Footer>
34
+ * </CenteredLayout.Root>
35
+ * ```
36
+ */
37
+ declare const Root: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
38
+ /**
39
+ * A full-window-width strip pinned above everything else in the layout —
40
+ * including `CenteredLayout.Header` — for impersonation notices, environment
41
+ * warnings, and similar app-wide messaging. Renders an unstyled `<div>`
42
+ * (`w-full shrink-0`): the notice content brings its own colors and layout,
43
+ * and the part collapses to nothing when empty, so it can stay mounted and
44
+ * conditionally render its contents. The same slot contract as the
45
+ * app-layout shell's notice strip, so an app-wide banner composes
46
+ * identically across mantle's layouts. Deliberately
47
+ * not named Banner — `CenteredLayout.Header` renders the page's `<header>`
48
+ * (the ARIA `banner` landmark), and this part is not that. Optional: omitting
49
+ * it is fine.
50
+ *
51
+ * On flows that scroll (checkout, plan pickers), the strip scrolls away with
52
+ * the page by default; merge `sticky top-0 z-20` via `className` to pin it to
53
+ * the window. To pin it alongside a sticky `Header`, wrap the two strips in
54
+ * a single `sticky top-0` container instead — two elements pinned at `top-0`
55
+ * overlap each other once the page scrolls.
56
+ *
57
+ * @see https://mantle.ngrok.com/layouts/centered-layout
58
+ *
59
+ * @example
60
+ * ```tsx
61
+ * <CenteredLayout.Root>
62
+ * <CenteredLayout.Notice>
63
+ * {isImpersonating && <ImpersonationBanner />}
64
+ * </CenteredLayout.Notice>
65
+ * <CenteredLayout.Body>
66
+ * <Main>
67
+ * <SignInCard />
68
+ * </Main>
69
+ * </CenteredLayout.Body>
70
+ * </CenteredLayout.Root>
71
+ * ```
72
+ */
73
+ declare const Notice: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
74
+ /**
75
+ * A utility strip at the top of the layout — an account chip, a close/dismiss
76
+ * button, and similar page furniture for focused flows (checkout, plan
77
+ * pickers). Renders a semantic `<header>` (a page-level frame, so it is
78
+ * exposed as a `banner` landmark when not nested inside a sectioning element)
79
+ * with `flex shrink-0 items-center px-4 py-4`. It sits **outside** the
80
+ * centered `flex-1` region, mirroring `CenteredLayout.Footer`. Optional:
81
+ * omitting it is fine.
82
+ *
83
+ * To pin it to the window while the page scrolls (e.g. a close button that
84
+ * stays reachable), merge `sticky top-0 z-10` via `className` — prefer
85
+ * `sticky` over `fixed`, which removes the strip from flow and underlaps the
86
+ * content below it.
87
+ *
88
+ * @see https://mantle.ngrok.com/layouts/centered-layout
89
+ *
90
+ * @example
91
+ * ```tsx
92
+ * <CenteredLayout.Root>
93
+ * <CenteredLayout.Header className="sticky top-0 z-10 justify-between">
94
+ * <AccountChip />
95
+ * <IconButton appearance="ghost" intent="neutral" type="button" label="Close" icon={<XIcon />} />
96
+ * </CenteredLayout.Header>
97
+ * <CenteredLayout.Body>
98
+ * <div className="w-full max-w-5xl">
99
+ * <PlanPicker />
100
+ * </div>
101
+ * </CenteredLayout.Body>
102
+ * </CenteredLayout.Root>
103
+ * ```
104
+ */
105
+ declare const Header: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"header"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
106
+ /**
107
+ * The growing, centered region of the layout. Renders a `<div>` with
108
+ * `flex flex-1 flex-col items-center justify-center gap-6 py-4` so its
109
+ * children are centered in the space left over by `CenteredLayout.Header`
110
+ * and `CenteredLayout.Footer`. Content taller than the viewport top-flows
111
+ * and the page scrolls, because `Root` grows (`min-h-full`) instead of
112
+ * clipping.
113
+ *
114
+ * By convention the brand mark (a fully-styled logo/wordmark anchor) is the
115
+ * **first child** of `Body` — there is deliberately no `Logo` part because it
116
+ * would own nothing: vertical spacing comes from `Body`'s `gap-6`, and the
117
+ * mark arrives as already-styled JSX.
118
+ *
119
+ * @see https://mantle.ngrok.com/layouts/centered-layout
120
+ *
121
+ * @example
122
+ * ```tsx
123
+ * <CenteredLayout.Root>
124
+ * <SkipToMainLink />
125
+ * <CenteredLayout.Body>
126
+ * <a href="https://ngrok.com">
127
+ * <NgrokWordmarkIcon className="h-auto w-24" />
128
+ * </a>
129
+ * <Main>
130
+ * <SignInCard />
131
+ * </Main>
132
+ * </CenteredLayout.Body>
133
+ * <CenteredLayout.Footer>
134
+ * <ThemeSwitcher.Root>
135
+ * <ThemeSwitcher.Trigger />
136
+ * <ThemeSwitcher.Content />
137
+ * </ThemeSwitcher.Root>
138
+ * </CenteredLayout.Footer>
139
+ * </CenteredLayout.Root>
140
+ * ```
141
+ */
142
+ declare const Body: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"div"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
143
+ /**
144
+ * A pinned utility strip at the bottom of the layout — a theme switcher,
145
+ * legal links, and similar page furniture. Renders a semantic `<footer>`
146
+ * (a page-level frame, so it is exposed as a `contentinfo` landmark — unlike
147
+ * `Card.Footer`'s generic div) with `flex shrink-0 items-center px-4 py-4`.
148
+ * It sits **outside** the centered `flex-1` region — which is exactly why
149
+ * `Body` exists as a separate part. Optional: omitting it is fine.
150
+ *
151
+ * @see https://mantle.ngrok.com/layouts/centered-layout
152
+ *
153
+ * @example
154
+ * ```tsx
155
+ * <CenteredLayout.Root>
156
+ * <SkipToMainLink />
157
+ * <CenteredLayout.Body>
158
+ * <a href="https://ngrok.com">
159
+ * <NgrokWordmarkIcon className="h-auto w-24" />
160
+ * </a>
161
+ * <Main>
162
+ * <SignInCard />
163
+ * </Main>
164
+ * </CenteredLayout.Body>
165
+ * <CenteredLayout.Footer>
166
+ * <ThemeSwitcher.Root>
167
+ * <ThemeSwitcher.Trigger />
168
+ * <ThemeSwitcher.Content />
169
+ * </ThemeSwitcher.Root>
170
+ * </CenteredLayout.Footer>
171
+ * </CenteredLayout.Root>
172
+ * ```
173
+ */
174
+ declare const Footer: ({ asChild, children, className, "data-slot": dataSlot, ...props }: ComponentProps<"footer"> & WithAsChild & WithDataSlot) => import("react").JSX.Element;
4
175
  /**
5
176
  * A viewport-filling centered page flow for sign-in, sign-up, onboarding,
6
177
  * 404, checkout, and other focused full-page states. It owns structure only —
@@ -14,6 +185,7 @@ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
14
185
  * Composition:
15
186
  * ```
16
187
  * CenteredLayout.Root
188
+ * ├── CenteredLayout.Notice
17
189
  * ├── CenteredLayout.Header
18
190
  * ├── CenteredLayout.Body
19
191
  * └── CenteredLayout.Footer
@@ -43,9 +215,9 @@ import { t as WithDataSlot } from "./data-slot-CChfb_cv.js";
43
215
  declare const CenteredLayout: {
44
216
  /**
45
217
  * The outer frame of a centered page flow. Fills its nearest sized ancestor
46
- * (`min-h-full`) and stacks `Header` (pinned top), `Body` (which grows),
47
- * and `Footer` (pinned bottom). Merge `h-full` via `className` when the
48
- * host requires an exact height.
218
+ * (`min-h-full`) and stacks `Notice` and `Header` (pinned top), `Body`
219
+ * (which grows), and `Footer` (pinned bottom). Merge `h-full` via
220
+ * `className` when the host requires an exact height.
49
221
  *
50
222
  * @see https://mantle.ngrok.com/layouts/centered-layout
51
223
  *
@@ -70,7 +242,36 @@ declare const CenteredLayout: {
70
242
  * </CenteredLayout.Root>
71
243
  * ```
72
244
  */
73
- readonly Root: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & WithAsChild & WithDataSlot, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
245
+ readonly Root: typeof Root;
246
+ /**
247
+ * A full-window-width strip pinned above everything else in the layout —
248
+ * including `Header` — for impersonation notices and environment warnings.
249
+ * Renders an unstyled `<div>` (`w-full shrink-0`): the notice content
250
+ * brings its own colors, and the part collapses to nothing when empty. The
251
+ * same slot contract as the app-layout shell's notice strip, so an
252
+ * app-wide banner composes identically across mantle's layouts. Merge
253
+ * `sticky top-0 z-20` via `className` to pin it while a long flow scrolls
254
+ * (to pin it alongside a sticky `Header`, wrap the two strips in a single
255
+ * `sticky top-0` container instead — two elements pinned at `top-0`
256
+ * overlap once the page scrolls). Optional — omitting it is fine.
257
+ *
258
+ * @see https://mantle.ngrok.com/layouts/centered-layout
259
+ *
260
+ * @example
261
+ * ```tsx
262
+ * <CenteredLayout.Root>
263
+ * <CenteredLayout.Notice>
264
+ * {isImpersonating && <ImpersonationBanner />}
265
+ * </CenteredLayout.Notice>
266
+ * <CenteredLayout.Body>
267
+ * <Main>
268
+ * <SignInCard />
269
+ * </Main>
270
+ * </CenteredLayout.Body>
271
+ * </CenteredLayout.Root>
272
+ * ```
273
+ */
274
+ readonly Notice: typeof Notice;
74
275
  /**
75
276
  * A utility strip at the top of the layout (account chip, close button)
76
277
  * rendered as a semantic `<header>` (`banner` landmark) outside the
@@ -95,7 +296,7 @@ declare const CenteredLayout: {
95
296
  * </CenteredLayout.Root>
96
297
  * ```
97
298
  */
98
- readonly Header: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLElement> & import("react").HTMLAttributes<HTMLElement> & WithAsChild & WithDataSlot, "ref"> & import("react").RefAttributes<HTMLElement>>;
299
+ readonly Header: typeof Header;
99
300
  /**
100
301
  * The growing, centered region of the layout. By convention the brand mark
101
302
  * (a fully-styled logo/wordmark anchor) is its **first child** — spacing
@@ -124,7 +325,7 @@ declare const CenteredLayout: {
124
325
  * </CenteredLayout.Root>
125
326
  * ```
126
327
  */
127
- readonly Body: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & WithAsChild & WithDataSlot, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
328
+ readonly Body: typeof Body;
128
329
  /**
129
330
  * A pinned utility strip (theme switcher, legal links) rendered as a
130
331
  * semantic `<footer>` (`contentinfo` landmark) outside the centered
@@ -153,7 +354,7 @@ declare const CenteredLayout: {
153
354
  * </CenteredLayout.Root>
154
355
  * ```
155
356
  */
156
- readonly Footer: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLElement> & import("react").HTMLAttributes<HTMLElement> & WithAsChild & WithDataSlot, "ref"> & import("react").RefAttributes<HTMLElement>>;
357
+ readonly Footer: typeof Footer;
157
358
  };
158
359
  //#endregion
159
360
  export { CenteredLayout };
@@ -1 +1 @@
1
- import{t as e}from"./cx-IiQEAKf5.js";import{n as t,t as n}from"./slot-DmPrjM7N.js";import{forwardRef as r}from"react";import{jsx as i}from"react/jsx-runtime";const a=r(({asChild:r,children:a,className:o,"data-slot":s,...c},l)=>i(r?n:`div`,{ref:l,"data-slot":t(s,`centered-layout`),className:e(`flex min-h-full flex-col`,o),...c,children:a}));a.displayName=`CenteredLayout`;const o=r(({asChild:r,children:a,className:o,"data-slot":s,...c},l)=>i(r?n:`header`,{ref:l,"data-slot":t(s,`centered-layout-header`),className:e(`flex shrink-0 items-center px-4 py-4`,o),...c,children:a}));o.displayName=`CenteredLayoutHeader`;const s=r(({asChild:r,children:a,className:o,"data-slot":s,...c},l)=>i(r?n:`div`,{ref:l,"data-slot":t(s,`centered-layout-body`),className:e(`flex flex-1 flex-col items-center justify-center gap-6 py-4`,o),...c,children:a}));s.displayName=`CenteredLayoutBody`;const c=r(({asChild:r,children:a,className:o,"data-slot":s,...c},l)=>i(r?n:`footer`,{ref:l,"data-slot":t(s,`centered-layout-footer`),className:e(`flex shrink-0 items-center px-4 py-4`,o),...c,children:a}));c.displayName=`CenteredLayoutFooter`;const l={Root:a,Header:o,Body:s,Footer:c};export{l as CenteredLayout};
1
+ import{t as e}from"./cx-IiQEAKf5.js";import{n as t,t as n}from"./slot-CDk0Bb9z.js";import{jsx as r}from"react/jsx-runtime";const i={Root:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`centered-layout`),className:e(`flex min-h-full flex-col`,o),...c,children:a}),Notice:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`centered-layout-notice`),className:e(`w-full shrink-0`,o),...c,children:a}),Header:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`header`,{"data-slot":t(s,`centered-layout-header`),className:e(`flex shrink-0 items-center px-4 py-4`,o),...c,children:a}),Body:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`div`,{"data-slot":t(s,`centered-layout-body`),className:e(`flex flex-1 flex-col items-center justify-center gap-6 py-4`,o),...c,children:a}),Footer:({asChild:i,children:a,className:o,"data-slot":s,...c})=>r(i?n:`footer`,{"data-slot":t(s,`centered-layout-footer`),className:e(`flex shrink-0 items-center px-4 py-4`,o),...c,children:a})};export{i as CenteredLayout};
@@ -0,0 +1,2 @@
1
+ import{n as e}from"./compose-refs-BdBMM9ga.js";import{t}from"./cx-IiQEAKf5.js";import{n}from"./slot-CDk0Bb9z.js";import{t as r}from"./button-BAno7KIU.js";import{t as i}from"./use-copy-to-clipboard-DqQ0_N3E.js";import{createContext as a,useContext as o,useEffect as s,useId as c,useLayoutEffect as l,useMemo as u,useRef as d,useState as f,useSyncExternalStore as p}from"react";import m from"tiny-invariant";import{Fragment as h,jsx as g,jsxs as _}from"react/jsx-runtime";import{CheckIcon as v}from"@phosphor-icons/react/Check";import{CopyIcon as y}from"@phosphor-icons/react/Copy";import{scaleTime as b}from"d3-scale";import{area as x,curveLinear as S,curveMonotoneX as C,curveStep as w,line as T}from"d3-shape";const E=(e,t)=>Reflect.get(e,t),D=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`,`chart-other`],O=e=>D.includes(e),k=e=>`--color-${e}`,A=[`chart-1`,`chart-2`,`chart-3`,`chart-4`,`chart-5`,`chart-6`,`chart-7`,`chart-8`],j=e=>{let t=e.toLowerCase();return t.includes(`var(`)||t.includes(`currentcolor`)},M=(e,t)=>{let n=e.ownerDocument,r=n.createElement(`span`);r.style.display=`none`,r.style.color=t,e.appendChild(r);let i=n.defaultView?.getComputedStyle(r).color??``;return r.remove(),i},ee=(e,t)=>O(t)?M(e,`var(${k(t)})`):j(t)?M(e,t):t,te=e=>({grid:M(e,`var(--border-color-card-muted)`),baseline:M(e,`var(--border-color-card)`),tickText:M(e,`var(--text-color-muted)`),reference:M(e,`var(--color-neutral-500)`),surface:M(e,`var(--background-color-card)`)}),N=e=>`${e.className}|${e.getAttribute(`data-applied-theme`)??``}|${e.getAttribute(`data-theme`)??``}`,P=(e,t)=>{let n=new MutationObserver(t);return n.observe(e,{attributes:!0,attributeFilter:[`class`,`data-applied-theme`,`data-theme`]}),()=>n.disconnect()},F=1.5,I=1.6,ne=e=>`oklch(from ${e} calc(l - 0.18) c h)`,L=(e,t,n)=>{let r=F;if(n===`up`){e.moveTo(-1.5,t+r),e.lineTo(t+r,-1.5),e.moveTo(-1.5,r),e.lineTo(r,-1.5),e.moveTo(t-r,t+r),e.lineTo(t+r,t-r);return}e.moveTo(-1.5,-1.5),e.lineTo(t+r,t+r),e.moveTo(t-r,-1.5),e.lineTo(t+r,r),e.moveTo(-1.5,t-r),e.lineTo(r,t+r)},re=(e,t)=>{let{texture:n,color:r,ink:i,devicePixelRatio:a,orientation:o}=t,s=e.canvas.ownerDocument.createElement(`canvas`);s.width=Math.max(1,Math.round(8*a)),s.height=s.width;let c=s.getContext(`2d`);if(c==null)return null;let l=s.width/8;c.scale(l,l),c.fillStyle=r,c.fillRect(0,0,8,8),n===`perpendicular`?(c.fillStyle=i,o===`horizontal`?c.fillRect(8/2-2/2,0,2,8):c.fillRect(0,8/2-2/2,8,2)):n===`dots`?(c.fillStyle=i,c.beginPath(),c.arc(8/4,8/4,I,0,Math.PI*2),c.moveTo(7.6,24/4),c.arc(24/4,24/4,I,0,Math.PI*2),c.fill()):(c.strokeStyle=i,c.lineWidth=n===`crosshatch`?1:F,c.beginPath(),(n===`hatch`||n===`crosshatch`)&&L(c,8,`up`),(n===`hatch-reverse`||n===`crosshatch`)&&L(c,8,`down`),c.stroke());let u=e.createPattern(s,`repeat`);return u?.setTransform({a:1/l,b:0,c:0,d:1/l,e:0,f:0}),u},R=e=>{let{pointCount:t,columnCount:n,wasDecimated:r}=e;return n<=0?!1:r?t>=n*3:t>=n*4},ie=e=>{let{xs:t,values:n,startIndex:r,endIndex:i,positionK:a,positionB:o,columnCount:s}=e,c=new Uint8Array(s),l=new Float64Array(s),u=new Float64Array(s),d=new Float64Array(s),f=new Float64Array(s);for(let e=r;e<=i;e++){let r=n[e]??NaN;if(Number.isNaN(r))continue;let i=t[e]??NaN,p=Math.floor(i*a+o);if(p===s&&(p=s-1),!(p<0||p>=s)){if(c[p]===0){c[p]=1,l[p]=r,u[p]=r,d[p]=r,f[p]=r;continue}r<(l[p]??1/0)&&(l[p]=r),r>(u[p]??-1/0)&&(u[p]=r),f[p]=r}}return{columnCount:s,hasData:c,minValue:l,maxValue:u,inValue:d,outValue:f}},ae=new Intl.NumberFormat,oe=new Intl.NumberFormat(void 0,{maximumSignificantDigits:4}),z=new Map,B=(e,t)=>{let n=Object.is(e,-0)?0:e,r=t?.maximumFractionDigits;if(r!=null){let e=z.get(r);return e??(e=new Intl.NumberFormat(void 0,{maximumFractionDigits:r}),z.set(r,e)),e.format(n)}return n!==0&&Math.abs(n)<1?oe.format(n):ae.format(n)},V=e=>!Number.isFinite(e)||e<=0?0:Math.min(20,Math.max(0,-Math.floor(Math.log10(e)))),se=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`numeric`,minute:`2-digit`}),H=new Intl.DateTimeFormat(void 0,{year:`numeric`,month:`short`,day:`numeric`}),ce=e=>e.getHours()!==0||e.getMinutes()!==0||e.getSeconds()!==0||e.getMilliseconds()!==0,U=(e,t)=>typeof e==`string`?e:typeof e==`number`?B(e):Number.isNaN(e.getTime())?`—`:t?.datasetHasTimeOfDay??ce(e)?se.format(e):H.format(e),le=(e,t,n)=>{if(t<=0)return null;let r=0,i=t-1,a=e[0]??0,o=e[i]??0;if(n<=a)return 0;if(n>=o)return i;for(;i-r>1;){let t=r+i>>1;(e[t]??0)<=n?r=t:i=t}let s=n-(e[r]??0);return(e[i]??0)-n<s?i:r},ue=Math.PI/2-.05,de=e=>({cosYaw:Math.cos(e.yaw),sinYaw:Math.sin(e.yaw),cosPitch:Math.cos(e.pitch),sinPitch:Math.sin(e.pitch)}),fe=(e,t,n,r)=>{let i=e*r.cosYaw+n*r.sinYaw,a=-e*r.sinYaw+n*r.cosYaw,o=t*r.cosPitch-a*r.sinPitch,s=t*r.sinPitch+a*r.cosPitch,c=4/(4+s);return{x:i*c,y:o*c,depth:s,scale:c}},pe=e=>Math.min(ue,Math.max(-ue,e)),me=(e,t)=>{let n=t[1]-t[0];return n===0?0:(e-t[0])/n*2-1},he=[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1],[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],ge=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]],_e=Math.sqrt(50),ve=Math.sqrt(10),ye=Math.sqrt(2),W=(e,t,n)=>{let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=_e?10:a>=ve?5:a>=ye?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&(s+=1),c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&(s+=1),c*l>t&&--c),c<s&&.5<=n&&n<2?W(e,t,n*2):[s,c,l]},be=(e,t,n)=>{if(!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?W(t,e,n):W(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=[];for(let e=0;e<s;e+=1){let t=r?a-e:i+e;c.push(o<0?t/-o:t*o)}return c},xe=(e,t,n)=>W(e,t,n)[2],G=(e,t)=>{let n=e[1]-e[0];if(n===0)return{k:0,b:(t[0]+t[1])/2};let r=(t[1]-t[0])/n;return{k:r,b:t[0]-e[0]*r}},Se=e=>{let{count:t,rangeStart:n,rangeEnd:r,paddingInner:i,paddingOuter:a}=e,o=r-n;if(t<=0||o<=0)return{count:Math.max(0,t),rangeStart:n,step:0,bandwidth:0,offset:0};let s=o/Math.max(1,t-i+a*2);return{count:t,rangeStart:n,step:s,bandwidth:s*(1-i),offset:s*a}},K=(e,t)=>e.rangeStart+e.offset+t*e.step,q=(e,t)=>K(e,t)+e.bandwidth/2,Ce=(e,t)=>{if(e.count===0||e.step===0)return null;let n=Math.floor((t-e.rangeStart-e.offset+e.step/2-e.bandwidth/2)/e.step);return Math.min(e.count-1,Math.max(0,n))},we=(e,t)=>be(e[0],e[1],t);let J=null,Te=null;const Ee=e=>{if(Te!=null&&J!=null&&J[0]===e[0]&&J[1]===e[1])return Te;let t=b().domain([new Date(e[0]),new Date(e[1])]);return J=[e[0],e[1]],Te=t,t},De=(e,t)=>Ee(e).ticks(t).map(e=>e.getTime()),Oe=e=>{let t=Ee(e).tickFormat();return e=>t(new Date(e))},Y=(e,t)=>{if(e[0]>e[1])return Y([e[1],e[0]],t);if(e[0]===e[1]){let n=e[0],r=n===0?1:Math.abs(n)*.5;return Y([n-r,n+r],t)}let n=e[0],r=e[1],i=NaN;for(let e=0;e<10;e++){let e=xe(n,r,t);if(e===i||e===0||!Number.isFinite(e))break;if(e>0)n=Math.floor(n/e)*e,r=Math.ceil(r/e)*e;else{let t=-e;n=Math.floor(n*t)/t,r=Math.ceil(r*t)/t}i=e}return[n,r]},ke=e=>e===`monotone`?C:e===`step`?w:S,X=e=>Math.round(e)+.5,Ae=(e,t)=>{let{plot:n,color:r,xLines:i,yLines:a}=t;e.save(),e.strokeStyle=r,e.lineWidth=1;for(let t of i)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(X(t.position),n.top),e.lineTo(X(t.position),n.top+n.height),e.stroke();for(let t of a)e.globalAlpha=t.alpha,e.beginPath(),e.moveTo(n.left,X(t.position)),e.lineTo(n.left+n.width,X(t.position)),e.stroke();e.restore()},je=(e,t)=>{let{plot:n,color:r,y:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(n.left,X(i)),e.lineTo(n.left+n.width,X(i)),e.stroke()},Me=(e,t)=>{let{plot:n,color:r,x:i}=t;e.strokeStyle=r,e.lineWidth=1,e.beginPath(),e.moveTo(X(i),n.top),e.lineTo(X(i),n.top+n.height),e.stroke()},Ne=(e,t)=>{let{fill:n,rects:r}=t;e.fillStyle=n,e.beginPath();for(let t of r){let n=Math.max(.5,t.width),r=Math.min(t.valueY,t.baselineY),i=Math.abs(t.baselineY-t.valueY);if(i===0)continue;let a=t.rounded&&n>=8?Math.min(4,n/2,i):0;if(a===0){e.rect(t.x,r,n,i);continue}t.valueY<=t.baselineY?e.roundRect(t.x,r,n,i,[a,a,0,0]):e.roundRect(t.x,r,n,i,[0,0,a,a])}e.fill()},Pe=(e,t)=>{let{fill:n,rects:r}=t;e.fillStyle=n,e.beginPath();for(let t of r){let n=Math.max(.5,t.height),r=Math.min(t.valueX,t.baselineX),i=Math.abs(t.valueX-t.baselineX);if(i===0)continue;let a=t.rounded&&n>=8?Math.min(4,n/2,i):0;if(a===0){e.rect(r,t.y,i,n);continue}t.valueX>=t.baselineX?e.roundRect(r,t.y,i,n,[0,a,a,0]):e.roundRect(r,t.y,i,n,[a,0,0,a])}e.fill()},Fe=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,yAt:o,definedAt:s}=t,c=T().x(a).y(o).defined(s).curve(ke(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),c(i),e.stroke()},Ie=(e,t)=>{let{color:n,curve:r,indexes:i,xAt:a,y0At:o,y1At:s,definedAt:c}=t,l=x().x(a).y0(o).y1(s).defined(c).curve(ke(r)).context(e);e.beginPath(),l(i),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore();let u=T().x(a).y(s).defined(c).curve(ke(r)).context(e);e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath(),u(i),e.stroke()},Le=(e,t)=>{let{color:n,columns:r,columnToX:i,valueK:a,valueB:o}=t;e.strokeStyle=n,e.lineWidth=2,e.lineJoin=`round`,e.lineCap=`round`,e.beginPath();let s=!1;for(let t=0;t<r.columnCount;t++){if(r.hasData[t]===0){s=!1;continue}let n=i(t),c=(r.inValue[t]??0)*a+o,l=(r.minValue[t]??0)*a+o,u=(r.maxValue[t]??0)*a+o,d=(r.outValue[t]??0)*a+o;s?e.lineTo(n,c):(e.moveTo(n,c),s=!0),(l!==c||u!==c)&&(e.lineTo(n,l),e.lineTo(n,u)),d!==u&&e.lineTo(n,d)}e.stroke()},Re=(e,t)=>{let{color:n,lowerColumns:r,upperColumns:i,columnToX:a,valueK:o,valueB:s}=t;e.beginPath();let c=-1,l=t=>{if(c<0)return;let n=!1;for(let r=c;r<=t;r++){let t=a(r),c=(i.maxValue[r]??0)*o+s;n?e.lineTo(t,c):(e.moveTo(t,c),n=!0)}for(let n=t;n>=c;n--){let t=a(n),i=(r.minValue[n]??0)*o+s;e.lineTo(t,i)}e.closePath(),c=-1};for(let e=0;e<i.columnCount;e++){if(i.hasData[e]===0){l(e-1);continue}c<0&&(c=e)}l(i.columnCount-1),e.save(),e.globalAlpha=.1,e.fillStyle=n,e.fill(),e.restore(),Le(e,{color:n,columns:i,columnToX:a,valueK:o,valueB:s})},ze=(e,t,n,r,i)=>{if(i===`square`){let i=r*.886;e.moveTo(t-i,n-i),e.lineTo(t+i,n-i),e.lineTo(t+i,n+i),e.lineTo(t-i,n+i),e.closePath();return}if(i===`triangle`){let i=r*1.55;e.moveTo(t,n-i),e.lineTo(t+i*.866,n+i*.5),e.lineTo(t-i*.866,n+i*.5),e.closePath();return}if(i===`diamond`){let i=r*1.253;e.moveTo(t,n-i),e.lineTo(t+i,n),e.lineTo(t,n+i),e.lineTo(t-i,n),e.closePath();return}e.arc(t,n,r,0,Math.PI*2)},Be=(e,t)=>{let{color:n,surface:r,shape:i,indexes:a,xAt:o,yAt:s,definedAt:c}=t;e.fillStyle=n,e.strokeStyle=r,e.lineWidth=2;for(let t of a)c(t)&&(e.beginPath(),ze(e,o(t),s(t),4,i),e.fill(),e.stroke())},Ve=5e3,He=2e4,Ue=(e,t)=>{let{color:n,surface:r,shape:i,totalPointCount:a,indexes:o,xAt:s,yAt:c,radiusAt:l}=t;if(e.fillStyle=n,a>He){e.beginPath();for(let t of o)l(t)<=0||e.rect(s(t)-1,c(t)-1,2,2);e.fill();return}let u=a<=Ve;e.strokeStyle=r,e.lineWidth=2;for(let t of o){let n=l(t);n<=0||(e.beginPath(),ze(e,s(t),c(t),n,i),e.fill(),u&&e.stroke())}},We=(e,t)=>{let{count:n,order:r,screenX:i,screenY:a,radius:o,colorAt:s,shapeAt:c,alphaAt:l,surface:u}=t;if(e.save(),n>He){let t=``,n=-1;for(let c of r){let r=s(c);r!==t&&(e.fillStyle=r,t=r);let u=l(c);u!==n&&(e.globalAlpha=u,n=u);let d=Math.max(1,(o[c]??0)/2);e.fillRect((i[c]??0)-d/2,(a[c]??0)-d/2,d,d)}e.restore();return}let d=n<=Ve;e.strokeStyle=u,e.lineWidth=2;let f=``,p=-1;for(let t of r){let n=s(t);n!==f&&(e.fillStyle=n,f=n);let r=l(t);r!==p&&(e.globalAlpha=r,p=r),e.beginPath(),ze(e,i[t]??0,a[t]??0,o[t]??0,c(t)),e.fill(),d&&e.stroke()}e.restore()},Ge=(e,t)=>{let{gridColor:n,axisColor:r,corners:i,edges:a,cubeAlpha:o,axes:s}=t;if(e.save(),o>.01){e.globalAlpha=o,e.strokeStyle=n,e.lineWidth=1,e.beginPath();for(let[t,n]of a){let r=i[t],a=i[n];r!=null&&a!=null&&(e.moveTo(r.x,r.y),e.lineTo(a.x,a.y))}e.stroke()}e.strokeStyle=r;for(let{alpha:t,from:n,to:r}of s)t<=.01||(e.globalAlpha=t,e.beginPath(),e.moveTo(n.x,n.y),e.lineTo(r.x,r.y),e.stroke());e.restore()},Ke=(e,t)=>{let{textColor:n,fontFamily:r,plot:i,center:a,axes:o}=t;e.save(),e.fillStyle=n,e.font=`11px ${r}`,e.textAlign=`center`,e.textBaseline=`middle`;for(let{label:t,alpha:n,from:r,to:s}of o){if(n<=.01)continue;let o=Math.hypot(r.x-a.x,r.y-a.y),c=Math.hypot(s.x-a.x,s.y-a.y),l=c>=o?s:r,u=c>=o?r:s,d=Math.max(1,Math.hypot(l.x-u.x,l.y-u.y)),f=(l.x-u.x)/d*16,p=(l.y-u.y)/d*16,m=Math.min(i.left+i.width-8,Math.max(i.left+8,l.x+f)),h=Math.min(i.top+i.height-6,Math.max(i.top+6,l.y+p));e.globalAlpha=n,e.fillText(t,m,h)}e.restore()},qe=(e,t)=>{let{plot:n,color:r,textColor:i,y:a,label:o,fontFamily:s}=t;e.strokeStyle=r,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(n.left,X(a)),e.lineTo(n.left+n.width,X(a)),e.stroke(),e.setLineDash([]),o!=null&&o.length>0&&(e.font=`11px ${s}`,e.fillStyle=i,e.textAlign=`right`,e.textBaseline=`bottom`,e.fillText(o,n.left+n.width-4,a-3))},Je=(e,t)=>{let{plot:n,color:r,textColor:i,x:a,label:o,fontFamily:s}=t;if(e.strokeStyle=r,e.lineWidth=1,e.setLineDash([4,4]),e.beginPath(),e.moveTo(X(a),n.top),e.lineTo(X(a),n.top+n.height),e.stroke(),e.setLineDash([]),o!=null&&o.length>0){e.font=`11px ${s}`,e.fillStyle=i;let t=e.measureText(o).width,r=a+4+t<=n.left+n.width;e.textAlign=r?`left`:`right`,e.textBaseline=`top`,e.fillText(o,r?a+4:a-4,n.top+3)}},Ye=(e,t)=>{let{plot:n,color:r,fontFamily:i,xLabels:a,yLabels:o}=t;e.save(),e.font=`11px ${i}`,e.fillStyle=r,e.textAlign=`right`,e.textBaseline=`middle`;for(let t of o)e.globalAlpha=t.alpha,e.fillText(t.text,n.left-8,t.position);e.textAlign=`center`,e.textBaseline=`top`;for(let t of a)e.globalAlpha=t.alpha,e.fillText(t.text,t.position,n.top+n.height+8);e.restore()},Xe=e=>{let t=e.length,n=e[0]?.length??0,r=[],i=[];for(let e=0;e<t;e++)r.push(new Float64Array(n)),i.push(new Float64Array(n));let a=0,o=0,s=new Float64Array(n),c=new Float64Array(n);for(let l=0;l<t;l++){let t=e[l],u=r[l],d=i[l];if(t!=null&&u!=null&&d!=null)for(let e=0;e<n;e++){let n=t[e]??NaN;if(Number.isNaN(n)){u[e]=NaN,d[e]=NaN;continue}if(n>=0){let t=s[e]??0,r=t+n;s[e]=r,u[e]=t,d[e]=r,r>o&&(o=r)}else{let t=c[e]??0,r=t+n;c[e]=r,u[e]=r,d[e]=t,r<a&&(a=r)}}}return{lower:r,upper:i,min:a,max:o}},Ze=e=>1-(1-e)**3;var Qe=class{#e=new Float64Array;#t=new Float64Array;#n=new Float64Array;#r=0;#i=0;#a=!1;get active(){return this.#a}values(){return this.#n}retarget(e,t){let{duration:n,now:r}=t,i=e.length,a=this.#n.length!==i;if(a&&(this.#e=new Float64Array(i),this.#t=new Float64Array(i),this.#n=new Float64Array(i)),a||n<=0){for(let t=0;t<i;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n,this.#n[t]=n}this.#a=!1;return}let o=!1;for(let t=0;t<i;t++){let n=e[t]??NaN,r=this.#n[t]??NaN;if(r!==n&&!(Number.isNaN(r)&&Number.isNaN(n))){o=!0;break}}if(!o){for(let t=0;t<i;t++)this.#t[t]=e[t]??NaN;this.#a=!1;return}for(let t=0;t<i;t++)this.#e[t]=this.#n[t]??NaN,this.#t[t]=e[t]??NaN;this.#r=r,this.#i=n,this.#a=!0}snap(){this.#n.set(this.#t),this.#a=!1}tick(e){if(!this.#a)return!1;let t=Math.min(1,(e-this.#r)/this.#i),n=Ze(t);for(let e=0;e<this.#n.length;e++){let t=this.#e[e]??NaN,r=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(r)){this.#n[e]=r;continue}this.#n[e]=t+(r-t)*n}return t>=1&&(this.#a=!1),this.#a}},Z=class{#e=new Float64Array;#t=new Float64Array;#n=0;#r=!1;#i;#a;#o=0;constructor(e={}){this.#i=e.speed??.14,this.#a=e.epsilon??.001}get active(){return this.#r}values(){return this.#t}jump(e){this.#t.length!==e.length&&(this.#e=new Float64Array(e.length),this.#t=new Float64Array(e.length));for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n,this.#t[t]=n}this.#r=!1}aim(e,t){if(this.#t.length!==e.length){this.jump(e);return}let n=!1;for(let t=0;t<e.length;t++){let r=e[t]??NaN,i=this.#e[t]??NaN;if(i!==r&&!(Number.isNaN(i)&&Number.isNaN(r))){n=!0;break}}if(!n)return;let r=0;for(let t=0;t<e.length;t++){let n=e[t]??NaN;this.#e[t]=n;let i=Math.abs(n-(this.#t[t]??NaN));Number.isFinite(i)&&i>r&&(r=i)}this.#o=r,this.#r||(this.#r=!0,this.#n=t)}tick(e){if(!this.#r)return!1;let t=Math.min(50,Math.max(0,e-this.#n));this.#n=e;let n=1-(1-this.#i)**(t/16.67),r=Math.max(this.#o*this.#a,2**-52),i=!0;for(let e=0;e<this.#t.length;e++){let t=this.#e[e]??NaN,a=this.#t[e]??NaN;if(Number.isNaN(t)||Number.isNaN(a)){this.#t[e]=t;continue}let o=a+(t-a)*n;n>0&&o===a||Math.abs(t-o)<=r?this.#t[e]=t:(this.#t[e]=o,i=!1)}return this.#r=!i,this.#r}};const $e=e=>`${e.colorInput}|${e.texture}`,et={bar:`BarChart.Bar`,line:`LineChart.Line`,area:`AreaChart.Area`,scatter:`ScatterPlot.Point`},tt=1e3;var nt=class{#e;#t;#n;#r={xKey:``,xScale:`linear`,yDomain:[`auto`,`auto`],orientation:`vertical`,zKey:null,dimensions:3,stacked:!1,animate:!0};#i={onDatumActivate:null,onActiveIndexChange:null};#a;#o=null;#s=null;#c=null;#l=null;#u=0;#d=0;#f=1;#p=[];#m=0;#h=new Float64Array;#g=[];#_=null;#v=null;#y=!1;#b=!1;#x=new Map;#S=0;#C=0;#w=null;#T=new Z({speed:.16});#E=new Z({speed:.2});#D=new Map;#O=new Map;#k=!1;#A=new Map;#j=new Map;#M=0;#N=!1;#P=new Map;#F={alpha:0,target:0};#I=0;#L=null;#R=null;#z=null;#B={left:0,top:0,width:0,height:0};#V=null;#H=new Float64Array;#U=[0,1];#W={yaw:.65,pitch:-.35};#G=new Z({speed:.12});#K=new Z({speed:.16});#q=null;#J=!1;#Y=null;#X=new Int32Array;#Z=new Map;#Q=``;#$=null;#ee=null;#te=null;#ne=void 0;#re=null;#ie=!1;#ae=null;#oe=null;#se={width:0,height:0};#ce=!1;#le=!1;#ue=0;#de=!1;constructor(e){this.#e=e.kind,this.#t=e.elements,this.#n=e.store,this.#a=e.elements.canvas.getContext(`2d`),this.#n.onSeriesChange=()=>{this.#b=!0,this.#Ce()},this.#n.onPresentationChange=()=>{this.#Ce()},typeof ResizeObserver<`u`&&(this.#o=new ResizeObserver(e=>{let t=e[0];t!=null&&(this.#u=t.contentRect.width,this.#d=t.contentRect.height,this.#f=this.#De(),this.#P.clear(),this.#$=null,this.#Ce())}),this.#o.observe(e.elements.plot),this.#c=new ResizeObserver(()=>{this.#se={width:this.#t.tooltip.offsetWidth,height:this.#t.tooltip.offsetHeight},this.#we()}),this.#c.observe(e.elements.tooltip));let t=e.elements.root.ownerDocument.documentElement;this.#s=P(t,()=>{this.#z=null,this.#Ce()}),this.#fe(),this.#K.jump([1,1])}destroy(){this.#de=!0,this.#o?.disconnect(),this.#c?.disconnect(),this.#s?.(),this.#l?.(),this.#n.onSeriesChange=null,this.#n.onPresentationChange=null,this.#L!=null&&(clearTimeout(this.#L),this.#L=null),this.#ue!==0&&cancelAnimationFrame(this.#ue)}#fe(){if(typeof matchMedia>`u`||this.#de)return;this.#l?.();let e=matchMedia(`(resolution: ${this.#De()}dppx)`),t=()=>{this.#f=this.#De(),this.#P.clear(),this.#Ce(),this.#fe()};e.addEventListener(`change`,t,{once:!0}),this.#l=()=>e.removeEventListener(`change`,t)}setOptions(e){let t=this.#r;if(this.#r=e,t.xScale!==e.xScale&&this.#A.clear(),t.animate&&!e.animate&&this.#pe(),t.dimensions!==e.dimensions){let t=[+(e.dimensions>=2),+(e.dimensions>=3)],n=rt(e.dimensions);if(this.#ge()===0||!this.#k)this.#K.jump(t),this.#W=n,this.#G.jump([n.yaw,n.pitch]);else{let e=n.yaw+Math.round((this.#W.yaw-n.yaw)/(Math.PI*2))*Math.PI*2;this.#K.aim(t,performance.now()),this.#G.jump([this.#W.yaw,this.#W.pitch]),this.#G.aim([e,n.pitch],performance.now())}}(t.xKey!==e.xKey||t.xScale!==e.xScale||t.zKey!==e.zKey||t.stacked!==e.stacked||t.yDomain[0]!==e.yDomain[0]||t.yDomain[1]!==e.yDomain[1])&&(this.#b=!0),this.#Ce()}setCallbacks(e){this.#i=e}setRows(e){e!==this.#p&&(this.#p=e,this.#b=!0,this.#Ce())}flushIngest(){!this.#b||this.#de||(this.#b=!1,this.#me())}setControlledActiveIndex(e){let t=this.#re;this.#re=null;let n=this.#ne!==void 0;if(this.#ne=e,e!==void 0){let n=t!=null&&t.index===e&&t.viaKeyboard;this.#Qe(e==null?null:this.#Ye(e),{viaKeyboard:n,notify:!1})}else n&&this.#Qe(null,{viaKeyboard:!1,notify:!1});this.#we()}handlePointerMove(e,t){if(this.#q!=null){let n=e-this.#q.lastX,r=t-this.#q.lastY;(this.#q.moved||Math.abs(n)+Math.abs(r)>3)&&(this.#q.moved=!0,this.#W={yaw:this.#W.yaw+n*.008,pitch:pe(this.#W.pitch+r*.008)},this.#G.jump([this.#W.yaw,this.#W.pitch]),this.#q.lastX=e,this.#q.lastY=t,this.#Qe(null,{viaKeyboard:!1,notify:!1}),this.#Ce());return}if(this.#ae=e,this.#oe=t,this.#e===`scatter`){let n=this.#at(e,t);this.#ee=n?.seriesKey??null,this.#$=n==null?null:{x:n.screenX,y:n.screenY},this.#Qe(n?.index??null,{viaKeyboard:!1,notify:!0});return}let n=this.#Xe(e,t);this.#Qe(n,{viaKeyboard:!1,notify:!0})}handlePointerDown(e,t){if(this.#J=!0,this.#ye()){this.#q={lastX:e,lastY:t,moved:!1};return}this.handlePointerMove(e,t)}handlePointerUp(e,t){let n=this.#q;this.#q=null;let r=this.#J;if(this.#J=!1,n!=null){if(n.moved)return;this.handlePointerMove(e,t)}r&&this.handleActivate(e,t)}handlePointerLeave(){this.#ae=null,this.#oe=null,this.#q=null,this.#J=!1,this.#ee=null,this.#$=null,this.#Qe(null,{viaKeyboard:!1,notify:!0})}handleActivate(e,t){let n=this.#qe();if(n==null)return;let r=this.#Je(n),i=this.#p[r];if(i==null)return;let a=this.#e===`scatter`?this.#ee:e==null||t==null?null:this.#Ze(n,e,t);this.#i.onDatumActivate?.({index:r,xValue:this.#g[n]??``,datum:i,dataKey:a})}handleKeyDown(e){if(this.#m===0)return!1;let t=this.#m-1,n=this.#qe(),r=this.#N?Math.max(1,Math.floor(this.#m/Math.max(1,this.#B.width*this.#f))):1,i=Math.max(1,Math.floor(this.#m/10)),a=(()=>{switch(e){case`ArrowLeft`:return Math.max(0,(n??this.#m)-r);case`ArrowRight`:return Math.min(t,(n??-1)+r);case`PageUp`:return Math.min(t,(n??0)+i);case`PageDown`:return Math.max(0,(n??t)-i);case`Home`:return 0;case`End`:return t;case`Escape`:return null;default:return}})();return a===void 0?e===`Enter`||e===` `?(this.handleActivate(null,null),!0):!1:(this.#ae=null,this.#oe=null,this.#ee=null,this.#$=null,this.#Qe(a,{viaKeyboard:!0,notify:!0}),!0)}invalidateColors(){this.#z=null,this.#Ce()}#pe(){this.#T.jump(this.#_e()),this.#E.jump(this.#ve()),this.#K.jump([+(this.#r.dimensions>=2),+(this.#r.dimensions>=3)]);let e=rt(this.#r.dimensions);this.#W=e,this.#G.jump([e.yaw,e.pitch]);for(let e of this.#D.values())e.snap();for(let e of this.#O.values())e.snap();this.#F.alpha=this.#F.target,this.#Ce()}#me(){let e=this.#p,{xKey:t,xScale:n}=this.#r,r=this.#n.seriesSpecs();this.#P.clear();let i=this.#h;if(n===`band`||n===`point`){let n=e.length,r=new Float64Array(n),i=Array.from({length:n},()=>``),a=!1;for(let o=0;o<n;o++){let n=e[o],s=n==null?void 0:E(n,t);s!==void 0&&(a=!0),i[o]=typeof s==`string`||typeof s==`number`||s instanceof Date?s:String(s),r[o]=o}m(n===0||a,`${this.#xe()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#_=null,this.#v=null,this.#m=n,this.#h=r,this.#g=i}else{let r=[],i=!1,a=!1,o=!1;for(let s=0;s<e.length;s++){let c=e[s],l=c==null?void 0:E(c,t);l!==void 0&&(i=!0),l!=null&&(a=!0);let u=ct(l,n===`time`);Number.isFinite(u)&&(r.push({source:s,x:u}),o=!0)}m(e.length===0||i,`${this.#xe()} xKey "${t}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),m(!a||o,`${this.#xe()} could not read any "${t}" values as ${n===`time`?`dates`:`numbers`} for the "${n}" x scale — check the xScale and the data types.`);let s=!0;for(let e=1;e<r.length;e++)if((r[e]?.x??0)<(r[e-1]?.x??0)){s=!1;break}let c=s?r:r.toSorted((e,t)=>e.x-t.x),l=c.length,u=new Float64Array(l),d=Array.from({length:l},()=>``),f=l===e.length,p=new Int32Array(l);for(let e=0;e<l;e++){let t=c[e];t!=null&&(u[e]=t.x,n===`time`?d[e]=new Date(t.x):d[e]=t.x,p[e]=t.source,t.source!==e&&(f=!1))}if(f)this.#_=null,this.#v=null;else{this.#_=p;let t=new Int32Array(e.length).fill(-1);for(let e=0;e<l;e++){let n=p[e];n!=null&&(t[n]=e)}this.#v=t}this.#m=l,this.#h=u,this.#g=d}let a=!1;for(let e of this.#g)if(e instanceof Date&&ce(e)){a=!0;break}this.#y=a;let o=this.#h[0],s=this.#h[this.#m-1],c=i[0],l=i[i.length-1];!this.#ye()&&(n===`linear`||n===`time`)&&o!=null&&s!=null&&c!=null&&l!=null&&o>c&&s>=l?(this.#F.target=1,this.#I=performance.now()):(o!==c||s!==l)&&(this.#F.target=0);let u=this.#m,d=i.length===u&&u<=2500;if(d){for(let e=0;e<u;e++)if(i[e]!==this.#h[e]){d=!1;break}}let f=this.#x;this.#x=new Map;let p=1/0,h=-1/0;for(let t of r){let n=new Float64Array(u),r=!1;for(let i=0;i<u;i++){let a=e[this.#_==null?i:this.#_[i]??i],o=a==null?void 0:E(a,t.dataKey);if(o===void 0){n[i]=NaN;continue}r=!0;let s=typeof o==`number`&&Number.isFinite(o)?o:NaN;n[i]=s,Number.isNaN(s)||(s<p&&(p=s),s>h&&(h=s))}m(u===0||r,`${et[t.mark]} dataKey "${t.dataKey}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#x.set(t.dataKey,n)}this.#S=p===1/0?0:p,this.#C=h===-1/0?0:h;let g=this.#r.zKey;if(this.#e===`scatter`&&g!=null){let t=new Float64Array(u),n=1/0,r=-1/0,i=!1;for(let a=0;a<u;a++){let o=e[this.#_==null?a:this.#_[a]??a],s=o==null?void 0:E(o,g);s!==void 0&&(i=!0);let c=typeof s==`number`&&Number.isFinite(s)?s:NaN;t[a]=c,Number.isNaN(c)||(c<n&&(n=c),c>r&&(r=c))}m(u===0||i,`ScatterPlot.Root zKey "${g}" does not match any key in the provided data. Available keys: ${Object.keys(e[0]??{}).join(`, `)}.`),this.#H=t,this.#U=n===1/0?[0,1]:Y([n,r],5)}else this.#H=new Float64Array;this.#Y=null,this.#$=null,this.#w=this.#r.stacked?Xe(r.map(e=>this.#x.get(e.dataKey)??new Float64Array)):null,this.#N=R({pointCount:u,columnCount:Math.max(1,Math.round(this.#B.width*this.#f)),wasDecimated:this.#N});let _=this.#z;if(_!=null){for(let e of this.#n.seriesMeta())if(_.inputs.get(e.dataKey)!==$e(e)){this.#z=null;break}}this.#he(r,f,d);let v=this.#qe();v!=null&&this.#Qe(Math.min(v,Math.max(0,u-1)),{viaKeyboard:this.#ie,notify:!1}),this.#nt({force:!0})}#he(e,t,n){let r=performance.now(),i=this.#ge(),a=!this.#k;this.#k=this.#k||this.#m>0,a||i===0?(this.#T.jump(this.#_e()),this.#E.jump(this.#ve())):(this.#T.aim(this.#_e(),r),this.#E.aim(this.#ve(),r));let o=this.#m>0&&this.#m<=2500&&n,s=new Set,c=(e,t,n)=>{s.add(e);let a=this.#D.get(e);a??(a=new Qe,this.#D.set(e,a));let c=o&&n&&a.values().length===t.length;a.retarget(t,{duration:c?i:0,now:r})};e.forEach((e,n)=>{let i=t.has(e.dataKey);if(this.#w==null?c(e.dataKey,this.#x.get(e.dataKey)??new Float64Array,i):(c(`${e.dataKey}:lower`,this.#w.lower[n]??new Float64Array,i),c(`${e.dataKey}:upper`,this.#w.upper[n]??new Float64Array,i)),!this.#O.has(e.dataKey)&&this.#m>0){let t=new Qe;t.retarget([0],{duration:0,now:r}),t.retarget([1],{duration:this.#ge(),now:r}),this.#O.set(e.dataKey,t)}});for(let e of this.#D.keys())s.has(e)||this.#D.delete(e)}#ge(){return!this.#r.animate||typeof matchMedia<`u`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches?0:280}#_e(){let[e,t]=this.#r.yDomain,n,r;if(this.#w==null?this.#e===`line`||this.#e===`scatter`?(n=this.#S,r=this.#C):(n=Math.min(0,this.#S),r=Math.max(0,this.#C)):(n=Math.min(0,this.#w.min),r=Math.max(0,this.#w.max)),typeof e==`number`&&(n=e),typeof t==`number`&&(r=t),this.#m===0)return[0,1];let i=Y([n,r],5);return[typeof e==`number`?e:i[0],typeof t==`number`?t:i[1]]}#ve(){if(this.#m===0)return[0,1];let e=this.#h[0]??0,t=this.#h[this.#m-1]??0;return e===t?[e-.5,t+.5]:this.#e===`scatter`?Y([e,t],5):[e,t]}#ye(){return this.#e===`scatter`&&this.#r.zKey!=null}#be(){return this.#e===`bar`&&this.#r.orientation===`horizontal`}#xe(){return`${et[this.#e].split(`.`)[0]??`Chart`}.Root`}#Se(e,t){let n=this.#R;n??(n=this.#t.canvas.ownerDocument.createElement(`canvas`),this.#R=n),(n.width!==e||n.height!==t)&&(n.width=e,n.height=t);let r=n.getContext(`2d`);return r==null?null:{canvas:n,ctx:r}}#Ce(){this.#le=!0,this.#Te()}#we(){this.#Te()}#Te(){this.#ce||this.#de||(this.#ce=!0,this.#ue=requestAnimationFrame(()=>{this.#ce=!1,this.#ue=0,this.#Ee()}))}#Ee(){if(!this.#de){if(this.flushIngest(),this.#le){this.#le=!1;let e=performance.now(),t=!1;t=this.#T.tick(e)||t,t=this.#E.tick(e)||t;for(let n of this.#D.values())t=n.tick(e)||t;for(let n of this.#O.values())t=n.tick(e)||t;if(t=this.#K.tick(e)||t,this.#G.tick(e)){t=!0;let e=this.#G.values();this.#W={yaw:e[0]??this.#W.yaw,pitch:e[1]??this.#W.pitch}}this.#Oe(),this.#Ae(),t=this.#Le(e)||t,t&&this.#Ce()}this.#st()}}#De(){return typeof devicePixelRatio==`number`&&devicePixelRatio>0?Math.min(devicePixelRatio,3):1}#Oe(){let e=this.#t.root,t=`${N(e.ownerDocument.documentElement)}|${this.#f}|${this.#r.orientation}`;if(this.#z?.signature===t)return;let n=e.ownerDocument.defaultView;if(n==null)return;let r=this.#a,i=new Map,a=new Map,o=new Map;for(let t of this.#n.seriesMeta()){let n=ee(e,t.colorInput);if(i.set(t.dataKey,n),a.set(t.dataKey,$e(t)),r!=null&&t.mark===`bar`&&t.texture!==`solid`){let i=re(r,{texture:t.texture,color:n,ink:M(e,ne(n)),devicePixelRatio:this.#f,orientation:this.#r.orientation});i!=null&&o.set(t.dataKey,i)}}this.#z={signature:t,series:i,inputs:a,barTextures:o,chrome:te(e),fontFamily:n.getComputedStyle(e).fontFamily||`sans-serif`}}#ke(e){let t=this.#z?.signature??``;t!==this.#Q&&(this.#Z.clear(),this.#Q=t);let n=this.#Z.get(e);if(n!=null)return n;let r=ee(this.#t.root,e);return this.#Z.set(e,r),r}#Ae(){let e=this.#n.getSnapshot(),t=this.#ye(),n=this.#be(),r=!t&&e.xAxis!=null,i=!t&&e.yAxis!=null,a=n?r:i,o=(n?i:r)?24:8,s=Math.max(0,this.#d-8-o);this.#B={left:8,top:8,width:Math.max(0,this.#u-16),height:s};let c=8;if(a){c=40;let e=this.#a;if(e!=null&&this.#z!=null){e.font=`11px ${this.#z.fontFamily}`;let t=0,r=n?this.#Ie().map(e=>e.text):this.#Fe().map(e=>e.text);for(let n of r){let r=e.measureText(n).width;r>t&&(t=r)}c=Math.ceil(t)+14}}this.#B={left:c,top:8,width:Math.max(0,this.#u-c-8),height:s};let l=n?this.#B.top:this.#B.left,u=n?this.#B.top+this.#B.height:this.#B.left+this.#B.width;this.#r.xScale===`band`?this.#V=Se({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:.2,paddingOuter:.1}):this.#r.xScale===`point`?this.#V=Se({count:this.#m,rangeStart:l,rangeEnd:u,paddingInner:1,paddingOuter:.5}):this.#V=null,this.#N=R({pointCount:this.#m,columnCount:Math.max(1,Math.round(this.#B.width*this.#f)),wasDecimated:this.#N})}#je(){let e=this.#T.values();return G([e[0]??0,e[1]??1],[this.#B.top+this.#B.height,this.#B.top])}#Me(){let e=this.#T.values(),t=this.#be()?[this.#B.left,this.#B.left+this.#B.width]:[this.#B.top+this.#B.height,this.#B.top];return G([e[0]??0,e[1]??1],t)}#Ne(){let e=this.#E.values();return G([e[0]??0,e[1]??1],[this.#B.left,this.#B.left+this.#B.width])}#Pe(e){let t=this.#V;if(t!=null)return q(t,e);let{k:n,b:r}=this.#Ne();return(this.#h[e]??0)*n+r}#Fe(){let e=this.#n.getSnapshot(),t=this.#T.values(),n=we([t[0]??0,t[1]??1],e.yAxis?.tickCount??5),r=e.yAxis?.tickFormat,i=n.length>1?V(Math.abs((n[1]??0)-(n[0]??0))):void 0;return n.map(e=>({value:e,text:r==null?B(e,i==null?void 0:{maximumFractionDigits:i}):r(e)}))}#Ie(){let e=this.#n.getSnapshot(),t=e.xAxis?.tickFormat;if(this.#V!=null){let e=this.#be(),n=e?this.#B.height:this.#B.width,r=Math.max(1,Math.floor(n/(e?15:60))),i=Math.max(1,Math.ceil(this.#m/r)),a=[];for(let e=0;e<this.#m;e+=i){let n=this.#g[e]??``;a.push({index:e,value:e,text:t==null?U(n,{datasetHasTimeOfDay:this.#y}):t(n)})}return a}let n=this.#E.values(),r=[n[0]??0,n[1]??1],i=e.xAxis?.tickCount??Math.max(2,Math.floor(this.#B.width/90));if(this.#r.xScale===`time`){let e=Oe(r);return De(r,i).map(n=>({index:null,value:n,text:t==null?e(n):t(new Date(n))}))}let a=we(r,i),o=a.length>1?V(Math.abs((a[1]??0)-(a[0]??0))):void 0;return a.map(e=>({index:null,value:e,text:t==null?B(e,o==null?void 0:{maximumFractionDigits:o}):t(e)}))}#Le(e){let t=this.#a,n=this.#z;if(t==null||n==null||this.#u<=0||this.#d<=0)return!1;let r=Math.min(50,Math.max(0,e-this.#M));this.#M=e;let i=this.#t.canvas,a=Math.round(this.#u*this.#f),o=Math.round(this.#d*this.#f);(i.width!==a||i.height!==o)&&(i.width=a,i.height=o),t.setTransform(this.#f,0,0,this.#f,0,0),t.clearRect(0,0,this.#u,this.#d);let s=this.#n.getSnapshot(),c=this.#B;if(c.width<=0||c.height<=0)return!1;let l=this.#je(),u=this.#Ne(),d=this.#n.seriesSpecs(),f=this.#ye(),p=this.#ge()===0,m=f?[]:this.#Re(t,n.fontFamily),h=f?[]:this.#ze(t,n.fontFamily),g=it(this.#A,m,r,p);g=it(this.#j,h,r,p)||g;let _=this.#F;if(_.target===1){if(e-this.#I>tt)_.target=0;else if(this.#L==null){let t=tt-(e-this.#I)+17;this.#L=setTimeout(()=>{this.#L=null,this.#Ce()},t)}}if(p)_.alpha=_.target;else{let e=1-(1-(_.target>_.alpha?.16:.08))**(r/16.67);_.alpha+=(_.target-_.alpha)*e,Math.abs(_.target-_.alpha)<.02&&(_.alpha=_.target)}_.alpha!==_.target&&(g=!0);let v=this.#be(),y=v?this.#Me():l,b=e=>this.#V==null?e*u.k+u.b:q(this.#V,e),x=e=>e*y.k+y.b,S=[...this.#A.entries()].map(([e,t])=>({position:b(e),alpha:t.alpha})),C=[...this.#j.entries()].map(([e,t])=>({position:x(e),alpha:t.alpha}));if(s.grid!=null&&!f){let e=s.grid.lines??(v?`vertical`:`horizontal`),r=v?S:C,i=v?C:S;Ae(t,{plot:c,color:n.chrome.grid,xLines:e===`horizontal`?[]:i,yLines:e===`vertical`?[]:r})}let w=Math.min(40,c.width*.25),T=t,E=null;_.alpha>.01&&w>1&&(E=this.#Se(a,o),E!=null&&(E.ctx.setTransform(this.#f,0,0,this.#f,0,0),E.ctx.clearRect(0,0,this.#u,this.#d),T=E.ctx)),T.save(),T.beginPath(),T.rect(c.left,c.top,c.width,c.height+1),T.clip();let D=null;if(this.#e===`bar`?v?this.#Ue(T,d):this.#He(T,d,l):this.#e===`scatter`?D=this.#rt(T,d,l):this.#We(T,d,l),T.restore(),E!=null){T.save(),T.globalCompositeOperation=`destination-out`;let e=T.createLinearGradient(c.left,0,c.left+w,0);e.addColorStop(0,`rgba(0, 0, 0, ${_.alpha})`),e.addColorStop(1,`rgba(0, 0, 0, 0)`),T.fillStyle=e,T.fillRect(c.left,c.top,w,c.height+1),T.restore(),t.drawImage(E.canvas,0,0,this.#u,this.#d)}D!=null&&Ke(t,{textColor:n.chrome.tickText,fontFamily:n.fontFamily,plot:c,center:D.center,axes:D.axes}),this.#e===`bar`&&this.#m>0&&(v?Me(t,{plot:c,color:n.chrome.baseline,x:x(0)}):je(t,{plot:c,color:n.chrome.baseline,y:x(0)}));for(let e of f?[]:s.referenceLines){let r=x(e.y);if(v?r<c.left||r>c.left+c.width:r<c.top||r>c.top+c.height)continue;let i=e.color==null?n.chrome.reference:this.#ke(e.color);v?Je(t,{plot:c,color:i,textColor:n.chrome.tickText,x:r,label:e.label,fontFamily:n.fontFamily}):qe(t,{plot:c,color:i,textColor:n.chrome.tickText,y:r,label:e.label,fontFamily:n.fontFamily})}let O=s.xAxis==null||f?[]:[...this.#A.entries()].map(([e,t])=>({position:b(e),text:t.text,alpha:t.alpha})),k=s.yAxis==null||f?[]:[...this.#j.entries()].map(([e,t])=>({position:x(e),text:t.text,alpha:t.alpha})),A=v?k:O,j=v?O:k;return(A.length>0||j.length>0)&&Ye(t,{plot:c,color:n.chrome.tickText,fontFamily:n.fontFamily,xLabels:A,yLabels:j}),g}#Re(e,t){e.font=`11px ${t}`;let n=this.#be(),r=this.#Ne(),i=[],a=-1/0;for(let t of this.#Ie()){let o=t.index!=null&&this.#V!=null,s=o&&this.#V!=null?q(this.#V,t.index??0):t.value*r.k+r.b,c=n?15/2:e.measureText(t.text).width/2,l=n?2:8;s-c<a+l||(a=s+c,i.push({key:o?t.index??0:t.value,text:t.text}))}return i}#ze(e,t){let n=this.#Fe();if(!this.#be())return n.map(e=>({key:e.value,text:e.text}));e.font=`11px ${t}`;let r=this.#Me(),i=[],a=-1/0;for(let t of n){let n=t.value*r.k+r.b,o=e.measureText(t.text).width/2;n-o<a+8||(a=n+o,i.push({key:t.value,text:t.text}))}return i}#Be(e,t){let n=t===`value`?e.dataKey:`${e.dataKey}:${t}`;if(!this.#N&&this.#m<=2500){let e=this.#D.get(n);if(e!=null&&e.values().length===this.#m)return e.values()}if(t===`value`)return this.#x.get(e.dataKey)??new Float64Array;let r=this.#n.seriesSpecs().findIndex(t=>t.dataKey===e.dataKey);return(t===`lower`?this.#w?.lower:this.#w?.upper)?.[r]??new Float64Array}#Ve(e){return this.#O.get(e)?.values()[0]??1}#He(e,t,n){let r=this.#V,i=this.#z;if(r==null||i==null||this.#m===0||t.length===0)return;let a=0*n.k+n.b,o=this.#w!=null,s=o?1:t.length,c=r.bandwidth>=8*s?2:+(r.bandwidth>=3*s),l=(r.bandwidth-c*(s-1))/s,u=Math.min(24,l);t.forEach((d,f)=>{let p=this.#Ve(d.dataKey),m=[],h=o?this.#Be(d,`lower`):null,g=o?this.#Be(d,`upper`):this.#Be(d,`value`),_=f===t.length-1;for(let e=0;e<this.#m;e++){let t=g[e]??NaN;if(Number.isNaN(t))continue;let i=h==null?0:h[e]??0,d=o?K(r,e)+(r.bandwidth-u)/2:K(r,e)+(r.bandwidth-(l*s+c*(s-1)))/2+f*(l+c)+(l-u)/2,v=Number.isNaN(i)?a:i*n.k+n.b,y=t*n.k+n.b;y=v+(y-v)*p,o&&h!=null&&f>0&&!Number.isNaN(i)&&c>0&&(v-=Math.sign(v-y)*c),m.push({x:d,width:u,baselineY:v,valueY:y,rounded:!o||_})}Ne(e,{fill:i.barTextures.get(d.dataKey)??i.series.get(d.dataKey)??`currentColor`,rects:m})})}#Ue(e,t){let n=this.#V,r=this.#z;if(n==null||r==null||this.#m===0||t.length===0)return;let i=this.#Me(),a=0*i.k+i.b,o=this.#w!=null,s=o?1:t.length,c=n.bandwidth>=8*s?2:+(n.bandwidth>=3*s),l=(n.bandwidth-c*(s-1))/s,u=Math.min(24,l);t.forEach((d,f)=>{let p=this.#Ve(d.dataKey),m=[],h=o?this.#Be(d,`lower`):null,g=o?this.#Be(d,`upper`):this.#Be(d,`value`),_=f===t.length-1;for(let e=0;e<this.#m;e++){let t=g[e]??NaN;if(Number.isNaN(t))continue;let r=h==null?0:h[e]??0,d=o?K(n,e)+(n.bandwidth-u)/2:K(n,e)+(n.bandwidth-(l*s+c*(s-1)))/2+f*(l+c)+(l-u)/2,v=Number.isNaN(r)?a:r*i.k+i.b,y=t*i.k+i.b;y=v+(y-v)*p,o&&h!=null&&f>0&&!Number.isNaN(r)&&c>0&&(v-=Math.sign(v-y)*c),m.push({y:d,height:u,baselineX:v,valueX:y,rounded:!o||_})}Pe(e,{fill:r.barTextures.get(d.dataKey)??r.series.get(d.dataKey)??`currentColor`,rects:m})})}#We(e,t,n){let r=this.#z;if(r==null||this.#m===0)return;let i=this.#Ne(),a=this.#V,o=e=>a==null?(this.#h[e]??0)*i.k+i.b:q(a,e);t.forEach(t=>{let i=r.series.get(t.dataKey)??`currentColor`,a=this.#Ve(t.dataKey);if(e.save(),a<1&&(e.beginPath(),e.rect(this.#B.left,0,this.#B.width*a,this.#d),e.clip()),this.#N){this.#Ge(e,t,i,n),e.restore();return}let s=t.mark===`area`,c=this.#Be(t,this.#w==null?`value`:`upper`),l=this.#w==null?null:this.#Be(t,`lower`),u=e=>!Number.isNaN(c[e]??NaN),d=[];for(let e=0;e<this.#m;e++)(!t.connectNulls||u(e))&&d.push(e);let f=e=>(c[e]??0)*n.k+n.b;if(s){let r=l==null?()=>0*n.k+n.b:e=>(l[e]??0)*n.k+n.b;Ie(e,{color:i,curve:t.curve,indexes:d,xAt:o,y0At:r,y1At:f,definedAt:u})}else Fe(e,{color:i,curve:t.curve,indexes:d,xAt:o,yAt:f,definedAt:u}),t.markers&&this.#B.width/this.#m>=12&&Be(e,{color:i,surface:r.chrome.surface,shape:t.shape,indexes:d,xAt:o,yAt:f,definedAt:u});e.restore()})}#Ge(e,t,n,r){let i=Math.max(1,Math.round(this.#B.width*this.#f)),a=e=>this.#B.left+(e+.5)/this.#f;if(t.mark===`area`){let o=this.#Ke(`${t.dataKey}:upper`,this.#Be(t,this.#w==null?`value`:`upper`),i),s=this.#w==null?null:this.#Ke(`${t.dataKey}:lower`,this.#Be(t,`lower`),i);s==null?Re(e,{color:n,lowerColumns:lt(o,0),upperColumns:o,columnToX:a,valueK:r.k,valueB:r.b}):Re(e,{color:n,lowerColumns:s,upperColumns:o,columnToX:a,valueK:r.k,valueB:r.b});return}Le(e,{color:n,columns:this.#Ke(t.dataKey,this.#Be(t,`value`),i),columnToX:a,valueK:r.k,valueB:r.b})}#Ke(e,t,n){let r=this.#E.values(),i=`${r[0]??0}:${r[1]??1}:${n}`,a=this.#P.get(e);if(a!=null&&a.key===i)return a.columns;let o=G([r[0]??0,r[1]??1],[0,n]),s=ie({xs:this.#h,values:t,startIndex:0,endIndex:this.#m-1,positionK:o.k,positionB:o.b,columnCount:n});return this.#P.set(e,{key:i,columns:s}),s}#qe(){if(this.#m===0)return null;let e;return e=this.#ne===void 0?this.#te:this.#ne==null?null:this.#Ye(this.#ne),e==null?null:Math.min(Math.max(0,e),this.#m-1)}#Je(e){return this.#_==null?e:this.#_[e]??e}#Ye(e){if(this.#p.length===0)return null;let t=Math.min(Math.max(0,e),this.#p.length-1);if(this.#v==null)return t;let n=this.#v[t]??-1;return n===-1?null:n}#Xe(e,t){if(this.#m===0)return null;let n=this.#V;if(n!=null)return Ce(n,this.#be()?t:e);let{k:r,b:i}=this.#Ne();if(r===0)return 0;let a=e;if(this.#N){let t=Math.floor((e-this.#B.left)*this.#f);a=this.#B.left+(t+.5)/this.#f}return le(this.#h,this.#m,(a-i)/r)}#Ze(e,t,n){let r=this.#n.seriesSpecs(),i=this.#be(),a=this.#V;if(this.#e===`bar`&&this.#w==null&&a!=null&&r.length>1){let o=(i?n:t)-K(a,e),s=Math.floor(o/Math.max(1,a.bandwidth)*r.length);return r[Math.min(r.length-1,Math.max(0,s))]?.dataKey??null}let{k:o,b:s}=i?this.#Me():this.#je(),c=i?t:n,l=null,u=1/0;return r.forEach((t,n)=>{let r=(this.#w==null?this.#x.get(t.dataKey):this.#w.upper[n])?.[e]??NaN;if(Number.isNaN(r))return;let i=Math.abs(r*o+s-c);i<u&&(u=i,l=t.dataKey)}),l}#Qe(e,t){let n=e==null||this.#m===0?null:Math.min(Math.max(0,e),this.#m-1),r=this.#ne!==void 0;if(t.notify&&n!==this.#qe()){let e=n==null?null:this.#Je(n);if(this.#i.onActiveIndexChange?.(e),r){this.#re={index:e,viaKeyboard:t.viaKeyboard};return}}this.#ie=t.viaKeyboard,r||(this.#te=n),this.#nt(),this.#we()}#$e=null;#et=!1;#tt=null;#nt(e={force:!1}){let t=this.#qe();if(!e.force&&t===this.#$e&&this.#ie===this.#et&&this.#ee===this.#tt)return;if(this.#$e=t,this.#et=this.#ie,this.#tt=this.#ee,t==null||this.#m===0){this.#n.publishHover(null);return}let n=this.#Je(t),r=this.#p[n]??{},i=this.#n.seriesMeta().map(e=>{let n=this.#x.get(e.dataKey)?.[t]??NaN;return{dataKey:e.dataKey,label:e.label,value:Number.isNaN(n)?null:n,color:e.color}});this.#r.stacked&&i.reverse(),this.#e===`scatter`&&(i=this.#ee==null?i.filter(e=>e.value!=null):i.filter(e=>e.dataKey===this.#ee));let a={index:n,xValue:this.#g[t]??``,datum:r,points:i,viaKeyboard:this.#ie};if(this.#ye()){let e=this.#H[t]??NaN;a.zValue=Number.isNaN(e)?null:e}this.#n.publishHover(a)}#rt(e,t,n){let r=this.#z;if(r==null||this.#m===0||t.length===0)return null;if(this.#ye())return this.#it(e,t);let i=this.#Ne(),a=t.map(e=>{let t=this.#Be(e,`value`),n=[];for(let e=0;e<this.#m;e++)Number.isNaN(t[e]??NaN)||n.push(e);return n}),o=a.reduce((e,t)=>e+t.length,0);return t.forEach((t,s)=>{let c=this.#Be(t,`value`),l=a[s]??[];e.save(),e.globalAlpha=this.#Ve(t.dataKey),Ue(e,{color:r.series.get(t.dataKey)??`currentColor`,surface:r.chrome.surface,shape:t.shape,totalPointCount:o,indexes:l,xAt:e=>(this.#h[e]??0)*i.k+i.b,yAt:e=>(c[e]??0)*n.k+n.b,radiusAt:()=>4}),e.restore()}),null}#it(e,t){let n=this.#z;if(n==null)return null;let r=this.#B,i=de(this.#W),a=r.left+r.width/2,o=r.top+r.height/2,s=this.#K.values(),c=s[0]??1,l=s[1]??1,u=.85-.22*c-.11*l,d=Math.min(r.width,r.height)/2*u,f=this.#E.values(),p=[f[0]??0,f[1]??1],m=this.#T.values(),h=[m[0]??0,m[1]??1],g=this.#U,_=t.map(e=>this.#Ve(e.dataKey)),v=this.#K.values(),y=v[0]??1,b=v[1]??1,x=(e,t,n)=>{let r=fe(e,t,n,i);return{x:a+r.x*d,y:o-r.y*d}},S=he.map(([e,t,n])=>x(e,t,n)),C=t[0],w=t.length===1&&C!=null?C.dataKey:`y`,T=[{label:this.#r.xKey,alpha:1,from:x(-1,-y,-b),to:x(1,-y,-b)},{label:w,alpha:y,from:x(-1,-1,-b),to:x(-1,1,-b)},{label:this.#r.zKey??`z`,alpha:b,from:x(-1,-y,-1),to:x(-1,-y,1)}];Ge(e,{gridColor:n.chrome.grid,axisColor:n.chrome.baseline,corners:S,edges:ge,cubeAlpha:b,axes:T});let E=this.#m*t.length,D=this.#Y;(D==null||D.screenX.length<E)&&(D={screenX:new Float64Array(E),screenY:new Float64Array(E),radius:new Float64Array(E),seriesIndex:new Int32Array(E),pointIndex:new Int32Array(E),depths:new Float64Array(E),count:0});let O=D.depths,k=0;t.forEach((e,t)=>{let n=this.#Be(e,`value`);for(let e=0;e<this.#m;e++){let r=n[e]??NaN,s=this.#H[e]??NaN;if(Number.isNaN(r)||Number.isNaN(s))continue;let c=fe(me(this.#h[e]??0,p),me(r,h)*y,me(s,g)*b,i);D.screenX[k]=a+c.x*d,D.screenY[k]=o-c.y*d,D.radius[k]=4*c.scale,D.seriesIndex[k]=t,D.pointIndex[k]=e,O[k]=c.depth,k+=1}}),D.count=k,this.#Y=D,this.#X.length<k&&(this.#X=new Int32Array(E));let A=this.#X.subarray(0,k);for(let e=0;e<k;e++)A[e]=e;return A.sort((e,t)=>(O[t]??0)-(O[e]??0)),We(e,{count:k,order:A,screenX:D.screenX,screenY:D.screenY,radius:D.radius,colorAt:e=>{let r=t[D.seriesIndex[e]??0];return r==null?`currentColor`:n.series.get(r.dataKey)??`currentColor`},shapeAt:e=>t[D.seriesIndex[e]??0]?.shape??`circle`,alphaAt:e=>_[D.seriesIndex[e]??0]??1,surface:n.chrome.surface}),{center:{x:a,y:o},axes:T}}#at(e,t){let n=this.#n.seriesSpecs(),r=576,i=null;if(this.#ye()){let a=this.#Y;if(a==null)return null;for(let o=0;o<a.count;o++){let s=(a.screenX[o]??0)-e,c=(a.screenY[o]??0)-t,l=s*s+c*c;if(l<r){let e=n[a.seriesIndex[o]??0];if(e==null)continue;r=l,i={seriesKey:e.dataKey,index:a.pointIndex[o]??0,screenX:a.screenX[o]??0,screenY:a.screenY[o]??0}}}return i}let a=this.#Ne(),o=this.#je();for(let s of n){let n=this.#x.get(s.dataKey);if(n!=null)for(let c=0;c<this.#m;c++){let l=n[c]??NaN;if(Number.isNaN(l))continue;let u=(this.#h[c]??0)*a.k+a.b,d=l*o.k+o.b,f=u-e,p=d-t,m=f*f+p*p;m<r&&(r=m,i={seriesKey:s.dataKey,index:c,screenX:u,screenY:d})}}return i}#ot(e){let t=this.#n.seriesSpecs();if(this.#ye()){let t=this.#Y;if(t==null)return null;for(let n=0;n<t.count;n++)if((t.pointIndex[n]??-1)===e)return{x:t.screenX[n]??0,y:t.screenY[n]??0};return null}let n=this.#Ne(),r=this.#je();for(let i of t){let t=this.#x.get(i.dataKey)?.[e]??NaN;if(!Number.isNaN(t))return{x:(this.#h[e]??0)*n.k+n.b,y:t*r.k+r.b}}return null}#st(){let{crosshair:e,band:t,markers:n,tooltip:r}=this.#t,i=this.#qe(),a=i!=null&&this.#m>0,o=this.#e===`bar`,s=this.#e===`scatter`;if(e.style.opacity=a&&!o&&!s?`1`:`0`,t.style.opacity=a&&o?`1`:`0`,n.style.opacity=a&&!o?`1`:`0`,r.style.opacity=a?`1`:`0`,!a)return;let c=this.#B;if(s){let e=this.#$??this.#ot(i);if(e==null){n.style.opacity=`0`,r.style.opacity=`0`;return}for(;n.children.length>1;)n.lastElementChild?.remove();n.children.length===0&&n.appendChild(ot(n.ownerDocument));let t=n.children[0];if(t instanceof HTMLElement){let n=this.#n.seriesMeta(),r=this.#ee==null?n.find(e=>{let t=this.#x.get(e.dataKey)?.[i]??NaN;return!Number.isNaN(t)}):n.find(e=>e.dataKey===this.#ee);t.style.opacity=`1`,st(t,r?.shape??`circle`,r?.color??`currentColor`),t.style.transform=`translate3d(${e.x}px, ${e.y}px, 0)`}this.#ct(e.x,e.y);return}let l=this.#Pe(i),u=this.#be();if(o){let e=this.#V;if(e!=null){let n=K(e,i)-(e.step-e.bandwidth)/2;u?(t.style.transform=`translate3d(${c.left}px, ${n}px, 0)`,t.style.width=`${c.width}px`,t.style.height=`${Math.max(e.step,24)}px`):(t.style.transform=`translate3d(${n}px, ${c.top}px, 0)`,t.style.width=`${Math.max(e.step,24)}px`,t.style.height=`${c.height}px`)}}else{e.style.transform=`translate3d(${l}px, ${c.top}px, 0)`,e.style.height=`${c.height}px`;let t=this.#n.seriesMeta(),r=this.#n.seriesSpecs();for(;n.children.length>t.length;)n.lastElementChild?.remove();for(;n.children.length<t.length;)n.appendChild(ot(n.ownerDocument));let a=this.#je();t.forEach((e,t)=>{let o=n.children[t];if(!(o instanceof HTMLElement))return;let s=this.#x.get(e.dataKey)?.[i]??NaN,c=r[t],u=c==null?NaN:this.#Be(c,this.#w==null?`value`:`upper`)[i]??NaN;if(Number.isNaN(s)||Number.isNaN(u)){o.style.opacity=`0`;return}o.style.opacity=`1`,st(o,e.shape,e.color),o.style.transform=`translate3d(${l}px, ${u*a.k+a.b}px, 0)`})}o&&u&&this.#V!=null?this.#ct(this.#ae??c.left+c.width/2,q(this.#V,i)):this.#ct(l,this.#oe??c.top+8)}#ct(e,t){let n=this.#B,r=this.#t.tooltip,i=this.#se,a=e+12;a+i.width>n.left+n.width&&e-12-i.width>=n.left&&(a=e-12-i.width);let o=Math.min(Math.max(n.top,t-i.height/2),n.top+n.height-i.height);r.style.transform=`translate3d(${a}px, ${Math.max(n.top,o)}px, 0)`}};const rt=e=>e===3?{yaw:.65,pitch:-.35}:{yaw:0,pitch:0},it=(e,t,n,r)=>{for(let t of e.values())t.target=0;for(let n of t){let t=e.get(n.key);t==null?e.set(n.key,{alpha:+!!r,target:1,text:n.text}):(t.target=1,t.text=n.text)}let i=1-.84**(n/16.67),a=1-.88**(n/16.67),o=!1;for(let[t,n]of e){if(r)n.alpha=n.target;else{let e=n.target>n.alpha?i:a;n.alpha+=(n.target-n.alpha)*e}if(n.target===1&&n.alpha>.98&&(n.alpha=1),n.target===0&&n.alpha<.03){e.delete(t);continue}n.alpha!==n.target&&(o=!0)}return o},at={circle:`circle(50%)`,square:`inset(8%)`,triangle:`polygon(50% 0%, 100% 100%, 0% 100%)`,diamond:`polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)`},ot=e=>{let t=e.createElement(`div`);t.setAttribute(`data-slot`,`chart-active-point`),t.style.position=`absolute`,t.style.width=`12px`,t.style.height=`12px`,t.style.left=`-6px`,t.style.top=`-6px`;let n=e.createElement(`div`);n.style.position=`absolute`,n.style.inset=`0`,n.style.backgroundColor=`var(--background-color-card)`;let r=e.createElement(`div`);return r.style.position=`absolute`,r.style.inset=`2px`,t.appendChild(n),t.appendChild(r),t},st=(e,t,n)=>{let r=at[t];e.setAttribute(`data-shape`,t);let[i,a]=e.children;i instanceof HTMLElement&&(i.style.clipPath=r),a instanceof HTMLElement&&(a.style.clipPath=r,a.style.backgroundColor=n)},ct=(e,t)=>e instanceof Date?e.getTime():typeof e==`number`?e:t&&typeof e==`string`?new Date(e).getTime():NaN,lt=(e,t)=>({columnCount:e.columnCount,hasData:e.hasData,minValue:new Float64Array(e.columnCount).fill(t),maxValue:new Float64Array(e.columnCount).fill(t),inValue:new Float64Array(e.columnCount).fill(t),outValue:new Float64Array(e.columnCount).fill(t)}),ut=e=>e.replaceAll(`|`,`\\|`).replaceAll(/\s*\n\s*/g,` `),dt=e=>e instanceof Date?Number.isNaN(e.getTime())?`—`:e.toISOString():typeof e==`number`?Number.isFinite(e)?String(e):`—`:typeof e==`string`?ut(e):`—`,ft=e=>typeof e==`number`&&Number.isFinite(e)?String(e):`—`,pt=e=>`| ${e.join(` | `)} |`,mt=({data:e,xKey:t,series:n,zKey:r})=>{let i=[ut(t),...n.map(e=>ut(e.label)),...r==null?[]:[ut(r)]],a=e.map(e=>[dt(E(e,t)),...n.map(t=>ft(E(e,t.dataKey))),...r==null?[]:[ft(E(e,r))]]);return[pt(i),pt(i.map(()=>`---`)),...a.map(e=>pt(e))].join(`
2
+ `)},ht=(e,t)=>e==null?`var(${k(t)})`:O(e)?`var(${k(e)})`:e;var gt=class{#e=new Set;#t={series:[],hover:null,grid:null,xAxis:null,yAxis:null,referenceLines:[],tooltip:null,orientation:`vertical`};#n=new Map;#r=new Map;#i=new Map;#a=new Set;#o=0;#s=0;#c=null;#l=`vertical`;#u=null;#d=null;#f=new Map;#p=new Map;#m=null;#h=null;onSeriesChange=null;onPresentationChange=null;subscribe=e=>(this.#e.add(e),()=>{this.#e.delete(e)});getSnapshot=()=>this.#t;seriesSpecs(){return[...this.#n.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec)}slotFor(e){let t=this.#i.get(e);if(t!=null)return t;for(;this.#s<A.length&&this.#a.has(A[this.#s]??`chart-other`);)this.#s+=1;let n=A[this.#s]??`chart-other`;return this.#s<A.length&&(this.#s+=1),this.#i.set(e,n),this.#a.add(n),n}#g({token:e,pinnedBy:t}){for(let[n,r]of this.#i)if(r===e&&n!==t&&this.#n.get(n)?.spec.color!==e){this.#i.delete(n),this.slotFor(n);return}}registerSeries(e){let t=this.#r.get(e.dataKey)??this.#o++;return this.#r.set(e.dataKey,t),e.color==null?this.slotFor(e.dataKey):O(e.color)&&e.color!==`chart-other`&&(this.#a.add(e.color),this.#g({token:e.color,pinnedBy:e.dataKey})),this.#n.set(e.dataKey,{spec:e,sequence:t}),this.#_({seriesChanged:!0}),()=>{this.#n.get(e.dataKey)?.spec===e&&(this.#n.delete(e.dataKey),this.#_({seriesChanged:!0}))}}setOrientation(e){this.#l!==e&&(this.#l=e,this.#_())}registerGrid(e){let t={lines:e};return this.#c=t,this.#_(),()=>{this.#c===t&&(this.#c=null,this.#_())}}registerXAxis(e){return this.#u=e,this.#_(),()=>{this.#u===e&&(this.#u=null,this.#_())}}registerYAxis(e){return this.#d=e,this.#_(),()=>{this.#d===e&&(this.#d=null,this.#_())}}registerReferenceLine(e,t){let n=this.#p.get(e)??this.#o++;return this.#p.set(e,n),this.#f.set(e,{spec:t,sequence:n}),this.#_(),()=>{this.#f.get(e)?.spec===t&&(this.#f.delete(e),this.#_())}}registerTooltip(e){return this.#m=e,this.#_(),()=>{this.#m===e&&(this.#m=null,this.#_())}}publishHover(e){this.#h!==e&&(this.#h=e,this.#t={...this.#t,hover:e},this.#v())}seriesMeta(){return this.seriesSpecs().map(e=>({dataKey:e.dataKey,label:e.label,mark:e.mark,color:ht(e.color,this.#i.get(e.dataKey)??`chart-other`),colorInput:e.color??this.#i.get(e.dataKey)??`chart-other`,shape:e.shape,texture:e.texture}))}#_(e={seriesChanged:!1}){this.#t={series:this.seriesMeta(),hover:this.#h,grid:this.#c,xAxis:this.#u,yAxis:this.#d,referenceLines:[...this.#f.values()].toSorted((e,t)=>e.sequence-t.sequence).map(e=>e.spec),tooltip:this.#m,orientation:this.#l},this.#v(),e.seriesChanged?this.onSeriesChange?.():this.onPresentationChange?.()}#v(){for(let e of this.#e)e()}};const _t=a(null),Q=e=>{let t=o(_t);return m(t,`${e} must be composed inside ${e.split(`.`)[0]}.Root — it registers into the chart it belongs to and renders nothing on its own.`),t},vt=e=>p(e.subscribe,e.getSnapshot,e.getSnapshot),yt=(e,t)=>{for(let n of e){let e=E(n,t);if(e!=null)return e instanceof Date?`time`:typeof e==`number`?`linear`:`point`}return`point`},bt=[`auto`,`auto`],xt=({kind:r,componentName:i,slotName:a,data:o,xKey:s,xScale:p,zKey:h,dimensions:v=3,yDomain:y=bt,stacked:b=!1,orientation:x=`vertical`,animate:S=!0,pending:C=!1,activeIndex:w,onActiveIndexChange:T,onDatumActivate:D,className:O,children:k,ref:A,"data-slot":j,"aria-label":M,"aria-labelledby":ee,...te})=>{let[N]=f(()=>new gt),P=d(null),[F]=f(()=>({kind:r,componentName:i,store:N,engineRef:P,dataRef:{current:{data:o,xKey:s,zKey:h}}}));l(()=>{F.dataRef.current={data:o,xKey:s,zKey:h}},[F,o,s,h]);let I=d(null),ne=e(I,A),L=d(null),re=d(null),R=d(null),ie=d(null),ae=d(null),oe=d(null),z=c(),B=r===`bar`?`band`:p??yt(o,s);m(r!==`scatter`||o.length===0||B!==`point`,`${i}.Root requires numeric or Date x values — the "${s}" values are not numbers or dates, so they have no position on a continuous scatter axis.`);let[V,se]=y,H=u(()=>{for(let e of o){let t=E(e,s);if(t instanceof Date&&ce(t))return!0}return!1},[o,s]);return l(()=>{let e=I.current,t=L.current,n=re.current,i=R.current,a=ie.current,o=ae.current,s=oe.current;if(e==null||t==null||n==null||i==null||a==null||o==null||s==null)return;let c=new nt({kind:r,store:N,elements:{root:e,plot:t,canvas:n,crosshair:i,band:a,markers:o,tooltip:s}});return P.current=c,()=>{P.current=null,c.destroy()}},[r,N]),l(()=>{P.current?.setOptions({xKey:s,xScale:B,yDomain:[V,se],zKey:h??null,dimensions:v,stacked:b,orientation:x,animate:S}),N.setOrientation(x)},[N,s,B,V,se,h,v,b,x,S]),l(()=>{P.current?.setRows(o)},[o]),l(()=>{P.current?.setCallbacks({onDatumActivate:D??null,onActiveIndexChange:T??null})}),l(()=>{P.current?.setControlledActiveIndex(w)},[w]),l(()=>{P.current?.flushIngest()}),g(`div`,{"data-slot":n(j,a),className:t(`relative flex aspect-video w-full flex-col`,O),ref:ne,...te,children:_(_t.Provider,{value:F,children:[_(`div`,{"data-slot":`${a}-plot`,className:t(`relative min-h-0 w-full flex-1`,C&&`opacity-60 transition-opacity duration-300`),ref:L,children:[g(`canvas`,{"data-slot":`${a}-canvas`,ref:re,"aria-hidden":!0,className:`absolute inset-0 size-full`}),g(`div`,{role:`application`,"aria-label":M,"aria-labelledby":ee,"aria-describedby":z,tabIndex:0,className:t(`focus-visible:ring-focus-accent absolute inset-0 rounded-sm outline-none focus-visible:ring-2`,(r===`line`||r===`area`)&&`cursor-crosshair`,r===`scatter`&&h!=null&&`touch-none cursor-grab active:cursor-grabbing`),onPointerDown:e=>{e.isTrusted&&r===`scatter`&&h!=null&&e.currentTarget.setPointerCapture(e.pointerId),P.current?.handlePointerDown(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerMove:e=>{P.current?.handlePointerMove(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerUp:e=>{P.current?.handlePointerUp(e.nativeEvent.offsetX,e.nativeEvent.offsetY)},onPointerLeave:()=>{P.current?.handlePointerLeave()},onPointerCancel:()=>{P.current?.handlePointerLeave()},onBlur:()=>{P.current?.handlePointerLeave()},onKeyDown:e=>{P.current?.handleKeyDown(e.key)&&e.preventDefault()}}),g(`span`,{id:z,className:`sr-only`,children:`Use the left and right arrow keys to move between data points, Home and End to jump to the first and last, and Enter to activate the current point.`}),g(`div`,{ref:R,"aria-hidden":!0,className:`bg-neutral-500 pointer-events-none absolute left-0 top-0 w-px opacity-0`}),g(`div`,{ref:ie,"aria-hidden":!0,className:`bg-neutral-500/10 pointer-events-none absolute left-0 top-0 rounded-sm opacity-0`}),g(`div`,{ref:ae,"aria-hidden":!0,className:`pointer-events-none absolute inset-0 opacity-0`}),g(kt,{slotName:a,store:N,tooltipRef:oe,xHasTimeOfDay:H})]}),k,g(Ft,{store:N,xHasTimeOfDay:H}),g(It,{data:o,label:M,slotName:a,store:N,xHasTimeOfDay:H,xKey:s,zKey:h})]})})},St=(e,t,n)=>{let r=Q(e);m(r.kind===t,`${e} cannot be composed inside ${r.componentName}.Root — compose ${r.componentName} series parts instead.`);let{dataKey:i,label:a,color:o,curve:s=`linear`,markers:c=!1,connectNulls:u=!1,shape:d=`circle`,texture:f=`solid`}=n;return l(()=>r.store.registerSeries({dataKey:i,label:a??i,color:o,mark:t,curve:s,markers:c,connectNulls:u,shape:d,texture:f}),[r.store,i,a,o,t,s,c,u,d,f]),null},Ct=(e,t)=>{let n=Q(e),{lines:r}=t;return l(()=>n.store.registerGrid(r),[n.store,r]),null},wt=(e,t)=>{let n=Q(e),{tickFormat:r,tickCount:i}=t;return l(()=>n.store.registerXAxis({tickFormat:r,tickCount:i}),[n.store,r,i]),null},Tt=(e,t)=>{let n=Q(e),{tickFormat:r,tickCount:i}=t;return l(()=>n.store.registerYAxis({tickFormat:r,tickCount:i}),[n.store,r,i]),null},Et=(e,t)=>{let n=Q(e),r=c(),{y:i,label:a,color:o}=t;return l(()=>n.store.registerReferenceLine(r,{y:i,label:a,color:o}),[n.store,r,i,a,o]),null},Dt=(e,t)=>{let n=Q(e),{labelFormat:r,valueFormat:i,indicator:a=`line`,footer:o,children:s,...c}=t;return l(()=>n.store.registerTooltip({labelFormat:r,valueFormat:i,indicator:a,footer:o,children:s,divProps:c})),null},Ot=(e,t,n)=>e==null?`—`:n==null?B(e):n(e,t),kt=({slotName:n,store:r,tooltipRef:i,xHasTimeOfDay:a})=>{let o=vt(r),s=o.tooltip,c=o.hover,{className:u,ref:f,style:p,...m}=s?.divProps??{},v=d(null),y=e(i,v);l(()=>{if(f==null)return;let e=v.current;if(typeof f==`function`){let t=f(e);return()=>{typeof t==`function`?t():f(null)}}return f.current=e,()=>{f.current=null}},[f]);let b=s?.footer;return g(`div`,{"data-slot":`${n}-tooltip`,ref:y,className:t(`bg-popover border-popover text-strong pointer-events-none absolute left-0 top-0 z-10 min-w-32 rounded-md border px-2.5 py-1.5 text-xs shadow-md`,u),style:{opacity:0,...p},...m,children:c==null?null:s?.children==null?_(h,{children:[g(`div`,{className:`text-muted font-medium`,children:s?.labelFormat==null?U(c.xValue,{datasetHasTimeOfDay:a}):s.labelFormat(c.xValue)}),g(`div`,{className:`mt-1 grid gap-1`,children:c.points.map(e=>_(`div`,{className:`flex items-center gap-1.5`,children:[s?.indicator===`none`?null:g(`span`,{"aria-hidden":!0,className:`h-2.5 w-0.5 shrink-0 rounded-full`,style:{backgroundColor:e.color}}),g(`span`,{className:`text-muted`,children:e.label}),g(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:Ot(e.value,e.dataKey,s?.valueFormat)})]},e.dataKey))}),c.zValue===void 0?null:_(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[g(`span`,{className:`text-muted`,children:`z`}),g(`span`,{className:`text-strong ml-auto pl-3 font-medium tabular-nums`,children:c.zValue==null?`—`:B(c.zValue)})]}),b==null?null:g(`div`,{className:`text-muted mt-1`,children:typeof b==`function`?b(c):b})]}):s.children(c)})},$=(e,t,n=3)=>`repeating-linear-gradient(${e}, ${t} 0, ${t} 1px, transparent 1px, transparent ${n}px)`,At=`forced-color-adjust-none [print-color-adjust:exact] [-webkit-print-color-adjust:exact]`,jt=(e,t,n)=>{if(e===`solid`)return{};let r=ne(t);return e===`hatch`?{backgroundImage:$(`135deg`,r)}:e===`hatch-reverse`?{backgroundImage:$(`45deg`,r)}:e===`crosshatch`?{backgroundImage:`${$(`135deg`,r,4)}, ${$(`45deg`,r,4)}`}:e===`perpendicular`?{backgroundImage:$(n===`horizontal`?`90deg`:`0deg`,r)}:{backgroundImage:`radial-gradient(circle at 1px 1px, ${r} 0.75px, transparent 0.8px)`,backgroundSize:`3px 3px`}},Mt=({series:e,orientation:n})=>e.mark===`bar`?g(`span`,{"aria-hidden":!0,"data-texture":e.texture,className:t(`size-2 shrink-0 rounded-[2px]`,At),style:{backgroundColor:e.color,...jt(e.texture,e.color,n)}}):e.mark===`line`?_(`span`,{"aria-hidden":!0,className:`relative flex h-2 w-3 shrink-0 items-center justify-center`,children:[g(`span`,{className:t(`absolute inset-x-0 top-1/2 h-0.5 -translate-y-1/2 rounded-full`,At),style:{backgroundColor:e.color}}),g(`span`,{"data-shape":e.shape,className:t(`relative size-2`,At),style:{backgroundColor:e.color,clipPath:at[e.shape]}})]}):g(`span`,{"aria-hidden":!0,"data-shape":e.shape,className:t(`size-2 shrink-0`,At),style:{backgroundColor:e.color,clipPath:at[e.shape]}}),Nt=({partName:e,slotName:n,className:r,children:i,...a})=>{let o=Q(e),s=vt(o.store);return s.series.length<2?null:g(`div`,{"data-slot":`${n}-legend`,className:t(`text-muted flex flex-wrap items-center gap-x-4 gap-y-1 pt-3 text-xs`,r),...a,children:i==null?s.series.map(e=>_(`div`,{className:`flex items-center gap-1.5`,children:[g(Mt,{series:e,orientation:s.orientation}),e.label]},e.dataKey)):i(s.series)})},Pt=({partName:e,slotName:t,label:n=`Copy data as Markdown`,onCopy:a,onCopyError:o,onClick:c,ref:l,...u})=>{let p=Q(e),m=i(),[h,_]=f(!1),b=d(void 0);return s(()=>()=>{b.current!=null&&clearTimeout(b.current)},[]),g(r,{type:`button`,appearance:`ghost`,intent:`neutral`,size:`sm`,"data-slot":`${t}-copy-button`,label:n,icon:g(h?v:y,{}),ref:l,onClick:async e=>{try{if(c?.(e),e.defaultPrevented){b.current!=null&&(clearTimeout(b.current),b.current=void 0),_(!1);return}let{data:t,xKey:n,zKey:r}=p.dataRef.current,i=mt({data:t,xKey:n,zKey:r,series:p.store.getSnapshot().series});await m(i),a?.(i),_(!0),b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{_(!1)},2e3)}catch(e){o?.(e)}},...u})},Ft=({store:e,xHasTimeOfDay:t})=>{let n=vt(e),[r,i]=f(``),a=n.hover;return s(()=>{if(a==null||!a.viaKeyboard){i(``);return}let e=a.points.map(e=>`${e.label}: ${e.value==null?`no data`:B(e.value)}`).join(`, `),n=a.zValue===void 0?``:`, z: ${a.zValue==null?`no data`:B(a.zValue)}`,r=setTimeout(()=>{i(`${U(a.xValue,{datasetHasTimeOfDay:t})}. ${e}${n}`)},120);return()=>clearTimeout(r)},[a,t]),g(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:r})},It=({data:e,label:t,slotName:n,store:r,xHasTimeOfDay:i,xKey:a,zKey:o})=>{let s=vt(r);if(e.length===0||s.series.length===0)return null;let c=e.slice(0,150);return g(`div`,{className:`sr-only`,"data-slot":`${n}-data-table`,children:_(`table`,{children:[g(`caption`,{children:`${t==null?`Chart data`:`${t} — chart data`}${e.length>150?`. Showing the first 150 of ${e.length} rows.`:`.`}`}),g(`thead`,{children:_(`tr`,{children:[g(`th`,{scope:`col`,children:a}),s.series.map(e=>g(`th`,{scope:`col`,children:e.label},e.dataKey)),o==null?null:g(`th`,{scope:`col`,children:o})]})}),g(`tbody`,{children:c.map((e,t)=>{let n=E(e,a),r=n instanceof Date&&!Number.isNaN(n.getTime()),c=typeof n==`string`||typeof n==`number`||n instanceof Date?U(n,{datasetHasTimeOfDay:i}):String(n);return _(`tr`,{children:[g(`th`,{scope:`row`,"data-value":typeof n==`number`&&Number.isFinite(n)?n:void 0,children:r?g(`time`,{dateTime:n.toISOString(),children:c}):c}),s.series.map(t=>{let n=E(e,t.dataKey),r=typeof n==`number`&&Number.isFinite(n);return g(`td`,{"data-value":r?n:void 0,children:r?B(n):`—`},t.dataKey)}),o==null?null:(()=>{let t=E(e,o),n=typeof t==`number`&&Number.isFinite(t);return g(`td`,{"data-value":n?t:void 0,children:n?B(t):`—`})})()]},t)})})]})})};export{Et as a,wt as c,Ct as i,Tt as l,Nt as n,St as o,xt as r,Dt as s,Pt as t};