@burdenoff/microfe-technospam 2026.1030.6 → 2026.1031.1

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.
@@ -1,600 +0,0 @@
1
- "use client";
2
- import e, { forwardRef as t, isValidElement as n } from "react";
3
- import r from "react-dom";
4
- //#region node_modules/sonner/dist/index.mjs
5
- var i = (e) => {
6
- switch (e) {
7
- case "success": return s;
8
- case "info": return l;
9
- case "warning": return c;
10
- case "error": return u;
11
- default: return null;
12
- }
13
- }, a = Array(12).fill(0), o = ({ visible: t, className: n }) => e.createElement("div", {
14
- className: ["sonner-loading-wrapper", n].filter(Boolean).join(" "),
15
- "data-visible": t
16
- }, e.createElement("div", { className: "sonner-spinner" }, a.map((t, n) => e.createElement("div", {
17
- className: "sonner-loading-bar",
18
- key: `spinner-bar-${n}`
19
- })))), s = e.createElement("svg", {
20
- xmlns: "http://www.w3.org/2000/svg",
21
- viewBox: "0 0 20 20",
22
- fill: "currentColor",
23
- height: "20",
24
- width: "20"
25
- }, e.createElement("path", {
26
- fillRule: "evenodd",
27
- 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",
28
- clipRule: "evenodd"
29
- })), c = e.createElement("svg", {
30
- xmlns: "http://www.w3.org/2000/svg",
31
- viewBox: "0 0 24 24",
32
- fill: "currentColor",
33
- height: "20",
34
- width: "20"
35
- }, e.createElement("path", {
36
- fillRule: "evenodd",
37
- 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",
38
- clipRule: "evenodd"
39
- })), l = e.createElement("svg", {
40
- xmlns: "http://www.w3.org/2000/svg",
41
- viewBox: "0 0 20 20",
42
- fill: "currentColor",
43
- height: "20",
44
- width: "20"
45
- }, e.createElement("path", {
46
- fillRule: "evenodd",
47
- 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",
48
- clipRule: "evenodd"
49
- })), u = e.createElement("svg", {
50
- xmlns: "http://www.w3.org/2000/svg",
51
- viewBox: "0 0 20 20",
52
- fill: "currentColor",
53
- height: "20",
54
- width: "20"
55
- }, e.createElement("path", {
56
- fillRule: "evenodd",
57
- 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",
58
- clipRule: "evenodd"
59
- })), ee = e.createElement("svg", {
60
- xmlns: "http://www.w3.org/2000/svg",
61
- width: "12",
62
- height: "12",
63
- viewBox: "0 0 24 24",
64
- fill: "none",
65
- stroke: "currentColor",
66
- strokeWidth: "1.5",
67
- strokeLinecap: "round",
68
- strokeLinejoin: "round"
69
- }, e.createElement("line", {
70
- x1: "18",
71
- y1: "6",
72
- x2: "6",
73
- y2: "18"
74
- }), e.createElement("line", {
75
- x1: "6",
76
- y1: "6",
77
- x2: "18",
78
- y2: "18"
79
- })), d = () => {
80
- let [t, n] = e.useState(document.hidden);
81
- return e.useEffect(() => {
82
- let e = () => {
83
- n(document.hidden);
84
- };
85
- return document.addEventListener("visibilitychange", e), () => window.removeEventListener("visibilitychange", e);
86
- }, []), t;
87
- }, f = 1, p = new class {
88
- constructor() {
89
- this.subscribe = (e) => (this.subscribers.push(e), () => {
90
- let t = this.subscribers.indexOf(e);
91
- this.subscribers.splice(t, 1);
92
- }), this.publish = (e) => {
93
- this.subscribers.forEach((t) => t(e));
94
- }, this.addToast = (e) => {
95
- this.publish(e), this.toasts = [...this.toasts, e];
96
- }, this.create = (e) => {
97
- let { message: t, ...n } = e, r = typeof e?.id == "number" || e.id?.length > 0 ? e.id : f++, i = this.toasts.find((e) => e.id === r), a = e.dismissible === void 0 ? !0 : e.dismissible;
98
- return this.dismissedToasts.has(r) && this.dismissedToasts.delete(r), i ? this.toasts = this.toasts.map((n) => n.id === r ? (this.publish({
99
- ...n,
100
- ...e,
101
- id: r,
102
- title: t
103
- }), {
104
- ...n,
105
- ...e,
106
- id: r,
107
- dismissible: a,
108
- title: t
109
- }) : n) : this.addToast({
110
- title: t,
111
- ...n,
112
- dismissible: a,
113
- id: r
114
- }), r;
115
- }, this.dismiss = (e) => (this.dismissedToasts.add(e), e || this.toasts.forEach((e) => {
116
- this.subscribers.forEach((t) => t({
117
- id: e.id,
118
- dismiss: !0
119
- }));
120
- }), this.subscribers.forEach((t) => t({
121
- id: e,
122
- dismiss: !0
123
- })), e), this.message = (e, t) => this.create({
124
- ...t,
125
- message: e
126
- }), this.error = (e, t) => this.create({
127
- ...t,
128
- message: e,
129
- type: "error"
130
- }), this.success = (e, t) => this.create({
131
- ...t,
132
- type: "success",
133
- message: e
134
- }), this.info = (e, t) => this.create({
135
- ...t,
136
- type: "info",
137
- message: e
138
- }), this.warning = (e, t) => this.create({
139
- ...t,
140
- type: "warning",
141
- message: e
142
- }), this.loading = (e, t) => this.create({
143
- ...t,
144
- type: "loading",
145
- message: e
146
- }), this.promise = (t, n) => {
147
- if (!n) return;
148
- let r;
149
- n.loading !== void 0 && (r = this.create({
150
- ...n,
151
- promise: t,
152
- type: "loading",
153
- message: n.loading,
154
- description: typeof n.description == "function" ? void 0 : n.description
155
- }));
156
- let i = t instanceof Promise ? t : t(), a = r !== void 0, o, s = i.then(async (t) => {
157
- if (o = ["resolve", t], e.isValidElement(t)) a = !1, this.create({
158
- id: r,
159
- type: "default",
160
- message: t
161
- });
162
- else if (h(t) && !t.ok) {
163
- a = !1;
164
- let e = typeof n.error == "function" ? await n.error(`HTTP error! status: ${t.status}`) : n.error, i = typeof n.description == "function" ? await n.description(`HTTP error! status: ${t.status}`) : n.description;
165
- this.create({
166
- id: r,
167
- type: "error",
168
- message: e,
169
- description: i
170
- });
171
- } else if (n.success !== void 0) {
172
- a = !1;
173
- let e = typeof n.success == "function" ? await n.success(t) : n.success, i = typeof n.description == "function" ? await n.description(t) : n.description;
174
- this.create({
175
- id: r,
176
- type: "success",
177
- message: e,
178
- description: i
179
- });
180
- }
181
- }).catch(async (e) => {
182
- if (o = ["reject", e], n.error !== void 0) {
183
- a = !1;
184
- let t = typeof n.error == "function" ? await n.error(e) : n.error, i = typeof n.description == "function" ? await n.description(e) : n.description;
185
- this.create({
186
- id: r,
187
- type: "error",
188
- message: t,
189
- description: i
190
- });
191
- }
192
- }).finally(() => {
193
- var e;
194
- a && (this.dismiss(r), r = void 0), (e = n.finally) == null || e.call(n);
195
- }), c = () => new Promise((e, t) => s.then(() => o[0] === "reject" ? t(o[1]) : e(o[1])).catch(t));
196
- return typeof r != "string" && typeof r != "number" ? { unwrap: c } : Object.assign(r, { unwrap: c });
197
- }, this.custom = (e, t) => {
198
- let n = t?.id || f++;
199
- return this.create({
200
- jsx: e(n),
201
- id: n,
202
- ...t
203
- }), n;
204
- }, this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
205
- }
206
- }(), m = (e, t) => {
207
- let n = t?.id || f++;
208
- return p.addToast({
209
- title: e,
210
- ...t,
211
- id: n
212
- }), n;
213
- }, h = (e) => e && typeof e == "object" && "ok" in e && typeof e.ok == "boolean" && "status" in e && typeof e.status == "number", g = Object.assign(m, {
214
- success: p.success,
215
- info: p.info,
216
- warning: p.warning,
217
- error: p.error,
218
- custom: p.custom,
219
- message: p.message,
220
- promise: p.promise,
221
- dismiss: p.dismiss,
222
- loading: p.loading
223
- }, {
224
- getHistory: () => p.toasts,
225
- getToasts: () => p.getActiveToasts()
226
- });
227
- function _(e, { insertAt: t } = {}) {
228
- if (!e || typeof document > "u") return;
229
- let n = document.head || document.getElementsByTagName("head")[0], r = document.createElement("style");
230
- r.type = "text/css", t === "top" && n.firstChild ? n.insertBefore(r, n.firstChild) : n.appendChild(r), r.styleSheet ? r.styleSheet.cssText = e : r.appendChild(document.createTextNode(e));
231
- }
232
- _(":where(html[dir=\"ltr\"]),:where([data-sonner-toaster][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%)}:where(html[dir=\"rtl\"]),:where([data-sonner-toaster][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%)}:where([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:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted=\"true\"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted=\"true\"]){transform:none}}:where([data-sonner-toaster][data-x-position=\"right\"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position=\"left\"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position=\"center\"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position=\"top\"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position=\"bottom\"]){bottom:var(--offset-bottom)}:where([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);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([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 #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position=\"top\"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position=\"bottom\"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([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)}:where([data-sonner-toast][data-promise=\"true\"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([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;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme=\"dark\"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([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);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-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled=\"true\"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping=\"true\"]):before{content:\"\";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position=\"top\"][data-swiping=\"true\"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position=\"bottom\"][data-swiping=\"true\"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping=\"false\"][data-removed=\"true\"]):before{content:\"\";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:\"\";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted=\"true\"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded=\"false\"][data-front=\"false\"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded=\"false\"][data-front=\"false\"][data-styled=\"true\"])>*{opacity:0}:where([data-sonner-toast][data-visible=\"false\"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted=\"true\"][data-expanded=\"true\"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed=\"true\"][data-front=\"true\"][data-swipe-out=\"false\"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([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}:where([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}:where([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, 0px)) translate(var(--swipe-amount-x, 0px));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{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{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{0%{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-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--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-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-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-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, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--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-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-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],[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],[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],[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],[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:nth-child(1){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)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{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%)}\n");
233
- function v(e) {
234
- return e.label !== void 0;
235
- }
236
- var y = 3, b = "32px", x = "16px", S = 4e3, C = 356, te = 14, ne = 20, re = 200;
237
- function w(...e) {
238
- return e.filter(Boolean).join(" ");
239
- }
240
- function T(e) {
241
- let [t, n] = e.split("-"), r = [];
242
- return t && r.push(t), n && r.push(n), r;
243
- }
244
- var ie = (t) => {
245
- let { invert: r, toast: a, unstyled: s, interacting: c, setHeights: l, visibleToasts: u, heights: f, index: p, toasts: m, expanded: h, removeToast: g, defaultRichColors: _, closeButton: y, style: b, cancelButtonStyle: x, actionButtonStyle: C, className: te = "", descriptionClassName: ie = "", duration: E, position: D, gap: ae, loadingIcon: O, expandByDefault: k, classNames: A, icons: j, closeButtonAriaLabel: M = "Close toast", pauseWhenPageIsHidden: N } = t, [P, F] = e.useState(null), [I, oe] = e.useState(null), [L, R] = e.useState(!1), [z, se] = e.useState(!1), [ce, B] = e.useState(!1), [le, ue] = e.useState(!1), [de, V] = e.useState(!1), [fe, H] = e.useState(0), [pe, me] = e.useState(0), U = e.useRef(a.duration || E || S), he = e.useRef(null), W = e.useRef(null), ge = p === 0, _e = p + 1 <= u, G = a.type, K = a.dismissible !== !1, ve = a.className || "", ye = a.descriptionClassName || "", q = e.useMemo(() => f.findIndex((e) => e.toastId === a.id) || 0, [f, a.id]), be = e.useMemo(() => a.closeButton ?? y, [a.closeButton, y]), xe = e.useMemo(() => a.duration || E || S, [a.duration, E]), J = e.useRef(0), Y = e.useRef(0), X = e.useRef(0), Z = e.useRef(null), [Se, Ce] = D.split("-"), we = e.useMemo(() => f.reduce((e, t, n) => n >= q ? e : e + t.height, 0), [f, q]), Te = d(), Ee = a.invert || r, Q = G === "loading";
246
- Y.current = e.useMemo(() => q * ae + we, [q, we]), e.useEffect(() => {
247
- U.current = xe;
248
- }, [xe]), e.useEffect(() => {
249
- R(!0);
250
- }, []), e.useEffect(() => {
251
- let e = W.current;
252
- if (e) {
253
- let t = e.getBoundingClientRect().height;
254
- return me(t), l((e) => [{
255
- toastId: a.id,
256
- height: t,
257
- position: a.position
258
- }, ...e]), () => l((e) => e.filter((e) => e.toastId !== a.id));
259
- }
260
- }, [l, a.id]), e.useLayoutEffect(() => {
261
- if (!L) return;
262
- let e = W.current, t = e.style.height;
263
- e.style.height = "auto";
264
- let n = e.getBoundingClientRect().height;
265
- e.style.height = t, me(n), l((e) => e.find((e) => e.toastId === a.id) ? e.map((e) => e.toastId === a.id ? {
266
- ...e,
267
- height: n
268
- } : e) : [{
269
- toastId: a.id,
270
- height: n,
271
- position: a.position
272
- }, ...e]);
273
- }, [
274
- L,
275
- a.title,
276
- a.description,
277
- l,
278
- a.id
279
- ]);
280
- let $ = e.useCallback(() => {
281
- se(!0), H(Y.current), l((e) => e.filter((e) => e.toastId !== a.id)), setTimeout(() => {
282
- g(a);
283
- }, re);
284
- }, [
285
- a,
286
- g,
287
- l,
288
- Y
289
- ]);
290
- e.useEffect(() => {
291
- if (a.promise && G === "loading" || a.duration === Infinity || a.type === "loading") return;
292
- let e;
293
- return h || c || N && Te ? (() => {
294
- if (X.current < J.current) {
295
- let e = (/* @__PURE__ */ new Date()).getTime() - J.current;
296
- U.current -= e;
297
- }
298
- X.current = (/* @__PURE__ */ new Date()).getTime();
299
- })() : U.current !== Infinity && (J.current = (/* @__PURE__ */ new Date()).getTime(), e = setTimeout(() => {
300
- var e;
301
- (e = a.onAutoClose) == null || e.call(a, a), $();
302
- }, U.current)), () => clearTimeout(e);
303
- }, [
304
- h,
305
- c,
306
- a,
307
- G,
308
- N,
309
- Te,
310
- $
311
- ]), e.useEffect(() => {
312
- a.delete && $();
313
- }, [$, a.delete]);
314
- function De() {
315
- return j != null && j.loading ? e.createElement("div", {
316
- className: w(A?.loader, a?.classNames?.loader, "sonner-loader"),
317
- "data-visible": G === "loading"
318
- }, j.loading) : O ? e.createElement("div", {
319
- className: w(A?.loader, a?.classNames?.loader, "sonner-loader"),
320
- "data-visible": G === "loading"
321
- }, O) : e.createElement(o, {
322
- className: w(A?.loader, a?.classNames?.loader),
323
- visible: G === "loading"
324
- });
325
- }
326
- return e.createElement("li", {
327
- tabIndex: 0,
328
- ref: W,
329
- className: w(te, ve, A?.toast, a?.classNames?.toast, A?.default, A?.[G], a?.classNames?.[G]),
330
- "data-sonner-toast": "",
331
- "data-rich-colors": a.richColors ?? _,
332
- "data-styled": !(a.jsx || a.unstyled || s),
333
- "data-mounted": L,
334
- "data-promise": !!a.promise,
335
- "data-swiped": de,
336
- "data-removed": z,
337
- "data-visible": _e,
338
- "data-y-position": Se,
339
- "data-x-position": Ce,
340
- "data-index": p,
341
- "data-front": ge,
342
- "data-swiping": ce,
343
- "data-dismissible": K,
344
- "data-type": G,
345
- "data-invert": Ee,
346
- "data-swipe-out": le,
347
- "data-swipe-direction": I,
348
- "data-expanded": !!(h || k && L),
349
- style: {
350
- "--index": p,
351
- "--toasts-before": p,
352
- "--z-index": m.length - p,
353
- "--offset": `${z ? fe : Y.current}px`,
354
- "--initial-height": k ? "auto" : `${pe}px`,
355
- ...b,
356
- ...a.style
357
- },
358
- onDragEnd: () => {
359
- B(!1), F(null), Z.current = null;
360
- },
361
- onPointerDown: (e) => {
362
- Q || !K || (he.current = /* @__PURE__ */ new Date(), H(Y.current), e.target.setPointerCapture(e.pointerId), e.target.tagName !== "BUTTON" && (B(!0), Z.current = {
363
- x: e.clientX,
364
- y: e.clientY
365
- }));
366
- },
367
- onPointerUp: () => {
368
- var e;
369
- if (le || !K) return;
370
- Z.current = null;
371
- let t = Number(W.current?.style.getPropertyValue("--swipe-amount-x").replace("px", "") || 0), n = Number(W.current?.style.getPropertyValue("--swipe-amount-y").replace("px", "") || 0), r = (/* @__PURE__ */ new Date()).getTime() - he.current?.getTime(), i = P === "x" ? t : n, o = Math.abs(i) / r;
372
- if (Math.abs(i) >= ne || o > .11) {
373
- H(Y.current), (e = a.onDismiss) == null || e.call(a, a), oe(P === "x" ? t > 0 ? "right" : "left" : n > 0 ? "down" : "up"), $(), ue(!0), V(!1);
374
- return;
375
- }
376
- B(!1), F(null);
377
- },
378
- onPointerMove: (e) => {
379
- var n, r;
380
- if (!Z.current || !K || window.getSelection()?.toString().length > 0) return;
381
- let i = e.clientY - Z.current.y, a = e.clientX - Z.current.x, o = t.swipeDirections ?? T(D);
382
- !P && (Math.abs(a) > 1 || Math.abs(i) > 1) && F(Math.abs(a) > Math.abs(i) ? "x" : "y");
383
- let s = {
384
- x: 0,
385
- y: 0
386
- };
387
- P === "y" ? (o.includes("top") || o.includes("bottom")) && (o.includes("top") && i < 0 || o.includes("bottom") && i > 0) && (s.y = i) : P === "x" && (o.includes("left") || o.includes("right")) && (o.includes("left") && a < 0 || o.includes("right") && a > 0) && (s.x = a), (Math.abs(s.x) > 0 || Math.abs(s.y) > 0) && V(!0), (n = W.current) == null || n.style.setProperty("--swipe-amount-x", `${s.x}px`), (r = W.current) == null || r.style.setProperty("--swipe-amount-y", `${s.y}px`);
388
- }
389
- }, be && !a.jsx ? e.createElement("button", {
390
- "aria-label": M,
391
- "data-disabled": Q,
392
- "data-close-button": !0,
393
- onClick: Q || !K ? () => {} : () => {
394
- var e;
395
- $(), (e = a.onDismiss) == null || e.call(a, a);
396
- },
397
- className: w(A?.closeButton, a?.classNames?.closeButton)
398
- }, j?.close ?? ee) : null, a.jsx || n(a.title) ? a.jsx ? a.jsx : typeof a.title == "function" ? a.title() : a.title : e.createElement(e.Fragment, null, G || a.icon || a.promise ? e.createElement("div", {
399
- "data-icon": "",
400
- className: w(A?.icon, a?.classNames?.icon)
401
- }, a.promise || a.type === "loading" && !a.icon ? a.icon || De() : null, a.type === "loading" ? null : a.icon || j?.[G] || i(G)) : null, e.createElement("div", {
402
- "data-content": "",
403
- className: w(A?.content, a?.classNames?.content)
404
- }, e.createElement("div", {
405
- "data-title": "",
406
- className: w(A?.title, a?.classNames?.title)
407
- }, typeof a.title == "function" ? a.title() : a.title), a.description ? e.createElement("div", {
408
- "data-description": "",
409
- className: w(ie, ye, A?.description, a?.classNames?.description)
410
- }, typeof a.description == "function" ? a.description() : a.description) : null), n(a.cancel) ? a.cancel : a.cancel && v(a.cancel) ? e.createElement("button", {
411
- "data-button": !0,
412
- "data-cancel": !0,
413
- style: a.cancelButtonStyle || x,
414
- onClick: (e) => {
415
- var t, n;
416
- v(a.cancel) && K && ((n = (t = a.cancel).onClick) == null || n.call(t, e), $());
417
- },
418
- className: w(A?.cancelButton, a?.classNames?.cancelButton)
419
- }, a.cancel.label) : null, n(a.action) ? a.action : a.action && v(a.action) ? e.createElement("button", {
420
- "data-button": !0,
421
- "data-action": !0,
422
- style: a.actionButtonStyle || C,
423
- onClick: (e) => {
424
- var t, n;
425
- v(a.action) && ((n = (t = a.action).onClick) == null || n.call(t, e), !e.defaultPrevented && $());
426
- },
427
- className: w(A?.actionButton, a?.classNames?.actionButton)
428
- }, a.action.label) : null));
429
- };
430
- function E() {
431
- if (typeof window > "u" || typeof document > "u") return "ltr";
432
- let e = document.documentElement.getAttribute("dir");
433
- return e === "auto" || !e ? window.getComputedStyle(document.documentElement).direction : e;
434
- }
435
- function D(e, t) {
436
- let n = {};
437
- return [e, t].forEach((e, t) => {
438
- let r = t === 1, i = r ? "--mobile-offset" : "--offset", a = r ? x : b;
439
- function o(e) {
440
- [
441
- "top",
442
- "right",
443
- "bottom",
444
- "left"
445
- ].forEach((t) => {
446
- n[`${i}-${t}`] = typeof e == "number" ? `${e}px` : e;
447
- });
448
- }
449
- typeof e == "number" || typeof e == "string" ? o(e) : typeof e == "object" ? [
450
- "top",
451
- "right",
452
- "bottom",
453
- "left"
454
- ].forEach((t) => {
455
- e[t] === void 0 ? n[`${i}-${t}`] = a : n[`${i}-${t}`] = typeof e[t] == "number" ? `${e[t]}px` : e[t];
456
- }) : o(a);
457
- }), n;
458
- }
459
- t(function(t, n) {
460
- let { invert: i, position: a = "bottom-right", hotkey: o = ["altKey", "KeyT"], expand: s, closeButton: c, className: l, offset: u, mobileOffset: ee, theme: d = "light", richColors: f, duration: m, style: h, visibleToasts: g = y, toastOptions: _, dir: v = E(), gap: b = te, loadingIcon: x, icons: S, containerAriaLabel: ne = "Notifications", pauseWhenPageIsHidden: re } = t, [w, T] = e.useState([]), ae = e.useMemo(() => Array.from(new Set([a].concat(w.filter((e) => e.position).map((e) => e.position)))), [w, a]), [O, k] = e.useState([]), [A, j] = e.useState(!1), [M, N] = e.useState(!1), [P, F] = e.useState(d === "system" ? typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : d), I = e.useRef(null), oe = o.join("+").replace(/Key/g, "").replace(/Digit/g, ""), L = e.useRef(null), R = e.useRef(!1), z = e.useCallback((e) => {
461
- T((t) => {
462
- var n;
463
- return (n = t.find((t) => t.id === e.id)) != null && n.delete || p.dismiss(e.id), t.filter(({ id: t }) => t !== e.id);
464
- });
465
- }, []);
466
- return e.useEffect(() => p.subscribe((e) => {
467
- if (e.dismiss) {
468
- T((t) => t.map((t) => t.id === e.id ? {
469
- ...t,
470
- delete: !0
471
- } : t));
472
- return;
473
- }
474
- setTimeout(() => {
475
- r.flushSync(() => {
476
- T((t) => {
477
- let n = t.findIndex((t) => t.id === e.id);
478
- return n === -1 ? [e, ...t] : [
479
- ...t.slice(0, n),
480
- {
481
- ...t[n],
482
- ...e
483
- },
484
- ...t.slice(n + 1)
485
- ];
486
- });
487
- });
488
- });
489
- }), []), e.useEffect(() => {
490
- if (d !== "system") {
491
- F(d);
492
- return;
493
- }
494
- if (d === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? F("dark") : F("light")), typeof window > "u") return;
495
- let e = window.matchMedia("(prefers-color-scheme: dark)");
496
- try {
497
- e.addEventListener("change", ({ matches: e }) => {
498
- F(e ? "dark" : "light");
499
- });
500
- } catch {
501
- e.addListener(({ matches: e }) => {
502
- try {
503
- F(e ? "dark" : "light");
504
- } catch (e) {
505
- console.error(e);
506
- }
507
- });
508
- }
509
- }, [d]), e.useEffect(() => {
510
- w.length <= 1 && j(!1);
511
- }, [w]), e.useEffect(() => {
512
- let e = (e) => {
513
- var t, n;
514
- o.every((t) => e[t] || e.code === t) && (j(!0), (t = I.current) == null || t.focus()), e.code === "Escape" && (document.activeElement === I.current || (n = I.current) != null && n.contains(document.activeElement)) && j(!1);
515
- };
516
- return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
517
- }, [o]), e.useEffect(() => {
518
- if (I.current) return () => {
519
- L.current && (L.current.focus({ preventScroll: !0 }), L.current = null, R.current = !1);
520
- };
521
- }, [I.current]), e.createElement("section", {
522
- ref: n,
523
- "aria-label": `${ne} ${oe}`,
524
- tabIndex: -1,
525
- "aria-live": "polite",
526
- "aria-relevant": "additions text",
527
- "aria-atomic": "false",
528
- suppressHydrationWarning: !0
529
- }, ae.map((n, r) => {
530
- let [a, o] = n.split("-");
531
- return w.length ? e.createElement("ol", {
532
- key: n,
533
- dir: v === "auto" ? E() : v,
534
- tabIndex: -1,
535
- ref: I,
536
- className: l,
537
- "data-sonner-toaster": !0,
538
- "data-theme": P,
539
- "data-y-position": a,
540
- "data-lifted": A && w.length > 1 && !s,
541
- "data-x-position": o,
542
- style: {
543
- "--front-toast-height": `${O[0]?.height || 0}px`,
544
- "--width": `${C}px`,
545
- "--gap": `${b}px`,
546
- ...h,
547
- ...D(u, ee)
548
- },
549
- onBlur: (e) => {
550
- R.current && !e.currentTarget.contains(e.relatedTarget) && (R.current = !1, L.current &&= (L.current.focus({ preventScroll: !0 }), null));
551
- },
552
- onFocus: (e) => {
553
- e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || R.current || (R.current = !0, L.current = e.relatedTarget);
554
- },
555
- onMouseEnter: () => j(!0),
556
- onMouseMove: () => j(!0),
557
- onMouseLeave: () => {
558
- M || j(!1);
559
- },
560
- onDragEnd: () => j(!1),
561
- onPointerDown: (e) => {
562
- e.target instanceof HTMLElement && e.target.dataset.dismissible === "false" || N(!0);
563
- },
564
- onPointerUp: () => N(!1)
565
- }, w.filter((e) => !e.position && r === 0 || e.position === n).map((r, a) => e.createElement(ie, {
566
- key: r.id,
567
- icons: S,
568
- index: a,
569
- toast: r,
570
- defaultRichColors: f,
571
- duration: _?.duration ?? m,
572
- className: _?.className,
573
- descriptionClassName: _?.descriptionClassName,
574
- invert: i,
575
- visibleToasts: g,
576
- closeButton: _?.closeButton ?? c,
577
- interacting: M,
578
- position: n,
579
- style: _?.style,
580
- unstyled: _?.unstyled,
581
- classNames: _?.classNames,
582
- cancelButtonStyle: _?.cancelButtonStyle,
583
- actionButtonStyle: _?.actionButtonStyle,
584
- removeToast: z,
585
- toasts: w.filter((e) => e.position == r.position),
586
- heights: O.filter((e) => e.position == r.position),
587
- setHeights: k,
588
- expandByDefault: s,
589
- gap: b,
590
- loadingIcon: x,
591
- expanded: A,
592
- pauseWhenPageIsHidden: re,
593
- swipeDirections: t.swipeDirections
594
- }))) : null;
595
- }));
596
- });
597
- //#endregion
598
- export { g as ue };
599
-
600
- //# sourceMappingURL=index.js.map