@spear-ai/spectral 1.6.17 → 1.8.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 (149) hide show
  1. package/dist/.js +201 -200
  2. package/dist/Accordion.d.ts +13 -15
  3. package/dist/Accordion.js +184 -179
  4. package/dist/Alert/AlertBase.d.ts +7 -7
  5. package/dist/Alert/AlertBase.js +21 -21
  6. package/dist/Alert.d.ts +2 -2
  7. package/dist/Alert.js +31 -31
  8. package/dist/Avatar.d.ts +2 -2
  9. package/dist/Avatar.js +30 -22
  10. package/dist/Badge.d.ts +1 -1
  11. package/dist/Badge.js +3 -2
  12. package/dist/Button.d.ts +3 -3
  13. package/dist/Button.js +108 -46
  14. package/dist/ButtonGroup/ButtonGroupButton.d.ts +1 -1
  15. package/dist/ButtonGroup/ButtonGroupButton.js +5 -5
  16. package/dist/ButtonGroup.d.ts +5 -5
  17. package/dist/ButtonGroup.js +21 -21
  18. package/dist/ButtonIcon.d.ts +2 -2
  19. package/dist/ButtonIcon.js +30 -31
  20. package/dist/Checkbox/CheckboxBase.d.ts +2 -2
  21. package/dist/Checkbox/CheckboxBase.js +50 -57
  22. package/dist/Checkbox.js +15 -19
  23. package/dist/DataCard/Card.d.ts +1 -1
  24. package/dist/DataCard/Card.js +1 -1
  25. package/dist/DataCard.js +1 -1
  26. package/dist/DateTimePicker/Calendar.d.ts +4 -4
  27. package/dist/DateTimePicker/Calendar.js +3 -3
  28. package/dist/DateTimePicker/DateTimeDisplayInput.js +126 -136
  29. package/dist/DateTimePicker/DateTimeInput.js +4 -4
  30. package/dist/DateTimePicker/DateTimeUtils.d.ts +31 -31
  31. package/dist/DateTimePicker/DateTimeUtils.js +139 -197
  32. package/dist/DateTimePicker/TimePicker.d.ts +4 -4
  33. package/dist/DateTimePicker/TimePicker.js +3 -3
  34. package/dist/DateTimePicker.d.ts +5 -5
  35. package/dist/DateTimePicker.js +90 -70
  36. package/dist/Dialog.d.ts +13 -13
  37. package/dist/Dialog.js +57 -84
  38. package/dist/Drawer.d.ts +2 -2
  39. package/dist/Drawer.js +8 -8
  40. package/dist/HoverCard.d.ts +6 -5
  41. package/dist/HoverCard.js +64 -64
  42. package/dist/Icons/PolygonIcon.d.ts +5 -0
  43. package/dist/Icons/PolygonIcon.js +40 -0
  44. package/dist/Icons/index.d.ts +1 -1
  45. package/dist/Icons.js +34 -34
  46. package/dist/IconsAnimated/PanelLeftCloseIcon.js +2 -2
  47. package/dist/IconsAnimated/PanelLeftOpenIcon.js +2 -2
  48. package/dist/Input/InputUtils.d.ts +2 -2
  49. package/dist/Input/InputUtils.js +4 -4
  50. package/dist/Input.d.ts +1 -1
  51. package/dist/Input.js +19 -19
  52. package/dist/InputOTP.d.ts +10 -10
  53. package/dist/InputOTP.js +114 -114
  54. package/dist/Kbd.d.ts +8 -5
  55. package/dist/Kbd.js +85 -20
  56. package/dist/Label.d.ts +4 -2
  57. package/dist/Label.js +3 -3
  58. package/dist/MultiSelect/MultiSelectBase.d.ts +1 -1
  59. package/dist/MultiSelect/MultiSelectBase.js +278 -202
  60. package/dist/MultiSelect.d.ts +6 -6
  61. package/dist/MultiSelect.js +9 -9
  62. package/dist/Popover.js +22 -237
  63. package/dist/RadioButtonGroup/RadioButtonGroupBase.d.ts +11 -11
  64. package/dist/RadioButtonGroup/RadioButtonGroupBase.js +28 -28
  65. package/dist/RadioButtonGroup.d.ts +1 -1
  66. package/dist/RadioGroup.d.ts +15 -15
  67. package/dist/RadioGroup.js +253 -236
  68. package/dist/Select.d.ts +3 -1
  69. package/dist/Select.js +91 -88
  70. package/dist/Separator.js +4 -4
  71. package/dist/Skeleton.d.ts +1 -2
  72. package/dist/Skeleton.js +2 -4
  73. package/dist/Slider.d.ts +6 -6
  74. package/dist/Slider.js +78 -78
  75. package/dist/Switch/SwitchBase.d.ts +4 -4
  76. package/dist/Switch/SwitchBase.js +75 -111
  77. package/dist/Switch.d.ts +4 -4
  78. package/dist/Switch.js +122 -33
  79. package/dist/Tabs/TabsBase.js +39 -38
  80. package/dist/Tabs/tabsUtils.js +7 -7
  81. package/dist/Tabs.d.ts +0 -4
  82. package/dist/Tabs.js +62 -66
  83. package/dist/Textarea/TextareaUtils.d.ts +7 -7
  84. package/dist/Textarea/TextareaUtils.js +13 -13
  85. package/dist/Textarea.js +28 -18
  86. package/dist/Toast.d.ts +43 -0
  87. package/dist/Toast.js +883 -0
  88. package/dist/Toggle/ToggleBase.d.ts +4 -4
  89. package/dist/Toggle/ToggleBase.js +32 -33
  90. package/dist/Toggle.d.ts +1 -1
  91. package/dist/Toggle.js +7 -12
  92. package/dist/ToggleGroup/ToggleGroupBase.d.ts +5 -5
  93. package/dist/ToggleGroup/ToggleGroupBase.js +30 -30
  94. package/dist/ToggleGroup.d.ts +1 -1
  95. package/dist/ToggleGroup.js +27 -30
  96. package/dist/Tooltip.d.ts +1 -1
  97. package/dist/Tooltip.js +97 -97
  98. package/dist/Tray.d.ts +9 -9
  99. package/dist/Tray.js +71 -70
  100. package/dist/hooks/useAccordionAutoScroll.d.ts.map +1 -1
  101. package/dist/hooks/useAccordionAutoScroll.js +42 -39
  102. package/dist/hooks/useControllableState.d.ts +2 -2
  103. package/dist/hooks/useControllableState.d.ts.map +1 -1
  104. package/dist/hooks/useControllableState.js +2 -2
  105. package/dist/index-C12FUuIW.js +13 -0
  106. package/dist/{index-yU8jOTzS.js → index-CpovUAO-.js} +1 -1
  107. package/dist/{index-BdS7Ix8W.js → index-CqbPiOid.js} +1 -1
  108. package/dist/{index-B3UpsZ2x.js → index-CrjD9cAD.js} +1 -1
  109. package/dist/index-DEYs15GP.js +66 -0
  110. package/dist/index-DdFoGvON.js +146 -0
  111. package/dist/index-Q3N6lgwg.js +225 -0
  112. package/dist/index.d.ts +3 -3
  113. package/dist/index.d.ts.map +1 -1
  114. package/dist/primitives/button.d.ts +1 -1
  115. package/dist/primitives/button.js +4 -4
  116. package/dist/primitives/input.d.ts.map +1 -1
  117. package/dist/primitives/input.js +8 -5
  118. package/dist/primitives/select.d.ts +12 -13
  119. package/dist/primitives/select.d.ts.map +1 -1
  120. package/dist/primitives/select.js +59 -88
  121. package/dist/primitives/slot.d.ts +5 -5
  122. package/dist/primitives/slot.d.ts.map +1 -1
  123. package/dist/primitives/slot.js +24 -33
  124. package/dist/primitives/textarea.d.ts.map +1 -1
  125. package/dist/primitives/textarea.js +4 -3
  126. package/dist/{proxy-Cukf-VVj.js → proxy-CgaCj1WQ.js} +7 -3
  127. package/dist/styles/base-colors.css +30 -30
  128. package/dist/styles/horizon/base-colors.css +30 -30
  129. package/dist/styles/horizon/colors.css +43 -13
  130. package/dist/styles/horizon/utilities.css +26 -3
  131. package/dist/styles/main.css +1 -1
  132. package/dist/styles/spectral.css +2 -2
  133. package/dist/styles/theme.css +99 -46
  134. package/dist/{use-animation-zNd5Nq85.js → use-animation-CR-SdV2l.js} +1 -1
  135. package/dist/utils/formFieldUtils.d.ts +2 -2
  136. package/dist/utils/formFieldUtils.d.ts.map +1 -1
  137. package/dist/utils/formFieldUtils.js +14 -11
  138. package/dist/utils/sharedUtils.d.ts +3 -3
  139. package/dist/utils/sharedUtils.d.ts.map +1 -1
  140. package/dist/utils/sharedUtils.js +1 -4
  141. package/dist/utils/twUtils.d.ts +1 -1
  142. package/dist/utils/twUtils.d.ts.map +1 -1
  143. package/dist/utils/twUtils.js +1 -4
  144. package/package.json +6 -1
  145. package/dist/Icons/LineToolIcon2.d.ts +0 -5
  146. package/dist/Icons/LineToolIcon2.js +0 -49
  147. package/dist/createLucideIcon-D4r5Phnh.js +0 -70
  148. package/dist/index-CeP1E2kK.js +0 -209
  149. package/dist/index-Dy-Hzr7y.js +0 -13
package/dist/Toast.js ADDED
@@ -0,0 +1,883 @@
1
+ "use client";
2
+ import "./styles/main.css";
3
+ import { jsx as P, jsxs as Gt } from "react/jsx-runtime";
4
+ import "./Icons/AnalyzeIcon.js";
5
+ import "./Icons/AnnotationsIcon.js";
6
+ import "./Icons/ApprovedIcon.js";
7
+ import "./Icons/ArrowDownIcon.js";
8
+ import "./Icons/ArrowUpIcon.js";
9
+ import "./Icons/CalendarIcon.js";
10
+ import "./Icons/CheckCircleIcon.js";
11
+ import { CheckSquareIcon as Qt } from "./Icons/CheckSquareIcon.js";
12
+ import "./Icons/CheckmarkIcon.js";
13
+ import "./Icons/ChevronDownIcon.js";
14
+ import "./Icons/ChevronUpIcon.js";
15
+ import "./Icons/ClockIcon.js";
16
+ import { CloseCircleIcon as Jt } from "./Icons/CloseCircleIcon.js";
17
+ import "./Icons/CloseIcon.js";
18
+ import "./Icons/DashboardIcon.js";
19
+ import "./Icons/DatabaseIcon.js";
20
+ import "./Icons/DeleteIcon.js";
21
+ import "./Icons/DurationIcon.js";
22
+ import "./Icons/EditIcon.js";
23
+ import "./Icons/EmailIcon.js";
24
+ import "./Icons/EraserIcon.js";
25
+ import "./Icons/ErrorIcon.js";
26
+ import "./Icons/EyeClosedIcon.js";
27
+ import "./Icons/EyeClosedIcon2.js";
28
+ import "./Icons/EyeOpenIcon.js";
29
+ import "./Icons/GoToFirstIcon.js";
30
+ import "./Icons/GoToLastIcon.js";
31
+ import "./Icons/HarmonicCursorsIcon.js";
32
+ import { InfoIcon as Zt } from "./Icons/InfoIcon.js";
33
+ import "./Icons/KeyboardIcon.js";
34
+ import "./Icons/LabelIcon.js";
35
+ import "./Icons/LassoIcon.js";
36
+ import "./Icons/LineToolIcon.js";
37
+ import "./Icons/LiveViewIcon.js";
38
+ import "./Icons/LoaderIcon.js";
39
+ import "./Icons/LocationIcon.js";
40
+ import "./Icons/LogoutIcon.js";
41
+ import "./Icons/MeasureIcon.js";
42
+ import "./Icons/MessagesIcon.js";
43
+ import "./Icons/MetadataIcon.js";
44
+ import "./Icons/MinusIcon.js";
45
+ import "./Icons/OntologyIcon.js";
46
+ import "./Icons/PanelIconClose.js";
47
+ import "./Icons/PanelIconOpen.js";
48
+ import "./Icons/PlayIcon.js";
49
+ import "./Icons/PlusIcon.js";
50
+ import "./Icons/PolygonIcon.js";
51
+ import "./Icons/ResetIcon.js";
52
+ import "./Icons/ReviewedIcon.js";
53
+ import "./Icons/ScissorsIcon.js";
54
+ import "./Icons/SearchIcon.js";
55
+ import "./Icons/SettingsIcon.js";
56
+ import "./Icons/SortAscendingIcon.js";
57
+ import "./Icons/SortAtoZIcon.js";
58
+ import "./Icons/SortDescendingIcon.js";
59
+ import "./Icons/SortZtoAIcon.js";
60
+ import "./Icons/StackIcon.js";
61
+ import "./Icons/StarIcon.js";
62
+ import "./Icons/TrashIcon.js";
63
+ import "./Icons/UndoIcon.js";
64
+ import "./Icons/User2Icon.js";
65
+ import "./Icons/UserIcon.js";
66
+ import { WarningIcon as te } from "./Icons/WarningIcon.js";
67
+ import "./Icons/ZoomAllIcon.js";
68
+ import "./Icons/ZoomXIcon.js";
69
+ import "./Icons/ZoomYIcon.js";
70
+ import { cn as ee } from "./utils/twUtils.js";
71
+ import { c as zt } from "./index-D29mdTf5.js";
72
+ import a from "react";
73
+ import ae from "react-dom";
74
+ function oe(n) {
75
+ if (typeof document > "u") return;
76
+ let o = document.head || document.getElementsByTagName("head")[0], e = document.createElement("style");
77
+ e.type = "text/css", o.appendChild(e), e.styleSheet ? e.styleSheet.cssText = n : e.appendChild(document.createTextNode(n));
78
+ }
79
+ const se = (n) => {
80
+ switch (n) {
81
+ case "success":
82
+ return ie;
83
+ case "info":
84
+ return de;
85
+ case "warning":
86
+ return le;
87
+ case "error":
88
+ return ce;
89
+ default:
90
+ return null;
91
+ }
92
+ }, ne = Array(12).fill(0), re = ({ visible: n, className: o }) => /* @__PURE__ */ a.createElement("div", {
93
+ className: [
94
+ "sonner-loading-wrapper",
95
+ o
96
+ ].filter(Boolean).join(" "),
97
+ "data-visible": n
98
+ }, /* @__PURE__ */ a.createElement("div", {
99
+ className: "sonner-spinner"
100
+ }, ne.map((e, s) => /* @__PURE__ */ a.createElement("div", {
101
+ className: "sonner-loading-bar",
102
+ key: `spinner-bar-${s}`
103
+ })))), ie = /* @__PURE__ */ a.createElement("svg", {
104
+ xmlns: "http://www.w3.org/2000/svg",
105
+ viewBox: "0 0 20 20",
106
+ fill: "currentColor",
107
+ height: "20",
108
+ width: "20"
109
+ }, /* @__PURE__ */ a.createElement("path", {
110
+ fillRule: "evenodd",
111
+ 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",
112
+ clipRule: "evenodd"
113
+ })), le = /* @__PURE__ */ a.createElement("svg", {
114
+ xmlns: "http://www.w3.org/2000/svg",
115
+ viewBox: "0 0 24 24",
116
+ fill: "currentColor",
117
+ height: "20",
118
+ width: "20"
119
+ }, /* @__PURE__ */ a.createElement("path", {
120
+ fillRule: "evenodd",
121
+ 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",
122
+ clipRule: "evenodd"
123
+ })), de = /* @__PURE__ */ a.createElement("svg", {
124
+ xmlns: "http://www.w3.org/2000/svg",
125
+ viewBox: "0 0 20 20",
126
+ fill: "currentColor",
127
+ height: "20",
128
+ width: "20"
129
+ }, /* @__PURE__ */ a.createElement("path", {
130
+ fillRule: "evenodd",
131
+ 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",
132
+ clipRule: "evenodd"
133
+ })), ce = /* @__PURE__ */ a.createElement("svg", {
134
+ xmlns: "http://www.w3.org/2000/svg",
135
+ viewBox: "0 0 20 20",
136
+ fill: "currentColor",
137
+ height: "20",
138
+ width: "20"
139
+ }, /* @__PURE__ */ a.createElement("path", {
140
+ fillRule: "evenodd",
141
+ 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",
142
+ clipRule: "evenodd"
143
+ })), ue = /* @__PURE__ */ a.createElement("svg", {
144
+ xmlns: "http://www.w3.org/2000/svg",
145
+ width: "12",
146
+ height: "12",
147
+ viewBox: "0 0 24 24",
148
+ fill: "none",
149
+ stroke: "currentColor",
150
+ strokeWidth: "1.5",
151
+ strokeLinecap: "round",
152
+ strokeLinejoin: "round"
153
+ }, /* @__PURE__ */ a.createElement("line", {
154
+ x1: "18",
155
+ y1: "6",
156
+ x2: "6",
157
+ y2: "18"
158
+ }), /* @__PURE__ */ a.createElement("line", {
159
+ x1: "6",
160
+ y1: "6",
161
+ x2: "18",
162
+ y2: "18"
163
+ })), me = () => {
164
+ const [n, o] = a.useState(document.hidden);
165
+ return a.useEffect(() => {
166
+ const e = () => {
167
+ o(document.hidden);
168
+ };
169
+ return document.addEventListener("visibilitychange", e), () => window.removeEventListener("visibilitychange", e);
170
+ }, []), n;
171
+ };
172
+ let Tt = 1;
173
+ class fe {
174
+ constructor() {
175
+ this.subscribe = (o) => (this.subscribers.push(o), () => {
176
+ const e = this.subscribers.indexOf(o);
177
+ this.subscribers.splice(e, 1);
178
+ }), this.publish = (o) => {
179
+ this.subscribers.forEach((e) => e(o));
180
+ }, this.addToast = (o) => {
181
+ this.publish(o), this.toasts = [
182
+ ...this.toasts,
183
+ o
184
+ ];
185
+ }, this.create = (o) => {
186
+ var e;
187
+ const { message: s, ...w } = o, d = typeof o?.id == "number" || ((e = o.id) == null ? void 0 : e.length) > 0 ? o.id : Tt++, u = this.toasts.find((h) => h.id === d), v = o.dismissible === void 0 ? !0 : o.dismissible;
188
+ return this.dismissedToasts.has(d) && this.dismissedToasts.delete(d), u ? this.toasts = this.toasts.map((h) => h.id === d ? (this.publish({
189
+ ...h,
190
+ ...o,
191
+ id: d,
192
+ title: s
193
+ }), {
194
+ ...h,
195
+ ...o,
196
+ id: d,
197
+ dismissible: v,
198
+ title: s
199
+ }) : h) : this.addToast({
200
+ title: s,
201
+ ...w,
202
+ dismissible: v,
203
+ id: d
204
+ }), d;
205
+ }, this.dismiss = (o) => (o ? (this.dismissedToasts.add(o), requestAnimationFrame(() => this.subscribers.forEach((e) => e({
206
+ id: o,
207
+ dismiss: !0
208
+ })))) : this.toasts.forEach((e) => {
209
+ this.subscribers.forEach((s) => s({
210
+ id: e.id,
211
+ dismiss: !0
212
+ }));
213
+ }), o), this.message = (o, e) => this.create({
214
+ ...e,
215
+ message: o
216
+ }), this.error = (o, e) => this.create({
217
+ ...e,
218
+ message: o,
219
+ type: "error"
220
+ }), this.success = (o, e) => this.create({
221
+ ...e,
222
+ type: "success",
223
+ message: o
224
+ }), this.info = (o, e) => this.create({
225
+ ...e,
226
+ type: "info",
227
+ message: o
228
+ }), this.warning = (o, e) => this.create({
229
+ ...e,
230
+ type: "warning",
231
+ message: o
232
+ }), this.loading = (o, e) => this.create({
233
+ ...e,
234
+ type: "loading",
235
+ message: o
236
+ }), this.promise = (o, e) => {
237
+ if (!e)
238
+ return;
239
+ let s;
240
+ e.loading !== void 0 && (s = this.create({
241
+ ...e,
242
+ promise: o,
243
+ type: "loading",
244
+ message: e.loading,
245
+ description: typeof e.description != "function" ? e.description : void 0
246
+ }));
247
+ const w = Promise.resolve(o instanceof Function ? o() : o);
248
+ let d = s !== void 0, u;
249
+ const v = w.then(async (i) => {
250
+ if (u = [
251
+ "resolve",
252
+ i
253
+ ], a.isValidElement(i))
254
+ d = !1, this.create({
255
+ id: s,
256
+ type: "default",
257
+ message: i
258
+ });
259
+ else if (ge(i) && !i.ok) {
260
+ d = !1;
261
+ const t = typeof e.error == "function" ? await e.error(`HTTP error! status: ${i.status}`) : e.error, T = typeof e.description == "function" ? await e.description(`HTTP error! status: ${i.status}`) : e.description, N = typeof t == "object" && !a.isValidElement(t) ? t : {
262
+ message: t
263
+ };
264
+ this.create({
265
+ id: s,
266
+ type: "error",
267
+ description: T,
268
+ ...N
269
+ });
270
+ } else if (i instanceof Error) {
271
+ d = !1;
272
+ const t = typeof e.error == "function" ? await e.error(i) : e.error, T = typeof e.description == "function" ? await e.description(i) : e.description, N = typeof t == "object" && !a.isValidElement(t) ? t : {
273
+ message: t
274
+ };
275
+ this.create({
276
+ id: s,
277
+ type: "error",
278
+ description: T,
279
+ ...N
280
+ });
281
+ } else if (e.success !== void 0) {
282
+ d = !1;
283
+ const t = typeof e.success == "function" ? await e.success(i) : e.success, T = typeof e.description == "function" ? await e.description(i) : e.description, N = typeof t == "object" && !a.isValidElement(t) ? t : {
284
+ message: t
285
+ };
286
+ this.create({
287
+ id: s,
288
+ type: "success",
289
+ description: T,
290
+ ...N
291
+ });
292
+ }
293
+ }).catch(async (i) => {
294
+ if (u = [
295
+ "reject",
296
+ i
297
+ ], e.error !== void 0) {
298
+ d = !1;
299
+ const S = typeof e.error == "function" ? await e.error(i) : e.error, t = typeof e.description == "function" ? await e.description(i) : e.description, z = typeof S == "object" && !a.isValidElement(S) ? S : {
300
+ message: S
301
+ };
302
+ this.create({
303
+ id: s,
304
+ type: "error",
305
+ description: t,
306
+ ...z
307
+ });
308
+ }
309
+ }).finally(() => {
310
+ d && (this.dismiss(s), s = void 0), e.finally == null || e.finally.call(e);
311
+ }), h = () => new Promise((i, S) => v.then(() => u[0] === "reject" ? S(u[1]) : i(u[1])).catch(S));
312
+ return typeof s != "string" && typeof s != "number" ? {
313
+ unwrap: h
314
+ } : Object.assign(s, {
315
+ unwrap: h
316
+ });
317
+ }, this.custom = (o, e) => {
318
+ const s = e?.id || Tt++;
319
+ return this.create({
320
+ jsx: o(s),
321
+ id: s,
322
+ ...e
323
+ }), s;
324
+ }, this.getActiveToasts = () => this.toasts.filter((o) => !this.dismissedToasts.has(o.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
325
+ }
326
+ }
327
+ const k = new fe(), pe = (n, o) => {
328
+ const e = o?.id || Tt++;
329
+ return k.addToast({
330
+ title: n,
331
+ ...o,
332
+ id: e
333
+ }), e;
334
+ }, ge = (n) => n && typeof n == "object" && "ok" in n && typeof n.ok == "boolean" && "status" in n && typeof n.status == "number", he = pe, be = () => k.toasts, ve = () => k.getActiveToasts(), ye = Object.assign(he, {
335
+ success: k.success,
336
+ info: k.info,
337
+ warning: k.warning,
338
+ error: k.error,
339
+ custom: k.custom,
340
+ message: k.message,
341
+ promise: k.promise,
342
+ dismiss: k.dismiss,
343
+ loading: k.loading
344
+ }, {
345
+ getHistory: be,
346
+ getToasts: ve
347
+ });
348
+ oe("[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%)}");
349
+ function gt(n) {
350
+ return n.label !== void 0;
351
+ }
352
+ const xe = 3, we = "24px", Ee = "16px", At = 4e3, Te = 356, Ne = 14, Se = 45, ke = 200;
353
+ function O(...n) {
354
+ return n.filter(Boolean).join(" ");
355
+ }
356
+ function _e(n) {
357
+ const [o, e] = n.split("-"), s = [];
358
+ return o && s.push(o), e && s.push(e), s;
359
+ }
360
+ const Ie = (n) => {
361
+ var o, e, s, w, d, u, v, h, i;
362
+ const { invert: S, toast: t, unstyled: T, interacting: z, setHeights: N, visibleToasts: ht, heights: U, index: c, toasts: nt, expanded: X, removeToast: rt, defaultRichColors: bt, closeButton: H, style: tt, cancelButtonStyle: Y, actionButtonStyle: vt, className: it = "", descriptionClassName: yt = "", duration: et, position: A, gap: lt, expandByDefault: at, classNames: m, icons: y, closeButtonAriaLabel: $ = "Close toast" } = n, [V, B] = a.useState(null), [F, dt] = a.useState(null), [l, g] = a.useState(!1), [p, D] = a.useState(!1), [K, f] = a.useState(!1), [q, ct] = a.useState(!1), [ut, G] = a.useState(!1), [jt, xt] = a.useState(0), [Pt, St] = a.useState(0), ot = a.useRef(t.duration || et || At), kt = a.useRef(null), j = a.useRef(null), $t = c === 0, Lt = c + 1 <= ht, _ = t.type, Q = t.dismissible !== !1, Yt = t.className || "", Vt = t.descriptionClassName || "", mt = a.useMemo(() => U.findIndex((r) => r.toastId === t.id) || 0, [
363
+ U,
364
+ t.id
365
+ ]), Ft = a.useMemo(() => {
366
+ var r;
367
+ return (r = t.closeButton) != null ? r : H;
368
+ }, [
369
+ t.closeButton,
370
+ H
371
+ ]), _t = a.useMemo(() => t.duration || et || At, [
372
+ t.duration,
373
+ et
374
+ ]), wt = a.useRef(0), J = a.useRef(0), It = a.useRef(0), Z = a.useRef(null), [Wt, Ut] = A.split("-"), Dt = a.useMemo(() => U.reduce((r, b, E) => E >= mt ? r : r + b.height, 0), [
375
+ U,
376
+ mt
377
+ ]), Rt = me(), Xt = t.invert || S, Et = _ === "loading";
378
+ J.current = a.useMemo(() => mt * lt + Dt, [
379
+ mt,
380
+ Dt
381
+ ]), a.useEffect(() => {
382
+ ot.current = _t;
383
+ }, [
384
+ _t
385
+ ]), a.useEffect(() => {
386
+ g(!0);
387
+ }, []), a.useEffect(() => {
388
+ const r = j.current;
389
+ if (r) {
390
+ const b = r.getBoundingClientRect().height;
391
+ return St(b), N((E) => [
392
+ {
393
+ toastId: t.id,
394
+ height: b,
395
+ position: t.position
396
+ },
397
+ ...E
398
+ ]), () => N((E) => E.filter((I) => I.toastId !== t.id));
399
+ }
400
+ }, [
401
+ N,
402
+ t.id
403
+ ]), a.useLayoutEffect(() => {
404
+ if (!l) return;
405
+ const r = j.current, b = r.style.height;
406
+ r.style.height = "auto";
407
+ const E = r.getBoundingClientRect().height;
408
+ r.style.height = b, St(E), N((I) => I.find((x) => x.toastId === t.id) ? I.map((x) => x.toastId === t.id ? {
409
+ ...x,
410
+ height: E
411
+ } : x) : [
412
+ {
413
+ toastId: t.id,
414
+ height: E,
415
+ position: t.position
416
+ },
417
+ ...I
418
+ ]);
419
+ }, [
420
+ l,
421
+ t.title,
422
+ t.description,
423
+ N,
424
+ t.id,
425
+ t.jsx,
426
+ t.action,
427
+ t.cancel
428
+ ]);
429
+ const L = a.useCallback(() => {
430
+ D(!0), xt(J.current), N((r) => r.filter((b) => b.toastId !== t.id)), setTimeout(() => {
431
+ rt(t);
432
+ }, ke);
433
+ }, [
434
+ t,
435
+ rt,
436
+ N,
437
+ J
438
+ ]);
439
+ a.useEffect(() => {
440
+ if (t.promise && _ === "loading" || t.duration === 1 / 0 || t.type === "loading") return;
441
+ let r;
442
+ return X || z || Rt ? (() => {
443
+ if (It.current < wt.current) {
444
+ const I = (/* @__PURE__ */ new Date()).getTime() - wt.current;
445
+ ot.current = ot.current - I;
446
+ }
447
+ It.current = (/* @__PURE__ */ new Date()).getTime();
448
+ })() : ot.current !== 1 / 0 && (wt.current = (/* @__PURE__ */ new Date()).getTime(), r = setTimeout(() => {
449
+ t.onAutoClose == null || t.onAutoClose.call(t, t), L();
450
+ }, ot.current)), () => clearTimeout(r);
451
+ }, [
452
+ X,
453
+ z,
454
+ t,
455
+ _,
456
+ Rt,
457
+ L
458
+ ]), a.useEffect(() => {
459
+ t.delete && (L(), t.onDismiss == null || t.onDismiss.call(t, t));
460
+ }, [
461
+ L,
462
+ t.delete
463
+ ]);
464
+ function Kt() {
465
+ var r;
466
+ if (y?.loading) {
467
+ var b;
468
+ return /* @__PURE__ */ a.createElement("div", {
469
+ className: O(m?.loader, t == null || (b = t.classNames) == null ? void 0 : b.loader, "sonner-loader"),
470
+ "data-visible": _ === "loading"
471
+ }, y.loading);
472
+ }
473
+ return /* @__PURE__ */ a.createElement(re, {
474
+ className: O(m?.loader, t == null || (r = t.classNames) == null ? void 0 : r.loader),
475
+ visible: _ === "loading"
476
+ });
477
+ }
478
+ const qt = t.icon || y?.[_] || se(_);
479
+ var Bt, Mt;
480
+ return /* @__PURE__ */ a.createElement("li", {
481
+ tabIndex: 0,
482
+ ref: j,
483
+ className: O(it, Yt, m?.toast, t == null || (o = t.classNames) == null ? void 0 : o.toast, m?.default, m?.[_], t == null || (e = t.classNames) == null ? void 0 : e[_]),
484
+ "data-sonner-toast": "",
485
+ "data-rich-colors": (Bt = t.richColors) != null ? Bt : bt,
486
+ "data-styled": !(t.jsx || t.unstyled || T),
487
+ "data-mounted": l,
488
+ "data-promise": !!t.promise,
489
+ "data-swiped": ut,
490
+ "data-removed": p,
491
+ "data-visible": Lt,
492
+ "data-y-position": Wt,
493
+ "data-x-position": Ut,
494
+ "data-index": c,
495
+ "data-front": $t,
496
+ "data-swiping": K,
497
+ "data-dismissible": Q,
498
+ "data-type": _,
499
+ "data-invert": Xt,
500
+ "data-swipe-out": q,
501
+ "data-swipe-direction": F,
502
+ "data-expanded": !!(X || at && l),
503
+ "data-testid": t.testId,
504
+ style: {
505
+ "--index": c,
506
+ "--toasts-before": c,
507
+ "--z-index": nt.length - c,
508
+ "--offset": `${p ? jt : J.current}px`,
509
+ "--initial-height": at ? "auto" : `${Pt}px`,
510
+ ...tt,
511
+ ...t.style
512
+ },
513
+ onDragEnd: () => {
514
+ f(!1), B(null), Z.current = null;
515
+ },
516
+ onPointerDown: (r) => {
517
+ r.button !== 2 && (Et || !Q || (kt.current = /* @__PURE__ */ new Date(), xt(J.current), r.target.setPointerCapture(r.pointerId), r.target.tagName !== "BUTTON" && (f(!0), Z.current = {
518
+ x: r.clientX,
519
+ y: r.clientY
520
+ })));
521
+ },
522
+ onPointerUp: () => {
523
+ var r, b, E;
524
+ if (q || !Q) return;
525
+ Z.current = null;
526
+ const I = Number(((r = j.current) == null ? void 0 : r.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), ft = Number(((b = j.current) == null ? void 0 : b.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), x = (/* @__PURE__ */ new Date()).getTime() - ((E = kt.current) == null ? void 0 : E.getTime()), R = V === "x" ? I : ft, pt = Math.abs(R) / x;
527
+ if (Math.abs(R) >= Se || pt > 0.11) {
528
+ xt(J.current), t.onDismiss == null || t.onDismiss.call(t, t), dt(V === "x" ? I > 0 ? "right" : "left" : ft > 0 ? "down" : "up"), L(), ct(!0);
529
+ return;
530
+ } else {
531
+ var M, C;
532
+ (M = j.current) == null || M.style.setProperty("--swipe-amount-x", "0px"), (C = j.current) == null || C.style.setProperty("--swipe-amount-y", "0px");
533
+ }
534
+ G(!1), f(!1), B(null);
535
+ },
536
+ onPointerMove: (r) => {
537
+ var b, E, I;
538
+ if (!Z.current || !Q || ((b = window.getSelection()) == null ? void 0 : b.toString().length) > 0) return;
539
+ const x = r.clientY - Z.current.y, R = r.clientX - Z.current.x;
540
+ var pt;
541
+ const M = (pt = n.swipeDirections) != null ? pt : _e(A);
542
+ !V && (Math.abs(R) > 1 || Math.abs(x) > 1) && B(Math.abs(R) > Math.abs(x) ? "x" : "y");
543
+ let C = {
544
+ x: 0,
545
+ y: 0
546
+ };
547
+ const Ct = (W) => 1 / (1.5 + Math.abs(W) / 20);
548
+ if (V === "y") {
549
+ if (M.includes("top") || M.includes("bottom"))
550
+ if (M.includes("top") && x < 0 || M.includes("bottom") && x > 0)
551
+ C.y = x;
552
+ else {
553
+ const W = x * Ct(x);
554
+ C.y = Math.abs(W) < Math.abs(x) ? W : x;
555
+ }
556
+ } else if (V === "x" && (M.includes("left") || M.includes("right")))
557
+ if (M.includes("left") && R < 0 || M.includes("right") && R > 0)
558
+ C.x = R;
559
+ else {
560
+ const W = R * Ct(R);
561
+ C.x = Math.abs(W) < Math.abs(R) ? W : R;
562
+ }
563
+ (Math.abs(C.x) > 0 || Math.abs(C.y) > 0) && G(!0), (E = j.current) == null || E.style.setProperty("--swipe-amount-x", `${C.x}px`), (I = j.current) == null || I.style.setProperty("--swipe-amount-y", `${C.y}px`);
564
+ }
565
+ }, Ft && !t.jsx && _ !== "loading" ? /* @__PURE__ */ a.createElement("button", {
566
+ "aria-label": $,
567
+ "data-disabled": Et,
568
+ "data-close-button": !0,
569
+ onClick: Et || !Q ? () => {
570
+ } : () => {
571
+ L(), t.onDismiss == null || t.onDismiss.call(t, t);
572
+ },
573
+ className: O(m?.closeButton, t == null || (s = t.classNames) == null ? void 0 : s.closeButton)
574
+ }, (Mt = y?.close) != null ? Mt : ue) : null, (_ || t.icon || t.promise) && t.icon !== null && (y?.[_] !== null || t.icon) ? /* @__PURE__ */ a.createElement("div", {
575
+ "data-icon": "",
576
+ className: O(m?.icon, t == null || (w = t.classNames) == null ? void 0 : w.icon)
577
+ }, t.promise || t.type === "loading" && !t.icon ? t.icon || Kt() : null, t.type !== "loading" ? qt : null) : null, /* @__PURE__ */ a.createElement("div", {
578
+ "data-content": "",
579
+ className: O(m?.content, t == null || (d = t.classNames) == null ? void 0 : d.content)
580
+ }, /* @__PURE__ */ a.createElement("div", {
581
+ "data-title": "",
582
+ className: O(m?.title, t == null || (u = t.classNames) == null ? void 0 : u.title)
583
+ }, t.jsx ? t.jsx : typeof t.title == "function" ? t.title() : t.title), t.description ? /* @__PURE__ */ a.createElement("div", {
584
+ "data-description": "",
585
+ className: O(yt, Vt, m?.description, t == null || (v = t.classNames) == null ? void 0 : v.description)
586
+ }, typeof t.description == "function" ? t.description() : t.description) : null), /* @__PURE__ */ a.isValidElement(t.cancel) ? t.cancel : t.cancel && gt(t.cancel) ? /* @__PURE__ */ a.createElement("button", {
587
+ "data-button": !0,
588
+ "data-cancel": !0,
589
+ style: t.cancelButtonStyle || Y,
590
+ onClick: (r) => {
591
+ gt(t.cancel) && Q && (t.cancel.onClick == null || t.cancel.onClick.call(t.cancel, r), L());
592
+ },
593
+ className: O(m?.cancelButton, t == null || (h = t.classNames) == null ? void 0 : h.cancelButton)
594
+ }, t.cancel.label) : null, /* @__PURE__ */ a.isValidElement(t.action) ? t.action : t.action && gt(t.action) ? /* @__PURE__ */ a.createElement("button", {
595
+ "data-button": !0,
596
+ "data-action": !0,
597
+ style: t.actionButtonStyle || vt,
598
+ onClick: (r) => {
599
+ gt(t.action) && (t.action.onClick == null || t.action.onClick.call(t.action, r), !r.defaultPrevented && L());
600
+ },
601
+ className: O(m?.actionButton, t == null || (i = t.classNames) == null ? void 0 : i.actionButton)
602
+ }, t.action.label) : null);
603
+ };
604
+ function Ot() {
605
+ if (typeof window > "u" || typeof document > "u") return "ltr";
606
+ const n = document.documentElement.getAttribute("dir");
607
+ return n === "auto" || !n ? window.getComputedStyle(document.documentElement).direction : n;
608
+ }
609
+ function De(n, o) {
610
+ const e = {};
611
+ return [
612
+ n,
613
+ o
614
+ ].forEach((s, w) => {
615
+ const d = w === 1, u = d ? "--mobile-offset" : "--offset", v = d ? Ee : we;
616
+ function h(i) {
617
+ [
618
+ "top",
619
+ "right",
620
+ "bottom",
621
+ "left"
622
+ ].forEach((S) => {
623
+ e[`${u}-${S}`] = typeof i == "number" ? `${i}px` : i;
624
+ });
625
+ }
626
+ typeof s == "number" || typeof s == "string" ? h(s) : typeof s == "object" ? [
627
+ "top",
628
+ "right",
629
+ "bottom",
630
+ "left"
631
+ ].forEach((i) => {
632
+ s[i] === void 0 ? e[`${u}-${i}`] = v : e[`${u}-${i}`] = typeof s[i] == "number" ? `${s[i]}px` : s[i];
633
+ }) : h(v);
634
+ }), e;
635
+ }
636
+ const Re = /* @__PURE__ */ a.forwardRef(function(o, e) {
637
+ const { id: s, invert: w, position: d = "bottom-right", hotkey: u = [
638
+ "altKey",
639
+ "KeyT"
640
+ ], expand: v, closeButton: h, className: i, offset: S, mobileOffset: t, theme: T = "light", richColors: z, duration: N, style: ht, visibleToasts: U = xe, toastOptions: c, dir: nt = Ot(), gap: X = Ne, icons: rt, containerAriaLabel: bt = "Notifications" } = o, [H, tt] = a.useState([]), Y = a.useMemo(() => s ? H.filter((l) => l.toasterId === s) : H.filter((l) => !l.toasterId), [
641
+ H,
642
+ s
643
+ ]), vt = a.useMemo(() => Array.from(new Set([
644
+ d
645
+ ].concat(Y.filter((l) => l.position).map((l) => l.position)))), [
646
+ Y,
647
+ d
648
+ ]), [it, yt] = a.useState([]), [et, A] = a.useState(!1), [lt, at] = a.useState(!1), [m, y] = a.useState(T !== "system" ? T : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), $ = a.useRef(null), V = u.join("+").replace(/Key/g, "").replace(/Digit/g, ""), B = a.useRef(null), F = a.useRef(!1), dt = a.useCallback((l) => {
649
+ tt((g) => {
650
+ var p;
651
+ return (p = g.find((D) => D.id === l.id)) != null && p.delete || k.dismiss(l.id), g.filter(({ id: D }) => D !== l.id);
652
+ });
653
+ }, []);
654
+ return a.useEffect(() => k.subscribe((l) => {
655
+ if (l.dismiss) {
656
+ requestAnimationFrame(() => {
657
+ tt((g) => g.map((p) => p.id === l.id ? {
658
+ ...p,
659
+ delete: !0
660
+ } : p));
661
+ });
662
+ return;
663
+ }
664
+ setTimeout(() => {
665
+ ae.flushSync(() => {
666
+ tt((g) => {
667
+ const p = g.findIndex((D) => D.id === l.id);
668
+ return p !== -1 ? [
669
+ ...g.slice(0, p),
670
+ {
671
+ ...g[p],
672
+ ...l
673
+ },
674
+ ...g.slice(p + 1)
675
+ ] : [
676
+ l,
677
+ ...g
678
+ ];
679
+ });
680
+ });
681
+ });
682
+ }), [
683
+ H
684
+ ]), a.useEffect(() => {
685
+ if (T !== "system") {
686
+ y(T);
687
+ return;
688
+ }
689
+ if (T === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? y("dark") : y("light")), typeof window > "u") return;
690
+ const l = window.matchMedia("(prefers-color-scheme: dark)");
691
+ try {
692
+ l.addEventListener("change", ({ matches: g }) => {
693
+ y(g ? "dark" : "light");
694
+ });
695
+ } catch {
696
+ l.addListener(({ matches: p }) => {
697
+ try {
698
+ y(p ? "dark" : "light");
699
+ } catch (D) {
700
+ console.error(D);
701
+ }
702
+ });
703
+ }
704
+ }, [
705
+ T
706
+ ]), a.useEffect(() => {
707
+ H.length <= 1 && A(!1);
708
+ }, [
709
+ H
710
+ ]), a.useEffect(() => {
711
+ const l = (g) => {
712
+ var p;
713
+ if (u.every((f) => g[f] || g.code === f)) {
714
+ var K;
715
+ A(!0), (K = $.current) == null || K.focus();
716
+ }
717
+ g.code === "Escape" && (document.activeElement === $.current || (p = $.current) != null && p.contains(document.activeElement)) && A(!1);
718
+ };
719
+ return document.addEventListener("keydown", l), () => document.removeEventListener("keydown", l);
720
+ }, [
721
+ u
722
+ ]), a.useEffect(() => {
723
+ if ($.current)
724
+ return () => {
725
+ B.current && (B.current.focus({
726
+ preventScroll: !0
727
+ }), B.current = null, F.current = !1);
728
+ };
729
+ }, [
730
+ $.current
731
+ ]), // Remove item from normal navigation flow, only available via hotkey
732
+ /* @__PURE__ */ a.createElement("section", {
733
+ ref: e,
734
+ "aria-label": `${bt} ${V}`,
735
+ tabIndex: -1,
736
+ "aria-live": "polite",
737
+ "aria-relevant": "additions text",
738
+ "aria-atomic": "false",
739
+ suppressHydrationWarning: !0
740
+ }, vt.map((l, g) => {
741
+ var p;
742
+ const [D, K] = l.split("-");
743
+ return Y.length ? /* @__PURE__ */ a.createElement("ol", {
744
+ key: l,
745
+ dir: nt === "auto" ? Ot() : nt,
746
+ tabIndex: -1,
747
+ ref: $,
748
+ className: i,
749
+ "data-sonner-toaster": !0,
750
+ "data-sonner-theme": m,
751
+ "data-y-position": D,
752
+ "data-x-position": K,
753
+ style: {
754
+ "--front-toast-height": `${((p = it[0]) == null ? void 0 : p.height) || 0}px`,
755
+ "--width": `${Te}px`,
756
+ "--gap": `${X}px`,
757
+ ...ht,
758
+ ...De(S, t)
759
+ },
760
+ onBlur: (f) => {
761
+ F.current && !f.currentTarget.contains(f.relatedTarget) && (F.current = !1, B.current && (B.current.focus({
762
+ preventScroll: !0
763
+ }), B.current = null));
764
+ },
765
+ onFocus: (f) => {
766
+ f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || F.current || (F.current = !0, B.current = f.relatedTarget);
767
+ },
768
+ onMouseEnter: () => A(!0),
769
+ onMouseMove: () => A(!0),
770
+ onMouseLeave: () => {
771
+ lt || A(!1);
772
+ },
773
+ onDragEnd: () => A(!1),
774
+ onPointerDown: (f) => {
775
+ f.target instanceof HTMLElement && f.target.dataset.dismissible === "false" || at(!0);
776
+ },
777
+ onPointerUp: () => at(!1)
778
+ }, Y.filter((f) => !f.position && g === 0 || f.position === l).map((f, q) => {
779
+ var ct, ut;
780
+ return /* @__PURE__ */ a.createElement(Ie, {
781
+ key: f.id,
782
+ icons: rt,
783
+ index: q,
784
+ toast: f,
785
+ defaultRichColors: z,
786
+ duration: (ct = c?.duration) != null ? ct : N,
787
+ className: c?.className,
788
+ descriptionClassName: c?.descriptionClassName,
789
+ invert: w,
790
+ visibleToasts: U,
791
+ closeButton: (ut = c?.closeButton) != null ? ut : h,
792
+ interacting: lt,
793
+ position: l,
794
+ style: c?.style,
795
+ unstyled: c?.unstyled,
796
+ classNames: c?.classNames,
797
+ cancelButtonStyle: c?.cancelButtonStyle,
798
+ actionButtonStyle: c?.actionButtonStyle,
799
+ closeButtonAriaLabel: c?.closeButtonAriaLabel,
800
+ removeToast: dt,
801
+ toasts: Y.filter((G) => G.position == f.position),
802
+ heights: it.filter((G) => G.position == f.position),
803
+ setHeights: yt,
804
+ expandByDefault: v,
805
+ gap: X,
806
+ expanded: et,
807
+ swipeDirections: o.swipeDirections
808
+ });
809
+ })) : null;
810
+ }));
811
+ }), Be = zt("rounded-md border px-4 py-3 text-sm flex items-start gap-3 shadow-lg min-w-[300px] max-w-[420px]", {
812
+ variants: {
813
+ variant: {
814
+ default: "bg-toast-bg border-toast-border text-toast-text",
815
+ success: "bg-toast-success-bg border-toast-success-border text-toast-success-text",
816
+ error: "bg-toast-danger-bg border-toast-danger-border text-toast-danger-text",
817
+ info: "bg-toast-info-bg border-toast-info-border text-toast-info-text",
818
+ warning: "bg-toast-warning-bg border-toast-warning-border text-toast-warning-text"
819
+ }
820
+ },
821
+ defaultVariants: {
822
+ variant: "default"
823
+ }
824
+ }), Me = zt("mt-1 text-sm opacity-90", {
825
+ variants: {
826
+ variant: {
827
+ default: "text-toast-text",
828
+ success: "text-toast-success-text",
829
+ error: "text-toast-danger-text",
830
+ info: "text-toast-info-text",
831
+ warning: "text-toast-warning-text"
832
+ }
833
+ },
834
+ defaultVariants: {
835
+ variant: "default"
836
+ }
837
+ }), Ce = {
838
+ default: null,
839
+ success: /* @__PURE__ */ P(Qt, { className: "text-toast-success-icon size-5 shrink-0" }),
840
+ info: /* @__PURE__ */ P(Zt, { className: "text-toast-info-icon size-5 shrink-0" }),
841
+ warning: /* @__PURE__ */ P(te, { className: "text-toast-warning-icon size-5 shrink-0" }),
842
+ error: /* @__PURE__ */ P(Jt, { className: "text-toast-danger-icon size-5 shrink-0" })
843
+ }, Ht = ({ gap: n = 14, offset: o = 32, position: e = "bottom-right", visibleToasts: s = 3, ...w }) => /* @__PURE__ */ P(
844
+ Re,
845
+ {
846
+ position: e,
847
+ visibleToasts: s,
848
+ offset: o,
849
+ gap: n,
850
+ toastOptions: {
851
+ unstyled: !0,
852
+ classNames: {
853
+ toast: "spectral-toast"
854
+ }
855
+ },
856
+ ...w
857
+ }
858
+ );
859
+ Ht.displayName = "Toast.Provider";
860
+ const Nt = ({ className: n, containerAriaLabel: o = "Notification", dataTestId: e, icon: s, message: w, variant: d = "default" }) => {
861
+ const u = d ?? "default", v = s ?? Ce[u];
862
+ return /* @__PURE__ */ Gt("div", { "aria-label": o, className: ee(Be({ variant: u }), n), "data-variant": u, "data-testid": e ?? `spectral-toast-${u}`, role: "status", "aria-live": "polite", children: [
863
+ v && /* @__PURE__ */ P("div", { className: "mt-0.5", "aria-hidden": "true", children: v }),
864
+ /* @__PURE__ */ P("div", { className: "flex flex-col", children: /* @__PURE__ */ P("p", { className: Me({ variant: u }), children: w }) })
865
+ ] });
866
+ };
867
+ Nt.displayName = "Toast";
868
+ const st = ({ className: n, containerAriaLabel: o, dataTestId: e, duration: s = 4e3, icon: w, message: d, onAutoClose: u, position: v, variant: h = "default" }) => ye.custom((i) => /* @__PURE__ */ P(Nt, { className: n, containerAriaLabel: o, dataTestId: e, icon: w, id: i, message: d, variant: h }), {
869
+ duration: s,
870
+ onAutoClose: u,
871
+ position: v
872
+ }), Ja = Object.assign(Nt, {
873
+ Provider: Ht
874
+ }), Za = Object.assign(st, {
875
+ success: (n) => st({ ...n, variant: "success" }),
876
+ error: (n) => st({ ...n, variant: "error" }),
877
+ info: (n) => st({ ...n, variant: "info" }),
878
+ warning: (n) => st({ ...n, variant: "warning" })
879
+ });
880
+ export {
881
+ Ja as Toast,
882
+ Za as toast
883
+ };