@spear-ai/spectral 1.3.62 → 1.3.64

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 (281) hide show
  1. package/dist/.js +205 -152
  2. package/dist/Accordion.d.ts +37 -0
  3. package/dist/Accordion.js +474 -0
  4. package/dist/Alert/AlertBase.js +2 -2
  5. package/dist/Alert.js +21 -11
  6. package/dist/Avatar.js +1 -1
  7. package/dist/Badge.d.ts +12 -2
  8. package/dist/Badge.js +28 -4
  9. package/dist/Button.d.ts +3 -3
  10. package/dist/Button.js +35 -28
  11. package/dist/ButtonGroup/ButtonGroupButton.d.ts +13 -0
  12. package/dist/ButtonGroup/ButtonGroupButton.js +51 -0
  13. package/dist/ButtonGroup.d.ts +29 -0
  14. package/dist/ButtonGroup.js +89 -0
  15. package/dist/ButtonIcon.js +11 -1
  16. package/dist/Card.d.ts +16 -0
  17. package/dist/Card.js +32 -0
  18. package/dist/Checkbox/CheckboxBase.js +1 -1
  19. package/dist/Checkbox.js +22 -14
  20. package/dist/Dialog/DialogBase.d.ts +6 -3
  21. package/dist/Dialog/DialogBase.js +113 -98
  22. package/dist/Dialog.d.ts +1 -1
  23. package/dist/Dialog.js +42 -36
  24. package/dist/Drawer.js +24 -1283
  25. package/dist/HoverCard.d.ts +29 -0
  26. package/dist/HoverCard.js +207 -0
  27. package/dist/Icons/AnalyzeIcon.d.ts +3 -0
  28. package/dist/Icons/AnalyzeIcon.js +73 -0
  29. package/dist/Icons/AnnotationsIcon.js +4 -4
  30. package/dist/Icons/ApprovedIcon.d.ts +3 -0
  31. package/dist/Icons/ApprovedIcon.js +43 -0
  32. package/dist/Icons/CalendarIcon.js +7 -7
  33. package/dist/Icons/CheckCircleIcon.js +14 -14
  34. package/dist/Icons/CheckSquareIcon.js +14 -14
  35. package/dist/Icons/CheckmarkIcon.js +9 -9
  36. package/dist/Icons/ChevronDownIcon.js +6 -6
  37. package/dist/Icons/ChevronUpIcon.js +7 -7
  38. package/dist/Icons/ClockIcon.js +10 -10
  39. package/dist/Icons/CloseCircleIcon.js +10 -10
  40. package/dist/Icons/CloseIcon.js +5 -5
  41. package/dist/Icons/DashboardIcon.js +4 -4
  42. package/dist/Icons/DatabaseIcon.d.ts +3 -0
  43. package/dist/Icons/DatabaseIcon.js +53 -0
  44. package/dist/Icons/DeleteIcon.js +24 -6
  45. package/dist/Icons/DurationIcon.js +7 -7
  46. package/dist/Icons/EmailIcon.js +4 -4
  47. package/dist/Icons/EraserIcon.js +20 -11
  48. package/dist/Icons/ErrorIcon.js +3 -3
  49. package/dist/Icons/EyeClosedIcon.js +2 -2
  50. package/dist/Icons/EyeClosedIcon2.js +18 -18
  51. package/dist/Icons/EyeOpenIcon.js +8 -8
  52. package/dist/Icons/GoToFirstIcon.js +1 -1
  53. package/dist/Icons/GoToLastIcon.js +3 -3
  54. package/dist/Icons/HarmonicCursorsIcon.js +4 -4
  55. package/dist/Icons/IconBase.d.ts +1 -1
  56. package/dist/Icons/IconBase.js +15 -17
  57. package/dist/Icons/InfoIcon.js +4 -4
  58. package/dist/Icons/LabelIcon.js +6 -6
  59. package/dist/Icons/LassoIcon.js +6 -6
  60. package/dist/Icons/LineToolIcon.js +22 -93
  61. package/dist/Icons/LineToolIcon2.d.ts +3 -0
  62. package/dist/Icons/LineToolIcon2.js +73 -0
  63. package/dist/Icons/LiveViewIcon.js +5 -5
  64. package/dist/Icons/LoaderIcon.js +5 -5
  65. package/dist/Icons/LocationIcon.js +5 -5
  66. package/dist/Icons/LogoutIcon.js +11 -11
  67. package/dist/Icons/MessagesIcon.d.ts +3 -0
  68. package/dist/Icons/MessagesIcon.js +34 -0
  69. package/dist/Icons/MetadataIcon.js +5 -5
  70. package/dist/Icons/MinusIcon.js +9 -9
  71. package/dist/Icons/OntologyIcon.js +74 -21
  72. package/dist/Icons/PanelIconClose.js +11 -11
  73. package/dist/Icons/PanelIconOpen.js +11 -11
  74. package/dist/Icons/PlayIcon.js +5 -5
  75. package/dist/Icons/PlusIcon.js +9 -8
  76. package/dist/Icons/ResetIcon.js +6 -6
  77. package/dist/Icons/ReviewedIcon.d.ts +3 -0
  78. package/dist/Icons/ReviewedIcon.js +44 -0
  79. package/dist/Icons/ScissorsIcon.js +9 -9
  80. package/dist/Icons/SettingsIcon.js +20 -22
  81. package/dist/Icons/SortAscendingIcon.d.ts +3 -0
  82. package/dist/Icons/SortAscendingIcon.js +73 -0
  83. package/dist/Icons/SortDescendingIcon.d.ts +3 -0
  84. package/dist/Icons/SortDescendingIcon.js +73 -0
  85. package/dist/Icons/StackIcon.d.ts +3 -0
  86. package/dist/Icons/StackIcon.js +43 -0
  87. package/dist/Icons/StarIcon.d.ts +3 -0
  88. package/dist/Icons/StarIcon.js +31 -0
  89. package/dist/Icons/TrashIcon.js +10 -10
  90. package/dist/Icons/UndoIcon.js +1 -1
  91. package/dist/Icons/UserIcon.js +1 -1
  92. package/dist/Icons/WarningIcon.js +9 -9
  93. package/dist/Icons/ZoomAllIcon.js +97 -57
  94. package/dist/Icons/ZoomXIcon.js +6 -6
  95. package/dist/Icons/ZoomYIcon.js +17 -8
  96. package/dist/Icons/index.d.ts +10 -0
  97. package/dist/Icons.js +114 -94
  98. package/dist/Input.d.ts +2 -0
  99. package/dist/Input.js +100 -82
  100. package/dist/InputGroup.d.ts +16 -0
  101. package/dist/InputGroup.js +129 -0
  102. package/dist/InputOTP.d.ts +0 -2
  103. package/dist/InputOTP.js +148 -143
  104. package/dist/Label.d.ts +3 -7
  105. package/dist/Label.js +11 -11
  106. package/dist/MultiSelect/MultiSelectBase.js +28 -28
  107. package/dist/Popover.d.ts +6 -7
  108. package/dist/Popover.js +60 -71
  109. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +1 -1
  110. package/dist/RadioButtonGroup.js +1 -1
  111. package/dist/RadioGroup.d.ts +1 -1
  112. package/dist/RadioGroup.js +141 -134
  113. package/dist/Select.d.ts +12 -12
  114. package/dist/Select.js +106 -895
  115. package/dist/Separator.d.ts +12 -0
  116. package/dist/Separator.js +24 -0
  117. package/dist/Skeleton.js +3 -3
  118. package/dist/Slider.d.ts +15 -3
  119. package/dist/Slider.js +464 -40
  120. package/dist/Switch/SwitchBase.js +1 -1
  121. package/dist/Switch.js +2 -2
  122. package/dist/Tabs/TabsBase.js +1 -1
  123. package/dist/Tabs.js +16 -16
  124. package/dist/Textarea.js +58 -50
  125. package/dist/Toggle.js +2 -2
  126. package/dist/ToggleGroup.js +1 -1
  127. package/dist/Tooltip/TooltipBase.js +29 -29
  128. package/dist/Tooltip.js +15 -15
  129. package/dist/Tray/TrayStoriesData.d.ts +39 -0
  130. package/dist/Tray/TrayStoriesData.js +438 -0
  131. package/dist/Tray.d.ts +28 -0
  132. package/dist/Tray.js +236 -0
  133. package/dist/analyzer/network.webp +0 -0
  134. package/dist/analyzer/sunburst.webp +0 -0
  135. package/dist/analyzer/visual.webp +0 -0
  136. package/dist/clsx-OuTLNxxd.js +16 -0
  137. package/dist/components/Accordion/Accordion.d.ts +37 -0
  138. package/dist/components/Accordion/Accordion.d.ts.map +1 -0
  139. package/dist/components/Badge/Badge.d.ts +12 -2
  140. package/dist/components/Badge/Badge.d.ts.map +1 -1
  141. package/dist/components/Button/Button.d.ts +3 -3
  142. package/dist/components/Button/Button.d.ts.map +1 -1
  143. package/dist/components/ButtonGroup/ButtonGroup.d.ts +29 -0
  144. package/dist/components/ButtonGroup/ButtonGroup.d.ts.map +1 -0
  145. package/dist/components/ButtonGroup/ButtonGroupButton.d.ts +13 -0
  146. package/dist/components/ButtonGroup/ButtonGroupButton.d.ts.map +1 -0
  147. package/dist/components/Card/Card.d.ts +16 -0
  148. package/dist/components/Card/Card.d.ts.map +1 -0
  149. package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
  150. package/dist/components/Dialog/Dialog.d.ts +1 -1
  151. package/dist/components/Dialog/Dialog.d.ts.map +1 -1
  152. package/dist/components/Dialog/DialogBase.d.ts +6 -3
  153. package/dist/components/Dialog/DialogBase.d.ts.map +1 -1
  154. package/dist/components/HoverCard/HoverCard.d.ts +29 -0
  155. package/dist/components/HoverCard/HoverCard.d.ts.map +1 -0
  156. package/dist/components/Icons/AnalyzeIcon.d.ts +3 -0
  157. package/dist/components/Icons/AnalyzeIcon.d.ts.map +1 -0
  158. package/dist/components/Icons/ApprovedIcon.d.ts +3 -0
  159. package/dist/components/Icons/ApprovedIcon.d.ts.map +1 -0
  160. package/dist/components/Icons/DatabaseIcon.d.ts +3 -0
  161. package/dist/components/Icons/DatabaseIcon.d.ts.map +1 -0
  162. package/dist/components/Icons/DeleteIcon.d.ts.map +1 -1
  163. package/dist/components/Icons/EraserIcon.d.ts.map +1 -1
  164. package/dist/components/Icons/IconBase.d.ts +1 -1
  165. package/dist/components/Icons/IconBase.d.ts.map +1 -1
  166. package/dist/components/Icons/LineToolIcon.d.ts.map +1 -1
  167. package/dist/components/Icons/LineToolIcon2.d.ts +3 -0
  168. package/dist/components/Icons/LineToolIcon2.d.ts.map +1 -0
  169. package/dist/components/Icons/MessagesIcon.d.ts +3 -0
  170. package/dist/components/Icons/MessagesIcon.d.ts.map +1 -0
  171. package/dist/components/Icons/OntologyIcon.d.ts.map +1 -1
  172. package/dist/components/Icons/PlusIcon.d.ts.map +1 -1
  173. package/dist/components/Icons/ReviewedIcon.d.ts +3 -0
  174. package/dist/components/Icons/ReviewedIcon.d.ts.map +1 -0
  175. package/dist/components/Icons/SettingsIcon.d.ts.map +1 -1
  176. package/dist/components/Icons/SortAscendingIcon.d.ts +3 -0
  177. package/dist/components/Icons/SortAscendingIcon.d.ts.map +1 -0
  178. package/dist/components/Icons/SortDescendingIcon.d.ts +3 -0
  179. package/dist/components/Icons/SortDescendingIcon.d.ts.map +1 -0
  180. package/dist/components/Icons/StackIcon.d.ts +3 -0
  181. package/dist/components/Icons/StackIcon.d.ts.map +1 -0
  182. package/dist/components/Icons/StarIcon.d.ts +3 -0
  183. package/dist/components/Icons/StarIcon.d.ts.map +1 -0
  184. package/dist/components/Icons/ZoomAllIcon.d.ts.map +1 -1
  185. package/dist/components/Icons/ZoomYIcon.d.ts.map +1 -1
  186. package/dist/components/Icons/index.d.ts +10 -0
  187. package/dist/components/Icons/index.d.ts.map +1 -1
  188. package/dist/components/Input/Input.d.ts +2 -0
  189. package/dist/components/Input/Input.d.ts.map +1 -1
  190. package/dist/components/InputGroup/InputGroup.d.ts +16 -0
  191. package/dist/components/InputGroup/InputGroup.d.ts.map +1 -0
  192. package/dist/components/InputOTP/InputOTP.d.ts +0 -2
  193. package/dist/components/InputOTP/InputOTP.d.ts.map +1 -1
  194. package/dist/components/Label/Label.d.ts +3 -7
  195. package/dist/components/Label/Label.d.ts.map +1 -1
  196. package/dist/components/Popover/Popover.d.ts +6 -7
  197. package/dist/components/Popover/Popover.d.ts.map +1 -1
  198. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  199. package/dist/components/RadioGroup/RadioGroup.d.ts.map +1 -1
  200. package/dist/components/Select/Select.d.ts +12 -12
  201. package/dist/components/Select/Select.d.ts.map +1 -1
  202. package/dist/components/Separator/Separator.d.ts +12 -0
  203. package/dist/components/Separator/Separator.d.ts.map +1 -0
  204. package/dist/components/Slider/Slider.d.ts +15 -3
  205. package/dist/components/Slider/Slider.d.ts.map +1 -1
  206. package/dist/components/Textarea/Textarea.d.ts.map +1 -1
  207. package/dist/components/Tray/Tray.d.ts +28 -0
  208. package/dist/components/Tray/Tray.d.ts.map +1 -0
  209. package/dist/components/Tray/TrayStoriesData.d.ts +39 -0
  210. package/dist/components/Tray/TrayStoriesData.d.ts.map +1 -0
  211. package/dist/{createLucideIcon-CI1yJrZf.js → createLucideIcon-B_8CJpcQ.js} +4 -4
  212. package/dist/features/AuthCard/ForgotPasswordEmailForm.js +13 -3
  213. package/dist/features/AuthCard/ForgotPasswordResetForm.js +9 -9
  214. package/dist/features/AuthCard/PasswordInput.js +87 -9
  215. package/dist/features/AuthCard/SignInForm.js +25 -15
  216. package/dist/features/AuthCard/SignUpForm.js +24 -14
  217. package/dist/features/AuthCard.js +2 -2
  218. package/dist/features/LabelingTools.js +16 -6
  219. package/dist/features/SensorMetadata.js +15 -5
  220. package/dist/features/SettingsPopover.js +22 -12
  221. package/dist/index-0ioNhtNM.js +10 -0
  222. package/dist/{index-CBwRmAsQ.js → index-6Abv_Flm.js} +1 -1
  223. package/dist/{index-DUK1rxhf.js → index-B-GQStVW.js} +6 -5
  224. package/dist/index-B2oBi8ng.js +142 -0
  225. package/dist/index-BIpuW_o8.js +146 -0
  226. package/dist/index-BZPx6jYI.js +8 -0
  227. package/dist/index-BhufZRa2.js +232 -0
  228. package/dist/index-CAKA12cC.js +1265 -0
  229. package/dist/{index-Cfyte2YO.js → index-CGALWSq_.js} +1 -1
  230. package/dist/index-CVSxKOPp.js +13 -0
  231. package/dist/index-CevVJ05e.js +822 -0
  232. package/dist/{index-CRBC94ik.js → index-D29mdTf5.js} +1 -1
  233. package/dist/{index-FeGk8zep.js → index-NzygPVvJ.js} +10 -9
  234. package/dist/index-UEFPWH8U.js +54 -0
  235. package/dist/index-rKs9bXHr.js +6 -0
  236. package/dist/{index-Cb7rjMhE.js → index-y6Br5T4h.js} +6 -6
  237. package/dist/index.d.ts +11 -1
  238. package/dist/index.d.ts.map +1 -1
  239. package/dist/linear-cursor-small.png +0 -0
  240. package/dist/{loader-circle-CvdzOiQ_.js → loader-circle-CdRVlFhN.js} +2 -2
  241. package/dist/main.js +15630 -13510
  242. package/dist/message-alert-matte-glass-gradient.webp +0 -0
  243. package/dist/primitives/button.d.ts +10 -0
  244. package/dist/primitives/button.d.ts.map +1 -0
  245. package/dist/primitives/button.js +42 -0
  246. package/dist/primitives/input.d.ts +3 -0
  247. package/dist/primitives/input.d.ts.map +1 -0
  248. package/dist/primitives/input.js +18 -0
  249. package/dist/primitives/select.d.ts +16 -0
  250. package/dist/primitives/select.d.ts.map +1 -0
  251. package/dist/primitives/select.js +205 -0
  252. package/dist/primitives/slot.d.ts.map +1 -1
  253. package/dist/primitives/slot.js +21 -20
  254. package/dist/primitives/textarea.d.ts +3 -0
  255. package/dist/primitives/textarea.d.ts.map +1 -0
  256. package/dist/primitives/textarea.js +16 -0
  257. package/dist/{proxy-DD79Ok6n.js → proxy-C9AqCss6.js} +1 -1
  258. package/dist/speech-bubble-fluid-glass-gradient.webp +0 -0
  259. package/dist/styles/main.css +1 -1
  260. package/dist/utils/formFieldUtils.js +1 -1
  261. package/dist/utils/twUtils.js +2728 -2
  262. package/dist/{x-BBpi7a_7.js → x-Dl66o_vF.js} +2 -2
  263. package/package.json +28 -23
  264. package/dist/Accordion/AccordionBase.d.ts +0 -42
  265. package/dist/Accordion/AccordionBase.js +0 -225
  266. package/dist/Badge/BadgeBase.d.ts +0 -13
  267. package/dist/Badge/BadgeBase.js +0 -35
  268. package/dist/PasswordInput-ClY_hxuN.js +0 -261
  269. package/dist/components/Accordion/AccordionBase.d.ts +0 -42
  270. package/dist/components/Accordion/AccordionBase.d.ts.map +0 -1
  271. package/dist/components/Badge/BadgeBase.d.ts +0 -13
  272. package/dist/components/Badge/BadgeBase.d.ts.map +0 -1
  273. package/dist/index-CA7haECj.js +0 -248
  274. package/dist/index-CbXx14YO.js +0 -59
  275. package/dist/index-VXXKXen4.js +0 -15
  276. package/dist/index-cCg4yNa8.js +0 -132
  277. package/dist/primitives/label.d.ts +0 -5
  278. package/dist/primitives/label.d.ts.map +0 -1
  279. package/dist/primitives/label.js +0 -27
  280. package/dist/twUtils-CRiPKpXj.js +0 -2743
  281. /package/dist/{list.yml.webp → analyzer/list.yml.webp} +0 -0
@@ -0,0 +1,1265 @@
1
+ import "./styles/main.css";
2
+ import * as O from "react";
3
+ import i, { useMemo as Ye, useLayoutEffect as je, useEffect as qe } from "react";
4
+ import { c as Xe, e as Ge, P as gt, a as Lt, b as mt, g as Ke, u as Je } from "./index-BhufZRa2.js";
5
+ import { u as At } from "./index-CVSxKOPp.js";
6
+ import { D as Ze, P as Qe } from "./index-B2oBi8ng.js";
7
+ import { R as tn, h as en, u as nn, F as rn } from "./index-B-GQStVW.js";
8
+ import { P as Ft } from "./index-6Abv_Flm.js";
9
+ import { jsx as A, jsxs as Zt, Fragment as Qt } from "react/jsx-runtime";
10
+ var Et = "Dialog", [ae] = Xe(Et), [an, q] = ae(Et), oe = (t) => {
11
+ const {
12
+ __scopeDialog: n,
13
+ children: e,
14
+ open: a,
15
+ defaultOpen: o,
16
+ onOpenChange: r,
17
+ modal: c = !0
18
+ } = t, s = O.useRef(null), v = O.useRef(null), [E, g] = Je({
19
+ prop: a,
20
+ defaultProp: o ?? !1,
21
+ onChange: r,
22
+ caller: Et
23
+ });
24
+ return /* @__PURE__ */ A(
25
+ an,
26
+ {
27
+ scope: n,
28
+ triggerRef: s,
29
+ contentRef: v,
30
+ contentId: At(),
31
+ titleId: At(),
32
+ descriptionId: At(),
33
+ open: E,
34
+ onOpenChange: g,
35
+ onOpenToggle: O.useCallback(() => g((m) => !m), [g]),
36
+ modal: c,
37
+ children: e
38
+ }
39
+ );
40
+ };
41
+ oe.displayName = Et;
42
+ var ie = "DialogTrigger", se = O.forwardRef(
43
+ (t, n) => {
44
+ const { __scopeDialog: e, ...a } = t, o = q(ie, e), r = Lt(n, o.triggerRef);
45
+ return /* @__PURE__ */ A(
46
+ gt.button,
47
+ {
48
+ type: "button",
49
+ "aria-haspopup": "dialog",
50
+ "aria-expanded": o.open,
51
+ "aria-controls": o.contentId,
52
+ "data-state": Bt(o.open),
53
+ ...a,
54
+ ref: r,
55
+ onClick: mt(t.onClick, o.onOpenToggle)
56
+ }
57
+ );
58
+ }
59
+ );
60
+ se.displayName = ie;
61
+ var kt = "DialogPortal", [on, le] = ae(kt, {
62
+ forceMount: void 0
63
+ }), ue = (t) => {
64
+ const { __scopeDialog: n, forceMount: e, children: a, container: o } = t, r = q(kt, n);
65
+ return /* @__PURE__ */ A(on, { scope: n, forceMount: e, children: O.Children.map(a, (c) => /* @__PURE__ */ A(Ft, { present: e || r.open, children: /* @__PURE__ */ A(Qe, { asChild: !0, container: o, children: c }) })) });
66
+ };
67
+ ue.displayName = kt;
68
+ var Rt = "DialogOverlay", ce = O.forwardRef(
69
+ (t, n) => {
70
+ const e = le(Rt, t.__scopeDialog), { forceMount: a = e.forceMount, ...o } = t, r = q(Rt, t.__scopeDialog);
71
+ return r.modal ? /* @__PURE__ */ A(Ft, { present: a || r.open, children: /* @__PURE__ */ A(ln, { ...o, ref: n }) }) : null;
72
+ }
73
+ );
74
+ ce.displayName = Rt;
75
+ var sn = Ge("DialogOverlay.RemoveScroll"), ln = O.forwardRef(
76
+ (t, n) => {
77
+ const { __scopeDialog: e, ...a } = t, o = q(Rt, e);
78
+ return (
79
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
80
+ // ie. when `Overlay` and `Content` are siblings
81
+ /* @__PURE__ */ A(tn, { as: sn, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ A(
82
+ gt.div,
83
+ {
84
+ "data-state": Bt(o.open),
85
+ ...a,
86
+ ref: n,
87
+ style: { pointerEvents: "auto", ...a.style }
88
+ }
89
+ ) })
90
+ );
91
+ }
92
+ ), rt = "DialogContent", de = O.forwardRef(
93
+ (t, n) => {
94
+ const e = le(rt, t.__scopeDialog), { forceMount: a = e.forceMount, ...o } = t, r = q(rt, t.__scopeDialog);
95
+ return /* @__PURE__ */ A(Ft, { present: a || r.open, children: r.modal ? /* @__PURE__ */ A(un, { ...o, ref: n }) : /* @__PURE__ */ A(cn, { ...o, ref: n }) });
96
+ }
97
+ );
98
+ de.displayName = rt;
99
+ var un = O.forwardRef(
100
+ (t, n) => {
101
+ const e = q(rt, t.__scopeDialog), a = O.useRef(null), o = Lt(n, e.contentRef, a);
102
+ return O.useEffect(() => {
103
+ const r = a.current;
104
+ if (r) return en(r);
105
+ }, []), /* @__PURE__ */ A(
106
+ fe,
107
+ {
108
+ ...t,
109
+ ref: o,
110
+ trapFocus: e.open,
111
+ disableOutsidePointerEvents: !0,
112
+ onCloseAutoFocus: mt(t.onCloseAutoFocus, (r) => {
113
+ r.preventDefault(), e.triggerRef.current?.focus();
114
+ }),
115
+ onPointerDownOutside: mt(t.onPointerDownOutside, (r) => {
116
+ const c = r.detail.originalEvent, s = c.button === 0 && c.ctrlKey === !0;
117
+ (c.button === 2 || s) && r.preventDefault();
118
+ }),
119
+ onFocusOutside: mt(
120
+ t.onFocusOutside,
121
+ (r) => r.preventDefault()
122
+ )
123
+ }
124
+ );
125
+ }
126
+ ), cn = O.forwardRef(
127
+ (t, n) => {
128
+ const e = q(rt, t.__scopeDialog), a = O.useRef(!1), o = O.useRef(!1);
129
+ return /* @__PURE__ */ A(
130
+ fe,
131
+ {
132
+ ...t,
133
+ ref: n,
134
+ trapFocus: !1,
135
+ disableOutsidePointerEvents: !1,
136
+ onCloseAutoFocus: (r) => {
137
+ t.onCloseAutoFocus?.(r), r.defaultPrevented || (a.current || e.triggerRef.current?.focus(), r.preventDefault()), a.current = !1, o.current = !1;
138
+ },
139
+ onInteractOutside: (r) => {
140
+ t.onInteractOutside?.(r), r.defaultPrevented || (a.current = !0, r.detail.originalEvent.type === "pointerdown" && (o.current = !0));
141
+ const c = r.target;
142
+ e.triggerRef.current?.contains(c) && r.preventDefault(), r.detail.originalEvent.type === "focusin" && o.current && r.preventDefault();
143
+ }
144
+ }
145
+ );
146
+ }
147
+ ), fe = O.forwardRef(
148
+ (t, n) => {
149
+ const { __scopeDialog: e, trapFocus: a, onOpenAutoFocus: o, onCloseAutoFocus: r, ...c } = t, s = q(rt, e), v = O.useRef(null), E = Lt(n, v);
150
+ return nn(), /* @__PURE__ */ Zt(Qt, { children: [
151
+ /* @__PURE__ */ A(
152
+ rn,
153
+ {
154
+ asChild: !0,
155
+ loop: !0,
156
+ trapped: a,
157
+ onMountAutoFocus: o,
158
+ onUnmountAutoFocus: r,
159
+ children: /* @__PURE__ */ A(
160
+ Ze,
161
+ {
162
+ role: "dialog",
163
+ id: s.contentId,
164
+ "aria-describedby": s.descriptionId,
165
+ "aria-labelledby": s.titleId,
166
+ "data-state": Bt(s.open),
167
+ ...c,
168
+ ref: E,
169
+ onDismiss: () => s.onOpenChange(!1)
170
+ }
171
+ )
172
+ }
173
+ ),
174
+ /* @__PURE__ */ Zt(Qt, { children: [
175
+ /* @__PURE__ */ A(dn, { titleId: s.titleId }),
176
+ /* @__PURE__ */ A(pn, { contentRef: v, descriptionId: s.descriptionId })
177
+ ] })
178
+ ] });
179
+ }
180
+ ), Ht = "DialogTitle", pe = O.forwardRef(
181
+ (t, n) => {
182
+ const { __scopeDialog: e, ...a } = t, o = q(Ht, e);
183
+ return /* @__PURE__ */ A(gt.h2, { id: o.titleId, ...a, ref: n });
184
+ }
185
+ );
186
+ pe.displayName = Ht;
187
+ var me = "DialogDescription", ge = O.forwardRef(
188
+ (t, n) => {
189
+ const { __scopeDialog: e, ...a } = t, o = q(me, e);
190
+ return /* @__PURE__ */ A(gt.p, { id: o.descriptionId, ...a, ref: n });
191
+ }
192
+ );
193
+ ge.displayName = me;
194
+ var he = "DialogClose", we = O.forwardRef(
195
+ (t, n) => {
196
+ const { __scopeDialog: e, ...a } = t, o = q(he, e);
197
+ return /* @__PURE__ */ A(
198
+ gt.button,
199
+ {
200
+ type: "button",
201
+ ...a,
202
+ ref: n,
203
+ onClick: mt(t.onClick, () => o.onOpenChange(!1))
204
+ }
205
+ );
206
+ }
207
+ );
208
+ we.displayName = he;
209
+ function Bt(t) {
210
+ return t ? "open" : "closed";
211
+ }
212
+ var ve = "DialogTitleWarning", [rr, ye] = Ke(ve, {
213
+ contentName: rt,
214
+ titleName: Ht,
215
+ docsSlug: "dialog"
216
+ }), dn = ({ titleId: t }) => {
217
+ const n = ye(ve), e = `\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
218
+
219
+ If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
220
+
221
+ For more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;
222
+ return O.useEffect(() => {
223
+ t && (document.getElementById(t) || console.error(e));
224
+ }, [e, t]), null;
225
+ }, fn = "DialogDescriptionWarning", pn = ({ contentRef: t, descriptionId: n }) => {
226
+ const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ye(fn).contentName}}.`;
227
+ return O.useEffect(() => {
228
+ const o = t.current?.getAttribute("aria-describedby");
229
+ n && o && (document.getElementById(n) || console.warn(a));
230
+ }, [a, t, n]), null;
231
+ }, mn = oe, gn = se, hn = ue, wn = ce, vn = de, yn = pe, bn = ge, Dn = we;
232
+ function Rn(t) {
233
+ if (typeof document > "u") return;
234
+ let n = document.head || document.getElementsByTagName("head")[0], e = document.createElement("style");
235
+ e.type = "text/css", n.appendChild(e), e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
236
+ }
237
+ const be = i.createContext({
238
+ drawerRef: {
239
+ current: null
240
+ },
241
+ overlayRef: {
242
+ current: null
243
+ },
244
+ onPress: () => {
245
+ },
246
+ onRelease: () => {
247
+ },
248
+ onDrag: () => {
249
+ },
250
+ onNestedDrag: () => {
251
+ },
252
+ onNestedOpenChange: () => {
253
+ },
254
+ onNestedRelease: () => {
255
+ },
256
+ openProp: void 0,
257
+ dismissible: !1,
258
+ isOpen: !1,
259
+ isDragging: !1,
260
+ keyboardIsOpen: {
261
+ current: !1
262
+ },
263
+ snapPointsOffset: null,
264
+ snapPoints: null,
265
+ handleOnly: !1,
266
+ modal: !1,
267
+ shouldFade: !1,
268
+ activeSnapPoint: null,
269
+ onOpenChange: () => {
270
+ },
271
+ setActiveSnapPoint: () => {
272
+ },
273
+ closeDrawer: () => {
274
+ },
275
+ direction: "bottom",
276
+ shouldAnimate: {
277
+ current: !0
278
+ },
279
+ shouldScaleBackground: !1,
280
+ setBackgroundColorOnScale: !0,
281
+ noBodyStyles: !1,
282
+ container: null,
283
+ autoFocus: !1
284
+ }), ht = () => {
285
+ const t = i.useContext(be);
286
+ if (!t)
287
+ throw new Error("useDrawerContext must be used within a Drawer.Root");
288
+ return t;
289
+ };
290
+ Rn(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
291
+ [data-state=closed]
292
+ ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);
293
+ function En() {
294
+ const t = navigator.userAgent;
295
+ return typeof window < "u" && (/Firefox/.test(t) && /Mobile/.test(t) || // Android Firefox
296
+ /FxiOS/.test(t));
297
+ }
298
+ function Sn() {
299
+ return Wt(/^Mac/);
300
+ }
301
+ function Tn() {
302
+ return Wt(/^iPhone/);
303
+ }
304
+ function te() {
305
+ return /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
306
+ }
307
+ function Cn() {
308
+ return Wt(/^iPad/) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
309
+ Sn() && navigator.maxTouchPoints > 1;
310
+ }
311
+ function De() {
312
+ return Tn() || Cn();
313
+ }
314
+ function Wt(t) {
315
+ return typeof window < "u" && window.navigator != null ? t.test(window.navigator.platform) : void 0;
316
+ }
317
+ const On = 24, xn = typeof window < "u" ? je : qe;
318
+ function ee(...t) {
319
+ return (...n) => {
320
+ for (let e of t)
321
+ typeof e == "function" && e(...n);
322
+ };
323
+ }
324
+ const Pt = typeof document < "u" && window.visualViewport;
325
+ function ne(t) {
326
+ let n = window.getComputedStyle(t);
327
+ return /(auto|scroll)/.test(n.overflow + n.overflowX + n.overflowY);
328
+ }
329
+ function Re(t) {
330
+ for (ne(t) && (t = t.parentElement); t && !ne(t); )
331
+ t = t.parentElement;
332
+ return t || document.scrollingElement || document.documentElement;
333
+ }
334
+ const An = /* @__PURE__ */ new Set([
335
+ "checkbox",
336
+ "radio",
337
+ "range",
338
+ "color",
339
+ "file",
340
+ "image",
341
+ "button",
342
+ "submit",
343
+ "reset"
344
+ ]);
345
+ let bt = 0, _t;
346
+ function Pn(t = {}) {
347
+ let { isDisabled: n } = t;
348
+ xn(() => {
349
+ if (!n)
350
+ return bt++, bt === 1 && De() && (_t = _n()), () => {
351
+ bt--, bt === 0 && _t?.();
352
+ };
353
+ }, [
354
+ n
355
+ ]);
356
+ }
357
+ function _n() {
358
+ let t, n = 0, e = (m) => {
359
+ t = Re(m.target), !(t === document.documentElement && t === document.body) && (n = m.changedTouches[0].pageY);
360
+ }, a = (m) => {
361
+ if (!t || t === document.documentElement || t === document.body) {
362
+ m.preventDefault();
363
+ return;
364
+ }
365
+ let h = m.changedTouches[0].pageY, W = t.scrollTop, H = t.scrollHeight - t.clientHeight;
366
+ H !== 0 && ((W <= 0 && h > n || W >= H && h < n) && m.preventDefault(), n = h);
367
+ }, o = (m) => {
368
+ let h = m.target;
369
+ $t(h) && h !== document.activeElement && (m.preventDefault(), h.style.transform = "translateY(-2000px)", h.focus(), requestAnimationFrame(() => {
370
+ h.style.transform = "";
371
+ }));
372
+ }, r = (m) => {
373
+ let h = m.target;
374
+ $t(h) && (h.style.transform = "translateY(-2000px)", requestAnimationFrame(() => {
375
+ h.style.transform = "", Pt && (Pt.height < window.innerHeight ? requestAnimationFrame(() => {
376
+ re(h);
377
+ }) : Pt.addEventListener("resize", () => re(h), {
378
+ once: !0
379
+ }));
380
+ }));
381
+ }, c = () => {
382
+ window.scrollTo(0, 0);
383
+ }, s = window.pageXOffset, v = window.pageYOffset, E = ee(Mn(document.documentElement, "paddingRight", `${window.innerWidth - document.documentElement.clientWidth}px`));
384
+ window.scrollTo(0, 0);
385
+ let g = ee(ft(document, "touchstart", e, {
386
+ passive: !1,
387
+ capture: !0
388
+ }), ft(document, "touchmove", a, {
389
+ passive: !1,
390
+ capture: !0
391
+ }), ft(document, "touchend", o, {
392
+ passive: !1,
393
+ capture: !0
394
+ }), ft(document, "focus", r, !0), ft(window, "scroll", c));
395
+ return () => {
396
+ E(), g(), window.scrollTo(s, v);
397
+ };
398
+ }
399
+ function Mn(t, n, e) {
400
+ let a = t.style[n];
401
+ return t.style[n] = e, () => {
402
+ t.style[n] = a;
403
+ };
404
+ }
405
+ function ft(t, n, e, a) {
406
+ return t.addEventListener(n, e, a), () => {
407
+ t.removeEventListener(n, e, a);
408
+ };
409
+ }
410
+ function re(t) {
411
+ let n = document.scrollingElement || document.documentElement;
412
+ for (; t && t !== n; ) {
413
+ let e = Re(t);
414
+ if (e !== document.documentElement && e !== document.body && e !== t) {
415
+ let a = e.getBoundingClientRect().top, o = t.getBoundingClientRect().top, r = t.getBoundingClientRect().bottom;
416
+ const c = e.getBoundingClientRect().bottom + On;
417
+ r > c && (e.scrollTop += o - a);
418
+ }
419
+ t = e.parentElement;
420
+ }
421
+ }
422
+ function $t(t) {
423
+ return t instanceof HTMLInputElement && !An.has(t.type) || t instanceof HTMLTextAreaElement || t instanceof HTMLElement && t.isContentEditable;
424
+ }
425
+ function In(t, n) {
426
+ typeof t == "function" ? t(n) : t != null && (t.current = n);
427
+ }
428
+ function $n(...t) {
429
+ return (n) => t.forEach((e) => In(e, n));
430
+ }
431
+ function Ee(...t) {
432
+ return O.useCallback($n(...t), t);
433
+ }
434
+ const Se = /* @__PURE__ */ new WeakMap();
435
+ function _(t, n, e = !1) {
436
+ if (!t || !(t instanceof HTMLElement)) return;
437
+ let a = {};
438
+ Object.entries(n).forEach(([o, r]) => {
439
+ if (o.startsWith("--")) {
440
+ t.style.setProperty(o, r);
441
+ return;
442
+ }
443
+ a[o] = t.style[o], t.style[o] = r;
444
+ }), !e && Se.set(t, a);
445
+ }
446
+ function Nn(t, n) {
447
+ if (!t || !(t instanceof HTMLElement)) return;
448
+ let e = Se.get(t);
449
+ e && (t.style[n] = e[n]);
450
+ }
451
+ const P = (t) => {
452
+ switch (t) {
453
+ case "top":
454
+ case "bottom":
455
+ return !0;
456
+ case "left":
457
+ case "right":
458
+ return !1;
459
+ default:
460
+ return t;
461
+ }
462
+ };
463
+ function Dt(t, n) {
464
+ if (!t)
465
+ return null;
466
+ const e = window.getComputedStyle(t), a = (
467
+ // @ts-ignore
468
+ e.transform || e.webkitTransform || e.mozTransform
469
+ );
470
+ let o = a.match(/^matrix3d\((.+)\)$/);
471
+ return o ? parseFloat(o[1].split(", ")[P(n) ? 13 : 12]) : (o = a.match(/^matrix\((.+)\)$/), o ? parseFloat(o[1].split(", ")[P(n) ? 5 : 4]) : null);
472
+ }
473
+ function Ln(t) {
474
+ return 8 * (Math.log(t + 1) - 2);
475
+ }
476
+ function Mt(t, n) {
477
+ if (!t) return () => {
478
+ };
479
+ const e = t.style.cssText;
480
+ return Object.assign(t.style, n), () => {
481
+ t.style.cssText = e;
482
+ };
483
+ }
484
+ function Fn(...t) {
485
+ return (...n) => {
486
+ for (const e of t)
487
+ typeof e == "function" && e(...n);
488
+ };
489
+ }
490
+ const C = {
491
+ DURATION: 0.5,
492
+ EASE: [
493
+ 0.32,
494
+ 0.72,
495
+ 0,
496
+ 1
497
+ ]
498
+ }, Te = 0.4, kn = 0.25, Hn = 100, Ce = 8, nt = 16, Nt = 26, It = "vaul-dragging";
499
+ function Oe(t) {
500
+ const n = i.useRef(t);
501
+ return i.useEffect(() => {
502
+ n.current = t;
503
+ }), i.useMemo(() => (...e) => n.current == null ? void 0 : n.current.call(n, ...e), []);
504
+ }
505
+ function Bn({ defaultProp: t, onChange: n }) {
506
+ const e = i.useState(t), [a] = e, o = i.useRef(a), r = Oe(n);
507
+ return i.useEffect(() => {
508
+ o.current !== a && (r(a), o.current = a);
509
+ }, [
510
+ a,
511
+ o,
512
+ r
513
+ ]), e;
514
+ }
515
+ function xe({ prop: t, defaultProp: n, onChange: e = () => {
516
+ } }) {
517
+ const [a, o] = Bn({
518
+ defaultProp: n,
519
+ onChange: e
520
+ }), r = t !== void 0, c = r ? t : a, s = Oe(e), v = i.useCallback((E) => {
521
+ if (r) {
522
+ const m = typeof E == "function" ? E(t) : E;
523
+ m !== t && s(m);
524
+ } else
525
+ o(E);
526
+ }, [
527
+ r,
528
+ t,
529
+ o,
530
+ s
531
+ ]);
532
+ return [
533
+ c,
534
+ v
535
+ ];
536
+ }
537
+ function Wn({ activeSnapPointProp: t, setActiveSnapPointProp: n, snapPoints: e, drawerRef: a, overlayRef: o, fadeFromIndex: r, onSnapPointChange: c, direction: s = "bottom", container: v, snapToSequentialPoint: E }) {
538
+ const [g, m] = xe({
539
+ prop: t,
540
+ defaultProp: e?.[0],
541
+ onChange: n
542
+ }), [h, W] = i.useState(typeof window < "u" ? {
543
+ innerWidth: window.innerWidth,
544
+ innerHeight: window.innerHeight
545
+ } : void 0);
546
+ i.useEffect(() => {
547
+ function d() {
548
+ W({
549
+ innerWidth: window.innerWidth,
550
+ innerHeight: window.innerHeight
551
+ });
552
+ }
553
+ return window.addEventListener("resize", d), () => window.removeEventListener("resize", d);
554
+ }, []);
555
+ const H = i.useMemo(() => g === e?.[e.length - 1] || null, [
556
+ e,
557
+ g
558
+ ]), T = i.useMemo(() => {
559
+ var d;
560
+ return (d = e?.findIndex((D) => D === g)) != null ? d : null;
561
+ }, [
562
+ e,
563
+ g
564
+ ]), U = e && e.length > 0 && (r || r === 0) && !Number.isNaN(r) && e[r] === g || !e, w = i.useMemo(() => {
565
+ const d = v ? {
566
+ width: v.getBoundingClientRect().width,
567
+ height: v.getBoundingClientRect().height
568
+ } : typeof window < "u" ? {
569
+ width: window.innerWidth,
570
+ height: window.innerHeight
571
+ } : {
572
+ width: 0,
573
+ height: 0
574
+ };
575
+ var D;
576
+ return (D = e?.map((b) => {
577
+ const L = typeof b == "string";
578
+ let $ = 0;
579
+ if (L && ($ = parseInt(b, 10)), P(s)) {
580
+ const u = L ? $ : h ? b * d.height : 0;
581
+ return h ? s === "bottom" ? d.height - u : -d.height + u : u;
582
+ }
583
+ const V = L ? $ : h ? b * d.width : 0;
584
+ return h ? s === "right" ? d.width - V : -d.width + V : V;
585
+ })) != null ? D : [];
586
+ }, [
587
+ e,
588
+ h,
589
+ v
590
+ ]), I = i.useMemo(() => T !== null ? w?.[T] : null, [
591
+ w,
592
+ T
593
+ ]), M = i.useCallback((d) => {
594
+ var D;
595
+ const b = (D = w?.findIndex((L) => L === d)) != null ? D : null;
596
+ c(b), _(a.current, {
597
+ transition: `transform ${C.DURATION}s cubic-bezier(${C.EASE.join(",")})`,
598
+ transform: P(s) ? `translate3d(0, ${d}px, 0)` : `translate3d(${d}px, 0, 0)`
599
+ }), w && b !== w.length - 1 && r !== void 0 && b !== r && b < r ? _(o.current, {
600
+ transition: `opacity ${C.DURATION}s cubic-bezier(${C.EASE.join(",")})`,
601
+ opacity: "0"
602
+ }) : _(o.current, {
603
+ transition: `opacity ${C.DURATION}s cubic-bezier(${C.EASE.join(",")})`,
604
+ opacity: "1"
605
+ }), m(e?.[Math.max(b, 0)]);
606
+ }, [
607
+ a.current,
608
+ e,
609
+ w,
610
+ r,
611
+ o,
612
+ m
613
+ ]);
614
+ i.useEffect(() => {
615
+ if (g || t) {
616
+ var d;
617
+ const D = (d = e?.findIndex((b) => b === t || b === g)) != null ? d : -1;
618
+ w && D !== -1 && typeof w[D] == "number" && M(w[D]);
619
+ }
620
+ }, [
621
+ g,
622
+ t,
623
+ e,
624
+ w,
625
+ M
626
+ ]);
627
+ function f({ draggedDistance: d, closeDrawer: D, velocity: b, dismissible: L }) {
628
+ if (r === void 0) return;
629
+ const $ = s === "bottom" || s === "right" ? (I ?? 0) - d : (I ?? 0) + d, V = T === r - 1, u = T === 0, z = d > 0;
630
+ if (V && _(o.current, {
631
+ transition: `opacity ${C.DURATION}s cubic-bezier(${C.EASE.join(",")})`
632
+ }), !E && b > 2 && !z) {
633
+ L ? D() : M(w[0]);
634
+ return;
635
+ }
636
+ if (!E && b > 2 && z && w && e) {
637
+ M(w[e.length - 1]);
638
+ return;
639
+ }
640
+ const F = w?.reduce((N, K) => typeof N != "number" || typeof K != "number" ? N : Math.abs(K - $) < Math.abs(N - $) ? K : N), Y = P(s) ? window.innerHeight : window.innerWidth;
641
+ if (b > Te && Math.abs(d) < Y * 0.4) {
642
+ const N = z ? 1 : -1;
643
+ if (N > 0 && H && e) {
644
+ M(w[e.length - 1]);
645
+ return;
646
+ }
647
+ if (u && N < 0 && L && D(), T === null) return;
648
+ M(w[T + N]);
649
+ return;
650
+ }
651
+ M(F);
652
+ }
653
+ function X({ draggedDistance: d }) {
654
+ if (I === null) return;
655
+ const D = s === "bottom" || s === "right" ? I - d : I + d;
656
+ (s === "bottom" || s === "right") && D < w[w.length - 1] || (s === "top" || s === "left") && D > w[w.length - 1] || _(a.current, {
657
+ transform: P(s) ? `translate3d(0, ${D}px, 0)` : `translate3d(${D}px, 0, 0)`
658
+ });
659
+ }
660
+ function tt(d, D) {
661
+ if (!e || typeof T != "number" || !w || r === void 0) return null;
662
+ const b = T === r - 1;
663
+ if (T >= r && D)
664
+ return 0;
665
+ if (b && !D) return 1;
666
+ if (!U && !b) return null;
667
+ const $ = b ? T + 1 : T - 1, V = b ? w[$] - w[$ - 1] : w[$ + 1] - w[$], u = d / Math.abs(V);
668
+ return b ? 1 - u : u;
669
+ }
670
+ return {
671
+ isLastSnapPoint: H,
672
+ activeSnapPoint: g,
673
+ shouldFade: U,
674
+ getPercentageDragged: tt,
675
+ setActiveSnapPoint: m,
676
+ activeSnapPointIndex: T,
677
+ onRelease: f,
678
+ onDrag: X,
679
+ snapPointsOffset: w
680
+ };
681
+ }
682
+ const Un = () => () => {
683
+ };
684
+ function zn() {
685
+ const { direction: t, isOpen: n, shouldScaleBackground: e, setBackgroundColorOnScale: a, noBodyStyles: o } = ht(), r = i.useRef(null), c = Ye(() => document.body.style.backgroundColor, []);
686
+ function s() {
687
+ return (window.innerWidth - Nt) / window.innerWidth;
688
+ }
689
+ i.useEffect(() => {
690
+ if (n && e) {
691
+ r.current && clearTimeout(r.current);
692
+ const v = document.querySelector("[data-vaul-drawer-wrapper]") || document.querySelector("[vaul-drawer-wrapper]");
693
+ if (!v) return;
694
+ Fn(a && !o ? Mt(document.body, {
695
+ background: "black"
696
+ }) : Un, Mt(v, {
697
+ transformOrigin: P(t) ? "top" : "left",
698
+ transitionProperty: "transform, border-radius",
699
+ transitionDuration: `${C.DURATION}s`,
700
+ transitionTimingFunction: `cubic-bezier(${C.EASE.join(",")})`
701
+ }));
702
+ const E = Mt(v, {
703
+ borderRadius: `${Ce}px`,
704
+ overflow: "hidden",
705
+ ...P(t) ? {
706
+ transform: `scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`
707
+ } : {
708
+ transform: `scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`
709
+ }
710
+ });
711
+ return () => {
712
+ E(), r.current = window.setTimeout(() => {
713
+ c ? document.body.style.background = c : document.body.style.removeProperty("background");
714
+ }, C.DURATION * 1e3);
715
+ };
716
+ }
717
+ }, [
718
+ n,
719
+ e,
720
+ c
721
+ ]);
722
+ }
723
+ let pt = null;
724
+ function Vn({ isOpen: t, modal: n, nested: e, hasBeenOpened: a, preventScrollRestoration: o, noBodyStyles: r }) {
725
+ const [c, s] = i.useState(() => typeof window < "u" ? window.location.href : ""), v = i.useRef(0), E = i.useCallback(() => {
726
+ if (te() && pt === null && t && !r) {
727
+ pt = {
728
+ position: document.body.style.position,
729
+ top: document.body.style.top,
730
+ left: document.body.style.left,
731
+ height: document.body.style.height,
732
+ right: "unset"
733
+ };
734
+ const { scrollX: m, innerHeight: h } = window;
735
+ document.body.style.setProperty("position", "fixed", "important"), Object.assign(document.body.style, {
736
+ top: `${-v.current}px`,
737
+ left: `${-m}px`,
738
+ right: "0px",
739
+ height: "auto"
740
+ }), window.setTimeout(() => window.requestAnimationFrame(() => {
741
+ const W = h - window.innerHeight;
742
+ W && v.current >= h && (document.body.style.top = `${-(v.current + W)}px`);
743
+ }), 300);
744
+ }
745
+ }, [
746
+ t
747
+ ]), g = i.useCallback(() => {
748
+ if (te() && pt !== null && !r) {
749
+ const m = -parseInt(document.body.style.top, 10), h = -parseInt(document.body.style.left, 10);
750
+ Object.assign(document.body.style, pt), window.requestAnimationFrame(() => {
751
+ if (o && c !== window.location.href) {
752
+ s(window.location.href);
753
+ return;
754
+ }
755
+ window.scrollTo(h, m);
756
+ }), pt = null;
757
+ }
758
+ }, [
759
+ c
760
+ ]);
761
+ return i.useEffect(() => {
762
+ function m() {
763
+ v.current = window.scrollY;
764
+ }
765
+ return m(), window.addEventListener("scroll", m), () => {
766
+ window.removeEventListener("scroll", m);
767
+ };
768
+ }, []), i.useEffect(() => {
769
+ if (n)
770
+ return () => {
771
+ typeof document > "u" || document.querySelector("[data-vaul-drawer]") || g();
772
+ };
773
+ }, [
774
+ n,
775
+ g
776
+ ]), i.useEffect(() => {
777
+ e || !a || (t ? (!window.matchMedia("(display-mode: standalone)").matches && E(), n || window.setTimeout(() => {
778
+ g();
779
+ }, 500)) : g());
780
+ }, [
781
+ t,
782
+ a,
783
+ c,
784
+ n,
785
+ e,
786
+ E,
787
+ g
788
+ ]), {
789
+ restorePositionSetting: g
790
+ };
791
+ }
792
+ function Yn({ open: t, onOpenChange: n, children: e, onDrag: a, onRelease: o, snapPoints: r, shouldScaleBackground: c = !1, setBackgroundColorOnScale: s = !0, closeThreshold: v = kn, scrollLockTimeout: E = Hn, dismissible: g = !0, handleOnly: m = !1, fadeFromIndex: h = r && r.length - 1, activeSnapPoint: W, setActiveSnapPoint: H, fixed: T, modal: U = !0, onClose: w, nested: I, noBodyStyles: M = !1, direction: f = "bottom", defaultOpen: X = !1, disablePreventScroll: tt = !0, snapToSequentialPoint: d = !1, preventScrollRestoration: D = !1, repositionInputs: b = !0, onAnimationEnd: L, container: $, autoFocus: V = !1 }) {
793
+ var u, z;
794
+ const [F = !1, Y] = xe({
795
+ defaultProp: X,
796
+ prop: t,
797
+ onChange: (l) => {
798
+ n?.(l), !l && !I && Fe(), setTimeout(() => {
799
+ L?.(l);
800
+ }, C.DURATION * 1e3), l && !U && typeof window < "u" && window.requestAnimationFrame(() => {
801
+ document.body.style.pointerEvents = "auto";
802
+ }), l || (document.body.style.pointerEvents = "auto");
803
+ }
804
+ }), [N, K] = i.useState(!1), [J, st] = i.useState(!1), [_e, Ut] = i.useState(!1), at = i.useRef(null), wt = i.useRef(null), St = i.useRef(null), Tt = i.useRef(null), lt = i.useRef(null), ut = i.useRef(!1), Ct = i.useRef(null), Ot = i.useRef(0), ot = i.useRef(!1), zt = i.useRef(!X), Vt = i.useRef(0), p = i.useRef(null), Yt = i.useRef(((u = p.current) == null ? void 0 : u.getBoundingClientRect().height) || 0), jt = i.useRef(((z = p.current) == null ? void 0 : z.getBoundingClientRect().width) || 0), xt = i.useRef(0), Me = i.useCallback((l) => {
805
+ r && l === ct.length - 1 && (wt.current = /* @__PURE__ */ new Date());
806
+ }, []), { activeSnapPoint: Ie, activeSnapPointIndex: it, setActiveSnapPoint: qt, onRelease: $e, snapPointsOffset: ct, onDrag: Ne, shouldFade: Xt, getPercentageDragged: Le } = Wn({
807
+ snapPoints: r,
808
+ activeSnapPointProp: W,
809
+ setActiveSnapPointProp: H,
810
+ drawerRef: p,
811
+ fadeFromIndex: h,
812
+ overlayRef: at,
813
+ onSnapPointChange: Me,
814
+ direction: f,
815
+ container: $,
816
+ snapToSequentialPoint: d
817
+ });
818
+ Pn({
819
+ isDisabled: !F || J || !U || _e || !N || !b || !tt
820
+ });
821
+ const { restorePositionSetting: Fe } = Vn({
822
+ isOpen: F,
823
+ modal: U,
824
+ nested: I ?? !1,
825
+ hasBeenOpened: N,
826
+ preventScrollRestoration: D,
827
+ noBodyStyles: M
828
+ });
829
+ function vt() {
830
+ return (window.innerWidth - Nt) / window.innerWidth;
831
+ }
832
+ function ke(l) {
833
+ var R, S;
834
+ !g && !r || p.current && !p.current.contains(l.target) || (Yt.current = ((R = p.current) == null ? void 0 : R.getBoundingClientRect().height) || 0, jt.current = ((S = p.current) == null ? void 0 : S.getBoundingClientRect().width) || 0, st(!0), St.current = /* @__PURE__ */ new Date(), De() && window.addEventListener("touchend", () => ut.current = !1, {
835
+ once: !0
836
+ }), l.target.setPointerCapture(l.pointerId), Ot.current = P(f) ? l.pageY : l.pageX);
837
+ }
838
+ function Gt(l, R) {
839
+ var S;
840
+ let y = l;
841
+ const x = (S = window.getSelection()) == null ? void 0 : S.toString(), B = p.current ? Dt(p.current, f) : null, k = /* @__PURE__ */ new Date();
842
+ if (y.tagName === "SELECT" || y.hasAttribute("data-vaul-no-drag") || y.closest("[data-vaul-no-drag]"))
843
+ return !1;
844
+ if (f === "right" || f === "left")
845
+ return !0;
846
+ if (wt.current && k.getTime() - wt.current.getTime() < 500)
847
+ return !1;
848
+ if (B !== null && (f === "bottom" ? B > 0 : B < 0))
849
+ return !0;
850
+ if (x && x.length > 0)
851
+ return !1;
852
+ if (lt.current && k.getTime() - lt.current.getTime() < E && B === 0 || R)
853
+ return lt.current = k, !1;
854
+ for (; y; ) {
855
+ if (y.scrollHeight > y.clientHeight) {
856
+ if (y.scrollTop !== 0)
857
+ return lt.current = /* @__PURE__ */ new Date(), !1;
858
+ if (y.getAttribute("role") === "dialog")
859
+ return !0;
860
+ }
861
+ y = y.parentNode;
862
+ }
863
+ return !0;
864
+ }
865
+ function He(l) {
866
+ if (p.current && J) {
867
+ const R = f === "bottom" || f === "right" ? 1 : -1, S = (Ot.current - (P(f) ? l.pageY : l.pageX)) * R, y = S > 0, x = r && !g && !y;
868
+ if (x && it === 0) return;
869
+ const B = Math.abs(S), k = document.querySelector("[data-vaul-drawer-wrapper]"), Z = f === "bottom" || f === "top" ? Yt.current : jt.current;
870
+ let j = B / Z;
871
+ const et = Le(B, y);
872
+ if (et !== null && (j = et), x && j >= 1 || !ut.current && !Gt(l.target, y)) return;
873
+ if (p.current.classList.add(It), ut.current = !0, _(p.current, {
874
+ transition: "none"
875
+ }), _(at.current, {
876
+ transition: "none"
877
+ }), r && Ne({
878
+ draggedDistance: S
879
+ }), y && !r) {
880
+ const G = Ln(S), yt = Math.min(G * -1, 0) * R;
881
+ _(p.current, {
882
+ transform: P(f) ? `translate3d(0, ${yt}px, 0)` : `translate3d(${yt}px, 0, 0)`
883
+ });
884
+ return;
885
+ }
886
+ const Q = 1 - j;
887
+ if ((Xt || h && it === h - 1) && (a?.(l, j), _(at.current, {
888
+ opacity: `${Q}`,
889
+ transition: "none"
890
+ }, !0)), k && at.current && c) {
891
+ const G = Math.min(vt() + j * (1 - vt()), 1), yt = 8 - j * 8, Jt = Math.max(0, 14 - j * 14);
892
+ _(k, {
893
+ borderRadius: `${yt}px`,
894
+ transform: P(f) ? `scale(${G}) translate3d(0, ${Jt}px, 0)` : `scale(${G}) translate3d(${Jt}px, 0, 0)`,
895
+ transition: "none"
896
+ }, !0);
897
+ }
898
+ if (!r) {
899
+ const G = B * R;
900
+ _(p.current, {
901
+ transform: P(f) ? `translate3d(0, ${G}px, 0)` : `translate3d(${G}px, 0, 0)`
902
+ });
903
+ }
904
+ }
905
+ }
906
+ i.useEffect(() => {
907
+ window.requestAnimationFrame(() => {
908
+ zt.current = !0;
909
+ });
910
+ }, []), i.useEffect(() => {
911
+ var l;
912
+ function R() {
913
+ if (!p.current || !b) return;
914
+ const S = document.activeElement;
915
+ if ($t(S) || ot.current) {
916
+ var y;
917
+ const x = ((y = window.visualViewport) == null ? void 0 : y.height) || 0, B = window.innerHeight;
918
+ let k = B - x;
919
+ const Z = p.current.getBoundingClientRect().height || 0, j = Z > B * 0.8;
920
+ xt.current || (xt.current = Z);
921
+ const et = p.current.getBoundingClientRect().top;
922
+ if (Math.abs(Vt.current - k) > 60 && (ot.current = !ot.current), r && r.length > 0 && ct && it) {
923
+ const Q = ct[it] || 0;
924
+ k += Q;
925
+ }
926
+ if (Vt.current = k, Z > x || ot.current) {
927
+ const Q = p.current.getBoundingClientRect().height;
928
+ let G = Q;
929
+ Q > x && (G = x - (j ? et : Nt)), T ? p.current.style.height = `${Q - Math.max(k, 0)}px` : p.current.style.height = `${Math.max(G, x - et)}px`;
930
+ } else En() || (p.current.style.height = `${xt.current}px`);
931
+ r && r.length > 0 && !ot.current ? p.current.style.bottom = "0px" : p.current.style.bottom = `${Math.max(k, 0)}px`;
932
+ }
933
+ }
934
+ return (l = window.visualViewport) == null || l.addEventListener("resize", R), () => {
935
+ var S;
936
+ return (S = window.visualViewport) == null ? void 0 : S.removeEventListener("resize", R);
937
+ };
938
+ }, [
939
+ it,
940
+ r,
941
+ ct
942
+ ]);
943
+ function dt(l) {
944
+ Be(), w?.(), l || Y(!1), setTimeout(() => {
945
+ r && qt(r[0]);
946
+ }, C.DURATION * 1e3);
947
+ }
948
+ function Kt() {
949
+ if (!p.current) return;
950
+ const l = document.querySelector("[data-vaul-drawer-wrapper]"), R = Dt(p.current, f);
951
+ _(p.current, {
952
+ transform: "translate3d(0, 0, 0)",
953
+ transition: `transform ${C.DURATION}s cubic-bezier(${C.EASE.join(",")})`
954
+ }), _(at.current, {
955
+ transition: `opacity ${C.DURATION}s cubic-bezier(${C.EASE.join(",")})`,
956
+ opacity: "1"
957
+ }), c && R && R > 0 && F && _(l, {
958
+ borderRadius: `${Ce}px`,
959
+ overflow: "hidden",
960
+ ...P(f) ? {
961
+ transform: `scale(${vt()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
962
+ transformOrigin: "top"
963
+ } : {
964
+ transform: `scale(${vt()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
965
+ transformOrigin: "left"
966
+ },
967
+ transitionProperty: "transform, border-radius",
968
+ transitionDuration: `${C.DURATION}s`,
969
+ transitionTimingFunction: `cubic-bezier(${C.EASE.join(",")})`
970
+ }, !0);
971
+ }
972
+ function Be() {
973
+ !J || !p.current || (p.current.classList.remove(It), ut.current = !1, st(!1), Tt.current = /* @__PURE__ */ new Date());
974
+ }
975
+ function We(l) {
976
+ if (!J || !p.current) return;
977
+ p.current.classList.remove(It), ut.current = !1, st(!1), Tt.current = /* @__PURE__ */ new Date();
978
+ const R = Dt(p.current, f);
979
+ if (!l || !Gt(l.target, !1) || !R || Number.isNaN(R) || St.current === null) return;
980
+ const S = Tt.current.getTime() - St.current.getTime(), y = Ot.current - (P(f) ? l.pageY : l.pageX), x = Math.abs(y) / S;
981
+ if (x > 0.05 && (Ut(!0), setTimeout(() => {
982
+ Ut(!1);
983
+ }, 200)), r) {
984
+ $e({
985
+ draggedDistance: y * (f === "bottom" || f === "right" ? 1 : -1),
986
+ closeDrawer: dt,
987
+ velocity: x,
988
+ dismissible: g
989
+ }), o?.(l, !0);
990
+ return;
991
+ }
992
+ if (f === "bottom" || f === "right" ? y > 0 : y < 0) {
993
+ Kt(), o?.(l, !0);
994
+ return;
995
+ }
996
+ if (x > Te) {
997
+ dt(), o?.(l, !1);
998
+ return;
999
+ }
1000
+ var B;
1001
+ const k = Math.min((B = p.current.getBoundingClientRect().height) != null ? B : 0, window.innerHeight);
1002
+ var Z;
1003
+ const j = Math.min((Z = p.current.getBoundingClientRect().width) != null ? Z : 0, window.innerWidth), et = f === "left" || f === "right";
1004
+ if (Math.abs(R) >= (et ? j : k) * v) {
1005
+ dt(), o?.(l, !1);
1006
+ return;
1007
+ }
1008
+ o?.(l, !0), Kt();
1009
+ }
1010
+ i.useEffect(() => (F && (_(document.documentElement, {
1011
+ scrollBehavior: "auto"
1012
+ }), wt.current = /* @__PURE__ */ new Date()), () => {
1013
+ Nn(document.documentElement, "scrollBehavior");
1014
+ }), [
1015
+ F
1016
+ ]);
1017
+ function Ue(l) {
1018
+ const R = l ? (window.innerWidth - nt) / window.innerWidth : 1, S = l ? -nt : 0;
1019
+ Ct.current && window.clearTimeout(Ct.current), _(p.current, {
1020
+ transition: `transform ${C.DURATION}s cubic-bezier(${C.EASE.join(",")})`,
1021
+ transform: P(f) ? `scale(${R}) translate3d(0, ${S}px, 0)` : `scale(${R}) translate3d(${S}px, 0, 0)`
1022
+ }), !l && p.current && (Ct.current = setTimeout(() => {
1023
+ const y = Dt(p.current, f);
1024
+ _(p.current, {
1025
+ transition: "none",
1026
+ transform: P(f) ? `translate3d(0, ${y}px, 0)` : `translate3d(${y}px, 0, 0)`
1027
+ });
1028
+ }, 500));
1029
+ }
1030
+ function ze(l, R) {
1031
+ if (R < 0) return;
1032
+ const S = (window.innerWidth - nt) / window.innerWidth, y = S + R * (1 - S), x = -nt + R * nt;
1033
+ _(p.current, {
1034
+ transform: P(f) ? `scale(${y}) translate3d(0, ${x}px, 0)` : `scale(${y}) translate3d(${x}px, 0, 0)`,
1035
+ transition: "none"
1036
+ });
1037
+ }
1038
+ function Ve(l, R) {
1039
+ const S = P(f) ? window.innerHeight : window.innerWidth, y = R ? (S - nt) / S : 1, x = R ? -nt : 0;
1040
+ R && _(p.current, {
1041
+ transition: `transform ${C.DURATION}s cubic-bezier(${C.EASE.join(",")})`,
1042
+ transform: P(f) ? `scale(${y}) translate3d(0, ${x}px, 0)` : `scale(${y}) translate3d(${x}px, 0, 0)`
1043
+ });
1044
+ }
1045
+ return i.useEffect(() => {
1046
+ U || window.requestAnimationFrame(() => {
1047
+ document.body.style.pointerEvents = "auto";
1048
+ });
1049
+ }, [
1050
+ U
1051
+ ]), /* @__PURE__ */ i.createElement(mn, {
1052
+ defaultOpen: X,
1053
+ onOpenChange: (l) => {
1054
+ !g && !l || (l ? K(!0) : dt(!0), Y(l));
1055
+ },
1056
+ open: F
1057
+ }, /* @__PURE__ */ i.createElement(be.Provider, {
1058
+ value: {
1059
+ activeSnapPoint: Ie,
1060
+ snapPoints: r,
1061
+ setActiveSnapPoint: qt,
1062
+ drawerRef: p,
1063
+ overlayRef: at,
1064
+ onOpenChange: n,
1065
+ onPress: ke,
1066
+ onRelease: We,
1067
+ onDrag: He,
1068
+ dismissible: g,
1069
+ shouldAnimate: zt,
1070
+ handleOnly: m,
1071
+ isOpen: F,
1072
+ isDragging: J,
1073
+ shouldFade: Xt,
1074
+ closeDrawer: dt,
1075
+ onNestedDrag: ze,
1076
+ onNestedOpenChange: Ue,
1077
+ onNestedRelease: Ve,
1078
+ keyboardIsOpen: ot,
1079
+ modal: U,
1080
+ snapPointsOffset: ct,
1081
+ activeSnapPointIndex: it,
1082
+ direction: f,
1083
+ shouldScaleBackground: c,
1084
+ setBackgroundColorOnScale: s,
1085
+ noBodyStyles: M,
1086
+ container: $,
1087
+ autoFocus: V
1088
+ }
1089
+ }, e));
1090
+ }
1091
+ const Ae = /* @__PURE__ */ i.forwardRef(function({ ...t }, n) {
1092
+ const { overlayRef: e, snapPoints: a, onRelease: o, shouldFade: r, isOpen: c, modal: s, shouldAnimate: v } = ht(), E = Ee(n, e), g = a && a.length > 0;
1093
+ if (!s)
1094
+ return null;
1095
+ const m = i.useCallback((h) => o(h), [
1096
+ o
1097
+ ]);
1098
+ return /* @__PURE__ */ i.createElement(wn, {
1099
+ onMouseUp: m,
1100
+ ref: E,
1101
+ "data-vaul-overlay": "",
1102
+ "data-vaul-snap-points": c && g ? "true" : "false",
1103
+ "data-vaul-snap-points-overlay": c && r ? "true" : "false",
1104
+ "data-vaul-animate": v?.current ? "true" : "false",
1105
+ ...t
1106
+ });
1107
+ });
1108
+ Ae.displayName = "Drawer.Overlay";
1109
+ const Pe = /* @__PURE__ */ i.forwardRef(function({ onPointerDownOutside: t, style: n, onOpenAutoFocus: e, ...a }, o) {
1110
+ const { drawerRef: r, onPress: c, onRelease: s, onDrag: v, keyboardIsOpen: E, snapPointsOffset: g, activeSnapPointIndex: m, modal: h, isOpen: W, direction: H, snapPoints: T, container: U, handleOnly: w, shouldAnimate: I, autoFocus: M } = ht(), [f, X] = i.useState(!1), tt = Ee(o, r), d = i.useRef(null), D = i.useRef(null), b = i.useRef(!1), L = T && T.length > 0;
1111
+ zn();
1112
+ const $ = (u, z, F = 0) => {
1113
+ if (b.current) return !0;
1114
+ const Y = Math.abs(u.y), N = Math.abs(u.x), K = N > Y, J = [
1115
+ "bottom",
1116
+ "right"
1117
+ ].includes(z) ? 1 : -1;
1118
+ if (z === "left" || z === "right") {
1119
+ if (!(u.x * J < 0) && N >= 0 && N <= F)
1120
+ return K;
1121
+ } else if (!(u.y * J < 0) && Y >= 0 && Y <= F)
1122
+ return !K;
1123
+ return b.current = !0, !0;
1124
+ };
1125
+ i.useEffect(() => {
1126
+ L && window.requestAnimationFrame(() => {
1127
+ X(!0);
1128
+ });
1129
+ }, []);
1130
+ function V(u) {
1131
+ d.current = null, b.current = !1, s(u);
1132
+ }
1133
+ return /* @__PURE__ */ i.createElement(vn, {
1134
+ "data-vaul-drawer-direction": H,
1135
+ "data-vaul-drawer": "",
1136
+ "data-vaul-delayed-snap-points": f ? "true" : "false",
1137
+ "data-vaul-snap-points": W && L ? "true" : "false",
1138
+ "data-vaul-custom-container": U ? "true" : "false",
1139
+ "data-vaul-animate": I?.current ? "true" : "false",
1140
+ ...a,
1141
+ ref: tt,
1142
+ style: g && g.length > 0 ? {
1143
+ "--snap-point-height": `${g[m ?? 0]}px`,
1144
+ ...n
1145
+ } : n,
1146
+ onPointerDown: (u) => {
1147
+ w || (a.onPointerDown == null || a.onPointerDown.call(a, u), d.current = {
1148
+ x: u.pageX,
1149
+ y: u.pageY
1150
+ }, c(u));
1151
+ },
1152
+ onOpenAutoFocus: (u) => {
1153
+ e?.(u), M || u.preventDefault();
1154
+ },
1155
+ onPointerDownOutside: (u) => {
1156
+ if (t?.(u), !h || u.defaultPrevented) {
1157
+ u.preventDefault();
1158
+ return;
1159
+ }
1160
+ E.current && (E.current = !1);
1161
+ },
1162
+ onFocusOutside: (u) => {
1163
+ if (!h) {
1164
+ u.preventDefault();
1165
+ return;
1166
+ }
1167
+ },
1168
+ onPointerMove: (u) => {
1169
+ if (D.current = u, w || (a.onPointerMove == null || a.onPointerMove.call(a, u), !d.current)) return;
1170
+ const z = u.pageY - d.current.y, F = u.pageX - d.current.x, Y = u.pointerType === "touch" ? 10 : 2;
1171
+ $({
1172
+ x: F,
1173
+ y: z
1174
+ }, H, Y) ? v(u) : (Math.abs(F) > Y || Math.abs(z) > Y) && (d.current = null);
1175
+ },
1176
+ onPointerUp: (u) => {
1177
+ a.onPointerUp == null || a.onPointerUp.call(a, u), d.current = null, b.current = !1, s(u);
1178
+ },
1179
+ onPointerOut: (u) => {
1180
+ a.onPointerOut == null || a.onPointerOut.call(a, u), V(D.current);
1181
+ },
1182
+ onContextMenu: (u) => {
1183
+ a.onContextMenu == null || a.onContextMenu.call(a, u), D.current && V(D.current);
1184
+ }
1185
+ });
1186
+ });
1187
+ Pe.displayName = "Drawer.Content";
1188
+ const jn = 250, qn = 120, Xn = /* @__PURE__ */ i.forwardRef(function({ preventCycle: t = !1, children: n, ...e }, a) {
1189
+ const { closeDrawer: o, isDragging: r, snapPoints: c, activeSnapPoint: s, setActiveSnapPoint: v, dismissible: E, handleOnly: g, isOpen: m, onPress: h, onDrag: W } = ht(), H = i.useRef(null), T = i.useRef(!1);
1190
+ function U() {
1191
+ if (T.current) {
1192
+ M();
1193
+ return;
1194
+ }
1195
+ window.setTimeout(() => {
1196
+ w();
1197
+ }, qn);
1198
+ }
1199
+ function w() {
1200
+ if (r || t || T.current) {
1201
+ M();
1202
+ return;
1203
+ }
1204
+ if (M(), !c || c.length === 0) {
1205
+ E || o();
1206
+ return;
1207
+ }
1208
+ if (s === c[c.length - 1] && E) {
1209
+ o();
1210
+ return;
1211
+ }
1212
+ const X = c.findIndex((d) => d === s);
1213
+ if (X === -1) return;
1214
+ const tt = c[X + 1];
1215
+ v(tt);
1216
+ }
1217
+ function I() {
1218
+ H.current = window.setTimeout(() => {
1219
+ T.current = !0;
1220
+ }, jn);
1221
+ }
1222
+ function M() {
1223
+ H.current && window.clearTimeout(H.current), T.current = !1;
1224
+ }
1225
+ return /* @__PURE__ */ i.createElement("div", {
1226
+ onClick: U,
1227
+ onPointerCancel: M,
1228
+ onPointerDown: (f) => {
1229
+ g && h(f), I();
1230
+ },
1231
+ onPointerMove: (f) => {
1232
+ g && W(f);
1233
+ },
1234
+ // onPointerUp is already handled by the content component
1235
+ ref: a,
1236
+ "data-vaul-drawer-visible": m ? "true" : "false",
1237
+ "data-vaul-handle": "",
1238
+ "aria-hidden": "true",
1239
+ ...e
1240
+ }, /* @__PURE__ */ i.createElement("span", {
1241
+ "data-vaul-handle-hitarea": "",
1242
+ "aria-hidden": "true"
1243
+ }, n));
1244
+ });
1245
+ Xn.displayName = "Drawer.Handle";
1246
+ function Gn(t) {
1247
+ const n = ht(), { container: e = n.container, ...a } = t;
1248
+ return /* @__PURE__ */ i.createElement(hn, {
1249
+ container: e,
1250
+ ...a
1251
+ });
1252
+ }
1253
+ const ar = {
1254
+ Root: Yn,
1255
+ Content: Pe,
1256
+ Overlay: Ae,
1257
+ Trigger: gn,
1258
+ Portal: Gn,
1259
+ Close: Dn,
1260
+ Title: yn,
1261
+ Description: bn
1262
+ };
1263
+ export {
1264
+ ar as D
1265
+ };