@mechane-ai/elements 0.8.0 → 0.10.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 (94) hide show
  1. package/NOTICE +24 -0
  2. package/README.md +67 -40
  3. package/dist/ai.js +274 -209
  4. package/dist/{categorical-values-dGbaZ0tp.js → categorical-values-DLRE4EEW.js} +4 -4
  5. package/dist/{chart-frame-DgPdIguO.js → chart-frame-et6f6Vhg.js} +22 -14
  6. package/dist/{chart-input-Sac4StHN.js → chart-input-CdLkFomi.js} +2 -2
  7. package/dist/charts/cartesian.js +529 -450
  8. package/dist/charts/distribution.js +302 -261
  9. package/dist/charts/graph.js +137 -103
  10. package/dist/charts/hierarchy.js +7 -7
  11. package/dist/charts/matrix.js +187 -174
  12. package/dist/charts/timeline.js +118 -92
  13. package/dist/charts.js +1 -1
  14. package/dist/code-block-D77maJBB.js +180 -0
  15. package/dist/collections.js +388 -300
  16. package/dist/content/code.js +1 -1
  17. package/dist/content/diff.js +81 -63
  18. package/dist/content/link.js +1 -1
  19. package/dist/content/markdown.js +115 -96
  20. package/dist/content/tree.js +43 -38
  21. package/dist/{content-link-Dd8gapwc.js → content-link-BpSZeTNK.js} +6 -2
  22. package/dist/content.js +169 -150
  23. package/dist/{assets/stylex.css → elements.css} +862 -338
  24. package/dist/feedback.js +1 -1
  25. package/dist/forms/dates.js +31 -31
  26. package/dist/forms.js +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/layout.js +286 -187
  29. package/dist/navigation/commands.js +45 -42
  30. package/dist/{navigation-yxK3iQXo.js → navigation-D2_sGy3C.js} +2 -2
  31. package/dist/navigation.js +10 -10
  32. package/dist/overlays.js +1 -1
  33. package/dist/packages/ai/src/conversation.d.ts +2 -1
  34. package/dist/packages/ai/src/index.d.ts +4 -0
  35. package/dist/packages/ai/src/message-action.d.ts +10 -0
  36. package/dist/packages/ai/src/message-boundary.d.ts +6 -0
  37. package/dist/packages/ai/src/message.d.ts +2 -1
  38. package/dist/packages/charts/src/cartesian/bar-chart.d.ts +5 -0
  39. package/dist/packages/charts/src/cartesian/index.d.ts +2 -2
  40. package/dist/packages/charts/src/chart-frame.d.ts +3 -0
  41. package/dist/packages/charts/src/chart-theme.d.ts +2 -1
  42. package/dist/packages/charts/src/distribution/distribution-plot.d.ts +22 -2
  43. package/dist/packages/collections/src/collection-scroll.d.ts +2 -1
  44. package/dist/packages/collections/src/data-table.d.ts +6 -0
  45. package/dist/packages/collections/src/index.d.ts +2 -2
  46. package/dist/packages/collections/src/timeline.d.ts +10 -3
  47. package/dist/packages/content/src/diff/pierre-diff.d.ts +2 -1
  48. package/dist/packages/content/src/viewer-styles.d.ts +64 -0
  49. package/dist/packages/core/src/actions.d.ts +7 -0
  50. package/dist/packages/core/src/agent-avatar-glyphs.d.ts +5 -0
  51. package/dist/packages/core/src/agent-avatar.d.ts +17 -0
  52. package/dist/packages/core/src/copy-value.d.ts +2 -1
  53. package/dist/packages/core/src/index.d.ts +6 -2
  54. package/dist/packages/core/src/surfaces.d.ts +5 -0
  55. package/dist/packages/feedback/src/index.d.ts +4 -1
  56. package/dist/packages/feedback/src/toast.d.ts +5 -27
  57. package/dist/packages/forms/src/agent-avatar-picker.d.ts +8 -0
  58. package/dist/packages/forms/src/field-styles.d.ts +28 -0
  59. package/dist/packages/forms/src/forms.d.ts +2 -1
  60. package/dist/packages/forms/src/index.d.ts +2 -0
  61. package/dist/packages/forms/src/selection-styles.d.ts +18 -2
  62. package/dist/packages/foundations/src/overlay-styles.d.ts +3 -1
  63. package/dist/packages/foundations/src/popup-styles.d.ts +7 -0
  64. package/dist/packages/foundations/src/tokens.stylex.d.ts +61 -0
  65. package/dist/packages/layout/src/app-shell.d.ts +2 -1
  66. package/dist/packages/layout/src/frame.stylex.d.ts +1 -0
  67. package/dist/packages/layout/src/index.d.ts +2 -1
  68. package/dist/packages/layout/src/page-toolbar.d.ts +3 -1
  69. package/dist/packages/layout/src/sidebar.d.ts +7 -1
  70. package/dist/packages/layout/src/view-stack.d.ts +13 -0
  71. package/dist/packages/layout/src/workbench.d.ts +5 -2
  72. package/dist/packages/overlays/src/alert-dialog.d.ts +5 -2
  73. package/dist/packages/overlays/src/dialog.d.ts +7 -3
  74. package/dist/pierre-diff--zsiHCCB.js +71 -0
  75. package/dist/pierre-theme-D9hnHv3Z.js +126 -0
  76. package/dist/{pierre-tree-DdE1boiT.js → pierre-tree-BFxEuxwb.js} +3 -3
  77. package/dist/src-Be7NLG8c.js +1242 -0
  78. package/dist/src-CBspCKfO.js +969 -0
  79. package/dist/src-Cs0dRc4X.js +617 -0
  80. package/dist/src-sU9b0oZW.js +1168 -0
  81. package/dist/theme.js +1 -1
  82. package/dist/tokens.js +69 -10
  83. package/dist/viewer-styles-CpHqp5Qv.js +70 -0
  84. package/package.json +2 -1
  85. package/packages/foundations/src/tokens.stylex.ts +61 -0
  86. package/styles.css +1 -1
  87. package/dist/code-block-BRNdtTaP.js +0 -175
  88. package/dist/pierre-diff-CZdzgiYm.js +0 -66
  89. package/dist/pierre-theme-BpESNIsV.js +0 -96
  90. package/dist/popup-styles-CvtZDE2t.js +0 -135
  91. package/dist/src-Bc5sEhdO.js +0 -680
  92. package/dist/src-CfDf8TY8.js +0 -466
  93. package/dist/src-DV0BNk1M.js +0 -360
  94. package/dist/src-Eg_ytPjv.js +0 -1107
@@ -0,0 +1,969 @@
1
+ import { i as e, s as t } from "./src-sU9b0oZW.js";
2
+ import { t as n } from "./accessibility-C-aIZ1Yx.js";
3
+ import { layers as r, spacing as i } from "./tokens.js";
4
+ import { mergeProps as a } from "@base-ui/react/merge-props";
5
+ import * as o from "@stylexjs/stylex";
6
+ import s, { createContext as c, useContext as l, useEffect as u, useState as d } from "react";
7
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
8
+ import { Box as m, CircleCheck as h, CircleX as ee, Info as g, LoaderCircle as _, TriangleAlert as v, X as y } from "lucide-react";
9
+ import { Meter as b } from "@base-ui/react/meter";
10
+ import { Progress as x } from "@base-ui/react/progress";
11
+ import S from "react-dom";
12
+ // packages/feedback/src/feedback.tsx
13
+ function C({ title: n, children: r, action: i, ...o }) {
14
+ return /* @__PURE__ */ p("div", {
15
+ ...a({ className: "x78zum5 xdt5ytf x6s0dn4 xl56j7k x2b8uid xeuugli x193iq5w x9f619 x9w77qv xnx3t7k x1n8ia3y x1hz01jw xj57cvi xvmahel xj0a0fe" }, o),
16
+ children: [
17
+ /* @__PURE__ */ f(m, {
18
+ size: 22,
19
+ "aria-hidden": !0,
20
+ className: "x153jb6y x2lah0s"
21
+ }),
22
+ /* @__PURE__ */ f(t, { children: n }),
23
+ r != null && /* @__PURE__ */ f(e, { children: r }),
24
+ i != null && /* @__PURE__ */ f("div", {
25
+ className: "x78zum5 xl56j7k x1a02dak x1hnptsi xeuugli x193iq5w",
26
+ children: i
27
+ })
28
+ ]
29
+ });
30
+ }
31
+ function w({ error: e = !1, ...t }) {
32
+ return /* @__PURE__ */ f("div", { ...a({ role: e ? "alert" : "status" }, {
33
+ 0: { className: "xeuugli x193iq5w x9f619 x1qokhjc x1doqdfy x1ok0vyi x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi x1dqe72f x1f9ixgr xj0a0fe" },
34
+ 1: { className: "xeuugli x193iq5w x9f619 x1qokhjc x1doqdfy x1ok0vyi x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi xj0a0fe xr5kp14 xcqwzn" }
35
+ }[!!e | 0], t) });
36
+ }
37
+ // packages/feedback/src/skeleton.tsx
38
+ var T = {
39
+ skeleton: {
40
+ k1xSpc: "x1lliihq",
41
+ ks0D6T: "x193iq5w",
42
+ kWkggS: "x1fa40ue",
43
+ kaIpWk: "x1ok0vyi",
44
+ kmuXW: "x2lah0s",
45
+ $$css: !0
46
+ },
47
+ dimensions: (e, t) => [{
48
+ kzqmXN: e == null ? e : "x5lhr3w",
49
+ kZKoxP: t == null ? t : "x16ye13r",
50
+ $$css: !0
51
+ }, {
52
+ "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e),
53
+ "--x-height": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(t)
54
+ }],
55
+ width: (e) => [{
56
+ kzqmXN: e == null ? e : "x5lhr3w",
57
+ $$css: !0
58
+ }, { "--x-width": ((e) => typeof e == "number" ? e + "px" : e ?? void 0)(e) }],
59
+ circle: {
60
+ kaIpWk: "x16rqkct",
61
+ $$css: !0
62
+ },
63
+ rectangle: { $$css: !0 },
64
+ text: {
65
+ k1xSpc: "x3nfvp2",
66
+ kXwgrk: "xdt5ytf",
67
+ k7Eaqz: "xeuugli",
68
+ ks0D6T: "x193iq5w",
69
+ kXLuUW: "x16dsc37",
70
+ $$css: !0
71
+ },
72
+ label: {
73
+ k7Eaqz: "xeuugli",
74
+ $$css: !0
75
+ }
76
+ }, E = {
77
+ rectangle: T.rectangle,
78
+ circle: T.circle
79
+ };
80
+ function D({ width: e = "100%", height: t = 8, shape: n = "rectangle" }) {
81
+ return /* @__PURE__ */ f("span", {
82
+ "aria-hidden": !0,
83
+ ...o.props(T.skeleton, T.dimensions(e, t), E[n])
84
+ });
85
+ }
86
+ function O({ lines: e = 1, width: t = "100%" }) {
87
+ return /* @__PURE__ */ f("span", {
88
+ "aria-hidden": !0,
89
+ ...o.props(T.text, T.width(t)),
90
+ children: Array.from({ length: e }, (t, n) => /* @__PURE__ */ f("span", {
91
+ className: "x78zum5 x6s0dn4 xg2ss61",
92
+ children: /* @__PURE__ */ f(D, {
93
+ width: e > 1 && n === e - 1 ? "65%" : "100%",
94
+ height: "0.6em"
95
+ })
96
+ }, `placeholder-${n}`))
97
+ });
98
+ }
99
+ function k({ label: e, showLabel: t = !1 }) {
100
+ return /* @__PURE__ */ p("span", {
101
+ role: "status",
102
+ className: "x3nfvp2 x1n2onr6 x6s0dn4 xeuugli x193iq5w x1hnptsi x153jb6y x1hz01jw xtqrqnz x1778rvt xj57cvi xj0a0fe",
103
+ children: [/* @__PURE__ */ f(_, {
104
+ "aria-hidden": !0,
105
+ className: "xtwnzbg x18utl2x x2lah0s"
106
+ }), /* @__PURE__ */ f("span", {
107
+ ...o.props(T.label, !t && n.hidden),
108
+ children: e
109
+ })]
110
+ });
111
+ }
112
+ // packages/feedback/src/loading.tsx
113
+ function A({ label: e, shape: t = "rows" }) {
114
+ return /* @__PURE__ */ p("div", {
115
+ role: "status",
116
+ className: "xeuugli x1n2onr6",
117
+ children: [/* @__PURE__ */ f("span", {
118
+ ...o.props(n.hidden),
119
+ children: e
120
+ }), t === "rows" ? /* @__PURE__ */ p("div", {
121
+ "aria-hidden": !0,
122
+ children: [/* @__PURE__ */ f("div", {
123
+ className: "xrvj5dj x18zg5m9 x6s0dn4 x9f619 x1hyy85k xso031l x1q0q8m5 x1qndepd",
124
+ children: /* @__PURE__ */ f("div", {
125
+ className: "xeuugli x1m92p3w",
126
+ children: /* @__PURE__ */ f(D, { width: 54 })
127
+ })
128
+ }), [
129
+ 0,
130
+ 1,
131
+ 2
132
+ ].map((e) => /* @__PURE__ */ p("div", {
133
+ className: "xrvj5dj x18zg5m9 x6s0dn4 xb4ss6y x9f619",
134
+ children: [
135
+ /* @__PURE__ */ f("div", {
136
+ className: "xeuugli x1m92p3w",
137
+ children: /* @__PURE__ */ f(D, { width: e === 1 ? 108 : 174 })
138
+ }),
139
+ /* @__PURE__ */ f("div", {
140
+ className: "xeuugli x1m92p3w",
141
+ children: /* @__PURE__ */ f(D, { width: 54 })
142
+ }),
143
+ /* @__PURE__ */ f("div", {
144
+ className: "xeuugli x1m92p3w",
145
+ children: /* @__PURE__ */ f(D, { width: 108 })
146
+ })
147
+ ]
148
+ }, e))]
149
+ }) : /* @__PURE__ */ p("div", {
150
+ "aria-hidden": !0,
151
+ className: "xrvj5dj xaml1ju x1ydxw8w",
152
+ children: [
153
+ /* @__PURE__ */ f(D, {
154
+ width: 216,
155
+ height: 24
156
+ }),
157
+ /* @__PURE__ */ f(D, { width: 174 }),
158
+ /* @__PURE__ */ f(D, { width: 108 })
159
+ ]
160
+ })]
161
+ });
162
+ }
163
+ // packages/feedback/src/progress.tsx
164
+ function j({ label: e, value: t, max: n, valueLabel: r }) {
165
+ return /* @__PURE__ */ p(x.Root, {
166
+ value: t,
167
+ max: n,
168
+ locale: "en-US",
169
+ getAriaValueText: () => r,
170
+ className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
171
+ children: [/* @__PURE__ */ p("div", {
172
+ className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
173
+ children: [/* @__PURE__ */ f(x.Label, {
174
+ className: "xeuugli x193iq5w",
175
+ children: e
176
+ }), /* @__PURE__ */ f("span", {
177
+ className: "xeuugli x193iq5w x153jb6y xss6m8b",
178
+ children: r
179
+ })]
180
+ }), /* @__PURE__ */ f(x.Track, {
181
+ ...{
182
+ 0: { className: "xqu0tyb xh8yej3 x1ok0vyi x1fa40ue xb3r6kr" },
183
+ 1: { className: "xqu0tyb xh8yej3 x1ok0vyi xb3r6kr x1r7kqkb xmkeg23 xbsl7fq xqrc7c3 x9f619" }
184
+ }[t === null | 0],
185
+ children: t !== null && /* @__PURE__ */ f(x.Indicator, { className: "x5yr21d x1pt885t x1ok0vyi" })
186
+ })]
187
+ });
188
+ }
189
+ function M({ label: e, value: t, max: n, valueLabel: r }) {
190
+ return t === null ? /* @__PURE__ */ p("div", {
191
+ className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
192
+ children: [/* @__PURE__ */ p("div", {
193
+ className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
194
+ children: [/* @__PURE__ */ f("span", {
195
+ className: "xeuugli x193iq5w",
196
+ children: e
197
+ }), /* @__PURE__ */ f("span", {
198
+ className: "xeuugli x193iq5w x153jb6y xss6m8b",
199
+ children: r
200
+ })]
201
+ }), /* @__PURE__ */ f("div", {
202
+ "aria-hidden": !0,
203
+ className: "xqu0tyb xh8yej3 x1ok0vyi xb3r6kr x1r7kqkb xmkeg23 xbsl7fq xqrc7c3 x9f619"
204
+ })]
205
+ }) : /* @__PURE__ */ p(b.Root, {
206
+ value: t,
207
+ max: n,
208
+ locale: "en-US",
209
+ getAriaValueText: () => r,
210
+ className: "x78zum5 xdt5ytf x1hnptsi xh8yej3 xeuugli x1hz01jw xtqrqnz x1778rvt xj57cvi xbixft xj0a0fe",
211
+ children: [/* @__PURE__ */ p("div", {
212
+ className: "x78zum5 x1pha0wt x1qughib x1n8ia3y x1a02dak",
213
+ children: [/* @__PURE__ */ f(b.Label, {
214
+ className: "xeuugli x193iq5w",
215
+ children: e
216
+ }), /* @__PURE__ */ f("span", {
217
+ className: "xeuugli x193iq5w x153jb6y xss6m8b",
218
+ children: r
219
+ })]
220
+ }), /* @__PURE__ */ f(b.Track, {
221
+ className: "xqu0tyb xh8yej3 x1ok0vyi x1fa40ue xb3r6kr",
222
+ children: /* @__PURE__ */ f(b.Indicator, { className: "x5yr21d x1pt885t x1ok0vyi" })
223
+ })]
224
+ });
225
+ }
226
+ // ../../../node_modules/.pnpm/sonner@2.0.8_@types+react@19.3.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/sonner/dist/index.mjs
227
+ var te = (e) => {
228
+ switch (e) {
229
+ case "success": return F;
230
+ case "info": return L;
231
+ case "warning": return I;
232
+ case "error": return R;
233
+ default: return null;
234
+ }
235
+ }, N = Array(12).fill(0), P = ({ visible: e, className: t }) => /*#__PURE__*/ s.createElement("div", {
236
+ className: ["sonner-loading-wrapper", t].filter(Boolean).join(" "),
237
+ "data-visible": e
238
+ }, /*#__PURE__*/ s.createElement("div", { className: "sonner-spinner" }, N.map((e, t) => /*#__PURE__*/ s.createElement("div", {
239
+ className: "sonner-loading-bar",
240
+ key: `spinner-bar-${t}`
241
+ })))), F = /*#__PURE__*/ s.createElement("svg", {
242
+ xmlns: "http://www.w3.org/2000/svg",
243
+ viewBox: "0 0 20 20",
244
+ fill: "currentColor",
245
+ height: "20",
246
+ width: "20",
247
+ "aria-hidden": "true"
248
+ }, /*#__PURE__*/ s.createElement("path", {
249
+ fillRule: "evenodd",
250
+ 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",
251
+ clipRule: "evenodd"
252
+ })), I = /*#__PURE__*/ s.createElement("svg", {
253
+ xmlns: "http://www.w3.org/2000/svg",
254
+ viewBox: "0 0 24 24",
255
+ fill: "currentColor",
256
+ height: "20",
257
+ width: "20",
258
+ "aria-hidden": "true"
259
+ }, /*#__PURE__*/ s.createElement("path", {
260
+ fillRule: "evenodd",
261
+ 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",
262
+ clipRule: "evenodd"
263
+ })), L = /*#__PURE__*/ s.createElement("svg", {
264
+ xmlns: "http://www.w3.org/2000/svg",
265
+ viewBox: "0 0 20 20",
266
+ fill: "currentColor",
267
+ height: "20",
268
+ width: "20",
269
+ "aria-hidden": "true"
270
+ }, /*#__PURE__*/ s.createElement("path", {
271
+ fillRule: "evenodd",
272
+ 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",
273
+ clipRule: "evenodd"
274
+ })), R = /*#__PURE__*/ s.createElement("svg", {
275
+ xmlns: "http://www.w3.org/2000/svg",
276
+ viewBox: "0 0 20 20",
277
+ fill: "currentColor",
278
+ height: "20",
279
+ width: "20",
280
+ "aria-hidden": "true"
281
+ }, /*#__PURE__*/ s.createElement("path", {
282
+ fillRule: "evenodd",
283
+ 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",
284
+ clipRule: "evenodd"
285
+ })), ne = /*#__PURE__*/ s.createElement("svg", {
286
+ xmlns: "http://www.w3.org/2000/svg",
287
+ width: "12",
288
+ height: "12",
289
+ viewBox: "0 0 24 24",
290
+ fill: "none",
291
+ stroke: "currentColor",
292
+ strokeWidth: "1.5",
293
+ strokeLinecap: "round",
294
+ strokeLinejoin: "round",
295
+ "aria-hidden": "true"
296
+ }, /*#__PURE__*/ s.createElement("line", {
297
+ x1: "18",
298
+ y1: "6",
299
+ x2: "6",
300
+ y2: "18"
301
+ }), /*#__PURE__*/ s.createElement("line", {
302
+ x1: "6",
303
+ y1: "6",
304
+ x2: "18",
305
+ y2: "18"
306
+ })), re = () => {
307
+ let [e, t] = s.useState(document.hidden);
308
+ return s.useEffect(() => {
309
+ let e = () => {
310
+ t(document.hidden);
311
+ };
312
+ return document.addEventListener("visibilitychange", e), () => document.removeEventListener("visibilitychange", e);
313
+ }, []), e;
314
+ }, ie = 1, ae = 100, oe = (e) => typeof e?.id == "number" || e?.id?.length > 0 ? e.id : ie++, z = new class {
315
+ constructor() {
316
+ this.subscribe = (e) => (this.subscribers.push(e), this.getActiveToasts().forEach((t) => e(t)), () => {
317
+ let t = this.subscribers.indexOf(e);
318
+ this.subscribers.splice(t, 1);
319
+ }), this.publish = (e) => {
320
+ this.subscribers.forEach((t) => t(e));
321
+ }, this.addToast = (e) => {
322
+ this.publish(e), this.toasts = [...this.toasts, e], this.trimHistory();
323
+ }, this.trimHistory = () => {
324
+ let e = this.toasts.length - ae;
325
+ e <= 0 || (this.toasts = this.toasts.filter((t) => e > 0 && this.dismissedToasts.has(t.id) ? (this.dismissedToasts.delete(t.id), e--, !1) : !0));
326
+ }, this.create = (e) => {
327
+ let { message: t, ...n } = e, r = oe(e), i = this.pendingDismissals.get(r);
328
+ i !== void 0 && (cancelAnimationFrame(i), this.pendingDismissals.delete(r), this.dismissedToasts.delete(r));
329
+ let a = this.dismissedToasts.has(r), o = e.dismissible === void 0 || e.dismissible;
330
+ return a && (this.dismissedToasts.delete(r), this.toasts = this.toasts.filter((e) => e.id !== r)), !a && this.toasts.find((e) => e.id === r) ? this.toasts = this.toasts.map((n) => n.id === r ? (this.publish({
331
+ ...n,
332
+ ...e,
333
+ id: r,
334
+ title: t
335
+ }), {
336
+ ...n,
337
+ ...e,
338
+ id: r,
339
+ dismissible: o,
340
+ title: t
341
+ }) : n) : this.addToast({
342
+ title: t,
343
+ ...n,
344
+ dismissible: o,
345
+ id: r
346
+ }), r;
347
+ }, this.dismiss = (e) => {
348
+ if (e == null) return this.getActiveToasts().forEach((e) => {
349
+ this.dismissedToasts.add(e.id), this.subscribers.forEach((t) => t({
350
+ id: e.id,
351
+ dismiss: !0
352
+ }));
353
+ }), e;
354
+ this.dismissedToasts.add(e);
355
+ let t = this.pendingDismissals.get(e);
356
+ return t !== void 0 && cancelAnimationFrame(t), this.pendingDismissals.set(e, requestAnimationFrame(() => {
357
+ this.pendingDismissals.delete(e), this.subscribers.forEach((t) => t({
358
+ id: e,
359
+ dismiss: !0
360
+ }));
361
+ })), e;
362
+ }, this.message = (e, t) => this.create({
363
+ ...t,
364
+ message: e,
365
+ type: void 0
366
+ }), this.error = (e, t) => this.create({
367
+ ...t,
368
+ message: e,
369
+ type: "error"
370
+ }), this.success = (e, t) => this.create({
371
+ ...t,
372
+ type: "success",
373
+ message: e
374
+ }), this.info = (e, t) => this.create({
375
+ ...t,
376
+ type: "info",
377
+ message: e
378
+ }), this.warning = (e, t) => this.create({
379
+ ...t,
380
+ type: "warning",
381
+ message: e
382
+ }), this.loading = (e, t) => this.create({
383
+ ...t,
384
+ type: "loading",
385
+ message: e
386
+ }), this.promise = (e, t) => {
387
+ if (!t) return;
388
+ let n;
389
+ t.loading !== void 0 && (n = this.create({
390
+ ...t,
391
+ promise: e,
392
+ type: "loading",
393
+ message: t.loading,
394
+ description: typeof t.description == "function" ? void 0 : t.description
395
+ }));
396
+ let r = Promise.resolve(e instanceof Function ? e() : e), i = n !== void 0, a, o = r.then(async (e) => {
397
+ if (a = ["resolve", e], s.isValidElement(e)) i = !1, this.create({
398
+ id: n,
399
+ type: "default",
400
+ message: e
401
+ });
402
+ else if (ce(e) && !e.ok) {
403
+ i = !1;
404
+ let r = typeof t.error == "function" ? await t.error(`HTTP error! status: ${e.status}`) : t.error, a = typeof t.description == "function" ? await t.description(`HTTP error! status: ${e.status}`) : t.description, o = typeof r == "object" && !s.isValidElement(r) ? r : { message: r };
405
+ this.create({
406
+ id: n,
407
+ type: "error",
408
+ description: a,
409
+ ...o
410
+ });
411
+ } else if (e instanceof Error) {
412
+ i = !1;
413
+ let r = typeof t.error == "function" ? await t.error(e) : t.error, a = typeof t.description == "function" ? await t.description(e) : t.description, o = typeof r == "object" && !s.isValidElement(r) ? r : { message: r };
414
+ this.create({
415
+ id: n,
416
+ type: "error",
417
+ description: a,
418
+ ...o
419
+ });
420
+ } else if (t.success !== void 0) {
421
+ i = !1;
422
+ let r = typeof t.success == "function" ? await t.success(e) : t.success, a = typeof t.description == "function" ? await t.description(e) : t.description, o = typeof r == "object" && !s.isValidElement(r) ? r : { message: r };
423
+ this.create({
424
+ id: n,
425
+ type: "success",
426
+ description: a,
427
+ ...o
428
+ });
429
+ }
430
+ }).catch(async (e) => {
431
+ if (a = ["reject", e], t.error !== void 0) {
432
+ i = !1;
433
+ let r = typeof t.error == "function" ? await t.error(e) : t.error, a = typeof t.description == "function" ? await t.description(e) : t.description, o = typeof r == "object" && !s.isValidElement(r) ? r : { message: r };
434
+ this.create({
435
+ id: n,
436
+ type: "error",
437
+ description: a,
438
+ ...o
439
+ });
440
+ }
441
+ }).finally(() => {
442
+ i && (this.dismiss(n), n = void 0), t.finally == null || t.finally.call(t);
443
+ }), c = () => new Promise((e, t) => o.then(() => a[0] === "reject" ? t(a[1]) : e(a[1])).catch(t));
444
+ return typeof n != "string" && typeof n != "number" ? { unwrap: c } : Object.assign(n, { unwrap: c });
445
+ }, this.custom = (e, t) => {
446
+ let n = oe(t);
447
+ return this.create({
448
+ ...t,
449
+ jsx: e(n),
450
+ id: n,
451
+ type: void 0
452
+ }), n;
453
+ }, this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set(), this.pendingDismissals = /* @__PURE__ */ new Map();
454
+ }
455
+ }(), se = (e, t) => z.message(e, t), ce = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", B = Object.assign(se, {
456
+ success: z.success,
457
+ info: z.info,
458
+ warning: z.warning,
459
+ error: z.error,
460
+ custom: z.custom,
461
+ message: z.message,
462
+ promise: z.promise,
463
+ dismiss: z.dismiss,
464
+ loading: z.loading
465
+ }, {
466
+ getHistory: () => z.toasts,
467
+ getToasts: () => z.getActiveToasts()
468
+ });
469
+ function V(e) {
470
+ return e.label !== void 0;
471
+ }
472
+ var H = 3, U = "24px", le = "16px", ue = 4e3, de = 356, W = 14, fe = 45, pe = 200;
473
+ function G(...e) {
474
+ return e.filter(Boolean).join(" ");
475
+ }
476
+ function me(e) {
477
+ let [t, n] = e.split("-"), r = [];
478
+ return t && r.push(t), n && r.push(n), r;
479
+ }
480
+ var he = (e) => {
481
+ let { invert: t, toast: n, unstyled: r, interacting: i, setHeights: a, visibleToasts: o, heights: c, index: l, toasts: u, expanded: d, removeToast: f, defaultRichColors: p, closeButton: m, style: h, cancelButtonStyle: ee, actionButtonStyle: g, className: _ = "", descriptionClassName: v = "", duration: y, position: b, gap: x, expandByDefault: S, classNames: C, icons: w, closeButtonAriaLabel: T = "Close toast" } = e, [E, D] = s.useState(null), [O, k] = s.useState(null), [A, j] = s.useState(!1), [M, N] = s.useState(!1), [F, I] = s.useState(!1), [L, R] = s.useState(!1), [ie, ae] = s.useState(!1), [oe, z] = s.useState(0), [se, ce] = s.useState(0), B = s.useRef(n.duration || y || ue), H = s.useRef(null), U = s.useRef(null), le = l === 0, de = l + 1 <= o, W = n.type, he = W ?? "default", K = n.dismissible !== !1, ge = n.className || "", _e = n.descriptionClassName || "", q = s.useMemo(() => c.findIndex((e) => e.toastId === n.id) || 0, [c, n.id]), ve = s.useMemo(() => n.closeButton ?? m, [n.closeButton, m]), J = s.useMemo(() => n.duration || y || ue, [n.duration, y]), Y = s.useRef(0), X = s.useRef(0), ye = s.useRef(0), Z = s.useRef(null), [be, xe] = b.split("-"), Se = s.useMemo(() => c.reduce((e, t, n) => n >= q ? e : e + t.height, 0), [c, q]), Ce = re(), Q = s.useMemo(() => e.swipeDirections ?? me(b), [e.swipeDirections, b]), we = n.invert || t, Te = W === "loading";
482
+ X.current = s.useMemo(() => q * x + Se, [q, Se]), s.useEffect(() => {
483
+ B.current = J;
484
+ }, [J]), s.useEffect(() => {
485
+ j(!0);
486
+ }, []), s.useEffect(() => {
487
+ let e = U.current;
488
+ if (e) {
489
+ let t = e.getBoundingClientRect().height;
490
+ return ce(t), a((e) => [{
491
+ toastId: n.id,
492
+ height: t,
493
+ position: n.position
494
+ }, ...e]), () => a((e) => e.filter((e) => e.toastId !== n.id));
495
+ }
496
+ }, [a, n.id]), s.useLayoutEffect(() => {
497
+ if (!A) return;
498
+ let e = U.current, t = e.style.height;
499
+ e.style.height = "auto";
500
+ let r = e.getBoundingClientRect().height;
501
+ e.style.height = t, ce(r), a((e) => e.find((e) => e.toastId === n.id) ? e.map((e) => e.toastId === n.id ? {
502
+ ...e,
503
+ height: r
504
+ } : e) : [{
505
+ toastId: n.id,
506
+ height: r,
507
+ position: n.position
508
+ }, ...e]);
509
+ }, [
510
+ A,
511
+ n.title,
512
+ n.description,
513
+ a,
514
+ n.id,
515
+ n.jsx,
516
+ n.action,
517
+ n.cancel
518
+ ]);
519
+ let $ = s.useCallback(() => {
520
+ N(!0), z(X.current), a((e) => e.filter((e) => e.toastId !== n.id)), setTimeout(() => {
521
+ f(n);
522
+ }, pe);
523
+ }, [
524
+ n,
525
+ f,
526
+ a,
527
+ X
528
+ ]);
529
+ s.useEffect(() => {
530
+ if (n.promise && W === "loading" || n.duration === Infinity || n.type === "loading") return;
531
+ let e;
532
+ return d || i || Ce ? (() => {
533
+ if (ye.current < Y.current) {
534
+ let e = (/* @__PURE__ */ new Date()).getTime() - Y.current;
535
+ B.current -= e;
536
+ }
537
+ ye.current = (/* @__PURE__ */ new Date()).getTime();
538
+ })() : B.current !== Infinity && (Y.current = (/* @__PURE__ */ new Date()).getTime(), e = setTimeout(() => {
539
+ n.onAutoClose == null || n.onAutoClose.call(n, n), $();
540
+ }, B.current)), () => clearTimeout(e);
541
+ }, [
542
+ d,
543
+ i,
544
+ n,
545
+ W,
546
+ Ce,
547
+ $
548
+ ]), s.useEffect(() => {
549
+ n.delete && ($(), n.onDismiss == null || n.onDismiss.call(n, n));
550
+ }, [$, n.delete]);
551
+ function Ee() {
552
+ return w?.loading ? /*#__PURE__*/ s.createElement("div", {
553
+ className: G(C?.loader, n?.classNames?.loader, "sonner-loader"),
554
+ "data-visible": W === "loading"
555
+ }, w.loading) : /*#__PURE__*/ s.createElement(P, {
556
+ className: G(C?.loader, n?.classNames?.loader),
557
+ visible: W === "loading"
558
+ });
559
+ }
560
+ let De = n.icon || w?.[W] || te(W);
561
+ return /*#__PURE__*/ s.createElement("li", {
562
+ tabIndex: 0,
563
+ ref: U,
564
+ className: G(_, ge, C?.toast, n?.classNames?.toast, C?.[he], n?.classNames?.[he]),
565
+ "data-sonner-toast": "",
566
+ "data-rich-colors": n.richColors ?? p,
567
+ "data-styled": !(n.jsx || n.unstyled || r),
568
+ "data-mounted": A,
569
+ "data-promise": !!n.promise,
570
+ "data-swiped": ie,
571
+ "data-removed": M,
572
+ "data-visible": de,
573
+ "data-y-position": be,
574
+ "data-x-position": xe,
575
+ "data-index": l,
576
+ "data-front": le,
577
+ "data-swiping": F,
578
+ "data-dismissible": K,
579
+ "data-type": W,
580
+ "data-invert": we,
581
+ "data-swipe-out": L,
582
+ "data-swipe-direction": O,
583
+ "data-expanded": !!(d || S && A),
584
+ "data-testid": n.testId,
585
+ style: {
586
+ "--index": l,
587
+ "--toasts-before": l,
588
+ "--z-index": u.length - l,
589
+ "--offset": `${M ? oe : X.current}px`,
590
+ "--initial-height": S ? "auto" : `${se}px`,
591
+ ...h,
592
+ ...n.style
593
+ },
594
+ onDragEnd: () => {
595
+ I(!1), D(null), Z.current = null;
596
+ },
597
+ onPointerDown: (e) => {
598
+ e.button !== 2 && !Te && K && (H.current = /* @__PURE__ */ new Date(), z(X.current), e.target.setPointerCapture(e.pointerId), e.target.tagName !== "BUTTON" && (I(!0), Z.current = {
599
+ x: e.clientX,
600
+ y: e.clientY
601
+ }));
602
+ },
603
+ onPointerUp: () => {
604
+ if (L || !K) return;
605
+ Z.current = null;
606
+ let e = Number(U.current?.style.getPropertyValue("--swipe-amount-x").replace("px", "") || 0), t = Number(U.current?.style.getPropertyValue("--swipe-amount-y").replace("px", "") || 0), r = (/* @__PURE__ */ new Date()).getTime() - H.current?.getTime(), i = E === "x" ? e : t, a = Math.abs(i) / r;
607
+ if ((E === "x" ? Q.includes(e > 0 ? "right" : "left") : Q.includes(t > 0 ? "bottom" : "top")) && (Math.abs(i) >= fe || a > .11)) z(X.current), n.onDismiss == null || n.onDismiss.call(n, n), k(E === "x" ? e > 0 ? "right" : "left" : t > 0 ? "down" : "up"), $(), R(!0);
608
+ else {
609
+ var o, s;
610
+ (o = U.current) == null || o.style.setProperty("--swipe-amount-x", "0px"), (s = U.current) == null || s.style.setProperty("--swipe-amount-y", "0px"), ae(!1), I(!1), D(null);
611
+ }
612
+ },
613
+ onPointerMove: (e) => {
614
+ var t, n;
615
+ if (!Z.current || !K || window.getSelection()?.toString().length > 0) return;
616
+ let r = e.clientY - Z.current.y, i = e.clientX - Z.current.x;
617
+ !E && (Math.abs(i) > 1 || Math.abs(r) > 1) && D(Math.abs(i) > Math.abs(r) ? "x" : "y");
618
+ let a = {
619
+ x: 0,
620
+ y: 0
621
+ }, o = (e) => 1 / (1.5 + Math.abs(e) / 20);
622
+ if (E === "y") {
623
+ if (Q.includes("top") || Q.includes("bottom")) {
624
+ if (Q.includes("top") && r < 0 || Q.includes("bottom") && r > 0) a.y = r;
625
+ else {
626
+ let e = r * o(r);
627
+ a.y = Math.abs(e) < Math.abs(r) ? e : r;
628
+ }
629
+ }
630
+ } else if (E === "x" && (Q.includes("left") || Q.includes("right"))) {
631
+ if (Q.includes("left") && i < 0 || Q.includes("right") && i > 0) a.x = i;
632
+ else {
633
+ let e = i * o(i);
634
+ a.x = Math.abs(e) < Math.abs(i) ? e : i;
635
+ }
636
+ }
637
+ (Math.abs(a.x) > 0 || Math.abs(a.y) > 0) && ae(!0), (t = U.current) == null || t.style.setProperty("--swipe-amount-x", `${a.x}px`), (n = U.current) == null || n.style.setProperty("--swipe-amount-y", `${a.y}px`);
638
+ }
639
+ }, ve && !n.jsx && W !== "loading" ? /*#__PURE__*/ s.createElement("button", {
640
+ "aria-label": T,
641
+ "data-disabled": Te,
642
+ "data-close-button": !0,
643
+ onClick: Te || !K ? () => {} : () => {
644
+ $(), n.onDismiss == null || n.onDismiss.call(n, n);
645
+ },
646
+ className: G(C?.closeButton, n?.classNames?.closeButton)
647
+ }, w?.close ?? ne) : null, (W || n.icon || n.promise) && n.icon !== null && (w?.[W] !== null || n.icon) ? /*#__PURE__*/ s.createElement("div", {
648
+ "data-icon": "",
649
+ className: G(C?.icon, n?.classNames?.icon)
650
+ }, W === "loading" ? n.icon || Ee() : n.promise ? Ee() : null, W === "loading" ? null : De) : null, /*#__PURE__*/ s.createElement("div", {
651
+ "data-content": "",
652
+ className: G(C?.content, n?.classNames?.content)
653
+ }, /*#__PURE__*/ s.createElement("div", {
654
+ "data-title": "",
655
+ className: G(C?.title, n?.classNames?.title)
656
+ }, n.jsx ? n.jsx : typeof n.title == "function" ? n.title() : n.title), n.description ? /*#__PURE__*/ s.createElement("div", {
657
+ "data-description": "",
658
+ className: G(v, _e, C?.description, n?.classNames?.description)
659
+ }, typeof n.description == "function" ? n.description() : n.description) : null), /*#__PURE__*/ s.isValidElement(n.cancel) ? n.cancel : n.cancel && V(n.cancel) ? /*#__PURE__*/ s.createElement("button", {
660
+ "data-button": !0,
661
+ "data-cancel": !0,
662
+ style: n.cancelButtonStyle || ee,
663
+ onClick: (e) => {
664
+ V(n.cancel) && K && (n.cancel.onClick == null || n.cancel.onClick.call(n.cancel, e), $());
665
+ },
666
+ className: G(C?.cancelButton, n?.classNames?.cancelButton)
667
+ }, n.cancel.label) : null, /*#__PURE__*/ s.isValidElement(n.action) ? n.action : n.action && V(n.action) ? /*#__PURE__*/ s.createElement("button", {
668
+ "data-button": !0,
669
+ "data-action": !0,
670
+ style: n.actionButtonStyle || g,
671
+ onClick: (e) => {
672
+ V(n.action) && (n.action.onClick == null || n.action.onClick.call(n.action, e), e.defaultPrevented || $());
673
+ },
674
+ className: G(C?.actionButton, n?.classNames?.actionButton)
675
+ }, n.action.label) : null);
676
+ };
677
+ function K() {
678
+ if (typeof window > "u" || typeof document > "u") return "ltr";
679
+ let e = document.documentElement.getAttribute("dir");
680
+ return e === "auto" || !e ? window.getComputedStyle(document.documentElement).direction : e;
681
+ }
682
+ function ge(e, t) {
683
+ let n = {};
684
+ return [e, t].forEach((e, t) => {
685
+ let r = t === 1, i = r ? "--mobile-offset" : "--offset", a = r ? le : U;
686
+ function o(e) {
687
+ [
688
+ "top",
689
+ "right",
690
+ "bottom",
691
+ "left"
692
+ ].forEach((t) => {
693
+ n[`${i}-${t}`] = typeof e == "number" ? `${e}px` : e;
694
+ });
695
+ }
696
+ typeof e == "number" || typeof e == "string" ? o(e) : typeof e == "object" ? [
697
+ "top",
698
+ "right",
699
+ "bottom",
700
+ "left"
701
+ ].forEach((t) => {
702
+ e[t] === void 0 ? n[`${i}-${t}`] = a : n[`${i}-${t}`] = typeof e[t] == "number" ? `${e[t]}px` : e[t];
703
+ }) : o(a);
704
+ }), n;
705
+ }
706
+ var _e = /*#__PURE__*/ s.forwardRef(function(e, t) {
707
+ let { id: n, invert: r, position: i = "bottom-right", hotkey: a = ["altKey", "KeyT"], expand: o, closeButton: c, className: l, offset: u, mobileOffset: d, theme: f = "light", richColors: p, duration: m, style: h, visibleToasts: ee = H, toastOptions: g, dir: _ = K(), gap: v = W, icons: y, customAriaLabel: b, containerAriaLabel: x = "Notifications" } = e, [C, w] = s.useState([]), T = s.useMemo(() => n ? C.filter((e) => e.toasterId === n) : C.filter((e) => !e.toasterId), [C, n]), E = s.useMemo(() => Array.from(new Set([i].concat(T.filter((e) => e.position).map((e) => e.position)))), [T, i]), [D, O] = s.useState([]), [k, A] = s.useState(!1), [j, M] = s.useState(!1), [te, N] = s.useState(f === "system" ? typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : f), P = s.useRef(null), F = a.join("+").replace(/Key/g, "").replace(/Digit/g, ""), I = s.useRef(null), L = s.useRef(!1), R = s.useCallback((e) => {
708
+ w((t) => (t.find((t) => t.id === e.id)?.delete || z.dismiss(e.id), t.filter(({ id: t }) => t !== e.id)));
709
+ }, []);
710
+ return s.useEffect(() => z.subscribe((e) => {
711
+ e.dismiss ? requestAnimationFrame(() => {
712
+ w((t) => t.map((t) => t.id === e.id ? {
713
+ ...t,
714
+ delete: !0
715
+ } : t));
716
+ }) : setTimeout(() => {
717
+ S.flushSync(() => {
718
+ w((t) => {
719
+ let n = t.findIndex((t) => t.id === e.id);
720
+ return n === -1 ? [e, ...t] : [
721
+ ...t.slice(0, n),
722
+ {
723
+ ...t[n],
724
+ ...e
725
+ },
726
+ ...t.slice(n + 1)
727
+ ];
728
+ });
729
+ });
730
+ });
731
+ }), []), s.useEffect(() => {
732
+ if (f !== "system") {
733
+ N(f);
734
+ return;
735
+ }
736
+ if (f === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? N("dark") : N("light")), typeof window > "u") return;
737
+ let e = window.matchMedia("(prefers-color-scheme: dark)");
738
+ try {
739
+ e.addEventListener("change", ({ matches: e }) => {
740
+ N(e ? "dark" : "light");
741
+ });
742
+ } catch {
743
+ e.addListener(({ matches: e }) => {
744
+ try {
745
+ N(e ? "dark" : "light");
746
+ } catch (e) {
747
+ console.error(e);
748
+ }
749
+ });
750
+ }
751
+ }, [f]), s.useEffect(() => {
752
+ C.length <= 1 && A(!1);
753
+ }, [C]), s.useEffect(() => {
754
+ let e = (e) => {
755
+ if (a.length > 0 && a.every((t) => e[t] || e.code === t)) {
756
+ var t;
757
+ A(!0), (t = P.current) == null || t.focus();
758
+ }
759
+ e.code === "Escape" && (document.activeElement === P.current || P.current?.contains(document.activeElement)) && A(!1);
760
+ };
761
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
762
+ }, [a]), s.useEffect(() => {
763
+ if (P.current) return () => {
764
+ I.current && (I.current.focus({ preventScroll: !0 }), I.current = null, L.current = !1);
765
+ };
766
+ }, [P.current]), /*#__PURE__*/ s.createElement("section", {
767
+ ref: t,
768
+ "aria-label": b ?? `${x} ${F}`,
769
+ tabIndex: -1,
770
+ "aria-live": "polite",
771
+ "aria-relevant": "additions text",
772
+ "aria-atomic": "false",
773
+ suppressHydrationWarning: !0,
774
+ "data-react-aria-top-layer": !0
775
+ }, E.map((t, n) => {
776
+ let [i, a] = t.split("-");
777
+ return T.length ? /*#__PURE__*/ s.createElement("ol", {
778
+ key: t,
779
+ dir: _ === "auto" ? K() : _,
780
+ tabIndex: -1,
781
+ ref: P,
782
+ className: l,
783
+ "data-sonner-toaster": !0,
784
+ "data-sonner-theme": te,
785
+ "data-y-position": i,
786
+ "data-x-position": a,
787
+ style: {
788
+ "--front-toast-height": `${D[0]?.height || 0}px`,
789
+ "--width": `${de}px`,
790
+ "--gap": `${v}px`,
791
+ ...h,
792
+ ...ge(u, d)
793
+ },
794
+ onBlur: (e) => {
795
+ L.current && !e.currentTarget.contains(e.relatedTarget) && (L.current = !1, I.current &&= (I.current.focus({ preventScroll: !0 }), null));
796
+ },
797
+ onFocus: (e) => {
798
+ e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || L.current || (L.current = !0, I.current = e.relatedTarget);
799
+ },
800
+ onMouseEnter: () => A(!0),
801
+ onMouseMove: () => A(!0),
802
+ onMouseLeave: () => {
803
+ j || A(!1);
804
+ },
805
+ onDragEnd: () => A(!1),
806
+ onPointerDown: (e) => {
807
+ e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || M(!0);
808
+ },
809
+ onPointerUp: () => M(!1)
810
+ }, T.filter((e) => !e.position && n === 0 || e.position === t).map((n, i) => /*#__PURE__*/ s.createElement(he, {
811
+ key: n.id,
812
+ icons: y,
813
+ index: i,
814
+ toast: n,
815
+ defaultRichColors: p,
816
+ duration: g?.duration ?? m,
817
+ className: g?.className,
818
+ descriptionClassName: g?.descriptionClassName,
819
+ invert: r,
820
+ visibleToasts: ee,
821
+ closeButton: g?.closeButton ?? c,
822
+ interacting: j,
823
+ position: t,
824
+ style: g?.style,
825
+ unstyled: g?.unstyled,
826
+ classNames: g?.classNames,
827
+ cancelButtonStyle: g?.cancelButtonStyle,
828
+ actionButtonStyle: g?.actionButtonStyle,
829
+ closeButtonAriaLabel: g?.closeButtonAriaLabel,
830
+ removeToast: R,
831
+ toasts: T.filter((e) => e.position == n.position),
832
+ heights: D.filter((e) => e.position == n.position),
833
+ setHeights: O,
834
+ expandByDefault: o,
835
+ gap: v,
836
+ expanded: k,
837
+ swipeDirections: e.swipeDirections
838
+ }))) : null;
839
+ }));
840
+ });
841
+ // packages/feedback/src/toast.tsx
842
+ function q({ closeButton: e = !0, closeButtonAriaLabel: t = "Dismiss notification", offset: n = i.xl, mobileOffset: a = i.lg, ...o }) {
843
+ return /* @__PURE__ */ f(_e, {
844
+ ...o,
845
+ className: "x1xzild6 xkwcdv0 x19hn9gq x350ok5 x1dknavn x1qgcmqu x19j7ixz xgam3oh x7s97pk",
846
+ style: {
847
+ zIndex: r.popup,
848
+ transitionProperty: "opacity, transform"
849
+ },
850
+ offset: n,
851
+ mobileOffset: a,
852
+ closeButton: e,
853
+ icons: {
854
+ success: /* @__PURE__ */ f(h, {
855
+ "aria-hidden": !0,
856
+ className: "xtwnzbg x18utl2x x7zct4q x7ixh4y"
857
+ }),
858
+ error: /* @__PURE__ */ f(ee, {
859
+ "aria-hidden": !0,
860
+ className: "xtwnzbg x18utl2x x7zct4q xr5kp14"
861
+ }),
862
+ warning: /* @__PURE__ */ f(v, {
863
+ "aria-hidden": !0,
864
+ className: "xtwnzbg x18utl2x x7zct4q x1f9ixgr"
865
+ }),
866
+ info: /* @__PURE__ */ f(g, {
867
+ "aria-hidden": !0,
868
+ className: "xtwnzbg x18utl2x x7zct4q x153jb6y"
869
+ }),
870
+ loading: /* @__PURE__ */ f(_, {
871
+ "aria-hidden": !0,
872
+ className: "xtwnzbg x18utl2x x7zct4q x153jb6y"
873
+ }),
874
+ close: /* @__PURE__ */ f(y, {
875
+ "aria-hidden": !0,
876
+ className: "xtwnzbg x18utl2x x7zct4q"
877
+ })
878
+ },
879
+ toastOptions: {
880
+ unstyled: !0,
881
+ closeButtonAriaLabel: t,
882
+ style: { transitionProperty: "opacity, transform" },
883
+ classNames: {
884
+ toast: { className: "x1bl4301 x78zum5 x1a02dak x6s0dn4 x1hnptsi x1c8xbx5 x2ik7qb x7ottyg xmkeg23 x1y0btm7 x1ey3b81 xy32g2j xpvm0e4 xbixft x16hm2kh x1hz01jw xvmahel xtqrqnz x1778rvt xj57cvi x1xzild6 xkwcdv0 x19hn9gq x350ok5 x1dknavn x1qgcmqu x19j7ixz xgam3oh x7s97pk x-default-marker" }.className ?? "",
885
+ title: { className: "xk4h15q" }.className ?? "",
886
+ description: { className: "x153jb6y" }.className ?? "",
887
+ content: { className: "x78zum5 xdt5ytf x1slnebi xeuugli xfko13i x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
888
+ icon: { className: "x78zum5 x1n2onr6 x2lah0s xtwnzbg x18utl2x x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
889
+ loader: { className: "x1xzild6 xkwcdv0 x19hn9gq x350ok5 x1dknavn" }.className ?? "",
890
+ actionButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 xeuugli x193iq5w xaeotn9 xwu7q15 x1hmw7ec x1atzlso xc342km x1ok0vyi x1hz01jw xtqrqnz x1778rvt xk4h15q xeaf4i8 xj0a0fe x1ypdohk x1pt885t x1ymx3u3 xbhuexu x1eou8nq x1qgcmqu x19j7ixz xgam3oh x7s97pk x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
891
+ cancelButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 xeuugli x193iq5w xaeotn9 xwu7q15 x1hmw7ec x1atzlso xc342km x1ok0vyi x1hz01jw xtqrqnz x1778rvt xk4h15q xeaf4i8 xj0a0fe x1ypdohk x1r7kqkb xbixft xxg5jw2 x1ecmtor x1qgcmqu x19j7ixz xgam3oh x7s97pk x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? "",
892
+ closeButton: { className: "x3nfvp2 x6s0dn4 xl56j7k x2lah0s x9f619 x193iq5w xaeotn9 xwu7q15 x1hmw7ec xc342km x1ok0vyi x1hz01jw xtqrqnz x1778rvt xk4h15q xeaf4i8 xj0a0fe x1ypdohk x10l6tqk x1m7q2ru x1b86y6l x1udcv4t xidce53 xnjsko4 xjbqb8w x153jb6y xg54am9 xfkdqyo x1snzz31 xqu5dr6 x1qgcmqu x19j7ixz xgam3oh x7s97pk x1hc1fzr xnglhca x19991ni xkwcdv0 x19hn9gq" }.className ?? ""
893
+ }
894
+ }
895
+ });
896
+ }
897
+ // packages/feedback/src/async-region.tsx
898
+ var ve = c(!1);
899
+ function J({ enter: e, fill: t = !1, children: n }) {
900
+ let r = l(ve), [i] = d(e && !r), [a, o] = d(i);
901
+ return u(() => {
902
+ let e = requestAnimationFrame(() => o(!1));
903
+ return () => cancelAnimationFrame(e);
904
+ }, []), /* @__PURE__ */ f("div", {
905
+ ...{
906
+ 0: { className: "xeuugli" },
907
+ 2: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf" },
908
+ 1: { className: "xeuugli xqcmdr3 xcgnenq xwkv4th x1c3o69q" },
909
+ 3: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf xqcmdr3 xcgnenq xwkv4th x1c3o69q" }
910
+ }[!!t << 1 | !!i],
911
+ children: /* @__PURE__ */ f(ve, {
912
+ value: a,
913
+ children: n
914
+ })
915
+ });
916
+ }
917
+ function Y({ label: e, placeholder: t, fill: r = !1, startedAt: i, delayMs: a = 0 }) {
918
+ let [s] = d(() => i ?? Date.now()), [c, l] = d(a <= 0);
919
+ return u(() => {
920
+ let e = Math.max(0, a - (Date.now() - s)), t = setTimeout(() => l(!0), e);
921
+ return () => clearTimeout(t);
922
+ }, [s, a]), /* @__PURE__ */ p("div", {
923
+ ...{
924
+ 0: { className: "xeuugli" },
925
+ 4: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf" },
926
+ 2: { className: "xeuugli xlshs6z" },
927
+ 6: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf xlshs6z" },
928
+ 1: { className: "xeuugli xqcmdr3 xcgnenq xwkv4th x1c3o69q" },
929
+ 5: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf xqcmdr3 xcgnenq xwkv4th x1c3o69q" },
930
+ 3: { className: "xeuugli xlshs6z xqcmdr3 xcgnenq xwkv4th x1c3o69q" },
931
+ 7: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf xlshs6z xqcmdr3 xcgnenq xwkv4th x1c3o69q" }
932
+ }[!!r << 2 | !c << 1 | !!c],
933
+ children: [c && /* @__PURE__ */ f("span", {
934
+ role: "status",
935
+ ...o.props(n.hidden),
936
+ children: e
937
+ }), /* @__PURE__ */ f("div", {
938
+ "aria-hidden": "true",
939
+ inert: !0,
940
+ ...{
941
+ 0: { className: "xeuugli" },
942
+ 1: { className: "xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf" }
943
+ }[!!r | 0],
944
+ children: t
945
+ })]
946
+ });
947
+ }
948
+ function X({ pending: e, label: t, placeholder: n, children: r, fill: i = !1, startedAt: a, delayMs: o }) {
949
+ let [s, c] = d(e);
950
+ return e && !s && c(!0), /* @__PURE__ */ f("div", {
951
+ "aria-busy": e,
952
+ ...{
953
+ 0: { className: "x1n2onr6 xeuugli" },
954
+ 1: { className: "x1n2onr6 xeuugli x98rzlu x2lwn1j x78zum5 xdt5ytf" }
955
+ }[!!i | 0],
956
+ children: e ? /* @__PURE__ */ f(Y, {
957
+ label: t,
958
+ placeholder: n,
959
+ fill: i,
960
+ startedAt: a,
961
+ delayMs: o
962
+ }, a) : /* @__PURE__ */ f(J, {
963
+ enter: s,
964
+ fill: i,
965
+ children: r
966
+ })
967
+ });
968
+ }
969
+ export { M as a, D as c, C as d, w as f, B as i, O as l, J as n, j as o, q as r, A as s, X as t, k as u };