@vuetify/one 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,44 +1,51 @@
1
- import { reactive as Z, toRefs as K, ref as j, shallowRef as T, computed as D, watch as F, defineComponent as L, openBlock as g, createBlock as y, unref as a, withCtx as p, createVNode as d, createTextVNode as w, toDisplayString as $, createCommentVNode as Q, mergeProps as tt, createElementVNode as _, createElementBlock as et, Fragment as ot, renderList as st, pushScopeId as nt, popScopeId as it, onBeforeMount as rt } from "vue";
2
- import { defineStore as x } from "pinia";
3
- import { merge as I } from "lodash-es";
4
- import { mdiDiscord as P, mdiGithub as E, mdiViewDashboard as at, mdiLogoutVariant as lt, mdiLogin as ct, mdiShieldStarOutline as ut, mdiReddit as ft } from "@mdi/js";
5
- import { VListItem as G, VList as M, VListSubheader as dt } from "vuetify/lib/components/VList/index.mjs";
6
- import { VAvatar as pt } from "vuetify/lib/components/VAvatar/index.mjs";
7
- import { VBtn as J } from "vuetify/lib/components/VBtn/index.mjs";
8
- import { VMenu as mt } from "vuetify/lib/components/VMenu/index.mjs";
9
- import { VSkeletonLoader as ht } from "vuetify/lib/components/VSkeletonLoader/index.mjs";
10
- import { useDisplay as vt, useTheme as gt } from "vuetify";
11
- import { VCard as yt, VCardTitle as bt, VCardSubtitle as _t } from "vuetify/lib/components/VCard/index.mjs";
12
- import { VDialog as wt } from "vuetify/lib/components/VDialog/index.mjs";
13
- import { VImg as W } from "vuetify/lib/components/VImg/index.mjs";
14
- import { VFooter as Lt } from "vuetify/lib/components/VFooter/index.mjs";
15
- import { VIcon as xt } from "vuetify/lib/components/VIcon/index.mjs";
16
- const C = x("http", {
1
+ import { reactive as Y, toRefs as Z, ref as O, shallowRef as T, computed as x, watch as H, defineComponent as V, openBlock as h, createBlock as b, unref as l, withCtx as f, createVNode as d, createTextVNode as S, toDisplayString as B, createCommentVNode as K, mergeProps as Q, createElementVNode as k, createElementBlock as ee, Fragment as te, renderList as oe, pushScopeId as se, popScopeId as ne, onBeforeMount as ie } from "vue";
2
+ import { defineStore as $ } from "pinia";
3
+ import { merge as D } from "lodash-es";
4
+ import { mdiDiscord as M, mdiGithub as G, mdiViewDashboard as re, mdiLogoutVariant as ae, mdiLogin as le, mdiShieldStarOutline as ce, mdiReddit as ue } from "@mdi/js";
5
+ import { VListItem as z, VList as J, VListSubheader as de } from "vuetify/lib/components/VList/index.mjs";
6
+ import { VAvatar as fe } from "vuetify/lib/components/VAvatar/index.mjs";
7
+ import { VBtn as W } from "vuetify/lib/components/VBtn/index.mjs";
8
+ import { VMenu as pe } from "vuetify/lib/components/VMenu/index.mjs";
9
+ import { VSkeletonLoader as me } from "vuetify/lib/components/VSkeletonLoader/index.mjs";
10
+ import { useDisplay as ve, useTheme as he } from "vuetify";
11
+ import { VCard as ye, VCardTitle as ge, VCardSubtitle as be } from "vuetify/lib/components/VCard/index.mjs";
12
+ import { VDialog as _e } from "vuetify/lib/components/VDialog/index.mjs";
13
+ import { VImg as we } from "vuetify/lib/components/VImg/index.mjs";
14
+ import { VFooter as Le } from "vuetify/lib/components/VFooter/index.mjs";
15
+ import { VIcon as xe } from "vuetify/lib/components/VIcon/index.mjs";
16
+ const N = $("http", {
17
17
  state: () => ({
18
18
  url: ""
19
19
  }),
20
20
  actions: {
21
- async fetch(o, e = {}) {
22
- return (await fetch(`${this.url}${o}`, {
21
+ async fetch(o, t = {}) {
22
+ const s = await fetch(`${this.url}${o}`, {
23
23
  credentials: "include",
24
- ...e
25
- })).json();
24
+ ...t
25
+ });
26
+ return s.status === 204 ? s : s.json();
26
27
  },
27
- async post(o, e, s = {}) {
28
+ async post(o, t, s = {}) {
28
29
  return this.fetch(o, {
29
30
  method: "POST",
30
31
  headers: {
31
32
  "Content-Type": "application/json"
32
33
  },
33
- body: JSON.stringify(e),
34
+ body: JSON.stringify(t),
34
35
  ...s
35
36
  });
36
37
  },
37
- async get(o, e = {}) {
38
- return this.fetch(o, e);
38
+ async get(o, t = {}) {
39
+ return this.fetch(o, t);
40
+ },
41
+ async delete(o, t = {}) {
42
+ return this.fetch(o, {
43
+ method: "DELETE",
44
+ ...t
45
+ });
39
46
  }
40
47
  }
41
- }), A = typeof window < "u", R = {
48
+ }), C = typeof window < "u", P = {
42
49
  v: 4,
43
50
  api: "link-only",
44
51
  avatar: "",
@@ -65,267 +72,273 @@ const C = x("http", {
65
72
  jobs: null
66
73
  }
67
74
  }
68
- }, q = x("user", () => {
69
- const o = Z(I({}, R));
70
- function e() {
71
- if (!A)
75
+ }, q = $("user", () => {
76
+ const o = Y(D({}, P));
77
+ function t() {
78
+ if (!C)
72
79
  return;
73
- const r = localStorage.getItem("vuetify@user"), t = r ? JSON.parse(r) : {}, h = t.v === o.v;
74
- t.v || (t.pwaRefresh = !0, typeof t.api == "boolean" && (t.api = t.api ? "inline" : "link-only"), typeof t.rtl == "boolean" && (t.direction = t.rtl ? "rtl" : "ltr", delete t.rtl), typeof t.theme == "object" && (t.mixedTheme = t.theme.mixed, t.theme = t.theme.system ? "system" : t.theme.dark ? "dark" : "light"), Array.isArray(t.notifications) && (t.notifications = { read: t.notifications }), typeof t.last == "object" && (t.notifications.last = t.last, delete t.last)), t.v === 1 && (Array.isArray(t.composition) && (t.composition = "composition"), Array.isArray(t.notifications.last.banner) || (t.notifications = t.notifications || {}, t.notifications.last = t.notifications.last || {}, t.notifications.last.banner = [])), t.v === 2 && (t.syncSettings = !0, t.disableAds = !1, t.v = 3), t.v === 3 && (t.quickbar = !1), t.v = o.v, Object.assign(o, I(o, t)), h && s();
80
+ const a = localStorage.getItem("vuetify@user"), e = a ? JSON.parse(a) : {}, p = e.v === o.v;
81
+ 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.last = e.last, delete e.last)), e.v === 1 && (Array.isArray(e.composition) && (e.composition = "composition"), Array.isArray(e.notifications.last.banner) || (e.notifications = e.notifications || {}, e.notifications.last = e.notifications.last || {}, e.notifications.last.banner = [])), e.v === 2 && (e.syncSettings = !0, e.disableAds = !1, e.v = 3), e.v === 3 && (e.quickbar = !1), e.v = o.v, Object.assign(o, D(o, e)), p && s();
75
82
  }
76
83
  function s() {
77
- A && localStorage.setItem("vuetify@user", JSON.stringify(o, null, 2));
84
+ C && localStorage.setItem("vuetify@user", JSON.stringify(o, null, 2));
78
85
  }
79
- function i() {
80
- A && (Object.assign(o, I({}, R)), s());
86
+ function n() {
87
+ C && (Object.assign(o, D({}, P)), s());
81
88
  }
82
- return e(), {
83
- ...K(o),
84
- load: e,
89
+ return t(), {
90
+ ...Z(o),
91
+ load: t,
85
92
  save: s,
86
- reset: i
93
+ reset: n
87
94
  };
88
- }), V = x("auth", () => {
89
- const o = j(null), e = C(), s = q(), i = T(!1), r = D(() => {
90
- var n, l;
91
- return !e.url || ((n = o.value) == null ? void 0 : n.isAdmin) || ((l = o.value) == null ? void 0 : l.sponsorships.some((S) => S.isActive));
95
+ }), w = $("auth", () => {
96
+ const o = O(null), t = N(), s = q(), n = T(!1), a = x(() => {
97
+ var i, r;
98
+ return !t.url || ((i = o.value) == null ? void 0 : i.isAdmin) || ((r = o.value) == null ? void 0 : r.sponsorships.some((c) => c.isActive));
92
99
  });
93
- let t = !1;
94
- F(o, (n) => {
95
- if (!(n != null && n.settings))
100
+ let e = !1;
101
+ H(o, (i) => {
102
+ if (!(i != null && i.settings))
96
103
  return;
97
- const l = localStorage.getItem("vuetify@user") || "{}";
98
- JSON.stringify(n.settings, null, 2) !== l && (t = !0, Object.assign(s, n.settings));
104
+ const r = localStorage.getItem("vuetify@user") || "{}";
105
+ JSON.stringify(i.settings, null, 2) !== r && (e = !0, Object.assign(s, i.settings));
99
106
  }), s.$subscribe(() => {
100
- t || h(), t = !1;
107
+ e || p(), e = !1;
101
108
  });
102
- async function h() {
109
+ async function p() {
103
110
  try {
104
- await e.post("/user/settings", { settings: s.$state });
105
- } catch (n) {
106
- console.error(n);
111
+ await t.post("/user/settings", { settings: s.$state });
112
+ } catch (i) {
113
+ console.error(i);
107
114
  }
108
115
  }
109
- async function c(n = !1) {
110
- if (c.promise)
111
- return c.promise;
112
- i.value = !0, c.promise = fetch(`${e.url}/auth/verify`, {
116
+ async function u(i = !1) {
117
+ if (u.promise)
118
+ return u.promise;
119
+ n.value = !0, u.promise = fetch(`${t.url}/auth/verify`, {
113
120
  credentials: "include",
114
- headers: n ? {
121
+ headers: i ? {
115
122
  "Cache-Control": "no-cache"
116
123
  } : void 0
117
124
  }).then(
118
- async (l) => {
119
- l.ok ? o.value = (await l.json()).user : l.status === 401 ? o.value = null : console.error(l.statusText);
125
+ async (r) => {
126
+ r.ok ? o.value = (await r.json()).user : r.status === 401 ? o.value = null : console.error(r.statusText);
120
127
  },
121
128
  () => {
122
129
  }
123
130
  ).finally(() => {
124
- i.value = !1, c.promise = null;
131
+ n.value = !1, u.promise = null;
125
132
  });
126
133
  }
127
- c.promise = null;
128
- async function f(n = "github") {
129
- i.value = !0;
130
- const l = `${e.url}/auth/${n}/redirect`, S = 400, O = 600, X = window.screenX + (window.innerWidth - S) / 2, Y = window.screenY + (window.innerHeight - O) / 2, v = window.open(
134
+ u.promise = null;
135
+ async function _(i = "github") {
136
+ n.value = !0;
137
+ const r = `${t.url}/auth/${i}/redirect`, c = 400, m = 600, I = window.screenX + (window.innerWidth - c) / 2, A = window.screenY + (window.innerHeight - m) / 2, v = window.open(
131
138
  "",
132
139
  "vuetify:authorize:popup",
133
- `popup,left=${X},top=${Y},width=${S},height=${O},resizable`
140
+ `popup,left=${I},top=${A},width=${c},height=${m},resizable`
134
141
  );
135
142
  if (!v) {
136
143
  console.error("Failed to open popup");
137
144
  return;
138
145
  }
139
- v.location.href = l;
140
- let H = -1, B = -1;
141
- function N(b) {
142
- var U;
143
- b.origin === e.url && ((U = b.data) == null ? void 0 : U.type) === "auth-response" && (b.data.status === "success" ? (o.value || localStorage.setItem("vuetify@lastLoginProvider", n), o.value = b.data.body.user) : console.error(b.data.message), k());
146
+ v.location.href = r;
147
+ let U = -1, R = -1;
148
+ function E(L) {
149
+ var F;
150
+ L.origin === t.url && ((F = L.data) == null ? void 0 : F.type) === "auth-response" && (L.data.status === "success" ? (o.value || localStorage.setItem("vuetify@lastLoginProvider", i), o.value = L.data.body.user) : console.error(L.data.message), j());
144
151
  }
145
- function k() {
146
- window.removeEventListener("message", N), window.clearInterval(H), window.clearTimeout(B), v == null || v.close(), i.value = !1;
152
+ function j() {
153
+ window.removeEventListener("message", E), window.clearInterval(U), window.clearTimeout(R), v == null || v.close(), n.value = !1;
147
154
  }
148
- window.addEventListener("message", N), H = window.setInterval(() => {
149
- !v || v.closed ? (console.error("Auth popup closed"), k()) : v.postMessage({ type: "auth-request" }, "*");
150
- }, 1e3), B = window.setTimeout(() => {
151
- k(), console.error("Auth timed out");
155
+ window.addEventListener("message", E), U = window.setInterval(() => {
156
+ !v || v.closed ? (console.error("Auth popup closed"), j()) : v.postMessage({ type: "auth-request" }, "*");
157
+ }, 1e3), R = window.setTimeout(() => {
158
+ j(), console.error("Auth timed out");
152
159
  }, 120 * 1e3);
153
160
  }
154
- async function u() {
155
- i.value = !0;
161
+ async function y() {
162
+ n.value = !0;
156
163
  try {
157
- await e.post("/auth/logout"), await c(!0), o.value = null;
158
- } catch (n) {
159
- console.error(n);
164
+ await t.post("/auth/logout"), await u(!0), o.value = null;
165
+ } catch (i) {
166
+ console.error(i);
160
167
  } finally {
161
- i.value = !1;
168
+ n.value = !1;
162
169
  }
163
170
  }
164
- function m() {
171
+ function g() {
165
172
  return localStorage.getItem("vuetify@lastLoginProvider");
166
173
  }
167
- return m() && c(), {
174
+ return g() && u(), {
168
175
  user: o,
169
- url: e.url,
170
- isLoading: i,
171
- verify: c,
172
- login: f,
173
- logout: u,
174
- isSubscriber: r,
175
- lastLoginProvider: m
176
+ url: t.url,
177
+ isLoading: n,
178
+ verify: u,
179
+ login: _,
180
+ logout: y,
181
+ isSubscriber: a,
182
+ lastLoginProvider: g
176
183
  };
177
- }), Vt = /* @__PURE__ */ L({
184
+ }), Ve = /* @__PURE__ */ V({
178
185
  __name: "VoDiscordLogin",
179
186
  setup(o) {
180
- const e = V();
181
- return (s, i) => (g(), y(G, {
182
- "prepend-icon": `svg:${a(P)}`,
183
- title: a(e).user ? "Connect Discord" : "Log in with Discord",
184
- subtitle: !a(e).user && a(e).lastLoginProvider() === "discord" ? "Last Used" : "",
187
+ const t = w();
188
+ return (s, n) => (h(), b(z, {
189
+ "prepend-icon": `svg:${l(M)}`,
190
+ title: l(t).user ? "Connect Discord" : "Log in with Discord",
191
+ subtitle: !l(t).user && l(t).lastLoginProvider() === "discord" ? "Last Used" : "",
185
192
  nav: "",
186
193
  "base-color": "#5865F2",
187
194
  slim: "",
188
195
  variant: "flat",
189
- onClick: i[0] || (i[0] = (r) => a(e).login("discord"))
196
+ onClick: n[0] || (n[0] = (a) => l(t).login("discord"))
190
197
  }, null, 8, ["prepend-icon", "title", "subtitle"]));
191
198
  }
192
- }), St = /* @__PURE__ */ L({
199
+ }), $e = /* @__PURE__ */ V({
193
200
  __name: "VoGithubLogin",
194
201
  setup(o) {
195
- const e = V();
196
- return (s, i) => (g(), y(G, {
197
- "prepend-icon": `svg:${a(E)}`,
198
- title: a(e).user ? "Connect GitHub" : "Log in with GitHub",
199
- subtitle: !a(e).user && a(e).lastLoginProvider() === "github" ? "Last Used" : "",
202
+ const t = w();
203
+ return (s, n) => (h(), b(z, {
204
+ "prepend-icon": `svg:${l(G)}`,
205
+ title: l(t).user ? "Connect GitHub" : "Log in with GitHub",
206
+ subtitle: !l(t).user && l(t).lastLoginProvider() === "github" ? "Last Used" : "",
200
207
  "base-color": "#2a2a2a",
201
208
  nav: "",
202
209
  slim: "",
203
210
  variant: "flat",
204
- onClick: i[0] || (i[0] = (r) => a(e).login("github"))
211
+ onClick: n[0] || (n[0] = (a) => l(t).login("github"))
205
212
  }, null, 8, ["prepend-icon", "title", "subtitle"]));
206
213
  }
207
- }), $t = /* @__PURE__ */ L({
214
+ }), Se = /* @__PURE__ */ V({
208
215
  __name: "VoUserBtn",
209
216
  props: {
210
217
  external: Boolean
211
218
  },
212
219
  setup(o) {
213
- const e = o, s = V(), i = q(), r = [
220
+ const t = o, s = w(), n = q(), a = x(() => [
214
221
  { title: "Options", type: "subheader" },
215
222
  {
216
223
  title: "My Dashboard",
217
- appendIcon: `svg:${at}`,
218
- to: e.external ? void 0 : "/user/dashboard",
219
- href: e.external ? "https://vuetifyjs.com/user/dashboard/" : void 0,
220
- target: e.external ? "_blank" : void 0
224
+ appendIcon: `svg:${re}`,
225
+ to: t.external ? void 0 : "/user/dashboard",
226
+ href: t.external ? "https://vuetifyjs.com/user/dashboard/" : void 0,
227
+ target: t.external ? "_blank" : void 0
228
+ },
229
+ {
230
+ title: "My Subscriptions",
231
+ appendIcon: "$vuetify",
232
+ href: "https://vuetifyjs.com/user/subscriptions/",
233
+ target: "_blank"
221
234
  },
222
235
  {
223
236
  title: "Logout",
224
- appendIcon: `svg:${lt}`,
237
+ appendIcon: `svg:${ae}`,
225
238
  onClick: () => {
226
239
  s.logout();
227
240
  }
228
241
  }
229
- ];
230
- return (t, h) => (g(), y(J, {
242
+ ]);
243
+ return (e, p) => (h(), b(W, {
231
244
  class: "vo-user-btn",
232
- loading: a(s).isLoading,
245
+ loading: l(s).isLoading,
233
246
  icon: ""
234
247
  }, {
235
- loader: p(() => [
236
- d(ht, { type: "avatar" })
248
+ loader: f(() => [
249
+ d(me, { type: "avatar" })
237
250
  ]),
238
- default: p(() => [
239
- d(mt, {
240
- disabled: !a(s).user || a(s).isLoading,
251
+ default: f(() => [
252
+ d(pe, {
253
+ disabled: !l(s).user || l(s).isLoading,
241
254
  activator: "parent",
242
255
  location: "bottom end"
243
256
  }, {
244
- default: p(() => [
245
- d(M, {
246
- items: r,
257
+ default: f(() => [
258
+ d(J, {
259
+ items: a.value,
247
260
  lines: !1,
248
261
  density: "compact",
249
262
  "item-props": "",
250
263
  nav: ""
251
264
  }, {
252
- subheader: p(({ props: c }) => [
253
- d(dt, { class: "text-high-emphasis text-uppercase font-weight-black" }, {
254
- default: p(() => [
255
- w($(c.title), 1)
265
+ subheader: f(({ props: u }) => [
266
+ d(de, { class: "text-high-emphasis text-uppercase font-weight-black" }, {
267
+ default: f(() => [
268
+ S(B(u.title), 1)
256
269
  ]),
257
270
  _: 2
258
271
  }, 1024)
259
272
  ]),
260
273
  _: 1
261
- })
274
+ }, 8, ["items"])
262
275
  ]),
263
276
  _: 1
264
277
  }, 8, ["disabled"]),
265
- a(s).user ? (g(), y(pt, {
278
+ l(s).user ? (h(), b(fe, {
266
279
  key: 0,
267
- image: a(i).avatar || a(s).user.picture || ""
268
- }, null, 8, ["image"])) : Q("", !0)
280
+ image: l(n).avatar || l(s).user.picture || ""
281
+ }, null, 8, ["image"])) : K("", !0)
269
282
  ]),
270
283
  _: 1
271
284
  }, 8, ["loading"]));
272
285
  }
273
286
  });
274
- const z = (o, e) => {
287
+ const X = (o, t) => {
275
288
  const s = o.__vccOpts || o;
276
- for (const [i, r] of e)
277
- s[i] = r;
289
+ for (const [n, a] of t)
290
+ s[n] = a;
278
291
  return s;
279
- }, kt = /* @__PURE__ */ z($t, [["__scopeId", "data-v-8e6fff6f"]]), It = { class: "text-center mb-6" }, At = /* @__PURE__ */ L({
292
+ }, ke = /* @__PURE__ */ X(Se, [["__scopeId", "data-v-aeb16535"]]), Ie = { class: "text-center mb-6" }, Ae = /* @__PURE__ */ V({
280
293
  __name: "VoAuthDialog",
281
294
  setup(o) {
282
- const e = V(), { mdAndDown: s, lgAndUp: i } = vt(), r = gt();
283
- return (t, h) => !a(e).user && !a(e).isLoading ? (g(), y(wt, {
295
+ const t = w(), { mdAndDown: s, lgAndUp: n } = ve(), a = he();
296
+ return (e, p) => !l(t).user && !l(t).isLoading ? (h(), b(_e, {
284
297
  key: 0,
285
298
  "max-width": "480"
286
299
  }, {
287
- activator: p(({ props: c }) => [
288
- d(J, tt({
289
- ...c,
290
- [`${a(i) ? "append-" : ""}icon`]: `svg:${a(ct)}`,
291
- text: a(i) ? "Login" : void 0
300
+ activator: f(({ props: u }) => [
301
+ d(W, Q({
302
+ ...u,
303
+ [`${l(n) ? "append-" : ""}icon`]: `svg:${l(le)}`,
304
+ text: l(n) ? "Login" : void 0
292
305
  }, {
293
- rounded: a(s),
306
+ rounded: l(s),
294
307
  class: "text-none",
295
308
  color: "primary",
296
309
  variant: "outlined"
297
310
  }), null, 16, ["rounded"])
298
311
  ]),
299
- default: p(() => [
300
- d(yt, { class: "pt-6 pb-1 pb-sm-4 px-4 px-sm-8" }, {
301
- default: p(() => [
302
- d(W, {
303
- src: `https://cdn.vuetifyjs.com/docs/images/logos/vuetify-logo-v3-slim-text-${a(r).name.value}.svg`,
312
+ default: f(() => [
313
+ d(ye, { class: "pt-6 pb-1 pb-sm-4 px-4 px-sm-8" }, {
314
+ default: f(() => [
315
+ d(we, {
316
+ src: `https://cdn.vuetifyjs.com/docs/images/logos/vuetify-logo-v3-slim-text-${l(a).name.value}.svg`,
304
317
  class: "mb-4",
305
318
  height: "30"
306
319
  }, null, 8, ["src"]),
307
- _("div", It, [
308
- d(bt, { class: "text-h5 mb-1 text-md-h4 font-weight-bold" }, {
309
- default: p(() => [
310
- w($(a(e).lastLoginProvider() ? "Welcome Back" : "Log in to Vuetify"), 1)
320
+ k("div", Ie, [
321
+ d(ge, { class: "text-h5 mb-1 text-md-h4 font-weight-bold" }, {
322
+ default: f(() => [
323
+ S(B(l(t).lastLoginProvider() ? "Welcome Back" : "Log in to Vuetify"), 1)
311
324
  ]),
312
325
  _: 1
313
326
  }),
314
- d(_t, { class: "text-wrap" }, {
315
- default: p(() => [
316
- w(" Sign in with GitHub or Discord to save your settings and unlock exclusive subscriber perks. ")
327
+ d(be, { class: "text-wrap" }, {
328
+ default: f(() => [
329
+ S(" Sign in with GitHub or Discord to save your settings and unlock exclusive subscriber perks. ")
317
330
  ]),
318
331
  _: 1
319
332
  })
320
333
  ]),
321
- d(M, {
334
+ d(J, {
322
335
  class: "mx-auto",
323
336
  "max-width": "300",
324
337
  width: "100%"
325
338
  }, {
326
- default: p(() => [
327
- d(St, { class: "mb-3" }),
328
- d(Vt)
339
+ default: f(() => [
340
+ d($e, { class: "mb-3" }),
341
+ d(Ve)
329
342
  ]),
330
343
  _: 1
331
344
  })
@@ -334,24 +347,23 @@ const z = (o, e) => {
334
347
  })
335
348
  ]),
336
349
  _: 1
337
- })) : (g(), y(kt, { key: 1 }));
350
+ })) : (h(), b(ke, { key: 1 }));
338
351
  }
339
- }), jt = (o) => (nt("data-v-6f6b85b8"), o = o(), it(), o), Dt = {
340
- class: "d-inline-block me-2 text-decoration-none text-primary",
341
- href: "https://vuetifyjs.com/",
342
- target: "_blank",
343
- title: "Vuetify Documentation",
344
- rel: "noopener noreferrer"
345
- }, Ct = ["href", "title"], Ot = {
346
- class: "text-caption",
352
+ }), je = (o) => (se("data-v-b66944c0"), o = o(), ne(), o), De = ["href", "title"], Ce = {
353
+ class: "text-caption text-disabled",
347
354
  style: { position: "absolute", right: "16px" }
348
- }, Ht = /* @__PURE__ */ jt(() => /* @__PURE__ */ _("span", { class: "d-none d-sm-inline-block" }, "Vuetify, LLC", -1)), Bt = /* @__PURE__ */ L({
355
+ }, Oe = /* @__PURE__ */ je(() => /* @__PURE__ */ k("span", { class: "d-none d-sm-inline-block" }, "Vuetify, LLC", -1)), Te = /* @__PURE__ */ V({
349
356
  __name: "VoFooter",
350
357
  setup(o) {
351
- const e = [
358
+ const t = [
359
+ {
360
+ title: "Vuetify Documentation",
361
+ icon: "$vuetify",
362
+ href: "https://vuetifyjs.com/"
363
+ },
352
364
  {
353
365
  title: "Vuetify Support",
354
- icon: `svg:${ut}`,
366
+ icon: `svg:${ce}`,
355
367
  href: "https://support.vuetifyjs.com/"
356
368
  },
357
369
  {
@@ -361,163 +373,169 @@ const z = (o, e) => {
361
373
  },
362
374
  {
363
375
  title: "Vuetify GitHub",
364
- icon: `svg:${E}`,
376
+ icon: `svg:${G}`,
365
377
  href: "https://github.com/vuetifyjs/vuetify"
366
378
  },
367
379
  {
368
380
  title: "Vuetify Discord",
369
- icon: `svg:${P}`,
381
+ icon: `svg:${M}`,
370
382
  href: "https://community.vuetifyjs.com/"
371
383
  },
372
384
  {
373
385
  title: "Vuetify Reddit",
374
- icon: `svg:${ft}`,
386
+ icon: `svg:${ue}`,
375
387
  href: "https://reddit.com/r/vuetifyjs"
376
388
  }
377
389
  ];
378
- return (s, i) => (g(), y(Lt, {
390
+ return (s, n) => (h(), b(Le, {
379
391
  class: "vo-footer",
380
392
  theme: "dark",
381
393
  height: "40"
382
394
  }, {
383
- default: p(() => [
384
- _("a", Dt, [
385
- d(W, {
386
- alt: "Vuetify logo",
387
- src: "https://cdn.vuetifyjs.com/docs/images/logos/v.svg",
388
- width: "32"
389
- })
390
- ]),
391
- (g(), et(ot, null, st(e, (r) => _("a", {
392
- key: r.title,
393
- href: r.href,
394
- title: r.title,
395
+ default: f(() => [
396
+ (h(), ee(te, null, oe(t, (a) => k("a", {
397
+ key: a.title,
398
+ href: a.href,
399
+ title: a.title,
395
400
  class: "d-inline-block mx-2 social-link",
396
401
  target: "_blank",
397
402
  rel: "noopener noreferrer"
398
403
  }, [
399
- d(xt, { size: "18" }, {
400
- default: p(() => [
401
- w($(r.icon), 1)
402
- ]),
403
- _: 2
404
- }, 1024)
405
- ], 8, Ct)), 64)),
406
- _("div", Ot, [
407
- w(" © 2016-" + $((/* @__PURE__ */ new Date()).getFullYear()) + " ", 1),
408
- Ht
404
+ d(xe, {
405
+ icon: a.icon,
406
+ size: a.icon === "$vuetify" ? 24 : 16
407
+ }, null, 8, ["icon", "size"])
408
+ ], 8, De)), 64)),
409
+ k("div", Ce, [
410
+ S(" © 2016-" + B((/* @__PURE__ */ new Date()).getFullYear()) + " ", 1),
411
+ Oe
409
412
  ])
410
413
  ]),
411
414
  _: 1
412
415
  }));
413
416
  }
414
417
  });
415
- const Nt = /* @__PURE__ */ z(Bt, [["__scopeId", "data-v-6f6b85b8"]]), Kt = x("bins", () => {
416
- const o = C(), e = j([]), s = j();
417
- async function i() {
418
- const f = await o.get("/one/bins");
419
- e.value = f.bins;
418
+ const He = /* @__PURE__ */ X(Te, [["__scopeId", "data-v-b66944c0"]]), Ze = $("bins", () => {
419
+ const o = w(), t = N(), s = O([]), n = O(), a = T(-1), e = x(() => !o.user || !n.value ? !1 : o.user.id === n.value.owner.id);
420
+ H(() => n, () => {
421
+ window.clearTimeout(a.value), a.value = window.setTimeout(() => {
422
+ !n.value || !e.value || y(n.value, n.value.id);
423
+ }, 100);
424
+ }, { deep: !0 });
425
+ async function p() {
426
+ const r = await t.get("/one/bins");
427
+ return s.value = r.bins, r.bins;
420
428
  }
421
- async function r(f) {
422
- const u = await o.post("/one/bins", { bin: f });
423
- return e.value.push(u.bin), s.value = u.bin, u;
429
+ async function u(r) {
430
+ const c = await t.delete(`/one/bins/${r}`);
431
+ return s.value = s.value.filter((m) => m.id !== r), c;
424
432
  }
425
- async function t(f, u) {
426
- const m = await o.post(`/one/bins/${u}`, { bin: f }), n = e.value.findIndex((l) => l.id === u);
427
- return e.value.splice(n, 1, m.bin), s.value = m.bin, m;
433
+ async function _(r) {
434
+ const c = await t.post("/one/bins", { bin: r });
435
+ return s.value.push(c.bin), n.value = c.bin, c;
428
436
  }
429
- async function h(f, u) {
430
- const m = u ? await t(f, u) : await r(f);
431
- return s.value = m.bin, m;
437
+ async function y(r, c) {
438
+ const m = await t.post(`/one/bins/${c}`, { bin: r }), I = s.value.findIndex((A) => A.id === c);
439
+ return s.value.splice(I, 1, m.bin), m;
432
440
  }
433
- async function c(f) {
434
- const u = await o.get(`/one/bins/${f}`);
435
- return s.value = u.bin, u;
441
+ async function g(r, c) {
442
+ const m = c ? await y(r, c) : await _(r);
443
+ return n.value = m.bin, m;
444
+ }
445
+ async function i(r) {
446
+ const c = await t.get(`/one/bins/${r}`);
447
+ return n.value = c.bin, c;
436
448
  }
437
449
  return {
438
- all: e,
439
- create: r,
440
- current: s,
441
- find: c,
442
- get: i,
443
- update: t,
444
- updateOrCreate: h
450
+ isOwner: e,
451
+ all: s,
452
+ create: _,
453
+ delete: u,
454
+ current: n,
455
+ find: i,
456
+ get: p,
457
+ update: y,
458
+ updateOrCreate: g
445
459
  };
446
- }), Qt = x("one", () => {
447
- const e = new URLSearchParams(window.location.search).get("session_id"), s = V(), i = C(), r = T(!1), t = D(() => {
448
- var n;
449
- return (n = s.user) == null ? void 0 : n.sponsorships.find((l) => l.platform === "stripe" && l.tierName.startsWith("sub_"));
450
- }), h = D(() => {
451
- var n;
452
- return (n = t.value) == null ? void 0 : n.isActive;
460
+ }), Ke = $("one", () => {
461
+ const t = new URLSearchParams(window.location.search).get("session_id"), s = w(), n = N(), a = T(!1), e = x(() => {
462
+ var i;
463
+ return (i = s.user) == null ? void 0 : i.sponsorships.find((r) => r.platform === "stripe" && r.tierName.startsWith("sub_"));
464
+ }), p = x(() => {
465
+ var i;
466
+ return (i = e.value) == null ? void 0 : i.isActive;
453
467
  });
454
- rt(async () => {
455
- e && await c();
456
- }), F(h, (n) => {
457
- n && m();
468
+ ie(async () => {
469
+ t && await u();
470
+ }), H(p, (i) => {
471
+ i && g();
458
472
  });
459
- async function c() {
473
+ async function u() {
460
474
  try {
461
- r.value = !0;
462
- const n = await i.post("/one/activate", { sessionId: e });
463
- s.user = n.user;
475
+ a.value = !0;
476
+ const i = await n.post("/one/activate", { sessionId: t });
477
+ s.user = i.user;
464
478
  } catch {
465
479
  } finally {
466
- r.value = !1;
480
+ a.value = !1;
467
481
  }
468
482
  }
469
- async function f() {
470
- r.value = !0, window.location.href = `${i.url}/one/subscribe`;
483
+ async function _() {
484
+ a.value = !0, window.location.href = `${n.url}/one/subscribe`;
471
485
  }
472
- async function u() {
473
- var n;
474
- if (t.value)
486
+ async function y() {
487
+ var i;
488
+ if (e.value)
475
489
  try {
476
- r.value = !0;
477
- const l = await i.post(
478
- `/one/cancel?subscriptionId=${(n = t.value) == null ? void 0 : n.tierName}`
490
+ a.value = !0;
491
+ const r = await n.post(
492
+ `/one/cancel?subscriptionId=${(i = e.value) == null ? void 0 : i.tierName}`
479
493
  );
480
- s.user = l.user;
494
+ s.user = r.user;
481
495
  } catch {
482
496
  } finally {
483
- r.value = !1;
497
+ a.value = !1;
484
498
  }
485
499
  }
486
- async function m() {
487
- var n;
488
- if (t.value)
500
+ async function g() {
501
+ var i;
502
+ if (e.value)
489
503
  try {
490
- r.value = !0;
491
- const l = await i.post(
492
- `/one/verify?subscriptionId=${(n = t.value) == null ? void 0 : n.tierName}`
504
+ a.value = !0;
505
+ const r = await n.post(
506
+ `/one/verify?subscriptionId=${(i = e.value) == null ? void 0 : i.tierName}`
493
507
  );
494
- s.user = l.user;
508
+ s.user = r.user;
495
509
  } catch {
496
510
  } finally {
497
- r.value = !1;
511
+ a.value = !1;
498
512
  }
499
513
  }
500
514
  return {
501
- activate: c,
502
- cancel: u,
503
- subscribe: f,
504
- verify: m,
505
- subscription: t,
506
- isLoading: r,
507
- isSubscriber: h
515
+ activate: u,
516
+ cancel: y,
517
+ subscribe: _,
518
+ verify: g,
519
+ subscription: e,
520
+ isLoading: a,
521
+ isSubscriber: p
508
522
  };
509
523
  });
510
- function te() {
511
- function o(e) {
512
- e.component("VoAuthDialog", At), e.component("VoFooter", Nt);
524
+ function Qe() {
525
+ function o(t) {
526
+ t.component("VoAuthDialog", Ae), t.component("VoFooter", He);
513
527
  }
514
528
  return { install: o };
515
529
  }
530
+ function et(o) {
531
+ o.store.url = "https://api.vuetifyjs.com";
532
+ }
516
533
  export {
517
- te as createOne,
518
- V as useAuthStore,
519
- Kt as useBinsStore,
520
- C as useHttpStore,
521
- Qt as useOneStore,
534
+ Qe as createOne,
535
+ et as one,
536
+ w as useAuthStore,
537
+ Ze as useBinsStore,
538
+ N as useHttpStore,
539
+ Ke as useOneStore,
522
540
  q as useUserStore
523
541
  };