@soft-toast/vue 1.0.1 → 1.1.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.
package/dist/index.js CHANGED
@@ -1,43 +1,43 @@
1
- import { ref as O, computed as $, defineComponent as X, shallowRef as At, onMounted as he, watch as N, onUnmounted as me, h as xe, nextTick as Ee, openBlock as S, createElementBlock as L, createVNode as Ae, unref as at, createElementVNode as j, normalizeStyle as ct, normalizeClass as re, renderSlot as Q, withModifiers as Re, createCommentVNode as H, createBlock as q, resolveDynamicComponent as $e, toDisplayString as J, Fragment as ue, createTextVNode as Ct, renderList as ne, Teleport as lt, withDirectives as Ot, createSlots as ut, withCtx as ft, mergeProps as be, vShow as Lt, createApp as Dt } from "vue";
2
- import { gsap as A } from "gsap";
3
- let Z = null, dt = !1;
4
- const Ft = () => {
5
- dt = !0;
1
+ import { ref as R, computed as z, defineComponent as pe, shallowRef as un, onMounted as qe, watch as G, onUnmounted as Ve, h as Ge, nextTick as ke, openBlock as P, createElementBlock as $, createVNode as st, unref as Nt, createElementVNode as Q, normalizeStyle as De, normalizeClass as Fe, renderSlot as re, withModifiers as $e, createCommentVNode as ee, createBlock as K, resolveDynamicComponent as gt, toDisplayString as ye, Fragment as Ie, createTextVNode as fn, renderList as Se, Teleport as Ht, withDirectives as dn, createSlots as qt, withCtx as Vt, mergeProps as Ke, vShow as pn, createApp as hn } from "vue";
2
+ import { gsap as F } from "gsap";
3
+ let we = null, Yt = !1;
4
+ const mn = () => {
5
+ Yt = !0;
6
6
  };
7
7
  typeof window < "u" && ["click", "keydown", "pointerdown", "touchstart"].forEach(
8
- (e) => window.addEventListener(e, Ft, { once: !0, passive: !0 })
8
+ (e) => window.addEventListener(e, mn, { once: !0, passive: !0 })
9
9
  );
10
- const Mt = () => typeof window > "u" || typeof AudioContext > "u" ? null : (Z || (Z = new AudioContext()), Z.state === "suspended" && Z.resume().catch(() => {
11
- }), Z), B = (e, t, n, o = "sine", s = 0) => {
12
- const i = Mt();
10
+ const gn = () => typeof window > "u" || typeof AudioContext > "u" ? null : (we || (we = new AudioContext()), we.state === "suspended" && we.resume().catch(() => {
11
+ }), we), U = (e, t, n, o = "sine", s = 0) => {
12
+ const i = gn();
13
13
  if (i)
14
14
  try {
15
15
  const r = i.createOscillator(), a = i.createGain();
16
16
  r.connect(a), a.connect(i.destination), r.type = o, r.frequency.setValueAtTime(e, i.currentTime + s), a.gain.setValueAtTime(0, i.currentTime + s), a.gain.linearRampToValueAtTime(n, i.currentTime + s + 0.01), a.gain.exponentialRampToValueAtTime(1e-3, i.currentTime + s + t), r.start(i.currentTime + s), r.stop(i.currentTime + s + t + 0.02);
17
17
  } catch {
18
18
  }
19
- }, Ne = {
19
+ }, vt = {
20
20
  success: (e) => {
21
- B(523.25, 0.12, e * 0.45, "sine", 0), B(659.25, 0.14, e * 0.5, "sine", 0.08), B(783.99, 0.2, e * 0.55, "sine", 0.16);
21
+ U(523.25, 0.12, e * 0.45, "sine", 0), U(659.25, 0.14, e * 0.5, "sine", 0.08), U(783.99, 0.2, e * 0.55, "sine", 0.16);
22
22
  },
23
23
  error: (e) => {
24
- B(329.63, 0.18, e * 0.6, "triangle", 0), B(277.18, 0.28, e * 0.55, "triangle", 0.12);
24
+ U(329.63, 0.18, e * 0.6, "triangle", 0), U(277.18, 0.28, e * 0.55, "triangle", 0.12);
25
25
  },
26
26
  warning: (e) => {
27
- B(440, 0.14, e * 0.5, "sine", 0), B(440, 0.18, e * 0.4, "sine", 0.22);
27
+ U(440, 0.14, e * 0.5, "sine", 0), U(440, 0.18, e * 0.4, "sine", 0.22);
28
28
  },
29
29
  info: (e) => {
30
- B(659.25, 0.12, e * 0.38, "sine", 0), B(880, 0.18, e * 0.42, "sine", 0.1);
30
+ U(659.25, 0.12, e * 0.38, "sine", 0), U(880, 0.18, e * 0.42, "sine", 0.1);
31
31
  },
32
32
  default: (e) => {
33
- B(523.25, 0.15, e * 0.35, "sine", 0);
33
+ U(523.25, 0.15, e * 0.35, "sine", 0);
34
34
  },
35
35
  // promise → same as info while loading
36
36
  promise: (e) => {
37
- B(523.25, 0.12, e * 0.3, "sine", 0);
37
+ U(523.25, 0.12, e * 0.3, "sine", 0);
38
38
  }
39
- }, He = (e, t, n = 0.5) => {
40
- if (!t || typeof window > "u" || !dt) return;
39
+ }, yt = (e, t, n = 0.5) => {
40
+ if (!t || typeof window > "u" || !Yt) return;
41
41
  const o = Math.max(0, Math.min(1, n));
42
42
  if (typeof t == "string") {
43
43
  try {
@@ -48,8 +48,8 @@ const Mt = () => typeof window > "u" || typeof AudioContext > "u" ? null : (Z ||
48
48
  }
49
49
  return;
50
50
  }
51
- (Ne[e] ?? Ne.default)(o);
52
- }, jt = () => `toast-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, V = {
51
+ (vt[e] ?? vt.default)(o);
52
+ }, vn = () => `toast-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, se = {
53
53
  type: "default",
54
54
  duration: 4e3,
55
55
  position: "top-right",
@@ -58,142 +58,169 @@ const Mt = () => typeof window > "u" || typeof AudioContext > "u" ? null : (Z ||
58
58
  spring: !0,
59
59
  showTimestamp: !1,
60
60
  showProgress: !1
61
- }, b = O([]), Bt = (e) => $(() => b.value.filter((t) => t.position === e)), Rt = $(() => b.value), U = (e) => {
62
- const t = e.id || jt(), n = b.value.findIndex((r) => r.id === t);
63
- if (n !== -1 && !b.value[n].isLeaving) {
64
- const r = b.value[n];
65
- b.value[n] = {
66
- ...r,
61
+ }, k = R([]), X = /* @__PURE__ */ new Map(), Je = (e, t, n = !1) => {
62
+ if (t === 1 / 0) {
63
+ X.delete(e);
64
+ return;
65
+ }
66
+ X.set(e, { remainingTime: t, isPaused: n });
67
+ }, yn = (e) => z(() => k.value.filter((t) => t.position === e)), wn = z(() => k.value), ae = (e) => {
68
+ const t = e.id || vn(), n = k.value.findIndex((a) => a.id === t);
69
+ if (n !== -1 && !k.value[n].isLeaving) {
70
+ const a = k.value[n];
71
+ k.value[n] = {
72
+ ...a,
67
73
  ...e,
68
74
  id: t,
69
75
  // Reset timer so user has time to read the updated content
70
- remainingTime: e.duration ?? r.duration,
71
- isPaused: r.isPaused,
76
+ remainingTime: e.duration ?? a.duration,
77
+ isPaused: a.isPaused,
72
78
  isLeaving: !1
73
- };
74
- const a = e.sound, l = e.soundVolume ?? 0.5;
75
- return a && He(e.type ?? r.type, a, l), t;
79
+ }, Je(t, e.duration ?? a.duration, a.isPaused);
80
+ const l = e.sound, c = e.soundVolume ?? 0.5;
81
+ return l && yt(e.type ?? a.type, l, c), t;
76
82
  }
77
- const o = {
78
- ...V,
83
+ const o = e.duration ?? se.duration, s = {
84
+ ...se,
79
85
  ...e,
80
86
  id: t,
81
87
  createdAt: Date.now(),
82
- remainingTime: e.duration ?? V.duration,
88
+ remainingTime: o,
83
89
  isPaused: !1,
84
90
  isExpanded: !0,
85
91
  isLeaving: !1,
86
- preset: e.preset ?? V.preset,
87
- bounce: e.bounce ?? V.bounce,
88
- spring: e.spring ?? V.spring,
89
- showTimestamp: e.showTimestamp ?? V.showTimestamp,
90
- showProgress: e.showProgress ?? V.showProgress
92
+ preset: e.preset ?? se.preset,
93
+ bounce: e.bounce ?? se.bounce,
94
+ spring: e.spring ?? se.spring,
95
+ showTimestamp: e.showTimestamp ?? se.showTimestamp,
96
+ showProgress: e.showProgress ?? se.showProgress
91
97
  };
92
- b.value.unshift(o), zt();
93
- const s = e.sound, i = e.soundVolume ?? 0.5;
94
- return s && He(o.type, s, i), t;
95
- }, ke = (e, t) => {
96
- const n = b.value.findIndex((o) => o.id === e);
97
- n !== -1 && (b.value[n] = { ...b.value[n], ...t });
98
- }, $t = (e) => {
98
+ Je(t, o, !1), k.value.unshift(s), Sn();
99
+ const i = e.sound, r = e.soundVolume ?? 0.5;
100
+ return i && yt(s.type, i, r), t;
101
+ }, Ze = (e, t) => {
102
+ const n = k.value.findIndex((o) => o.id === e);
103
+ if (n !== -1) {
104
+ const o = k.value[n], s = t.duration ?? o.duration, i = t.duration === void 0 ? o.remainingTime : s;
105
+ k.value[n] = {
106
+ ...o,
107
+ ...t,
108
+ remainingTime: i
109
+ }, t.duration !== void 0 && Je(e, s, o.isPaused);
110
+ }
111
+ }, xn = (e) => {
99
112
  var t;
100
113
  if (!e) {
101
- b.value.forEach((n) => {
114
+ k.value.forEach((n) => {
102
115
  n.isLeaving = !0;
103
- }), setTimeout(() => {
104
- b.value = [];
116
+ }), X.clear(), setTimeout(() => {
117
+ k.value = [];
105
118
  }, 400);
106
119
  return;
107
120
  }
108
121
  if (typeof e == "string") {
109
- const n = b.value.find((o) => o.id === e);
110
- n && (n.isLeaving = !0, (t = n.onDismiss) == null || t.call(n, e), setTimeout(() => {
111
- b.value = b.value.filter((o) => o.id !== e);
122
+ const n = k.value.find((o) => o.id === e);
123
+ n && (n.isLeaving = !0, (t = n.onDismiss) == null || t.call(n, e), X.delete(e), setTimeout(() => {
124
+ k.value = k.value.filter((o) => o.id !== e);
112
125
  }, 400));
113
126
  } else {
114
127
  const n = Array.isArray(e.type) ? e.type : [e.type];
115
- b.value.forEach((o) => {
128
+ k.value.forEach((o) => {
116
129
  var s;
117
- n.includes(o.type) && (o.isLeaving = !0, (s = o.onDismiss) == null || s.call(o, o.id));
130
+ n.includes(o.type) && (o.isLeaving = !0, (s = o.onDismiss) == null || s.call(o, o.id), X.delete(o.id));
118
131
  }), setTimeout(() => {
119
- b.value = b.value.filter((o) => !n.includes(o.type));
132
+ k.value = k.value.filter((o) => !n.includes(o.type));
120
133
  }, 400);
121
134
  }
122
- }, Nt = (e) => {
123
- const t = b.value.find((n) => n.id === e);
135
+ }, bn = (e) => {
136
+ const t = X.get(e);
124
137
  t && (t.isPaused = !0);
125
- }, Ht = (e) => {
126
- const t = b.value.find((n) => n.id === e);
138
+ const n = k.value.find((o) => o.id === e);
139
+ n && (n.isPaused = !0);
140
+ }, Tn = (e) => {
141
+ const t = X.get(e);
127
142
  t && (t.isPaused = !1);
128
- }, qt = (e) => {
129
- const t = b.value.find((n) => n.id === e);
143
+ const n = k.value.find((o) => o.id === e);
144
+ n && (n.isPaused = !1);
145
+ }, kn = (e) => {
146
+ const t = k.value.find((n) => n.id === e);
130
147
  t && (t.isExpanded = !0);
131
- }, Vt = (e) => {
132
- const t = b.value.find((n) => n.id === e);
148
+ }, In = (e) => {
149
+ const t = k.value.find((n) => n.id === e);
133
150
  t && (t.isExpanded = !1);
134
151
  };
135
- let _ = 0, ie = null;
136
- const zt = () => {
137
- if (ie !== null || typeof window > "u") return;
152
+ let xe = 0, Me = null;
153
+ const Sn = () => {
154
+ if (Me !== null || typeof window > "u") return;
138
155
  const e = (t) => {
139
- _ === 0 && (_ = t);
140
- const n = t - _;
141
- _ = t, b.value.forEach((o) => {
142
- var s;
143
- !o.isPaused && !o.isLeaving && o.remainingTime > 0 && o.duration !== 1 / 0 && (o.remainingTime -= n, o.remainingTime <= 0 && (o.isLeaving = !0, (s = o.onAutoClose) == null || s.call(o, o.id), setTimeout(() => {
144
- b.value = b.value.filter((i) => i.id !== o.id);
145
- }, 400)));
146
- }), b.value.length > 0 ? ie = requestAnimationFrame(e) : (ie = null, _ = 0);
156
+ var s;
157
+ xe === 0 && (xe = t);
158
+ const n = t - xe;
159
+ xe = t;
160
+ const o = [];
161
+ X.forEach((i, r) => {
162
+ if (i.isPaused) return;
163
+ const a = k.value.find((l) => l.id === r);
164
+ !a || a.isLeaving || a.duration === 1 / 0 || (i.remainingTime -= n, a.showProgress && (a.remainingTime = i.remainingTime), i.remainingTime <= 0 && o.push(r));
165
+ });
166
+ for (const i of o) {
167
+ X.delete(i);
168
+ const r = k.value.find((a) => a.id === i);
169
+ r && !r.isLeaving && (r.isLeaving = !0, (s = r.onAutoClose) == null || s.call(r, i), setTimeout(() => {
170
+ k.value = k.value.filter((a) => a.id !== i);
171
+ }, 400));
172
+ }
173
+ k.value.length > 0 ? Me = requestAnimationFrame(e) : (Me = null, xe = 0);
147
174
  };
148
- ie = requestAnimationFrame(e);
149
- }, Qt = (e, t) => U({ ...t, type: "success", title: e }), Ut = (e, t) => U({ ...t, type: "error", title: e }), Yt = (e, t) => U({ ...t, type: "warning", title: e }), Gt = (e, t) => U({ ...t, type: "info", title: e }), Xt = (e, t) => U({ ...t, type: "promise", title: e, duration: 1 / 0 }), Wt = async (e, t, n) => {
150
- var s, i, r;
151
- const o = U({
175
+ Me = requestAnimationFrame(e);
176
+ }, En = (e, t) => ae({ ...t, type: "success", title: e }), Pn = (e, t) => ae({ ...t, type: "error", title: e }), Ln = (e, t) => ae({ ...t, type: "warning", title: e }), Cn = (e, t) => ae({ ...t, type: "info", title: e }), An = (e, t) => ae({ ...t, type: "promise", title: e, duration: 1 / 0 }), On = async (e, t, n) => {
177
+ var s, i, r, a, l;
178
+ const o = ae({
152
179
  ...n,
153
180
  type: "promise",
154
181
  title: t.loading,
155
182
  duration: 1 / 0
156
183
  });
157
184
  try {
158
- const a = await e;
159
- return ke(o, {
185
+ const c = await e;
186
+ return Ze(o, {
160
187
  type: "success",
161
- title: t.success,
162
- description: (s = t.description) == null ? void 0 : s.success,
188
+ title: typeof t.success == "function" ? t.success(c) : t.success,
189
+ description: typeof ((s = t.description) == null ? void 0 : s.success) == "function" ? t.description.success(c) : (i = t.description) == null ? void 0 : i.success,
163
190
  duration: 4e3
164
- }), a;
165
- } catch (a) {
166
- throw ke(o, {
191
+ }), c;
192
+ } catch (c) {
193
+ throw Ze(o, {
167
194
  type: "error",
168
- title: t.error,
169
- description: (i = t.description) == null ? void 0 : i.error,
170
- action: (r = t.action) == null ? void 0 : r.error,
195
+ title: typeof t.error == "function" ? t.error(c) : t.error,
196
+ description: typeof ((r = t.description) == null ? void 0 : r.error) == "function" ? t.description.error(c) : (a = t.description) == null ? void 0 : a.error,
197
+ action: (l = t.action) == null ? void 0 : l.error,
171
198
  duration: 6e3
172
- }), a;
199
+ }), c;
173
200
  }
174
- }, Kt = () => {
175
- b.value = [];
176
- }, Jt = (e) => {
177
- b.value = b.value.filter((t) => t.id !== e);
178
- }, m = {
179
- toasts: Rt,
180
- getToastsByPosition: Bt,
181
- add: U,
182
- update: ke,
183
- dismiss: $t,
184
- pause: Nt,
185
- resume: Ht,
186
- expand: qt,
187
- collapse: Vt,
188
- success: Qt,
189
- error: Ut,
190
- warning: Yt,
191
- info: Gt,
192
- loading: Xt,
193
- promise: Wt,
194
- clearAll: Kt,
195
- remove: Jt
196
- }, pt = /^[a-z0-9]+(-[a-z0-9]+)*$/, ge = (e, t, n, o = "") => {
201
+ }, Mn = () => {
202
+ X.clear(), k.value = [];
203
+ }, Dn = (e) => {
204
+ X.delete(e), k.value = k.value.filter((t) => t.id !== e);
205
+ }, y = {
206
+ toasts: wn,
207
+ getToastsByPosition: yn,
208
+ add: ae,
209
+ update: Ze,
210
+ dismiss: xn,
211
+ pause: bn,
212
+ resume: Tn,
213
+ expand: kn,
214
+ collapse: In,
215
+ success: En,
216
+ error: Pn,
217
+ warning: Ln,
218
+ info: Cn,
219
+ loading: An,
220
+ promise: On,
221
+ clearAll: Mn,
222
+ remove: Dn
223
+ }, zt = /^[a-z0-9]+(-[a-z0-9]+)*$/, Ye = (e, t, n, o = "") => {
197
224
  const s = e.split(":");
198
225
  if (e.slice(0, 1) === "@") {
199
226
  if (s.length < 2 || s.length > 3) return null;
@@ -206,7 +233,7 @@ const zt = () => {
206
233
  prefix: l,
207
234
  name: a
208
235
  };
209
- return t && !ae(c) ? null : c;
236
+ return t && !Be(c) ? null : c;
210
237
  }
211
238
  const i = s[0], r = i.split("-");
212
239
  if (r.length > 1) {
@@ -215,7 +242,7 @@ const zt = () => {
215
242
  prefix: r.shift(),
216
243
  name: r.join("-")
217
244
  };
218
- return t && !ae(a) ? null : a;
245
+ return t && !Be(a) ? null : a;
219
246
  }
220
247
  if (n && o === "") {
221
248
  const a = {
@@ -223,11 +250,11 @@ const zt = () => {
223
250
  prefix: "",
224
251
  name: i
225
252
  };
226
- return t && !ae(a, n) ? null : a;
253
+ return t && !Be(a, n) ? null : a;
227
254
  }
228
255
  return null;
229
- }, ae = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
230
- function Zt(e, t) {
256
+ }, Be = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
257
+ function Fn(e, t) {
231
258
  const n = e.icons, o = e.aliases || /* @__PURE__ */ Object.create(null), s = /* @__PURE__ */ Object.create(null);
232
259
  function i(r) {
233
260
  if (n[r]) return s[r] = [];
@@ -240,83 +267,83 @@ function Zt(e, t) {
240
267
  }
241
268
  return Object.keys(n).concat(Object.keys(o)).forEach(i), s;
242
269
  }
243
- const ht = Object.freeze({
270
+ const Qt = Object.freeze({
244
271
  left: 0,
245
272
  top: 0,
246
273
  width: 16,
247
274
  height: 16
248
- }), fe = Object.freeze({
275
+ }), Ne = Object.freeze({
249
276
  rotate: 0,
250
277
  vFlip: !1,
251
278
  hFlip: !1
252
- }), ve = Object.freeze({
253
- ...ht,
254
- ...fe
255
- }), Te = Object.freeze({
256
- ...ve,
279
+ }), ze = Object.freeze({
280
+ ...Qt,
281
+ ...Ne
282
+ }), _e = Object.freeze({
283
+ ...ze,
257
284
  body: "",
258
285
  hidden: !1
259
286
  });
260
- function _t(e, t) {
287
+ function Bn(e, t) {
261
288
  const n = {};
262
289
  !e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
263
290
  const o = ((e.rotate || 0) + (t.rotate || 0)) % 4;
264
291
  return o && (n.rotate = o), n;
265
292
  }
266
- function qe(e, t) {
267
- const n = _t(e, t);
268
- for (const o in Te) o in fe ? o in e && !(o in n) && (n[o] = fe[o]) : o in t ? n[o] = t[o] : o in e && (n[o] = e[o]);
293
+ function wt(e, t) {
294
+ const n = Bn(e, t);
295
+ for (const o in _e) o in Ne ? o in e && !(o in n) && (n[o] = Ne[o]) : o in t ? n[o] = t[o] : o in e && (n[o] = e[o]);
269
296
  return n;
270
297
  }
271
- function en(e, t, n) {
298
+ function jn(e, t, n) {
272
299
  const o = e.icons, s = e.aliases || /* @__PURE__ */ Object.create(null);
273
300
  let i = {};
274
301
  function r(a) {
275
- i = qe(o[a] || s[a], i);
302
+ i = wt(o[a] || s[a], i);
276
303
  }
277
- return r(t), n.forEach(r), qe(e, i);
304
+ return r(t), n.forEach(r), wt(e, i);
278
305
  }
279
- function mt(e, t) {
306
+ function Ut(e, t) {
280
307
  const n = [];
281
308
  if (typeof e != "object" || typeof e.icons != "object") return n;
282
309
  e.not_found instanceof Array && e.not_found.forEach((s) => {
283
310
  t(s, null), n.push(s);
284
311
  });
285
- const o = Zt(e);
312
+ const o = Fn(e);
286
313
  for (const s in o) {
287
314
  const i = o[s];
288
- i && (t(s, en(e, s, i)), n.push(s));
315
+ i && (t(s, jn(e, s, i)), n.push(s));
289
316
  }
290
317
  return n;
291
318
  }
292
- const tn = {
319
+ const Rn = {
293
320
  provider: "",
294
321
  aliases: {},
295
322
  not_found: {},
296
- ...ht
323
+ ...Qt
297
324
  };
298
- function ye(e, t) {
325
+ function Xe(e, t) {
299
326
  for (const n in t) if (n in e && typeof e[n] != typeof t[n]) return !1;
300
327
  return !0;
301
328
  }
302
- function gt(e) {
329
+ function Xt(e) {
303
330
  if (typeof e != "object" || e === null) return null;
304
331
  const t = e;
305
- if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !ye(e, tn)) return null;
332
+ if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !Xe(e, Rn)) return null;
306
333
  const n = t.icons;
307
334
  for (const s in n) {
308
335
  const i = n[s];
309
- if (!s || typeof i.body != "string" || !ye(i, Te)) return null;
336
+ if (!s || typeof i.body != "string" || !Xe(i, _e)) return null;
310
337
  }
311
338
  const o = t.aliases || /* @__PURE__ */ Object.create(null);
312
339
  for (const s in o) {
313
340
  const i = o[s], r = i.parent;
314
- if (!s || typeof r != "string" || !n[r] && !o[r] || !ye(i, Te)) return null;
341
+ if (!s || typeof r != "string" || !n[r] && !o[r] || !Xe(i, _e)) return null;
315
342
  }
316
343
  return t;
317
344
  }
318
- const Ve = /* @__PURE__ */ Object.create(null);
319
- function nn(e, t) {
345
+ const xt = /* @__PURE__ */ Object.create(null);
346
+ function $n(e, t) {
320
347
  return {
321
348
  provider: e,
322
349
  prefix: t,
@@ -324,16 +351,16 @@ function nn(e, t) {
324
351
  missing: /* @__PURE__ */ new Set()
325
352
  };
326
353
  }
327
- function G(e, t) {
328
- const n = Ve[e] || (Ve[e] = /* @__PURE__ */ Object.create(null));
329
- return n[t] || (n[t] = nn(e, t));
354
+ function de(e, t) {
355
+ const n = xt[e] || (xt[e] = /* @__PURE__ */ Object.create(null));
356
+ return n[t] || (n[t] = $n(e, t));
330
357
  }
331
- function vt(e, t) {
332
- return gt(t) ? mt(t, (n, o) => {
358
+ function Wt(e, t) {
359
+ return Xt(t) ? Ut(t, (n, o) => {
333
360
  o ? e.icons[n] = o : e.missing.add(n);
334
361
  }) : [];
335
362
  }
336
- function on(e, t, n) {
363
+ function Nn(e, t, n) {
337
364
  try {
338
365
  if (typeof n.body == "string")
339
366
  return e.icons[t] = { ...n }, !0;
@@ -341,52 +368,52 @@ function on(e, t, n) {
341
368
  }
342
369
  return !1;
343
370
  }
344
- let oe = !1;
345
- function yt(e) {
346
- return typeof e == "boolean" && (oe = e), oe;
371
+ let Ee = !1;
372
+ function Gt(e) {
373
+ return typeof e == "boolean" && (Ee = e), Ee;
347
374
  }
348
- function sn(e) {
349
- const t = typeof e == "string" ? ge(e, !0, oe) : e;
375
+ function Hn(e) {
376
+ const t = typeof e == "string" ? Ye(e, !0, Ee) : e;
350
377
  if (t) {
351
- const n = G(t.provider, t.prefix), o = t.name;
378
+ const n = de(t.provider, t.prefix), o = t.name;
352
379
  return n.icons[o] || (n.missing.has(o) ? null : void 0);
353
380
  }
354
381
  }
355
- function z(e, t) {
356
- const n = ge(e, !0, oe);
382
+ function ie(e, t) {
383
+ const n = Ye(e, !0, Ee);
357
384
  if (!n) return !1;
358
- const o = G(n.provider, n.prefix);
359
- return t ? on(o, n.name, t) : (o.missing.add(n.name), !0);
385
+ const o = de(n.provider, n.prefix);
386
+ return t ? Nn(o, n.name, t) : (o.missing.add(n.name), !0);
360
387
  }
361
- function rn(e, t) {
388
+ function qn(e, t) {
362
389
  if (typeof e != "object") return !1;
363
- if (typeof t != "string" && (t = e.provider || ""), oe && !t && !e.prefix) {
390
+ if (typeof t != "string" && (t = e.provider || ""), Ee && !t && !e.prefix) {
364
391
  let o = !1;
365
- return gt(e) && (e.prefix = "", mt(e, (s, i) => {
366
- z(s, i) && (o = !0);
392
+ return Xt(e) && (e.prefix = "", Ut(e, (s, i) => {
393
+ ie(s, i) && (o = !0);
367
394
  })), o;
368
395
  }
369
396
  const n = e.prefix;
370
- return ae({
397
+ return Be({
371
398
  prefix: n,
372
399
  name: "a"
373
- }) ? !!vt(G(t, n), e) : !1;
400
+ }) ? !!Wt(de(t, n), e) : !1;
374
401
  }
375
- const wt = Object.freeze({
402
+ const Kt = Object.freeze({
376
403
  width: null,
377
404
  height: null
378
- }), xt = Object.freeze({
379
- ...wt,
380
- ...fe
381
- }), an = /(-?[0-9.]*[0-9]+[0-9.]*)/g, cn = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
382
- function ze(e, t, n) {
405
+ }), Jt = Object.freeze({
406
+ ...Kt,
407
+ ...Ne
408
+ }), Vn = /(-?[0-9.]*[0-9]+[0-9.]*)/g, Yn = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
409
+ function bt(e, t, n) {
383
410
  if (t === 1) return e;
384
411
  if (n = n || 100, typeof e == "number") return Math.ceil(e * t * n) / n;
385
412
  if (typeof e != "string") return e;
386
- const o = e.split(an);
413
+ const o = e.split(Vn);
387
414
  if (o === null || !o.length) return e;
388
415
  const s = [];
389
- let i = o.shift(), r = cn.test(i);
416
+ let i = o.shift(), r = Yn.test(i);
390
417
  for (; ; ) {
391
418
  if (r) {
392
419
  const a = parseFloat(i);
@@ -396,7 +423,7 @@ function ze(e, t, n) {
396
423
  r = !r;
397
424
  }
398
425
  }
399
- function ln(e, t = "defs") {
426
+ function zn(e, t = "defs") {
400
427
  let n = "";
401
428
  const o = e.indexOf("<" + t);
402
429
  for (; o >= 0; ) {
@@ -411,20 +438,20 @@ function ln(e, t = "defs") {
411
438
  content: e
412
439
  };
413
440
  }
414
- function un(e, t) {
441
+ function Qn(e, t) {
415
442
  return e ? "<defs>" + e + "</defs>" + t : t;
416
443
  }
417
- function fn(e, t, n) {
418
- const o = ln(e);
419
- return un(o.defs, t + o.content + n);
444
+ function Un(e, t, n) {
445
+ const o = zn(e);
446
+ return Qn(o.defs, t + o.content + n);
420
447
  }
421
- const dn = (e) => e === "unset" || e === "undefined" || e === "none";
422
- function pn(e, t) {
448
+ const Xn = (e) => e === "unset" || e === "undefined" || e === "none";
449
+ function Wn(e, t) {
423
450
  const n = {
424
- ...ve,
451
+ ...ze,
425
452
  ...e
426
453
  }, o = {
427
- ...xt,
454
+ ...Jt,
428
455
  ...t
429
456
  }, s = {
430
457
  left: n.left,
@@ -434,67 +461,67 @@ function pn(e, t) {
434
461
  };
435
462
  let i = n.body;
436
463
  [n, o].forEach((I) => {
437
- const d = [], D = I.hFlip, F = I.vFlip;
438
- let f = I.rotate;
439
- D ? F ? f += 2 : (d.push("translate(" + (s.width + s.left).toString() + " " + (0 - s.top).toString() + ")"), d.push("scale(-1 1)"), s.top = s.left = 0) : F && (d.push("translate(" + (0 - s.left).toString() + " " + (s.height + s.top).toString() + ")"), d.push("scale(1 -1)"), s.top = s.left = 0);
440
- let g;
441
- switch (f < 0 && (f -= Math.floor(f / 4) * 4), f = f % 4, f) {
464
+ const h = [], N = I.hFlip, O = I.vFlip;
465
+ let b = I.rotate;
466
+ N ? O ? b += 2 : (h.push("translate(" + (s.width + s.left).toString() + " " + (0 - s.top).toString() + ")"), h.push("scale(-1 1)"), s.top = s.left = 0) : O && (h.push("translate(" + (0 - s.left).toString() + " " + (s.height + s.top).toString() + ")"), h.push("scale(1 -1)"), s.top = s.left = 0);
467
+ let T;
468
+ switch (b < 0 && (b -= Math.floor(b / 4) * 4), b = b % 4, b) {
442
469
  case 1:
443
- g = s.height / 2 + s.top, d.unshift("rotate(90 " + g.toString() + " " + g.toString() + ")");
470
+ T = s.height / 2 + s.top, h.unshift("rotate(90 " + T.toString() + " " + T.toString() + ")");
444
471
  break;
445
472
  case 2:
446
- d.unshift("rotate(180 " + (s.width / 2 + s.left).toString() + " " + (s.height / 2 + s.top).toString() + ")");
473
+ h.unshift("rotate(180 " + (s.width / 2 + s.left).toString() + " " + (s.height / 2 + s.top).toString() + ")");
447
474
  break;
448
475
  case 3:
449
- g = s.width / 2 + s.left, d.unshift("rotate(-90 " + g.toString() + " " + g.toString() + ")");
476
+ T = s.width / 2 + s.left, h.unshift("rotate(-90 " + T.toString() + " " + T.toString() + ")");
450
477
  break;
451
478
  }
452
- f % 2 === 1 && (s.left !== s.top && (g = s.left, s.left = s.top, s.top = g), s.width !== s.height && (g = s.width, s.width = s.height, s.height = g)), d.length && (i = fn(i, '<g transform="' + d.join(" ") + '">', "</g>"));
479
+ b % 2 === 1 && (s.left !== s.top && (T = s.left, s.left = s.top, s.top = T), s.width !== s.height && (T = s.width, s.width = s.height, s.height = T)), h.length && (i = Un(i, '<g transform="' + h.join(" ") + '">', "</g>"));
453
480
  });
454
481
  const r = o.width, a = o.height, l = s.width, c = s.height;
455
- let u, p;
456
- r === null ? (p = a === null ? "1em" : a === "auto" ? c : a, u = ze(p, l / c)) : (u = r === "auto" ? l : r, p = a === null ? ze(u, c / l) : a === "auto" ? c : a);
457
- const x = {}, k = (I, d) => {
458
- dn(d) || (x[I] = d.toString());
482
+ let d, w;
483
+ r === null ? (w = a === null ? "1em" : a === "auto" ? c : a, d = bt(w, l / c)) : (d = r === "auto" ? l : r, w = a === null ? bt(d, c / l) : a === "auto" ? c : a);
484
+ const x = {}, S = (I, h) => {
485
+ Xn(h) || (x[I] = h.toString());
459
486
  };
460
- k("width", u), k("height", p);
461
- const T = [
487
+ S("width", d), S("height", w);
488
+ const g = [
462
489
  s.left,
463
490
  s.top,
464
491
  l,
465
492
  c
466
493
  ];
467
- return x.viewBox = T.join(" "), {
494
+ return x.viewBox = g.join(" "), {
468
495
  attributes: x,
469
- viewBox: T,
496
+ viewBox: g,
470
497
  body: i
471
498
  };
472
499
  }
473
- const hn = /\sid="(\S+)"/g, Qe = /* @__PURE__ */ new Map();
474
- function mn(e) {
500
+ const Gn = /\sid="(\S+)"/g, Tt = /* @__PURE__ */ new Map();
501
+ function Kn(e) {
475
502
  e = e.replace(/[0-9]+$/, "") || "a";
476
- const t = Qe.get(e) || 0;
477
- return Qe.set(e, t + 1), t ? `${e}${t}` : e;
503
+ const t = Tt.get(e) || 0;
504
+ return Tt.set(e, t + 1), t ? `${e}${t}` : e;
478
505
  }
479
- function gn(e) {
506
+ function Jn(e) {
480
507
  const t = [];
481
508
  let n;
482
- for (; n = hn.exec(e); ) t.push(n[1]);
509
+ for (; n = Gn.exec(e); ) t.push(n[1]);
483
510
  if (!t.length) return e;
484
511
  const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
485
512
  return t.forEach((s) => {
486
- const i = mn(s), r = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
513
+ const i = Kn(s), r = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
487
514
  e = e.replace(new RegExp('([#;"])(' + r + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
488
515
  }), e = e.replace(new RegExp(o, "g"), ""), e;
489
516
  }
490
- const Ie = /* @__PURE__ */ Object.create(null);
491
- function vn(e, t) {
492
- Ie[e] = t;
517
+ const et = /* @__PURE__ */ Object.create(null);
518
+ function Zn(e, t) {
519
+ et[e] = t;
493
520
  }
494
- function Se(e) {
495
- return Ie[e] || Ie[""];
521
+ function tt(e) {
522
+ return et[e] || et[""];
496
523
  }
497
- function Ce(e) {
524
+ function it(e) {
498
525
  let t;
499
526
  if (typeof e.resources == "string") t = [e.resources];
500
527
  else if (t = e.resources, !(t instanceof Array) || !t.length) return null;
@@ -509,26 +536,26 @@ function Ce(e) {
509
536
  dataAfterTimeout: e.dataAfterTimeout !== !1
510
537
  };
511
538
  }
512
- const Oe = /* @__PURE__ */ Object.create(null), ee = ["https://api.simplesvg.com", "https://api.unisvg.com"], ce = [];
513
- for (; ee.length > 0; ) ee.length === 1 || Math.random() > 0.5 ? ce.push(ee.shift()) : ce.push(ee.pop());
514
- Oe[""] = Ce({ resources: ["https://api.iconify.design"].concat(ce) });
515
- function yn(e, t) {
516
- const n = Ce(t);
517
- return n === null ? !1 : (Oe[e] = n, !0);
539
+ const rt = /* @__PURE__ */ Object.create(null), be = ["https://api.simplesvg.com", "https://api.unisvg.com"], je = [];
540
+ for (; be.length > 0; ) be.length === 1 || Math.random() > 0.5 ? je.push(be.shift()) : je.push(be.pop());
541
+ rt[""] = it({ resources: ["https://api.iconify.design"].concat(je) });
542
+ function _n(e, t) {
543
+ const n = it(t);
544
+ return n === null ? !1 : (rt[e] = n, !0);
518
545
  }
519
- function Le(e) {
520
- return Oe[e];
546
+ function at(e) {
547
+ return rt[e];
521
548
  }
522
- const wn = () => {
549
+ const eo = () => {
523
550
  let e;
524
551
  try {
525
552
  if (e = fetch, typeof e == "function") return e;
526
553
  } catch {
527
554
  }
528
555
  };
529
- let Ue = wn();
530
- function xn(e, t) {
531
- const n = Le(e);
556
+ let kt = eo();
557
+ function to(e, t) {
558
+ const n = at(e);
532
559
  if (!n) return 0;
533
560
  let o;
534
561
  if (!n.maxURL) o = 0;
@@ -542,11 +569,11 @@ function xn(e, t) {
542
569
  }
543
570
  return o;
544
571
  }
545
- function bn(e) {
572
+ function no(e) {
546
573
  return e === 404;
547
574
  }
548
- const kn = (e, t, n) => {
549
- const o = [], s = xn(e, t), i = "icons";
575
+ const oo = (e, t, n) => {
576
+ const o = [], s = to(e, t), i = "icons";
550
577
  let r = {
551
578
  type: i,
552
579
  provider: e,
@@ -562,19 +589,19 @@ const kn = (e, t, n) => {
562
589
  }, a = l.length), r.icons.push(l);
563
590
  }), o.push(r), o;
564
591
  };
565
- function Tn(e) {
592
+ function so(e) {
566
593
  if (typeof e == "string") {
567
- const t = Le(e);
594
+ const t = at(e);
568
595
  if (t) return t.path;
569
596
  }
570
597
  return "/";
571
598
  }
572
- const In = (e, t, n) => {
573
- if (!Ue) {
599
+ const io = (e, t, n) => {
600
+ if (!kt) {
574
601
  n("abort", 424);
575
602
  return;
576
603
  }
577
- let o = Tn(t.provider);
604
+ let o = so(t.provider);
578
605
  switch (t.type) {
579
606
  case "icons": {
580
607
  const i = t.prefix, r = t.icons.join(","), a = new URLSearchParams({ icons: r });
@@ -591,11 +618,11 @@ const In = (e, t, n) => {
591
618
  return;
592
619
  }
593
620
  let s = 503;
594
- Ue(e + o).then((i) => {
621
+ kt(e + o).then((i) => {
595
622
  const r = i.status;
596
623
  if (r !== 200) {
597
624
  setTimeout(() => {
598
- n(bn(r) ? "abort" : "next", r);
625
+ n(no(r) ? "abort" : "next", r);
599
626
  });
600
627
  return;
601
628
  }
@@ -613,17 +640,17 @@ const In = (e, t, n) => {
613
640
  }).catch(() => {
614
641
  n("next", s);
615
642
  });
616
- }, Sn = {
617
- prepare: kn,
618
- send: In
643
+ }, ro = {
644
+ prepare: oo,
645
+ send: io
619
646
  };
620
- function bt(e, t) {
647
+ function Zt(e, t) {
621
648
  e.forEach((n) => {
622
649
  const o = n.loaderCallbacks;
623
650
  o && (n.loaderCallbacks = o.filter((s) => s.id !== t));
624
651
  });
625
652
  }
626
- function Pn(e) {
653
+ function ao(e) {
627
654
  e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
628
655
  e.pendingCallbacksFlag = !1;
629
656
  const t = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
@@ -648,13 +675,13 @@ function Pn(e) {
648
675
  else
649
676
  return n = !0, !0;
650
677
  return !1;
651
- }), r.pending.length !== a && (n || bt([e], i.id), i.callback(r.loaded.slice(0), r.missing.slice(0), r.pending.slice(0), i.abort));
678
+ }), r.pending.length !== a && (n || Zt([e], i.id), i.callback(r.loaded.slice(0), r.missing.slice(0), r.pending.slice(0), i.abort));
652
679
  });
653
680
  }));
654
681
  }
655
- let En = 0;
656
- function An(e, t, n) {
657
- const o = En++, s = bt.bind(null, n, o);
682
+ let co = 0;
683
+ function lo(e, t, n) {
684
+ const o = co++, s = Zt.bind(null, n, o);
658
685
  if (!t.pending.length) return s;
659
686
  const i = {
660
687
  id: o,
@@ -666,7 +693,7 @@ function An(e, t, n) {
666
693
  (r.loaderCallbacks || (r.loaderCallbacks = [])).push(i);
667
694
  }), s;
668
695
  }
669
- function Cn(e) {
696
+ function uo(e) {
670
697
  const t = {
671
698
  loaded: [],
672
699
  missing: [],
@@ -681,25 +708,25 @@ function Cn(e) {
681
708
  return e.forEach((s) => {
682
709
  if (o.name === s.name && o.prefix === s.prefix && o.provider === s.provider) return;
683
710
  o = s;
684
- const i = s.provider, r = s.prefix, a = s.name, l = n[i] || (n[i] = /* @__PURE__ */ Object.create(null)), c = l[r] || (l[r] = G(i, r));
685
- let u;
686
- a in c.icons ? u = t.loaded : r === "" || c.missing.has(a) ? u = t.missing : u = t.pending;
687
- const p = {
711
+ const i = s.provider, r = s.prefix, a = s.name, l = n[i] || (n[i] = /* @__PURE__ */ Object.create(null)), c = l[r] || (l[r] = de(i, r));
712
+ let d;
713
+ a in c.icons ? d = t.loaded : r === "" || c.missing.has(a) ? d = t.missing : d = t.pending;
714
+ const w = {
688
715
  provider: i,
689
716
  prefix: r,
690
717
  name: a
691
718
  };
692
- u.push(p);
719
+ d.push(w);
693
720
  }), t;
694
721
  }
695
- function On(e, t = !0, n = !1) {
722
+ function fo(e, t = !0, n = !1) {
696
723
  const o = [];
697
724
  return e.forEach((s) => {
698
- const i = typeof s == "string" ? ge(s, t, n) : s;
725
+ const i = typeof s == "string" ? Ye(s, t, n) : s;
699
726
  i && o.push(i);
700
727
  }), o;
701
728
  }
702
- const Ln = {
729
+ const po = {
703
730
  resources: [],
704
731
  index: 0,
705
732
  timeout: 2e3,
@@ -707,107 +734,107 @@ const Ln = {
707
734
  random: !1,
708
735
  dataAfterTimeout: !1
709
736
  };
710
- function Dn(e, t, n, o) {
737
+ function ho(e, t, n, o) {
711
738
  const s = e.resources.length, i = e.random ? Math.floor(Math.random() * s) : e.index;
712
739
  let r;
713
740
  if (e.random) {
714
741
  let v = e.resources.slice(0);
715
742
  for (r = []; v.length > 1; ) {
716
- const P = Math.floor(Math.random() * v.length);
717
- r.push(v[P]), v = v.slice(0, P).concat(v.slice(P + 1));
743
+ const M = Math.floor(Math.random() * v.length);
744
+ r.push(v[M]), v = v.slice(0, M).concat(v.slice(M + 1));
718
745
  }
719
746
  r = r.concat(v);
720
747
  } else r = e.resources.slice(i).concat(e.resources.slice(0, i));
721
748
  const a = Date.now();
722
- let l = "pending", c = 0, u, p = null, x = [], k = [];
723
- typeof o == "function" && k.push(o);
724
- function T() {
725
- p && (clearTimeout(p), p = null);
749
+ let l = "pending", c = 0, d, w = null, x = [], S = [];
750
+ typeof o == "function" && S.push(o);
751
+ function g() {
752
+ w && (clearTimeout(w), w = null);
726
753
  }
727
754
  function I() {
728
- l === "pending" && (l = "aborted"), T(), x.forEach((v) => {
755
+ l === "pending" && (l = "aborted"), g(), x.forEach((v) => {
729
756
  v.status === "pending" && (v.status = "aborted");
730
757
  }), x = [];
731
758
  }
732
- function d(v, P) {
733
- P && (k = []), typeof v == "function" && k.push(v);
759
+ function h(v, M) {
760
+ M && (S = []), typeof v == "function" && S.push(v);
734
761
  }
735
- function D() {
762
+ function N() {
736
763
  return {
737
764
  startTime: a,
738
765
  payload: t,
739
766
  status: l,
740
767
  queriesSent: c,
741
768
  queriesPending: x.length,
742
- subscribe: d,
769
+ subscribe: h,
743
770
  abort: I
744
771
  };
745
772
  }
746
- function F() {
747
- l = "failed", k.forEach((v) => {
748
- v(void 0, u);
773
+ function O() {
774
+ l = "failed", S.forEach((v) => {
775
+ v(void 0, d);
749
776
  });
750
777
  }
751
- function f() {
778
+ function b() {
752
779
  x.forEach((v) => {
753
780
  v.status === "pending" && (v.status = "aborted");
754
781
  }), x = [];
755
782
  }
756
- function g(v, P, h) {
757
- const w = P !== "success";
758
- switch (x = x.filter((y) => y !== v), l) {
783
+ function T(v, M, W) {
784
+ const J = M !== "success";
785
+ switch (x = x.filter((E) => E !== v), l) {
759
786
  case "pending":
760
787
  break;
761
788
  case "failed":
762
- if (w || !e.dataAfterTimeout) return;
789
+ if (J || !e.dataAfterTimeout) return;
763
790
  break;
764
791
  default:
765
792
  return;
766
793
  }
767
- if (P === "abort") {
768
- u = h, F();
794
+ if (M === "abort") {
795
+ d = W, O();
769
796
  return;
770
797
  }
771
- if (w) {
772
- u = h, x.length || (r.length ? C() : F());
798
+ if (J) {
799
+ d = W, x.length || (r.length ? H() : O());
773
800
  return;
774
801
  }
775
- if (T(), f(), !e.random) {
776
- const y = e.resources.indexOf(v.resource);
777
- y !== -1 && y !== e.index && (e.index = y);
802
+ if (g(), b(), !e.random) {
803
+ const E = e.resources.indexOf(v.resource);
804
+ E !== -1 && E !== e.index && (e.index = E);
778
805
  }
779
- l = "completed", k.forEach((y) => {
780
- y(h);
806
+ l = "completed", S.forEach((E) => {
807
+ E(W);
781
808
  });
782
809
  }
783
- function C() {
810
+ function H() {
784
811
  if (l !== "pending") return;
785
- T();
812
+ g();
786
813
  const v = r.shift();
787
814
  if (v === void 0) {
788
815
  if (x.length) {
789
- p = setTimeout(() => {
790
- T(), l === "pending" && (f(), F());
816
+ w = setTimeout(() => {
817
+ g(), l === "pending" && (b(), O());
791
818
  }, e.timeout);
792
819
  return;
793
820
  }
794
- F();
821
+ O();
795
822
  return;
796
823
  }
797
- const P = {
824
+ const M = {
798
825
  status: "pending",
799
826
  resource: v,
800
- callback: (h, w) => {
801
- g(P, h, w);
827
+ callback: (W, J) => {
828
+ T(M, W, J);
802
829
  }
803
830
  };
804
- x.push(P), c++, p = setTimeout(C, e.rotate), n(v, t, P.callback);
831
+ x.push(M), c++, w = setTimeout(H, e.rotate), n(v, t, M.callback);
805
832
  }
806
- return setTimeout(C), D;
833
+ return setTimeout(H), N;
807
834
  }
808
- function kt(e) {
835
+ function _t(e) {
809
836
  const t = {
810
- ...Ln,
837
+ ...po,
811
838
  ...e
812
839
  };
813
840
  let n = [];
@@ -815,8 +842,8 @@ function kt(e) {
815
842
  n = n.filter((r) => r().status === "pending");
816
843
  }
817
844
  function s(r, a, l) {
818
- const c = Dn(t, r, a, (u, p) => {
819
- o(), l && l(u, p);
845
+ const c = ho(t, r, a, (d, w) => {
846
+ o(), l && l(d, w);
820
847
  });
821
848
  return n.push(c), c;
822
849
  }
@@ -833,56 +860,56 @@ function kt(e) {
833
860
  cleanup: o
834
861
  };
835
862
  }
836
- function Ye() {
863
+ function It() {
837
864
  }
838
- const we = /* @__PURE__ */ Object.create(null);
839
- function Fn(e) {
840
- if (!we[e]) {
841
- const t = Le(e);
865
+ const We = /* @__PURE__ */ Object.create(null);
866
+ function mo(e) {
867
+ if (!We[e]) {
868
+ const t = at(e);
842
869
  if (!t) return;
843
- we[e] = {
870
+ We[e] = {
844
871
  config: t,
845
- redundancy: kt(t)
872
+ redundancy: _t(t)
846
873
  };
847
874
  }
848
- return we[e];
875
+ return We[e];
849
876
  }
850
- function Mn(e, t, n) {
877
+ function go(e, t, n) {
851
878
  let o, s;
852
879
  if (typeof e == "string") {
853
- const i = Se(e);
880
+ const i = tt(e);
854
881
  if (!i)
855
- return n(void 0, 424), Ye;
882
+ return n(void 0, 424), It;
856
883
  s = i.send;
857
- const r = Fn(e);
884
+ const r = mo(e);
858
885
  r && (o = r.redundancy);
859
886
  } else {
860
- const i = Ce(e);
887
+ const i = it(e);
861
888
  if (i) {
862
- o = kt(i);
863
- const r = Se(e.resources ? e.resources[0] : "");
889
+ o = _t(i);
890
+ const r = tt(e.resources ? e.resources[0] : "");
864
891
  r && (s = r.send);
865
892
  }
866
893
  }
867
- return !o || !s ? (n(void 0, 424), Ye) : o.query(t, s, n)().abort;
894
+ return !o || !s ? (n(void 0, 424), It) : o.query(t, s, n)().abort;
868
895
  }
869
- function Ge() {
896
+ function St() {
870
897
  }
871
- function jn(e) {
898
+ function vo(e) {
872
899
  e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
873
- e.iconsLoaderFlag = !1, Pn(e);
900
+ e.iconsLoaderFlag = !1, ao(e);
874
901
  }));
875
902
  }
876
- function Bn(e) {
903
+ function yo(e) {
877
904
  const t = [], n = [];
878
905
  return e.forEach((o) => {
879
- (o.match(pt) ? t : n).push(o);
906
+ (o.match(zt) ? t : n).push(o);
880
907
  }), {
881
908
  valid: t,
882
909
  invalid: n
883
910
  };
884
911
  }
885
- function te(e, t, n) {
912
+ function Te(e, t, n) {
886
913
  function o() {
887
914
  const s = e.pendingIcons;
888
915
  t.forEach((i) => {
@@ -890,65 +917,65 @@ function te(e, t, n) {
890
917
  });
891
918
  }
892
919
  if (n && typeof n == "object") try {
893
- if (!vt(e, n).length) {
920
+ if (!Wt(e, n).length) {
894
921
  o();
895
922
  return;
896
923
  }
897
924
  } catch (s) {
898
925
  console.error(s);
899
926
  }
900
- o(), jn(e);
927
+ o(), vo(e);
901
928
  }
902
- function Xe(e, t) {
929
+ function Et(e, t) {
903
930
  e instanceof Promise ? e.then((n) => {
904
931
  t(n);
905
932
  }).catch(() => {
906
933
  t(null);
907
934
  }) : t(e);
908
935
  }
909
- function Rn(e, t) {
936
+ function wo(e, t) {
910
937
  e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(t).sort() : e.iconsToLoad = t, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
911
938
  e.iconsQueueFlag = !1;
912
939
  const { provider: n, prefix: o } = e, s = e.iconsToLoad;
913
940
  if (delete e.iconsToLoad, !s || !s.length) return;
914
941
  const i = e.loadIcon;
915
942
  if (e.loadIcons && (s.length > 1 || !i)) {
916
- Xe(e.loadIcons(s, o, n), (c) => {
917
- te(e, s, c);
943
+ Et(e.loadIcons(s, o, n), (c) => {
944
+ Te(e, s, c);
918
945
  });
919
946
  return;
920
947
  }
921
948
  if (i) {
922
949
  s.forEach((c) => {
923
- Xe(i(c, o, n), (u) => {
924
- te(e, [c], u ? {
950
+ Et(i(c, o, n), (d) => {
951
+ Te(e, [c], d ? {
925
952
  prefix: o,
926
- icons: { [c]: u }
953
+ icons: { [c]: d }
927
954
  } : null);
928
955
  });
929
956
  });
930
957
  return;
931
958
  }
932
- const { valid: r, invalid: a } = Bn(s);
933
- if (a.length && te(e, a, null), !r.length) return;
934
- const l = o.match(pt) ? Se(n) : null;
959
+ const { valid: r, invalid: a } = yo(s);
960
+ if (a.length && Te(e, a, null), !r.length) return;
961
+ const l = o.match(zt) ? tt(n) : null;
935
962
  if (!l) {
936
- te(e, r, null);
963
+ Te(e, r, null);
937
964
  return;
938
965
  }
939
966
  l.prepare(n, o, r).forEach((c) => {
940
- Mn(n, c, (u) => {
941
- te(e, c.icons, u);
967
+ go(n, c, (d) => {
968
+ Te(e, c.icons, d);
942
969
  });
943
970
  });
944
971
  }));
945
972
  }
946
- const $n = (e, t) => {
947
- const n = Cn(On(e, !0, yt()));
973
+ const xo = (e, t) => {
974
+ const n = uo(fo(e, !0, Gt()));
948
975
  if (!n.pending.length) {
949
976
  let a = !0;
950
977
  return t && setTimeout(() => {
951
- a && t(n.loaded, n.missing, n.pending, Ge);
978
+ a && t(n.loaded, n.missing, n.pending, St);
952
979
  }), () => {
953
980
  a = !1;
954
981
  };
@@ -958,28 +985,28 @@ const $n = (e, t) => {
958
985
  return n.pending.forEach((a) => {
959
986
  const { provider: l, prefix: c } = a;
960
987
  if (c === r && l === i) return;
961
- i = l, r = c, s.push(G(l, c));
962
- const u = o[l] || (o[l] = /* @__PURE__ */ Object.create(null));
963
- u[c] || (u[c] = []);
988
+ i = l, r = c, s.push(de(l, c));
989
+ const d = o[l] || (o[l] = /* @__PURE__ */ Object.create(null));
990
+ d[c] || (d[c] = []);
964
991
  }), n.pending.forEach((a) => {
965
- const { provider: l, prefix: c, name: u } = a, p = G(l, c), x = p.pendingIcons || (p.pendingIcons = /* @__PURE__ */ new Set());
966
- x.has(u) || (x.add(u), o[l][c].push(u));
992
+ const { provider: l, prefix: c, name: d } = a, w = de(l, c), x = w.pendingIcons || (w.pendingIcons = /* @__PURE__ */ new Set());
993
+ x.has(d) || (x.add(d), o[l][c].push(d));
967
994
  }), s.forEach((a) => {
968
995
  const l = o[a.provider][a.prefix];
969
- l.length && Rn(a, l);
970
- }), t ? An(t, n, s) : Ge;
996
+ l.length && wo(a, l);
997
+ }), t ? lo(t, n, s) : St;
971
998
  };
972
- function Nn(e, t) {
999
+ function bo(e, t) {
973
1000
  const n = { ...e };
974
1001
  for (const o in t) {
975
1002
  const s = t[o], i = typeof s;
976
- o in wt ? (s === null || s && (i === "string" || i === "number")) && (n[o] = s) : i === typeof n[o] && (n[o] = o === "rotate" ? s % 4 : s);
1003
+ o in Kt ? (s === null || s && (i === "string" || i === "number")) && (n[o] = s) : i === typeof n[o] && (n[o] = o === "rotate" ? s % 4 : s);
977
1004
  }
978
1005
  return n;
979
1006
  }
980
- const Hn = /[\s,]+/;
981
- function qn(e, t) {
982
- t.split(Hn).forEach((n) => {
1007
+ const To = /[\s,]+/;
1008
+ function ko(e, t) {
1009
+ t.split(To).forEach((n) => {
983
1010
  switch (n.trim()) {
984
1011
  case "horizontal":
985
1012
  e.hFlip = !0;
@@ -990,7 +1017,7 @@ function qn(e, t) {
990
1017
  }
991
1018
  });
992
1019
  }
993
- function Vn(e, t = 0) {
1020
+ function Io(e, t = 0) {
994
1021
  const n = e.replace(/^-?[0-9.]*/, "");
995
1022
  function o(s) {
996
1023
  for (; s < 0; ) s += 4;
@@ -1015,61 +1042,61 @@ function Vn(e, t = 0) {
1015
1042
  }
1016
1043
  return t;
1017
1044
  }
1018
- function zn(e, t) {
1045
+ function So(e, t) {
1019
1046
  let n = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
1020
1047
  for (const o in t) n += " " + o + '="' + t[o] + '"';
1021
1048
  return '<svg xmlns="http://www.w3.org/2000/svg"' + n + ">" + e + "</svg>";
1022
1049
  }
1023
- function Qn(e) {
1050
+ function Eo(e) {
1024
1051
  return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
1025
1052
  }
1026
- function Un(e) {
1027
- return "data:image/svg+xml," + Qn(e);
1053
+ function Po(e) {
1054
+ return "data:image/svg+xml," + Eo(e);
1028
1055
  }
1029
- function Yn(e) {
1030
- return 'url("' + Un(e) + '")';
1056
+ function Lo(e) {
1057
+ return 'url("' + Po(e) + '")';
1031
1058
  }
1032
- const We = {
1033
- ...xt,
1059
+ const Pt = {
1060
+ ...Jt,
1034
1061
  inline: !1
1035
- }, Gn = {
1062
+ }, Co = {
1036
1063
  xmlns: "http://www.w3.org/2000/svg",
1037
1064
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
1038
1065
  "aria-hidden": !0,
1039
1066
  role: "img"
1040
- }, Xn = {
1067
+ }, Ao = {
1041
1068
  display: "inline-block"
1042
- }, Pe = {
1069
+ }, nt = {
1043
1070
  backgroundColor: "currentColor"
1044
- }, Tt = {
1071
+ }, en = {
1045
1072
  backgroundColor: "transparent"
1046
- }, Ke = {
1073
+ }, Lt = {
1047
1074
  Image: "var(--svg)",
1048
1075
  Repeat: "no-repeat",
1049
1076
  Size: "100% 100%"
1050
- }, Je = {
1051
- webkitMask: Pe,
1052
- mask: Pe,
1053
- background: Tt
1077
+ }, Ct = {
1078
+ webkitMask: nt,
1079
+ mask: nt,
1080
+ background: en
1054
1081
  };
1055
- for (const e in Je) {
1056
- const t = Je[e];
1057
- for (const n in Ke)
1058
- t[e + n] = Ke[n];
1082
+ for (const e in Ct) {
1083
+ const t = Ct[e];
1084
+ for (const n in Lt)
1085
+ t[e + n] = Lt[n];
1059
1086
  }
1060
- const le = {};
1087
+ const Re = {};
1061
1088
  ["horizontal", "vertical"].forEach((e) => {
1062
1089
  const t = e.slice(0, 1) + "Flip";
1063
- le[e + "-flip"] = t, le[e.slice(0, 1) + "-flip"] = t, le[e + "Flip"] = t;
1090
+ Re[e + "-flip"] = t, Re[e.slice(0, 1) + "-flip"] = t, Re[e + "Flip"] = t;
1064
1091
  });
1065
- function Ze(e) {
1092
+ function At(e) {
1066
1093
  return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
1067
1094
  }
1068
- const _e = (e, t) => {
1069
- const n = Nn(We, t), o = { ...Gn }, s = t.mode || "svg", i = {}, r = t.style, a = typeof r == "object" && !(r instanceof Array) ? r : {};
1095
+ const Ot = (e, t) => {
1096
+ const n = bo(Pt, t), o = { ...Co }, s = t.mode || "svg", i = {}, r = t.style, a = typeof r == "object" && !(r instanceof Array) ? r : {};
1070
1097
  for (let I in t) {
1071
- const d = t[I];
1072
- if (d !== void 0)
1098
+ const h = t[I];
1099
+ if (h !== void 0)
1073
1100
  switch (I) {
1074
1101
  case "icon":
1075
1102
  case "style":
@@ -1081,50 +1108,50 @@ const _e = (e, t) => {
1081
1108
  case "inline":
1082
1109
  case "hFlip":
1083
1110
  case "vFlip":
1084
- n[I] = d === !0 || d === "true" || d === 1;
1111
+ n[I] = h === !0 || h === "true" || h === 1;
1085
1112
  break;
1086
1113
  case "flip":
1087
- typeof d == "string" && qn(n, d);
1114
+ typeof h == "string" && ko(n, h);
1088
1115
  break;
1089
1116
  case "color":
1090
- i.color = d;
1117
+ i.color = h;
1091
1118
  break;
1092
1119
  case "rotate":
1093
- typeof d == "string" ? n[I] = Vn(d) : typeof d == "number" && (n[I] = d);
1120
+ typeof h == "string" ? n[I] = Io(h) : typeof h == "number" && (n[I] = h);
1094
1121
  break;
1095
1122
  case "ariaHidden":
1096
1123
  case "aria-hidden":
1097
- d !== !0 && d !== "true" && delete o["aria-hidden"];
1124
+ h !== !0 && h !== "true" && delete o["aria-hidden"];
1098
1125
  break;
1099
1126
  default: {
1100
- const D = le[I];
1101
- D ? (d === !0 || d === "true" || d === 1) && (n[D] = !0) : We[I] === void 0 && (o[I] = d);
1127
+ const N = Re[I];
1128
+ N ? (h === !0 || h === "true" || h === 1) && (n[N] = !0) : Pt[I] === void 0 && (o[I] = h);
1102
1129
  }
1103
1130
  }
1104
1131
  }
1105
- const l = pn(e, n), c = l.attributes;
1132
+ const l = Wn(e, n), c = l.attributes;
1106
1133
  if (n.inline && (i.verticalAlign = "-0.125em"), s === "svg")
1107
1134
  return o.style = {
1108
1135
  ...i,
1109
1136
  ...a
1110
- }, Object.assign(o, c), o.innerHTML = gn(l.body), xe("svg", o);
1111
- const { body: u, width: p, height: x } = e, k = s === "mask" || (s === "bg" ? !1 : u.indexOf("currentColor") !== -1), T = zn(u, {
1137
+ }, Object.assign(o, c), o.innerHTML = Jn(l.body), Ge("svg", o);
1138
+ const { body: d, width: w, height: x } = e, S = s === "mask" || (s === "bg" ? !1 : d.indexOf("currentColor") !== -1), g = So(d, {
1112
1139
  ...c,
1113
- width: p + "",
1140
+ width: w + "",
1114
1141
  height: x + ""
1115
1142
  });
1116
1143
  return o.style = {
1117
1144
  ...i,
1118
- "--svg": Yn(T),
1119
- width: Ze(c.width),
1120
- height: Ze(c.height),
1121
- ...Xn,
1122
- ...k ? Pe : Tt,
1145
+ "--svg": Lo(g),
1146
+ width: At(c.width),
1147
+ height: At(c.height),
1148
+ ...Ao,
1149
+ ...S ? nt : en,
1123
1150
  ...a
1124
- }, xe("span", o);
1151
+ }, Ge("span", o);
1125
1152
  };
1126
- yt(!0);
1127
- vn("", Sn);
1153
+ Gt(!0);
1154
+ Zn("", ro);
1128
1155
  if (typeof document < "u" && typeof window < "u") {
1129
1156
  const e = window;
1130
1157
  if (e.IconifyPreload !== void 0) {
@@ -1134,7 +1161,7 @@ if (typeof document < "u" && typeof window < "u") {
1134
1161
  // Check if item is an object and not null/array
1135
1162
  (typeof o != "object" || o === null || o instanceof Array || // Check for 'icons' and 'prefix'
1136
1163
  typeof o.icons != "object" || typeof o.prefix != "string" || // Add icon set
1137
- !rn(o)) && console.error(n);
1164
+ !qn(o)) && console.error(n);
1138
1165
  } catch {
1139
1166
  console.error(n);
1140
1167
  }
@@ -1149,73 +1176,73 @@ if (typeof document < "u" && typeof window < "u") {
1149
1176
  const s = t[n];
1150
1177
  if (typeof s != "object" || !s || s.resources === void 0)
1151
1178
  continue;
1152
- yn(n, s) || console.error(o);
1179
+ _n(n, s) || console.error(o);
1153
1180
  } catch {
1154
1181
  console.error(o);
1155
1182
  }
1156
1183
  }
1157
1184
  }
1158
1185
  }
1159
- const Wn = {
1160
- ...ve,
1186
+ const Oo = {
1187
+ ...ze,
1161
1188
  body: ""
1162
- }, It = X((e, { emit: t }) => {
1163
- const n = O(null);
1189
+ }, tn = pe((e, { emit: t }) => {
1190
+ const n = R(null);
1164
1191
  function o() {
1165
- var c, u;
1166
- n.value && ((u = (c = n.value).abort) == null || u.call(c), n.value = null);
1192
+ var c, d;
1193
+ n.value && ((d = (c = n.value).abort) == null || d.call(c), n.value = null);
1167
1194
  }
1168
- const s = O(!!e.ssr), i = O(""), r = At(null);
1195
+ const s = R(!!e.ssr), i = R(""), r = un(null);
1169
1196
  function a() {
1170
1197
  const c = e.icon;
1171
1198
  if (typeof c == "object" && c !== null && typeof c.body == "string")
1172
1199
  return i.value = "", {
1173
1200
  data: c
1174
1201
  };
1175
- let u;
1176
- if (typeof c != "string" || (u = ge(c, !1, !0)) === null)
1202
+ let d;
1203
+ if (typeof c != "string" || (d = Ye(c, !1, !0)) === null)
1177
1204
  return null;
1178
- let p = sn(u);
1179
- if (!p) {
1180
- const T = n.value;
1181
- return (!T || T.name !== c) && (p === null ? n.value = {
1205
+ let w = Hn(d);
1206
+ if (!w) {
1207
+ const g = n.value;
1208
+ return (!g || g.name !== c) && (w === null ? n.value = {
1182
1209
  name: c
1183
1210
  } : n.value = {
1184
1211
  name: c,
1185
- abort: $n([u], l)
1212
+ abort: xo([d], l)
1186
1213
  }), null;
1187
1214
  }
1188
- o(), i.value !== c && (i.value = c, Ee(() => {
1215
+ o(), i.value !== c && (i.value = c, ke(() => {
1189
1216
  t("load", c);
1190
1217
  }));
1191
1218
  const x = e.customise;
1192
1219
  if (x) {
1193
- p = Object.assign({}, p);
1194
- const T = x(p.body, u.name, u.prefix, u.provider);
1195
- typeof T == "string" && (p.body = T);
1220
+ w = Object.assign({}, w);
1221
+ const g = x(w.body, d.name, d.prefix, d.provider);
1222
+ typeof g == "string" && (w.body = g);
1196
1223
  }
1197
- const k = ["iconify"];
1198
- return u.prefix !== "" && k.push("iconify--" + u.prefix), u.provider !== "" && k.push("iconify--" + u.provider), { data: p, classes: k };
1224
+ const S = ["iconify"];
1225
+ return d.prefix !== "" && S.push("iconify--" + d.prefix), d.provider !== "" && S.push("iconify--" + d.provider), { data: w, classes: S };
1199
1226
  }
1200
1227
  function l() {
1201
- var u;
1228
+ var d;
1202
1229
  const c = a();
1203
- c ? c.data !== ((u = r.value) == null ? void 0 : u.data) && (r.value = c) : r.value = null;
1230
+ c ? c.data !== ((d = r.value) == null ? void 0 : d.data) && (r.value = c) : r.value = null;
1204
1231
  }
1205
- return s.value ? l() : he(() => {
1232
+ return s.value ? l() : qe(() => {
1206
1233
  s.value = !0, l();
1207
- }), N(() => e.icon, l), me(o), () => {
1234
+ }), G(() => e.icon, l), Ve(o), () => {
1208
1235
  const c = r.value;
1209
1236
  if (!c)
1210
- return _e(Wn, e);
1211
- let u = e;
1212
- return c.classes && (u = {
1237
+ return Ot(Oo, e);
1238
+ let d = e;
1239
+ return c.classes && (d = {
1213
1240
  ...e,
1214
1241
  class: c.classes.join(" ")
1215
- }), _e({
1216
- ...ve,
1242
+ }), Ot({
1243
+ ...ze,
1217
1244
  ...c.data
1218
- }, u);
1245
+ }, d);
1219
1246
  };
1220
1247
  }, {
1221
1248
  props: [
@@ -1244,38 +1271,38 @@ const Wn = {
1244
1271
  ],
1245
1272
  emits: ["load"]
1246
1273
  });
1247
- let et = !1;
1248
- const Y = {
1274
+ let Mt = !1;
1275
+ const ue = {
1249
1276
  width: 24,
1250
1277
  height: 24
1251
- }, St = () => {
1252
- et || (et = !0, z("lucide:circle-check", {
1253
- ...Y,
1278
+ }, nn = () => {
1279
+ Mt || (Mt = !0, ie("lucide:circle-check", {
1280
+ ...ue,
1254
1281
  body: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m9 12l2 2l4-4"/></g>'
1255
- }), z("lucide:circle-x", {
1256
- ...Y,
1282
+ }), ie("lucide:circle-x", {
1283
+ ...ue,
1257
1284
  body: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="m15 9l-6 6m0-6l6 6"/></g>'
1258
- }), z("lucide:triangle-alert", {
1259
- ...Y,
1285
+ }), ie("lucide:triangle-alert", {
1286
+ ...ue,
1260
1287
  body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01"/>'
1261
- }), z("lucide:info", {
1262
- ...Y,
1288
+ }), ie("lucide:info", {
1289
+ ...ue,
1263
1290
  body: '<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4m0-4h.01"/></g>'
1264
- }), z("lucide:bell", {
1265
- ...Y,
1291
+ }), ie("lucide:bell", {
1292
+ ...ue,
1266
1293
  body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.268 21a2 2 0 0 0 3.464 0m-10.47-5.674A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326"/>'
1267
- }), z("lucide:loader-circle", {
1268
- ...Y,
1294
+ }), ie("lucide:loader-circle", {
1295
+ ...ue,
1269
1296
  body: '<path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 1 1-6.219-8.56"/>'
1270
1297
  }));
1271
- }, Kn = { class: "soft-toast-icon" }, tt = /* @__PURE__ */ X({
1298
+ }, Mo = { class: "soft-toast-icon" }, Dt = /* @__PURE__ */ pe({
1272
1299
  __name: "ToastIcon",
1273
1300
  props: {
1274
1301
  type: {},
1275
1302
  customIcon: {}
1276
1303
  },
1277
1304
  setup(e) {
1278
- St();
1305
+ nn();
1279
1306
  const t = e, n = {
1280
1307
  success: "lucide:circle-check",
1281
1308
  error: "lucide:circle-x",
@@ -1283,8 +1310,8 @@ const Y = {
1283
1310
  info: "lucide:info",
1284
1311
  default: "lucide:bell"
1285
1312
  }, o = () => t.customIcon ? t.customIcon : n[t.type] || n.default;
1286
- return (s, i) => (S(), L("span", Kn, [
1287
- Ae(at(It), {
1313
+ return (s, i) => (P(), $("span", Mo, [
1314
+ st(Nt(tn), {
1288
1315
  class: "soft-toast-icon-svg",
1289
1316
  icon: o(),
1290
1317
  width: 18,
@@ -1292,7 +1319,7 @@ const Y = {
1292
1319
  }, null, 8, ["icon"])
1293
1320
  ]));
1294
1321
  }
1295
- }), de = {
1322
+ }), He = {
1296
1323
  smooth: {
1297
1324
  ease: "power3.out",
1298
1325
  elasticEase: "elastic.out(1, 0.5)",
@@ -1314,32 +1341,32 @@ const Y = {
1314
1341
  duration: 0.5
1315
1342
  }
1316
1343
  };
1317
- A.defaults({ overwrite: "auto" });
1318
- const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1344
+ F.defaults({ overwrite: "auto" });
1345
+ const Do = typeof window < "u" && window.matchMedia("(pointer: coarse)").matches, fe = (e) => Do ? e * 0.65 : e, Fo = 0.22, ot = "power2.out", Bo = (e) => {
1319
1346
  const t = 0.8 + e * 0.8, n = 0.55 - e * 0.15;
1320
1347
  return `elastic.out(${t.toFixed(2)}, ${n.toFixed(2)})`;
1321
- }, _n = (e, t, n) => Math.max(t, Math.min(n, e)), nt = (e, t) => {
1322
- const n = Number(A.getProperty(e, "y")) || 0, o = t.y - n, s = Math.abs(o);
1323
- return s < 0.5 ? A.to(e, {
1348
+ }, jo = (e, t, n) => Math.max(t, Math.min(n, e)), Ft = (e, t) => {
1349
+ const n = Number(F.getProperty(e, "y")) || 0, o = t.y - n, s = Math.abs(o);
1350
+ return s < 0.5 ? F.to(e, {
1324
1351
  y: t.y,
1325
1352
  scale: t.scale,
1326
1353
  opacity: t.opacity,
1327
1354
  force3D: !0,
1328
1355
  overwrite: !0,
1329
- duration: Jn,
1330
- ease: pe
1331
- }) : A.to(e, {
1356
+ duration: Fo,
1357
+ ease: ot
1358
+ }) : F.to(e, {
1332
1359
  y: t.y,
1333
1360
  scale: t.scale,
1334
1361
  opacity: t.opacity,
1335
1362
  force3D: !0,
1336
1363
  overwrite: !0,
1337
- duration: _n(0.34 + s * 3e-3, 0.36, 0.46),
1364
+ duration: fe(jo(0.34 + s * 3e-3, 0.36, 0.46)),
1338
1365
  ease: "sine.out"
1339
1366
  });
1340
- }, eo = (e, t = {}) => {
1341
- const { direction: n = "up", preset: o = "smooth" } = t, s = de[o] || de.smooth, i = n === "down" ? -14 : 14, r = Math.min(s.duration, 0.46), a = o === "bouncy" ? "back.out(1.35)" : pe, l = A.timeline(), c = e.querySelector(".soft-toast-extra");
1342
- return c && A.set(c, { height: 0, opacity: 0 }), l.fromTo(
1367
+ }, Ro = (e, t = {}) => {
1368
+ const { direction: n = "up", preset: o = "smooth" } = t, s = He[o] || He.smooth, i = n === "down" ? -14 : 14, r = fe(Math.min(s.duration, 0.46)), a = o === "bouncy" ? "back.out(1.35)" : ot, l = F.timeline(), c = e.querySelector(".soft-toast-extra");
1369
+ return c && F.set(c, { height: 0, opacity: 0 }), l.fromTo(
1343
1370
  e,
1344
1371
  { y: i, opacity: 0, scale: 0.94 },
1345
1372
  {
@@ -1353,33 +1380,36 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1353
1380
  ), c && l.to(c, {
1354
1381
  height: "auto",
1355
1382
  opacity: 1,
1356
- duration: 0.36,
1383
+ duration: fe(0.36),
1357
1384
  force3D: !0,
1358
- ease: pe,
1385
+ ease: ot,
1359
1386
  clearProps: "overflow"
1360
1387
  }, "-=0.32"), l;
1361
- }, to = (e) => A.to(e, {
1362
- scale: 0.8,
1363
- opacity: 0,
1364
- force3D: !0,
1365
- overwrite: "auto",
1366
- duration: 0.25,
1367
- ease: "power2.out"
1368
- }), no = (e, t) => A.to(e, {
1388
+ }, $o = (e) => {
1389
+ const t = F.timeline();
1390
+ return t.to(e, {
1391
+ scale: 0.85,
1392
+ opacity: 0,
1393
+ force3D: !0,
1394
+ overwrite: "auto",
1395
+ duration: 0.2,
1396
+ ease: "power2.out"
1397
+ }), t.to(e, {
1398
+ height: 0,
1399
+ paddingTop: 0,
1400
+ paddingBottom: 0,
1401
+ marginBottom: 0,
1402
+ duration: 0.14,
1403
+ ease: "power2.in"
1404
+ }, "-=0.05"), t;
1405
+ }, No = (e, t) => F.to(e, {
1369
1406
  x: t,
1370
1407
  opacity: 0,
1371
1408
  force3D: !0,
1372
1409
  overwrite: "auto",
1373
1410
  duration: 0.28,
1374
1411
  ease: "power3.out"
1375
- }), ot = (e) => A.to(e, {
1376
- x: 0,
1377
- opacity: 1,
1378
- force3D: !0,
1379
- overwrite: "auto",
1380
- duration: 0.55,
1381
- ease: "elastic.out(1, 0.55)"
1382
- }), oo = (e, t) => {
1412
+ }), Ho = (e, t) => {
1383
1413
  const {
1384
1414
  index: n,
1385
1415
  expanded: o,
@@ -1389,47 +1419,62 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1389
1419
  direction: a = "up",
1390
1420
  expandedOffset: l = 0,
1391
1421
  liftPx: c = 14,
1392
- scaleStep: u = 0.055,
1393
- opacityStep: p = 0.2,
1422
+ scaleStep: d = 0.055,
1423
+ opacityStep: w = 0.2,
1394
1424
  maxVisible: x = 3,
1395
- reposition: k = !1
1396
- } = t, T = de[s] || de.smooth, I = a === "up" ? -1 : 1;
1425
+ reposition: S = !1,
1426
+ resetSwipe: g = !1
1427
+ } = t, I = He[s] || He.smooth, h = a === "up" ? -1 : 1;
1397
1428
  if (o) {
1398
- const v = {
1399
- y: l * I,
1429
+ const M = {
1430
+ x: g ? 0 : void 0,
1431
+ y: l * h,
1400
1432
  scale: 1,
1401
- opacity: 1
1433
+ opacity: 1,
1434
+ rotate: g ? 0 : void 0
1402
1435
  };
1403
- return k && r ? nt(e, v) : A.to(e, {
1404
- ...v,
1436
+ return S && r && !g ? Ft(e, M) : F.to(e, {
1437
+ ...M,
1405
1438
  force3D: !0,
1406
- overwrite: "auto",
1407
- duration: 0.36,
1408
- ease: pe
1439
+ overwrite: !0,
1440
+ duration: fe(g ? 0.34 : 0.12),
1441
+ ease: g ? "elastic.out(1, 0.55)" : "power2.out"
1409
1442
  });
1410
1443
  }
1411
- const d = n >= x, D = Math.min(n, x), F = D * c * I, f = 1 - D * u, g = d ? 0 : Math.max(0, 1 - D * p);
1412
- if (k && r)
1413
- return nt(e, {
1414
- y: F,
1415
- scale: f,
1416
- opacity: g
1444
+ const N = n >= x, O = Math.min(n, x), b = O * c * h, T = 1 - O * d, H = N ? 0 : Math.max(0, 1 - O * w);
1445
+ if (S && r)
1446
+ return g ? F.to(e, {
1447
+ x: 0,
1448
+ y: b,
1449
+ scale: T,
1450
+ opacity: H,
1451
+ rotate: 0,
1452
+ force3D: !0,
1453
+ overwrite: !0,
1454
+ duration: fe(0.38),
1455
+ ease: "elastic.out(1, 0.55)"
1456
+ }) : Ft(e, {
1457
+ y: b,
1458
+ scale: T,
1459
+ opacity: H
1417
1460
  });
1418
- const C = r ? Zn(i) : T.ease;
1419
- return A.to(e, {
1420
- y: F,
1421
- scale: f,
1422
- opacity: g,
1461
+ const v = r ? Bo(i) : I.ease;
1462
+ return F.to(e, {
1463
+ x: g ? 0 : void 0,
1464
+ y: b,
1465
+ scale: T,
1466
+ opacity: H,
1467
+ rotate: g ? 0 : void 0,
1423
1468
  force3D: !0,
1424
- overwrite: "auto",
1425
- duration: T.duration * 0.85,
1426
- ease: C
1469
+ overwrite: g ? !0 : "auto",
1470
+ duration: fe(g ? 0.38 : I.duration * 0.85),
1471
+ ease: g ? "elastic.out(1, 0.55)" : v
1427
1472
  });
1428
- }, so = (e, t, n) => A.fromTo(
1473
+ }, qo = (e, t, n) => F.fromTo(
1429
1474
  e,
1430
1475
  { scaleX: 1 },
1431
1476
  { scaleX: 0, duration: t / 1e3, ease: "linear", onComplete: n }
1432
- ), st = (e) => e.pause(), io = (e) => e.play(), ro = (e) => A.killTweensOf(e), ao = { class: "soft-toast-progress" }, co = /* @__PURE__ */ X({
1477
+ ), Bt = (e) => e.pause(), Vo = (e) => e.play(), Yo = (e) => F.killTweensOf(e), zo = { class: "soft-toast-progress" }, Qo = /* @__PURE__ */ pe({
1433
1478
  __name: "ToastProgress",
1434
1479
  props: {
1435
1480
  remainingTime: {},
@@ -1437,19 +1482,19 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1437
1482
  isPaused: { type: Boolean }
1438
1483
  },
1439
1484
  setup(e) {
1440
- const t = e, n = O(null), o = O(null);
1441
- return he(() => {
1442
- n.value && (o.value = so(
1485
+ const t = e, n = R(null), o = R(null);
1486
+ return qe(() => {
1487
+ n.value && (o.value = qo(
1443
1488
  n.value,
1444
1489
  t.remainingTime
1445
- ), t.isPaused && st(o.value));
1446
- }), N(() => t.isPaused, (s) => {
1447
- o.value && (s ? st(o.value) : io(o.value));
1448
- }), me(() => {
1490
+ ), t.isPaused && Bt(o.value));
1491
+ }), G(() => t.isPaused, (s) => {
1492
+ o.value && (s ? Bt(o.value) : Vo(o.value));
1493
+ }), Ve(() => {
1449
1494
  var s;
1450
1495
  (s = o.value) == null || s.kill();
1451
- }), (s, i) => (S(), L("div", ao, [
1452
- j(
1496
+ }), (s, i) => (P(), $("div", zo, [
1497
+ Q(
1453
1498
  "div",
1454
1499
  {
1455
1500
  ref_key: "progressRef",
@@ -1462,32 +1507,32 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1462
1507
  )
1463
1508
  ]));
1464
1509
  }
1465
- }), lo = ["data-type", "data-st-index", "data-leaving"], uo = ["data-position"], fo = { class: "soft-toast-content" }, po = {
1510
+ }), Uo = ["data-type", "data-st-index", "data-toast-id", "data-leaving", "data-interactive"], Xo = ["data-position"], Wo = { class: "soft-toast-content" }, Go = {
1466
1511
  key: 0,
1467
1512
  class: "soft-toast-icon"
1468
- }, ho = {
1513
+ }, Ko = {
1469
1514
  key: 2,
1470
1515
  class: "soft-toast-icon"
1471
- }, mo = { class: "soft-toast-body" }, go = { class: "soft-toast-header-row" }, vo = {
1516
+ }, Jo = { class: "soft-toast-body" }, Zo = { class: "soft-toast-header-row" }, _o = {
1472
1517
  key: 0,
1473
1518
  class: "soft-toast-extra",
1474
1519
  style: { overflow: "hidden" }
1475
- }, yo = {
1520
+ }, es = {
1476
1521
  key: 0,
1477
1522
  class: "soft-toast-description"
1478
- }, wo = {
1523
+ }, ts = {
1479
1524
  key: 0,
1480
1525
  class: "soft-toast-action"
1481
- }, xo = ["onClick"], bo = {
1526
+ }, ns = ["onClick"], os = {
1482
1527
  key: 1,
1483
1528
  class: "soft-toast-action"
1484
- }, ko = {
1529
+ }, ss = {
1485
1530
  class: "soft-toast-action-button soft-toast-action-success",
1486
1531
  style: { opacity: "0.75", cursor: "default" }
1487
- }, To = {
1532
+ }, is = {
1488
1533
  key: 1,
1489
1534
  class: "soft-toast-timestamp"
1490
- }, Io = /* @__PURE__ */ X({
1535
+ }, jt = /* @__PURE__ */ pe({
1491
1536
  __name: "ToastItem",
1492
1537
  props: {
1493
1538
  toast: {},
@@ -1498,111 +1543,175 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1498
1543
  expanded: { type: Boolean, default: !1 },
1499
1544
  expandedOffset: { default: 0 },
1500
1545
  stackDirection: { default: "up" },
1501
- reposition: { type: Boolean, default: !1 }
1546
+ reposition: { type: Boolean, default: !1 },
1547
+ interactive: { type: Boolean, default: !0 }
1502
1548
  },
1503
- setup(e) {
1504
- St();
1505
- const t = e, n = O(null), o = O(!1), s = O("");
1506
- let i = !1;
1507
- const r = $(() => new Date(t.toast.createdAt).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })), a = () => {
1508
- if (i || !n.value) return;
1509
- i = !0, t.toast.isLeaving = !0, to(n.value).then(() => m.dismiss(t.toast.id));
1510
- }, l = async (f) => {
1511
- if (f)
1549
+ setup(e, { expose: t }) {
1550
+ nn();
1551
+ const n = e, o = R(null), s = R(!1), i = R("");
1552
+ let r = !1;
1553
+ const a = z(() => new Date(n.toast.createdAt).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })), l = z(() => n.swipeToDismiss !== !1), c = () => {
1554
+ var B, q;
1555
+ if (r || !o.value) return;
1556
+ const p = n.toast.id, L = n.toast.isLeaving;
1557
+ r = !0, n.toast.isLeaving = !0, L || (q = (B = n.toast).onDismiss) == null || q.call(B, p), v !== null && window.clearTimeout(v), v = window.setTimeout(() => {
1558
+ y.remove(p), v = null;
1559
+ }, 320), $o(o.value);
1560
+ }, d = async (p) => {
1561
+ if (p)
1512
1562
  try {
1513
- await f.onClick(), f.successLabel && (o.value = !0, s.value = f.successLabel, setTimeout(a, 1200));
1563
+ await p.onClick(), p.successLabel && (s.value = !0, i.value = p.successLabel, setTimeout(c, 1200));
1514
1564
  } catch {
1515
1565
  }
1516
- }, c = $(() => t.toast.action ? Array.isArray(t.toast.action) ? t.toast.action : [t.toast.action] : []), u = (f = !1) => {
1517
- !n.value || t.toast.isLeaving || oo(n.value, {
1518
- index: t.index,
1519
- expanded: t.expanded,
1520
- preset: t.toast.preset,
1521
- bounce: t.toast.bounce,
1522
- spring: t.toast.spring,
1523
- direction: t.stackDirection,
1524
- expandedOffset: t.expandedOffset,
1525
- reposition: f
1566
+ }, w = z(() => n.toast.action ? Array.isArray(n.toast.action) ? n.toast.action : [n.toast.action] : []), x = (p = !1, L, B = !1) => {
1567
+ !o.value || n.toast.isLeaving || h || Ho(o.value, {
1568
+ index: n.index,
1569
+ expanded: n.expanded,
1570
+ preset: n.toast.preset,
1571
+ bounce: n.toast.bounce,
1572
+ spring: n.toast.spring,
1573
+ direction: n.stackDirection,
1574
+ expandedOffset: L ?? n.expandedOffset,
1575
+ reposition: p,
1576
+ resetSwipe: B
1526
1577
  });
1527
1578
  };
1528
- let p = 0, x = 0, k = !1, T = 0;
1529
- const I = (f) => {
1530
- !t.swipeToDismiss || i || f.pointerType === "mouse" && f.button !== 0 || f.target.closest("button, a") || (p = f.clientX, x = Date.now(), k = !0, T = 0, f.currentTarget.setPointerCapture(f.pointerId), m.pause(t.toast.id));
1531
- }, d = (f) => {
1532
- if (!k || !n.value) return;
1533
- const g = f.clientX - p;
1534
- T = g;
1535
- const C = n.value.offsetWidth, v = Math.max(0, 1 - Math.abs(g) / (C * 0.7)), P = g / C * 6;
1536
- A.set(n.value, { x: g, opacity: v, rotate: P, overwrite: "auto" });
1537
- }, D = (f) => {
1538
- if (!k || !n.value) return;
1539
- k = !1;
1540
- const g = T, C = Math.max(1, Date.now() - x), v = Math.abs(g) / C * 1e3, P = n.value.offsetWidth, h = P * 0.35;
1541
- if (Math.abs(g) >= h || v >= 500) {
1542
- i = !0, t.toast.isLeaving = !0;
1543
- const w = g > 0 ? P * 1.6 : -P * 1.6;
1544
- no(n.value, w).then(() => {
1545
- m.remove(t.toast.id);
1546
- });
1579
+ let S = 0, g = 0, I = 0, h = !1, N = !1, O = 0, b = null, T = null, H = null, v = null;
1580
+ const M = () => {
1581
+ H !== null && (window.clearTimeout(H), H = null);
1582
+ }, W = () => {
1583
+ if (!(b === null || !T))
1584
+ try {
1585
+ T.hasPointerCapture(b) && T.releasePointerCapture(b);
1586
+ } catch {
1587
+ }
1588
+ }, J = () => {
1589
+ window.removeEventListener("pointermove", Le), window.removeEventListener("pointerup", me), window.removeEventListener("pointercancel", _);
1590
+ }, E = () => {
1591
+ h = !1, N = !1, M(), W(), J(), b = null, T = null;
1592
+ }, Z = () => {
1593
+ o.value && (n.expanded || y.resume(n.toast.id), x(!0, void 0, !0));
1594
+ }, Pe = () => {
1595
+ if (!o.value) return;
1596
+ const p = O, L = Math.max(1, Date.now() - I), B = Math.abs(p) / L * 1e3, q = o.value.offsetWidth, ne = q * 0.35;
1597
+ if (E(), Math.abs(p) >= ne || B >= 500) {
1598
+ r = !0;
1599
+ const oe = n.toast.id;
1600
+ n.toast.isLeaving = !0, v !== null && window.clearTimeout(v), v = window.setTimeout(() => {
1601
+ y.remove(oe), v = null;
1602
+ }, 320);
1603
+ const ge = p > 0 ? q * 1.6 : -q * 1.6;
1604
+ No(o.value, ge);
1547
1605
  } else
1548
- A.set(n.value, { rotate: 0 }), ot(n.value), m.resume(t.toast.id);
1549
- }, F = () => {
1550
- !k || !n.value || (k = !1, A.set(n.value, { rotate: 0 }), ot(n.value), m.resume(t.toast.id));
1606
+ Z();
1607
+ }, he = (p) => {
1608
+ if (h && b !== null)
1609
+ try {
1610
+ (T ?? p.currentTarget).hasPointerCapture(b) || (E(), Z());
1611
+ } catch {
1612
+ E();
1613
+ }
1614
+ if (!(!l.value || r || h || n.toast.isLeaving || p.pointerType === "mouse" && p.button !== 0 || p.target.closest("button, a"))) {
1615
+ S = p.clientX, g = p.clientY, I = Date.now(), h = !0, N = !1, O = 0, b = p.pointerId, T = p.currentTarget, F.killTweensOf(o.value);
1616
+ try {
1617
+ T.setPointerCapture(p.pointerId);
1618
+ } catch {
1619
+ }
1620
+ window.addEventListener("pointermove", Le), window.addEventListener("pointerup", me), window.addEventListener("pointercancel", _), y.pause(n.toast.id);
1621
+ }
1622
+ }, Le = (p) => {
1623
+ if (!h || !o.value || b !== null && p.pointerId !== b) return;
1624
+ M();
1625
+ const L = p.clientX - S, B = p.clientY - g;
1626
+ if (!N) {
1627
+ if (Math.abs(B) > Math.abs(L) + 4) {
1628
+ E(), Z();
1629
+ return;
1630
+ }
1631
+ if (Math.abs(L) > Math.abs(B) + 4)
1632
+ N = !0;
1633
+ else
1634
+ return;
1635
+ }
1636
+ p.preventDefault(), O = L;
1637
+ const q = o.value.offsetWidth, ne = Math.max(0, 1 - Math.abs(L) / (q * 0.7)), oe = L / q * 6;
1638
+ F.set(o.value, { x: L, opacity: ne, rotate: oe, overwrite: "auto" });
1639
+ }, me = (p) => {
1640
+ !h || !o.value || b !== null && p.pointerId !== b || Pe();
1641
+ }, _ = (p) => {
1642
+ !h || !o.value || p && b !== null && p.pointerId !== b || (E(), Z());
1643
+ }, te = (p) => {
1644
+ !h || !o.value || b !== null && p.pointerId !== b || (T = null, M(), H = window.setTimeout(() => {
1645
+ h && (E(), Z());
1646
+ }, 150));
1647
+ }, ce = () => {
1648
+ document.hidden && h && (E(), Z());
1551
1649
  };
1552
- return he(() => {
1553
- if (!n.value) return;
1554
- const f = t.toast.position.includes("bottom");
1555
- eo(n.value, {
1556
- preset: t.toast.preset,
1557
- bounce: t.toast.bounce,
1558
- spring: t.toast.spring,
1559
- direction: f ? "up" : "down"
1650
+ return qe(() => {
1651
+ if (document.addEventListener("visibilitychange", ce), !o.value) return;
1652
+ const p = n.toast.position.includes("bottom");
1653
+ Ro(o.value, {
1654
+ preset: n.toast.preset,
1655
+ bounce: n.toast.bounce,
1656
+ spring: n.toast.spring,
1657
+ direction: p ? "up" : "down"
1560
1658
  }).eventCallback("onComplete", () => {
1561
- Ee(u);
1659
+ ke(x);
1562
1660
  });
1563
- }), N(() => t.index, (f, g) => {
1564
- t.expanded || u(f < g || t.reposition);
1565
- }), N(() => t.expandedOffset, (f, g) => {
1566
- t.expanded && u(f !== g);
1567
- }), N(() => t.expanded, () => {
1568
- u(!0);
1569
- }), N(
1570
- () => t.expanded,
1571
- (f) => {
1572
- f ? m.pause(t.toast.id) : m.resume(t.toast.id);
1661
+ }), G(
1662
+ () => n.index,
1663
+ (p, L) => {
1664
+ n.expanded || x(p < L || n.reposition);
1573
1665
  }
1574
- ), N(
1575
- () => t.toast.isLeaving,
1576
- (f) => {
1577
- f && a();
1666
+ ), G(
1667
+ () => n.expandedOffset,
1668
+ (p, L) => {
1669
+ n.expanded && x(p !== L);
1578
1670
  }
1579
- ), me(() => {
1580
- n.value && ro(n.value);
1581
- }), (f, g) => (S(), L("div", {
1671
+ ), G(
1672
+ () => n.expanded,
1673
+ (p) => {
1674
+ p || x(!0);
1675
+ }
1676
+ ), G(
1677
+ () => n.expanded,
1678
+ (p) => {
1679
+ p ? y.pause(n.toast.id) : !h && !n.toast.isLeaving && y.resume(n.toast.id);
1680
+ }
1681
+ ), G(
1682
+ () => n.toast.isLeaving,
1683
+ (p) => {
1684
+ p && (h && E(), c());
1685
+ }
1686
+ ), t({ applyStackPosition: x }), Ve(() => {
1687
+ document.removeEventListener("visibilitychange", ce), h && (E(), y.resume(n.toast.id)), v !== null && (window.clearTimeout(v), v = null), o.value && Yo(o.value);
1688
+ }), (p, L) => (P(), $("div", {
1582
1689
  ref_key: "toastRef",
1583
- ref: n,
1584
- class: re(["soft-toast-item", { "soft-toast-item--swipeable": e.swipeToDismiss }]),
1690
+ ref: o,
1691
+ class: Fe(["soft-toast-item", { "soft-toast-item--swipeable": l.value }]),
1585
1692
  "data-type": e.toast.type,
1586
1693
  "data-st-index": e.index,
1694
+ "data-toast-id": e.toast.id,
1587
1695
  "data-leaving": e.toast.isLeaving,
1588
- style: ct({ zIndex: 1e3 - e.index }),
1589
- onPointerdown: I,
1590
- onPointermove: d,
1591
- onPointerup: D,
1592
- onPointercancel: F
1696
+ "data-interactive": e.interactive,
1697
+ style: De({ zIndex: 1e3 - e.index }),
1698
+ onPointerdown: he,
1699
+ onPointercancel: _,
1700
+ onLostpointercapture: te
1593
1701
  }, [
1594
- Q(f.$slots, "close-button", {
1702
+ re(p.$slots, "close-button", {
1595
1703
  toast: e.toast,
1596
- dismiss: a
1704
+ dismiss: c,
1705
+ closeButton: e.closeButton
1597
1706
  }, () => [
1598
- e.closeButton ? (S(), L("button", {
1707
+ e.closeButton ? (P(), $("button", {
1599
1708
  key: 0,
1600
1709
  class: "soft-toast-close",
1601
1710
  "data-position": typeof e.closeButton == "string" ? e.closeButton : "top-right",
1602
- onClick: Re(a, ["stop"]),
1711
+ onClick: $e(c, ["stop"]),
1603
1712
  "aria-label": "Close"
1604
- }, [...g[0] || (g[0] = [
1605
- j(
1713
+ }, [...L[0] || (L[0] = [
1714
+ Q(
1606
1715
  "svg",
1607
1716
  {
1608
1717
  width: "10",
@@ -1612,14 +1721,14 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1612
1721
  class: "st-close-icon"
1613
1722
  },
1614
1723
  [
1615
- j("path", {
1724
+ Q("path", {
1616
1725
  class: "st-close-line-1",
1617
1726
  d: "M1 1L9 9",
1618
1727
  stroke: "currentColor",
1619
1728
  "stroke-width": "1.6",
1620
1729
  "stroke-linecap": "round"
1621
1730
  }),
1622
- j("path", {
1731
+ Q("path", {
1623
1732
  class: "st-close-line-2",
1624
1733
  d: "M9 1L1 9",
1625
1734
  stroke: "currentColor",
@@ -1630,51 +1739,62 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1630
1739
  -1
1631
1740
  /* CACHED */
1632
1741
  )
1633
- ])], 8, uo)) : H("v-if", !0)
1742
+ ])], 8, Xo)) : ee("v-if", !0)
1634
1743
  ]),
1635
- j("div", fo, [
1636
- Q(f.$slots, "icon", { toast: e.toast }, () => [
1637
- e.toast.type === "promise" ? (S(), L("div", po, [
1638
- Ae(at(It), {
1744
+ Q("div", Wo, [
1745
+ re(p.$slots, "icon", {
1746
+ toast: e.toast,
1747
+ closeButton: e.closeButton
1748
+ }, () => [
1749
+ e.toast.type === "promise" ? (P(), $("div", Go, [
1750
+ st(Nt(tn), {
1639
1751
  class: "soft-toast-icon-svg",
1640
1752
  icon: "lucide:loader-circle",
1641
1753
  width: 18,
1642
1754
  height: 18
1643
1755
  })
1644
- ])) : e.toast.icon && typeof e.toast.icon == "string" ? (S(), q(tt, {
1756
+ ])) : e.toast.icon && typeof e.toast.icon == "string" ? (P(), K(Dt, {
1645
1757
  key: 1,
1646
1758
  type: e.toast.type,
1647
1759
  customIcon: e.toast.icon
1648
- }, null, 8, ["type", "customIcon"])) : e.toast.icon ? (S(), L("div", ho, [
1649
- (S(), q($e(e.toast.icon)))
1650
- ])) : e.toast.type !== "default" ? (S(), q(tt, {
1760
+ }, null, 8, ["type", "customIcon"])) : e.toast.icon ? (P(), $("div", Ko, [
1761
+ (P(), K(gt(e.toast.icon)))
1762
+ ])) : e.toast.type !== "default" ? (P(), K(Dt, {
1651
1763
  key: 3,
1652
1764
  type: e.toast.type
1653
- }, null, 8, ["type"])) : H("v-if", !0)
1765
+ }, null, 8, ["type"])) : ee("v-if", !0)
1654
1766
  ]),
1655
- j("div", mo, [
1656
- j("div", go, [
1657
- Q(f.$slots, "title", { toast: e.toast }, () => [
1658
- j(
1767
+ Q("div", Jo, [
1768
+ Q("div", Zo, [
1769
+ re(p.$slots, "title", {
1770
+ toast: e.toast,
1771
+ closeButton: e.closeButton
1772
+ }, () => [
1773
+ Q(
1659
1774
  "p",
1660
1775
  {
1661
- class: re(["soft-toast-title", { "soft-toast-title--has-close": e.closeButton === !0 || e.closeButton === "top-right" }])
1776
+ class: Fe(["soft-toast-title", {
1777
+ "soft-toast-title--has-close": e.closeButton === !0 || e.closeButton === "top-right"
1778
+ }])
1662
1779
  },
1663
- J(e.toast.title),
1780
+ ye(e.toast.title),
1664
1781
  3
1665
1782
  /* TEXT, CLASS */
1666
1783
  )
1667
1784
  ])
1668
1785
  ]),
1669
- e.toast.description || e.toast.action ? (S(), L("div", vo, [
1670
- Q(f.$slots, "description", { toast: e.toast }, () => [
1671
- e.toast.description ? (S(), L("p", yo, [
1672
- typeof e.toast.description == "object" ? (S(), q($e(e.toast.description), { key: 0 })) : (S(), L(
1673
- ue,
1786
+ e.toast.description || e.toast.action ? (P(), $("div", _o, [
1787
+ re(p.$slots, "description", {
1788
+ toast: e.toast,
1789
+ closeButton: e.closeButton
1790
+ }, () => [
1791
+ e.toast.description ? (P(), $("p", es, [
1792
+ typeof e.toast.description == "object" ? (P(), K(gt(e.toast.description), { key: 0 })) : (P(), $(
1793
+ Ie,
1674
1794
  { key: 1 },
1675
1795
  [
1676
- Ct(
1677
- J(e.toast.description),
1796
+ fn(
1797
+ ye(e.toast.description),
1678
1798
  1
1679
1799
  /* TEXT */
1680
1800
  )
@@ -1682,55 +1802,59 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1682
1802
  64
1683
1803
  /* STABLE_FRAGMENT */
1684
1804
  ))
1685
- ])) : H("v-if", !0)
1805
+ ])) : ee("v-if", !0)
1686
1806
  ]),
1687
- Q(f.$slots, "action", {
1807
+ re(p.$slots, "action", {
1688
1808
  toast: e.toast,
1689
- execute: l,
1690
- hasSucceeded: o.value
1809
+ execute: d,
1810
+ hasSucceeded: s.value,
1811
+ closeButton: e.closeButton
1691
1812
  }, () => [
1692
- c.value.length > 0 && !o.value ? (S(), L("div", wo, [
1693
- (S(!0), L(
1694
- ue,
1813
+ w.value.length > 0 && !s.value ? (P(), $("div", ts, [
1814
+ (P(!0), $(
1815
+ Ie,
1695
1816
  null,
1696
- ne(c.value, (C, v) => (S(), L("button", {
1697
- key: v,
1698
- class: re(["soft-toast-action-button", [C.class || "", C.primary ? "soft-toast-action-primary" : ""]]),
1699
- onClick: Re(() => l(C), ["stop"])
1700
- }, J(C.label), 11, xo))),
1817
+ Se(w.value, (B, q) => (P(), $("button", {
1818
+ key: q,
1819
+ class: Fe(["soft-toast-action-button", [
1820
+ B.class || "",
1821
+ B.primary ? "soft-toast-action-primary" : ""
1822
+ ]]),
1823
+ onClick: $e(() => d(B), ["stop"])
1824
+ }, ye(B.label), 11, ns))),
1701
1825
  128
1702
1826
  /* KEYED_FRAGMENT */
1703
1827
  ))
1704
- ])) : o.value ? (S(), L("div", bo, [
1705
- j(
1828
+ ])) : s.value ? (P(), $("div", os, [
1829
+ Q(
1706
1830
  "span",
1707
- ko,
1708
- J(s.value),
1831
+ ss,
1832
+ ye(i.value),
1709
1833
  1
1710
1834
  /* TEXT */
1711
1835
  )
1712
- ])) : H("v-if", !0)
1836
+ ])) : ee("v-if", !0)
1713
1837
  ])
1714
- ])) : H("v-if", !0),
1715
- H(" Timestamp lives below all content — never overlaps close button "),
1716
- e.toast.showTimestamp ? (S(), L(
1838
+ ])) : ee("v-if", !0),
1839
+ ee(" Timestamp lives below all content — never overlaps close button "),
1840
+ e.toast.showTimestamp ? (P(), $(
1717
1841
  "span",
1718
- To,
1719
- J(r.value),
1842
+ is,
1843
+ ye(a.value),
1720
1844
  1
1721
1845
  /* TEXT */
1722
- )) : H("v-if", !0)
1846
+ )) : ee("v-if", !0)
1723
1847
  ])
1724
1848
  ]),
1725
- e.toast.showProgress && e.toast.duration > 0 && e.toast.duration !== 1 / 0 ? (S(), q(co, {
1849
+ e.toast.showProgress && e.toast.duration > 0 && e.toast.duration !== 1 / 0 ? (P(), K(Qo, {
1726
1850
  key: 0,
1727
1851
  "remaining-time": e.toast.remainingTime,
1728
1852
  "total-duration": e.toast.duration,
1729
1853
  "is-paused": e.toast.isPaused
1730
- }, null, 8, ["remaining-time", "total-duration", "is-paused"])) : H("v-if", !0)
1731
- ], 46, lo));
1854
+ }, null, 8, ["remaining-time", "total-duration", "is-paused"])) : ee("v-if", !0)
1855
+ ], 46, Uo));
1732
1856
  }
1733
- }), So = ["data-position", "data-soft-toast-theme", "data-soft-toast-dir", "data-expanded"], Po = ["data-direction"], Eo = /* @__PURE__ */ X({
1857
+ }), rs = ["data-position", "data-soft-toast-theme", "data-soft-toast-dir", "data-expanded"], as = ["data-direction"], cs = 15, ls = /* @__PURE__ */ pe({
1734
1858
  __name: "ToastRegion",
1735
1859
  props: {
1736
1860
  position: { default: "top-right" },
@@ -1751,137 +1875,301 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1751
1875
  maxQueue: { default: 1 / 0 },
1752
1876
  queueOverflow: { default: "drop-oldest" },
1753
1877
  dir: { default: "ltr" },
1754
- swipeToDismiss: { type: Boolean, default: !0 }
1878
+ swipeToDismiss: { type: Boolean, default: !0 },
1879
+ slotFilter: {}
1755
1880
  },
1756
1881
  setup(e) {
1757
- const t = e, n = O(null), o = O(null), s = O(null), i = $(() => m.getToastsByPosition(t.position).value), r = (h) => {
1758
- if (h.key === "Escape" && t.closeOnEscape) {
1759
- const w = i.value;
1760
- w.length > 0 && m.dismiss(w[0].id);
1882
+ const t = e, n = R(null), o = R(null), s = R(null), i = R(
1883
+ /* @__PURE__ */ new Map()
1884
+ ), r = (u, f) => {
1885
+ f ? i.value.set(u, f) : i.value.delete(u);
1886
+ }, a = z(() => y.getToastsByPosition(t.position).value), l = (u) => {
1887
+ if (u.key === "Escape" && t.closeOnEscape) {
1888
+ const f = a.value;
1889
+ f.length > 0 && y.dismiss(f[0].id);
1761
1890
  }
1762
- }, a = () => {
1763
- const h = i.value;
1764
- document.hidden ? h.forEach((w) => m.pause(w.id)) : h.forEach((w) => m.resume(w.id));
1891
+ }, c = () => {
1892
+ const u = a.value;
1893
+ document.hidden ? u.forEach((f) => y.pause(f.id)) : u.forEach((f) => y.resume(f.id));
1765
1894
  };
1766
- he(() => {
1767
- t.closeOnEscape && document.addEventListener("keydown", r), document.addEventListener("visibilitychange", a), s.value && typeof ResizeObserver < "u" && (g = new ResizeObserver(() => I()), g.observe(s.value));
1768
- }), me(() => {
1769
- t.closeOnEscape && document.removeEventListener("keydown", r), document.removeEventListener("visibilitychange", a), g && g.disconnect();
1770
- }), N(
1771
- () => i.value.map((h) => `${h.id}:${h.isLeaving}`).join(","),
1895
+ qe(() => {
1896
+ var u;
1897
+ t.closeOnEscape && document.addEventListener("keydown", l), document.addEventListener("visibilitychange", c), document.addEventListener("touchstart", dt, { passive: !0 }), (u = o.value) == null || u.addEventListener("touchmove", pt, {
1898
+ passive: !1
1899
+ }), typeof ResizeObserver < "u" && (_ = new ResizeObserver(() => v()), te = new ResizeObserver(() => v()), s.value && _.observe(s.value)), ke(() => v());
1900
+ }), Ve(() => {
1901
+ var u;
1902
+ t.closeOnEscape && document.removeEventListener("keydown", l), document.removeEventListener("visibilitychange", c), document.removeEventListener("touchstart", dt), (u = o.value) == null || u.removeEventListener("touchmove", pt), _ && _.disconnect(), te && te.disconnect(), h(), ce = /* @__PURE__ */ new WeakSet();
1903
+ }), G(
1904
+ () => a.value.map((u) => `${u.id}:${u.isLeaving}`).join(","),
1772
1905
  () => {
1773
- Ee(I);
1906
+ ke(v);
1774
1907
  }
1775
- ), N(
1776
- () => m.toasts.value.length,
1777
- (h, w) => {
1778
- if (h > w) {
1779
- const y = m.toasts.value[0];
1780
- y && (y.duration || (y.duration = t.duration), y.preset || (y.preset = t.preset), y.bounce === void 0 && (y.bounce = t.bounce), y.spring === void 0 && (y.spring = t.spring), y.showProgress === void 0 && (y.showProgress = t.showProgress), y.showTimestamp === void 0 && (y.showTimestamp = t.showTimestamp));
1908
+ ), G(
1909
+ () => y.toasts.value.length,
1910
+ (u, f) => {
1911
+ if (u > f) {
1912
+ const m = y.toasts.value[0];
1913
+ m && (m.duration || (m.duration = t.duration), m.preset || (m.preset = t.preset), m.bounce === void 0 && (m.bounce = t.bounce), m.spring === void 0 && (m.spring = t.spring), m.showProgress === void 0 && (m.showProgress = t.showProgress), m.showTimestamp === void 0 && (m.showTimestamp = t.showTimestamp));
1781
1914
  }
1782
1915
  }
1783
1916
  );
1784
- const l = $(() => `soft-toast-container--${t.position}`), c = $(
1785
- () => i.value.filter((h) => !h.isLeaving)
1786
- ), u = (h, w) => h.isLeaving ? w : c.value.findIndex((y) => y.id === h.id), p = O(!1), x = O([]), k = O(0), T = O(0), I = () => {
1917
+ const d = z(() => `soft-toast-container--${t.position}`), w = z(() => t.position.endsWith("-center")), x = z(
1918
+ () => a.value.filter((u) => !u.isLeaving)
1919
+ ), S = (u, f) => u.isLeaving ? f : x.value.findIndex((m) => m.id === u.id), g = R(!1);
1920
+ let I = null;
1921
+ const h = () => {
1922
+ I !== null && (window.clearTimeout(I), I = null);
1923
+ }, N = z(() => {
1924
+ const u = a.value, f = u.slice(0, cs), m = u.filter((C) => C.isLeaving), D = new Set(f.map((C) => C.id));
1925
+ return [...f, ...m.filter((C) => !D.has(C.id))];
1926
+ }), O = R({}), b = R(0), T = R(0);
1927
+ let H = null;
1928
+ const v = () => {
1929
+ H === null && (H = requestAnimationFrame(() => {
1930
+ H = null, W(!1);
1931
+ }));
1932
+ }, M = (u, f, m) => {
1933
+ if (b.value !== f || T.value !== m) return !0;
1934
+ const D = O.value, C = Object.keys(D), j = Object.keys(u);
1935
+ return C.length !== j.length ? !0 : j.some((V) => D[V] !== u[V]);
1936
+ }, W = (u = !1) => {
1787
1937
  if (!s.value) return;
1788
- const h = Array.from(
1938
+ const f = Array.from(
1789
1939
  s.value.querySelectorAll(".soft-toast-item")
1790
- ), w = t.gap ?? 10, y = [];
1791
- let R = 0, se = 0;
1792
- for (let M = 0; M < h.length; M++)
1793
- if (y.push(R), h[M].getAttribute("data-leaving") !== "true") {
1794
- R += h[M].offsetHeight + w;
1795
- const W = h[M].dataset.toastId, K = i.value.find((Be) => Be.id === W);
1796
- K && u(K, i.value.indexOf(K)) === 0 && (se = h[M].offsetHeight);
1940
+ );
1941
+ p(f);
1942
+ const m = t.gap ?? 10, D = [];
1943
+ let C = 0, j = 0;
1944
+ for (let Y = 0; Y < f.length; Y++)
1945
+ if (D.push(C), f[Y].getAttribute("data-leaving") !== "true") {
1946
+ C += f[Y].offsetHeight + m;
1947
+ const Oe = f[Y].dataset.toastId, Ue = a.value.find((mt) => mt.id === Oe);
1948
+ Ue && S(Ue, a.value.indexOf(Ue)) === 0 && (j = f[Y].offsetHeight);
1797
1949
  }
1798
- x.value = y, k.value = se, T.value = Math.max(0, R - w), p.value && s.value && D(0);
1799
- }, d = O(0), D = (h) => {
1950
+ const V = {};
1951
+ for (let Y = 0; Y < f.length; Y++) {
1952
+ const Oe = f[Y].dataset.toastId;
1953
+ Oe && (V[Oe] = D[Y]);
1954
+ }
1955
+ const le = Math.max(0, C - m), Ae = M(V, j, le);
1956
+ if (Ae && (O.value = V, b.value = j, T.value = le), g.value && s.value && Ae && he(0), s.value && Ae) {
1957
+ const Y = g.value ? T.value : b.value;
1958
+ F.set(s.value, { height: Y });
1959
+ }
1960
+ g.value && (Ae || u) && J();
1961
+ }, J = () => {
1962
+ N.value.forEach((u) => {
1963
+ const f = i.value.get(u.id);
1964
+ f && f.applyStackPosition(!1, O.value[u.id] ?? 0);
1965
+ });
1966
+ }, E = R(0), Z = () => {
1967
+ const f = Math.max(
1968
+ 0,
1969
+ T.value - window.innerHeight + 120
1970
+ );
1971
+ return Ce.value === "up" ? { min: 0, max: f } : { min: -f, max: 0 };
1972
+ }, Pe = (u, f = !0, m = 0.18, D = "power2.out") => {
1800
1973
  if (!s.value) return;
1801
- const w = 120, y = window.innerHeight, R = Math.max(0, T.value - y + w);
1802
- P.value === "up" ? (d.value -= h, d.value = Math.max(0, Math.min(d.value, R))) : (d.value -= h, d.value = Math.max(-R, Math.min(d.value, 0))), A.to(s.value, {
1803
- y: d.value,
1804
- duration: 0.4,
1805
- ease: "power3.out",
1974
+ const { min: C, max: j } = Z();
1975
+ if (E.value = Math.max(C, Math.min(u, j)), !f) {
1976
+ F.set(s.value, {
1977
+ y: E.value,
1978
+ force3D: !0,
1979
+ overwrite: !0
1980
+ });
1981
+ return;
1982
+ }
1983
+ F.to(s.value, {
1984
+ y: E.value,
1985
+ duration: m,
1986
+ ease: D,
1806
1987
  overwrite: "auto"
1807
1988
  });
1808
- }, F = (h) => {
1809
- if (!p.value) return;
1810
- let w = h.target, y = !1;
1811
- for (; w && w !== o.value; ) {
1812
- const M = window.getComputedStyle(w).overflowY;
1813
- if ((M === "auto" || M === "scroll") && w.scrollHeight > w.clientHeight) {
1814
- const W = Math.ceil(w.scrollTop + w.clientHeight) < w.scrollHeight, K = w.scrollTop > 0;
1815
- if (h.deltaY > 0 && W || h.deltaY < 0 && K) {
1816
- y = !0;
1989
+ }, he = (u, f = !0) => {
1990
+ Pe(E.value - u, f);
1991
+ }, Le = (u) => {
1992
+ if (!g.value) return;
1993
+ let f = u.target, m = !1;
1994
+ for (; f && f !== o.value; ) {
1995
+ const j = window.getComputedStyle(f).overflowY;
1996
+ if ((j === "auto" || j === "scroll") && f.scrollHeight > f.clientHeight) {
1997
+ const V = Math.ceil(f.scrollTop + f.clientHeight) < f.scrollHeight, le = f.scrollTop > 0;
1998
+ if (u.deltaY > 0 && V || u.deltaY < 0 && le) {
1999
+ m = !0;
1817
2000
  break;
1818
2001
  }
1819
2002
  }
1820
- w = w.parentElement;
2003
+ f = f.parentElement;
1821
2004
  }
1822
- y || Math.max(0, T.value - window.innerHeight + 120) <= 0 || (h.preventDefault(), D(h.deltaY));
1823
- }, f = $(() => i.value.length === 0 ? 0 : p.value ? T.value : k.value);
1824
- let g = null;
1825
- const C = () => {
1826
- I(), p.value = !0;
1827
- }, v = () => {
1828
- p.value = !1, d.value = 0, s.value && A.to(s.value, { y: 0, duration: 0.5, ease: "power3.out", overwrite: "auto" });
1829
- }, P = $(
2005
+ m || Math.max(
2006
+ 0,
2007
+ T.value - window.innerHeight + 120
2008
+ ) <= 0 || (u.preventDefault(), he(u.deltaY));
2009
+ }, me = (u) => {
2010
+ if (!s.value) return;
2011
+ const f = u ? T.value : b.value;
2012
+ F.to(s.value, {
2013
+ height: f,
2014
+ duration: u ? 0.14 : 0.16,
2015
+ ease: u ? "power3.out" : "power2.out",
2016
+ overwrite: "auto"
2017
+ });
2018
+ };
2019
+ let _ = null, te = null, ce = /* @__PURE__ */ new WeakSet();
2020
+ const p = (u) => {
2021
+ if (te)
2022
+ for (const f of u)
2023
+ ce.has(f) || (ce.add(f), te.observe(f));
2024
+ }, L = () => {
2025
+ h(), !g.value && (g.value = !0, ke(() => {
2026
+ W(!0), me(!0);
2027
+ }));
2028
+ }, B = () => {
2029
+ h(), I = window.setTimeout(() => {
2030
+ I = null, g.value = !1, me(!1), E.value = 0, s.value && F.to(s.value, {
2031
+ y: 0,
2032
+ duration: 0.2,
2033
+ ease: "power2.out",
2034
+ overwrite: "auto"
2035
+ });
2036
+ }, 80);
2037
+ };
2038
+ let q = 0, ne = 0, oe = 0, ge = 0, ve = 0, Qe = !1;
2039
+ const rn = (u) => {
2040
+ q = u.touches[0].clientX, ne = u.touches[0].clientY, oe = u.touches[0].clientY, ge = performance.now(), ve = 0, Qe = !1, s.value && F.killTweensOf(s.value);
2041
+ }, an = (u) => {
2042
+ var D, C;
2043
+ if (a.value.length <= 1) return;
2044
+ const f = Math.abs((((D = u.changedTouches[0]) == null ? void 0 : D.clientX) ?? q) - q), m = Math.abs((((C = u.changedTouches[0]) == null ? void 0 : C.clientY) ?? ne) - ne);
2045
+ if (f > 8 || m > 8) {
2046
+ if (g.value && Qe && Math.abs(ve) > 0.08) {
2047
+ const j = Math.max(
2048
+ -460,
2049
+ Math.min(ve * 560, 460)
2050
+ ), V = Math.max(
2051
+ 0.32,
2052
+ Math.min(Math.abs(j) / 780, 0.62)
2053
+ );
2054
+ Pe(
2055
+ E.value + j,
2056
+ !0,
2057
+ V,
2058
+ "power3.out"
2059
+ );
2060
+ }
2061
+ return;
2062
+ }
2063
+ g.value ? B() : (u.preventDefault(), L());
2064
+ }, dt = (u) => {
2065
+ g.value && n.value && !n.value.contains(u.target) && B();
2066
+ }, pt = (u) => {
2067
+ if (!g.value) return;
2068
+ u.preventDefault();
2069
+ const f = u.touches[0].clientY, m = oe - f, D = performance.now(), C = Math.max(1, D - ge);
2070
+ if (oe = f, ge = D, Math.max(
2071
+ 0,
2072
+ T.value - window.innerHeight + 120
2073
+ ) <= 0) return;
2074
+ const V = E.value;
2075
+ he(m, !1);
2076
+ const le = (E.value - V) / C;
2077
+ ve = ve * 0.35 + le * 0.65, Qe = !0;
2078
+ }, Ce = z(
1830
2079
  () => t.position.includes("bottom") ? "up" : "down"
1831
- );
1832
- return (h, w) => (S(), q(lt, { to: "body" }, [
1833
- Ot(j("div", {
2080
+ ), cn = z(() => ({
2081
+ width: w.value ? "100%" : void 0
2082
+ })), ln = (u) => {
2083
+ var f;
2084
+ return ((f = t.slotFilter) == null ? void 0 : f.call(t, u)) ?? !0;
2085
+ }, ht = z(() => t.swipeToDismiss !== !1);
2086
+ return (u, f) => (P(), K(Ht, { to: "body" }, [
2087
+ dn(Q("div", {
1834
2088
  ref_key: "containerRef",
1835
2089
  ref: n,
1836
- class: re(["soft-toast-container", l.value]),
2090
+ class: Fe(["soft-toast-container", d.value]),
1837
2091
  "data-position": e.position,
1838
2092
  "data-soft-toast-theme": e.theme,
1839
2093
  "data-soft-toast-dir": e.dir,
1840
- "data-expanded": p.value
2094
+ "data-expanded": g.value
1841
2095
  }, [
1842
- j("div", {
2096
+ Q("div", {
1843
2097
  ref_key: "stackRef",
1844
2098
  ref: o,
1845
2099
  class: "soft-toast-stack",
1846
- "data-direction": P.value,
1847
- onMouseenter: C,
1848
- onMouseleave: v,
1849
- onWheel: F,
2100
+ "data-direction": Ce.value,
2101
+ onMouseenter: L,
2102
+ onMouseleave: B,
2103
+ onTouchstart: $e(rn, ["stop"]),
2104
+ onTouchend: $e(an, ["stop"]),
2105
+ onWheel: Le,
1850
2106
  "data-lenis-prevent": "true"
1851
2107
  }, [
1852
- j(
2108
+ Q(
1853
2109
  "div",
1854
2110
  {
1855
2111
  ref_key: "listRef",
1856
2112
  ref: s,
1857
2113
  class: "soft-toast-list",
1858
- style: ct({ height: f.value + "px" })
2114
+ style: De(cn.value)
1859
2115
  },
1860
2116
  [
1861
- (S(!0), L(
1862
- ue,
2117
+ (P(!0), $(
2118
+ Ie,
1863
2119
  null,
1864
- ne(i.value, (y, R) => (S(), q(Io, {
1865
- key: y.id,
1866
- toast: y,
1867
- index: u(y, R),
1868
- total: c.value.length,
1869
- expanded: p.value,
1870
- "expanded-offset": x.value[R] ?? 0,
1871
- "stack-direction": P.value,
1872
- "close-button": y.closeButton ?? e.closeButton,
1873
- "swipe-to-dismiss": e.swipeToDismiss
1874
- }, ut({
1875
- _: 2
1876
- /* DYNAMIC */
1877
- }, [
1878
- ne(h.$slots, (se, M) => ({
1879
- name: M,
1880
- fn: ft((W) => [
1881
- Q(h.$slots, M, be({ ref_for: !0 }, W || {}), void 0, !0)
1882
- ])
1883
- }))
1884
- ]), 1032, ["toast", "index", "total", "expanded", "expanded-offset", "stack-direction", "close-button", "swipe-to-dismiss"]))),
2120
+ Se(N.value, (m, D) => (P(), $(
2121
+ Ie,
2122
+ {
2123
+ key: m.id
2124
+ },
2125
+ [
2126
+ ln(m) ? (P(), K(jt, {
2127
+ key: 0,
2128
+ ref_for: !0,
2129
+ ref: (C) => r(m.id, C),
2130
+ toast: m,
2131
+ index: S(m, D),
2132
+ total: x.value.length,
2133
+ expanded: g.value,
2134
+ "expanded-offset": O.value[m.id] ?? 0,
2135
+ "stack-direction": Ce.value,
2136
+ interactive: !m.isLeaving && (g.value || S(m, D) === 0),
2137
+ "close-button": m.closeButton ?? e.closeButton,
2138
+ "swipe-to-dismiss": ht.value,
2139
+ style: De(
2140
+ w.value ? { left: "50%", marginLeft: "-50%" } : void 0
2141
+ )
2142
+ }, qt({
2143
+ _: 2
2144
+ /* DYNAMIC */
2145
+ }, [
2146
+ Se(u.$slots, (C, j) => ({
2147
+ name: j,
2148
+ fn: Vt((V) => [
2149
+ re(u.$slots, j, Ke({ ref_for: !0 }, V || {}), void 0, !0)
2150
+ ])
2151
+ }))
2152
+ ]), 1032, ["toast", "index", "total", "expanded", "expanded-offset", "stack-direction", "interactive", "close-button", "swipe-to-dismiss", "style"])) : (P(), K(jt, {
2153
+ key: 1,
2154
+ ref_for: !0,
2155
+ ref: (C) => r(m.id, C),
2156
+ toast: m,
2157
+ index: S(m, D),
2158
+ total: x.value.length,
2159
+ expanded: g.value,
2160
+ "expanded-offset": O.value[m.id] ?? 0,
2161
+ "stack-direction": Ce.value,
2162
+ interactive: !m.isLeaving && (g.value || S(m, D) === 0),
2163
+ "close-button": m.closeButton ?? e.closeButton,
2164
+ "swipe-to-dismiss": ht.value,
2165
+ style: De(
2166
+ w.value ? { left: "50%", marginLeft: "-50%" } : void 0
2167
+ )
2168
+ }, null, 8, ["toast", "index", "total", "expanded", "expanded-offset", "stack-direction", "interactive", "close-button", "swipe-to-dismiss", "style"]))
2169
+ ],
2170
+ 64
2171
+ /* STABLE_FRAGMENT */
2172
+ ))),
1885
2173
  128
1886
2174
  /* KEYED_FRAGMENT */
1887
2175
  ))
@@ -1889,18 +2177,18 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1889
2177
  4
1890
2178
  /* STYLE */
1891
2179
  )
1892
- ], 40, Po)
1893
- ], 10, So), [
1894
- [Lt, i.value.length > 0]
2180
+ ], 40, as)
2181
+ ], 10, rs), [
2182
+ [pn, a.value.length > 0]
1895
2183
  ])
1896
2184
  ]));
1897
2185
  }
1898
- }), Ao = (e, t) => {
2186
+ }), us = (e, t) => {
1899
2187
  const n = e.__vccOpts || e;
1900
2188
  for (const [o, s] of t)
1901
2189
  n[o] = s;
1902
2190
  return n;
1903
- }, Co = /* @__PURE__ */ Ao(Eo, [["__scopeId", "data-v-3699e296"]]), it = /* @__PURE__ */ X({
2191
+ }, fs = /* @__PURE__ */ us(ls, [["__scopeId", "data-v-ad802395"]]), Rt = /* @__PURE__ */ pe({
1904
2192
  __name: "ToastContainer",
1905
2193
  props: {
1906
2194
  position: { default: "top-right" },
@@ -1921,7 +2209,8 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1921
2209
  maxQueue: { default: 10 },
1922
2210
  queueOverflow: { default: "drop-oldest" },
1923
2211
  dir: {},
1924
- swipeToDismiss: { type: Boolean }
2212
+ swipeToDismiss: { type: Boolean, default: !0 },
2213
+ slotFilter: {}
1925
2214
  },
1926
2215
  setup(e) {
1927
2216
  const t = e, n = [
@@ -1929,7 +2218,6 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1929
2218
  "bottom",
1930
2219
  "left",
1931
2220
  "right",
1932
- "center",
1933
2221
  "top-left",
1934
2222
  "top-center",
1935
2223
  "top-right",
@@ -1937,18 +2225,18 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1937
2225
  "bottom-center",
1938
2226
  "bottom-right"
1939
2227
  ];
1940
- return (o, s) => (S(), q(lt, { to: "body" }, [
1941
- (S(), L(
1942
- ue,
2228
+ return (o, s) => (P(), K(Ht, { to: "body" }, [
2229
+ (P(), $(
2230
+ Ie,
1943
2231
  null,
1944
- ne(n, (i) => Ae(Co, be({ key: i }, { ref_for: !0 }, t, { position: i }), ut({
2232
+ Se(n, (i) => st(fs, Ke({ key: i }, { ref_for: !0 }, t, { position: i }), qt({
1945
2233
  _: 2
1946
2234
  /* DYNAMIC */
1947
2235
  }, [
1948
- ne(o.$slots, (r, a) => ({
2236
+ Se(o.$slots, (r, a) => ({
1949
2237
  name: a,
1950
- fn: ft((l) => [
1951
- Q(o.$slots, a, be({ ref_for: !0 }, l || {}))
2238
+ fn: Vt((l) => [
2239
+ re(o.$slots, a, Ke({ ref_for: !0 }, l || {}))
1952
2240
  ])
1953
2241
  }))
1954
2242
  ]), 1040, ["position"])),
@@ -1958,7 +2246,7 @@ const Jn = 0.22, pe = "power2.out", Zn = (e) => {
1958
2246
  ]));
1959
2247
  }
1960
2248
  });
1961
- let E = {
2249
+ let A = {
1962
2250
  position: "top-right",
1963
2251
  duration: 4e3,
1964
2252
  theme: "light",
@@ -1973,128 +2261,131 @@ let E = {
1973
2261
  queueOverflow: "drop-oldest",
1974
2262
  dir: "ltr",
1975
2263
  swipeToDismiss: !0,
1976
- teleportTarget: "body"
1977
- }, rt = !1;
1978
- const Do = {
2264
+ teleportTarget: "body",
2265
+ autoMount: !0
2266
+ }, $t = !1;
2267
+ const hs = {
1979
2268
  install(e, t = {}) {
1980
- if (E = { ...E, ...t }, !rt && typeof window < "u") {
2269
+ if (A = { ...A, ...t }, e.component("SoftToastContainer", Rt), A.autoMount !== !1 && !$t && typeof window < "u") {
1981
2270
  const n = "soft-toast-global-container";
1982
2271
  let o = document.getElementById(n);
1983
- o || (o = document.createElement("div"), o.id = n, document.body.appendChild(o)), e.component("SoftToastContainer", it), Dt({
1984
- render: () => xe(it, {
1985
- position: E.position,
1986
- duration: E.duration,
1987
- gap: E.gap,
1988
- offset: E.offset,
1989
- theme: E.theme,
1990
- spring: E.spring,
1991
- bounce: E.bounce,
1992
- preset: E.preset,
1993
- closeOnEscape: E.closeOnEscape,
1994
- closeButton: E.closeButton,
1995
- showProgress: E.showProgress,
1996
- maxQueue: E.maxQueue,
1997
- queueOverflow: E.queueOverflow,
1998
- dir: E.dir,
1999
- swipeToDismiss: E.swipeToDismiss
2272
+ o || (o = document.createElement("div"), o.id = n, document.body.appendChild(o)), hn({
2273
+ render: () => Ge(Rt, {
2274
+ position: A.position,
2275
+ duration: A.duration,
2276
+ gap: A.gap,
2277
+ offset: A.offset,
2278
+ theme: A.theme,
2279
+ spring: A.spring,
2280
+ bounce: A.bounce,
2281
+ preset: A.preset,
2282
+ closeOnEscape: A.closeOnEscape,
2283
+ closeButton: A.closeButton,
2284
+ showProgress: A.showProgress,
2285
+ maxQueue: A.maxQueue,
2286
+ queueOverflow: A.queueOverflow,
2287
+ dir: A.dir,
2288
+ swipeToDismiss: A.swipeToDismiss,
2289
+ showTimestamp: A.showTimestamp,
2290
+ slotFilter: A.slotFilter
2000
2291
  })
2001
- }).mount(o), rt = !0;
2292
+ }).mount(o), $t = !0;
2002
2293
  }
2003
- e.provide("softToastOptions", E), typeof document < "u" && (document.body.setAttribute("data-soft-toast-theme", E.theme || "light"), document.body.setAttribute("data-soft-toast-dir", E.dir || "ltr"));
2294
+ e.provide("softToastOptions", A), typeof document < "u" && (document.body.setAttribute("data-soft-toast-theme", A.theme || "light"), document.body.setAttribute("data-soft-toast-dir", A.dir || "ltr"));
2004
2295
  }
2005
- }, Fo = () => E, Pt = "@soft-toast/vue:flash", De = () => {
2296
+ }, ms = () => A, on = "@soft-toast/vue:flash", ct = () => {
2006
2297
  if (typeof sessionStorage > "u") return [];
2007
2298
  try {
2008
- return JSON.parse(sessionStorage.getItem(Pt) || "[]");
2299
+ return JSON.parse(sessionStorage.getItem(on) || "[]");
2009
2300
  } catch {
2010
2301
  return [];
2011
2302
  }
2012
- }, Et = (e) => {
2303
+ }, sn = (e) => {
2013
2304
  if (!(typeof sessionStorage > "u"))
2014
2305
  try {
2015
- sessionStorage.setItem(Pt, JSON.stringify(e));
2306
+ sessionStorage.setItem(on, JSON.stringify(e));
2016
2307
  } catch {
2017
2308
  }
2018
- }, Fe = (e, t = {}) => {
2019
- const n = De().filter(
2309
+ }, lt = (e, t = {}) => {
2310
+ const n = ct().filter(
2020
2311
  (o) => Date.now() - o.queuedAt < 3e4
2021
2312
  // discard stale flashes
2022
2313
  );
2023
- n.push({ title: e, options: t, queuedAt: Date.now() }), Et(n);
2024
- }, Me = () => {
2025
- const e = De().filter(
2314
+ n.push({ title: e, options: t, queuedAt: Date.now() }), sn(n);
2315
+ }, ut = () => {
2316
+ const e = ct().filter(
2026
2317
  (t) => Date.now() - t.queuedAt < 3e4
2027
2318
  );
2028
- return Et([]), e.forEach((t) => {
2029
- m.add({ title: t.title, type: "default", ...t.options });
2319
+ return sn([]), e.forEach((t) => {
2320
+ y.add({ title: t.title, type: "default", ...t.options });
2030
2321
  }), e.length;
2031
- }, je = () => De().some((e) => Date.now() - e.queuedAt < 3e4), Mo = () => ({
2322
+ }, ft = () => ct().some((e) => Date.now() - e.queuedAt < 3e4), gs = () => ({
2032
2323
  /** Queue a toast that will appear on the next page/route */
2033
- flash: Fe,
2324
+ flash: lt,
2034
2325
  /** Show all pending flashes now — call in onMounted */
2035
- showPendingFlashes: Me,
2326
+ showPendingFlashes: ut,
2036
2327
  /** True if there are flashes waiting to be shown */
2037
- hasPending: je
2038
- }), jo = () => ({
2039
- default: (e, t) => m.add({ ...t, type: "default", title: e }),
2040
- success: (e, t) => m.add({ ...t, type: "success", title: e }),
2041
- error: (e, t) => m.add({ ...t, type: "error", title: e }),
2042
- warning: (e, t) => m.add({ ...t, type: "warning", title: e }),
2043
- info: (e, t) => m.add({ ...t, type: "info", title: e }),
2044
- loading: (e, t) => m.loading(e, t),
2045
- promise: (e, t, n) => m.promise(e, t, n),
2046
- custom: (e) => m.add(e),
2047
- update: (e, t) => m.update(e, t),
2048
- dismiss: (e) => m.dismiss(e),
2049
- dismissAll: () => m.dismiss(),
2050
- pause: (e) => m.pause(e),
2051
- resume: (e) => m.resume(e),
2328
+ hasPending: ft
2329
+ }), vs = () => ({
2330
+ default: (e, t) => y.add({ ...t, type: "default", title: e }),
2331
+ success: (e, t) => y.add({ ...t, type: "success", title: e }),
2332
+ error: (e, t) => y.add({ ...t, type: "error", title: e }),
2333
+ warning: (e, t) => y.add({ ...t, type: "warning", title: e }),
2334
+ info: (e, t) => y.add({ ...t, type: "info", title: e }),
2335
+ loading: (e, t) => y.loading(e, t),
2336
+ promise: (e, t, n) => y.promise(e, t, n),
2337
+ custom: (e) => y.add(e),
2338
+ update: (e, t) => y.update(e, t),
2339
+ dismiss: (e) => y.dismiss(e),
2340
+ dismissAll: () => y.dismiss(),
2341
+ pause: (e) => y.pause(e),
2342
+ resume: (e) => y.resume(e),
2052
2343
  /**
2053
2344
  * Queue a toast that will be shown on the next page load / route navigation.
2054
2345
  * Perfect for the "submit → redirect → show success" pattern.
2055
2346
  *
2056
2347
  * @example
2057
- * const { flash } = useToast()
2348
+ * const { flash } = useSoftToast()
2058
2349
  * await api.save()
2059
2350
  * flash('Saved!', { type: 'success' })
2060
2351
  * router.push('/dashboard')
2061
2352
  */
2062
- flash: (e, t = {}) => Fe(e, t),
2353
+ flash: (e, t = {}) => lt(e, t),
2063
2354
  /**
2064
2355
  * Show any toasts that were queued with flash() before a page navigation.
2065
2356
  * Call this in onMounted() of your root layout or App.vue.
2066
2357
  */
2067
- showFlashes: () => Me(),
2358
+ showFlashes: () => ut(),
2068
2359
  /** Check if there are pending flash messages without consuming them. */
2069
- hasFlashes: () => je()
2070
- }), Bo = {
2071
- default: (e, t) => m.add({ ...t, type: "default", title: e }),
2072
- success: (e, t) => m.add({ ...t, type: "success", title: e }),
2073
- error: (e, t) => m.add({ ...t, type: "error", title: e }),
2074
- warning: (e, t) => m.add({ ...t, type: "warning", title: e }),
2075
- info: (e, t) => m.add({ ...t, type: "info", title: e }),
2076
- loading: (e, t) => m.loading(e, t),
2077
- promise: (e, t, n) => m.promise(e, t, n),
2078
- custom: (e) => m.add(e),
2079
- update: (e, t) => m.update(e, t),
2080
- dismiss: (e) => m.dismiss(e),
2081
- dismissAll: () => m.dismiss(),
2082
- pause: (e) => m.pause(e),
2083
- resume: (e) => m.resume(e),
2084
- flash: (e, t = {}) => Fe(e, t),
2085
- showFlashes: () => Me(),
2086
- hasFlashes: () => je()
2360
+ hasFlashes: () => ft()
2361
+ }), ys = {
2362
+ default: (e, t) => y.add({ ...t, type: "default", title: e }),
2363
+ success: (e, t) => y.add({ ...t, type: "success", title: e }),
2364
+ error: (e, t) => y.add({ ...t, type: "error", title: e }),
2365
+ warning: (e, t) => y.add({ ...t, type: "warning", title: e }),
2366
+ info: (e, t) => y.add({ ...t, type: "info", title: e }),
2367
+ loading: (e, t) => y.loading(e, t),
2368
+ promise: (e, t, n) => y.promise(e, t, n),
2369
+ custom: (e) => y.add(e),
2370
+ update: (e, t) => y.update(e, t),
2371
+ dismiss: (e) => y.dismiss(e),
2372
+ dismissAll: () => y.dismiss(),
2373
+ pause: (e) => y.pause(e),
2374
+ resume: (e) => y.resume(e),
2375
+ flash: (e, t = {}) => lt(e, t),
2376
+ showFlashes: () => ut(),
2377
+ hasFlashes: () => ft()
2087
2378
  };
2088
2379
  export {
2089
- Do as SoftToastPlugin,
2090
- it as ToastContainer,
2091
- Io as ToastItem,
2092
- Me as consumeFlashes,
2093
- Fo as getToastOptions,
2094
- je as hasPendingFlashes,
2095
- Fe as queueFlash,
2096
- Bo as toast,
2097
- m as toastStore,
2098
- Mo as useFlash,
2099
- jo as useToast
2380
+ hs as SoftToastPlugin,
2381
+ Rt as ToastContainer,
2382
+ jt as ToastItem,
2383
+ ut as consumeFlashes,
2384
+ ms as getToastOptions,
2385
+ ft as hasPendingFlashes,
2386
+ lt as queueFlash,
2387
+ ys as softToast,
2388
+ y as toastStore,
2389
+ gs as useFlash,
2390
+ vs as useSoftToast
2100
2391
  };