@soft-toast/vue 1.0.0 → 1.0.2

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