@wssto2/vue-core 0.5.0 → 0.5.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/{AccessGate.vue_vue_type_script_setup_true_lang-Nw1IsB8N.js → AccessGate.vue_vue_type_script_setup_true_lang-DZ9GcLC1.js} +1 -1
  3. package/dist/{Activity-CoGI2_GL.js → Activity-dpY2kIs2.js} +2 -2
  4. package/dist/{Changes-Cwfe6wbX.js → Changes-CL8F1w8q.js} +2 -2
  5. package/dist/{CollectionPage.vue_vue_type_script_setup_true_lang-CtvHtFLy.js → CollectionPage.vue_vue_type_script_setup_true_lang-l-e-6WeS.js} +1 -1
  6. package/dist/{DeadLetters-DyA5Dqn0.js → DeadLetters-DopyRRx0.js} +4 -4
  7. package/dist/{General-DTEfxWls.js → General-mrVzi-5R.js} +2 -2
  8. package/dist/{NewRolePage-CRZoUajV.js → NewRolePage-sfr7tQs5.js} +2 -2
  9. package/dist/{ProfilePage-DLY81mvN.js → ProfilePage-EiTIYzZ5.js} +2 -2
  10. package/dist/{RoleEditor.vue_vue_type_script_setup_true_lang-gXbxXG2R.js → RoleEditor.vue_vue_type_script_setup_true_lang-BGtyOyWL.js} +6 -5
  11. package/dist/{RolePage-B9t586Q8.js → RolePage-ByUr3v_H.js} +3 -3
  12. package/dist/{RolesPage-BRdG-OSL.js → RolesPage-CvHrY9ZC.js} +2 -2
  13. package/dist/{SectionNavigator.vue_vue_type_script_setup_true_lang-Cy9Oi0ts.js → SectionNavigator.vue_vue_type_script_setup_true_lang-Ci04hApd.js} +1 -1
  14. package/dist/{Sessions-vGyUOnPG.js → Sessions-CHLokZ9e.js} +2 -2
  15. package/dist/{SettingsPage-V8WeADZZ.js → SettingsPage-DvOGJz9L.js} +2 -2
  16. package/dist/{SignIn-C-3i8RG6.js → SignIn-ypRvdmjg.js} +2 -2
  17. package/dist/{SignInPage-D2NA3VKU.js → SignInPage-CbPeKlAo.js} +2 -2
  18. package/dist/{SignIns-eoYPB6kB.js → SignIns-BApzbGq-.js} +2 -2
  19. package/dist/{UserRecord-BaQl2zzQ.js → UserRecord-BCTaBajE.js} +5 -5
  20. package/dist/{UsersList-BfXWgH5K.js → UsersList-CqSK3cQL.js} +4 -4
  21. package/dist/access/api.d.ts +8 -7
  22. package/dist/access/context.d.ts +7 -0
  23. package/dist/access/feature.d.ts +8 -0
  24. package/dist/access/index.js +1 -1
  25. package/dist/access/labels.d.ts +5 -0
  26. package/dist/app/index.js +117 -115
  27. package/dist/app/keepAlive.d.ts +4 -8
  28. package/dist/collection/index.js +3 -3
  29. package/dist/{contributions-DVQPcjJz.js → contributions-fx5q5n1u.js} +1 -1
  30. package/dist/{guards-DRh4zmxO.js → guards-D4mXf_2X.js} +1 -1
  31. package/dist/{http-D_pBg22D.js → http-CdQowFlW.js} +1 -1
  32. package/dist/identity/index.d.ts +1 -1
  33. package/dist/identity/index.js +6 -7
  34. package/dist/identity/session.d.ts +10 -7
  35. package/dist/{index-g-qbUeTk.js → index-BPwfLD7i.js} +261 -239
  36. package/dist/index-BVlbcaKs.js +763 -0
  37. package/dist/{index-kqk7Mclb.js → index-auJqVMWC.js} +90 -92
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.js +1 -1
  40. package/dist/keepAlive-z3IRFkQq.js +46 -0
  41. package/dist/{navigation-DuQwti76.js → navigation-Bc5EQ_Si.js} +1 -1
  42. package/dist/{neighbors-IMRQ4rkm.js → neighbors-Bv6vnWlW.js} +1 -1
  43. package/dist/notifications/index.d.ts +2 -0
  44. package/dist/notifications/index.js +5 -4
  45. package/dist/notifications/push/pushState.d.ts +27 -0
  46. package/dist/page/index.js +1 -1
  47. package/dist/platform/index.js +3 -3
  48. package/dist/platform/platform.d.ts +7 -2
  49. package/dist/platform/session.d.ts +17 -0
  50. package/dist/platform-Dx6STiwY.js +283 -0
  51. package/dist/router/index.js +3 -3
  52. package/dist/{sections-D5rgQ4YB.js → sections-B0HxIOC2.js} +1 -1
  53. package/dist/shell/index.js +3 -3
  54. package/dist/{status-C2gHqkj6.js → status-BUFELJz2.js} +2 -2
  55. package/dist/testing/index.js +1 -1
  56. package/package.json +1 -1
  57. package/dist/index-WkbzC_ee.js +0 -745
  58. package/dist/keepAlive-CDvMQlcJ.js +0 -49
  59. package/dist/platform-Dl1fbScN.js +0 -268
@@ -1,10 +1,10 @@
1
- import { route as m } from "./client/index.js";
2
- import { d as pe, p as me } from "./feature-DdUAfyi4.js";
3
- import { ref as M, readonly as R, defineComponent as O, openBlock as y, createBlock as q, unref as s, shallowRef as W, withCtx as $, createTextVNode as X, toDisplayString as P, mergeProps as Z, computed as D, createElementBlock as S, createElementVNode as C, createCommentVNode as L, createVNode as T, Fragment as z, renderList as ve, normalizeClass as H, useTemplateRef as be, createSlots as he } from "vue";
1
+ import { route as v } from "./client/index.js";
2
+ import { d as ve, p as me } from "./feature-DdUAfyi4.js";
3
+ import { ref as C, readonly as $, defineComponent as q, openBlock as _, createBlock as U, unref as s, shallowRef as z, withCtx as A, createTextVNode as X, toDisplayString as L, mergeProps as Z, computed as N, createElementBlock as S, createElementVNode as P, createCommentVNode as R, createVNode as T, Fragment as G, renderList as be, normalizeClass as H, useTemplateRef as he, createSlots as ye } from "vue";
4
4
  import { d as ge } from "./context-Ch1r4fdN.js";
5
- import { u as ye } from "./platform-Dl1fbScN.js";
6
- import { d as ee } from "./defineRoutes-BGAdiIrt.js";
7
- import { useI18n as U } from "vue-i18n";
5
+ import { u as ee } from "./platform-Dx6STiwY.js";
6
+ import { d as te } from "./defineRoutes-BGAdiIrt.js";
7
+ import { useI18n as I } from "vue-i18n";
8
8
  import { _ as _e } from "./AccountMenuItem.vue_vue_type_script_setup_true_lang-CPeNxh5K.js";
9
9
  import { f as xe } from "./client-BHPFfBj3.js";
10
10
  import { u as we } from "./mediaQuery-CygcXmFW.js";
@@ -12,44 +12,44 @@ import { _ as ke } from "./Sheet.vue_vue_type_script_setup_true_lang-DgOFV4fa.js
12
12
  import { _ as Se } from "./Popover.vue_vue_type_script_setup_true_lang-C70GrCP7.js";
13
13
  import { _ as J } from "./HeaderAction.vue_vue_type_script_setup_true_lang-Cgji-Jrr.js";
14
14
  import { useRouter as Te } from "vue-router";
15
- import { _ as G } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
15
+ import { _ as K } from "./Button.vue_vue_type_script_setup_true_lang-CL9Qh5yq.js";
16
16
  import { u as Ee } from "./format-D8X4zsx6.js";
17
- import { _ as Ce } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
18
- import { _ as Pe } from "./AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js";
17
+ import { _ as Pe } from "./Icon.vue_vue_type_script_lang-D7oC-d-S.js";
18
+ import { _ as Ce } from "./AsyncSection.vue_vue_type_script_setup_true_lang-B0NfvG3B.js";
19
19
  const E = {
20
- list: m("GET", "/v1/notifications"),
21
- unread: m("GET", "/v1/notifications/unread"),
22
- read: m("POST", "/v1/notifications/:id/read"),
23
- readAll: m("POST", "/v1/notifications/read"),
24
- stream: m.raw("GET", "/v1/notifications/stream"),
25
- test: m("POST", "/v1/notifications/test"),
26
- preferences: m("GET", "/v1/notifications/preferences"),
27
- preferencesSetEmail: m("PUT", "/v1/notifications/preferences/:category"),
28
- quietHours: m("PUT", "/v1/notifications/quiet-hours"),
29
- preferencesSetPush: m("PUT", "/v1/notifications/preferences/:category/push"),
30
- push: m("GET", "/v1/notifications/push"),
31
- devices: m("GET", "/v1/notifications/devices"),
32
- deviceSubscribe: m("POST", "/v1/notifications/devices"),
33
- deviceUnsubscribe: m("POST", "/v1/notifications/devices/unsubscribe"),
34
- deviceRename: m("PATCH", "/v1/notifications/devices/:id"),
35
- deviceRemove: m("DELETE", "/v1/notifications/devices/:id"),
36
- deviceTest: m("POST", "/v1/notifications/devices/:id/test")
37
- }, Lt = {
38
- deadLettersList: m("GET", "/v1/events/dead-letters", { permission: "events.deadletter:view" }),
39
- deadLettersRetry: m("POST", "/v1/events/dead-letters/:event/:consumer/retry", { permission: "events.deadletter:retry" }),
40
- deadLettersRetryAll: m("POST", "/v1/events/dead-letters/retry", { permission: "events.deadletter:retry" }),
41
- consumers: m("GET", "/v1/events/consumers", { permission: "events.deadletter:view" })
42
- }, [Le, te] = ge("vue-core.notifications");
43
- function ne(n) {
20
+ list: v("GET", "/v1/notifications"),
21
+ unread: v("GET", "/v1/notifications/unread"),
22
+ read: v("POST", "/v1/notifications/:id/read"),
23
+ readAll: v("POST", "/v1/notifications/read"),
24
+ stream: v.raw("GET", "/v1/notifications/stream"),
25
+ test: v("POST", "/v1/notifications/test"),
26
+ preferences: v("GET", "/v1/notifications/preferences"),
27
+ preferencesSetEmail: v("PUT", "/v1/notifications/preferences/:category"),
28
+ quietHours: v("PUT", "/v1/notifications/quiet-hours"),
29
+ preferencesSetPush: v("PUT", "/v1/notifications/preferences/:category/push"),
30
+ push: v("GET", "/v1/notifications/push"),
31
+ devices: v("GET", "/v1/notifications/devices"),
32
+ deviceSubscribe: v("POST", "/v1/notifications/devices"),
33
+ deviceUnsubscribe: v("POST", "/v1/notifications/devices/unsubscribe"),
34
+ deviceRename: v("PATCH", "/v1/notifications/devices/:id"),
35
+ deviceRemove: v("DELETE", "/v1/notifications/devices/:id"),
36
+ deviceTest: v("POST", "/v1/notifications/devices/:id/test")
37
+ }, Rt = {
38
+ deadLettersList: v("GET", "/v1/events/dead-letters", { permission: "events.deadletter:view" }),
39
+ deadLettersRetry: v("POST", "/v1/events/dead-letters/:event/:consumer/retry", { permission: "events.deadletter:retry" }),
40
+ deadLettersRetryAll: v("POST", "/v1/events/dead-letters/retry", { permission: "events.deadletter:retry" }),
41
+ consumers: v("GET", "/v1/events/consumers", { permission: "events.deadletter:view" })
42
+ }, [Le, ne] = ge("vue-core.notifications");
43
+ function ie(n) {
44
44
  const t = (n + "=".repeat((4 - n.length % 4) % 4)).replace(/-/g, "+").replace(/_/g, "/"), e = atob(t), i = new Uint8Array(new ArrayBuffer(e.length));
45
- for (let o = 0; o < e.length; o++) i[o] = e.charCodeAt(o);
45
+ for (let a = 0; a < e.length; a++) i[a] = e.charCodeAt(a);
46
46
  return i;
47
47
  }
48
- function ie(n, t) {
48
+ function ae(n, t) {
49
49
  const e = n.options?.applicationServerKey;
50
50
  if (!e) return !0;
51
- const i = ne(t), o = new Uint8Array(e);
52
- return o.length === i.length && o.every((c, l) => c === i[l]);
51
+ const i = ie(t), a = new Uint8Array(e);
52
+ return a.length === i.length && a.every((c, u) => c === i[u]);
53
53
  }
54
54
  function Re(n) {
55
55
  const t = n.toJSON();
@@ -62,7 +62,7 @@ async function oe(n) {
62
62
  function $e(n) {
63
63
  return (/iPhone|iPad|iPod/.test(n.userAgent) || /Macintosh/.test(n.userAgent) && n.maxTouchPoints > 1) && !n.standalone ? "ios-browser" : n.hasPushManager && n.hasNotification && n.hasServiceWorker ? "supported" : "unsupported";
64
64
  }
65
- function K() {
65
+ function W() {
66
66
  const n = async () => "serviceWorker" in navigator && await navigator.serviceWorker.getRegistration() ? navigator.serviceWorker.ready : null;
67
67
  return {
68
68
  support: () => $e({
@@ -76,14 +76,14 @@ function K() {
76
76
  permission: () => "Notification" in window ? Notification.permission : "unknown",
77
77
  requestPermission: () => Notification.requestPermission(),
78
78
  subscription: async () => (await n())?.pushManager.getSubscription() ?? null,
79
- subscribe: async (t) => (await n())?.pushManager.subscribe({ userVisibleOnly: !0, applicationServerKey: ne(t) }) ?? null
79
+ subscribe: async (t) => (await n())?.pushManager.subscribe({ userVisibleOnly: !0, applicationServerKey: ie(t) }) ?? null
80
80
  };
81
81
  }
82
- async function ae(n, t, e) {
82
+ async function se(n, t, e) {
83
83
  const i = Re(t);
84
84
  return i ? (await n.request(E.deviceSubscribe, i, e ? { signal: e } : void 0), oe(i.endpoint)) : null;
85
85
  }
86
- async function se(n, t = K(), e) {
86
+ async function re(n, t = W(), e) {
87
87
  const i = await t.subscription();
88
88
  i && (await n.request(E.deviceUnsubscribe, { endpoint: i.endpoint }, e ? { signal: e } : void 0).catch(() => {
89
89
  }), await i.unsubscribe().catch(() => !1));
@@ -96,53 +96,53 @@ async function Ae(n, t, e) {
96
96
  await i.unsubscribe().catch(() => !1);
97
97
  return;
98
98
  }
99
- const { data: o } = await n.request(E.push, void 0, e ? { signal: e } : void 0);
100
- o.enabled && (ie(i, o.public_key) || (await i.unsubscribe(), i = await t.subscribe(o.public_key)), i && await ae(n, i, e));
99
+ const { data: a } = await n.request(E.push, void 0, e ? { signal: e } : void 0);
100
+ a.enabled && (ae(i, a.public_key) || (await i.unsubscribe(), i = await t.subscribe(a.public_key)), i && await se(n, i, e));
101
101
  }
102
- function Rt(n = ye().http, t = K()) {
103
- const e = M("loading"), i = M(null), o = M(!1);
102
+ function Me(n = ee().http, t = W()) {
103
+ const e = C("loading"), i = C(null), a = C(!1);
104
104
  async function c() {
105
- const a = t.support();
106
- if (a !== "supported") {
107
- e.value = a;
105
+ const o = t.support();
106
+ if (o !== "supported") {
107
+ e.value = o;
108
108
  return;
109
109
  }
110
110
  const r = await t.subscription().catch(() => null);
111
111
  i.value = r ? await oe(r.endpoint) : null, e.value = t.permission() === "denied" ? "denied" : r && t.permission() === "granted" ? "on" : "off";
112
112
  }
113
- async function l() {
113
+ async function u() {
114
114
  if (t.support() !== "supported") return e.value;
115
- o.value = !0;
115
+ a.value = !0;
116
116
  try {
117
- const { data: a } = await n.request(E.push, void 0);
118
- if (!a.enabled) return e.value;
117
+ const { data: o } = await n.request(E.push, void 0);
118
+ if (!o.enabled) return e.value;
119
119
  if (await t.requestPermission() !== "granted")
120
120
  return e.value = t.permission() === "denied" ? "denied" : "off", e.value;
121
121
  let r = await t.subscription();
122
- return r && !ie(r, a.public_key) && (await r.unsubscribe(), r = null), r ?? (r = await t.subscribe(a.public_key)), r && (i.value = await ae(n, r), e.value = "on"), e.value;
122
+ return r && !ae(r, o.public_key) && (await r.unsubscribe(), r = null), r ?? (r = await t.subscribe(o.public_key)), r && (i.value = await se(n, r), e.value = "on"), e.value;
123
123
  } finally {
124
- o.value = !1;
124
+ a.value = !1;
125
125
  }
126
126
  }
127
- async function _() {
128
- o.value = !0;
127
+ async function g() {
128
+ a.value = !0;
129
129
  try {
130
- await se(n, t), i.value = null, e.value = "off";
130
+ await re(n, t), i.value = null, e.value = "off";
131
131
  } finally {
132
- o.value = !1;
132
+ a.value = !1;
133
133
  }
134
134
  }
135
- return { state: R(e), hash: R(i), busy: R(o), inspect: c, enable: l, disable: _ };
135
+ return { state: $(e), hash: $(i), busy: $(a), inspect: c, enable: u, disable: g };
136
136
  }
137
- const Me = "events.deadletter:view", $t = "events.deadletter:retry", Y = ee({
138
- index: { name: "events.deadletters", path: "/events/dead-letters", component: () => import("./DeadLetters-DyA5Dqn0.js"), meta: { access: Me, titleKey: "core.notifications.dead_letters.title" } }
139
- }), j = ee({
140
- index: { name: "notifications.settings", path: "/profile/notifications", component: () => import("./SettingsPage-V8WeADZZ.js"), meta: { titleKey: "core.notifications.settings.title" } }
141
- }), Ne = /* @__PURE__ */ O({
137
+ const Ne = "events.deadletter:view", $t = "events.deadletter:retry", Y = te({
138
+ index: { name: "events.deadletters", path: "/events/dead-letters", component: () => import("./DeadLetters-DopyRRx0.js"), meta: { access: Ne, titleKey: "core.notifications.dead_letters.title" } }
139
+ }), j = te({
140
+ index: { name: "notifications.settings", path: "/profile/notifications", component: () => import("./SettingsPage-DvOGJz9L.js"), meta: { titleKey: "core.notifications.settings.title" } }
141
+ }), Oe = /* @__PURE__ */ q({
142
142
  __name: "SettingsMenuItem",
143
143
  setup(n) {
144
- const { t } = U();
145
- return (e, i) => (y(), q(_e, {
144
+ const { t } = I();
145
+ return (e, i) => (_(), U(_e, {
146
146
  label: s(t)("core.notifications.settings.title"),
147
147
  icon: "notification3Line",
148
148
  to: s(j).index,
@@ -150,36 +150,36 @@ const Me = "events.deadletter:view", $t = "events.deadletter:retry", Y = ee({
150
150
  }, null, 8, ["label", "to"]));
151
151
  }
152
152
  });
153
- function re(n) {
153
+ function ce(n) {
154
154
  return n.reduce((t, e) => Math.max(t, e.id), 0);
155
155
  }
156
- function Oe(n, t, e) {
156
+ function qe(n, t, e) {
157
157
  return n.map((i) => i.id === t && i.read_at === null ? { ...i, read_at: e } : i);
158
158
  }
159
- function qe(n, t, e) {
159
+ function Ue(n, t, e) {
160
160
  return n.map((i) => i.read_at === null && i.id <= t ? { ...i, read_at: e } : i);
161
161
  }
162
- function Ue(n, t) {
163
- const e = re(n);
162
+ function Ie(n, t) {
163
+ const e = ce(n);
164
164
  return [...t.filter((i) => i.id > e), ...n];
165
165
  }
166
- function Ie(n, t) {
166
+ function Be(n, t) {
167
167
  const e = new Set(n.map((i) => i.id));
168
168
  return [...n, ...t.filter((i) => !e.has(i.id))];
169
169
  }
170
- function Be(n, t, e) {
170
+ function De(n, t, e) {
171
171
  let i = n.items;
172
- if (t.type === "created" && t.notification && !i.some((o) => o.id === t.notification?.id) && (i = [t.notification, ...i]), t.type === "read") {
173
- const o = new Set(t.read_ids ?? []), c = t.read_up_to_id ?? 0;
174
- i = i.map((l) => l.read_at === null && (t.all_read ? l.id <= c : o.has(l.id)) ? { ...l, read_at: e } : l);
172
+ if (t.type === "created" && t.notification && !i.some((a) => a.id === t.notification?.id) && (i = [t.notification, ...i]), t.type === "read") {
173
+ const a = new Set(t.read_ids ?? []), c = t.read_up_to_id ?? 0;
174
+ i = i.map((u) => u.read_at === null && (t.all_read ? u.id <= c : a.has(u.id)) ? { ...u, read_at: e } : u);
175
175
  }
176
176
  return { items: i, unreadCount: Math.max(0, t.unread_count) };
177
177
  }
178
- function De(n) {
178
+ function We(n) {
179
179
  return n > 99 ? "99+" : String(n);
180
180
  }
181
- const We = ["created", "read", "unread"];
182
- function ze(n) {
181
+ const ze = ["created", "read", "unread"];
182
+ function Ge(n) {
183
183
  const t = n.split(`
184
184
  `).filter((e) => e.startsWith("data:")).map((e) => e.slice(5).replace(/^ /, "")).join(`
185
185
  `);
@@ -187,59 +187,59 @@ function ze(n) {
187
187
  try {
188
188
  const e = JSON.parse(t);
189
189
  if (typeof e != "object" || e === null) return null;
190
- const { type: i, unread_count: o } = e;
191
- return typeof i == "string" && We.includes(i) && typeof o == "number" ? e : null;
190
+ const { type: i, unread_count: a } = e;
191
+ return typeof i == "string" && ze.includes(i) && typeof a == "number" ? e : null;
192
192
  } catch {
193
193
  return null;
194
194
  }
195
195
  }
196
- async function Ge({ url: n, transport: t, signal: e, onEvent: i, idleTimeout: o }) {
196
+ async function Ke({ url: n, transport: t, signal: e, onEvent: i, idleTimeout: a }) {
197
197
  if (e.aborted) return "aborted";
198
198
  const c = new AbortController();
199
- let l = null, _ = !1, a;
199
+ let u = null, g = !1, o;
200
200
  const r = () => {
201
- c.abort(), l?.cancel().catch(() => {
201
+ c.abort(), u?.cancel().catch(() => {
202
202
  });
203
203
  }, h = () => {
204
- clearTimeout(a), a = setTimeout(() => {
205
- _ = !0, r();
206
- }, o);
204
+ clearTimeout(o), o = setTimeout(() => {
205
+ g = !0, r();
206
+ }, a);
207
207
  };
208
208
  e.addEventListener("abort", r, { once: !0 }), h();
209
209
  try {
210
210
  const d = await t(n, { method: "GET", headers: { Accept: "text/event-stream" }, credentials: "include", signal: c.signal });
211
211
  if (d.status === 401) return "unauthorized";
212
212
  if (!d.ok || !d.body) return "failed";
213
- l = d.body.getReader();
213
+ u = d.body.getReader();
214
214
  const x = new TextDecoder();
215
215
  let w = "";
216
216
  for (; ; ) {
217
- const { done: b, value: u } = await l.read();
217
+ const { done: b, value: l } = await u.read();
218
218
  if (e.aborted) return "aborted";
219
- if (_) return "stalled";
219
+ if (g) return "stalled";
220
220
  if (b) return "closed";
221
- h(), w += x.decode(u, { stream: !0 }).replace(/\r\n/g, `
221
+ h(), w += x.decode(l, { stream: !0 }).replace(/\r\n/g, `
222
222
  `);
223
223
  const k = w.split(`
224
224
 
225
225
  `);
226
226
  w = k.pop() ?? "";
227
- for (const g of k) {
228
- const N = ze(g);
229
- N && i(N);
227
+ for (const y of k) {
228
+ const O = Ge(y);
229
+ O && i(O);
230
230
  }
231
231
  }
232
232
  } catch (d) {
233
- return e.aborted ? "aborted" : _ ? "stalled" : d instanceof Error && d.name === "AbortError" ? "aborted" : "failed";
233
+ return e.aborted ? "aborted" : g ? "stalled" : d instanceof Error && d.name === "AbortError" ? "aborted" : "failed";
234
234
  } finally {
235
- clearTimeout(a), e.removeEventListener("abort", r);
235
+ clearTimeout(o), e.removeEventListener("abort", r);
236
236
  }
237
237
  }
238
- function Ke(n) {
239
- const { http: t, signal: e, pageSize: i = 20, backoff: o = { min: 1e3, max: 3e4 }, idleTimeout: c = 5e4, transport: l = xe, now: _ = () => /* @__PURE__ */ new Date() } = n, a = W([]), r = M(0), h = M(!1), d = W({ status: "idle" }), x = M("idle");
238
+ function je(n) {
239
+ const { http: t, signal: e, pageSize: i = 20, backoff: a = { min: 1e3, max: 3e4 }, idleTimeout: c = 5e4, transport: u = xe, now: g = () => /* @__PURE__ */ new Date() } = n, o = z([]), r = C(0), h = C(!1), d = z({ status: "idle" }), x = C("idle");
240
240
  let w = 0;
241
- const b = () => _().toISOString();
242
- async function u() {
241
+ const b = () => g().toISOString();
242
+ async function l() {
243
243
  try {
244
244
  const { data: f } = await t.request(E.unread, void 0, { signal: e });
245
245
  e.aborted || (r.value = f.unread_count);
@@ -252,79 +252,79 @@ function Ke(n) {
252
252
  try {
253
253
  const { data: p } = await t.request(E.list, { limit: i }, { signal: e });
254
254
  if (e.aborted || f !== w) return;
255
- a.value = Ue(p.items, a.value), h.value = p.has_more, d.value = { status: "loaded" };
255
+ o.value = Ie(p.items, o.value), h.value = p.has_more, d.value = { status: "loaded" };
256
256
  } catch (p) {
257
257
  if (e.aborted || f !== w) return;
258
258
  d.value = { status: "failed", error: p };
259
259
  }
260
260
  }
261
- async function g() {
262
- const f = a.value[a.value.length - 1]?.id;
261
+ async function y() {
262
+ const f = o.value[o.value.length - 1]?.id;
263
263
  if (!h.value || x.value === "loading" || f === void 0) return;
264
264
  const p = w;
265
265
  x.value = "loading";
266
266
  try {
267
- const { data: v } = await t.request(E.list, { before_id: f, limit: i }, { signal: e });
267
+ const { data: m } = await t.request(E.list, { before_id: f, limit: i }, { signal: e });
268
268
  if (e.aborted || p !== w) return;
269
- a.value = Ie(a.value, v.items), h.value = v.has_more, x.value = "idle";
269
+ o.value = Be(o.value, m.items), h.value = m.has_more, x.value = "idle";
270
270
  } catch {
271
271
  !e.aborted && p === w && (x.value = "failed");
272
272
  }
273
273
  }
274
- async function N(f) {
275
- if (!(f.read_at !== null || a.value.find((p) => p.id === f.id)?.read_at)) {
276
- a.value = Oe(a.value, f.id, b()), r.value = Math.max(0, r.value - 1);
274
+ async function O(f) {
275
+ if (!(f.read_at !== null || o.value.find((p) => p.id === f.id)?.read_at)) {
276
+ o.value = qe(o.value, f.id, b()), r.value = Math.max(0, r.value - 1);
277
277
  try {
278
278
  const { data: p } = await t.request(E.read, { id: f.id }, { signal: e });
279
279
  e.aborted || (r.value = p.unread_count);
280
280
  } catch {
281
281
  if (e.aborted) return;
282
- a.value = a.value.map((p) => p.id === f.id ? { ...p, read_at: null } : p), await u();
282
+ o.value = o.value.map((p) => p.id === f.id ? { ...p, read_at: null } : p), await l();
283
283
  }
284
284
  }
285
285
  }
286
- async function le() {
287
- const f = re(a.value);
286
+ async function de() {
287
+ const f = ce(o.value);
288
288
  if (f === 0) return;
289
- const p = new Set(a.value.filter((v) => v.read_at === null && v.id <= f).map((v) => v.id));
290
- a.value = qe(a.value, f, b()), r.value = Math.max(0, r.value - p.size);
289
+ const p = new Set(o.value.filter((m) => m.read_at === null && m.id <= f).map((m) => m.id));
290
+ o.value = Ue(o.value, f, b()), r.value = Math.max(0, r.value - p.size);
291
291
  try {
292
- const { data: v } = await t.request(E.readAll, { up_to_id: f }, { signal: e });
293
- e.aborted || (r.value = v.unread_count);
292
+ const { data: m } = await t.request(E.readAll, { up_to_id: f }, { signal: e });
293
+ e.aborted || (r.value = m.unread_count);
294
294
  } catch {
295
295
  if (e.aborted) return;
296
- a.value = a.value.map((v) => p.has(v.id) ? { ...v, read_at: null } : v), await u();
296
+ o.value = o.value.map((m) => p.has(m.id) ? { ...m, read_at: null } : m), await l();
297
297
  }
298
298
  }
299
- let A = o.min, I = null;
300
- const de = (f) => new Promise((p) => {
301
- const v = () => {
302
- clearTimeout(B), e.removeEventListener("abort", v), I = null, p();
303
- }, B = setTimeout(v, f);
304
- e.addEventListener("abort", v, { once: !0 }), I = v;
299
+ let M = a.min, B = null;
300
+ const fe = (f) => new Promise((p) => {
301
+ const m = () => {
302
+ clearTimeout(D), e.removeEventListener("abort", m), B = null, p();
303
+ }, D = setTimeout(m, f);
304
+ e.addEventListener("abort", m, { once: !0 }), B = m;
305
305
  });
306
- async function fe() {
306
+ async function pe() {
307
307
  for (let f = !1; !e.aborted; f = !0) {
308
- if (f && await u(), e.aborted) return;
308
+ if (f && await l(), e.aborted) return;
309
309
  let p = !1;
310
- if (await Ge({
310
+ if (await Ke({
311
311
  url: n.streamUrl,
312
- transport: l,
312
+ transport: u,
313
313
  signal: e,
314
314
  idleTimeout: c,
315
- onEvent(v) {
315
+ onEvent(m) {
316
316
  p = !0;
317
- const B = Be({ items: a.value, unreadCount: r.value }, v, b());
318
- a.value = B.items, r.value = B.unreadCount;
317
+ const D = De({ items: o.value, unreadCount: r.value }, m, b());
318
+ o.value = D.items, r.value = D.unreadCount;
319
319
  }
320
320
  }), e.aborted) return;
321
- p && (A = o.min), await de(A), A = Math.min(A * 2, o.max);
321
+ p && (M = a.min), await fe(M), M = Math.min(M * 2, a.max);
322
322
  }
323
323
  }
324
324
  const F = () => {
325
- document.visibilityState === "visible" && (u(), A = o.min, I?.());
325
+ document.visibilityState === "visible" && (l(), M = a.min, B?.());
326
326
  }, V = () => {
327
- u(), A = o.min, I?.();
327
+ l(), M = a.min, B?.();
328
328
  };
329
329
  return document.addEventListener("visibilitychange", F), window.addEventListener("online", V), e.addEventListener(
330
330
  "abort",
@@ -332,69 +332,69 @@ function Ke(n) {
332
332
  document.removeEventListener("visibilitychange", F), window.removeEventListener("online", V);
333
333
  },
334
334
  { once: !0 }
335
- ), e.aborted || fe(), { items: R(a), unreadCount: R(r), hasMore: R(h), list: R(d), more: R(x), load: k, loadMore: g, markRead: N, markAllRead: le };
335
+ ), e.aborted || pe(), { items: $(o), unreadCount: $(r), hasMore: $(h), list: $(d), more: $(x), load: k, loadMore: y, markRead: O, markAllRead: de };
336
336
  }
337
- const ce = /* @__PURE__ */ O({
337
+ const ue = /* @__PURE__ */ q({
338
338
  __name: "MarkAllRead",
339
339
  props: {
340
340
  inbox: {}
341
341
  },
342
342
  setup(n) {
343
- const { t } = U();
344
- return (e, i) => (y(), q(s(G), {
343
+ const { t } = I();
344
+ return (e, i) => (_(), U(s(K), {
345
345
  prominence: "plain",
346
346
  size: "sm",
347
347
  icon: "checkDoubleLine",
348
348
  "data-notification-mark-all": "",
349
349
  disabled: n.inbox.unreadCount.value === 0,
350
- onClick: i[0] || (i[0] = (o) => n.inbox.markAllRead())
350
+ onClick: i[0] || (i[0] = (a) => n.inbox.markAllRead())
351
351
  }, {
352
- default: $(() => [
353
- X(P(s(t)("core.notifications.mark_all_read")), 1)
352
+ default: A(() => [
353
+ X(L(s(t)("core.notifications.mark_all_read")), 1)
354
354
  ]),
355
355
  _: 1
356
356
  }, 8, ["disabled"]));
357
357
  }
358
- }), ue = /* @__PURE__ */ O({
358
+ }), le = /* @__PURE__ */ q({
359
359
  __name: "SettingsLink",
360
360
  emits: ["click"],
361
361
  setup(n, { emit: t }) {
362
- const e = t, { t: i } = U();
363
- return (o, c) => (y(), q(s(G), Z({
362
+ const e = t, { t: i } = I();
363
+ return (a, c) => (_(), U(s(K), Z({
364
364
  prominence: "plain",
365
365
  size: "sm",
366
366
  icon: "settings3Line",
367
367
  to: s(j).index
368
368
  }, { "aria-label": s(i)("core.notifications.settings.open"), title: s(i)("core.notifications.settings.open") }, {
369
369
  "data-notification-settings": "",
370
- onClick: c[0] || (c[0] = (l) => e("click"))
370
+ onClick: c[0] || (c[0] = (u) => e("click"))
371
371
  }), null, 16, ["to"]));
372
372
  }
373
- }), je = {
373
+ }), Fe = {
374
374
  "data-notification-inbox": "",
375
375
  class: "w-full min-w-0 sm:w-96"
376
- }, Fe = {
376
+ }, Ve = {
377
377
  key: 0,
378
378
  class: "mb-1 flex items-center justify-between gap-2"
379
- }, Ve = { class: "px-1 text-headline font-semibold" }, He = { class: "flex items-center gap-1" }, Je = { class: "-mx-1 max-h-[min(28rem,60dvh)] overflow-y-auto overscroll-contain" }, Ye = ["data-unread", "onClick"], Qe = { class: "min-w-0 flex-1" }, Xe = {
379
+ }, He = { class: "px-1 text-headline font-semibold" }, Je = { class: "flex items-center gap-1" }, Ye = { class: "-mx-1 max-h-[min(28rem,60dvh)] overflow-y-auto overscroll-contain" }, Qe = ["data-unread", "onClick"], Xe = { class: "min-w-0 flex-1" }, Ze = {
380
380
  key: 0,
381
381
  class: "mt-0.5 line-clamp-2 block text-footnote text-content-muted"
382
- }, Ze = ["datetime"], et = {
382
+ }, et = ["datetime"], tt = {
383
383
  key: 0,
384
384
  class: "mt-2 size-2 shrink-0 rounded-full bg-content-link",
385
385
  "aria-hidden": "true"
386
- }, tt = {
386
+ }, nt = {
387
387
  key: 1,
388
388
  class: "sr-only"
389
- }, nt = {
389
+ }, it = {
390
390
  key: 0,
391
391
  class: "mt-2 flex flex-col items-center gap-1",
392
392
  "data-notification-more": ""
393
- }, it = {
393
+ }, at = {
394
394
  key: 0,
395
395
  class: "text-footnote text-status-danger-content",
396
396
  role: "alert"
397
- }, ot = "bg-fill text-content-muted", Q = /* @__PURE__ */ O({
397
+ }, ot = "bg-fill text-content-muted", Q = /* @__PURE__ */ q({
398
398
  __name: "InboxPanel",
399
399
  props: {
400
400
  inbox: {},
@@ -402,7 +402,7 @@ const ce = /* @__PURE__ */ O({
402
402
  },
403
403
  emits: ["close"],
404
404
  setup(n, { emit: t }) {
405
- const e = n, i = t, { t: o } = U(), c = Te(), l = Ee(), { categories: _, settings: a } = te(), r = {
405
+ const e = n, i = t, { t: a } = I(), c = Te(), u = Ee(), { categories: g, settings: o } = ne(), r = {
406
406
  amber: "bg-category-amber-surface text-category-amber-content",
407
407
  lime: "bg-category-lime-surface text-category-lime-content",
408
408
  teal: "bg-category-teal-surface text-category-teal-content",
@@ -412,103 +412,103 @@ const ce = /* @__PURE__ */ O({
412
412
  violet: "bg-category-violet-surface text-category-violet-content",
413
413
  fuchsia: "bg-category-fuchsia-surface text-category-fuchsia-content",
414
414
  pink: "bg-category-pink-surface text-category-pink-content"
415
- }, h = D(() => {
416
- const { list: b, items: u } = e.inbox;
415
+ }, h = N(() => {
416
+ const { list: b, items: l } = e.inbox;
417
417
  if (b.value.status === "failed") {
418
- const k = o("core.notifications.load_error");
419
- return u.value.length > 0 ? { status: "stale", value: u.value, error: k } : { status: "failed", error: k };
418
+ const k = a("core.notifications.load_error");
419
+ return l.value.length > 0 ? { status: "stale", value: l.value, error: k } : { status: "failed", error: k };
420
420
  }
421
- return b.value.status === "loaded" ? { status: "loaded", value: u.value } : u.value.length > 0 ? { status: "refreshing", value: u.value } : { status: "loading" };
421
+ return b.value.status === "loaded" ? { status: "loaded", value: l.value } : l.value.length > 0 ? { status: "refreshing", value: l.value } : { status: "loading" };
422
422
  }), d = (b) => {
423
- const u = _[b.category];
424
- return { icon: u?.icon ?? "notification3Line", classes: u?.hue ? r[u.hue] : ot };
423
+ const l = g[b.category];
424
+ return { icon: l?.icon ?? "notification3Line", classes: l?.hue ? r[l.hue] : ot };
425
425
  }, x = (b) => b.startsWith("/") && !b.startsWith("//");
426
426
  function w(b) {
427
427
  e.inbox.markRead(b), !(b.link === "" || !x(b.link)) && (i("close"), c.push(b.link));
428
428
  }
429
- return (b, u) => (y(), S("div", je, [
430
- n.appearance === "popover" ? (y(), S("div", Fe, [
431
- C("h2", Ve, P(s(o)("core.notifications.title")), 1),
432
- C("div", He, [
433
- s(a) ? (y(), q(ue, {
429
+ return (b, l) => (_(), S("div", Fe, [
430
+ n.appearance === "popover" ? (_(), S("div", Ve, [
431
+ P("h2", He, L(s(a)("core.notifications.title")), 1),
432
+ P("div", Je, [
433
+ s(o) ? (_(), U(le, {
434
434
  key: 0,
435
- onClick: u[0] || (u[0] = (k) => i("close"))
436
- })) : L("", !0),
437
- T(ce, { inbox: n.inbox }, null, 8, ["inbox"])
435
+ onClick: l[0] || (l[0] = (k) => i("close"))
436
+ })) : R("", !0),
437
+ T(ue, { inbox: n.inbox }, null, 8, ["inbox"])
438
438
  ])
439
- ])) : L("", !0),
440
- T(s(Pe), {
439
+ ])) : R("", !0),
440
+ T(s(Ce), {
441
441
  state: h.value,
442
- "empty-title": s(o)("core.notifications.empty_title"),
443
- "empty-description": s(o)("core.notifications.empty_description"),
442
+ "empty-title": s(a)("core.notifications.empty_title"),
443
+ "empty-description": s(a)("core.notifications.empty_description"),
444
444
  "empty-icon": "notification3Line",
445
- onRetry: u[2] || (u[2] = (k) => n.inbox.load())
445
+ onRetry: l[2] || (l[2] = (k) => n.inbox.load())
446
446
  }, {
447
- default: $(({ value: k }) => [
448
- C("ul", Je, [
449
- (y(!0), S(z, null, ve(k, (g) => (y(), S("li", {
450
- key: g.id
447
+ default: A(({ value: k }) => [
448
+ P("ul", Ye, [
449
+ (_(!0), S(G, null, be(k, (y) => (_(), S("li", {
450
+ key: y.id
451
451
  }, [
452
- C("button", {
452
+ P("button", {
453
453
  type: "button",
454
454
  "data-notification-item": "",
455
- "data-unread": g.read_at === null ? "true" : void 0,
455
+ "data-unread": y.read_at === null ? "true" : void 0,
456
456
  class: "flex w-full cursor-pointer items-start gap-3 rounded-control px-2 py-2.5 text-left transition-colors duration-motion-fast hover:bg-fill focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-border-focus",
457
- onClick: (N) => w(g)
457
+ onClick: (O) => w(y)
458
458
  }, [
459
- C("span", {
460
- class: H(["flex size-9 shrink-0 items-center justify-center rounded-full", d(g).classes]),
459
+ P("span", {
460
+ class: H(["flex size-9 shrink-0 items-center justify-center rounded-full", d(y).classes]),
461
461
  "aria-hidden": "true"
462
462
  }, [
463
- T(s(Ce), {
464
- name: d(g).icon,
463
+ T(s(Pe), {
464
+ name: d(y).icon,
465
465
  size: 18
466
466
  }, null, 8, ["name"])
467
467
  ], 2),
468
- C("span", Qe, [
469
- C("span", {
470
- class: H(["block text-subheadline", g.read_at === null ? "font-semibold text-content-strong" : "font-medium text-content"])
471
- }, P(g.title), 3),
472
- g.body ? (y(), S("span", Xe, P(g.body), 1)) : L("", !0),
473
- C("time", {
474
- datetime: g.created_at,
468
+ P("span", Xe, [
469
+ P("span", {
470
+ class: H(["block text-subheadline", y.read_at === null ? "font-semibold text-content-strong" : "font-medium text-content"])
471
+ }, L(y.title), 3),
472
+ y.body ? (_(), S("span", Ze, L(y.body), 1)) : R("", !0),
473
+ P("time", {
474
+ datetime: y.created_at,
475
475
  class: "mt-0.5 block text-footnote text-content-muted"
476
- }, P(s(l).relative(g.created_at)), 9, Ze)
476
+ }, L(s(u).relative(y.created_at)), 9, et)
477
477
  ]),
478
- g.read_at === null ? (y(), S("span", et)) : L("", !0),
479
- g.read_at === null ? (y(), S("span", tt, P(s(o)("core.notifications.unread")), 1)) : L("", !0)
480
- ], 8, Ye)
478
+ y.read_at === null ? (_(), S("span", tt)) : R("", !0),
479
+ y.read_at === null ? (_(), S("span", nt, L(s(a)("core.notifications.unread")), 1)) : R("", !0)
480
+ ], 8, Qe)
481
481
  ]))), 128))
482
482
  ]),
483
- n.inbox.hasMore.value ? (y(), S("div", nt, [
484
- n.inbox.more.value === "failed" ? (y(), S("p", it, P(s(o)("core.notifications.load_more_error")), 1)) : L("", !0),
485
- T(s(G), {
483
+ n.inbox.hasMore.value ? (_(), S("div", it, [
484
+ n.inbox.more.value === "failed" ? (_(), S("p", at, L(s(a)("core.notifications.load_more_error")), 1)) : R("", !0),
485
+ T(s(K), {
486
486
  prominence: "plain",
487
487
  size: "sm",
488
488
  processing: n.inbox.more.value === "loading",
489
- onClick: u[1] || (u[1] = (g) => n.inbox.loadMore())
489
+ onClick: l[1] || (l[1] = (y) => n.inbox.loadMore())
490
490
  }, {
491
- default: $(() => [
492
- X(P(s(o)("core.notifications.load_more")), 1)
491
+ default: A(() => [
492
+ X(L(s(a)("core.notifications.load_more")), 1)
493
493
  ]),
494
494
  _: 1
495
495
  }, 8, ["processing"])
496
- ])) : L("", !0)
496
+ ])) : R("", !0)
497
497
  ]),
498
498
  _: 1
499
499
  }, 8, ["state", "empty-title", "empty-description"])
500
500
  ]));
501
501
  }
502
- }), at = { class: "flex items-center justify-center" }, st = /* @__PURE__ */ O({
502
+ }), st = { class: "flex items-center justify-center" }, rt = /* @__PURE__ */ q({
503
503
  __name: "NotificationBell",
504
504
  setup(n) {
505
- const { t } = U(), { inbox: e, settings: i } = te(), o = we(), c = be("sheet"), l = D(() => e.value?.unreadCount.value ?? 0), _ = D(() => l.value > 0 ? t("core.notifications.open_unread", { count: l.value }) : t("core.notifications.open")), a = D(() => l.value > 0 ? De(l.value) : void 0);
506
- return (r, h) => s(e) ? (y(), S(z, { key: 0 }, [
507
- s(o) ? (y(), S(z, { key: 1 }, [
505
+ const { t } = I(), { inbox: e, settings: i } = ne(), a = we(), c = he("sheet"), u = N(() => e.value?.unreadCount.value ?? 0), g = N(() => u.value > 0 ? t("core.notifications.open_unread", { count: u.value }) : t("core.notifications.open")), o = N(() => u.value > 0 ? We(u.value) : void 0);
506
+ return (r, h) => s(e) ? (_(), S(G, { key: 0 }, [
507
+ s(a) ? (_(), S(G, { key: 1 }, [
508
508
  T(J, {
509
509
  icon: "notification3Line",
510
- label: _.value,
511
- badge: a.value,
510
+ label: g.value,
511
+ badge: o.value,
512
512
  "data-notification-bell": "",
513
513
  onClick: h[1] || (h[1] = (d) => {
514
514
  c.value?.present(), s(e).load();
@@ -518,13 +518,13 @@ const ce = /* @__PURE__ */ O({
518
518
  ref_key: "sheet",
519
519
  ref: c,
520
520
  title: s(t)("core.notifications.title")
521
- }, he({
522
- footer: $(() => [
523
- C("div", at, [
524
- T(ce, { inbox: s(e) }, null, 8, ["inbox"])
521
+ }, ye({
522
+ footer: A(() => [
523
+ P("div", st, [
524
+ T(ue, { inbox: s(e) }, null, 8, ["inbox"])
525
525
  ])
526
526
  ]),
527
- default: $(() => [
527
+ default: A(() => [
528
528
  T(Q, {
529
529
  inbox: s(e),
530
530
  appearance: "sheet",
@@ -535,15 +535,15 @@ const ce = /* @__PURE__ */ O({
535
535
  }, [
536
536
  s(i) ? {
537
537
  name: "actions",
538
- fn: $(() => [
539
- T(ue, {
538
+ fn: A(() => [
539
+ T(le, {
540
540
  onClick: h[2] || (h[2] = (d) => c.value?.dismiss())
541
541
  })
542
542
  ]),
543
543
  key: "0"
544
544
  } : void 0
545
545
  ]), 1032, ["title"])
546
- ], 64)) : (y(), q(s(Se), {
546
+ ], 64)) : (_(), U(s(Se), {
547
547
  key: 0,
548
548
  placement: "bottom-start",
549
549
  width: "auto",
@@ -551,16 +551,16 @@ const ce = /* @__PURE__ */ O({
551
551
  label: s(t)("core.notifications.title"),
552
552
  onPresented: h[0] || (h[0] = (d) => s(e).load())
553
553
  }, {
554
- trigger: $(({ toggle: d, attrs: x }) => [
554
+ trigger: A(({ toggle: d, attrs: x }) => [
555
555
  T(J, Z(x, {
556
556
  icon: "notification3Line",
557
- label: _.value,
558
- badge: a.value,
557
+ label: g.value,
558
+ badge: o.value,
559
559
  "data-notification-bell": "",
560
560
  onClick: d
561
561
  }), null, 16, ["label", "badge", "onClick"])
562
562
  ]),
563
- default: $(({ dismiss: d }) => [
563
+ default: A(({ dismiss: d }) => [
564
564
  T(Q, {
565
565
  inbox: s(e),
566
566
  appearance: "popover",
@@ -569,62 +569,84 @@ const ce = /* @__PURE__ */ O({
569
569
  ]),
570
570
  _: 1
571
571
  }, 8, ["label"]))
572
- ], 64)) : L("", !0);
572
+ ], 64)) : R("", !0);
573
573
  }
574
- }), rt = ["channels", "quiet", "device", "devices"];
575
- function ct(n) {
576
- const t = new Set(rt);
574
+ }), ct = ["channels", "quiet", "device", "devices"];
575
+ function ut(n) {
576
+ const t = new Set(ct);
577
577
  for (const e of n) {
578
578
  if (t.has(e.id)) throw new Error(`notificationsFeature: the settings section "${e.id}" is a built-in id or is given twice.`);
579
579
  t.add(e.id);
580
580
  }
581
581
  return n;
582
582
  }
583
- function ut() {
583
+ function lt() {
584
584
  return {
585
585
  id: "notifications.push",
586
586
  scope: "session",
587
587
  start({ signal: n, platform: t, report: e }) {
588
- const i = K();
589
- return Ae(t.http, i, n).catch((o) => {
590
- n.aborted || e(o);
591
- }), t.session.onBeforeSignOut((o, c) => se(t.http, i, c));
588
+ const i = W();
589
+ return Ae(t.http, i, n).catch((a) => {
590
+ n.aborted || e(a);
591
+ }), t.session.onBeforeSignOut((a, c) => re(t.http, i, c));
592
592
  }
593
593
  };
594
594
  }
595
- function lt(n) {
595
+ function dt(n) {
596
596
  return {
597
597
  id: "notifications.inbox",
598
598
  scope: "session",
599
599
  start({ signal: t, platform: e }) {
600
600
  const i = e.config.apiBase.replace(/\/+$/, "");
601
- return n.value = Ke({ http: e.http, streamUrl: `${i}/${E.stream.path.replace(/^\/+/, "")}`, signal: t }), () => {
601
+ return n.value = je({ http: e.http, streamUrl: `${i}/${E.stream.path.replace(/^\/+/, "")}`, signal: t }), () => {
602
602
  n.value = null;
603
603
  };
604
604
  }
605
605
  };
606
606
  }
607
607
  function At(n = {}) {
608
- const t = W(null), e = n.deadLetters ?? {}, i = n.settings ?? !0, o = n.push ?? !0, c = ct(n.settingsSections ?? []);
609
- return pe({
608
+ const t = z(null), e = n.deadLetters ?? {}, i = n.settings ?? !0, a = n.push ?? !0, c = ut(n.settingsSections ?? []);
609
+ return ve({
610
610
  id: "notifications",
611
611
  routes: [...e === !1 ? [] : Y.records, ...i ? j.records : []],
612
612
  navigation: e !== !1 && e.destination ? [{ destination: e.destination, to: Y.index }] : [],
613
- context: me(Le, { inbox: t, categories: n.categories ?? {}, settings: i, push: o, sections: c }),
613
+ context: me(Le, { inbox: t, categories: n.categories ?? {}, settings: i, push: a, sections: c }),
614
614
  contributions: [
615
- { id: "notifications.bell", slot: "headerActions", component: st, scope: "authenticated" },
616
- ...i ? [{ id: "notifications.settings", slot: "accountMenu", component: Ne, scope: "authenticated", optional: !0, order: -9 }] : []
615
+ { id: "notifications.bell", slot: "headerActions", component: rt, scope: "authenticated" },
616
+ ...i ? [{ id: "notifications.settings", slot: "accountMenu", component: Oe, scope: "authenticated", optional: !0, order: -9 }] : []
617
617
  ],
618
- effects: [lt(t), ...o ? [ut()] : []]
618
+ effects: [dt(t), ...a ? [lt()] : []]
619
619
  });
620
620
  }
621
+ function Mt(n = ee().http, t = W()) {
622
+ const e = Me(n, t), i = C(!1), a = C(!1), c = C("unknown"), u = async () => {
623
+ await e.inspect(), c.value = t.permission();
624
+ };
625
+ return Promise.all([
626
+ u(),
627
+ n.request(E.push, void 0).then(({ data: g }) => void (a.value = g.enabled), () => {
628
+ })
629
+ ]).finally(() => void (i.value = !0)), {
630
+ ready: i,
631
+ available: N(() => a.value && (e.state.value === "off" || e.state.value === "on" || e.state.value === "denied")),
632
+ permission: c,
633
+ subscribed: N(() => e.state.value === "on"),
634
+ busy: e.busy,
635
+ enable: async () => {
636
+ const g = await e.enable();
637
+ return c.value = t.permission(), g === "on";
638
+ },
639
+ disable: e.disable
640
+ };
641
+ }
621
642
  export {
622
643
  $t as R,
623
- Rt as a,
644
+ Me as a,
624
645
  j as b,
625
646
  At as c,
626
647
  Y as d,
627
- Lt as e,
648
+ Rt as e,
649
+ Mt as f,
628
650
  E as n,
629
- te as u
651
+ ne as u
630
652
  };