@enya-learning/nova 0.4.3 → 0.5.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 (132) hide show
  1. package/README.md +7 -16
  2. package/dist/chunks/dist-fahbq1psobj0ox6s.js +1327 -0
  3. package/dist/chunks/dist-fahbq1psobj0ox6s.js.map +1 -0
  4. package/dist/chunks/dist-o8x0ip0z71xkr2oh.js +37 -0
  5. package/dist/chunks/dist-o8x0ip0z71xkr2oh.js.map +1 -0
  6. package/dist/components/accordion.js +59 -0
  7. package/dist/components/accordion.js.map +1 -0
  8. package/dist/components/alert-dialog.js +108 -0
  9. package/dist/components/alert-dialog.js.map +1 -0
  10. package/dist/components/alert.js +49 -0
  11. package/dist/components/alert.js.map +1 -0
  12. package/dist/components/aspect-ratio.js +16 -0
  13. package/dist/components/aspect-ratio.js.map +1 -0
  14. package/dist/components/avatar.js +58 -0
  15. package/dist/components/avatar.js.map +1 -0
  16. package/dist/components/badge.js +33 -0
  17. package/dist/components/badge.js.map +1 -0
  18. package/dist/components/breadcrumb.js +81 -0
  19. package/dist/components/breadcrumb.js.map +1 -0
  20. package/dist/components/button-group.js +47 -0
  21. package/dist/components/button-group.js.map +1 -0
  22. package/dist/components/button.js +48 -3
  23. package/dist/components/button.js.map +1 -0
  24. package/dist/components/calendar.js +3000 -0
  25. package/dist/components/calendar.js.map +1 -0
  26. package/dist/components/card.js +65 -0
  27. package/dist/components/card.js.map +1 -0
  28. package/dist/components/carousel.js +1191 -0
  29. package/dist/components/carousel.js.map +1 -0
  30. package/dist/components/chart.js +10596 -0
  31. package/dist/components/chart.js.map +1 -0
  32. package/dist/components/checkbox.js +22 -0
  33. package/dist/components/checkbox.js.map +1 -0
  34. package/dist/components/collapsible.js +28 -0
  35. package/dist/components/collapsible.js.map +1 -0
  36. package/dist/components/combobox.js +179 -0
  37. package/dist/components/combobox.js.map +1 -0
  38. package/dist/components/command.js +656 -0
  39. package/dist/components/command.js.map +1 -0
  40. package/dist/components/context-menu.js +149 -0
  41. package/dist/components/context-menu.js.map +1 -0
  42. package/dist/components/dialog.js +103 -0
  43. package/dist/components/dialog.js.map +1 -0
  44. package/dist/components/direction.js +6 -0
  45. package/dist/components/drawer.js +1042 -0
  46. package/dist/components/drawer.js.map +1 -0
  47. package/dist/components/dropdown-menu.js +153 -0
  48. package/dist/components/dropdown-menu.js.map +1 -0
  49. package/dist/components/empty.js +67 -0
  50. package/dist/components/empty.js.map +1 -0
  51. package/dist/components/enya-logo.js +42 -42
  52. package/dist/components/enya-logo.js.map +1 -1
  53. package/dist/components/field.js +119 -0
  54. package/dist/components/field.js.map +1 -0
  55. package/dist/components/hover-card.js +40 -0
  56. package/dist/components/hover-card.js.map +1 -0
  57. package/dist/components/input-group.js +85 -0
  58. package/dist/components/input-group.js.map +1 -0
  59. package/dist/components/input-otp.js +416 -0
  60. package/dist/components/input-otp.js.map +1 -0
  61. package/dist/components/input.js +18 -0
  62. package/dist/components/input.js.map +1 -0
  63. package/dist/components/item.js +133 -0
  64. package/dist/components/item.js.map +1 -0
  65. package/dist/components/kbd.js +23 -0
  66. package/dist/components/kbd.js.map +1 -0
  67. package/dist/components/label.js +16 -0
  68. package/dist/components/label.js.map +1 -0
  69. package/dist/components/menubar.js +153 -0
  70. package/dist/components/menubar.js.map +1 -0
  71. package/dist/components/native-select.js +43 -0
  72. package/dist/components/native-select.js.map +1 -0
  73. package/dist/components/navigation-menu.js +93 -0
  74. package/dist/components/navigation-menu.js.map +1 -0
  75. package/dist/components/pagination.js +95 -0
  76. package/dist/components/pagination.js.map +1 -0
  77. package/dist/components/popover.js +62 -0
  78. package/dist/components/popover.js.map +1 -0
  79. package/dist/components/progress.js +50 -0
  80. package/dist/components/progress.js.map +1 -0
  81. package/dist/components/radio-group.js +30 -0
  82. package/dist/components/radio-group.js.map +1 -0
  83. package/dist/components/resizable.js +1562 -0
  84. package/dist/components/resizable.js.map +1 -0
  85. package/dist/components/scroll-area.js +40 -0
  86. package/dist/components/scroll-area.js.map +1 -0
  87. package/dist/components/select.js +109 -0
  88. package/dist/components/select.js.map +1 -0
  89. package/dist/components/separator.js +17 -0
  90. package/dist/components/separator.js.map +1 -0
  91. package/dist/components/sheet.js +98 -0
  92. package/dist/components/sheet.js.map +1 -0
  93. package/dist/components/sidebar.js +395 -0
  94. package/dist/components/sidebar.js.map +1 -0
  95. package/dist/components/skeleton.js +15 -0
  96. package/dist/components/skeleton.js.map +1 -0
  97. package/dist/components/slider.js +36 -0
  98. package/dist/components/slider.js.map +1 -0
  99. package/dist/components/sonner.js +722 -0
  100. package/dist/components/sonner.js.map +1 -0
  101. package/dist/components/spinner.js +17 -0
  102. package/dist/components/spinner.js.map +1 -0
  103. package/dist/components/switch.js +21 -0
  104. package/dist/components/switch.js.map +1 -0
  105. package/dist/components/table.js +76 -0
  106. package/dist/components/table.js.map +1 -0
  107. package/dist/components/tabs.js +51 -0
  108. package/dist/components/tabs.js.map +1 -0
  109. package/dist/components/textarea.js +16 -0
  110. package/dist/components/textarea.js.map +1 -0
  111. package/dist/components/toggle-group.js +55 -0
  112. package/dist/components/toggle-group.js.map +1 -0
  113. package/dist/components/toggle.js +39 -0
  114. package/dist/components/toggle.js.map +1 -0
  115. package/dist/components/tooltip.js +46 -0
  116. package/dist/components/tooltip.js.map +1 -0
  117. package/dist/index.js +17 -23241
  118. package/dist/src/components/badge/badge.d.ts +1 -1
  119. package/dist/src/components/button/button.d.ts +1 -1
  120. package/dist/src/components/item/item.d.ts +1 -1
  121. package/dist/src/components/tabs/tabs.d.ts +1 -1
  122. package/dist/src/index.d.ts +1 -53
  123. package/dist/styles/nova-binding.css +102 -0
  124. package/dist/styles/nova.css +106 -48
  125. package/dist/styles/theme-nova.css +77 -81
  126. package/dist/styles/typography.css +34 -22
  127. package/package.json +17 -9
  128. package/src/eslint/no-primitive-colors.test.ts +97 -0
  129. package/dist/chunks/button-kvgr8g13fe959ju0.js +0 -81
  130. package/dist/chunks/button-kvgr8g13fe959ju0.js.map +0 -1
  131. package/dist/index.js.map +0 -1
  132. package/dist/styles/globals.css +0 -77
@@ -0,0 +1,722 @@
1
+ "use client";
2
+ import { jsx as Z } from "react/jsx-runtime";
3
+ import { CircleCheckIcon as Ut, InfoIcon as Xt, Loader2Icon as Kt, OctagonXIcon as qt, TriangleAlertIcon as Jt } from "lucide-react";
4
+ import * as gt from "react";
5
+ import o from "react";
6
+ import Qt from "react-dom";
7
+ var Gt = (e, a, r, d, u, f, b, h) => {
8
+ let i = document.documentElement, n = ["light", "dark"];
9
+ function y(E) {
10
+ (Array.isArray(e) ? e : [e]).forEach((I) => {
11
+ let U = I === "class", P = U && f ? u.map((c) => f[c] || c) : u;
12
+ U ? (i.classList.remove(...P), i.classList.add(f && f[E] ? f[E] : E)) : i.setAttribute(I, E);
13
+ }), t(E);
14
+ }
15
+ function t(E) {
16
+ h && n.includes(E) && (i.style.colorScheme = E);
17
+ }
18
+ function A() {
19
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
20
+ }
21
+ if (d) y(d);
22
+ else try {
23
+ let E = localStorage.getItem(a) || r;
24
+ y(b && E === "system" ? A() : E);
25
+ } catch {
26
+ }
27
+ };
28
+ var Zt = gt.createContext(void 0), te = {
29
+ setTheme: (e) => {
30
+ },
31
+ themes: []
32
+ }, ee = () => {
33
+ var e;
34
+ return (e = gt.useContext(Zt)) != null ? e : te;
35
+ };
36
+ var Ae = gt.memo(({ forcedTheme: e, storageKey: a, attribute: r, enableSystem: d, enableColorScheme: u, defaultTheme: f, value: b, themes: h, nonce: i, scriptProps: n }) => {
37
+ let y = JSON.stringify([
38
+ r,
39
+ a,
40
+ f,
41
+ e,
42
+ h,
43
+ b,
44
+ d,
45
+ u
46
+ ]).slice(1, -1);
47
+ return gt.createElement("script", {
48
+ ...n,
49
+ suppressHydrationWarning: !0,
50
+ nonce: typeof window > "u" ? i : "",
51
+ dangerouslySetInnerHTML: { __html: `(${Gt.toString()})(${y})` }
52
+ });
53
+ });
54
+ function ae(e) {
55
+ if (!e || typeof document > "u") return;
56
+ let a = document.head || document.getElementsByTagName("head")[0], r = document.createElement("style");
57
+ r.type = "text/css", a.appendChild(r), r.styleSheet ? r.styleSheet.cssText = e : r.appendChild(document.createTextNode(e));
58
+ }
59
+ var oe = (e) => {
60
+ switch (e) {
61
+ case "success":
62
+ return se;
63
+ case "info":
64
+ return le;
65
+ case "warning":
66
+ return ie;
67
+ case "error":
68
+ return de;
69
+ default:
70
+ return null;
71
+ }
72
+ }, re = Array(12).fill(0), ne = ({ visible: e, className: a }) => /* @__PURE__ */ o.createElement("div", {
73
+ className: ["sonner-loading-wrapper", a].filter(Boolean).join(" "),
74
+ "data-visible": e
75
+ }, /* @__PURE__ */ o.createElement("div", { className: "sonner-spinner" }, re.map((r, d) => /* @__PURE__ */ o.createElement("div", {
76
+ className: "sonner-loading-bar",
77
+ key: `spinner-bar-${d}`
78
+ })))), se = /* @__PURE__ */ o.createElement("svg", {
79
+ xmlns: "http://www.w3.org/2000/svg",
80
+ viewBox: "0 0 20 20",
81
+ fill: "currentColor",
82
+ height: "20",
83
+ width: "20"
84
+ }, /* @__PURE__ */ o.createElement("path", {
85
+ fillRule: "evenodd",
86
+ 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",
87
+ clipRule: "evenodd"
88
+ })), ie = /* @__PURE__ */ o.createElement("svg", {
89
+ xmlns: "http://www.w3.org/2000/svg",
90
+ viewBox: "0 0 24 24",
91
+ fill: "currentColor",
92
+ height: "20",
93
+ width: "20"
94
+ }, /* @__PURE__ */ o.createElement("path", {
95
+ fillRule: "evenodd",
96
+ 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",
97
+ clipRule: "evenodd"
98
+ })), le = /* @__PURE__ */ o.createElement("svg", {
99
+ xmlns: "http://www.w3.org/2000/svg",
100
+ viewBox: "0 0 20 20",
101
+ fill: "currentColor",
102
+ height: "20",
103
+ width: "20"
104
+ }, /* @__PURE__ */ o.createElement("path", {
105
+ fillRule: "evenodd",
106
+ 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",
107
+ clipRule: "evenodd"
108
+ })), de = /* @__PURE__ */ o.createElement("svg", {
109
+ xmlns: "http://www.w3.org/2000/svg",
110
+ viewBox: "0 0 20 20",
111
+ fill: "currentColor",
112
+ height: "20",
113
+ width: "20"
114
+ }, /* @__PURE__ */ o.createElement("path", {
115
+ fillRule: "evenodd",
116
+ 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",
117
+ clipRule: "evenodd"
118
+ })), ce = /* @__PURE__ */ o.createElement("svg", {
119
+ xmlns: "http://www.w3.org/2000/svg",
120
+ width: "12",
121
+ height: "12",
122
+ viewBox: "0 0 24 24",
123
+ fill: "none",
124
+ stroke: "currentColor",
125
+ strokeWidth: "1.5",
126
+ strokeLinecap: "round",
127
+ strokeLinejoin: "round"
128
+ }, /* @__PURE__ */ o.createElement("line", {
129
+ x1: "18",
130
+ y1: "6",
131
+ x2: "6",
132
+ y2: "18"
133
+ }), /* @__PURE__ */ o.createElement("line", {
134
+ x1: "6",
135
+ y1: "6",
136
+ x2: "18",
137
+ y2: "18"
138
+ })), ue = () => {
139
+ const [e, a] = o.useState(document.hidden);
140
+ return o.useEffect(() => {
141
+ const r = () => {
142
+ a(document.hidden);
143
+ };
144
+ return document.addEventListener("visibilitychange", r), () => window.removeEventListener("visibilitychange", r);
145
+ }, []), e;
146
+ }, Tt = 1, me = class {
147
+ constructor() {
148
+ this.subscribe = (e) => (this.subscribers.push(e), () => {
149
+ const a = this.subscribers.indexOf(e);
150
+ this.subscribers.splice(a, 1);
151
+ }), this.publish = (e) => {
152
+ this.subscribers.forEach((a) => a(e));
153
+ }, this.addToast = (e) => {
154
+ this.publish(e), this.toasts = [...this.toasts, e];
155
+ }, this.create = (e) => {
156
+ var a;
157
+ const { message: r, ...d } = e, u = typeof e?.id == "number" || ((a = e.id) == null ? void 0 : a.length) > 0 ? e.id : Tt++, f = this.toasts.find((h) => h.id === u), b = e.dismissible === void 0 ? !0 : e.dismissible;
158
+ return this.dismissedToasts.has(u) && this.dismissedToasts.delete(u), f ? this.toasts = this.toasts.map((h) => h.id === u ? (this.publish({
159
+ ...h,
160
+ ...e,
161
+ id: u,
162
+ title: r
163
+ }), {
164
+ ...h,
165
+ ...e,
166
+ id: u,
167
+ dismissible: b,
168
+ title: r
169
+ }) : h) : this.addToast({
170
+ title: r,
171
+ ...d,
172
+ dismissible: b,
173
+ id: u
174
+ }), u;
175
+ }, this.dismiss = (e) => (e ? (this.dismissedToasts.add(e), requestAnimationFrame(() => this.subscribers.forEach((a) => a({
176
+ id: e,
177
+ dismiss: !0
178
+ })))) : this.toasts.forEach((a) => {
179
+ this.subscribers.forEach((r) => r({
180
+ id: a.id,
181
+ dismiss: !0
182
+ }));
183
+ }), e), this.message = (e, a) => this.create({
184
+ ...a,
185
+ message: e
186
+ }), this.error = (e, a) => this.create({
187
+ ...a,
188
+ message: e,
189
+ type: "error"
190
+ }), this.success = (e, a) => this.create({
191
+ ...a,
192
+ type: "success",
193
+ message: e
194
+ }), this.info = (e, a) => this.create({
195
+ ...a,
196
+ type: "info",
197
+ message: e
198
+ }), this.warning = (e, a) => this.create({
199
+ ...a,
200
+ type: "warning",
201
+ message: e
202
+ }), this.loading = (e, a) => this.create({
203
+ ...a,
204
+ type: "loading",
205
+ message: e
206
+ }), this.promise = (e, a) => {
207
+ if (!a) return;
208
+ let r;
209
+ a.loading !== void 0 && (r = this.create({
210
+ ...a,
211
+ promise: e,
212
+ type: "loading",
213
+ message: a.loading,
214
+ description: typeof a.description != "function" ? a.description : void 0
215
+ }));
216
+ const d = Promise.resolve(e instanceof Function ? e() : e);
217
+ let u = r !== void 0, f;
218
+ const b = d.then(async (i) => {
219
+ if (f = ["resolve", i], o.isValidElement(i))
220
+ u = !1, this.create({
221
+ id: r,
222
+ type: "default",
223
+ message: i
224
+ });
225
+ else if (pe(i) && !i.ok) {
226
+ u = !1;
227
+ const n = typeof a.error == "function" ? await a.error(`HTTP error! status: ${i.status}`) : a.error, y = typeof a.description == "function" ? await a.description(`HTTP error! status: ${i.status}`) : a.description, t = typeof n == "object" && !o.isValidElement(n) ? n : { message: n };
228
+ this.create({
229
+ id: r,
230
+ type: "error",
231
+ description: y,
232
+ ...t
233
+ });
234
+ } else if (i instanceof Error) {
235
+ u = !1;
236
+ const n = typeof a.error == "function" ? await a.error(i) : a.error, y = typeof a.description == "function" ? await a.description(i) : a.description, t = typeof n == "object" && !o.isValidElement(n) ? n : { message: n };
237
+ this.create({
238
+ id: r,
239
+ type: "error",
240
+ description: y,
241
+ ...t
242
+ });
243
+ } else if (a.success !== void 0) {
244
+ u = !1;
245
+ const n = typeof a.success == "function" ? await a.success(i) : a.success, y = typeof a.description == "function" ? await a.description(i) : a.description, t = typeof n == "object" && !o.isValidElement(n) ? n : { message: n };
246
+ this.create({
247
+ id: r,
248
+ type: "success",
249
+ description: y,
250
+ ...t
251
+ });
252
+ }
253
+ }).catch(async (i) => {
254
+ if (f = ["reject", i], a.error !== void 0) {
255
+ u = !1;
256
+ const n = typeof a.error == "function" ? await a.error(i) : a.error, y = typeof a.description == "function" ? await a.description(i) : a.description, t = typeof n == "object" && !o.isValidElement(n) ? n : { message: n };
257
+ this.create({
258
+ id: r,
259
+ type: "error",
260
+ description: y,
261
+ ...t
262
+ });
263
+ }
264
+ }).finally(() => {
265
+ u && (this.dismiss(r), r = void 0), a.finally == null || a.finally.call(a);
266
+ }), h = () => new Promise((i, n) => b.then(() => f[0] === "reject" ? n(f[1]) : i(f[1])).catch(n));
267
+ return typeof r != "string" && typeof r != "number" ? { unwrap: h } : Object.assign(r, { unwrap: h });
268
+ }, this.custom = (e, a) => {
269
+ const r = a?.id || Tt++;
270
+ return this.create({
271
+ jsx: e(r),
272
+ id: r,
273
+ ...a
274
+ }), r;
275
+ }, this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
276
+ }
277
+ }, N = new me(), fe = (e, a) => {
278
+ const r = a?.id || Tt++;
279
+ return N.addToast({
280
+ title: e,
281
+ ...a,
282
+ id: r
283
+ }), r;
284
+ }, pe = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", he = fe, ge = () => N.toasts, ve = () => N.getActiveToasts(), Re = Object.assign(he, {
285
+ success: N.success,
286
+ info: N.info,
287
+ warning: N.warning,
288
+ error: N.error,
289
+ custom: N.custom,
290
+ message: N.message,
291
+ promise: N.promise,
292
+ dismiss: N.dismiss,
293
+ loading: N.loading
294
+ }, {
295
+ getHistory: ge,
296
+ getToasts: ve
297
+ });
298
+ ae("[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%)}");
299
+ function ht(e) {
300
+ return e.label !== void 0;
301
+ }
302
+ var be = 3, ye = "24px", we = "16px", Dt = 4e3, xe = 356, Ee = 14, Te = 45, Se = 200;
303
+ function O(...e) {
304
+ return e.filter(Boolean).join(" ");
305
+ }
306
+ function ke(e) {
307
+ const [a, r] = e.split("-"), d = [];
308
+ return a && d.push(a), r && d.push(r), d;
309
+ }
310
+ var Ne = (e) => {
311
+ var a, r, d, u, f, b, h, i, n;
312
+ const { invert: y, toast: t, unstyled: A, interacting: E, setHeights: I, visibleToasts: U, heights: P, index: c, toasts: st, expanded: X, removeToast: it, defaultRichColors: vt, closeButton: z, style: tt, cancelButtonStyle: Y, actionButtonStyle: bt, className: lt = "", descriptionClassName: yt = "", duration: et, position: R, gap: dt, expandByDefault: at, classNames: m, icons: T, closeButtonAriaLabel: j = "Close toast" } = e, [F, M] = o.useState(null), [V, ct] = o.useState(null), [l, g] = o.useState(!1), [p, k] = o.useState(!1), [K, v] = o.useState(!1), [ut, mt] = o.useState(!1), [ft, q] = o.useState(!1), [Rt, wt] = o.useState(0), [Lt, St] = o.useState(0), ot = o.useRef(t.duration || et || Dt), kt = o.useRef(null), H = o.useRef(null), Ot = c === 0, zt = c + 1 <= U, _ = t.type, J = t.dismissible !== !1, Ht = t.className || "", Pt = t.descriptionClassName || "", pt = o.useMemo(() => P.findIndex((s) => s.toastId === t.id) || 0, [P, t.id]), jt = o.useMemo(() => {
313
+ var s;
314
+ return (s = t.closeButton) != null ? s : z;
315
+ }, [t.closeButton, z]), Nt = o.useMemo(() => t.duration || et || Dt, [t.duration, et]), xt = o.useRef(0), Q = o.useRef(0), _t = o.useRef(0), G = o.useRef(null), [$t, Yt] = R.split("-"), Ct = o.useMemo(() => P.reduce((s, w, S) => S >= pt ? s : s + w.height, 0), [P, pt]), It = ue(), Ft = t.invert || y, Et = _ === "loading";
316
+ Q.current = o.useMemo(() => pt * dt + Ct, [pt, Ct]), o.useEffect(() => {
317
+ ot.current = Nt;
318
+ }, [Nt]), o.useEffect(() => {
319
+ g(!0);
320
+ }, []), o.useEffect(() => {
321
+ const s = H.current;
322
+ if (s) {
323
+ const w = s.getBoundingClientRect().height;
324
+ return St(w), I((S) => [{
325
+ toastId: t.id,
326
+ height: w,
327
+ position: t.position
328
+ }, ...S]), () => I((S) => S.filter((C) => C.toastId !== t.id));
329
+ }
330
+ }, [I, t.id]), o.useLayoutEffect(() => {
331
+ if (!l) return;
332
+ const s = H.current, w = s.style.height;
333
+ s.style.height = "auto";
334
+ const S = s.getBoundingClientRect().height;
335
+ s.style.height = w, St(S), I((C) => C.find((x) => x.toastId === t.id) ? C.map((x) => x.toastId === t.id ? {
336
+ ...x,
337
+ height: S
338
+ } : x) : [{
339
+ toastId: t.id,
340
+ height: S,
341
+ position: t.position
342
+ }, ...C]);
343
+ }, [
344
+ l,
345
+ t.title,
346
+ t.description,
347
+ I,
348
+ t.id,
349
+ t.jsx,
350
+ t.action,
351
+ t.cancel
352
+ ]);
353
+ const $ = o.useCallback(() => {
354
+ k(!0), wt(Q.current), I((s) => s.filter((w) => w.toastId !== t.id)), setTimeout(() => {
355
+ it(t);
356
+ }, Se);
357
+ }, [
358
+ t,
359
+ it,
360
+ I,
361
+ Q
362
+ ]);
363
+ o.useEffect(() => {
364
+ if (t.promise && _ === "loading" || t.duration === 1 / 0 || t.type === "loading") return;
365
+ let s;
366
+ return X || E || It ? (() => {
367
+ if (_t.current < xt.current) {
368
+ const C = (/* @__PURE__ */ new Date()).getTime() - xt.current;
369
+ ot.current = ot.current - C;
370
+ }
371
+ _t.current = (/* @__PURE__ */ new Date()).getTime();
372
+ })() : ot.current !== 1 / 0 && (xt.current = (/* @__PURE__ */ new Date()).getTime(), s = setTimeout(() => {
373
+ t.onAutoClose == null || t.onAutoClose.call(t, t), $();
374
+ }, ot.current)), () => clearTimeout(s);
375
+ }, [
376
+ X,
377
+ E,
378
+ t,
379
+ _,
380
+ It,
381
+ $
382
+ ]), o.useEffect(() => {
383
+ t.delete && ($(), t.onDismiss == null || t.onDismiss.call(t, t));
384
+ }, [$, t.delete]);
385
+ function Vt() {
386
+ var s;
387
+ if (T?.loading) {
388
+ var w;
389
+ return /* @__PURE__ */ o.createElement("div", {
390
+ className: O(m?.loader, t == null || (w = t.classNames) == null ? void 0 : w.loader, "sonner-loader"),
391
+ "data-visible": _ === "loading"
392
+ }, T.loading);
393
+ }
394
+ return /* @__PURE__ */ o.createElement(ne, {
395
+ className: O(m?.loader, t == null || (s = t.classNames) == null ? void 0 : s.loader),
396
+ visible: _ === "loading"
397
+ });
398
+ }
399
+ const Wt = t.icon || T?.[_] || oe(_);
400
+ var Mt, Bt;
401
+ return /* @__PURE__ */ o.createElement("li", {
402
+ tabIndex: 0,
403
+ ref: H,
404
+ className: O(lt, Ht, m?.toast, t == null || (a = t.classNames) == null ? void 0 : a.toast, m?.default, m?.[_], t == null || (r = t.classNames) == null ? void 0 : r[_]),
405
+ "data-sonner-toast": "",
406
+ "data-rich-colors": (Mt = t.richColors) != null ? Mt : vt,
407
+ "data-styled": !(t.jsx || t.unstyled || A),
408
+ "data-mounted": l,
409
+ "data-promise": !!t.promise,
410
+ "data-swiped": ft,
411
+ "data-removed": p,
412
+ "data-visible": zt,
413
+ "data-y-position": $t,
414
+ "data-x-position": Yt,
415
+ "data-index": c,
416
+ "data-front": Ot,
417
+ "data-swiping": K,
418
+ "data-dismissible": J,
419
+ "data-type": _,
420
+ "data-invert": Ft,
421
+ "data-swipe-out": ut,
422
+ "data-swipe-direction": V,
423
+ "data-expanded": !!(X || at && l),
424
+ "data-testid": t.testId,
425
+ style: {
426
+ "--index": c,
427
+ "--toasts-before": c,
428
+ "--z-index": st.length - c,
429
+ "--offset": `${p ? Rt : Q.current}px`,
430
+ "--initial-height": at ? "auto" : `${Lt}px`,
431
+ ...tt,
432
+ ...t.style
433
+ },
434
+ onDragEnd: () => {
435
+ v(!1), M(null), G.current = null;
436
+ },
437
+ onPointerDown: (s) => {
438
+ s.button !== 2 && (Et || !J || (kt.current = /* @__PURE__ */ new Date(), wt(Q.current), s.target.setPointerCapture(s.pointerId), s.target.tagName !== "BUTTON" && (v(!0), G.current = {
439
+ x: s.clientX,
440
+ y: s.clientY
441
+ })));
442
+ },
443
+ onPointerUp: () => {
444
+ var s, w, S;
445
+ if (ut || !J) return;
446
+ G.current = null;
447
+ const C = Number(((s = H.current) == null ? void 0 : s.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), x = Number(((w = H.current) == null ? void 0 : w.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), B = (/* @__PURE__ */ new Date()).getTime() - ((S = kt.current) == null ? void 0 : S.getTime()), rt = F === "x" ? C : x, L = Math.abs(rt) / B;
448
+ if (Math.abs(rt) >= Te || L > 0.11) {
449
+ wt(Q.current), t.onDismiss == null || t.onDismiss.call(t, t), ct(F === "x" ? C > 0 ? "right" : "left" : x > 0 ? "down" : "up"), $(), mt(!0);
450
+ return;
451
+ } else {
452
+ var D, nt;
453
+ (D = H.current) == null || D.style.setProperty("--swipe-amount-x", "0px"), (nt = H.current) == null || nt.style.setProperty("--swipe-amount-y", "0px");
454
+ }
455
+ q(!1), v(!1), M(null);
456
+ },
457
+ onPointerMove: (s) => {
458
+ var w, S, C;
459
+ if (!G.current || !J || ((w = window.getSelection()) == null ? void 0 : w.toString().length) > 0) return;
460
+ const x = s.clientY - G.current.y, B = s.clientX - G.current.x;
461
+ var rt;
462
+ const L = (rt = e.swipeDirections) != null ? rt : ke(R);
463
+ !F && (Math.abs(B) > 1 || Math.abs(x) > 1) && M(Math.abs(B) > Math.abs(x) ? "x" : "y");
464
+ let D = {
465
+ x: 0,
466
+ y: 0
467
+ };
468
+ const nt = (W) => 1 / (1.5 + Math.abs(W) / 20);
469
+ if (F === "y") {
470
+ if (L.includes("top") || L.includes("bottom")) if (L.includes("top") && x < 0 || L.includes("bottom") && x > 0) D.y = x;
471
+ else {
472
+ const W = x * nt(x);
473
+ D.y = Math.abs(W) < Math.abs(x) ? W : x;
474
+ }
475
+ } else if (F === "x" && (L.includes("left") || L.includes("right")))
476
+ if (L.includes("left") && B < 0 || L.includes("right") && B > 0) D.x = B;
477
+ else {
478
+ const W = B * nt(B);
479
+ D.x = Math.abs(W) < Math.abs(B) ? W : B;
480
+ }
481
+ (Math.abs(D.x) > 0 || Math.abs(D.y) > 0) && q(!0), (S = H.current) == null || S.style.setProperty("--swipe-amount-x", `${D.x}px`), (C = H.current) == null || C.style.setProperty("--swipe-amount-y", `${D.y}px`);
482
+ }
483
+ }, jt && !t.jsx && _ !== "loading" ? /* @__PURE__ */ o.createElement("button", {
484
+ "aria-label": j,
485
+ "data-disabled": Et,
486
+ "data-close-button": !0,
487
+ onClick: Et || !J ? () => {
488
+ } : () => {
489
+ $(), t.onDismiss == null || t.onDismiss.call(t, t);
490
+ },
491
+ className: O(m?.closeButton, t == null || (d = t.classNames) == null ? void 0 : d.closeButton)
492
+ }, (Bt = T?.close) != null ? Bt : ce) : null, (_ || t.icon || t.promise) && t.icon !== null && (T?.[_] !== null || t.icon) ? /* @__PURE__ */ o.createElement("div", {
493
+ "data-icon": "",
494
+ className: O(m?.icon, t == null || (u = t.classNames) == null ? void 0 : u.icon)
495
+ }, t.promise || t.type === "loading" && !t.icon ? t.icon || Vt() : null, t.type !== "loading" ? Wt : null) : null, /* @__PURE__ */ o.createElement("div", {
496
+ "data-content": "",
497
+ className: O(m?.content, t == null || (f = t.classNames) == null ? void 0 : f.content)
498
+ }, /* @__PURE__ */ o.createElement("div", {
499
+ "data-title": "",
500
+ className: O(m?.title, t == null || (b = t.classNames) == null ? void 0 : b.title)
501
+ }, t.jsx ? t.jsx : typeof t.title == "function" ? t.title() : t.title), t.description ? /* @__PURE__ */ o.createElement("div", {
502
+ "data-description": "",
503
+ className: O(yt, Pt, m?.description, t == null || (h = t.classNames) == null ? void 0 : h.description)
504
+ }, typeof t.description == "function" ? t.description() : t.description) : null), /* @__PURE__ */ o.isValidElement(t.cancel) ? t.cancel : t.cancel && ht(t.cancel) ? /* @__PURE__ */ o.createElement("button", {
505
+ "data-button": !0,
506
+ "data-cancel": !0,
507
+ style: t.cancelButtonStyle || Y,
508
+ onClick: (s) => {
509
+ ht(t.cancel) && J && (t.cancel.onClick == null || t.cancel.onClick.call(t.cancel, s), $());
510
+ },
511
+ className: O(m?.cancelButton, t == null || (i = t.classNames) == null ? void 0 : i.cancelButton)
512
+ }, t.cancel.label) : null, /* @__PURE__ */ o.isValidElement(t.action) ? t.action : t.action && ht(t.action) ? /* @__PURE__ */ o.createElement("button", {
513
+ "data-button": !0,
514
+ "data-action": !0,
515
+ style: t.actionButtonStyle || bt,
516
+ onClick: (s) => {
517
+ ht(t.action) && (t.action.onClick == null || t.action.onClick.call(t.action, s), !s.defaultPrevented && $());
518
+ },
519
+ className: O(m?.actionButton, t == null || (n = t.classNames) == null ? void 0 : n.actionButton)
520
+ }, t.action.label) : null);
521
+ };
522
+ function At() {
523
+ if (typeof window > "u" || typeof document > "u") return "ltr";
524
+ const e = document.documentElement.getAttribute("dir");
525
+ return e === "auto" || !e ? window.getComputedStyle(document.documentElement).direction : e;
526
+ }
527
+ function _e(e, a) {
528
+ const r = {};
529
+ return [e, a].forEach((d, u) => {
530
+ const f = u === 1, b = f ? "--mobile-offset" : "--offset", h = f ? we : ye;
531
+ function i(n) {
532
+ [
533
+ "top",
534
+ "right",
535
+ "bottom",
536
+ "left"
537
+ ].forEach((y) => {
538
+ r[`${b}-${y}`] = typeof n == "number" ? `${n}px` : n;
539
+ });
540
+ }
541
+ typeof d == "number" || typeof d == "string" ? i(d) : typeof d == "object" ? [
542
+ "top",
543
+ "right",
544
+ "bottom",
545
+ "left"
546
+ ].forEach((n) => {
547
+ d[n] === void 0 ? r[`${b}-${n}`] = h : r[`${b}-${n}`] = typeof d[n] == "number" ? `${d[n]}px` : d[n];
548
+ }) : i(h);
549
+ }), r;
550
+ }
551
+ var Ce = /* @__PURE__ */ o.forwardRef(function(a, r) {
552
+ const { id: d, invert: u, position: f = "bottom-right", hotkey: b = ["altKey", "KeyT"], expand: h, closeButton: i, className: n, offset: y, mobileOffset: t, theme: A = "light", richColors: E, duration: I, style: U, visibleToasts: P = be, toastOptions: c, dir: st = At(), gap: X = Ee, icons: it, containerAriaLabel: vt = "Notifications" } = a, [z, tt] = o.useState([]), Y = o.useMemo(() => d ? z.filter((l) => l.toasterId === d) : z.filter((l) => !l.toasterId), [z, d]), bt = o.useMemo(() => Array.from(new Set([f].concat(Y.filter((l) => l.position).map((l) => l.position)))), [Y, f]), [lt, yt] = o.useState([]), [et, R] = o.useState(!1), [dt, at] = o.useState(!1), [m, T] = o.useState(A !== "system" ? A : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), j = o.useRef(null), F = b.join("+").replace(/Key/g, "").replace(/Digit/g, ""), M = o.useRef(null), V = o.useRef(!1), ct = o.useCallback((l) => {
553
+ tt((g) => {
554
+ var p;
555
+ return (p = g.find((k) => k.id === l.id)) != null && p.delete || N.dismiss(l.id), g.filter(({ id: k }) => k !== l.id);
556
+ });
557
+ }, []);
558
+ return o.useEffect(() => N.subscribe((l) => {
559
+ if (l.dismiss) {
560
+ requestAnimationFrame(() => {
561
+ tt((g) => g.map((p) => p.id === l.id ? {
562
+ ...p,
563
+ delete: !0
564
+ } : p));
565
+ });
566
+ return;
567
+ }
568
+ setTimeout(() => {
569
+ Qt.flushSync(() => {
570
+ tt((g) => {
571
+ const p = g.findIndex((k) => k.id === l.id);
572
+ return p !== -1 ? [
573
+ ...g.slice(0, p),
574
+ {
575
+ ...g[p],
576
+ ...l
577
+ },
578
+ ...g.slice(p + 1)
579
+ ] : [l, ...g];
580
+ });
581
+ });
582
+ });
583
+ }), [z]), o.useEffect(() => {
584
+ if (A !== "system") {
585
+ T(A);
586
+ return;
587
+ }
588
+ if (A === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? T("dark") : T("light")), typeof window > "u") return;
589
+ const l = window.matchMedia("(prefers-color-scheme: dark)");
590
+ try {
591
+ l.addEventListener("change", ({ matches: g }) => {
592
+ T(g ? "dark" : "light");
593
+ });
594
+ } catch {
595
+ l.addListener(({ matches: p }) => {
596
+ try {
597
+ T(p ? "dark" : "light");
598
+ } catch (k) {
599
+ console.error(k);
600
+ }
601
+ });
602
+ }
603
+ }, [A]), o.useEffect(() => {
604
+ z.length <= 1 && R(!1);
605
+ }, [z]), o.useEffect(() => {
606
+ const l = (g) => {
607
+ var p;
608
+ if (b.every((K) => g[K] || g.code === K)) {
609
+ var k;
610
+ R(!0), (k = j.current) == null || k.focus();
611
+ }
612
+ g.code === "Escape" && (document.activeElement === j.current || (p = j.current) != null && p.contains(document.activeElement)) && R(!1);
613
+ };
614
+ return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
615
+ }, [b]), o.useEffect(() => {
616
+ if (j.current) return () => {
617
+ M.current && (M.current.focus({ preventScroll: !0 }), M.current = null, V.current = !1);
618
+ };
619
+ }, [j.current]), /* @__PURE__ */ o.createElement("section", {
620
+ ref: r,
621
+ "aria-label": `${vt} ${F}`,
622
+ tabIndex: -1,
623
+ "aria-live": "polite",
624
+ "aria-relevant": "additions text",
625
+ "aria-atomic": "false",
626
+ suppressHydrationWarning: !0
627
+ }, bt.map((l, g) => {
628
+ var p;
629
+ const [k, K] = l.split("-");
630
+ return Y.length ? /* @__PURE__ */ o.createElement("ol", {
631
+ key: l,
632
+ dir: st === "auto" ? At() : st,
633
+ tabIndex: -1,
634
+ ref: j,
635
+ className: n,
636
+ "data-sonner-toaster": !0,
637
+ "data-sonner-theme": m,
638
+ "data-y-position": k,
639
+ "data-x-position": K,
640
+ style: {
641
+ "--front-toast-height": `${((p = lt[0]) == null ? void 0 : p.height) || 0}px`,
642
+ "--width": `${xe}px`,
643
+ "--gap": `${X}px`,
644
+ ...U,
645
+ ..._e(y, t)
646
+ },
647
+ onBlur: (v) => {
648
+ V.current && !v.currentTarget.contains(v.relatedTarget) && (V.current = !1, M.current && (M.current.focus({ preventScroll: !0 }), M.current = null));
649
+ },
650
+ onFocus: (v) => {
651
+ v.target instanceof HTMLElement && v.target.dataset.dismissible === "false" || V.current || (V.current = !0, M.current = v.relatedTarget);
652
+ },
653
+ onMouseEnter: () => R(!0),
654
+ onMouseMove: () => R(!0),
655
+ onMouseLeave: () => {
656
+ dt || R(!1);
657
+ },
658
+ onDragEnd: () => R(!1),
659
+ onPointerDown: (v) => {
660
+ v.target instanceof HTMLElement && v.target.dataset.dismissible === "false" || at(!0);
661
+ },
662
+ onPointerUp: () => at(!1)
663
+ }, Y.filter((v) => !v.position && g === 0 || v.position === l).map((v, ut) => {
664
+ var mt, ft;
665
+ return /* @__PURE__ */ o.createElement(Ne, {
666
+ key: v.id,
667
+ icons: it,
668
+ index: ut,
669
+ toast: v,
670
+ defaultRichColors: E,
671
+ duration: (mt = c?.duration) != null ? mt : I,
672
+ className: c?.className,
673
+ descriptionClassName: c?.descriptionClassName,
674
+ invert: u,
675
+ visibleToasts: P,
676
+ closeButton: (ft = c?.closeButton) != null ? ft : i,
677
+ interacting: dt,
678
+ position: l,
679
+ style: c?.style,
680
+ unstyled: c?.unstyled,
681
+ classNames: c?.classNames,
682
+ cancelButtonStyle: c?.cancelButtonStyle,
683
+ actionButtonStyle: c?.actionButtonStyle,
684
+ closeButtonAriaLabel: c?.closeButtonAriaLabel,
685
+ removeToast: ct,
686
+ toasts: Y.filter((q) => q.position == v.position),
687
+ heights: lt.filter((q) => q.position == v.position),
688
+ setHeights: yt,
689
+ expandByDefault: h,
690
+ gap: X,
691
+ expanded: et,
692
+ swipeDirections: a.swipeDirections
693
+ });
694
+ })) : null;
695
+ }));
696
+ }), Le = ({ ...e }) => {
697
+ const { theme: a = "system" } = ee();
698
+ return /* @__PURE__ */ Z(Ce, {
699
+ theme: a,
700
+ className: "toaster group",
701
+ icons: {
702
+ success: /* @__PURE__ */ Z(Ut, { className: "size-4" }),
703
+ info: /* @__PURE__ */ Z(Xt, { className: "size-4" }),
704
+ warning: /* @__PURE__ */ Z(Jt, { className: "size-4" }),
705
+ error: /* @__PURE__ */ Z(qt, { className: "size-4" }),
706
+ loading: /* @__PURE__ */ Z(Kt, { className: "size-4 animate-spin" })
707
+ },
708
+ style: {
709
+ "--normal-bg": "var(--color-popover)",
710
+ "--normal-text": "var(--color-popover-foreground)",
711
+ "--normal-border": "var(--color-border)",
712
+ "--border-radius": "var(--radius-xl)"
713
+ },
714
+ toastOptions: { classNames: { toast: "cn-toast" } },
715
+ ...e
716
+ });
717
+ };
718
+ export {
719
+ Le as Toaster
720
+ };
721
+
722
+ //# sourceMappingURL=sonner.js.map