@gv-tech/ui-web 2.9.1 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/dist/accordion.cjs.js +1 -0
  2. package/dist/accordion.d.ts +18 -0
  3. package/dist/accordion.es.js +259 -0
  4. package/dist/alert-dialog.cjs.js +7 -0
  5. package/dist/alert-dialog.d.ts +43 -0
  6. package/dist/alert-dialog.es.js +171 -0
  7. package/dist/alert.cjs.js +1 -0
  8. package/dist/alert.d.ts +18 -0
  9. package/dist/alert.es.js +32 -0
  10. package/dist/aspect-ratio.cjs.js +1 -0
  11. package/dist/aspect-ratio.d.ts +10 -0
  12. package/dist/aspect-ratio.es.js +43 -0
  13. package/dist/avatar.cjs.js +1 -0
  14. package/dist/avatar.d.ts +15 -0
  15. package/dist/avatar.es.js +205 -0
  16. package/dist/badge.cjs.js +1 -0
  17. package/dist/badge.d.ts +16 -0
  18. package/dist/badge.es.js +26 -0
  19. package/dist/breadcrumb.cjs.js +1 -0
  20. package/dist/breadcrumb.d.ts +35 -0
  21. package/dist/breadcrumb.es.js +69 -0
  22. package/dist/button.cjs.js +1 -0
  23. package/dist/button.d.ts +17 -0
  24. package/dist/button.es.js +40 -0
  25. package/dist/calendar.cjs.js +1 -0
  26. package/dist/calendar.d.ts +29 -0
  27. package/dist/calendar.es.js +2976 -0
  28. package/dist/card.cjs.js +1 -0
  29. package/dist/card.d.ts +19 -0
  30. package/dist/card.es.js +33 -0
  31. package/dist/carousel.cjs.js +1 -0
  32. package/dist/carousel.d.ts +50 -0
  33. package/dist/carousel.es.js +1403 -0
  34. package/dist/chart.cjs.js +16 -0
  35. package/dist/chart.d.ts +60 -0
  36. package/dist/chart.es.js +4402 -0
  37. package/dist/checkbox.cjs.js +1 -0
  38. package/dist/checkbox.d.ts +10 -0
  39. package/dist/checkbox.es.js +258 -0
  40. package/dist/collapsible.cjs.js +1 -0
  41. package/dist/collapsible.d.ts +20 -0
  42. package/dist/collapsible.es.js +7 -0
  43. package/dist/command.cjs.js +1 -0
  44. package/dist/command.d.ts +115 -0
  45. package/dist/command.es.js +396 -0
  46. package/dist/context-menu.cjs.js +1 -0
  47. package/dist/context-menu.d.ts +80 -0
  48. package/dist/context-menu.es.js +328 -0
  49. package/dist/dialog.cjs.js +1 -0
  50. package/dist/dialog.d.ts +31 -0
  51. package/dist/dialog.es.js +66 -0
  52. package/dist/drawer.cjs.js +3 -0
  53. package/dist/drawer.d.ts +65 -0
  54. package/dist/drawer.es.js +1085 -0
  55. package/dist/dropdown-menu.cjs.js +1 -0
  56. package/dist/dropdown-menu.d.ts +80 -0
  57. package/dist/dropdown-menu.es.js +316 -0
  58. package/dist/form.cjs.js +1 -0
  59. package/dist/form.d.ts +53 -0
  60. package/dist/form.es.js +355 -0
  61. package/dist/hover-card.cjs.js +1 -0
  62. package/dist/hover-card.d.ts +19 -0
  63. package/dist/hover-card.es.js +188 -0
  64. package/dist/index-0ioNhtNM.mjs +10 -0
  65. package/dist/index-3j-XAIXT.mjs +55 -0
  66. package/dist/index-B2XtpfGY.js +1 -0
  67. package/dist/index-B39Lzq0v.js +1 -0
  68. package/dist/index-B7n6fy75.js +1 -0
  69. package/dist/index-B8dxbSWX.js +41 -0
  70. package/dist/index-BGIK9FQF.js +1 -0
  71. package/dist/index-BZPx6jYI.mjs +8 -0
  72. package/dist/index-BoNjHhm4.js +1 -0
  73. package/dist/index-BtZvtDmp.js +1 -0
  74. package/dist/index-Bv7qrYW6.mjs +180 -0
  75. package/dist/index-ByiPJW53.js +5 -0
  76. package/dist/index-C0dlIQIi.js +1 -0
  77. package/dist/index-C1qb0595.mjs +27 -0
  78. package/dist/index-C7HEunrh.mjs +15 -0
  79. package/dist/index-C8ni3LLa.js +1 -0
  80. package/dist/index-CCKe-Mpx.mjs +6 -0
  81. package/dist/index-CD6_IrA-.mjs +10 -0
  82. package/dist/index-CRyCZJLa.mjs +677 -0
  83. package/dist/index-CVx1AgNG.mjs +615 -0
  84. package/dist/index-Ce5TOFAK.js +1 -0
  85. package/dist/index-CeSLNJ60.mjs +32 -0
  86. package/dist/index-CefEQe_4.js +1 -0
  87. package/dist/index-Cj5hzyBi.js +1 -0
  88. package/dist/index-Cjj_rUPu.js +1 -0
  89. package/dist/index-Cl3G0jzM.js +1 -0
  90. package/dist/index-CsjrqSSN.js +1 -0
  91. package/dist/index-CwfE56Ep.mjs +1545 -0
  92. package/dist/index-CwyAfCwY.js +1 -0
  93. package/dist/index-CzY-WZXL.js +1 -0
  94. package/dist/index-D2HnlO3y.js +1 -0
  95. package/dist/index-DAWHN3cH.mjs +85 -0
  96. package/dist/index-DFdF7K7v.mjs +50 -0
  97. package/dist/index-DIsg7zU7.js +1 -0
  98. package/dist/index-DKN_vhyX.mjs +32 -0
  99. package/dist/index-DLcqcWxM.mjs +29 -0
  100. package/dist/index-DSxf1gN6.mjs +118 -0
  101. package/dist/index-DYxWvftI.js +1 -0
  102. package/dist/index-DaILh3TV.mjs +32 -0
  103. package/dist/index-Dfzl8TxY.mjs +136 -0
  104. package/dist/index-Dko2XdTk.js +1 -0
  105. package/dist/index-DlY82G31.mjs +245 -0
  106. package/dist/index-DnFcfnA9.mjs +13 -0
  107. package/dist/index-IZ2gq03c.mjs +68 -0
  108. package/dist/index-K9FzbxYw.mjs +93 -0
  109. package/dist/index-Le8p9oP4.mjs +60 -0
  110. package/dist/index-MQ0c3ZX_.js +1 -0
  111. package/dist/index-_XxjJPRD.js +1 -0
  112. package/dist/index-_wdrnYim.js +1 -0
  113. package/dist/index-jv3B4mTd.js +1 -0
  114. package/dist/index-kaM0u2Q1.js +1 -0
  115. package/dist/index-p6xVFRb4.mjs +52 -0
  116. package/dist/index-rKs9bXHr.mjs +6 -0
  117. package/dist/index-vuPgkS0V.mjs +70 -0
  118. package/dist/index.cjs.js +1 -0
  119. package/dist/index.d.ts +1288 -0
  120. package/dist/index.es.js +289 -0
  121. package/dist/input.cjs.js +1 -0
  122. package/dist/input.d.ts +9 -0
  123. package/dist/input.es.js +19 -0
  124. package/dist/jsx-runtime-nZSsnGb7.js +6 -0
  125. package/dist/jsx-runtime-tc70JA_2.mjs +264 -0
  126. package/dist/label.cjs.js +1 -0
  127. package/dist/label.d.ts +11 -0
  128. package/dist/label.es.js +22 -0
  129. package/dist/menubar.cjs.js +1 -0
  130. package/dist/menubar.d.ts +79 -0
  131. package/dist/menubar.es.js +473 -0
  132. package/dist/navigation-menu.cjs.js +1 -0
  133. package/dist/navigation-menu.d.ts +47 -0
  134. package/dist/navigation-menu.es.js +673 -0
  135. package/dist/pagination.cjs.js +1 -0
  136. package/dist/pagination.d.ts +68 -0
  137. package/dist/pagination.es.js +68 -0
  138. package/dist/popover.cjs.js +1 -0
  139. package/dist/popover.d.ts +24 -0
  140. package/dist/popover.es.js +242 -0
  141. package/dist/progress.cjs.js +6 -0
  142. package/dist/progress.d.ts +9 -0
  143. package/dist/progress.es.js +99 -0
  144. package/dist/radio-group.cjs.js +1 -0
  145. package/dist/radio-group.d.ts +16 -0
  146. package/dist/radio-group.es.js +253 -0
  147. package/dist/resizable.cjs.js +1 -0
  148. package/dist/resizable.d.ts +22 -0
  149. package/dist/resizable.es.js +1990 -0
  150. package/dist/scroll-area.cjs.js +1 -0
  151. package/dist/scroll-area.d.ts +14 -0
  152. package/dist/scroll-area.es.js +546 -0
  153. package/dist/search.cjs.js +1 -0
  154. package/dist/search.d.ts +15 -0
  155. package/dist/search.es.js +51 -0
  156. package/dist/select.cjs.js +1 -0
  157. package/dist/select.d.ts +54 -0
  158. package/dist/select.es.js +908 -0
  159. package/dist/separator.cjs.js +1 -0
  160. package/dist/separator.d.ts +9 -0
  161. package/dist/separator.es.js +35 -0
  162. package/dist/sheet.cjs.js +1 -0
  163. package/dist/sheet.d.ts +68 -0
  164. package/dist/sheet.es.js +66 -0
  165. package/dist/skeleton.cjs.js +1 -0
  166. package/dist/skeleton.d.ts +9 -0
  167. package/dist/skeleton.es.js +8 -0
  168. package/dist/slider.cjs.js +1 -0
  169. package/dist/slider.d.ts +9 -0
  170. package/dist/slider.es.js +442 -0
  171. package/dist/sonner.cjs.js +1 -0
  172. package/dist/sonner.d.ts +10 -0
  173. package/dist/sonner.es.js +764 -0
  174. package/dist/switch.cjs.js +1 -0
  175. package/dist/switch.d.ts +9 -0
  176. package/dist/switch.es.js +149 -0
  177. package/dist/table.cjs.js +1 -0
  178. package/dist/table.d.ts +43 -0
  179. package/dist/table.es.js +57 -0
  180. package/dist/tabs.cjs.js +1 -0
  181. package/dist/tabs.d.ts +24 -0
  182. package/dist/tabs.es.js +195 -0
  183. package/dist/text.cjs.js +1 -0
  184. package/dist/text.d.ts +17 -0
  185. package/dist/text.es.js +42 -0
  186. package/dist/textarea.cjs.js +1 -0
  187. package/dist/textarea.d.ts +9 -0
  188. package/dist/textarea.es.js +18 -0
  189. package/dist/theme-provider.cjs.js +1 -0
  190. package/dist/theme-provider.d.ts +9 -0
  191. package/dist/theme-provider.es.js +8 -0
  192. package/dist/theme-toggle.cjs.js +1 -0
  193. package/dist/theme-toggle.d.ts +8 -0
  194. package/dist/theme-toggle.es.js +78 -0
  195. package/dist/toast.cjs.js +1 -0
  196. package/dist/toast.d.ts +26 -0
  197. package/dist/toast.es.js +494 -0
  198. package/dist/toaster-CIpfms4W.js +1 -0
  199. package/dist/toaster-jBYXAPRk.mjs +118 -0
  200. package/dist/toaster.cjs.js +1 -0
  201. package/dist/toaster.d.ts +6 -0
  202. package/dist/toaster.es.js +6 -0
  203. package/dist/toggle-group.cjs.js +1 -0
  204. package/dist/toggle-group.d.ts +18 -0
  205. package/dist/toggle-group.es.js +170 -0
  206. package/dist/toggle.cjs.js +1 -0
  207. package/dist/toggle.d.ts +14 -0
  208. package/dist/toggle.es.js +14 -0
  209. package/dist/tooltip.cjs.js +1 -0
  210. package/dist/tooltip.d.ts +25 -0
  211. package/dist/tooltip.es.js +342 -0
  212. package/dist/utils-B6yFEsav.mjs +8 -0
  213. package/dist/utils-IjLH3w2e.js +1 -0
  214. package/package.json +1 -1
@@ -0,0 +1,764 @@
1
+ import { j as Ut } from "./jsx-runtime-tc70JA_2.mjs";
2
+ import { z as Xt } from "./index-DAWHN3cH.mjs";
3
+ import a from "react";
4
+ import Wt from "react-dom";
5
+ function Kt(r) {
6
+ if (typeof document > "u") return;
7
+ let o = document.head || document.getElementsByTagName("head")[0], e = document.createElement("style");
8
+ e.type = "text/css", o.appendChild(e), e.styleSheet ? e.styleSheet.cssText = r : e.appendChild(document.createTextNode(r));
9
+ }
10
+ const qt = (r) => {
11
+ switch (r) {
12
+ case "success":
13
+ return Jt;
14
+ case "info":
15
+ return te;
16
+ case "warning":
17
+ return Zt;
18
+ case "error":
19
+ return ee;
20
+ default:
21
+ return null;
22
+ }
23
+ }, Gt = Array(12).fill(0), Qt = ({ visible: r, className: o }) => /* @__PURE__ */ a.createElement("div", {
24
+ className: [
25
+ "sonner-loading-wrapper",
26
+ o
27
+ ].filter(Boolean).join(" "),
28
+ "data-visible": r
29
+ }, /* @__PURE__ */ a.createElement("div", {
30
+ className: "sonner-spinner"
31
+ }, Gt.map((e, s) => /* @__PURE__ */ a.createElement("div", {
32
+ className: "sonner-loading-bar",
33
+ key: `spinner-bar-${s}`
34
+ })))), Jt = /* @__PURE__ */ a.createElement("svg", {
35
+ xmlns: "http://www.w3.org/2000/svg",
36
+ viewBox: "0 0 20 20",
37
+ fill: "currentColor",
38
+ height: "20",
39
+ width: "20"
40
+ }, /* @__PURE__ */ a.createElement("path", {
41
+ fillRule: "evenodd",
42
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
43
+ clipRule: "evenodd"
44
+ })), Zt = /* @__PURE__ */ a.createElement("svg", {
45
+ xmlns: "http://www.w3.org/2000/svg",
46
+ viewBox: "0 0 24 24",
47
+ fill: "currentColor",
48
+ height: "20",
49
+ width: "20"
50
+ }, /* @__PURE__ */ a.createElement("path", {
51
+ fillRule: "evenodd",
52
+ d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
53
+ clipRule: "evenodd"
54
+ })), te = /* @__PURE__ */ a.createElement("svg", {
55
+ xmlns: "http://www.w3.org/2000/svg",
56
+ viewBox: "0 0 20 20",
57
+ fill: "currentColor",
58
+ height: "20",
59
+ width: "20"
60
+ }, /* @__PURE__ */ a.createElement("path", {
61
+ fillRule: "evenodd",
62
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
63
+ clipRule: "evenodd"
64
+ })), ee = /* @__PURE__ */ a.createElement("svg", {
65
+ xmlns: "http://www.w3.org/2000/svg",
66
+ viewBox: "0 0 20 20",
67
+ fill: "currentColor",
68
+ height: "20",
69
+ width: "20"
70
+ }, /* @__PURE__ */ a.createElement("path", {
71
+ fillRule: "evenodd",
72
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
73
+ clipRule: "evenodd"
74
+ })), ae = /* @__PURE__ */ a.createElement("svg", {
75
+ xmlns: "http://www.w3.org/2000/svg",
76
+ width: "12",
77
+ height: "12",
78
+ viewBox: "0 0 24 24",
79
+ fill: "none",
80
+ stroke: "currentColor",
81
+ strokeWidth: "1.5",
82
+ strokeLinecap: "round",
83
+ strokeLinejoin: "round"
84
+ }, /* @__PURE__ */ a.createElement("line", {
85
+ x1: "18",
86
+ y1: "6",
87
+ x2: "6",
88
+ y2: "18"
89
+ }), /* @__PURE__ */ a.createElement("line", {
90
+ x1: "6",
91
+ y1: "6",
92
+ x2: "18",
93
+ y2: "18"
94
+ })), oe = () => {
95
+ const [r, o] = a.useState(document.hidden);
96
+ return a.useEffect(() => {
97
+ const e = () => {
98
+ o(document.hidden);
99
+ };
100
+ return document.addEventListener("visibilitychange", e), () => window.removeEventListener("visibilitychange", e);
101
+ }, []), r;
102
+ };
103
+ let wt = 1;
104
+ class se {
105
+ constructor() {
106
+ this.subscribe = (o) => (this.subscribers.push(o), () => {
107
+ const e = this.subscribers.indexOf(o);
108
+ this.subscribers.splice(e, 1);
109
+ }), this.publish = (o) => {
110
+ this.subscribers.forEach((e) => e(o));
111
+ }, this.addToast = (o) => {
112
+ this.publish(o), this.toasts = [
113
+ ...this.toasts,
114
+ o
115
+ ];
116
+ }, this.create = (o) => {
117
+ var e;
118
+ const { message: s, ...C } = o, u = typeof o?.id == "number" || ((e = o.id) == null ? void 0 : e.length) > 0 ? o.id : wt++, g = this.toasts.find((b) => b.id === u), _ = o.dismissible === void 0 ? !0 : o.dismissible;
119
+ return this.dismissedToasts.has(u) && this.dismissedToasts.delete(u), g ? this.toasts = this.toasts.map((b) => b.id === u ? (this.publish({
120
+ ...b,
121
+ ...o,
122
+ id: u,
123
+ title: s
124
+ }), {
125
+ ...b,
126
+ ...o,
127
+ id: u,
128
+ dismissible: _,
129
+ title: s
130
+ }) : b) : this.addToast({
131
+ title: s,
132
+ ...C,
133
+ dismissible: _,
134
+ id: u
135
+ }), u;
136
+ }, this.dismiss = (o) => (o ? (this.dismissedToasts.add(o), requestAnimationFrame(() => this.subscribers.forEach((e) => e({
137
+ id: o,
138
+ dismiss: !0
139
+ })))) : this.toasts.forEach((e) => {
140
+ this.subscribers.forEach((s) => s({
141
+ id: e.id,
142
+ dismiss: !0
143
+ }));
144
+ }), o), this.message = (o, e) => this.create({
145
+ ...e,
146
+ message: o
147
+ }), this.error = (o, e) => this.create({
148
+ ...e,
149
+ message: o,
150
+ type: "error"
151
+ }), this.success = (o, e) => this.create({
152
+ ...e,
153
+ type: "success",
154
+ message: o
155
+ }), this.info = (o, e) => this.create({
156
+ ...e,
157
+ type: "info",
158
+ message: o
159
+ }), this.warning = (o, e) => this.create({
160
+ ...e,
161
+ type: "warning",
162
+ message: o
163
+ }), this.loading = (o, e) => this.create({
164
+ ...e,
165
+ type: "loading",
166
+ message: o
167
+ }), this.promise = (o, e) => {
168
+ if (!e)
169
+ return;
170
+ let s;
171
+ e.loading !== void 0 && (s = this.create({
172
+ ...e,
173
+ promise: o,
174
+ type: "loading",
175
+ message: e.loading,
176
+ description: typeof e.description != "function" ? e.description : void 0
177
+ }));
178
+ const C = Promise.resolve(o instanceof Function ? o() : o);
179
+ let u = s !== void 0, g;
180
+ const _ = C.then(async (i) => {
181
+ if (g = [
182
+ "resolve",
183
+ i
184
+ ], a.isValidElement(i))
185
+ u = !1, this.create({
186
+ id: s,
187
+ type: "default",
188
+ message: i
189
+ });
190
+ else if (re(i) && !i.ok) {
191
+ u = !1;
192
+ const t = typeof e.error == "function" ? await e.error(`HTTP error! status: ${i.status}`) : e.error, w = typeof e.description == "function" ? await e.description(`HTTP error! status: ${i.status}`) : e.description, E = typeof t == "object" && !a.isValidElement(t) ? t : {
193
+ message: t
194
+ };
195
+ this.create({
196
+ id: s,
197
+ type: "error",
198
+ description: w,
199
+ ...E
200
+ });
201
+ } else if (i instanceof Error) {
202
+ u = !1;
203
+ const t = typeof e.error == "function" ? await e.error(i) : e.error, w = typeof e.description == "function" ? await e.description(i) : e.description, E = typeof t == "object" && !a.isValidElement(t) ? t : {
204
+ message: t
205
+ };
206
+ this.create({
207
+ id: s,
208
+ type: "error",
209
+ description: w,
210
+ ...E
211
+ });
212
+ } else if (e.success !== void 0) {
213
+ u = !1;
214
+ const t = typeof e.success == "function" ? await e.success(i) : e.success, w = typeof e.description == "function" ? await e.description(i) : e.description, E = typeof t == "object" && !a.isValidElement(t) ? t : {
215
+ message: t
216
+ };
217
+ this.create({
218
+ id: s,
219
+ type: "success",
220
+ description: w,
221
+ ...E
222
+ });
223
+ }
224
+ }).catch(async (i) => {
225
+ if (g = [
226
+ "reject",
227
+ i
228
+ ], e.error !== void 0) {
229
+ u = !1;
230
+ const T = typeof e.error == "function" ? await e.error(i) : e.error, t = typeof e.description == "function" ? await e.description(i) : e.description, O = typeof T == "object" && !a.isValidElement(T) ? T : {
231
+ message: T
232
+ };
233
+ this.create({
234
+ id: s,
235
+ type: "error",
236
+ description: t,
237
+ ...O
238
+ });
239
+ }
240
+ }).finally(() => {
241
+ u && (this.dismiss(s), s = void 0), e.finally == null || e.finally.call(e);
242
+ }), b = () => new Promise((i, T) => _.then(() => g[0] === "reject" ? T(g[1]) : i(g[1])).catch(T));
243
+ return typeof s != "string" && typeof s != "number" ? {
244
+ unwrap: b
245
+ } : Object.assign(s, {
246
+ unwrap: b
247
+ });
248
+ }, this.custom = (o, e) => {
249
+ const s = e?.id || wt++;
250
+ return this.create({
251
+ jsx: o(s),
252
+ id: s,
253
+ ...e
254
+ }), s;
255
+ }, this.getActiveToasts = () => this.toasts.filter((o) => !this.dismissedToasts.has(o.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
256
+ }
257
+ }
258
+ const S = new se(), ne = (r, o) => {
259
+ const e = o?.id || wt++;
260
+ return S.addToast({
261
+ title: r,
262
+ ...o,
263
+ id: e
264
+ }), e;
265
+ }, re = (r) => r && typeof r == "object" && "ok" in r && typeof r.ok == "boolean" && "status" in r && typeof r.status == "number", ie = ne, le = () => S.toasts, de = () => S.getActiveToasts();
266
+ Object.assign(ie, {
267
+ success: S.success,
268
+ info: S.info,
269
+ warning: S.warning,
270
+ error: S.error,
271
+ custom: S.custom,
272
+ message: S.message,
273
+ promise: S.promise,
274
+ dismiss: S.dismiss,
275
+ loading: S.loading
276
+ }, {
277
+ getHistory: le,
278
+ getToasts: de
279
+ });
280
+ Kt("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
281
+ function mt(r) {
282
+ return r.label !== void 0;
283
+ }
284
+ const ce = 3, ue = "24px", fe = "16px", Mt = 4e3, me = 356, pe = 14, ge = 45, he = 200;
285
+ function H(...r) {
286
+ return r.filter(Boolean).join(" ");
287
+ }
288
+ function be(r) {
289
+ const [o, e] = r.split("-"), s = [];
290
+ return o && s.push(o), e && s.push(e), s;
291
+ }
292
+ const ve = (r) => {
293
+ var o, e, s, C, u, g, _, b, i;
294
+ const { invert: T, toast: t, unstyled: w, interacting: O, setHeights: E, visibleToasts: pt, heights: U, index: d, toasts: ot, expanded: X, removeToast: st, defaultRichColors: gt, closeButton: z, style: Z, cancelButtonStyle: Y, actionButtonStyle: ht, className: nt = "", descriptionClassName: bt = "", duration: tt, position: A, gap: rt, expandByDefault: et, classNames: c, icons: v, closeButtonAriaLabel: P = "Close toast" } = r, [$, B] = a.useState(null), [F, it] = a.useState(null), [l, p] = a.useState(!1), [m, D] = a.useState(!1), [W, f] = a.useState(!1), [K, lt] = a.useState(!1), [dt, q] = a.useState(!1), [Ct, vt] = a.useState(0), [At, Et] = a.useState(0), at = a.useRef(t.duration || tt || Mt), Tt = a.useRef(null), j = a.useRef(null), Ht = d === 0, Ot = d + 1 <= pt, N = t.type, G = t.dismissible !== !1, zt = t.className || "", jt = t.descriptionClassName || "", ct = a.useMemo(() => U.findIndex((n) => n.toastId === t.id) || 0, [
295
+ U,
296
+ t.id
297
+ ]), Pt = a.useMemo(() => {
298
+ var n;
299
+ return (n = t.closeButton) != null ? n : z;
300
+ }, [
301
+ t.closeButton,
302
+ z
303
+ ]), St = a.useMemo(() => t.duration || tt || Mt, [
304
+ t.duration,
305
+ tt
306
+ ]), yt = a.useRef(0), Q = a.useRef(0), Nt = a.useRef(0), J = a.useRef(null), [Lt, Yt] = A.split("-"), kt = a.useMemo(() => U.reduce((n, h, x) => x >= ct ? n : n + h.height, 0), [
307
+ U,
308
+ ct
309
+ ]), _t = oe(), $t = t.invert || T, xt = N === "loading";
310
+ Q.current = a.useMemo(() => ct * rt + kt, [
311
+ ct,
312
+ kt
313
+ ]), a.useEffect(() => {
314
+ at.current = St;
315
+ }, [
316
+ St
317
+ ]), a.useEffect(() => {
318
+ p(!0);
319
+ }, []), a.useEffect(() => {
320
+ const n = j.current;
321
+ if (n) {
322
+ const h = n.getBoundingClientRect().height;
323
+ return Et(h), E((x) => [
324
+ {
325
+ toastId: t.id,
326
+ height: h,
327
+ position: t.position
328
+ },
329
+ ...x
330
+ ]), () => E((x) => x.filter((k) => k.toastId !== t.id));
331
+ }
332
+ }, [
333
+ E,
334
+ t.id
335
+ ]), a.useLayoutEffect(() => {
336
+ if (!l) return;
337
+ const n = j.current, h = n.style.height;
338
+ n.style.height = "auto";
339
+ const x = n.getBoundingClientRect().height;
340
+ n.style.height = h, Et(x), E((k) => k.find((y) => y.toastId === t.id) ? k.map((y) => y.toastId === t.id ? {
341
+ ...y,
342
+ height: x
343
+ } : y) : [
344
+ {
345
+ toastId: t.id,
346
+ height: x,
347
+ position: t.position
348
+ },
349
+ ...k
350
+ ]);
351
+ }, [
352
+ l,
353
+ t.title,
354
+ t.description,
355
+ E,
356
+ t.id,
357
+ t.jsx,
358
+ t.action,
359
+ t.cancel
360
+ ]);
361
+ const L = a.useCallback(() => {
362
+ D(!0), vt(Q.current), E((n) => n.filter((h) => h.toastId !== t.id)), setTimeout(() => {
363
+ st(t);
364
+ }, he);
365
+ }, [
366
+ t,
367
+ st,
368
+ E,
369
+ Q
370
+ ]);
371
+ a.useEffect(() => {
372
+ if (t.promise && N === "loading" || t.duration === 1 / 0 || t.type === "loading") return;
373
+ let n;
374
+ return X || O || _t ? (() => {
375
+ if (Nt.current < yt.current) {
376
+ const k = (/* @__PURE__ */ new Date()).getTime() - yt.current;
377
+ at.current = at.current - k;
378
+ }
379
+ Nt.current = (/* @__PURE__ */ new Date()).getTime();
380
+ })() : at.current !== 1 / 0 && (yt.current = (/* @__PURE__ */ new Date()).getTime(), n = setTimeout(() => {
381
+ t.onAutoClose == null || t.onAutoClose.call(t, t), L();
382
+ }, at.current)), () => clearTimeout(n);
383
+ }, [
384
+ X,
385
+ O,
386
+ t,
387
+ N,
388
+ _t,
389
+ L
390
+ ]), a.useEffect(() => {
391
+ t.delete && (L(), t.onDismiss == null || t.onDismiss.call(t, t));
392
+ }, [
393
+ L,
394
+ t.delete
395
+ ]);
396
+ function Ft() {
397
+ var n;
398
+ if (v?.loading) {
399
+ var h;
400
+ return /* @__PURE__ */ a.createElement("div", {
401
+ className: H(c?.loader, t == null || (h = t.classNames) == null ? void 0 : h.loader, "sonner-loader"),
402
+ "data-visible": N === "loading"
403
+ }, v.loading);
404
+ }
405
+ return /* @__PURE__ */ a.createElement(Qt, {
406
+ className: H(c?.loader, t == null || (n = t.classNames) == null ? void 0 : n.loader),
407
+ visible: N === "loading"
408
+ });
409
+ }
410
+ const Vt = t.icon || v?.[N] || qt(N);
411
+ var Dt, Rt;
412
+ return /* @__PURE__ */ a.createElement("li", {
413
+ tabIndex: 0,
414
+ ref: j,
415
+ className: H(nt, zt, c?.toast, t == null || (o = t.classNames) == null ? void 0 : o.toast, c?.default, c?.[N], t == null || (e = t.classNames) == null ? void 0 : e[N]),
416
+ "data-sonner-toast": "",
417
+ "data-rich-colors": (Dt = t.richColors) != null ? Dt : gt,
418
+ "data-styled": !(t.jsx || t.unstyled || w),
419
+ "data-mounted": l,
420
+ "data-promise": !!t.promise,
421
+ "data-swiped": dt,
422
+ "data-removed": m,
423
+ "data-visible": Ot,
424
+ "data-y-position": Lt,
425
+ "data-x-position": Yt,
426
+ "data-index": d,
427
+ "data-front": Ht,
428
+ "data-swiping": W,
429
+ "data-dismissible": G,
430
+ "data-type": N,
431
+ "data-invert": $t,
432
+ "data-swipe-out": K,
433
+ "data-swipe-direction": F,
434
+ "data-expanded": !!(X || et && l),
435
+ "data-testid": t.testId,
436
+ style: {
437
+ "--index": d,
438
+ "--toasts-before": d,
439
+ "--z-index": ot.length - d,
440
+ "--offset": `${m ? Ct : Q.current}px`,
441
+ "--initial-height": et ? "auto" : `${At}px`,
442
+ ...Z,
443
+ ...t.style
444
+ },
445
+ onDragEnd: () => {
446
+ f(!1), B(null), J.current = null;
447
+ },
448
+ onPointerDown: (n) => {
449
+ n.button !== 2 && (xt || !G || (Tt.current = /* @__PURE__ */ new Date(), vt(Q.current), n.target.setPointerCapture(n.pointerId), n.target.tagName !== "BUTTON" && (f(!0), J.current = {
450
+ x: n.clientX,
451
+ y: n.clientY
452
+ })));
453
+ },
454
+ onPointerUp: () => {
455
+ var n, h, x;
456
+ if (K || !G) return;
457
+ J.current = null;
458
+ const k = Number(((n = j.current) == null ? void 0 : n.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), ut = Number(((h = j.current) == null ? void 0 : h.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), y = (/* @__PURE__ */ new Date()).getTime() - ((x = Tt.current) == null ? void 0 : x.getTime()), R = $ === "x" ? k : ut, ft = Math.abs(R) / y;
459
+ if (Math.abs(R) >= ge || ft > 0.11) {
460
+ vt(Q.current), t.onDismiss == null || t.onDismiss.call(t, t), it($ === "x" ? k > 0 ? "right" : "left" : ut > 0 ? "down" : "up"), L(), lt(!0);
461
+ return;
462
+ } else {
463
+ var M, I;
464
+ (M = j.current) == null || M.style.setProperty("--swipe-amount-x", "0px"), (I = j.current) == null || I.style.setProperty("--swipe-amount-y", "0px");
465
+ }
466
+ q(!1), f(!1), B(null);
467
+ },
468
+ onPointerMove: (n) => {
469
+ var h, x, k;
470
+ if (!J.current || !G || ((h = window.getSelection()) == null ? void 0 : h.toString().length) > 0) return;
471
+ const y = n.clientY - J.current.y, R = n.clientX - J.current.x;
472
+ var ft;
473
+ const M = (ft = r.swipeDirections) != null ? ft : be(A);
474
+ !$ && (Math.abs(R) > 1 || Math.abs(y) > 1) && B(Math.abs(R) > Math.abs(y) ? "x" : "y");
475
+ let I = {
476
+ x: 0,
477
+ y: 0
478
+ };
479
+ const Bt = (V) => 1 / (1.5 + Math.abs(V) / 20);
480
+ if ($ === "y") {
481
+ if (M.includes("top") || M.includes("bottom"))
482
+ if (M.includes("top") && y < 0 || M.includes("bottom") && y > 0)
483
+ I.y = y;
484
+ else {
485
+ const V = y * Bt(y);
486
+ I.y = Math.abs(V) < Math.abs(y) ? V : y;
487
+ }
488
+ } else if ($ === "x" && (M.includes("left") || M.includes("right")))
489
+ if (M.includes("left") && R < 0 || M.includes("right") && R > 0)
490
+ I.x = R;
491
+ else {
492
+ const V = R * Bt(R);
493
+ I.x = Math.abs(V) < Math.abs(R) ? V : R;
494
+ }
495
+ (Math.abs(I.x) > 0 || Math.abs(I.y) > 0) && q(!0), (x = j.current) == null || x.style.setProperty("--swipe-amount-x", `${I.x}px`), (k = j.current) == null || k.style.setProperty("--swipe-amount-y", `${I.y}px`);
496
+ }
497
+ }, Pt && !t.jsx && N !== "loading" ? /* @__PURE__ */ a.createElement("button", {
498
+ "aria-label": P,
499
+ "data-disabled": xt,
500
+ "data-close-button": !0,
501
+ onClick: xt || !G ? () => {
502
+ } : () => {
503
+ L(), t.onDismiss == null || t.onDismiss.call(t, t);
504
+ },
505
+ className: H(c?.closeButton, t == null || (s = t.classNames) == null ? void 0 : s.closeButton)
506
+ }, (Rt = v?.close) != null ? Rt : ae) : null, (N || t.icon || t.promise) && t.icon !== null && (v?.[N] !== null || t.icon) ? /* @__PURE__ */ a.createElement("div", {
507
+ "data-icon": "",
508
+ className: H(c?.icon, t == null || (C = t.classNames) == null ? void 0 : C.icon)
509
+ }, t.promise || t.type === "loading" && !t.icon ? t.icon || Ft() : null, t.type !== "loading" ? Vt : null) : null, /* @__PURE__ */ a.createElement("div", {
510
+ "data-content": "",
511
+ className: H(c?.content, t == null || (u = t.classNames) == null ? void 0 : u.content)
512
+ }, /* @__PURE__ */ a.createElement("div", {
513
+ "data-title": "",
514
+ className: H(c?.title, t == null || (g = t.classNames) == null ? void 0 : g.title)
515
+ }, t.jsx ? t.jsx : typeof t.title == "function" ? t.title() : t.title), t.description ? /* @__PURE__ */ a.createElement("div", {
516
+ "data-description": "",
517
+ className: H(bt, jt, c?.description, t == null || (_ = t.classNames) == null ? void 0 : _.description)
518
+ }, typeof t.description == "function" ? t.description() : t.description) : null), /* @__PURE__ */ a.isValidElement(t.cancel) ? t.cancel : t.cancel && mt(t.cancel) ? /* @__PURE__ */ a.createElement("button", {
519
+ "data-button": !0,
520
+ "data-cancel": !0,
521
+ style: t.cancelButtonStyle || Y,
522
+ onClick: (n) => {
523
+ mt(t.cancel) && G && (t.cancel.onClick == null || t.cancel.onClick.call(t.cancel, n), L());
524
+ },
525
+ className: H(c?.cancelButton, t == null || (b = t.classNames) == null ? void 0 : b.cancelButton)
526
+ }, t.cancel.label) : null, /* @__PURE__ */ a.isValidElement(t.action) ? t.action : t.action && mt(t.action) ? /* @__PURE__ */ a.createElement("button", {
527
+ "data-button": !0,
528
+ "data-action": !0,
529
+ style: t.actionButtonStyle || ht,
530
+ onClick: (n) => {
531
+ mt(t.action) && (t.action.onClick == null || t.action.onClick.call(t.action, n), !n.defaultPrevented && L());
532
+ },
533
+ className: H(c?.actionButton, t == null || (i = t.classNames) == null ? void 0 : i.actionButton)
534
+ }, t.action.label) : null);
535
+ };
536
+ function It() {
537
+ if (typeof window > "u" || typeof document > "u") return "ltr";
538
+ const r = document.documentElement.getAttribute("dir");
539
+ return r === "auto" || !r ? window.getComputedStyle(document.documentElement).direction : r;
540
+ }
541
+ function ye(r, o) {
542
+ const e = {};
543
+ return [
544
+ r,
545
+ o
546
+ ].forEach((s, C) => {
547
+ const u = C === 1, g = u ? "--mobile-offset" : "--offset", _ = u ? fe : ue;
548
+ function b(i) {
549
+ [
550
+ "top",
551
+ "right",
552
+ "bottom",
553
+ "left"
554
+ ].forEach((T) => {
555
+ e[`${g}-${T}`] = typeof i == "number" ? `${i}px` : i;
556
+ });
557
+ }
558
+ typeof s == "number" || typeof s == "string" ? b(s) : typeof s == "object" ? [
559
+ "top",
560
+ "right",
561
+ "bottom",
562
+ "left"
563
+ ].forEach((i) => {
564
+ s[i] === void 0 ? e[`${g}-${i}`] = _ : e[`${g}-${i}`] = typeof s[i] == "number" ? `${s[i]}px` : s[i];
565
+ }) : b(_);
566
+ }), e;
567
+ }
568
+ const xe = /* @__PURE__ */ a.forwardRef(function(o, e) {
569
+ const { id: s, invert: C, position: u = "bottom-right", hotkey: g = [
570
+ "altKey",
571
+ "KeyT"
572
+ ], expand: _, closeButton: b, className: i, offset: T, mobileOffset: t, theme: w = "light", richColors: O, duration: E, style: pt, visibleToasts: U = ce, toastOptions: d, dir: ot = It(), gap: X = pe, icons: st, containerAriaLabel: gt = "Notifications" } = o, [z, Z] = a.useState([]), Y = a.useMemo(() => s ? z.filter((l) => l.toasterId === s) : z.filter((l) => !l.toasterId), [
573
+ z,
574
+ s
575
+ ]), ht = a.useMemo(() => Array.from(new Set([
576
+ u
577
+ ].concat(Y.filter((l) => l.position).map((l) => l.position)))), [
578
+ Y,
579
+ u
580
+ ]), [nt, bt] = a.useState([]), [tt, A] = a.useState(!1), [rt, et] = a.useState(!1), [c, v] = a.useState(w !== "system" ? w : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), P = a.useRef(null), $ = g.join("+").replace(/Key/g, "").replace(/Digit/g, ""), B = a.useRef(null), F = a.useRef(!1), it = a.useCallback((l) => {
581
+ Z((p) => {
582
+ var m;
583
+ return (m = p.find((D) => D.id === l.id)) != null && m.delete || S.dismiss(l.id), p.filter(({ id: D }) => D !== l.id);
584
+ });
585
+ }, []);
586
+ return a.useEffect(() => S.subscribe((l) => {
587
+ if (l.dismiss) {
588
+ requestAnimationFrame(() => {
589
+ Z((p) => p.map((m) => m.id === l.id ? {
590
+ ...m,
591
+ delete: !0
592
+ } : m));
593
+ });
594
+ return;
595
+ }
596
+ setTimeout(() => {
597
+ Wt.flushSync(() => {
598
+ Z((p) => {
599
+ const m = p.findIndex((D) => D.id === l.id);
600
+ return m !== -1 ? [
601
+ ...p.slice(0, m),
602
+ {
603
+ ...p[m],
604
+ ...l
605
+ },
606
+ ...p.slice(m + 1)
607
+ ] : [
608
+ l,
609
+ ...p
610
+ ];
611
+ });
612
+ });
613
+ });
614
+ }), [
615
+ z
616
+ ]), a.useEffect(() => {
617
+ if (w !== "system") {
618
+ v(w);
619
+ return;
620
+ }
621
+ if (w === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? v("dark") : v("light")), typeof window > "u") return;
622
+ const l = window.matchMedia("(prefers-color-scheme: dark)");
623
+ try {
624
+ l.addEventListener("change", ({ matches: p }) => {
625
+ v(p ? "dark" : "light");
626
+ });
627
+ } catch {
628
+ l.addListener(({ matches: m }) => {
629
+ try {
630
+ v(m ? "dark" : "light");
631
+ } catch (D) {
632
+ console.error(D);
633
+ }
634
+ });
635
+ }
636
+ }, [
637
+ w
638
+ ]), a.useEffect(() => {
639
+ z.length <= 1 && A(!1);
640
+ }, [
641
+ z
642
+ ]), a.useEffect(() => {
643
+ const l = (p) => {
644
+ var m;
645
+ if (g.every((f) => p[f] || p.code === f)) {
646
+ var W;
647
+ A(!0), (W = P.current) == null || W.focus();
648
+ }
649
+ p.code === "Escape" && (document.activeElement === P.current || (m = P.current) != null && m.contains(document.activeElement)) && A(!1);
650
+ };
651
+ return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
652
+ }, [
653
+ g
654
+ ]), a.useEffect(() => {
655
+ if (P.current)
656
+ return () => {
657
+ B.current && (B.current.focus({
658
+ preventScroll: !0
659
+ }), B.current = null, F.current = !1);
660
+ };
661
+ }, [
662
+ P.current
663
+ ]), // Remove item from normal navigation flow, only available via hotkey
664
+ /* @__PURE__ */ a.createElement("section", {
665
+ ref: e,
666
+ "aria-label": `${gt} ${$}`,
667
+ tabIndex: -1,
668
+ "aria-live": "polite",
669
+ "aria-relevant": "additions text",
670
+ "aria-atomic": "false",
671
+ suppressHydrationWarning: !0
672
+ }, ht.map((l, p) => {
673
+ var m;
674
+ const [D, W] = l.split("-");
675
+ return Y.length ? /* @__PURE__ */ a.createElement("ol", {
676
+ key: l,
677
+ dir: ot === "auto" ? It() : ot,
678
+ tabIndex: -1,
679
+ ref: P,
680
+ className: i,
681
+ "data-sonner-toaster": !0,
682
+ "data-sonner-theme": c,
683
+ "data-y-position": D,
684
+ "data-x-position": W,
685
+ style: {
686
+ "--front-toast-height": `${((m = nt[0]) == null ? void 0 : m.height) || 0}px`,
687
+ "--width": `${me}px`,
688
+ "--gap": `${X}px`,
689
+ ...pt,
690
+ ...ye(T, t)
691
+ },
692
+ onBlur: (f) => {
693
+ F.current && !f.currentTarget.contains(f.relatedTarget) && (F.current = !1, B.current && (B.current.focus({
694
+ preventScroll: !0
695
+ }), B.current = null));
696
+ },
697
+ onFocus: (f) => {
698
+ f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || F.current || (F.current = !0, B.current = f.relatedTarget);
699
+ },
700
+ onMouseEnter: () => A(!0),
701
+ onMouseMove: () => A(!0),
702
+ onMouseLeave: () => {
703
+ rt || A(!1);
704
+ },
705
+ onDragEnd: () => A(!1),
706
+ onPointerDown: (f) => {
707
+ f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || et(!0);
708
+ },
709
+ onPointerUp: () => et(!1)
710
+ }, Y.filter((f) => !f.position && p === 0 || f.position === l).map((f, K) => {
711
+ var lt, dt;
712
+ return /* @__PURE__ */ a.createElement(ve, {
713
+ key: f.id,
714
+ icons: st,
715
+ index: K,
716
+ toast: f,
717
+ defaultRichColors: O,
718
+ duration: (lt = d?.duration) != null ? lt : E,
719
+ className: d?.className,
720
+ descriptionClassName: d?.descriptionClassName,
721
+ invert: C,
722
+ visibleToasts: U,
723
+ closeButton: (dt = d?.closeButton) != null ? dt : b,
724
+ interacting: rt,
725
+ position: l,
726
+ style: d?.style,
727
+ unstyled: d?.unstyled,
728
+ classNames: d?.classNames,
729
+ cancelButtonStyle: d?.cancelButtonStyle,
730
+ actionButtonStyle: d?.actionButtonStyle,
731
+ closeButtonAriaLabel: d?.closeButtonAriaLabel,
732
+ removeToast: it,
733
+ toasts: Y.filter((q) => q.position == f.position),
734
+ heights: nt.filter((q) => q.position == f.position),
735
+ setHeights: bt,
736
+ expandByDefault: _,
737
+ gap: X,
738
+ expanded: tt,
739
+ swipeDirections: o.swipeDirections
740
+ });
741
+ })) : null;
742
+ }));
743
+ }), ke = ({ ...r }) => {
744
+ const { theme: o = "system" } = Xt();
745
+ return /* @__PURE__ */ Ut.jsx(
746
+ xe,
747
+ {
748
+ theme: o,
749
+ className: "toaster group",
750
+ toastOptions: {
751
+ classNames: {
752
+ toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
753
+ description: "group-[.toast]:text-muted-foreground",
754
+ actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
755
+ cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"
756
+ }
757
+ },
758
+ ...r
759
+ }
760
+ );
761
+ };
762
+ export {
763
+ ke as Toaster
764
+ };