@konstructio/ui 0.1.2-alpha.101 → 0.1.2-alpha.103

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 (221) hide show
  1. package/dist/AlertDialogTrigger-CgcsW_ta.js +109 -0
  2. package/dist/{Breadcrumb-Bmv0vzgt.js → Breadcrumb-Cp3abB2w.js} +1 -1
  3. package/dist/Checkbox-DzAx7n67.js +249 -0
  4. package/dist/{CommandInput-CYYsk_31.js → CommandInput-BnvRMfLI.js} +2 -2
  5. package/dist/{Counter-DWKyr569.js → Counter-CY0xGnVM.js} +2 -2
  6. package/dist/{DayPicker-CwO8Zff5.js → DayPicker-kweJz134.js} +750 -746
  7. package/dist/{DropdownButton-Beel5_gN.js → DropdownButton-DnlwdPmb.js} +1 -1
  8. package/dist/FlagSelectorList-BoYG-_It.js +852 -0
  9. package/dist/{HamburgerTrigger-7a4POUaM.js → HamburgerTrigger-1vOTrm8-.js} +2 -2
  10. package/dist/{Input-DG3snJf_.js → Input-CW0VwW2T.js} +4 -4
  11. package/dist/{Modal-Bcu6LLAp.js → Modal-Bfzggwlr.js} +2 -2
  12. package/dist/{Spinner-BegZ5yd7.js → Spinner-Lw9mZYhg.js} +1 -1
  13. package/dist/Switch-WBRr8uOJ.js +196 -0
  14. package/dist/Toast-ByH-l4XK.js +459 -0
  15. package/dist/{Wrapper-DwxJAkNQ.js → Wrapper-ClJ_Mham.js} +2 -2
  16. package/dist/{Wrapper-DtT29fc5.js → Wrapper-XeeD3av7.js} +1 -1
  17. package/dist/components/Alert/Alert.js +2 -2
  18. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  19. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  20. package/dist/components/AlertDialog/components/index.js +1 -1
  21. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  22. package/dist/components/Checkbox/Checkbox.js +1 -1
  23. package/dist/components/Command/Command.js +2 -2
  24. package/dist/components/Command/components/Command.js +1 -1
  25. package/dist/components/Command/components/CommandEmpty.js +1 -1
  26. package/dist/components/Command/components/CommandGroup.js +1 -1
  27. package/dist/components/Command/components/CommandInput.js +1 -1
  28. package/dist/components/Command/components/CommandItem.js +1 -1
  29. package/dist/components/Command/components/CommandList.js +1 -1
  30. package/dist/components/Command/components/CommandSeparator.js +1 -1
  31. package/dist/components/Command/components/DialogContent.js +2 -2
  32. package/dist/components/Command/components/DialogOverlay.js +1 -1
  33. package/dist/components/Command/components/index.js +1 -1
  34. package/dist/components/Counter/Counter.js +1 -1
  35. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +1 -1
  36. package/dist/components/DateRangePicker/components/DateTimeInputs/components/EndInputFields/EndInputFields.js +1 -1
  37. package/dist/components/DateRangePicker/components/DateTimeInputs/components/StartInputFields/StartInputFields.js +1 -1
  38. package/dist/components/Datepicker/DatePicker.js +2 -3
  39. package/dist/components/Drawer/Drawer.js +2 -2
  40. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  41. package/dist/components/Filter/Filter.js +4 -3
  42. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +23 -24
  43. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +60 -65
  44. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +35 -43
  45. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +40 -45
  46. package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.js +33 -34
  47. package/dist/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.js +45 -51
  48. package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +28 -0
  49. package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +56 -61
  50. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.js +33 -34
  51. package/dist/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.js +70 -75
  52. package/dist/components/Filter/contexts/filter.provider.js +8 -5
  53. package/dist/components/Filter/utils/index.js +1 -1
  54. package/dist/components/Input/Input.js +1 -1
  55. package/dist/components/LineChart/LineChart.js +1 -1
  56. package/dist/components/Modal/Modal.js +1 -1
  57. package/dist/components/Modal/components/Wrapper/Wrapper.js +1 -1
  58. package/dist/components/Modal/components/index.js +1 -1
  59. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +1 -1
  60. package/dist/components/MultiSelectDropdown/components/List/List.js +1 -1
  61. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +1 -1
  62. package/dist/components/MultiSelectDropdown/components/index.js +1 -1
  63. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +2 -2
  64. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +1 -1
  65. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +2 -2
  66. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +2 -2
  67. package/dist/components/PhoneNumberInput/components/Wrapper.js +1 -1
  68. package/dist/components/PhoneNumberInput/components/index.js +2 -2
  69. package/dist/components/PhoneNumberInput/contexts/index.js +1 -1
  70. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +1 -1
  71. package/dist/components/PieChart/PieChart.js +1 -1
  72. package/dist/components/Range/Range.js +1 -1
  73. package/dist/components/Select/components/List/List.js +1 -1
  74. package/dist/components/Sidebar/components/HamburgerTrigger/HamburgerTrigger.js +1 -1
  75. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +1 -1
  76. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +1 -1
  77. package/dist/components/Sidebar/components/index.js +1 -1
  78. package/dist/components/Slider/Slider.js +1 -1
  79. package/dist/components/Spinner/Spinner.js +1 -1
  80. package/dist/components/Switch/Switch.js +1 -1
  81. package/dist/components/Table/components/Filter.js +1 -1
  82. package/dist/components/Tabs/Tabs.js +1 -1
  83. package/dist/components/Tabs/components/Content.js +1 -1
  84. package/dist/components/Tabs/components/List.js +1 -1
  85. package/dist/components/Tabs/components/Trigger.js +1 -1
  86. package/dist/components/TagSelect/TagSelect.js +1 -1
  87. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +1 -1
  88. package/dist/components/TagSelect/components/index.js +1 -1
  89. package/dist/components/Toast/Toast.js +1 -1
  90. package/dist/components/Tooltip/Tooltip.js +1 -1
  91. package/dist/components/VirtualizedTable/VirtualizedTable.js +87 -87
  92. package/dist/components/VirtualizedTable/components/Actions/Actions.js +19 -19
  93. package/dist/components/VirtualizedTable/components/Body/Body.js +50 -49
  94. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +67 -21
  95. package/dist/components/VirtualizedTable/components/ExpandableRow/ExpandableRow.js +1 -1
  96. package/dist/components/VirtualizedTable/components/Filter/Filter.js +53 -63
  97. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +10 -10
  98. package/dist/components/VirtualizedTable/components/Header/Header.js +47 -34
  99. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +19 -15
  100. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +10 -10
  101. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +1 -1
  102. package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +8 -8
  103. package/dist/components/VirtualizedTable/contexts/index.js +1 -1
  104. package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
  105. package/dist/components/VirtualizedTable/contexts/table.provider.js +1 -1
  106. package/dist/components/index.js +10 -10
  107. package/dist/{components-CYt24H4n.js → components-BIHlj4yH.js} +1 -1
  108. package/dist/{debounce-KoeGNmnW.js → debounce-C5Ycjilj.js} +14 -14
  109. package/dist/dist-2bGlmy8N2.js +165 -0
  110. package/dist/dist-BiJrNvNo.js +193 -0
  111. package/dist/dist-BuFiu480.js +13 -0
  112. package/dist/dist-C2aTw0m62.js +1320 -0
  113. package/dist/{dist-DvoMuWKO2.js → dist-C2s4VX-42.js} +4 -4
  114. package/dist/dist-CT6d9xe7.js +441 -0
  115. package/dist/dist-CTvBzxW8.js +31 -0
  116. package/dist/dist-CVDFmWf2.js +358 -0
  117. package/dist/dist-D4FePjTS.js +194 -0
  118. package/dist/dist-DISvWx7U.js +99 -0
  119. package/dist/dist-Db6UeFo4.js +291 -0
  120. package/dist/{dist-DGO9opgu.js → dist-Dse3gSmZ.js} +49 -49
  121. package/dist/dist-j7FOUrFU.js +206 -0
  122. package/dist/{dist-C8NWUTUh.js → dist-l-aDnQZC.js} +1 -1
  123. package/dist/es2015-BWf6xQHm.js +222 -0
  124. package/dist/index.js +10 -10
  125. package/dist/{isObject-1ZmdWuhC.js → isObject-BeFFiVJK.js} +8 -8
  126. package/dist/lib/components/Alert/Alert.types.d.ts +1 -1
  127. package/dist/lib/components/AlertDialog/AlertDialog.types.d.ts +1 -1
  128. package/dist/lib/components/AlertDialog/components/AlertDialogTrigger.types.d.ts +2 -2
  129. package/dist/lib/components/Autocomplete/Autocomplete.types.d.ts +1 -1
  130. package/dist/lib/components/Breadcrumb/Breadcrumb.types.d.ts +1 -1
  131. package/dist/lib/components/Breadcrumb/components/BackButton/BackButton.types.d.ts +1 -1
  132. package/dist/lib/components/Breadcrumb/components/Item/Item.types.d.ts +1 -1
  133. package/dist/lib/components/Button/Button.types.d.ts +1 -1
  134. package/dist/lib/components/ButtonGroup/ButtonGroup.types.d.ts +1 -1
  135. package/dist/lib/components/Card/Card.types.d.ts +1 -1
  136. package/dist/lib/components/Checkbox/Checkbox.types.d.ts +1 -1
  137. package/dist/lib/components/Command/Command.types.d.ts +1 -1
  138. package/dist/lib/components/Counter/Counter.types.d.ts +1 -1
  139. package/dist/lib/components/DateRangePicker/DateRangePicker.types.d.ts +1 -1
  140. package/dist/lib/components/Drawer/Drawer.types.d.ts +1 -1
  141. package/dist/lib/components/Filter/Filter.types.d.ts +1 -1
  142. package/dist/lib/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.d.ts +2 -3
  143. package/dist/lib/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.d.ts +1 -2
  144. package/dist/lib/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.hook.d.ts +2 -3
  145. package/dist/lib/components/Filter/components/DateRangeFilterDropdown/DateRangeFilterDropdown.types.d.ts +1 -1
  146. package/dist/lib/components/Filter/components/FilterDropdown/FilterDropdown.d.ts +3 -0
  147. package/dist/lib/components/Filter/components/FilterDropdown/FilterDropdown.types.d.ts +9 -0
  148. package/dist/lib/components/Filter/components/ResetButton/ResetButton.types.d.ts +1 -1
  149. package/dist/lib/components/Filter/components/TimeFilterDropdown/TimeFilterDropdown.hook.d.ts +1 -2
  150. package/dist/lib/components/Filter/contexts/filter.context.d.ts +1 -0
  151. package/dist/lib/components/ImageUpload/ImageUpload.types.d.ts +1 -1
  152. package/dist/lib/components/Input/Input.types.d.ts +1 -1
  153. package/dist/lib/components/LineChart/LineChart.types.d.ts +1 -1
  154. package/dist/lib/components/Loading/Loading.types.d.ts +1 -1
  155. package/dist/lib/components/Modal/Modal.types.d.ts +1 -1
  156. package/dist/lib/components/Modal/components/Wrapper/Wrapper.types.d.ts +1 -1
  157. package/dist/lib/components/MultiSelectDropdown/components/Item/Item.types.d.ts +1 -1
  158. package/dist/lib/components/MultiSelectDropdown/components/List/List.types.d.ts +1 -1
  159. package/dist/lib/components/MultiSelectDropdown/components/Wrapper/Wrapper.types.d.ts +1 -1
  160. package/dist/lib/components/ProgressBar/ProgressBar.types.d.ts +1 -1
  161. package/dist/lib/components/Radio/Radio.types.d.ts +1 -1
  162. package/dist/lib/components/RadioCard/RadioCard.types.d.ts +1 -1
  163. package/dist/lib/components/RadioCardGroup/RadioCardGroup.types.d.ts +1 -1
  164. package/dist/lib/components/RadioGroup/RadioGroup.types.d.ts +1 -1
  165. package/dist/lib/components/Range/Range.types.d.ts +1 -1
  166. package/dist/lib/components/Select/Select.types.d.ts +1 -1
  167. package/dist/lib/components/Sidebar/Sidebar.types.d.ts +2 -2
  168. package/dist/lib/components/Sidebar/components/Label/Label.types.d.ts +1 -1
  169. package/dist/lib/components/Slider/Slider.types.d.ts +1 -1
  170. package/dist/lib/components/Spinner/Spinner.types.d.ts +2 -2
  171. package/dist/lib/components/Stepper/Stepper.types.d.ts +1 -1
  172. package/dist/lib/components/Stepper/components/StepItem/StepItem.types.d.ts +1 -1
  173. package/dist/lib/components/Switch/Switch.types.d.ts +1 -1
  174. package/dist/lib/components/Table/Table.types.d.ts +1 -1
  175. package/dist/lib/components/Tabs/Tabs.types.d.ts +1 -1
  176. package/dist/lib/components/TagSelect/TagSelect.types.d.ts +1 -1
  177. package/dist/lib/components/TagSelect/components/Item/Item.types.d.ts +2 -2
  178. package/dist/lib/components/TagSelect/components/List/List.types.d.ts +1 -1
  179. package/dist/lib/components/TagSelect/components/Wrapper/Wrapper.types.d.ts +1 -1
  180. package/dist/lib/components/TagSelect/contexts/TagSelect.types.d.ts +1 -1
  181. package/dist/lib/components/TextArea/TextArea.types.d.ts +1 -1
  182. package/dist/lib/components/Toast/Toast.types.d.ts +1 -1
  183. package/dist/lib/components/Typography/Typography.types.d.ts +1 -1
  184. package/dist/lib/components/VirtualizedTable/VirtualizedTable.types.d.ts +27 -3
  185. package/dist/lib/components/VirtualizedTable/components/Body/Body.d.ts +1 -1
  186. package/dist/lib/components/VirtualizedTable/components/Body/Body.types.d.ts +1 -0
  187. package/dist/lib/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.types.d.ts +2 -0
  188. package/dist/lib/components/VirtualizedTable/components/Filter/Filter.types.d.ts +1 -1
  189. package/dist/lib/components/VirtualizedTable/components/Header/Header.d.ts +1 -1
  190. package/dist/lib/components/VirtualizedTable/components/Header/Header.types.d.ts +1 -0
  191. package/dist/lib/components/VirtualizedTable/components/Pagination/Pagination.types.d.ts +2 -0
  192. package/dist/lib/components/VirtualizedTable/components/TruncateText/TruncateText.types.d.ts +1 -1
  193. package/dist/lib/components/VirtualizedTable/contexts/table.context.d.ts +2 -0
  194. package/dist/lib/components/VirtualizedTable/contexts/table.provider.d.ts +1 -1
  195. package/dist/lib/components/VirtualizedTable/contexts/table.types.d.ts +1 -0
  196. package/dist/lib/contexts/theme.context.d.ts +1 -1
  197. package/dist/lib/contexts/theme.hook.d.ts +1 -1
  198. package/dist/package.json +34 -33
  199. package/dist/{phone-number.provider-CJJOFYk-.js → phone-number.provider-BxQCTxp8.js} +457 -457
  200. package/dist/{prop-types-CaJpPVsa.js → prop-types-CfEYxTbR.js} +52 -52
  201. package/dist/styles.css +1 -1
  202. package/dist/{table.provider-9uUt5a-s.js → table.provider-2sAkE7z_.js} +395 -368
  203. package/dist/{utils-B6A9pnrH.js → utils-B-BTGYA5.js} +193 -193
  204. package/dist/{x-CESTrenk.js → x-BI9jmc7e.js} +1 -1
  205. package/package.json +34 -33
  206. package/dist/AlertDialogTrigger-HhbFOOUE.js +0 -124
  207. package/dist/Checkbox-B1rTwzR3.js +0 -240
  208. package/dist/FlagSelectorList-BARhzfj2.js +0 -848
  209. package/dist/Switch-1RGhhTtg.js +0 -178
  210. package/dist/Toast-CS-igZor.js +0 -467
  211. package/dist/dist-7edduNXi.js +0 -398
  212. package/dist/dist-BkYHh2kH.js +0 -408
  213. package/dist/dist-C6Cif8-U.js +0 -28
  214. package/dist/dist-CeuUxVmT.js +0 -13
  215. package/dist/dist-CfYOvauX.js +0 -125
  216. package/dist/dist-CktbIsHq.js +0 -264
  217. package/dist/dist-DGqWMRtc.js +0 -183
  218. package/dist/dist-DdFwUrO22.js +0 -11
  219. package/dist/dist-DnGj9MTf.js +0 -1692
  220. package/dist/dist-eAwtFCCA.js +0 -87
  221. /package/dist/{dist-AihTpWdF2.js → dist-AihTpWdF.js} +0 -0
@@ -1,1692 +0,0 @@
1
- import { a as ge, r as Yt } from "./dist-DqKFpce5.js";
2
- import { t as we } from "./dist-CVy-ulDZ.js";
3
- import { t as Gt } from "./dist-C6Cif8-U.js";
4
- import { a as ot, i as Q, r as Pe, t as qt } from "./dist-CfYOvauX.js";
5
- import { t as Ut } from "./dist-CeuUxVmT.js";
6
- import { t as Kt } from "./dist-ppXKUlVt.js";
7
- import { r as Zt, t as Jt } from "./dist-DGqWMRtc.js";
8
- import { t as it } from "./dist-eAwtFCCA.js";
9
- import { t as Qt } from "./dist-DvoMuWKO2.js";
10
- import * as h from "react";
11
- import { useLayoutEffect as en } from "react";
12
- import * as tn from "react-dom";
13
- import { jsx as P, jsxs as nn } from "react/jsx-runtime";
14
- var rn = [
15
- "top",
16
- "right",
17
- "bottom",
18
- "left"
19
- ], U = Math.min, F = Math.max, de = Math.round, fe = Math.floor, j = (e) => ({
20
- x: e,
21
- y: e
22
- }), on = {
23
- left: "right",
24
- right: "left",
25
- bottom: "top",
26
- top: "bottom"
27
- };
28
- function Se(e, t, n) {
29
- return F(e, U(t, n));
30
- }
31
- function Y(e, t) {
32
- return typeof e == "function" ? e(t) : e;
33
- }
34
- function G(e) {
35
- return e.split("-")[0];
36
- }
37
- function re(e) {
38
- return e.split("-")[1];
39
- }
40
- function ke(e) {
41
- return e === "x" ? "y" : "x";
42
- }
43
- function Ne(e) {
44
- return e === "y" ? "height" : "width";
45
- }
46
- function z(e) {
47
- const t = e[0];
48
- return t === "t" || t === "b" ? "y" : "x";
49
- }
50
- function $e(e) {
51
- return ke(z(e));
52
- }
53
- function sn(e, t, n) {
54
- n === void 0 && (n = !1);
55
- const r = re(e), o = $e(e), i = Ne(o);
56
- let s = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
57
- return t.reference[i] > t.floating[i] && (s = pe(s)), [s, pe(s)];
58
- }
59
- function cn(e) {
60
- const t = pe(e);
61
- return [
62
- Le(e),
63
- t,
64
- Le(t)
65
- ];
66
- }
67
- function Le(e) {
68
- return e.includes("start") ? e.replace("start", "end") : e.replace("end", "start");
69
- }
70
- var Ge = ["left", "right"], qe = ["right", "left"], an = ["top", "bottom"], ln = ["bottom", "top"];
71
- function fn(e, t, n) {
72
- switch (e) {
73
- case "top":
74
- case "bottom":
75
- return n ? t ? qe : Ge : t ? Ge : qe;
76
- case "left":
77
- case "right":
78
- return t ? an : ln;
79
- default:
80
- return [];
81
- }
82
- }
83
- function un(e, t, n, r) {
84
- const o = re(e);
85
- let i = fn(G(e), n === "start", r);
86
- return o && (i = i.map((s) => s + "-" + o), t && (i = i.concat(i.map(Le)))), i;
87
- }
88
- function pe(e) {
89
- const t = G(e);
90
- return on[t] + e.slice(t.length);
91
- }
92
- function dn(e) {
93
- return {
94
- top: 0,
95
- right: 0,
96
- bottom: 0,
97
- left: 0,
98
- ...e
99
- };
100
- }
101
- function st(e) {
102
- return typeof e != "number" ? dn(e) : {
103
- top: e,
104
- right: e,
105
- bottom: e,
106
- left: e
107
- };
108
- }
109
- function me(e) {
110
- const { x: t, y: n, width: r, height: o } = e;
111
- return {
112
- width: r,
113
- height: o,
114
- top: n,
115
- left: t,
116
- right: t + r,
117
- bottom: n + o,
118
- x: t,
119
- y: n
120
- };
121
- }
122
- function Ue(e, t, n) {
123
- let { reference: r, floating: o } = e;
124
- const i = z(t), s = $e(t), c = Ne(s), l = G(t), u = i === "y", a = r.x + r.width / 2 - o.width / 2, d = r.y + r.height / 2 - o.height / 2, p = r[c] / 2 - o[c] / 2;
125
- let f;
126
- switch (l) {
127
- case "top":
128
- f = {
129
- x: a,
130
- y: r.y - o.height
131
- };
132
- break;
133
- case "bottom":
134
- f = {
135
- x: a,
136
- y: r.y + r.height
137
- };
138
- break;
139
- case "right":
140
- f = {
141
- x: r.x + r.width,
142
- y: d
143
- };
144
- break;
145
- case "left":
146
- f = {
147
- x: r.x - o.width,
148
- y: d
149
- };
150
- break;
151
- default:
152
- f = {
153
- x: r.x,
154
- y: r.y
155
- };
156
- }
157
- switch (re(t)) {
158
- case "start":
159
- f[s] -= p * (n && u ? -1 : 1);
160
- break;
161
- case "end":
162
- f[s] += p * (n && u ? -1 : 1);
163
- break;
164
- }
165
- return f;
166
- }
167
- async function pn(e, t) {
168
- var n;
169
- t === void 0 && (t = {});
170
- const { x: r, y: o, platform: i, rects: s, elements: c, strategy: l } = e, { boundary: u = "clippingAncestors", rootBoundary: a = "viewport", elementContext: d = "floating", altBoundary: p = !1, padding: f = 0 } = Y(t, e), m = st(f), g = c[p ? d === "floating" ? "reference" : "floating" : d], w = me(await i.getClippingRect({
171
- element: (n = await (i.isElement == null ? void 0 : i.isElement(g))) == null || n ? g : g.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(c.floating)),
172
- boundary: u,
173
- rootBoundary: a,
174
- strategy: l
175
- })), v = d === "floating" ? {
176
- x: r,
177
- y: o,
178
- width: s.floating.width,
179
- height: s.floating.height
180
- } : s.reference, x = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(c.floating)), b = await (i.isElement == null ? void 0 : i.isElement(x)) ? await (i.getScale == null ? void 0 : i.getScale(x)) || {
181
- x: 1,
182
- y: 1
183
- } : {
184
- x: 1,
185
- y: 1
186
- }, y = me(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
187
- elements: c,
188
- rect: v,
189
- offsetParent: x,
190
- strategy: l
191
- }) : v);
192
- return {
193
- top: (w.top - y.top + m.top) / b.y,
194
- bottom: (y.bottom - w.bottom + m.bottom) / b.y,
195
- left: (w.left - y.left + m.left) / b.x,
196
- right: (y.right - w.right + m.right) / b.x
197
- };
198
- }
199
- var mn = 50, hn = async (e, t, n) => {
200
- const { placement: r = "bottom", strategy: o = "absolute", middleware: i = [], platform: s } = n, c = s.detectOverflow ? s : {
201
- ...s,
202
- detectOverflow: pn
203
- }, l = await (s.isRTL == null ? void 0 : s.isRTL(t));
204
- let u = await s.getElementRects({
205
- reference: e,
206
- floating: t,
207
- strategy: o
208
- }), { x: a, y: d } = Ue(u, r, l), p = r, f = 0;
209
- const m = {};
210
- for (let g = 0; g < i.length; g++) {
211
- const w = i[g];
212
- if (!w) continue;
213
- const { name: v, fn: x } = w, { x: b, y, data: C, reset: R } = await x({
214
- x: a,
215
- y: d,
216
- initialPlacement: r,
217
- placement: p,
218
- strategy: o,
219
- middlewareData: m,
220
- rects: u,
221
- platform: c,
222
- elements: {
223
- reference: e,
224
- floating: t
225
- }
226
- });
227
- a = b ?? a, d = y ?? d, m[v] = {
228
- ...m[v],
229
- ...C
230
- }, R && f < mn && (f++, typeof R == "object" && (R.placement && (p = R.placement), R.rects && (u = R.rects === !0 ? await s.getElementRects({
231
- reference: e,
232
- floating: t,
233
- strategy: o
234
- }) : R.rects), { x: a, y: d } = Ue(u, p, l)), g = -1);
235
- }
236
- return {
237
- x: a,
238
- y: d,
239
- placement: p,
240
- strategy: o,
241
- middlewareData: m
242
- };
243
- }, gn = (e) => ({
244
- name: "arrow",
245
- options: e,
246
- async fn(t) {
247
- const { x: n, y: r, placement: o, rects: i, platform: s, elements: c, middlewareData: l } = t, { element: u, padding: a = 0 } = Y(e, t) || {};
248
- if (u == null) return {};
249
- const d = st(a), p = {
250
- x: n,
251
- y: r
252
- }, f = $e(o), m = Ne(f), g = await s.getDimensions(u), w = f === "y", v = w ? "top" : "left", x = w ? "bottom" : "right", b = w ? "clientHeight" : "clientWidth", y = i.reference[m] + i.reference[f] - p[f] - i.floating[m], C = p[f] - i.reference[f], R = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(u));
253
- let O = R ? R[b] : 0;
254
- (!O || !await (s.isElement == null ? void 0 : s.isElement(R))) && (O = c.floating[b] || i.floating[m]);
255
- const M = y / 2 - C / 2, $ = O / 2 - g[m] / 2 - 1, D = U(d[v], $), N = U(d[x], $), k = D, L = O - g[m] - N, T = O / 2 - g[m] / 2 + M, H = Se(k, T, L), E = !l.arrow && re(o) != null && T !== H && i.reference[m] / 2 - (T < k ? D : N) - g[m] / 2 < 0, S = E ? T < k ? T - k : T - L : 0;
256
- return {
257
- [f]: p[f] + S,
258
- data: {
259
- [f]: H,
260
- centerOffset: T - H - S,
261
- ...E && { alignmentOffset: S }
262
- },
263
- reset: E
264
- };
265
- }
266
- }), wn = function(e) {
267
- return e === void 0 && (e = {}), {
268
- name: "flip",
269
- options: e,
270
- async fn(t) {
271
- var n, r;
272
- const { placement: o, middlewareData: i, rects: s, initialPlacement: c, platform: l, elements: u } = t, { mainAxis: a = !0, crossAxis: d = !0, fallbackPlacements: p, fallbackStrategy: f = "bestFit", fallbackAxisSideDirection: m = "none", flipAlignment: g = !0, ...w } = Y(e, t);
273
- if ((n = i.arrow) != null && n.alignmentOffset) return {};
274
- const v = G(o), x = z(c), b = G(c) === c, y = await (l.isRTL == null ? void 0 : l.isRTL(u.floating)), C = p || (b || !g ? [pe(c)] : cn(c)), R = m !== "none";
275
- !p && R && C.push(...un(c, g, m, y));
276
- const O = [c, ...C], M = await l.detectOverflow(t, w), $ = [];
277
- let D = ((r = i.flip) == null ? void 0 : r.overflows) || [];
278
- if (a && $.push(M[v]), d) {
279
- const T = sn(o, s, y);
280
- $.push(M[T[0]], M[T[1]]);
281
- }
282
- if (D = [...D, {
283
- placement: o,
284
- overflows: $
285
- }], !$.every((T) => T <= 0)) {
286
- var N, k;
287
- const T = (((N = i.flip) == null ? void 0 : N.index) || 0) + 1, H = O[T];
288
- if (H && (!(d === "alignment" && x !== z(H)) || D.every((S) => z(S.placement) === x ? S.overflows[0] > 0 : !0)))
289
- return {
290
- data: {
291
- index: T,
292
- overflows: D
293
- },
294
- reset: { placement: H }
295
- };
296
- let E = (k = D.filter((S) => S.overflows[0] <= 0).sort((S, A) => S.overflows[1] - A.overflows[1])[0]) == null ? void 0 : k.placement;
297
- if (!E) switch (f) {
298
- case "bestFit": {
299
- var L;
300
- const S = (L = D.filter((A) => {
301
- if (R) {
302
- const _ = z(A.placement);
303
- return _ === x || _ === "y";
304
- }
305
- return !0;
306
- }).map((A) => [A.placement, A.overflows.filter((_) => _ > 0).reduce((_, I) => _ + I, 0)]).sort((A, _) => A[1] - _[1])[0]) == null ? void 0 : L[0];
307
- S && (E = S);
308
- break;
309
- }
310
- case "initialPlacement":
311
- E = c;
312
- break;
313
- }
314
- if (o !== E) return { reset: { placement: E } };
315
- }
316
- return {};
317
- }
318
- };
319
- };
320
- function Ke(e, t) {
321
- return {
322
- top: e.top - t.height,
323
- right: e.right - t.width,
324
- bottom: e.bottom - t.height,
325
- left: e.left - t.width
326
- };
327
- }
328
- function Ze(e) {
329
- return rn.some((t) => e[t] >= 0);
330
- }
331
- var vn = function(e) {
332
- return e === void 0 && (e = {}), {
333
- name: "hide",
334
- options: e,
335
- async fn(t) {
336
- const { rects: n, platform: r } = t, { strategy: o = "referenceHidden", ...i } = Y(e, t);
337
- switch (o) {
338
- case "referenceHidden": {
339
- const s = Ke(await r.detectOverflow(t, {
340
- ...i,
341
- elementContext: "reference"
342
- }), n.reference);
343
- return { data: {
344
- referenceHiddenOffsets: s,
345
- referenceHidden: Ze(s)
346
- } };
347
- }
348
- case "escaped": {
349
- const s = Ke(await r.detectOverflow(t, {
350
- ...i,
351
- altBoundary: !0
352
- }), n.floating);
353
- return { data: {
354
- escapedOffsets: s,
355
- escaped: Ze(s)
356
- } };
357
- }
358
- default:
359
- return {};
360
- }
361
- }
362
- };
363
- }, ct = /* @__PURE__ */ new Set(["left", "top"]);
364
- async function xn(e, t) {
365
- const { placement: n, platform: r, elements: o } = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), s = G(n), c = re(n), l = z(n) === "y", u = ct.has(s) ? -1 : 1, a = i && l ? -1 : 1, d = Y(t, e);
366
- let { mainAxis: p, crossAxis: f, alignmentAxis: m } = typeof d == "number" ? {
367
- mainAxis: d,
368
- crossAxis: 0,
369
- alignmentAxis: null
370
- } : {
371
- mainAxis: d.mainAxis || 0,
372
- crossAxis: d.crossAxis || 0,
373
- alignmentAxis: d.alignmentAxis
374
- };
375
- return c && typeof m == "number" && (f = c === "end" ? m * -1 : m), l ? {
376
- x: f * a,
377
- y: p * u
378
- } : {
379
- x: p * u,
380
- y: f * a
381
- };
382
- }
383
- var yn = function(e) {
384
- return e === void 0 && (e = 0), {
385
- name: "offset",
386
- options: e,
387
- async fn(t) {
388
- var n, r;
389
- const { x: o, y: i, placement: s, middlewareData: c } = t, l = await xn(t, e);
390
- return s === ((n = c.offset) == null ? void 0 : n.placement) && (r = c.arrow) != null && r.alignmentOffset ? {} : {
391
- x: o + l.x,
392
- y: i + l.y,
393
- data: {
394
- ...l,
395
- placement: s
396
- }
397
- };
398
- }
399
- };
400
- }, bn = function(e) {
401
- return e === void 0 && (e = {}), {
402
- name: "shift",
403
- options: e,
404
- async fn(t) {
405
- const { x: n, y: r, placement: o, platform: i } = t, { mainAxis: s = !0, crossAxis: c = !1, limiter: l = { fn: (v) => {
406
- let { x, y: b } = v;
407
- return {
408
- x,
409
- y: b
410
- };
411
- } }, ...u } = Y(e, t), a = {
412
- x: n,
413
- y: r
414
- }, d = await i.detectOverflow(t, u), p = z(G(o)), f = ke(p);
415
- let m = a[f], g = a[p];
416
- if (s) {
417
- const v = f === "y" ? "top" : "left", x = f === "y" ? "bottom" : "right", b = m + d[v], y = m - d[x];
418
- m = Se(b, m, y);
419
- }
420
- if (c) {
421
- const v = p === "y" ? "top" : "left", x = p === "y" ? "bottom" : "right", b = g + d[v], y = g - d[x];
422
- g = Se(b, g, y);
423
- }
424
- const w = l.fn({
425
- ...t,
426
- [f]: m,
427
- [p]: g
428
- });
429
- return {
430
- ...w,
431
- data: {
432
- x: w.x - n,
433
- y: w.y - r,
434
- enabled: {
435
- [f]: s,
436
- [p]: c
437
- }
438
- }
439
- };
440
- }
441
- };
442
- }, Rn = function(e) {
443
- return e === void 0 && (e = {}), {
444
- options: e,
445
- fn(t) {
446
- const { x: n, y: r, placement: o, rects: i, middlewareData: s } = t, { offset: c = 0, mainAxis: l = !0, crossAxis: u = !0 } = Y(e, t), a = {
447
- x: n,
448
- y: r
449
- }, d = z(o), p = ke(d);
450
- let f = a[p], m = a[d];
451
- const g = Y(c, t), w = typeof g == "number" ? {
452
- mainAxis: g,
453
- crossAxis: 0
454
- } : {
455
- mainAxis: 0,
456
- crossAxis: 0,
457
- ...g
458
- };
459
- if (l) {
460
- const b = p === "y" ? "height" : "width", y = i.reference[p] - i.floating[b] + w.mainAxis, C = i.reference[p] + i.reference[b] - w.mainAxis;
461
- f < y ? f = y : f > C && (f = C);
462
- }
463
- if (u) {
464
- var v, x;
465
- const b = p === "y" ? "width" : "height", y = ct.has(G(o)), C = i.reference[d] - i.floating[b] + (y && ((v = s.offset) == null ? void 0 : v[d]) || 0) + (y ? 0 : w.crossAxis), R = i.reference[d] + i.reference[b] + (y ? 0 : ((x = s.offset) == null ? void 0 : x[d]) || 0) - (y ? w.crossAxis : 0);
466
- m < C ? m = C : m > R && (m = R);
467
- }
468
- return {
469
- [p]: f,
470
- [d]: m
471
- };
472
- }
473
- };
474
- }, Cn = function(e) {
475
- return e === void 0 && (e = {}), {
476
- name: "size",
477
- options: e,
478
- async fn(t) {
479
- var n, r;
480
- const { placement: o, rects: i, platform: s, elements: c } = t, { apply: l = () => {
481
- }, ...u } = Y(e, t), a = await s.detectOverflow(t, u), d = G(o), p = re(o), f = z(o) === "y", { width: m, height: g } = i.floating;
482
- let w, v;
483
- d === "top" || d === "bottom" ? (w = d, v = p === (await (s.isRTL == null ? void 0 : s.isRTL(c.floating)) ? "start" : "end") ? "left" : "right") : (v = d, w = p === "end" ? "top" : "bottom");
484
- const x = g - a.top - a.bottom, b = m - a.left - a.right, y = U(g - a[w], x), C = U(m - a[v], b), R = !t.middlewareData.shift;
485
- let O = y, M = C;
486
- if ((n = t.middlewareData.shift) != null && n.enabled.x && (M = b), (r = t.middlewareData.shift) != null && r.enabled.y && (O = x), R && !p) {
487
- const D = F(a.left, 0), N = F(a.right, 0), k = F(a.top, 0), L = F(a.bottom, 0);
488
- f ? M = m - 2 * (D !== 0 || N !== 0 ? D + N : F(a.left, a.right)) : O = g - 2 * (k !== 0 || L !== 0 ? k + L : F(a.top, a.bottom));
489
- }
490
- await l({
491
- ...t,
492
- availableWidth: M,
493
- availableHeight: O
494
- });
495
- const $ = await s.getDimensions(c.floating);
496
- return m !== $.width || g !== $.height ? { reset: { rects: !0 } } : {};
497
- }
498
- };
499
- };
500
- function ve() {
501
- return typeof window < "u";
502
- }
503
- function oe(e) {
504
- return at(e) ? (e.nodeName || "").toLowerCase() : "#document";
505
- }
506
- function W(e) {
507
- var t;
508
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
509
- }
510
- function X(e) {
511
- var t;
512
- return (t = (at(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
513
- }
514
- function at(e) {
515
- return ve() ? e instanceof Node || e instanceof W(e).Node : !1;
516
- }
517
- function B(e) {
518
- return ve() ? e instanceof Element || e instanceof W(e).Element : !1;
519
- }
520
- function q(e) {
521
- return ve() ? e instanceof HTMLElement || e instanceof W(e).HTMLElement : !1;
522
- }
523
- function Je(e) {
524
- return !ve() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof W(e).ShadowRoot;
525
- }
526
- function ce(e) {
527
- const { overflow: t, overflowX: n, overflowY: r, display: o } = V(e);
528
- return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && o !== "inline" && o !== "contents";
529
- }
530
- function An(e) {
531
- return /^(table|td|th)$/.test(oe(e));
532
- }
533
- function xe(e) {
534
- try {
535
- if (e.matches(":popover-open")) return !0;
536
- } catch {
537
- }
538
- try {
539
- return e.matches(":modal");
540
- } catch {
541
- return !1;
542
- }
543
- }
544
- var Pn = /transform|translate|scale|rotate|perspective|filter/, On = /paint|layout|strict|content/, Z = (e) => !!e && e !== "none", Oe;
545
- function He(e) {
546
- const t = B(e) ? V(e) : e;
547
- return Z(t.transform) || Z(t.translate) || Z(t.scale) || Z(t.rotate) || Z(t.perspective) || !Fe() && (Z(t.backdropFilter) || Z(t.filter)) || Pn.test(t.willChange || "") || On.test(t.contain || "");
548
- }
549
- function Tn(e) {
550
- let t = K(e);
551
- for (; q(t) && !te(t); ) {
552
- if (He(t)) return t;
553
- if (xe(t)) return null;
554
- t = K(t);
555
- }
556
- return null;
557
- }
558
- function Fe() {
559
- return Oe == null && (Oe = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), Oe;
560
- }
561
- function te(e) {
562
- return /^(html|body|#document)$/.test(oe(e));
563
- }
564
- function V(e) {
565
- return W(e).getComputedStyle(e);
566
- }
567
- function ye(e) {
568
- return B(e) ? {
569
- scrollLeft: e.scrollLeft,
570
- scrollTop: e.scrollTop
571
- } : {
572
- scrollLeft: e.scrollX,
573
- scrollTop: e.scrollY
574
- };
575
- }
576
- function K(e) {
577
- if (oe(e) === "html") return e;
578
- const t = e.assignedSlot || e.parentNode || Je(e) && e.host || X(e);
579
- return Je(t) ? t.host : t;
580
- }
581
- function lt(e) {
582
- const t = K(e);
583
- return te(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : q(t) && ce(t) ? t : lt(t);
584
- }
585
- function ie(e, t, n) {
586
- var r;
587
- t === void 0 && (t = []), n === void 0 && (n = !0);
588
- const o = lt(e), i = o === ((r = e.ownerDocument) == null ? void 0 : r.body), s = W(o);
589
- if (i) {
590
- const c = De(s);
591
- return t.concat(s, s.visualViewport || [], ce(o) ? o : [], c && n ? ie(c) : []);
592
- } else return t.concat(o, ie(o, [], n));
593
- }
594
- function De(e) {
595
- return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
596
- }
597
- function ft(e) {
598
- const t = V(e);
599
- let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
600
- const o = q(e), i = o ? e.offsetWidth : n, s = o ? e.offsetHeight : r, c = de(n) !== i || de(r) !== s;
601
- return c && (n = i, r = s), {
602
- width: n,
603
- height: r,
604
- $: c
605
- };
606
- }
607
- function We(e) {
608
- return B(e) ? e : e.contextElement;
609
- }
610
- function ee(e) {
611
- const t = We(e);
612
- if (!q(t)) return j(1);
613
- const n = t.getBoundingClientRect(), { width: r, height: o, $: i } = ft(t);
614
- let s = (i ? de(n.width) : n.width) / r, c = (i ? de(n.height) : n.height) / o;
615
- return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
616
- x: s,
617
- y: c
618
- };
619
- }
620
- var En = /* @__PURE__ */ j(0);
621
- function ut(e) {
622
- const t = W(e);
623
- return !Fe() || !t.visualViewport ? En : {
624
- x: t.visualViewport.offsetLeft,
625
- y: t.visualViewport.offsetTop
626
- };
627
- }
628
- function Sn(e, t, n) {
629
- return t === void 0 && (t = !1), !n || t && n !== W(e) ? !1 : t;
630
- }
631
- function J(e, t, n, r) {
632
- t === void 0 && (t = !1), n === void 0 && (n = !1);
633
- const o = e.getBoundingClientRect(), i = We(e);
634
- let s = j(1);
635
- t && (r ? B(r) && (s = ee(r)) : s = ee(e));
636
- const c = Sn(i, n, r) ? ut(i) : j(0);
637
- let l = (o.left + c.x) / s.x, u = (o.top + c.y) / s.y, a = o.width / s.x, d = o.height / s.y;
638
- if (i) {
639
- const p = W(i), f = r && B(r) ? W(r) : r;
640
- let m = p, g = De(m);
641
- for (; g && r && f !== m; ) {
642
- const w = ee(g), v = g.getBoundingClientRect(), x = V(g), b = v.left + (g.clientLeft + parseFloat(x.paddingLeft)) * w.x, y = v.top + (g.clientTop + parseFloat(x.paddingTop)) * w.y;
643
- l *= w.x, u *= w.y, a *= w.x, d *= w.y, l += b, u += y, m = W(g), g = De(m);
644
- }
645
- }
646
- return me({
647
- width: a,
648
- height: d,
649
- x: l,
650
- y: u
651
- });
652
- }
653
- function be(e, t) {
654
- const n = ye(e).scrollLeft;
655
- return t ? t.left + n : J(X(e)).left + n;
656
- }
657
- function dt(e, t) {
658
- const n = e.getBoundingClientRect();
659
- return {
660
- x: n.left + t.scrollLeft - be(e, n),
661
- y: n.top + t.scrollTop
662
- };
663
- }
664
- function Ln(e) {
665
- let { elements: t, rect: n, offsetParent: r, strategy: o } = e;
666
- const i = o === "fixed", s = X(r), c = t ? xe(t.floating) : !1;
667
- if (r === s || c && i) return n;
668
- let l = {
669
- scrollLeft: 0,
670
- scrollTop: 0
671
- }, u = j(1);
672
- const a = j(0), d = q(r);
673
- if ((d || !d && !i) && ((oe(r) !== "body" || ce(s)) && (l = ye(r)), d)) {
674
- const f = J(r);
675
- u = ee(r), a.x = f.x + r.clientLeft, a.y = f.y + r.clientTop;
676
- }
677
- const p = s && !d && !i ? dt(s, l) : j(0);
678
- return {
679
- width: n.width * u.x,
680
- height: n.height * u.y,
681
- x: n.x * u.x - l.scrollLeft * u.x + a.x + p.x,
682
- y: n.y * u.y - l.scrollTop * u.y + a.y + p.y
683
- };
684
- }
685
- function Dn(e) {
686
- return Array.from(e.getClientRects());
687
- }
688
- function Mn(e) {
689
- const t = X(e), n = ye(e), r = e.ownerDocument.body, o = F(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = F(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
690
- let s = -n.scrollLeft + be(e);
691
- const c = -n.scrollTop;
692
- return V(r).direction === "rtl" && (s += F(t.clientWidth, r.clientWidth) - o), {
693
- width: o,
694
- height: i,
695
- x: s,
696
- y: c
697
- };
698
- }
699
- var Qe = 25;
700
- function _n(e, t) {
701
- const n = W(e), r = X(e), o = n.visualViewport;
702
- let i = r.clientWidth, s = r.clientHeight, c = 0, l = 0;
703
- if (o) {
704
- i = o.width, s = o.height;
705
- const a = Fe();
706
- (!a || a && t === "fixed") && (c = o.offsetLeft, l = o.offsetTop);
707
- }
708
- const u = be(r);
709
- if (u <= 0) {
710
- const a = r.ownerDocument, d = a.body, p = getComputedStyle(d), f = a.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, m = Math.abs(r.clientWidth - d.clientWidth - f);
711
- m <= Qe && (i -= m);
712
- } else u <= Qe && (i += u);
713
- return {
714
- width: i,
715
- height: s,
716
- x: c,
717
- y: l
718
- };
719
- }
720
- function kn(e, t) {
721
- const n = J(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = q(e) ? ee(e) : j(1);
722
- return {
723
- width: e.clientWidth * i.x,
724
- height: e.clientHeight * i.y,
725
- x: o * i.x,
726
- y: r * i.y
727
- };
728
- }
729
- function et(e, t, n) {
730
- let r;
731
- if (t === "viewport") r = _n(e, n);
732
- else if (t === "document") r = Mn(X(e));
733
- else if (B(t)) r = kn(t, n);
734
- else {
735
- const o = ut(e);
736
- r = {
737
- x: t.x - o.x,
738
- y: t.y - o.y,
739
- width: t.width,
740
- height: t.height
741
- };
742
- }
743
- return me(r);
744
- }
745
- function pt(e, t) {
746
- const n = K(e);
747
- return n === t || !B(n) || te(n) ? !1 : V(n).position === "fixed" || pt(n, t);
748
- }
749
- function Nn(e, t) {
750
- const n = t.get(e);
751
- if (n) return n;
752
- let r = ie(e, [], !1).filter((c) => B(c) && oe(c) !== "body"), o = null;
753
- const i = V(e).position === "fixed";
754
- let s = i ? K(e) : e;
755
- for (; B(s) && !te(s); ) {
756
- const c = V(s), l = He(s);
757
- !l && c.position === "fixed" && (o = null), (i ? !l && !o : !l && c.position === "static" && o && (o.position === "absolute" || o.position === "fixed") || ce(s) && !l && pt(e, s)) ? r = r.filter((u) => u !== s) : o = c, s = K(s);
758
- }
759
- return t.set(e, r), r;
760
- }
761
- function $n(e) {
762
- let { element: t, boundary: n, rootBoundary: r, strategy: o } = e;
763
- const i = [...n === "clippingAncestors" ? xe(t) ? [] : Nn(t, this._c) : [].concat(n), r], s = et(t, i[0], o);
764
- let c = s.top, l = s.right, u = s.bottom, a = s.left;
765
- for (let d = 1; d < i.length; d++) {
766
- const p = et(t, i[d], o);
767
- c = F(p.top, c), l = U(p.right, l), u = U(p.bottom, u), a = F(p.left, a);
768
- }
769
- return {
770
- width: l - a,
771
- height: u - c,
772
- x: a,
773
- y: c
774
- };
775
- }
776
- function Hn(e) {
777
- const { width: t, height: n } = ft(e);
778
- return {
779
- width: t,
780
- height: n
781
- };
782
- }
783
- function Fn(e, t, n) {
784
- const r = q(t), o = X(t), i = n === "fixed", s = J(e, !0, i, t);
785
- let c = {
786
- scrollLeft: 0,
787
- scrollTop: 0
788
- };
789
- const l = j(0);
790
- function u() {
791
- l.x = be(o);
792
- }
793
- if (r || !r && !i)
794
- if ((oe(t) !== "body" || ce(o)) && (c = ye(t)), r) {
795
- const d = J(t, !0, i, t);
796
- l.x = d.x + t.clientLeft, l.y = d.y + t.clientTop;
797
- } else o && u();
798
- i && !r && o && u();
799
- const a = o && !r && !i ? dt(o, c) : j(0);
800
- return {
801
- x: s.left + c.scrollLeft - l.x - a.x,
802
- y: s.top + c.scrollTop - l.y - a.y,
803
- width: s.width,
804
- height: s.height
805
- };
806
- }
807
- function Te(e) {
808
- return V(e).position === "static";
809
- }
810
- function tt(e, t) {
811
- if (!q(e) || V(e).position === "fixed") return null;
812
- if (t) return t(e);
813
- let n = e.offsetParent;
814
- return X(e) === n && (n = n.ownerDocument.body), n;
815
- }
816
- function mt(e, t) {
817
- const n = W(e);
818
- if (xe(e)) return n;
819
- if (!q(e)) {
820
- let o = K(e);
821
- for (; o && !te(o); ) {
822
- if (B(o) && !Te(o)) return o;
823
- o = K(o);
824
- }
825
- return n;
826
- }
827
- let r = tt(e, t);
828
- for (; r && An(r) && Te(r); ) r = tt(r, t);
829
- return r && te(r) && Te(r) && !He(r) ? n : r || Tn(e) || n;
830
- }
831
- var Wn = async function(e) {
832
- const t = this.getOffsetParent || mt, n = this.getDimensions, r = await n(e.floating);
833
- return {
834
- reference: Fn(e.reference, await t(e.floating), e.strategy),
835
- floating: {
836
- x: 0,
837
- y: 0,
838
- width: r.width,
839
- height: r.height
840
- }
841
- };
842
- };
843
- function In(e) {
844
- return V(e).direction === "rtl";
845
- }
846
- var Bn = {
847
- convertOffsetParentRelativeRectToViewportRelativeRect: Ln,
848
- getDocumentElement: X,
849
- getClippingRect: $n,
850
- getOffsetParent: mt,
851
- getElementRects: Wn,
852
- getClientRects: Dn,
853
- getDimensions: Hn,
854
- getScale: ee,
855
- isElement: B,
856
- isRTL: In
857
- };
858
- function ht(e, t) {
859
- return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
860
- }
861
- function Vn(e, t) {
862
- let n = null, r;
863
- const o = X(e);
864
- function i() {
865
- var c;
866
- clearTimeout(r), (c = n) == null || c.disconnect(), n = null;
867
- }
868
- function s(c, l) {
869
- c === void 0 && (c = !1), l === void 0 && (l = 1), i();
870
- const u = e.getBoundingClientRect(), { left: a, top: d, width: p, height: f } = u;
871
- if (c || t(), !p || !f) return;
872
- const m = fe(d), g = fe(o.clientWidth - (a + p)), w = fe(o.clientHeight - (d + f)), v = fe(a), x = {
873
- rootMargin: -m + "px " + -g + "px " + -w + "px " + -v + "px",
874
- threshold: F(0, U(1, l)) || 1
875
- };
876
- let b = !0;
877
- function y(C) {
878
- const R = C[0].intersectionRatio;
879
- if (R !== l) {
880
- if (!b) return s();
881
- R ? s(!1, R) : r = setTimeout(() => {
882
- s(!1, 1e-7);
883
- }, 1e3);
884
- }
885
- R === 1 && !ht(u, e.getBoundingClientRect()) && s(), b = !1;
886
- }
887
- try {
888
- n = new IntersectionObserver(y, {
889
- ...x,
890
- root: o.ownerDocument
891
- });
892
- } catch {
893
- n = new IntersectionObserver(y, x);
894
- }
895
- n.observe(e);
896
- }
897
- return s(!0), i;
898
- }
899
- function zn(e, t, n, r) {
900
- r === void 0 && (r = {});
901
- const { ancestorScroll: o = !0, ancestorResize: i = !0, elementResize: s = typeof ResizeObserver == "function", layoutShift: c = typeof IntersectionObserver == "function", animationFrame: l = !1 } = r, u = We(e), a = o || i ? [...u ? ie(u) : [], ...t ? ie(t) : []] : [];
902
- a.forEach((v) => {
903
- o && v.addEventListener("scroll", n, { passive: !0 }), i && v.addEventListener("resize", n);
904
- });
905
- const d = u && c ? Vn(u, n) : null;
906
- let p = -1, f = null;
907
- s && (f = new ResizeObserver((v) => {
908
- let [x] = v;
909
- x && x.target === u && f && t && (f.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
910
- var b;
911
- (b = f) == null || b.observe(t);
912
- })), n();
913
- }), u && !l && f.observe(u), t && f.observe(t));
914
- let m, g = l ? J(e) : null;
915
- l && w();
916
- function w() {
917
- const v = J(e);
918
- g && !ht(g, v) && n(), g = v, m = requestAnimationFrame(w);
919
- }
920
- return n(), () => {
921
- var v;
922
- a.forEach((x) => {
923
- o && x.removeEventListener("scroll", n), i && x.removeEventListener("resize", n);
924
- }), d?.(), (v = f) == null || v.disconnect(), f = null, l && cancelAnimationFrame(m);
925
- };
926
- }
927
- var jn = yn, Xn = bn, Yn = wn, Gn = Cn, qn = vn, nt = gn, Un = Rn, Kn = (e, t, n) => {
928
- const r = /* @__PURE__ */ new Map(), o = {
929
- platform: Bn,
930
- ...n
931
- }, i = {
932
- ...o.platform,
933
- _c: r
934
- };
935
- return hn(e, t, {
936
- ...o,
937
- platform: i
938
- });
939
- }, ue = typeof document < "u" ? en : function() {
940
- };
941
- function he(e, t) {
942
- if (e === t) return !0;
943
- if (typeof e != typeof t) return !1;
944
- if (typeof e == "function" && e.toString() === t.toString()) return !0;
945
- let n, r, o;
946
- if (e && t && typeof e == "object") {
947
- if (Array.isArray(e)) {
948
- if (n = e.length, n !== t.length) return !1;
949
- for (r = n; r-- !== 0; ) if (!he(e[r], t[r])) return !1;
950
- return !0;
951
- }
952
- if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length) return !1;
953
- for (r = n; r-- !== 0; ) if (!{}.hasOwnProperty.call(t, o[r])) return !1;
954
- for (r = n; r-- !== 0; ) {
955
- const i = o[r];
956
- if (!(i === "_owner" && e.$$typeof) && !he(e[i], t[i]))
957
- return !1;
958
- }
959
- return !0;
960
- }
961
- return e !== e && t !== t;
962
- }
963
- function gt(e) {
964
- return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
965
- }
966
- function rt(e, t) {
967
- const n = gt(e);
968
- return Math.round(t * n) / n;
969
- }
970
- function Ee(e) {
971
- const t = h.useRef(e);
972
- return ue(() => {
973
- t.current = e;
974
- }), t;
975
- }
976
- function Zn(e) {
977
- e === void 0 && (e = {});
978
- const { placement: t = "bottom", strategy: n = "absolute", middleware: r = [], platform: o, elements: { reference: i, floating: s } = {}, transform: c = !0, whileElementsMounted: l, open: u } = e, [a, d] = h.useState({
979
- x: 0,
980
- y: 0,
981
- strategy: n,
982
- placement: t,
983
- middlewareData: {},
984
- isPositioned: !1
985
- }), [p, f] = h.useState(r);
986
- he(p, r) || f(r);
987
- const [m, g] = h.useState(null), [w, v] = h.useState(null), x = h.useCallback((A) => {
988
- A !== R.current && (R.current = A, g(A));
989
- }, []), b = h.useCallback((A) => {
990
- A !== O.current && (O.current = A, v(A));
991
- }, []), y = i || m, C = s || w, R = h.useRef(null), O = h.useRef(null), M = h.useRef(a), $ = l != null, D = Ee(l), N = Ee(o), k = Ee(u), L = h.useCallback(() => {
992
- if (!R.current || !O.current) return;
993
- const A = {
994
- placement: t,
995
- strategy: n,
996
- middleware: p
997
- };
998
- N.current && (A.platform = N.current), Kn(R.current, O.current, A).then((_) => {
999
- const I = {
1000
- ..._,
1001
- isPositioned: k.current !== !1
1002
- };
1003
- T.current && !he(M.current, I) && (M.current = I, tn.flushSync(() => {
1004
- d(I);
1005
- }));
1006
- });
1007
- }, [
1008
- p,
1009
- t,
1010
- n,
1011
- N,
1012
- k
1013
- ]);
1014
- ue(() => {
1015
- u === !1 && M.current.isPositioned && (M.current.isPositioned = !1, d((A) => ({
1016
- ...A,
1017
- isPositioned: !1
1018
- })));
1019
- }, [u]);
1020
- const T = h.useRef(!1);
1021
- ue(() => (T.current = !0, () => {
1022
- T.current = !1;
1023
- }), []), ue(() => {
1024
- if (y && (R.current = y), C && (O.current = C), y && C) {
1025
- if (D.current) return D.current(y, C, L);
1026
- L();
1027
- }
1028
- }, [
1029
- y,
1030
- C,
1031
- L,
1032
- D,
1033
- $
1034
- ]);
1035
- const H = h.useMemo(() => ({
1036
- reference: R,
1037
- floating: O,
1038
- setReference: x,
1039
- setFloating: b
1040
- }), [x, b]), E = h.useMemo(() => ({
1041
- reference: y,
1042
- floating: C
1043
- }), [y, C]), S = h.useMemo(() => {
1044
- const A = {
1045
- position: n,
1046
- left: 0,
1047
- top: 0
1048
- };
1049
- if (!E.floating) return A;
1050
- const _ = rt(E.floating, a.x), I = rt(E.floating, a.y);
1051
- return c ? {
1052
- ...A,
1053
- transform: "translate(" + _ + "px, " + I + "px)",
1054
- ...gt(E.floating) >= 1.5 && { willChange: "transform" }
1055
- } : {
1056
- position: n,
1057
- left: _,
1058
- top: I
1059
- };
1060
- }, [
1061
- n,
1062
- c,
1063
- E.floating,
1064
- a.x,
1065
- a.y
1066
- ]);
1067
- return h.useMemo(() => ({
1068
- ...a,
1069
- update: L,
1070
- refs: H,
1071
- elements: E,
1072
- floatingStyles: S
1073
- }), [
1074
- a,
1075
- L,
1076
- H,
1077
- E,
1078
- S
1079
- ]);
1080
- }
1081
- var Jn = (e) => {
1082
- function t(n) {
1083
- return {}.hasOwnProperty.call(n, "current");
1084
- }
1085
- return {
1086
- name: "arrow",
1087
- options: e,
1088
- fn(n) {
1089
- const { element: r, padding: o } = typeof e == "function" ? e(n) : e;
1090
- return r && t(r) ? r.current != null ? nt({
1091
- element: r.current,
1092
- padding: o
1093
- }).fn(n) : {} : r ? nt({
1094
- element: r,
1095
- padding: o
1096
- }).fn(n) : {};
1097
- }
1098
- };
1099
- }, Qn = (e, t) => {
1100
- const n = jn(e);
1101
- return {
1102
- name: n.name,
1103
- fn: n.fn,
1104
- options: [e, t]
1105
- };
1106
- }, er = (e, t) => {
1107
- const n = Xn(e);
1108
- return {
1109
- name: n.name,
1110
- fn: n.fn,
1111
- options: [e, t]
1112
- };
1113
- }, tr = (e, t) => ({
1114
- fn: Un(e).fn,
1115
- options: [e, t]
1116
- }), nr = (e, t) => {
1117
- const n = Yn(e);
1118
- return {
1119
- name: n.name,
1120
- fn: n.fn,
1121
- options: [e, t]
1122
- };
1123
- }, rr = (e, t) => {
1124
- const n = Gn(e);
1125
- return {
1126
- name: n.name,
1127
- fn: n.fn,
1128
- options: [e, t]
1129
- };
1130
- }, or = (e, t) => {
1131
- const n = qn(e);
1132
- return {
1133
- name: n.name,
1134
- fn: n.fn,
1135
- options: [e, t]
1136
- };
1137
- }, ir = (e, t) => {
1138
- const n = Jn(e);
1139
- return {
1140
- name: n.name,
1141
- fn: n.fn,
1142
- options: [e, t]
1143
- };
1144
- }, sr = "Arrow", wt = h.forwardRef((e, t) => {
1145
- const { children: n, width: r = 10, height: o = 5, ...i } = e;
1146
- return /* @__PURE__ */ P(we.svg, {
1147
- ...i,
1148
- ref: t,
1149
- width: r,
1150
- height: o,
1151
- viewBox: "0 0 30 10",
1152
- preserveAspectRatio: "none",
1153
- children: e.asChild ? n : /* @__PURE__ */ P("polygon", { points: "0,0 30,0 15,10" })
1154
- });
1155
- });
1156
- wt.displayName = sr;
1157
- var cr = wt, Ie = "Popper", [vt, xt] = ot(Ie), [ar, yt] = vt(Ie), bt = (e) => {
1158
- const { __scopePopper: t, children: n } = e, [r, o] = h.useState(null), [i, s] = h.useState(void 0);
1159
- return /* @__PURE__ */ P(ar, {
1160
- scope: t,
1161
- anchor: r,
1162
- onAnchorChange: o,
1163
- placementState: i,
1164
- setPlacementState: s,
1165
- children: n
1166
- });
1167
- };
1168
- bt.displayName = Ie;
1169
- var Rt = "PopperAnchor", Ct = h.forwardRef((e, t) => {
1170
- const { __scopePopper: n, virtualRef: r, ...o } = e, i = yt(Rt, n), s = h.useRef(null), c = i.onAnchorChange, l = ge(t, h.useCallback((f) => {
1171
- s.current = f, f && c(f);
1172
- }, [c])), u = h.useRef(null);
1173
- h.useEffect(() => {
1174
- if (!r) return;
1175
- const f = u.current;
1176
- u.current = r.current, f !== u.current && c(u.current);
1177
- });
1178
- const a = i.placementState && Ve(i.placementState), d = a?.[0], p = a?.[1];
1179
- return r ? null : /* @__PURE__ */ P(we.div, {
1180
- "data-radix-popper-side": d,
1181
- "data-radix-popper-align": p,
1182
- ...o,
1183
- ref: l
1184
- });
1185
- });
1186
- Ct.displayName = Rt;
1187
- var Be = "PopperContent", [lr, fr] = vt(Be), At = h.forwardRef((e, t) => {
1188
- const { __scopePopper: n, side: r = "bottom", sideOffset: o = 0, align: i = "center", alignOffset: s = 0, arrowPadding: c = 0, avoidCollisions: l = !0, collisionBoundary: u = [], collisionPadding: a = 0, sticky: d = "partial", hideWhenDetached: p = !1, updatePositionStrategy: f = "optimized", onPlaced: m, ...g } = e, w = yt(Be, n), [v, x] = h.useState(null), b = ge(t, x), [y, C] = h.useState(null), R = Qt(y), O = R?.width ?? 0, M = R?.height ?? 0, $ = r + (i !== "center" ? "-" + i : ""), D = typeof a == "number" ? a : {
1189
- top: 0,
1190
- right: 0,
1191
- bottom: 0,
1192
- left: 0,
1193
- ...a
1194
- }, N = Array.isArray(u) ? u : [u], k = N.length > 0, L = {
1195
- padding: D,
1196
- boundary: N.filter(dr),
1197
- altBoundary: k
1198
- }, { refs: T, floatingStyles: H, placement: E, isPositioned: S, middlewareData: A } = Zn({
1199
- strategy: "fixed",
1200
- placement: $,
1201
- whileElementsMounted: (...Ae) => zn(...Ae, { animationFrame: f === "always" }),
1202
- elements: { reference: w.anchor },
1203
- middleware: [
1204
- Qn({
1205
- mainAxis: o + M,
1206
- alignmentAxis: s
1207
- }),
1208
- l && er({
1209
- mainAxis: !0,
1210
- crossAxis: !1,
1211
- limiter: d === "partial" ? tr() : void 0,
1212
- ...L
1213
- }),
1214
- l && nr({ ...L }),
1215
- rr({
1216
- ...L,
1217
- apply: ({ elements: Ae, rects: Bt, availableWidth: Vt, availableHeight: zt }) => {
1218
- const { width: jt, height: Xt } = Bt.reference, le = Ae.floating.style;
1219
- le.setProperty("--radix-popper-available-width", `${Vt}px`), le.setProperty("--radix-popper-available-height", `${zt}px`), le.setProperty("--radix-popper-anchor-width", `${jt}px`), le.setProperty("--radix-popper-anchor-height", `${Xt}px`);
1220
- }
1221
- }),
1222
- y && ir({
1223
- element: y,
1224
- padding: c
1225
- }),
1226
- pr({
1227
- arrowWidth: O,
1228
- arrowHeight: M
1229
- }),
1230
- p && or({
1231
- strategy: "referenceHidden",
1232
- ...L,
1233
- boundary: k ? L.boundary : void 0
1234
- })
1235
- ]
1236
- }), _ = w.setPlacementState;
1237
- Pe(() => (_(E), () => {
1238
- _(void 0);
1239
- }), [E, _]);
1240
- const [I, Xe] = Ve(E), Ye = Kt(m);
1241
- Pe(() => {
1242
- S && Ye?.();
1243
- }, [S, Ye]);
1244
- const $t = A.arrow?.x, Ht = A.arrow?.y, Ft = A.arrow?.centerOffset !== 0, [Wt, It] = h.useState();
1245
- return Pe(() => {
1246
- v && It(window.getComputedStyle(v).zIndex);
1247
- }, [v]), /* @__PURE__ */ P("div", {
1248
- ref: T.setFloating,
1249
- "data-radix-popper-content-wrapper": "",
1250
- style: {
1251
- ...H,
1252
- transform: S ? H.transform : "translate(0, -200%)",
1253
- minWidth: "max-content",
1254
- zIndex: Wt,
1255
- "--radix-popper-transform-origin": [A.transformOrigin?.x, A.transformOrigin?.y].join(" "),
1256
- ...A.hide?.referenceHidden && {
1257
- visibility: "hidden",
1258
- pointerEvents: "none"
1259
- }
1260
- },
1261
- dir: e.dir,
1262
- children: /* @__PURE__ */ P(lr, {
1263
- scope: n,
1264
- placedSide: I,
1265
- placedAlign: Xe,
1266
- onArrowChange: C,
1267
- arrowX: $t,
1268
- arrowY: Ht,
1269
- shouldHideArrow: Ft,
1270
- children: /* @__PURE__ */ P(we.div, {
1271
- "data-side": I,
1272
- "data-align": Xe,
1273
- ...g,
1274
- ref: b,
1275
- style: {
1276
- ...g.style,
1277
- animation: S ? void 0 : "none"
1278
- }
1279
- })
1280
- })
1281
- });
1282
- });
1283
- At.displayName = Be;
1284
- var Pt = "PopperArrow", ur = {
1285
- top: "bottom",
1286
- right: "left",
1287
- bottom: "top",
1288
- left: "right"
1289
- }, Ot = h.forwardRef(function(t, n) {
1290
- const { __scopePopper: r, ...o } = t, i = fr(Pt, r), s = ur[i.placedSide];
1291
- return /* @__PURE__ */ P("span", {
1292
- ref: i.onArrowChange,
1293
- style: {
1294
- position: "absolute",
1295
- left: i.arrowX,
1296
- top: i.arrowY,
1297
- [s]: 0,
1298
- transformOrigin: {
1299
- top: "",
1300
- right: "0 0",
1301
- bottom: "center 0",
1302
- left: "100% 0"
1303
- }[i.placedSide],
1304
- transform: {
1305
- top: "translateY(100%)",
1306
- right: "translateY(50%) rotate(90deg) translateX(-50%)",
1307
- bottom: "rotate(180deg)",
1308
- left: "translateY(50%) rotate(-90deg) translateX(50%)"
1309
- }[i.placedSide],
1310
- visibility: i.shouldHideArrow ? "hidden" : void 0
1311
- },
1312
- children: /* @__PURE__ */ P(cr, {
1313
- ...o,
1314
- ref: n,
1315
- style: {
1316
- ...o.style,
1317
- display: "block"
1318
- }
1319
- })
1320
- });
1321
- });
1322
- Ot.displayName = Pt;
1323
- function dr(e) {
1324
- return e !== null;
1325
- }
1326
- var pr = (e) => ({
1327
- name: "transformOrigin",
1328
- options: e,
1329
- fn(t) {
1330
- const { placement: n, rects: r, middlewareData: o } = t, i = o.arrow?.centerOffset !== 0, s = i ? 0 : e.arrowWidth, c = i ? 0 : e.arrowHeight, [l, u] = Ve(n), a = {
1331
- start: "0%",
1332
- center: "50%",
1333
- end: "100%"
1334
- }[u], d = (o.arrow?.x ?? 0) + s / 2, p = (o.arrow?.y ?? 0) + c / 2;
1335
- let f = "", m = "";
1336
- return l === "bottom" ? (f = i ? a : `${d}px`, m = `${-c}px`) : l === "top" ? (f = i ? a : `${d}px`, m = `${r.floating.height + c}px`) : l === "right" ? (f = `${-c}px`, m = i ? a : `${p}px`) : l === "left" && (f = `${r.floating.width + c}px`, m = i ? a : `${p}px`), { data: {
1337
- x: f,
1338
- y: m
1339
- } };
1340
- }
1341
- });
1342
- function Ve(e) {
1343
- const [t, n = "center"] = e.split("-");
1344
- return [t, n];
1345
- }
1346
- var mr = bt, hr = Ct, gr = At, wr = Ot, [Re, jr] = ot("Tooltip", [xt]), Ce = xt(), Tt = "TooltipProvider", vr = 700, Me = "tooltip.open", [xr, ze] = Re(Tt), Et = (e) => {
1347
- const { __scopeTooltip: t, delayDuration: n = vr, skipDelayDuration: r = 300, disableHoverableContent: o = !1, children: i } = e, s = h.useRef(!0), c = h.useRef(!1), l = h.useRef(0);
1348
- return h.useEffect(() => {
1349
- const u = l.current;
1350
- return () => window.clearTimeout(u);
1351
- }, []), /* @__PURE__ */ P(xr, {
1352
- scope: t,
1353
- isOpenDelayedRef: s,
1354
- delayDuration: n,
1355
- onOpen: h.useCallback(() => {
1356
- r <= 0 || (window.clearTimeout(l.current), s.current = !1);
1357
- }, [r]),
1358
- onClose: h.useCallback(() => {
1359
- r <= 0 || (window.clearTimeout(l.current), l.current = window.setTimeout(() => s.current = !0, r));
1360
- }, [r]),
1361
- isPointerInTransitRef: c,
1362
- onPointerInTransitChange: h.useCallback((u) => {
1363
- c.current = u;
1364
- }, []),
1365
- disableHoverableContent: o,
1366
- children: i
1367
- });
1368
- };
1369
- Et.displayName = Tt;
1370
- var se = "Tooltip", [yr, ae] = Re(se), St = (e) => {
1371
- const { __scopeTooltip: t, children: n, open: r, defaultOpen: o, onOpenChange: i, disableHoverableContent: s, delayDuration: c } = e, l = ze(se, e.__scopeTooltip), u = Ce(t), [a, d] = h.useState(null), p = Ut(), f = h.useRef(0), m = s ?? l.disableHoverableContent, g = c ?? l.delayDuration, w = h.useRef(!1), [v, x] = qt({
1372
- prop: r,
1373
- defaultProp: o ?? !1,
1374
- onChange: (O) => {
1375
- O ? (l.onOpen(), document.dispatchEvent(new CustomEvent(Me))) : l.onClose(), i?.(O);
1376
- },
1377
- caller: se
1378
- }), b = h.useMemo(() => v ? w.current ? "delayed-open" : "instant-open" : "closed", [v]), y = h.useCallback(() => {
1379
- window.clearTimeout(f.current), f.current = 0, w.current = !1, x(!0);
1380
- }, [x]), C = h.useCallback(() => {
1381
- window.clearTimeout(f.current), f.current = 0, x(!1);
1382
- }, [x]), R = h.useCallback(() => {
1383
- window.clearTimeout(f.current), f.current = window.setTimeout(() => {
1384
- w.current = !0, x(!0), f.current = 0;
1385
- }, g);
1386
- }, [g, x]);
1387
- return h.useEffect(() => () => {
1388
- f.current && (window.clearTimeout(f.current), f.current = 0);
1389
- }, []), /* @__PURE__ */ P(mr, {
1390
- ...u,
1391
- children: /* @__PURE__ */ P(yr, {
1392
- scope: t,
1393
- contentId: p,
1394
- open: v,
1395
- stateAttribute: b,
1396
- trigger: a,
1397
- onTriggerChange: d,
1398
- onTriggerEnter: h.useCallback(() => {
1399
- l.isOpenDelayedRef.current ? R() : y();
1400
- }, [
1401
- l.isOpenDelayedRef,
1402
- R,
1403
- y
1404
- ]),
1405
- onTriggerLeave: h.useCallback(() => {
1406
- m ? C() : (window.clearTimeout(f.current), f.current = 0);
1407
- }, [C, m]),
1408
- onOpen: y,
1409
- onClose: C,
1410
- disableHoverableContent: m,
1411
- children: n
1412
- })
1413
- });
1414
- };
1415
- St.displayName = se;
1416
- var _e = "TooltipTrigger", Lt = h.forwardRef((e, t) => {
1417
- const { __scopeTooltip: n, ...r } = e, o = ae(_e, n), i = ze(_e, n), s = Ce(n), c = ge(t, h.useRef(null), o.onTriggerChange), l = h.useRef(!1), u = h.useRef(!1), a = h.useCallback(() => l.current = !1, []);
1418
- return h.useEffect(() => () => document.removeEventListener("pointerup", a), [a]), /* @__PURE__ */ P(hr, {
1419
- asChild: !0,
1420
- ...s,
1421
- children: /* @__PURE__ */ P(we.button, {
1422
- "aria-describedby": o.open ? o.contentId : void 0,
1423
- "data-state": o.stateAttribute,
1424
- ...r,
1425
- ref: c,
1426
- onPointerMove: Q(e.onPointerMove, (d) => {
1427
- d.pointerType !== "touch" && !u.current && !i.isPointerInTransitRef.current && (o.onTriggerEnter(), u.current = !0);
1428
- }),
1429
- onPointerLeave: Q(e.onPointerLeave, () => {
1430
- o.onTriggerLeave(), u.current = !1;
1431
- }),
1432
- onPointerDown: Q(e.onPointerDown, () => {
1433
- o.open && o.onClose(), l.current = !0, document.addEventListener("pointerup", a, { once: !0 });
1434
- }),
1435
- onFocus: Q(e.onFocus, () => {
1436
- l.current || o.onOpen();
1437
- }),
1438
- onBlur: Q(e.onBlur, o.onClose),
1439
- onClick: Q(e.onClick, o.onClose)
1440
- })
1441
- });
1442
- });
1443
- Lt.displayName = _e;
1444
- var je = "TooltipPortal", [br, Rr] = Re(je, { forceMount: void 0 }), Dt = (e) => {
1445
- const { __scopeTooltip: t, forceMount: n, children: r, container: o } = e, i = ae(je, t);
1446
- return /* @__PURE__ */ P(br, {
1447
- scope: t,
1448
- forceMount: n,
1449
- children: /* @__PURE__ */ P(it, {
1450
- present: n || i.open,
1451
- children: /* @__PURE__ */ P(Jt, {
1452
- asChild: !0,
1453
- container: o,
1454
- children: r
1455
- })
1456
- })
1457
- });
1458
- };
1459
- Dt.displayName = je;
1460
- var ne = "TooltipContent", Mt = h.forwardRef((e, t) => {
1461
- const n = Rr(ne, e.__scopeTooltip), { forceMount: r = n.forceMount, side: o = "top", ...i } = e, s = ae(ne, e.__scopeTooltip);
1462
- return /* @__PURE__ */ P(it, {
1463
- present: r || s.open,
1464
- children: s.disableHoverableContent ? /* @__PURE__ */ P(_t, {
1465
- side: o,
1466
- ...i,
1467
- ref: t
1468
- }) : /* @__PURE__ */ P(Cr, {
1469
- side: o,
1470
- ...i,
1471
- ref: t
1472
- })
1473
- });
1474
- }), Cr = h.forwardRef((e, t) => {
1475
- const n = ae(ne, e.__scopeTooltip), r = ze(ne, e.__scopeTooltip), o = h.useRef(null), i = ge(t, o), [s, c] = h.useState(null), { trigger: l, onClose: u } = n, a = o.current, { onPointerInTransitChange: d } = r, p = h.useCallback(() => {
1476
- c(null), d(!1);
1477
- }, [d]), f = h.useCallback((m, g) => {
1478
- const w = m.currentTarget, v = {
1479
- x: m.clientX,
1480
- y: m.clientY
1481
- }, x = Er(v, Tr(v, w.getBoundingClientRect())), b = Sr(g.getBoundingClientRect()), y = Dr([...x, ...b]);
1482
- c(y), d(!0);
1483
- }, [d]);
1484
- return h.useEffect(() => () => p(), [p]), h.useEffect(() => {
1485
- if (l && a) {
1486
- const m = (w) => f(w, a), g = (w) => f(w, l);
1487
- return l.addEventListener("pointerleave", m), a.addEventListener("pointerleave", g), () => {
1488
- l.removeEventListener("pointerleave", m), a.removeEventListener("pointerleave", g);
1489
- };
1490
- }
1491
- }, [
1492
- l,
1493
- a,
1494
- f,
1495
- p
1496
- ]), h.useEffect(() => {
1497
- if (s) {
1498
- const m = (g) => {
1499
- const w = g.target, v = {
1500
- x: g.clientX,
1501
- y: g.clientY
1502
- }, x = l?.contains(w) || a?.contains(w), b = !Lr(v, s);
1503
- x ? p() : b && (p(), u());
1504
- };
1505
- return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
1506
- }
1507
- }, [
1508
- l,
1509
- a,
1510
- s,
1511
- u,
1512
- p
1513
- ]), /* @__PURE__ */ P(_t, {
1514
- ...e,
1515
- ref: i
1516
- });
1517
- }), [Ar, Pr] = Re(se, { isInside: !1 }), Or = Yt("TooltipContent"), _t = h.forwardRef((e, t) => {
1518
- const { __scopeTooltip: n, children: r, "aria-label": o, onEscapeKeyDown: i, onPointerDownOutside: s, ...c } = e, l = ae(ne, n), u = Ce(n), { onClose: a } = l;
1519
- return h.useEffect(() => (document.addEventListener(Me, a), () => document.removeEventListener(Me, a)), [a]), h.useEffect(() => {
1520
- if (l.trigger) {
1521
- const d = (p) => {
1522
- p.target instanceof Node && p.target.contains(l.trigger) && a();
1523
- };
1524
- return window.addEventListener("scroll", d, { capture: !0 }), () => window.removeEventListener("scroll", d, { capture: !0 });
1525
- }
1526
- }, [l.trigger, a]), /* @__PURE__ */ P(Zt, {
1527
- asChild: !0,
1528
- disableOutsidePointerEvents: !1,
1529
- onEscapeKeyDown: i,
1530
- onPointerDownOutside: s,
1531
- onFocusOutside: (d) => d.preventDefault(),
1532
- onDismiss: a,
1533
- children: /* @__PURE__ */ nn(gr, {
1534
- "data-state": l.stateAttribute,
1535
- ...u,
1536
- ...c,
1537
- ref: t,
1538
- style: {
1539
- ...c.style,
1540
- "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
1541
- "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
1542
- "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
1543
- "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
1544
- "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
1545
- },
1546
- children: [/* @__PURE__ */ P(Or, { children: r }), /* @__PURE__ */ P(Ar, {
1547
- scope: n,
1548
- isInside: !0,
1549
- children: /* @__PURE__ */ P(Gt, {
1550
- id: l.contentId,
1551
- role: "tooltip",
1552
- children: o || r
1553
- })
1554
- })]
1555
- })
1556
- });
1557
- });
1558
- Mt.displayName = ne;
1559
- var kt = "TooltipArrow", Nt = h.forwardRef((e, t) => {
1560
- const { __scopeTooltip: n, ...r } = e, o = Ce(n);
1561
- return Pr(kt, n).isInside ? null : /* @__PURE__ */ P(wr, {
1562
- ...o,
1563
- ...r,
1564
- ref: t
1565
- });
1566
- });
1567
- Nt.displayName = kt;
1568
- function Tr(e, t) {
1569
- const n = Math.abs(t.top - e.y), r = Math.abs(t.bottom - e.y), o = Math.abs(t.right - e.x), i = Math.abs(t.left - e.x);
1570
- switch (Math.min(n, r, o, i)) {
1571
- case i:
1572
- return "left";
1573
- case o:
1574
- return "right";
1575
- case n:
1576
- return "top";
1577
- case r:
1578
- return "bottom";
1579
- default:
1580
- throw new Error("unreachable");
1581
- }
1582
- }
1583
- function Er(e, t, n = 5) {
1584
- const r = [];
1585
- switch (t) {
1586
- case "top":
1587
- r.push({
1588
- x: e.x - n,
1589
- y: e.y + n
1590
- }, {
1591
- x: e.x + n,
1592
- y: e.y + n
1593
- });
1594
- break;
1595
- case "bottom":
1596
- r.push({
1597
- x: e.x - n,
1598
- y: e.y - n
1599
- }, {
1600
- x: e.x + n,
1601
- y: e.y - n
1602
- });
1603
- break;
1604
- case "left":
1605
- r.push({
1606
- x: e.x + n,
1607
- y: e.y - n
1608
- }, {
1609
- x: e.x + n,
1610
- y: e.y + n
1611
- });
1612
- break;
1613
- case "right":
1614
- r.push({
1615
- x: e.x - n,
1616
- y: e.y - n
1617
- }, {
1618
- x: e.x - n,
1619
- y: e.y + n
1620
- });
1621
- break;
1622
- }
1623
- return r;
1624
- }
1625
- function Sr(e) {
1626
- const { top: t, right: n, bottom: r, left: o } = e;
1627
- return [
1628
- {
1629
- x: o,
1630
- y: t
1631
- },
1632
- {
1633
- x: n,
1634
- y: t
1635
- },
1636
- {
1637
- x: n,
1638
- y: r
1639
- },
1640
- {
1641
- x: o,
1642
- y: r
1643
- }
1644
- ];
1645
- }
1646
- function Lr(e, t) {
1647
- const { x: n, y: r } = e;
1648
- let o = !1;
1649
- for (let i = 0, s = t.length - 1; i < t.length; s = i++) {
1650
- const c = t[i], l = t[s], u = c.x, a = c.y, d = l.x, p = l.y;
1651
- a > r != p > r && n < (d - u) * (r - a) / (p - a) + u && (o = !o);
1652
- }
1653
- return o;
1654
- }
1655
- function Dr(e) {
1656
- const t = e.slice();
1657
- return t.sort((n, r) => n.x < r.x ? -1 : n.x > r.x ? 1 : n.y < r.y ? -1 : n.y > r.y ? 1 : 0), Mr(t);
1658
- }
1659
- function Mr(e) {
1660
- if (e.length <= 1) return e.slice();
1661
- const t = [];
1662
- for (let r = 0; r < e.length; r++) {
1663
- const o = e[r];
1664
- for (; t.length >= 2; ) {
1665
- const i = t[t.length - 1], s = t[t.length - 2];
1666
- if ((i.x - s.x) * (o.y - s.y) >= (i.y - s.y) * (o.x - s.x)) t.pop();
1667
- else break;
1668
- }
1669
- t.push(o);
1670
- }
1671
- t.pop();
1672
- const n = [];
1673
- for (let r = e.length - 1; r >= 0; r--) {
1674
- const o = e[r];
1675
- for (; n.length >= 2; ) {
1676
- const i = n[n.length - 1], s = n[n.length - 2];
1677
- if ((i.x - s.x) * (o.y - s.y) >= (i.y - s.y) * (o.x - s.x)) n.pop();
1678
- else break;
1679
- }
1680
- n.push(o);
1681
- }
1682
- return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
1683
- }
1684
- var Xr = Et, Yr = St, Gr = Lt, qr = Dt, Ur = Mt, Kr = Nt;
1685
- export {
1686
- Yr as a,
1687
- Xr as i,
1688
- Ur as n,
1689
- Gr as o,
1690
- qr as r,
1691
- Kr as t
1692
- };