@vuetify/one 2.8.1 → 2.8.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.
@@ -1,25 +1,33 @@
1
1
  import { merge as O } from "lodash-es";
2
- import { defineStore as L } from "pinia";
3
- import { ref as T, reactive as z, watch as I, toRefs as M, computed as m, shallowRef as U, nextTick as X } from "vue";
4
- import { useRoute as Y, useRouter as J } from "vue-router";
5
- const _ = L("queue", () => {
2
+ import { defineStore as j } from "pinia";
3
+ import { ref as T, reactive as z, watch as I, toRefs as M, computed as m, shallowRef as N, nextTick as X } from "vue";
4
+ import { useRoute as Y, useRouter as F } from "vue-router";
5
+ const _ = j("queue", () => {
6
6
  const e = T([]);
7
- function s(o) {
8
- const a = typeof o == "string" ? { text: o } : o;
9
- e.value.push(a);
7
+ function r(o) {
8
+ const s = typeof o == "string" ? { text: o } : o;
9
+ e.value.push(s);
10
10
  }
11
11
  function t(o) {
12
- s({
12
+ r({
13
13
  color: "error",
14
14
  text: o,
15
15
  location: "top end",
16
16
  timeout: -1
17
17
  });
18
18
  }
19
+ function i(o) {
20
+ r({
21
+ color: "success",
22
+ text: o,
23
+ location: "top end"
24
+ });
25
+ }
19
26
  return {
20
27
  queue: e,
21
- show: s,
22
- showError: t
28
+ show: r,
29
+ showError: t,
30
+ showSuccess: i
23
31
  };
24
32
  }), G = [
25
33
  (e) => (e.v || (e.pwaRefresh = !0, typeof e.api == "boolean" && (e.api = e.api ? "inline" : "link-only"), typeof e.rtl == "boolean" && (e.direction = e.rtl ? "rtl" : "ltr", delete e.rtl), typeof e.theme == "object" && (e.mixedTheme = e.theme.mixed, e.theme = e.theme.system ? "system" : e.theme.dark ? "dark" : "light"), Array.isArray(e.notifications) && (e.notifications = { read: e.notifications }), typeof e.last == "object" && (e.notifications = e.notifications || {}, e.notifications.last = e.last, delete e.last), e.v = 1), e),
@@ -46,7 +54,7 @@ function K(e) {
46
54
  composition: e.composition || "composition",
47
55
  pins: {
48
56
  enabled: e.pins || !1,
49
- pinned: Array.isArray(e.pinned) ? e.pinned.map((s) => s.name || s).filter(Boolean) : []
57
+ pinned: Array.isArray(e.pinned) ? e.pinned.map((r) => r.name || r).filter(Boolean) : []
50
58
  },
51
59
  mixedTheme: e.mixedTheme ?? !0,
52
60
  favorites: [],
@@ -87,7 +95,7 @@ function K(e) {
87
95
  }
88
96
  };
89
97
  }
90
- function F(e) {
98
+ function H(e) {
91
99
  return {
92
100
  ...e,
93
101
  version: 7,
@@ -100,8 +108,8 @@ function F(e) {
100
108
  };
101
109
  }
102
110
  function Z(e) {
103
- const s = G.reduce((o, a) => a(o), e), t = K(s);
104
- return F(t);
111
+ const r = G.reduce((i, o) => o(i), e), t = K(r);
112
+ return H(t);
105
113
  }
106
114
  const W = typeof window < "u", E = {
107
115
  version: 7,
@@ -166,89 +174,97 @@ const W = typeof window < "u", E = {
166
174
  sync: !0,
167
175
  devmode: !1
168
176
  }
169
- }, D = L("user", () => {
177
+ }, D = j("user", () => {
170
178
  const e = z(structuredClone(E));
171
179
  I(e, t, { deep: !0 });
172
- function s() {
180
+ function r() {
173
181
  if (!W)
174
182
  return;
175
- const a = localStorage.getItem("vuetify@user");
176
- if (a)
183
+ const o = localStorage.getItem("vuetify@user");
184
+ if (o)
177
185
  try {
178
- const n = JSON.parse(a);
179
- if (n.version >= 7) {
186
+ const s = JSON.parse(o);
187
+ if (s.version >= 7) {
180
188
  const u = {
181
189
  version: 7,
182
- ecosystem: O(structuredClone(E.ecosystem), n.ecosystem || {}),
183
- one: O(structuredClone(E.one), n.one || {})
190
+ ecosystem: O(structuredClone(E.ecosystem), s.ecosystem || {}),
191
+ one: O(structuredClone(E.one), s.one || {})
184
192
  };
185
193
  Object.assign(e, u);
186
- } else if (n.version === 6) {
187
- const u = F(n), d = {
194
+ } else if (s.version === 6) {
195
+ const u = H(s), d = {
188
196
  version: 7,
189
197
  ecosystem: O(structuredClone(E.ecosystem), u.ecosystem || {}),
190
198
  one: O(structuredClone(E.one), u.one || {})
191
199
  };
192
200
  Object.assign(e, d);
193
201
  } else {
194
- const u = Z(n);
202
+ const u = Z(s);
195
203
  Object.assign(e, u);
196
204
  }
197
205
  t();
198
- } catch (n) {
199
- console.error("Failed to load user settings:", n);
206
+ } catch (s) {
207
+ console.error("Failed to load user settings:", s);
200
208
  }
201
209
  }
202
210
  function t() {
203
211
  W && localStorage.setItem("vuetify@user", JSON.stringify(e, null, 2));
204
212
  }
205
- function o() {
213
+ function i() {
206
214
  W && (Object.assign(e, structuredClone(E)), t());
207
215
  }
208
- return s(), {
216
+ return r(), {
209
217
  ...M(e),
210
- load: s,
218
+ load: r,
211
219
  save: t,
212
- reset: o
220
+ reset: i
213
221
  };
214
- }), H = L("http", {
222
+ }), J = j("http", {
215
223
  state: () => ({
216
224
  url: ""
217
225
  }),
218
226
  actions: {
219
- async fetch(e, s = {}) {
227
+ async fetch(e, r = {}) {
220
228
  const t = await fetch(`${this.url}${e}`, {
221
229
  credentials: "include",
222
- ...s
230
+ ...r
223
231
  });
224
- if (!t.ok)
225
- throw new Error(await t.text());
232
+ if (!t.ok) {
233
+ const i = await t.text();
234
+ let o = i || `HTTP ${t.status}`;
235
+ try {
236
+ const s = JSON.parse(i);
237
+ o = s.message || s.error || i;
238
+ } catch {
239
+ }
240
+ throw new Error(o);
241
+ }
226
242
  return t.status === 204 ? {} : t.json();
227
243
  },
228
- async post(e, s, t = {}) {
244
+ async post(e, r, t = {}) {
229
245
  return this.fetch(e, {
230
246
  method: "POST",
231
247
  headers: {
232
248
  "Content-Type": "application/json"
233
249
  },
234
- body: JSON.stringify(s),
250
+ body: JSON.stringify(r),
235
251
  ...t
236
252
  });
237
253
  },
238
- async form(e, s, t = {}) {
254
+ async form(e, r, t = {}) {
239
255
  return this.fetch(e, {
240
256
  method: "POST",
241
- body: s,
257
+ body: r,
242
258
  ...t
243
259
  });
244
260
  },
245
- async get(e, s = {}) {
246
- return this.fetch(e, s);
261
+ async get(e, r = {}) {
262
+ return this.fetch(e, r);
247
263
  },
248
- async delete(e, s = {}) {
264
+ async delete(e, r = {}) {
249
265
  return this.fetch(e, {
250
266
  method: "DELETE",
251
- ...s
267
+ ...r
252
268
  });
253
269
  }
254
270
  }
@@ -259,81 +275,81 @@ function Q() {
259
275
  () => e.query
260
276
  );
261
277
  }
262
- const V = L("one", () => {
263
- const e = Q(), s = J(), t = B(), o = H(), a = _(), n = U(!1), u = U(!1), d = T(null), v = T([]), g = m(() => e.value.session_id), A = m(() => d.value?.items[0].plan.interval), h = m(() => d.value?.items[0].plan.type), k = T([]), y = m(() => t.user?.sponsorships.find((r) => r.platform === "stripe" && r.tierName.startsWith("sub_"))), R = m(() => !!y.value?.tierName), c = m(() => t.user?.sponsorships.reduce((r, p) => {
278
+ const V = j("one", () => {
279
+ const e = Q(), r = F(), t = B(), i = J(), o = _(), s = N(!1), u = N(!1), d = T(null), v = T([]), g = m(() => e.value.session_id), A = m(() => d.value?.items[0].plan.interval), h = m(() => d.value?.items[0].plan.type), k = T([]), y = m(() => t.user?.sponsorships.find((n) => n.platform === "stripe" && n.tierName.startsWith("sub_"))), L = m(() => !!y.value?.tierName), c = m(() => t.user?.sponsorships.reduce((n, p) => {
264
280
  if (!p.isActive || p.interval === "once")
265
- return r;
281
+ return n;
266
282
  const b = p.interval === "month" ? p.amount : p.amount / 12;
267
- return r + b / 100;
268
- }, 0) ?? 0), i = m(() => t.user?.sponsorships.find((r) => r.tierName.startsWith("sub_") && r.isActive)), f = m(() => t.user?.sponsorships.find((r) => r.platform === "github" && r.isActive)), l = m(() => t.user?.sponsorships.find((r) => r.platform === "discord" && r.isActive)), $ = m(() => t.user?.identities.find((r) => r.provider === "shopify")), N = m(() => !o.url || t.user?.isAdmin || y.value?.isActive || k.value.some((r) => ["one", "one/team"].includes(r)));
269
- I(u, w), I(g, async (r) => {
270
- r && await j();
271
- }, { immediate: !0 }), I(e, (r) => {
272
- if (r.one !== "subscribe" || t.user)
283
+ return n + b / 100;
284
+ }, 0) ?? 0), a = m(() => t.user?.sponsorships.find((n) => n.tierName.startsWith("sub_") && n.isActive)), f = m(() => t.user?.sponsorships.find((n) => n.platform === "github" && n.isActive)), l = m(() => t.user?.sponsorships.find((n) => n.platform === "discord" && n.isActive)), $ = m(() => t.user?.identities.find((n) => n.provider === "shopify")), U = m(() => !i.url || t.user?.isAdmin || y.value?.isActive || k.value.some((n) => ["one", "one/team"].includes(n)));
285
+ I(u, w), I(g, async (n) => {
286
+ n && await R();
287
+ }, { immediate: !0 }), I(e, (n) => {
288
+ if (n.one !== "subscribe" || t.user)
273
289
  return;
274
290
  t.dialog = !0;
275
291
  const p = I(() => t.user, (b) => {
276
292
  b && (t.dialog = !1, p());
277
293
  });
278
294
  }, { immediate: !0 });
279
- async function j() {
295
+ async function R() {
280
296
  try {
281
- n.value = !0, await o.post("/one/activate", { sessionId: g.value }), await t.verify(!0), await q();
282
- const r = new URL(window.location.href), p = r.searchParams;
283
- p.delete("session_id"), p.delete("team"), history.pushState(null, "", r.toString());
284
- } catch (r) {
285
- a.showError(r?.message ?? "Error activating subscription, Please contact support");
297
+ s.value = !0, await i.post("/one/activate", { sessionId: g.value }), await t.verify(!0), await q();
298
+ const n = new URL(window.location.href), p = n.searchParams;
299
+ p.delete("session_id"), p.delete("team"), history.pushState(null, "", n.toString());
300
+ } catch (n) {
301
+ o.showError(n?.message ?? "Error activating subscription, Please contact support");
286
302
  } finally {
287
- n.value = !1;
303
+ s.value = !1;
288
304
  }
289
305
  }
290
306
  async function S() {
291
- window.open(`${o.url}/one/manage`, "_blank");
307
+ window.open(`${i.url}/one/manage`, "_blank");
292
308
  }
293
- async function C(r, p) {
294
- n.value = !0;
295
- const b = new URL("/one/subscribe", o.url);
296
- b.searchParams.set("interval", r), b.searchParams.set("type", p), window.location.href = b.toString();
309
+ async function x(n, p) {
310
+ s.value = !0;
311
+ const b = new URL("/one/subscribe", i.url);
312
+ b.searchParams.set("interval", n), b.searchParams.set("type", p), window.location.href = b.toString();
297
313
  }
298
- async function x() {
314
+ async function C() {
299
315
  if (y.value)
300
316
  try {
301
- n.value = !0, await o.post(
317
+ s.value = !0, await i.post(
302
318
  `/one/cancel?subscriptionId=${y.value?.tierName}`
303
319
  ), await t.verify(!0);
304
- } catch (r) {
305
- a.showError(r?.message ?? "Error cancelling subscription, Please contact support");
320
+ } catch (n) {
321
+ o.showError(n?.message ?? "Error cancelling subscription, Please contact support");
306
322
  } finally {
307
- n.value = !1;
323
+ s.value = !1;
308
324
  }
309
325
  }
310
- async function P(r, p) {
326
+ async function P(n, p) {
311
327
  if (y.value)
312
328
  try {
313
- n.value = !0, await o.post("/one/modify", {
329
+ s.value = !0, await i.post("/one/modify", {
314
330
  subscriptionId: y.value.tierName,
315
- interval: r,
331
+ interval: n,
316
332
  type: p
317
333
  }), await t.verify(!0);
318
334
  } catch (b) {
319
- a.showError(b?.message ?? "Error modifying subscription");
335
+ o.showError(b?.message ?? "Error modifying subscription");
320
336
  } finally {
321
- n.value = !1;
337
+ s.value = !1;
322
338
  }
323
339
  }
324
340
  async function q() {
325
341
  try {
326
- n.value = !0;
327
- const r = await o.get("/one/info");
328
- return d.value = r.subscription, v.value = r.invoices, r;
329
- } catch (r) {
330
- a.showError(r?.message ?? "Error fetching subscription info");
342
+ s.value = !0;
343
+ const n = await i.get("/one/info");
344
+ return d.value = n.subscription, v.value = n.invoices, n;
345
+ } catch (n) {
346
+ o.showError(n?.message ?? "Error fetching subscription info");
331
347
  } finally {
332
- n.value = !1;
348
+ s.value = !1;
333
349
  }
334
350
  }
335
351
  function w() {
336
- s.push({
352
+ r.push({
337
353
  query: {
338
354
  ...e.value,
339
355
  one: void 0
@@ -349,67 +365,67 @@ const V = L("one", () => {
349
365
  sessionId: g,
350
366
  subscription: y,
351
367
  monthlyTotal: c,
352
- hasBilling: R,
353
- isLoading: n,
368
+ hasBilling: L,
369
+ isLoading: s,
354
370
  isOpen: u,
355
- isSubscriber: N,
371
+ isSubscriber: U,
356
372
  github: f,
357
373
  discord: l,
358
374
  shopify: $,
359
- one: i,
360
- activate: j,
361
- cancel: x,
375
+ one: a,
376
+ activate: R,
377
+ cancel: C,
362
378
  manage: S,
363
379
  modify: P,
364
380
  resetQuery: w,
365
- subscribe: C,
381
+ subscribe: x,
366
382
  subscriptionInfo: q
367
383
  };
368
- }), ee = L("team", () => {
369
- const e = Q(), s = B(), t = V(), o = H(), a = _(), n = U(!1), u = T(null), d = T(!1), v = m(() => e.value.invite), g = m(
384
+ }), ee = j("team", () => {
385
+ const e = Q(), r = B(), t = V(), i = J(), o = _(), s = N(!1), u = T(null), d = T(!1), v = m(() => e.value.invite), g = m(
370
386
  () => u.value ? t.access?.some((c) => ["one/team", "snips/team"].includes(c)) : !1
371
387
  );
372
388
  I(v, async () => {
373
389
  if (v.value) {
374
- s.user || (s.dialog = !0);
390
+ r.user || (r.dialog = !0);
375
391
  try {
376
- n.value = !0;
377
- const c = await o.get(`/one/team/${v.value}`);
392
+ s.value = !0;
393
+ const c = await i.get(`/one/team/${v.value}`);
378
394
  u.value = c.team, d.value = !0;
379
395
  } catch (c) {
380
- y(), a.showError(c.message);
396
+ y(), o.showError(c.message);
381
397
  } finally {
382
- n.value = !1;
398
+ s.value = !1;
383
399
  }
384
400
  }
385
401
  }, { immediate: !0 });
386
402
  async function A(c) {
387
403
  try {
388
- if (n.value = !0, !u.value)
404
+ if (s.value = !0, !u.value)
389
405
  return;
390
- await o.post("/one/team/remove", { userId: c }), u.value.members = u.value.members.filter((i) => i.id !== c);
391
- } catch (i) {
392
- a.showError(i?.message ?? "Error removing user from team");
406
+ await i.post("/one/team/remove", { userId: c }), u.value.members = u.value.members.filter((a) => a.id !== c);
407
+ } catch (a) {
408
+ o.showError(a?.message ?? "Error removing user from team");
393
409
  } finally {
394
- n.value = !1;
410
+ s.value = !1;
395
411
  }
396
412
  }
397
413
  async function h() {
398
414
  try {
399
- n.value = !0, await o.post("/one/team/leave", { teamId: u.value?.id }), await s.verify(!0);
415
+ s.value = !0, await i.post("/one/team/leave", { teamId: u.value?.id }), await r.verify(!0);
400
416
  } catch (c) {
401
- a.showError(c?.message ?? "Error leaving team");
417
+ o.showError(c?.message ?? "Error leaving team");
402
418
  } finally {
403
- n.value = !1;
419
+ s.value = !1;
404
420
  }
405
421
  }
406
422
  async function k() {
407
423
  try {
408
- n.value = !0, await o.post("/one/team/join", { inviteCode: v.value }), await s.verify(!0), y();
424
+ s.value = !0, await i.post("/one/team/join", { inviteCode: v.value }), await r.verify(!0), y();
409
425
  } catch (c) {
410
- a.showError(c?.message ?? "Error joining team");
426
+ o.showError(c?.message ?? "Error joining team");
411
427
  } finally {
412
- n.value = !1;
428
+ s.value = !1;
413
429
  }
414
430
  }
415
431
  function y() {
@@ -417,130 +433,130 @@ const V = L("one", () => {
417
433
  const c = new URL(window.location.href);
418
434
  c.searchParams.delete("invite"), window.history.replaceState({}, "", c.toString());
419
435
  }
420
- const R = m(() => s.user?.id === s.user?.team?.owner.id);
436
+ const L = m(() => r.user?.id === r.user?.team?.owner.id);
421
437
  return {
422
438
  team: u,
423
439
  teamInviteDialog: d,
424
440
  teamInviteCode: v,
425
441
  hasTeamAccess: g,
426
- isTeamOwner: R,
427
- isLoading: n,
442
+ isTeamOwner: L,
443
+ isLoading: s,
428
444
  removeFromTeam: A,
429
445
  leaveTeam: h,
430
446
  joinTeam: k,
431
447
  clearTeamQuery: y
432
448
  };
433
- }), B = L("auth", () => {
434
- const e = T(!1), s = T(null), t = H(), o = D(), a = J(), n = U(!1), u = V(), d = ee(), v = _();
449
+ }), B = j("auth", () => {
450
+ const e = T(!1), r = T(null), t = J(), i = D(), o = F(), s = N(!1), u = V(), d = ee(), v = _();
435
451
  let g = !!c();
436
- I(s, (i) => {
437
- if (!i?.settings)
452
+ I(r, (a) => {
453
+ if (!a?.settings)
438
454
  return;
439
455
  const f = localStorage.getItem("vuetify@user") || "{}";
440
- if (JSON.stringify(i.settings, null, 2) === f)
456
+ if (JSON.stringify(a.settings, null, 2) === f)
441
457
  return;
442
458
  g = !0;
443
- let l = i.settings;
444
- l.version === 6 && (l = F(l));
459
+ let l = a.settings;
460
+ l.version === 6 && (l = H(l));
445
461
  const $ = {
446
462
  version: 7,
447
463
  ecosystem: O(structuredClone(E.ecosystem), l.ecosystem || {}),
448
464
  one: O(structuredClone(E.one), l.one || {})
449
465
  };
450
- Object.assign(o, $);
451
- }), o.$subscribe(() => {
466
+ Object.assign(i, $);
467
+ }), i.$subscribe(() => {
452
468
  g || A(), g = !1;
453
469
  });
454
470
  async function A() {
455
- if (await X(), !(!s.value || !o.one.sync))
471
+ if (await X(), !(!r.value || !i.one.sync))
456
472
  try {
457
- await t.post("/user/settings", { settings: o.$state }), await h(!0);
458
- } catch (i) {
459
- v.showError(i?.message ?? "Error syncing settings");
473
+ await t.post("/user/settings", { settings: i.$state }), await h(!0);
474
+ } catch (a) {
475
+ v.showError(a?.message ?? "Error syncing settings");
460
476
  }
461
477
  }
462
- async function h(i = !1) {
478
+ async function h(a = !1) {
463
479
  if (h.promise)
464
480
  return h.promise;
465
- if (!i && !document.cookie.includes("sx=1") && location.hostname.match(/([^.]+\.[^.]+)$/)?.[1] === new URL(t.url).hostname.match(/([^.]+\.[^.]+)$/)?.[1]) {
466
- s.value = null;
481
+ if (!a && !document.cookie.includes("sx=1") && location.hostname.match(/([^.]+\.[^.]+)$/)?.[1] === new URL(t.url).hostname.match(/([^.]+\.[^.]+)$/)?.[1]) {
482
+ r.value = null;
467
483
  return;
468
484
  }
469
- n.value = !0, h.promise = fetch(`${t.url}/auth/verify`, {
485
+ s.value = !0, h.promise = fetch(`${t.url}/auth/verify`, {
470
486
  credentials: "include",
471
- cache: i ? "reload" : void 0
487
+ cache: a ? "reload" : void 0
472
488
  }).then(
473
489
  async (f) => {
474
490
  if (f.ok || f.status === 401) {
475
491
  const l = await f.json();
476
- s.value = l.user, u.access = l.access, d.team = l.user?.team;
492
+ r.value = l.user, u.access = l.access, d.team = l.user?.team;
477
493
  } else
478
494
  console.error(f.statusText);
479
495
  },
480
496
  () => {
481
497
  }
482
498
  ).finally(() => {
483
- n.value = !1, h.promise = null;
499
+ s.value = !1, h.promise = null;
484
500
  });
485
501
  }
486
502
  h.promise = null;
487
- async function k(i = "github") {
488
- n.value = !0;
489
- const f = `${t.url}/auth/${i}/redirect`;
490
- if (i === "shopify") {
503
+ async function k(a = "github") {
504
+ s.value = !0;
505
+ const f = `${t.url}/auth/${a}/redirect`;
506
+ if (a === "shopify") {
491
507
  window.location.assign(f + "?next=" + encodeURIComponent(window.location.href));
492
508
  return;
493
509
  }
494
- const l = 400, $ = 600, N = window.screenX + (window.innerWidth - l) / 2, j = window.screenY + (window.innerHeight - $) / 2, S = window.open(
510
+ const l = 400, $ = 600, U = window.screenX + (window.innerWidth - l) / 2, R = window.screenY + (window.innerHeight - $) / 2, S = window.open(
495
511
  "",
496
512
  "vuetify:authorize:popup",
497
- `popup,left=${N},top=${j},width=${l},height=${$},resizable`
513
+ `popup,left=${U},top=${R},width=${l},height=${$},resizable`
498
514
  );
499
515
  if (!S) {
500
516
  console.error("Failed to open popup");
501
517
  return;
502
518
  }
503
519
  S.location.href = f;
504
- let C = -1, x = -1;
520
+ let x = -1, C = -1;
505
521
  function P(w) {
506
- w.origin === t.url && w.data?.type === "auth-response" && (w.data.status === "success" ? (s.value || (localStorage.setItem("vuetify@lastLoginProvider", i), e.value = !1, a.push("/user/dashboard")), s.value = w.data.body.user, u.access = w.data.body.access, d.team = w.data.body.user?.team, A()) : console.error(w.data.message), q());
522
+ w.origin === t.url && w.data?.type === "auth-response" && (w.data.status === "success" ? (r.value || (localStorage.setItem("vuetify@lastLoginProvider", a), e.value = !1, o.push("/user/dashboard")), r.value = w.data.body.user, u.access = w.data.body.access, d.team = w.data.body.user?.team, A()) : console.error(w.data.message), q());
507
523
  }
508
524
  function q() {
509
- window.removeEventListener("message", P), window.clearInterval(C), window.clearTimeout(x), S?.close(), n.value = !1;
525
+ window.removeEventListener("message", P), window.clearInterval(x), window.clearTimeout(C), S?.close(), s.value = !1;
510
526
  }
511
- window.addEventListener("message", P), C = window.setInterval(() => {
527
+ window.addEventListener("message", P), x = window.setInterval(() => {
512
528
  !S || S.closed ? (console.error("Auth popup closed"), q()) : S.postMessage({ type: "auth-request" }, "*");
513
- }, 1e3), x = window.setTimeout(() => {
529
+ }, 1e3), C = window.setTimeout(() => {
514
530
  q(), console.error("Auth timed out");
515
531
  }, 120 * 1e3);
516
532
  }
517
- async function y(i) {
518
- n.value = !0;
519
- const f = i ? `/auth/${i}/logout` : "/auth/logout";
533
+ async function y(a) {
534
+ s.value = !0;
535
+ const f = a ? `/auth/${a}/logout` : "/auth/logout";
520
536
  try {
521
- await t.post(f), await h(!0), s.value = null;
537
+ await t.post(f), await h(!0), r.value = null;
522
538
  } catch (l) {
523
539
  v.showError(l?.message ?? "Error logging out");
524
540
  } finally {
525
- a.push({
541
+ o.push({
526
542
  path: "/",
527
- query: a.currentRoute.value.query
528
- }), n.value = !1;
543
+ query: o.currentRoute.value.query
544
+ }), s.value = !1;
529
545
  }
530
546
  }
531
- function R(i) {
532
- return s.value?.identities.find((f) => f.provider === i);
547
+ function L(a) {
548
+ return r.value?.identities.find((f) => f.provider === a);
533
549
  }
534
550
  function c() {
535
551
  return localStorage.getItem("vuetify@lastLoginProvider");
536
552
  }
537
553
  return h(), {
538
- user: s,
554
+ user: r,
539
555
  url: t.url,
540
556
  dialog: e,
541
- isLoading: n,
557
+ isLoading: s,
542
558
  verify: h,
543
- findIdentity: R,
559
+ findIdentity: L,
544
560
  login: k,
545
561
  logout: y,
546
562
  lastLoginProvider: c,
@@ -552,7 +568,7 @@ export {
552
568
  D as b,
553
569
  V as c,
554
570
  Q as d,
555
- H as e,
571
+ J as e,
556
572
  ee as f,
557
573
  _ as u
558
574
  };
package/dist/index.d.ts CHANGED
@@ -995,8 +995,9 @@ interface QueueState {
995
995
  queue: Ref<Snackbar[]>;
996
996
  show: (text: Snackbar) => void;
997
997
  showError: (text: Snackbar) => void;
998
+ showSuccess: (text: Snackbar) => void;
998
999
  }
999
- declare const useQueueStore: pinia.StoreDefinition<"queue", Pick<QueueState, "queue">, Pick<QueueState, never>, Pick<QueueState, "show" | "showError">>;
1000
+ declare const useQueueStore: pinia.StoreDefinition<"queue", Pick<QueueState, "queue">, Pick<QueueState, never>, Pick<QueueState, "show" | "showError" | "showSuccess">>;
1000
1001
 
1001
1002
  interface VOneSuit {
1002
1003
  'app-bar': string;
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as y, createBlock as m, openBlock as c, unref as e, computed as b, createSlots as z, withCtx as s, createElementVNode as g, toDisplayString as C, createVNode as n, createTextVNode as S, normalizeStyle as it, createCommentVNode as h, renderSlot as w, shallowRef as M, watch as H, withModifiers as ye, mergeModels as rt, useModel as W, createElementBlock as k, Fragment as D, nextTick as be, renderList as G, mergeProps as R, withDirectives as N, vShow as Ie, isRef as j, ref as E, readonly as Se, resolveComponent as lt, watchEffect as Nt, onMounted as He, toRef as ge, normalizeClass as Zt, useSlots as ut, normalizeProps as ct, guardReactiveProps as dt, onBeforeMount as je, onBeforeUnmount as Ht, useCssVars as jt, onServerPrefetch as Rt } from "vue";
2
- import { u as oe, a as F, b as T, c as O, d as ke, e as J, f as De } from "./auth-QWWxnYQv.js";
2
+ import { u as oe, a as F, b as T, c as O, d as ke, e as J, f as De } from "./auth-CwLSOnno.js";
3
3
  import { VSnackbarQueue as qt } from "vuetify/components/VSnackbarQueue";
4
4
  import { mdiStorefront as Wt, mdiSync as Gt, mdiSyncOff as Kt, mdiLogoutVariant as Yt, mdiFullscreenExit as Qt, mdiFullscreen as Xt, mdiCheck as Ve, mdiSelect as Jt, mdiSpaceInvaders as pt, mdiImageFilterHdr as mt, mdiTransmissionTower as ft, mdiRocketLaunchOutline as vt, mdiHome as eo, mdiTextBox as to, mdiWhiteBalanceSunny as oo, mdiWeatherNight as no, mdiDesktopTowerMonitor as so, mdiContrastCircle as ao, mdiCog as io, mdiCogOutline as ro, mdiShieldKeyOutline as lo, mdiContentCopy as Re, mdiFileDocument as gt, mdiKey as uo, mdiPlus as co, mdiRefresh as po, mdiKeyOutline as mo, mdiCreditCardSettingsOutline as fo, mdiRocketOutline as vo, mdiCheckCircleOutline as Me, mdiCreditCard as go, mdiReload as _o, mdiPlaylistCheck as yo, mdiCreditCardOutline as ho, mdiOpenInNew as Ae, mdiMedal as bo, mdiHandHeart as ko, mdiHandHeartOutline as Vo, mdiCloudDownload as Co, mdiTrayArrowDown as tt, mdiAccountGroup as $o, mdiAccount as xo, mdiLinkVariant as Lo, mdiShieldLock as ot, mdiAccountRemoveOutline as wo, mdiExitToApp as So, mdiAccountGroupOutline as Mo, mdiPin as Io, mdiPinOutline as Do, mdiEmailOpenOutline as qe, mdiEmailVariant as We, mdiBell as Ao, mdiInboxOutline as To, mdiInboxFullOutline as Uo, mdiBillboard as Po, mdiBellOutline as zo, mdiViewDashboardOutline as Oo, mdiCrown as Bo, mdiArrowULeftBottom as Eo, mdiAtomVariant as Fo, mdiLogin as nt, mdiDotsVertical as No, mdiShieldStarOutline as Zo } from "@mdi/js";
5
5
  import { VListItem as le, VList as ne, VListSubheader as Ho, VListItemTitle as _t, VListItemSubtitle as jo } from "vuetify/components/VList";
@@ -1,5 +1,5 @@
1
1
  import "lodash-es";
2
- import { a as e } from "../auth-QWWxnYQv.js";
2
+ import { a as e } from "../auth-CwLSOnno.js";
3
3
  import "pinia";
4
4
  import "vue";
5
5
  import "vue-router";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuetify/one",
3
- "version": "2.8.1",
3
+ "version": "2.8.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "license": "MIT",