@inertiaui/notifications-vue 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/inertiaui-notifications.js +855 -846
- package/package.json +1 -1
|
@@ -95,32 +95,37 @@ function be(e) {
|
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
function xe(e) {
|
|
98
|
-
|
|
98
|
+
let t = new URL(window.location.href), n = new URL(e.url, t);
|
|
99
|
+
for (let e of [t, n]) e.hash = "", e.searchParams.sort();
|
|
100
|
+
return n.href === t.href;
|
|
99
101
|
}
|
|
100
102
|
function Se(e) {
|
|
103
|
+
return e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey;
|
|
104
|
+
}
|
|
105
|
+
function Ce(e) {
|
|
101
106
|
let t = e.target;
|
|
102
107
|
return typeof t?.closest == "function" && t.closest("a[href]") !== null;
|
|
103
108
|
}
|
|
104
|
-
function
|
|
105
|
-
return !e.onClick &&
|
|
109
|
+
function we(e, t, n) {
|
|
110
|
+
return !e.onClick && Ce(n) && (Se(n) || e.external || e.newTab || !be(t));
|
|
106
111
|
}
|
|
107
|
-
var
|
|
108
|
-
function
|
|
112
|
+
var Te = 1500;
|
|
113
|
+
function Ee(e, t) {
|
|
109
114
|
let n, r = () => {
|
|
110
115
|
n !== void 0 && (clearTimeout(n), n = void 0, window.location.assign(t));
|
|
111
116
|
};
|
|
112
|
-
n = setTimeout(r,
|
|
117
|
+
n = setTimeout(r, Te), e.then(r, r);
|
|
113
118
|
}
|
|
114
|
-
function
|
|
119
|
+
function De(e, t, n, r, i) {
|
|
115
120
|
r();
|
|
116
121
|
let a = i?.();
|
|
117
|
-
a && !
|
|
122
|
+
a && !Se(n) && !t.newTab && (n.preventDefault(), Ee(a, e));
|
|
118
123
|
}
|
|
119
|
-
var
|
|
120
|
-
function
|
|
124
|
+
var Oe = (e) => typeof e?.then == "function";
|
|
125
|
+
function ke(e, t, n, r, i) {
|
|
121
126
|
e.event && window.dispatchEvent(new CustomEvent(e.event, { detail: e.payload }));
|
|
122
127
|
let a = e.onClick?.(t);
|
|
123
|
-
if (
|
|
128
|
+
if (Oe(a)) return a.then(() => {
|
|
124
129
|
i?.(), r(!0);
|
|
125
130
|
}, () => r(!1)), "pending";
|
|
126
131
|
let o = fe(e.href);
|
|
@@ -130,7 +135,7 @@ function Oe(e, t, n, r, i) {
|
|
|
130
135
|
if (e.newTab) window.open(o, "_blank", "noopener"), i?.();
|
|
131
136
|
else {
|
|
132
137
|
let e = i?.();
|
|
133
|
-
e ?
|
|
138
|
+
e ? Ee(e, o) : window.location.assign(o);
|
|
134
139
|
}
|
|
135
140
|
return "done";
|
|
136
141
|
}
|
|
@@ -139,6 +144,10 @@ function Oe(e, t, n, r, i) {
|
|
|
139
144
|
return n.visit(o, {
|
|
140
145
|
method: s,
|
|
141
146
|
data: e.data,
|
|
147
|
+
...s === "get" ? {} : {
|
|
148
|
+
preserveState: xe,
|
|
149
|
+
preserveScroll: xe
|
|
150
|
+
},
|
|
142
151
|
...e.visit,
|
|
143
152
|
onSuccess: () => void (c = !0),
|
|
144
153
|
onFinish: () => {
|
|
@@ -147,48 +156,48 @@ function Oe(e, t, n, r, i) {
|
|
|
147
156
|
}), "pending";
|
|
148
157
|
}
|
|
149
158
|
// ../js/cn.ts
|
|
150
|
-
var
|
|
159
|
+
var Ae = ee({ extend: { theme: { radius: ["iui-toast", "iui-inbox"] } } });
|
|
151
160
|
function J(...e) {
|
|
152
|
-
return
|
|
161
|
+
return Ae(e.filter(Boolean).join(" "));
|
|
153
162
|
}
|
|
154
163
|
// ../js/icons.ts
|
|
155
|
-
var
|
|
164
|
+
var je = (e, t) => Object.hasOwn(e, t) ? e[t] : void 0, Me = {
|
|
156
165
|
success: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",
|
|
157
166
|
info: "M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z",
|
|
158
167
|
warning: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
159
168
|
error: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.28 7.22a.75.75 0 0 0-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06L10 11.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L11.06 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L10 8.94 8.28 7.22Z"
|
|
160
|
-
},
|
|
161
|
-
dismiss: [
|
|
162
|
-
bell:
|
|
163
|
-
notification:
|
|
169
|
+
}, Ne = "M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z", Pe = "M10 3a7 7 0 0 1 7 7", Fe = ["M10 2a6 6 0 0 0-6 6c0 1.887-.454 3.665-1.257 5.234a.75.75 0 0 0 .515 1.076 32.91 32.91 0 0 0 3.256.508 3.5 3.5 0 0 0 6.972 0 32.903 32.903 0 0 0 3.256-.508.75.75 0 0 0 .515-1.076A11.448 11.448 0 0 1 16 8a6 6 0 0 0-6-6ZM8.05 14.943a33.54 33.54 0 0 0 3.9 0 2 2 0 0 1-3.9 0Z"], Ie = ["M4 8c0-.26.017-.517.049-.77l7.722 7.723a33.56 33.56 0 0 1-3.722-.01 2 2 0 0 0 3.862.15l1.134 1.134a3.5 3.5 0 0 1-6.53-1.409 32.91 32.91 0 0 1-3.257-.508.75.75 0 0 1-.515-1.076A11.448 11.448 0 0 0 4 8ZM17.266 13.9a.756.756 0 0 1-.068.116L6.389 3.207A6 6 0 0 1 16 8c.001 1.887.455 3.665 1.258 5.234a.75.75 0 0 1 .01.666ZM3.28 2.22a.75.75 0 0 0-1.06 1.06l14.5 14.5a.75.75 0 1 0 1.06-1.06L3.28 2.22Z"], Le = ["M1 11.27c0-.246.033-.492.099-.73l1.523-5.521A2.75 2.75 0 0 1 5.273 3h9.454a2.75 2.75 0 0 1 2.651 2.019l1.523 5.52c.066.239.099.485.099.732V15a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2v-3.73Zm3.068-5.852A1.25 1.25 0 0 1 5.273 4.5h9.454a1.25 1.25 0 0 1 1.205.918l1.523 5.52c.006.02.01.041.015.062H14a1 1 0 0 0-.86.49l-.606 1.02a1 1 0 0 1-.86.49H8.236a1 1 0 0 1-.894-.553l-.448-.894A1 1 0 0 0 6 11H2.53l.015-.062 1.523-5.52Z"], Re = {
|
|
170
|
+
dismiss: [Ne],
|
|
171
|
+
bell: Fe,
|
|
172
|
+
notification: Fe,
|
|
164
173
|
read: ["M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z"],
|
|
165
174
|
unread: ["M3 4a2 2 0 0 0-2 2v1.161l8.441 4.221a1.25 1.25 0 0 0 1.118 0L19 7.162V6a2 2 0 0 0-2-2H3Z", "m19 8.839-7.77 3.885a2.75 2.75 0 0 1-2.46 0L1 8.839V14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.839Z"],
|
|
166
175
|
archive: ["M2 3a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H2Z", "M2 7.5h16l-.811 7.71a2 2 0 0 1-1.99 1.79H4.802a2 2 0 0 1-1.99-1.79L2 7.5ZM7 11a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Z"],
|
|
167
|
-
unarchive:
|
|
176
|
+
unarchive: Le,
|
|
168
177
|
snooze: ["M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm.75-13a.75.75 0 0 0-1.5 0v5c0 .414.336.75.75.75h4a.75.75 0 0 0 0-1.5h-3.25V5Z"],
|
|
169
|
-
unsnooze:
|
|
170
|
-
mute:
|
|
171
|
-
unmute:
|
|
178
|
+
unsnooze: Le,
|
|
179
|
+
mute: Ie,
|
|
180
|
+
unmute: Fe,
|
|
172
181
|
pause: ["M2 10a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm5-2.25A.75.75 0 0 1 7.75 7h.5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1-.75-.75v-4.5Zm4 0a.75.75 0 0 1 .75-.75h.5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-.75.75h-.5a.75.75 0 0 1-.75-.75v-4.5Z"],
|
|
173
|
-
paused:
|
|
182
|
+
paused: Ie,
|
|
174
183
|
more: ["M3 10a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM8.5 10a1.5 1.5 0 1 1 3 0 1.5 1.5 0 0 1-3 0ZM15.5 8.5a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z"],
|
|
175
184
|
delete: ["M8.75 1A2.75 2.75 0 0 0 6 3.75v.443c-.795.077-1.584.176-2.365.298a.75.75 0 1 0 .23 1.482l.149-.022.841 10.518A2.75 2.75 0 0 0 7.596 19h4.807a2.75 2.75 0 0 0 2.742-2.53l.841-10.52.149.023a.75.75 0 0 0 .23-1.482A41.03 41.03 0 0 0 14 4.193V3.75A2.75 2.75 0 0 0 11.25 1h-2.5ZM10 4c.84 0 1.673.025 2.5.075V3.75c0-.69-.56-1.25-1.25-1.25h-2.5c-.69 0-1.25.56-1.25 1.25v.325C8.327 4.025 9.16 4 10 4ZM8.58 7.72a.75.75 0 0 0-1.5.06l.3 7.5a.75.75 0 1 0 1.5-.06l-.3-7.5Zm4.34.06a.75.75 0 1 0-1.5-.06l-.3 7.5a.75.75 0 1 0 1.5.06l.3-7.5Z"],
|
|
176
|
-
empty:
|
|
185
|
+
empty: Le,
|
|
177
186
|
result: ["M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z"],
|
|
178
187
|
announcement: ["M13.92 3.845a19.362 19.362 0 0 1-6.3 1.98C6.765 5.942 5.89 6 5 6a4 4 0 0 0-.504 7.969 15.97 15.97 0 0 0 1.271 3.34c.397.771 1.342 1 2.05.59l.867-.5c.726-.419.94-1.32.588-2.02-.166-.331-.315-.666-.448-1.004 1.8.357 3.511.963 5.096 1.78A17.964 17.964 0 0 0 15 10c0-2.162-.381-4.235-1.08-6.155ZM15.243 3.097A19.456 19.456 0 0 1 16.5 10c0 2.43-.445 4.758-1.257 6.904l-.03.077a.75.75 0 0 0 1.401.537 20.903 20.903 0 0 0 1.312-5.745 2 2 0 0 0 0-3.546 20.902 20.902 0 0 0-1.312-5.745.75.75 0 0 0-1.4.537l.029.078Z"]
|
|
179
|
-
},
|
|
180
|
-
function
|
|
181
|
-
|
|
188
|
+
}, ze = null;
|
|
189
|
+
function Be(e) {
|
|
190
|
+
ze = e;
|
|
182
191
|
}
|
|
183
|
-
function
|
|
184
|
-
return
|
|
192
|
+
function Ve(e, t = {}) {
|
|
193
|
+
return ze?.(e, t) ?? null;
|
|
185
194
|
}
|
|
186
|
-
function
|
|
187
|
-
let i =
|
|
195
|
+
function He(e, t, n = {}, r) {
|
|
196
|
+
let i = je(n, e) ?? (r ? r(e, t) : Ve(e, t));
|
|
188
197
|
return i == null || i === !1 ? void 0 : i;
|
|
189
198
|
}
|
|
190
199
|
// ../js/translations.ts
|
|
191
|
-
var
|
|
200
|
+
var Ue = {
|
|
192
201
|
toaster_label: "Notifications",
|
|
193
202
|
toaster_label_with_hotkey: ":label (:hotkey)",
|
|
194
203
|
toaster_hotkey_alt: "Alt",
|
|
@@ -327,28 +336,28 @@ var He = {
|
|
|
327
336
|
preferences_retry: "Try again",
|
|
328
337
|
preferences_save_failed: "Your preferences could not be saved.",
|
|
329
338
|
preferences_push_device_remove_failed: "The device could not be removed."
|
|
330
|
-
},
|
|
331
|
-
function
|
|
332
|
-
for (let [t, n] of Object.entries(e)) n !== void 0 && (
|
|
339
|
+
}, We = Object.assign(Object.create(null), Ue);
|
|
340
|
+
function Ge(e) {
|
|
341
|
+
for (let [t, n] of Object.entries(e)) n !== void 0 && (We[t] = n);
|
|
333
342
|
}
|
|
334
|
-
var
|
|
335
|
-
function
|
|
343
|
+
var Ke = (e) => Object.hasOwn(We, e) ? We[e] : void 0;
|
|
344
|
+
function qe(e, t = {}) {
|
|
336
345
|
return typeof e == "function" ? e(t) : se(e, t);
|
|
337
346
|
}
|
|
338
|
-
function
|
|
339
|
-
let n =
|
|
340
|
-
return n === void 0 ? e :
|
|
347
|
+
function Je(e, t = {}) {
|
|
348
|
+
let n = Ke(e);
|
|
349
|
+
return n === void 0 ? e : qe(n, t);
|
|
341
350
|
}
|
|
342
|
-
var
|
|
343
|
-
function
|
|
344
|
-
return Object.fromEntries(t.map((t) => [t,
|
|
351
|
+
var Ye = (e, t) => e + t.replace(/[A-Z]/g, (e) => `_${e.toLowerCase()}`);
|
|
352
|
+
function Xe(e, t) {
|
|
353
|
+
return Object.fromEntries(t.map((t) => [t, Ue[Ye(e, t)]]));
|
|
345
354
|
}
|
|
346
|
-
function
|
|
355
|
+
function Ze(e, t, n) {
|
|
347
356
|
let r = (e) => n && Object.hasOwn(n, e) ? n[e] : void 0;
|
|
348
|
-
return Object.fromEntries(t.map((t) => [t, r(t) ??
|
|
357
|
+
return Object.fromEntries(t.map((t) => [t, r(t) ?? Ke(Ye(e, t)) ?? Ye(e, t)]));
|
|
349
358
|
}
|
|
350
359
|
// ../js/inbox.ts
|
|
351
|
-
var
|
|
360
|
+
var Qe = [
|
|
352
361
|
"read",
|
|
353
362
|
"unread",
|
|
354
363
|
"seen",
|
|
@@ -357,41 +366,41 @@ var Ze = [
|
|
|
357
366
|
"snooze",
|
|
358
367
|
"unsnooze",
|
|
359
368
|
"delete"
|
|
360
|
-
],
|
|
369
|
+
], $e = [
|
|
361
370
|
"snooze",
|
|
362
371
|
"archive",
|
|
363
372
|
"mute",
|
|
364
373
|
"delete"
|
|
365
|
-
],
|
|
374
|
+
], et = [
|
|
366
375
|
"snooze",
|
|
367
376
|
"archive",
|
|
368
377
|
"mute"
|
|
369
|
-
],
|
|
378
|
+
], tt = {
|
|
370
379
|
archive: "archive",
|
|
371
380
|
unarchive: "archive",
|
|
372
381
|
snooze: "snooze",
|
|
373
382
|
unsnooze: "snooze",
|
|
374
383
|
delete: "delete"
|
|
375
|
-
},
|
|
384
|
+
}, nt = (e, t) => (e !== "snoozed" || t.includes("snooze")) && (e !== "archived" || t.includes("archive")), rt = 100, it = "inertiauiInbox", Y = (e) => e ? Date.parse(e) : NaN, at = ({ counts: e, category: t, categoryCounts: n }) => t === null ? e.unread : n[t] ?? 0, ot = (e) => e.expiresAt !== null && Y(e.expiresAt) <= Date.now(), st = (e, t = Date.now()) => e.snoozedUntil !== null && Y(e.snoozedUntil) > t, ct = (e, t, n) => {
|
|
376
385
|
if (t === null || n === 0) return e;
|
|
377
386
|
let { [t]: r = 0, ...i } = e, a = Math.max(0, r + n);
|
|
378
387
|
return a === 0 ? i : {
|
|
379
388
|
...i,
|
|
380
389
|
[t]: a
|
|
381
390
|
};
|
|
382
|
-
},
|
|
391
|
+
}, lt = (e, t) => Y(e.createdAt) > Y(t.createdAt) || Y(e.createdAt) === Y(t.createdAt) && e.total > t.total, ut = (e, t) => {
|
|
383
392
|
let n = new Map(t.map((e) => [e.id, e])), r = e.filter((e) => {
|
|
384
393
|
let t = n.get(e.id);
|
|
385
|
-
return t === void 0 ||
|
|
394
|
+
return t === void 0 || lt(e, t);
|
|
386
395
|
}), i = new Set(r.map((e) => e.id));
|
|
387
396
|
return [...r, ...t.filter((e) => !i.has(e.id))];
|
|
388
|
-
},
|
|
397
|
+
}, dt = (e, { latest: t, latestIds: n }) => t !== null && (Y(e.createdAt) < Y(t) || Y(e.createdAt) === Y(t) && n.includes(e.id)), ft = (e) => G(e) ? {
|
|
389
398
|
name: K(e.name) ?? void 0,
|
|
390
399
|
avatar: fe(e.avatar)
|
|
391
400
|
} : null;
|
|
392
|
-
function
|
|
401
|
+
function pt(e) {
|
|
393
402
|
if (!G(e) || typeof e.id != "string" || typeof e.title != "string" || typeof e.createdAt != "string") return;
|
|
394
|
-
let t =
|
|
403
|
+
let t = ft(e.actor), n = (Array.isArray(e.actors) ? e.actors.map(ft) : [t]).filter((e) => e !== null);
|
|
395
404
|
return {
|
|
396
405
|
id: e.id,
|
|
397
406
|
type: K(e.type) ?? "",
|
|
@@ -422,8 +431,8 @@ function ft(e) {
|
|
|
422
431
|
expiresAt: K(e.expiresAt)
|
|
423
432
|
};
|
|
424
433
|
}
|
|
425
|
-
var
|
|
426
|
-
let t = G(e) ?
|
|
434
|
+
var mt = (e) => Array.isArray(e) ? {} : G(e) ? Object.fromEntries(Object.entries(e).filter((e) => typeof e[1] == "number")) : void 0, ht = (e) => {
|
|
435
|
+
let t = G(e) ? mt(e.categories) : void 0;
|
|
427
436
|
return G(e) && typeof e.unread == "number" && typeof e.unseen == "number" && typeof e.revision == "number" && (e.latest === null || typeof e.latest == "string") && Array.isArray(e.latestIds) && t !== void 0 ? {
|
|
428
437
|
unread: e.unread,
|
|
429
438
|
unseen: e.unseen,
|
|
@@ -435,7 +444,7 @@ var pt = (e) => Array.isArray(e) ? {} : G(e) ? Object.fromEntries(Object.entries
|
|
|
435
444
|
},
|
|
436
445
|
context: K(e.context)
|
|
437
446
|
} : void 0;
|
|
438
|
-
},
|
|
447
|
+
}, gt = (e) => G(e) ? Object.fromEntries(Object.entries(e).filter((e) => typeof e[1] == "string")) : {}, _t = (e) => Array.isArray(e) ? e.filter((e) => e === "tomorrow" || typeof e == "number" && Number.isInteger(e) && e > 0) : Pt, vt = (e) => G(e) ? Object.fromEntries(Object.entries(e).filter((e) => G(e[1])).map(([e, t]) => [e, {
|
|
439
448
|
label: K(t.label) ?? e,
|
|
440
449
|
category: K(t.category),
|
|
441
450
|
data: G(t.data) ? Object.fromEntries(Object.entries(t.data).filter((e) => [
|
|
@@ -443,8 +452,8 @@ var pt = (e) => Array.isArray(e) ? {} : G(e) ? Object.fromEntries(Object.entries
|
|
|
443
452
|
"number",
|
|
444
453
|
"boolean"
|
|
445
454
|
].includes(typeof e[1]))) : {}
|
|
446
|
-
}])) : {},
|
|
447
|
-
function
|
|
455
|
+
}])) : {}, yt = (e, t) => t !== void 0 && (t.category === null || e.category === t.category) && Object.entries(t.data).every(([t, n]) => e.data[t] === n);
|
|
456
|
+
function bt(e) {
|
|
448
457
|
if (!G(e)) return;
|
|
449
458
|
if (e.kind === "item") return typeof e.id == "string" ? {
|
|
450
459
|
kind: "item",
|
|
@@ -460,7 +469,7 @@ function yt(e) {
|
|
|
460
469
|
ids: e.ids.filter((e) => typeof e == "string")
|
|
461
470
|
} : void 0;
|
|
462
471
|
if (e.kind === "update") {
|
|
463
|
-
let t =
|
|
472
|
+
let t = pt(e.item);
|
|
464
473
|
return t === void 0 ? void 0 : {
|
|
465
474
|
kind: "update",
|
|
466
475
|
item: t
|
|
@@ -476,7 +485,7 @@ function yt(e) {
|
|
|
476
485
|
until: e.until
|
|
477
486
|
} : void 0;
|
|
478
487
|
if (e.kind === "items") {
|
|
479
|
-
let t =
|
|
488
|
+
let t = Qe.find((t) => t === e.action);
|
|
480
489
|
if (t === void 0 || t === "delete" || !Array.isArray(e.ids) || typeof e.at != "string" || t === "snooze" && typeof e.until != "string") return;
|
|
481
490
|
let n = e.ids.filter((e) => typeof e == "string");
|
|
482
491
|
return t === "snooze" ? {
|
|
@@ -507,25 +516,25 @@ function yt(e) {
|
|
|
507
516
|
category: n
|
|
508
517
|
} : void 0;
|
|
509
518
|
}
|
|
510
|
-
var
|
|
519
|
+
var xt = (e, t) => t.split(".").reduce((e, t) => G(e) ? e[t] : void 0, e), St = () => ({
|
|
511
520
|
unread: 0,
|
|
512
521
|
unseen: 0,
|
|
513
522
|
categories: {}
|
|
514
|
-
}),
|
|
523
|
+
}), Ct = 2147483647, wt = (e, { before: t, ids: n, category: r }) => {
|
|
515
524
|
if (r !== null && e.category !== r) return !1;
|
|
516
525
|
let i = Y(e.createdAt);
|
|
517
526
|
return i < Y(t) || i === Y(t) && (n === null || n.includes(e.id));
|
|
518
|
-
},
|
|
527
|
+
}, Tt = (e, t, n) => wt(e, t) ? t.kind === "archive" ? e.archivedAt === null && (!t.onlyRead || e.readAt !== null) ? {
|
|
519
528
|
...e,
|
|
520
529
|
archivedAt: n
|
|
521
530
|
} : e : t.kind === "seen" ? e.seenAt === null ? {
|
|
522
531
|
...e,
|
|
523
532
|
seenAt: n
|
|
524
|
-
} : e : e.readAt === null && e.archivedAt === null && !
|
|
533
|
+
} : e : e.readAt === null && e.archivedAt === null && !st(e) ? {
|
|
525
534
|
...e,
|
|
526
535
|
readAt: n,
|
|
527
536
|
seenAt: e.seenAt ?? n
|
|
528
|
-
} : e : e,
|
|
537
|
+
} : e : e, Et = (e, { action: t, ids: n, at: r, until: i }) => n.includes(e.id) ? t === "read" ? e.readAt === null ? {
|
|
529
538
|
...e,
|
|
530
539
|
readAt: r,
|
|
531
540
|
seenAt: e.seenAt ?? r
|
|
@@ -547,15 +556,15 @@ var bt = (e, t) => t.split(".").reduce((e, t) => G(e) ? e[t] : void 0, e), xt =
|
|
|
547
556
|
} : t === "unsnooze" ? e.snoozedUntil === null ? e : {
|
|
548
557
|
...e,
|
|
549
558
|
snoozedUntil: null
|
|
550
|
-
} : e : e,
|
|
559
|
+
} : e : e, Dt = (e, t, n) => t.kind === "items" ? Et(e, t) : Tt(e, t, n), Ot = ({ readAt: e, seenAt: t, archivedAt: n, snoozedUntil: r, result: i }) => ({
|
|
551
560
|
readAt: e,
|
|
552
561
|
seenAt: t,
|
|
553
562
|
archivedAt: n,
|
|
554
563
|
snoozedUntil: r,
|
|
555
564
|
result: i
|
|
556
565
|
});
|
|
557
|
-
function
|
|
558
|
-
let e, t =
|
|
566
|
+
function kt() {
|
|
567
|
+
let e, t = it, n, r = 0, i, a, o = null, s = null, c = et, l = !0, u = {}, d = Pt, f = {}, p = null, m, h, g = {
|
|
559
568
|
unread: 0,
|
|
560
569
|
unseen: 0
|
|
561
570
|
}, _ = {}, v = [], y = [], b = "all", x = null, S = "idle", C = !1, w = !1, T = null, E = 0, D, O = {}, k = 0, A = 0, j = /* @__PURE__ */ new Set(), M = /* @__PURE__ */ new Map(), N = [], P = [], F = /* @__PURE__ */ new Set(), I = /* @__PURE__ */ new Set(), L = /* @__PURE__ */ new Map(), R = /* @__PURE__ */ new Map(), z = !1, B = {
|
|
@@ -580,8 +589,8 @@ function Ot() {
|
|
|
580
589
|
...r,
|
|
581
590
|
...a.state
|
|
582
591
|
}, n = a.revision);
|
|
583
|
-
for (let e of N) e.revision > n && (r =
|
|
584
|
-
for (let t of P) t.kind === "bulk" ? r =
|
|
592
|
+
for (let e of N) e.revision > n && (r = Dt(r, e.change, e.at));
|
|
593
|
+
for (let t of P) t.kind === "bulk" ? r = Dt(r, t.change, t.at) : t.kind === "mute" && t.group === r.group ? r = {
|
|
585
594
|
...r,
|
|
586
595
|
muted: t.muted
|
|
587
596
|
} : t.kind === "item" && t.id === e.id && (t.createdAt === null || Y(e.createdAt) <= Y(t.createdAt)) && (r = {
|
|
@@ -589,13 +598,13 @@ function Ot() {
|
|
|
589
598
|
...t.state
|
|
590
599
|
});
|
|
591
600
|
return r;
|
|
592
|
-
}, se = (e) => I.has(e) || P.some((t) => t.kind === "delete" && t.ids.includes(e)), W = (e, t, n = null) => se(e.id) ||
|
|
601
|
+
}, se = (e) => I.has(e) || P.some((t) => t.kind === "delete" && t.ids.includes(e)), W = (e, t, n = null) => se(e.id) || ot(e) || n !== null && e.category !== n ? !1 : t === "archived" || e.archivedAt !== null ? t === "archived" && e.archivedAt !== null : st(e) === (t === "snoozed") ? t === "unread" ? e.readAt === null || F.has(e.id) : t === "all" || t === "snoozed" || yt(e, Object.hasOwn(f, t) ? f[t] : void 0) : !1, ce = () => {
|
|
593
602
|
let e = P.reduce((e, t) => t.kind === "pause" ? t.until : e, void 0), t = e === void 0 ? B.until : e;
|
|
594
603
|
return z && t !== null && Y(t) > Date.now() ? t : null;
|
|
595
604
|
}, le = (e) => {
|
|
596
605
|
e !== H && (clearTimeout(V), V = void 0, H = e, e !== null && (V = setTimeout(() => {
|
|
597
606
|
H = null, ce() === null ? q() : le(e);
|
|
598
|
-
}, Math.min(Y(e) - Date.now(),
|
|
607
|
+
}, Math.min(Y(e) - Date.now(), Ct))));
|
|
599
608
|
}, ue = (e, t) => {
|
|
600
609
|
t > B.revision && (B = {
|
|
601
610
|
until: e,
|
|
@@ -613,7 +622,7 @@ function Ot() {
|
|
|
613
622
|
categoryFilter: u,
|
|
614
623
|
tabs: f,
|
|
615
624
|
counts: g,
|
|
616
|
-
items:
|
|
625
|
+
items: ut(y, v).map(U).filter((e) => W(e, b, x)),
|
|
617
626
|
arrived: y,
|
|
618
627
|
filter: b,
|
|
619
628
|
category: x,
|
|
@@ -635,9 +644,9 @@ function Ot() {
|
|
|
635
644
|
D === void 0 || e > Y(D.at) ? D = {
|
|
636
645
|
at: t.createdAt,
|
|
637
646
|
ids: /* @__PURE__ */ new Set([t.id])
|
|
638
|
-
} : e === Y(D.at) && D.ids.add(t.id), t.revision !== null && oe(t.id,
|
|
647
|
+
} : e === Y(D.at) && D.ids.add(t.id), t.revision !== null && oe(t.id, Ot(t), t.revision);
|
|
639
648
|
}
|
|
640
|
-
}, me = () => (/* @__PURE__ */ new Date()).toISOString(), he = () => h !== void 0 && h.counted.latest !== null && (D === void 0 || Y(h.counted.latest) > Y(D.at)), ge = (e) => e.archivedAt === null && !
|
|
649
|
+
}, me = () => (/* @__PURE__ */ new Date()).toISOString(), he = () => h !== void 0 && h.counted.latest !== null && (D === void 0 || Y(h.counted.latest) > Y(D.at)), ge = (e) => e.archivedAt === null && !st(e), _e = (e) => ge(e) ? {
|
|
641
650
|
unread: +(e.readAt === null),
|
|
642
651
|
unseen: +(e.seenAt === null)
|
|
643
652
|
} : {
|
|
@@ -648,34 +657,34 @@ function Ot() {
|
|
|
648
657
|
g = {
|
|
649
658
|
unread: g.unread + t,
|
|
650
659
|
unseen: g.unseen + n
|
|
651
|
-
}, _ =
|
|
652
|
-
},
|
|
660
|
+
}, _ = ct(_, e.category, t);
|
|
661
|
+
}, xe = (e) => h === void 0 || !dt(e, h.counted), Ce = () => {
|
|
653
662
|
if (!(h === void 0 || P.length > 0)) {
|
|
654
663
|
g = {
|
|
655
664
|
unread: h.unread,
|
|
656
665
|
unseen: h.unseen
|
|
657
666
|
}, _ = h.categories;
|
|
658
|
-
for (let e of y)
|
|
667
|
+
for (let e of y) xe(e) && ve(U(e));
|
|
659
668
|
}
|
|
660
669
|
}, Te = (e) => {
|
|
661
|
-
let t =
|
|
662
|
-
!t || t.context !== p || h !== void 0 && t.revision < h.revision || (h = t,
|
|
663
|
-
},
|
|
670
|
+
let t = ht(G(e) ? e.counts : void 0);
|
|
671
|
+
!t || t.context !== p || h !== void 0 && t.revision < h.revision || (h = t, Ce());
|
|
672
|
+
}, Ee = ({ unread: e, unseen: t, categories: n }, r) => {
|
|
664
673
|
g = {
|
|
665
674
|
unread: Math.max(0, g.unread + r * e),
|
|
666
675
|
unseen: Math.max(0, g.unseen + r * t)
|
|
667
|
-
}, _ = Object.entries(n).reduce((e, [t, n]) =>
|
|
668
|
-
},
|
|
676
|
+
}, _ = Object.entries(n).reduce((e, [t, n]) => ct(e, t, r * n), _);
|
|
677
|
+
}, Oe = (e, t) => {
|
|
669
678
|
if (e.kind === "item") {
|
|
670
679
|
let { kind: n, id: r, ...i } = e;
|
|
671
680
|
oe(r, i, t);
|
|
672
|
-
} else if (e.kind === "delete")
|
|
681
|
+
} else if (e.kind === "delete") Ae(e.ids);
|
|
673
682
|
else if (e.kind === "update") {
|
|
674
683
|
let n = {
|
|
675
684
|
...e.item,
|
|
676
685
|
revision: e.item.revision ?? t
|
|
677
686
|
}, r = L.get(n.id);
|
|
678
|
-
(r === void 0 || (r.revision ?? 0) < n.revision) && L.set(n.id, n), oe(n.id,
|
|
687
|
+
(r === void 0 || (r.revision ?? 0) < n.revision) && L.set(n.id, n), oe(n.id, Ot(n), n.revision);
|
|
679
688
|
} else if (e.kind === "mute") {
|
|
680
689
|
let n = R.get(e.group);
|
|
681
690
|
(n === void 0 || n.revision < t) && R.set(e.group, {
|
|
@@ -687,10 +696,10 @@ function Ot() {
|
|
|
687
696
|
at: me(),
|
|
688
697
|
revision: t
|
|
689
698
|
}];
|
|
690
|
-
},
|
|
699
|
+
}, Ae = (e) => {
|
|
691
700
|
e.forEach((e) => I.add(e)), y = y.filter((e) => !I.has(e.id)), v = v.filter((e) => !I.has(e.id));
|
|
692
|
-
},
|
|
693
|
-
r++, E++, i = void 0, a = void 0, o = null, s = null, c =
|
|
701
|
+
}, J = () => {
|
|
702
|
+
r++, E++, i = void 0, a = void 0, o = null, s = null, c = et, l = !0, u = {}, d = Pt, f = {}, p = null, m = void 0, h = void 0, g = {
|
|
694
703
|
unread: 0,
|
|
695
704
|
unseen: 0
|
|
696
705
|
}, _ = {}, v = [], y = [], b = "all", x = null, S = "idle", C = !1, w = !1, T = null, D = void 0, O = {}, M.clear(), N = [], P = [], F.clear(), I.clear(), L.clear(), R.clear(), z = !1, B = {
|
|
@@ -702,28 +711,28 @@ function Ot() {
|
|
|
702
711
|
x !== null && n.set("category", x), t && n.set("cursor", t);
|
|
703
712
|
let r = await e.request("get", `${a}?${n.toString()}`);
|
|
704
713
|
return {
|
|
705
|
-
items: G(r) && Array.isArray(r.items) ? r.items.map(
|
|
714
|
+
items: G(r) && Array.isArray(r.items) ? r.items.map(pt).filter((e) => e !== void 0) : [],
|
|
706
715
|
cursor: G(r) && typeof r.nextCursor == "string" ? r.nextCursor : null,
|
|
707
716
|
body: r
|
|
708
717
|
};
|
|
709
718
|
}, Me = async (t, i, o) => {
|
|
710
719
|
if (!e || a === void 0) return;
|
|
711
720
|
let s = r;
|
|
712
|
-
P = [...P, t],
|
|
721
|
+
P = [...P, t], Ee(t.delta, 1), q();
|
|
713
722
|
try {
|
|
714
723
|
let n = await e.request("post", `${a}/${i}`, o);
|
|
715
724
|
if (s !== r) return;
|
|
716
|
-
let c = G(n) ? n : {}, l =
|
|
725
|
+
let c = G(n) ? n : {}, l = bt(c.change), u = ht(c.counts)?.revision;
|
|
717
726
|
if (!l || u === void 0) throw Error("The inbox endpoint answered without the change and the counts.");
|
|
718
|
-
P = P.filter((e) => e !== t),
|
|
727
|
+
P = P.filter((e) => e !== t), Oe(l, u), Te(c), ie.forEach((e) => e({
|
|
719
728
|
change: l,
|
|
720
729
|
counts: c.counts
|
|
721
730
|
}));
|
|
722
731
|
} catch (e) {
|
|
723
732
|
if (s !== r) return;
|
|
724
|
-
P = P.filter((e) => e !== t),
|
|
733
|
+
P = P.filter((e) => e !== t), Ee(t.delta, -1), n?.(e);
|
|
725
734
|
}
|
|
726
|
-
|
|
735
|
+
Ce(), q();
|
|
727
736
|
}, Ne = (e) => e.reduce((e, { before: t, after: n }) => {
|
|
728
737
|
let r = _e(t), i = n === void 0 ? {
|
|
729
738
|
unread: 0,
|
|
@@ -732,9 +741,9 @@ function Ot() {
|
|
|
732
741
|
return {
|
|
733
742
|
unread: e.unread + a,
|
|
734
743
|
unseen: e.unseen + i.unseen - r.unseen,
|
|
735
|
-
categories: t.category === null || a === 0 ? e.categories :
|
|
744
|
+
categories: t.category === null || a === 0 ? e.categories : ct(e.categories, t.category, a)
|
|
736
745
|
};
|
|
737
|
-
},
|
|
746
|
+
}, St()), Pe = (e, t, n) => {
|
|
738
747
|
let r = t.map((e) => e.id);
|
|
739
748
|
if (e === "delete") return Me({
|
|
740
749
|
kind: "delete",
|
|
@@ -755,7 +764,7 @@ function Ot() {
|
|
|
755
764
|
...n === void 0 ? {} : { until: n }
|
|
756
765
|
}, a = Ne(t.map((e) => ({
|
|
757
766
|
before: e,
|
|
758
|
-
after:
|
|
767
|
+
after: Et(e, i)
|
|
759
768
|
})));
|
|
760
769
|
return e === "seen" ? Me({
|
|
761
770
|
kind: "bulk",
|
|
@@ -792,7 +801,7 @@ function Ot() {
|
|
|
792
801
|
kind: "mute",
|
|
793
802
|
group: t,
|
|
794
803
|
muted: n,
|
|
795
|
-
delta:
|
|
804
|
+
delta: St()
|
|
796
805
|
}, `${encodeURIComponent(e.id)}/${n ? "mute" : "unmute"}`), Le = (e, t, n, r, i) => {
|
|
797
806
|
let a = D ? {
|
|
798
807
|
before: D.at,
|
|
@@ -838,7 +847,7 @@ function Ot() {
|
|
|
838
847
|
kind: "item",
|
|
839
848
|
id: t,
|
|
840
849
|
state: { readAt: r },
|
|
841
|
-
delta:
|
|
850
|
+
delta: St(),
|
|
842
851
|
createdAt: null
|
|
843
852
|
}, `${encodeURIComponent(t)}/read`) : n.readAt === null ? (F.add(t), Fe(n, {
|
|
844
853
|
readAt: r,
|
|
@@ -850,7 +859,7 @@ function Ot() {
|
|
|
850
859
|
kind: "item",
|
|
851
860
|
id: n,
|
|
852
861
|
state: {},
|
|
853
|
-
delta:
|
|
862
|
+
delta: St(),
|
|
854
863
|
createdAt: null
|
|
855
864
|
}, i, { action: t });
|
|
856
865
|
let a = r.actions[t]?.result;
|
|
@@ -868,26 +877,26 @@ function Ot() {
|
|
|
868
877
|
e = r, t = i.prop ?? t, n = i.onFailure ?? n;
|
|
869
878
|
},
|
|
870
879
|
sync(e, n) {
|
|
871
|
-
let r =
|
|
880
|
+
let r = xt(e, t), h = n === "history" || n === "cached";
|
|
872
881
|
if (!G(r)) {
|
|
873
|
-
r === null && !h && a !== void 0 && (
|
|
882
|
+
r === null && !h && a !== void 0 && (J(), q());
|
|
874
883
|
return;
|
|
875
884
|
}
|
|
876
885
|
let g = K(r.user) ?? void 0;
|
|
877
886
|
if (g !== i) {
|
|
878
887
|
if (h) return;
|
|
879
|
-
|
|
888
|
+
J(), i = g;
|
|
880
889
|
}
|
|
881
|
-
if (a = K(r.url) ?? a, o = K(r.channel), s = K(r.announcementsChannel), f =
|
|
890
|
+
if (a = K(r.url) ?? a, o = K(r.channel), s = K(r.announcementsChannel), f = vt(r.tabs), p = K(r.context), z = G(r.pause), !h) {
|
|
882
891
|
let e = r.allowedActions;
|
|
883
|
-
c = Array.isArray(e) ?
|
|
892
|
+
c = Array.isArray(e) ? $e.filter((t) => e.includes(t)) : et, l = r.selectable !== !1, u = gt(r.categoryFilter), d = _t(G(r.pause) ? r.pause.presets : void 0);
|
|
884
893
|
}
|
|
885
|
-
|
|
894
|
+
nt(b, c) || (b = "all", S !== "idle" && We.load()), !h && r !== m && (F.clear(), Te({ counts: r }), ee = r.push ?? null, G(r.pause) && ue(K(r.pause.until), typeof r.revision == "number" ? r.revision : 0)), m = r, q();
|
|
886
895
|
},
|
|
887
896
|
async load(t, n) {
|
|
888
897
|
if (!e || a === void 0) return;
|
|
889
898
|
let i = r, o = ++E;
|
|
890
|
-
x = n === void 0 ? t === void 0 ? x : null : n, b = t ?? b, b =
|
|
899
|
+
x = n === void 0 ? t === void 0 ? x : null : n, b = t ?? b, b = nt(b, c) ? b : "all", S = "loading", C = !1, w = !1, F.clear(), q();
|
|
891
900
|
try {
|
|
892
901
|
let e = await je(null);
|
|
893
902
|
i === r && o === E && (v = e.items, T = e.cursor, S = "ready", pe(e.items), Te(e.body));
|
|
@@ -929,25 +938,25 @@ function Ot() {
|
|
|
929
938
|
}
|
|
930
939
|
},
|
|
931
940
|
receive(e, t) {
|
|
932
|
-
let n =
|
|
933
|
-
if (!n || a === void 0 || I.has(n.id) || y.some((e) => e.id === n.id && !
|
|
941
|
+
let n = pt(e);
|
|
942
|
+
if (!n || a === void 0 || I.has(n.id) || y.some((e) => e.id === n.id && !lt(n, e))) return;
|
|
934
943
|
let r = G(e) ? K(e.context) : null;
|
|
935
944
|
if (p !== null && r !== null && r !== p) return;
|
|
936
945
|
y = [n, ...y.filter((e) => e.id !== n.id)].sort((e, t) => Y(t.createdAt) - Y(e.createdAt)), pe([n]);
|
|
937
946
|
let i = U(n);
|
|
938
|
-
return Te({ counts: t }), P.length > 0 || h === void 0 ?
|
|
947
|
+
return Te({ counts: t }), P.length > 0 || h === void 0 ? xe(n) && ve(i) : Ce(), q(), k > 0 && S === "ready" && W(i, b, x) && i.seenAt === null && We.markAllAsSeen(), ne.forEach((e) => e(n)), n;
|
|
939
948
|
},
|
|
940
949
|
onArrival(e) {
|
|
941
950
|
return ne.add(e), () => ne.delete(e);
|
|
942
951
|
},
|
|
943
952
|
receiveChange(e) {
|
|
944
|
-
let t = G(e) ? e.change : void 0, n =
|
|
953
|
+
let t = G(e) ? e.change : void 0, n = bt(t), r = ht(G(e) ? e.counts : void 0);
|
|
945
954
|
if (!n || r === void 0 || a === void 0) return;
|
|
946
955
|
let { revision: i } = r;
|
|
947
956
|
(r.context === p || n.kind !== "read" && n.kind !== "seen" && n.kind !== "archive") && (n.kind === "item" && G(t) && G(t.item) && We.receive({
|
|
948
957
|
...t.item,
|
|
949
958
|
revision: t.item.revision ?? i
|
|
950
|
-
}),
|
|
959
|
+
}), Oe(n, i), Te(e), q(), re.forEach((e) => e(n)));
|
|
951
960
|
},
|
|
952
961
|
onChange(e) {
|
|
953
962
|
return re.add(e), () => re.delete(e);
|
|
@@ -997,22 +1006,22 @@ function Ot() {
|
|
|
997
1006
|
return z ? Me({
|
|
998
1007
|
kind: "pause",
|
|
999
1008
|
until: t,
|
|
1000
|
-
delta:
|
|
1009
|
+
delta: St()
|
|
1001
1010
|
}, "pause", { until: t }) : Promise.resolve();
|
|
1002
1011
|
},
|
|
1003
1012
|
resume() {
|
|
1004
1013
|
return ce() === null ? Promise.resolve() : Me({
|
|
1005
1014
|
kind: "pause",
|
|
1006
1015
|
until: null,
|
|
1007
|
-
delta:
|
|
1016
|
+
delta: St()
|
|
1008
1017
|
}, "resume");
|
|
1009
1018
|
},
|
|
1010
1019
|
batch(e, t, n) {
|
|
1011
|
-
let r =
|
|
1020
|
+
let r = tt[e];
|
|
1012
1021
|
if (e !== "seen" && !l || r !== void 0 && !Ue(r)) return Promise.resolve();
|
|
1013
1022
|
if (e === "snooze" && n === void 0) return Promise.reject(/* @__PURE__ */ TypeError("Snoozing notifications needs the time to snooze them until."));
|
|
1014
1023
|
let i = t.map(U), a = e === "snooze" && n !== void 0 ? new Date(n).toISOString() : void 0, o = [];
|
|
1015
|
-
for (let t = 0; t < i.length; t +=
|
|
1024
|
+
for (let t = 0; t < i.length; t += rt) o.push(Pe(e, i.slice(t, t + rt), a));
|
|
1016
1025
|
return Promise.all(o).then(() => void 0);
|
|
1017
1026
|
},
|
|
1018
1027
|
delete(e) {
|
|
@@ -1036,7 +1045,7 @@ function Ot() {
|
|
|
1036
1045
|
},
|
|
1037
1046
|
archiveAll({ onlyRead: e = !1, category: t = x } = {}) {
|
|
1038
1047
|
if (!Ue("archive")) return Promise.resolve();
|
|
1039
|
-
let n = e ?
|
|
1048
|
+
let n = e ? St() : Re(!0, t);
|
|
1040
1049
|
return Le({
|
|
1041
1050
|
kind: "archive",
|
|
1042
1051
|
onlyRead: e
|
|
@@ -1058,20 +1067,20 @@ function Ot() {
|
|
|
1058
1067
|
if (n?.defaultPrevented) return;
|
|
1059
1068
|
Be(t);
|
|
1060
1069
|
let r = fe(t.url);
|
|
1061
|
-
r === void 0 || n &&
|
|
1070
|
+
r === void 0 || n && Se(n) || (n?.preventDefault(), !be(r) || !e ? window.location.assign(r) : e.visit(r, {}));
|
|
1062
1071
|
},
|
|
1063
1072
|
runAction(t, n, i) {
|
|
1064
1073
|
let a = t.actions[n];
|
|
1065
1074
|
if (!a || i?.defaultPrevented) return;
|
|
1066
1075
|
let o = ye(a);
|
|
1067
|
-
if (i && o !== void 0 &&
|
|
1068
|
-
a.event && !
|
|
1076
|
+
if (i && o !== void 0 && we(a, o, i)) {
|
|
1077
|
+
a.event && !Se(i) && window.dispatchEvent(new CustomEvent(a.event, { detail: a.payload })), De(o, a, i, () => void Be(t), a.result === void 0 ? void 0 : () => Ve(t, n));
|
|
1069
1078
|
return;
|
|
1070
1079
|
}
|
|
1071
1080
|
if (i?.preventDefault(), O[t.id] !== void 0) return;
|
|
1072
1081
|
Be(t);
|
|
1073
1082
|
let s = r, c = a.result === void 0 ? void 0 : He(t, n);
|
|
1074
|
-
|
|
1083
|
+
ke(a, t, e, () => {
|
|
1075
1084
|
if (s !== r) return;
|
|
1076
1085
|
let { [t.id]: e, ...n } = O;
|
|
1077
1086
|
O = n, q();
|
|
@@ -1083,10 +1092,10 @@ function Ot() {
|
|
|
1083
1092
|
};
|
|
1084
1093
|
return We;
|
|
1085
1094
|
}
|
|
1086
|
-
function
|
|
1087
|
-
return
|
|
1095
|
+
function At(e, t, n, r = null) {
|
|
1096
|
+
return ut(e.getSnapshot().arrived, t).map((t) => e.apply(t)).filter((t) => e.belongs(t, n, r));
|
|
1088
1097
|
}
|
|
1089
|
-
function
|
|
1098
|
+
function jt(e, t = !0) {
|
|
1090
1099
|
let n = [], r = /* @__PURE__ */ new Map();
|
|
1091
1100
|
for (let i of e) {
|
|
1092
1101
|
let e = t ? i.group : null, a = e === null ? void 0 : r.get(e);
|
|
@@ -1102,8 +1111,8 @@ function At(e, t = !0) {
|
|
|
1102
1111
|
}
|
|
1103
1112
|
return n;
|
|
1104
1113
|
}
|
|
1105
|
-
function
|
|
1106
|
-
let n =
|
|
1114
|
+
function Mt(e = {}, t = /* @__PURE__ */ new Date()) {
|
|
1115
|
+
let n = Jt(e), r = (e) => {
|
|
1107
1116
|
let n = new Date(t);
|
|
1108
1117
|
return n.setDate(t.getDate() + e), n.setHours(9, 0, 0, 0), n;
|
|
1109
1118
|
}, i = new Date(t.getTime() + 108e5), a = i.getDate() === t.getDate() ? [{
|
|
@@ -1122,7 +1131,7 @@ function jt(e = {}, t = /* @__PURE__ */ new Date()) {
|
|
|
1122
1131
|
}] : []
|
|
1123
1132
|
];
|
|
1124
1133
|
}
|
|
1125
|
-
function
|
|
1134
|
+
function Nt(e, t, n) {
|
|
1126
1135
|
let r = new Date(e), i = new Date(t).toDateString() === r.toDateString();
|
|
1127
1136
|
return r.toLocaleString(n, i ? {
|
|
1128
1137
|
hour: "numeric",
|
|
@@ -1133,18 +1142,18 @@ function Mt(e, t, n) {
|
|
|
1133
1142
|
minute: "2-digit"
|
|
1134
1143
|
});
|
|
1135
1144
|
}
|
|
1136
|
-
var
|
|
1145
|
+
var Pt = [
|
|
1137
1146
|
30,
|
|
1138
1147
|
60,
|
|
1139
1148
|
120,
|
|
1140
1149
|
"tomorrow"
|
|
1141
1150
|
];
|
|
1142
|
-
function
|
|
1151
|
+
function Ft(e, t = /* @__PURE__ */ new Date()) {
|
|
1143
1152
|
if (e !== "tomorrow") return new Date(t.getTime() + e * 6e4);
|
|
1144
1153
|
let n = new Date(t);
|
|
1145
1154
|
return n.setDate(t.getDate() + 1), n.setHours(8, 0, 0, 0), n;
|
|
1146
1155
|
}
|
|
1147
|
-
function
|
|
1156
|
+
function It(e, t, n) {
|
|
1148
1157
|
return e.filter((e) => e === "tomorrow" || Number.isFinite(e) && e > 0).map((e) => {
|
|
1149
1158
|
if (e === "tomorrow") return {
|
|
1150
1159
|
label: Z(t.pauseTomorrow),
|
|
@@ -1164,16 +1173,16 @@ function Ft(e, t, n) {
|
|
|
1164
1173
|
};
|
|
1165
1174
|
});
|
|
1166
1175
|
}
|
|
1167
|
-
function
|
|
1176
|
+
function Lt(e, t, n) {
|
|
1168
1177
|
let r = new Date(e);
|
|
1169
|
-
return r.getTime() - t < 5184e5 ?
|
|
1178
|
+
return r.getTime() - t < 5184e5 ? Nt(r, t, n) : r.toLocaleString(n, {
|
|
1170
1179
|
month: "short",
|
|
1171
1180
|
day: "numeric",
|
|
1172
1181
|
hour: "numeric",
|
|
1173
1182
|
minute: "2-digit"
|
|
1174
1183
|
});
|
|
1175
1184
|
}
|
|
1176
|
-
var
|
|
1185
|
+
var Rt = kt(), X = Rt, zt = {
|
|
1177
1186
|
load: X.load,
|
|
1178
1187
|
loadMore: X.loadMore,
|
|
1179
1188
|
refresh: X.refresh,
|
|
@@ -1200,11 +1209,11 @@ var Lt = Ot(), X = Lt, Rt = {
|
|
|
1200
1209
|
open: X.open,
|
|
1201
1210
|
runAction: X.runAction
|
|
1202
1211
|
};
|
|
1203
|
-
function
|
|
1212
|
+
function Bt(e) {
|
|
1204
1213
|
X.getSnapshot().url === void 0 && X.sync(e, "initial");
|
|
1205
1214
|
}
|
|
1206
|
-
var
|
|
1207
|
-
function
|
|
1215
|
+
var Vt = Rt;
|
|
1216
|
+
function Ht(e = 6e4) {
|
|
1208
1217
|
let t = /* @__PURE__ */ new Set(), n = Date.now(), r, i = () => {
|
|
1209
1218
|
n = Date.now(), t.forEach((e) => e());
|
|
1210
1219
|
};
|
|
@@ -1217,8 +1226,8 @@ function Vt(e = 6e4) {
|
|
|
1217
1226
|
getSnapshot: () => n
|
|
1218
1227
|
};
|
|
1219
1228
|
}
|
|
1220
|
-
var
|
|
1221
|
-
function
|
|
1229
|
+
var Ut = Ht();
|
|
1230
|
+
function Wt(e, t, n) {
|
|
1222
1231
|
let r = (Y(e) - t) / 1e3, i = new Intl.RelativeTimeFormat(n, { numeric: "auto" });
|
|
1223
1232
|
for (let [e, t] of [
|
|
1224
1233
|
["year", 31536e3],
|
|
@@ -1230,12 +1239,12 @@ function Ut(e, t, n) {
|
|
|
1230
1239
|
]) if (Math.abs(r) >= t) return i.format(Math.round(r / t), e);
|
|
1231
1240
|
return i.format(0, "second");
|
|
1232
1241
|
}
|
|
1233
|
-
function
|
|
1242
|
+
function Gt(e, t, n) {
|
|
1234
1243
|
let r = new Intl.NumberFormat(n);
|
|
1235
1244
|
return e > t ? `${r.format(t)}+` : r.format(e);
|
|
1236
1245
|
}
|
|
1237
|
-
var
|
|
1238
|
-
function
|
|
1246
|
+
var Kt = /* @__PURE__ */ "title.bell.bellNew.bellPaused.all.unread.archived.snoozed.markAllAsRead.archiveAll.moreActions.itemControl.markAsRead.markAsUnread.archive.unarchive.snooze.unsnooze.mute.unmute.muted.delete.select.selectAll.selected.selection.readSelected.unreadSelected.snoozeSelected.unsnoozeSelected.archiveSelected.unarchiveSelected.deleteSelected.clearSelection.showNew.snoozeUntil.snoozedUntil.snoozeLaterToday.snoozeTomorrow.snoozeNextWeek.pause.pauseFor.pauseTomorrow.pausedUntil.resume.showMore.showLess.unreadState.actorsAndOther.actorsAndOthers.empty.emptyUnread.emptyArchived.emptySnoozed.error.retry.categories.allCategories.loading.loadMore.viewAll.announcement".split("."), qt = Xe("inbox_", Kt), Jt = (e) => Ze("inbox_", Kt, e), Z = qe, Yt = (e) => e.actors.slice(0, 3);
|
|
1247
|
+
function Xt(e, t) {
|
|
1239
1248
|
let [n, r] = t.actors;
|
|
1240
1249
|
if (!(t.actorCount < 2 || !n?.name)) return t.actorCount > 2 ? Z(e.actorsAndOthers, {
|
|
1241
1250
|
name: n.name,
|
|
@@ -1246,8 +1255,8 @@ function Yt(e, t) {
|
|
|
1246
1255
|
}) : void 0;
|
|
1247
1256
|
}
|
|
1248
1257
|
// ../js/realtime.ts
|
|
1249
|
-
var
|
|
1250
|
-
function
|
|
1258
|
+
var Zt = ".inertiaui.inbox.arrived", Qt = ".inertiaui.inbox.changed", $t = ".inertiaui.announcement.published", en = 1e3, tn = "inertiaui-inbox";
|
|
1259
|
+
function nn(e, t, n) {
|
|
1251
1260
|
let r, i = !1, a, o, s = /* @__PURE__ */ new Set(), c = !1, l, u = () => {
|
|
1252
1261
|
try {
|
|
1253
1262
|
return r?.();
|
|
@@ -1268,7 +1277,7 @@ function tn(e, t, n) {
|
|
|
1268
1277
|
if (!G(t) || typeof t.id != "string") return;
|
|
1269
1278
|
let { id: r } = t, i = typeof t.context == "string" ? t.context : null, a = setTimeout(() => {
|
|
1270
1279
|
s.delete(a), e.loadArrival(r, i).then((e) => e && n(e));
|
|
1271
|
-
}, Math.random() *
|
|
1280
|
+
}, Math.random() * en);
|
|
1272
1281
|
s.add(a);
|
|
1273
1282
|
}, m = () => {
|
|
1274
1283
|
let { announcementsChannel: t } = e.getSnapshot();
|
|
@@ -1277,10 +1286,10 @@ function tn(e, t, n) {
|
|
|
1277
1286
|
let n = t === null ? void 0 : u();
|
|
1278
1287
|
if (!n || t === null || !r) return;
|
|
1279
1288
|
let i = n.private(t);
|
|
1280
|
-
i.listen(
|
|
1289
|
+
i.listen($t, p), o = {
|
|
1281
1290
|
channel: t,
|
|
1282
1291
|
resolve: r,
|
|
1283
|
-
stop: () => i.stopListening(
|
|
1292
|
+
stop: () => i.stopListening($t, p)
|
|
1284
1293
|
};
|
|
1285
1294
|
}, h = () => {
|
|
1286
1295
|
g(), m();
|
|
@@ -1291,7 +1300,7 @@ function tn(e, t, n) {
|
|
|
1291
1300
|
let n = t === null ? void 0 : u();
|
|
1292
1301
|
if (!n || t === null || !r) return;
|
|
1293
1302
|
let i = n.private(t);
|
|
1294
|
-
i.listen(
|
|
1303
|
+
i.listen(Zt, d), i.listen(Qt, f);
|
|
1295
1304
|
let o = !1, s = n.connector?.onConnectionChange?.((t) => {
|
|
1296
1305
|
t === "connected" && o && e.refresh(), o = t !== "connected";
|
|
1297
1306
|
});
|
|
@@ -1299,7 +1308,7 @@ function tn(e, t, n) {
|
|
|
1299
1308
|
channel: t,
|
|
1300
1309
|
resolve: r,
|
|
1301
1310
|
stop() {
|
|
1302
|
-
i.stopListening(
|
|
1311
|
+
i.stopListening(Zt, d), i.stopListening(Qt, f), typeof s == "function" && s();
|
|
1303
1312
|
}
|
|
1304
1313
|
};
|
|
1305
1314
|
}, _ = () => typeof document < "u" && document.visibilityState === "hidden", v = () => {
|
|
@@ -1308,7 +1317,7 @@ function tn(e, t, n) {
|
|
|
1308
1317
|
c && !_() && e.refresh(), v();
|
|
1309
1318
|
};
|
|
1310
1319
|
typeof document < "u" && document.addEventListener("visibilitychange", y);
|
|
1311
|
-
let b = typeof BroadcastChannel == "function" ? new BroadcastChannel(
|
|
1320
|
+
let b = typeof BroadcastChannel == "function" ? new BroadcastChannel(tn) : void 0;
|
|
1312
1321
|
b?.addEventListener("message", (t) => {
|
|
1313
1322
|
let { url: n, user: r, channel: i } = e.getSnapshot(), a = t.data;
|
|
1314
1323
|
G(a) && n !== void 0 && a.url === n && a.user === r && a.channel === i && e.receiveChange(a);
|
|
@@ -1336,21 +1345,21 @@ function tn(e, t, n) {
|
|
|
1336
1345
|
}
|
|
1337
1346
|
};
|
|
1338
1347
|
}
|
|
1339
|
-
var
|
|
1340
|
-
function
|
|
1348
|
+
var rn = "inertiaui-inbox-", an = (e) => `${rn}${e}`, on = (e) => e.startsWith(rn) ? e.slice(16) : void 0;
|
|
1349
|
+
function sn(e, t, n) {
|
|
1341
1350
|
let r = t === "none" || e.announcement || e.quiet === !0 || e.readAt !== null || e.archivedAt !== null ? null : e.toast ?? (t === "all" ? "default" : null);
|
|
1342
1351
|
if (r === null) return;
|
|
1343
|
-
let { title: i, ...a } =
|
|
1352
|
+
let { title: i, ...a } = cn(e, n);
|
|
1344
1353
|
return {
|
|
1345
1354
|
title: i,
|
|
1346
1355
|
options: {
|
|
1347
|
-
id:
|
|
1356
|
+
id: an(e.id),
|
|
1348
1357
|
type: r,
|
|
1349
1358
|
...a
|
|
1350
1359
|
}
|
|
1351
1360
|
};
|
|
1352
1361
|
}
|
|
1353
|
-
function
|
|
1362
|
+
function cn(e, t) {
|
|
1354
1363
|
let n = e.actions.length > 0 || e.url === null ? e.actions.map(({ onClick: e, ...t }) => t) : [{
|
|
1355
1364
|
...t,
|
|
1356
1365
|
href: e.url
|
|
@@ -1364,8 +1373,8 @@ function sn(e, t) {
|
|
|
1364
1373
|
};
|
|
1365
1374
|
}
|
|
1366
1375
|
// ../js/browserAlerts.ts
|
|
1367
|
-
var
|
|
1368
|
-
function
|
|
1376
|
+
var ln = "inertiaui-notifications";
|
|
1377
|
+
function un(e) {
|
|
1369
1378
|
let t = document, n = navigator.locks;
|
|
1370
1379
|
if (!n) return {
|
|
1371
1380
|
elected: () => t.visibilityState === "visible",
|
|
@@ -1391,25 +1400,25 @@ function ln(e) {
|
|
|
1391
1400
|
}
|
|
1392
1401
|
};
|
|
1393
1402
|
}
|
|
1394
|
-
async function
|
|
1403
|
+
async function dn() {
|
|
1395
1404
|
return typeof Notification == "function" ? Notification.requestPermission() : "denied";
|
|
1396
1405
|
}
|
|
1397
|
-
var
|
|
1398
|
-
function
|
|
1406
|
+
var fn;
|
|
1407
|
+
function pn() {
|
|
1399
1408
|
if (typeof AudioContext != "function") return;
|
|
1400
|
-
|
|
1401
|
-
let e =
|
|
1409
|
+
fn ??= new AudioContext();
|
|
1410
|
+
let e = fn;
|
|
1402
1411
|
for (let [t, n] of [880, 1320].entries()) {
|
|
1403
1412
|
let r = e.currentTime + t * .15, i = e.createOscillator(), a = e.createGain();
|
|
1404
1413
|
i.frequency.value = n, a.gain.setValueAtTime(.2, r), a.gain.exponentialRampToValueAtTime(.001, r + .4), i.connect(a).connect(e.destination), i.start(r), i.stop(r + .4);
|
|
1405
1414
|
}
|
|
1406
1415
|
}
|
|
1407
|
-
function
|
|
1416
|
+
function mn(e) {
|
|
1408
1417
|
let t = !1, n = "", r, i, a, o = !1, s, c = !1, l = !1, u, d, f = () => {
|
|
1409
1418
|
let a = document.title !== i;
|
|
1410
1419
|
a && (n = document.title);
|
|
1411
|
-
let { unread: o } = e.getSnapshot().counts, s = t && o > 0 ?
|
|
1412
|
-
count:
|
|
1420
|
+
let { unread: o } = e.getSnapshot().counts, s = t && o > 0 ? Je("inbox_title_count", {
|
|
1421
|
+
count: Gt(o, 99),
|
|
1413
1422
|
number: o,
|
|
1414
1423
|
title: n
|
|
1415
1424
|
}) : n;
|
|
@@ -1427,7 +1436,7 @@ function pn(e) {
|
|
|
1427
1436
|
e !== o && (o = e, m());
|
|
1428
1437
|
}, g = () => {
|
|
1429
1438
|
let e = c || l !== !1;
|
|
1430
|
-
e && !d && (d = ln
|
|
1439
|
+
e && !d && (d = un(ln)), !e && d && (d.stop(), d = void 0);
|
|
1431
1440
|
}, _ = (t) => {
|
|
1432
1441
|
if (typeof Notification != "function" || Notification.permission !== "granted") return;
|
|
1433
1442
|
let n;
|
|
@@ -1435,7 +1444,7 @@ function pn(e) {
|
|
|
1435
1444
|
n = new Notification(t.title, {
|
|
1436
1445
|
body: t.body ?? void 0,
|
|
1437
1446
|
icon: t.actor?.avatar,
|
|
1438
|
-
tag:
|
|
1447
|
+
tag: an(t.id)
|
|
1439
1448
|
});
|
|
1440
1449
|
} catch {
|
|
1441
1450
|
return;
|
|
@@ -1444,7 +1453,7 @@ function pn(e) {
|
|
|
1444
1453
|
window.focus(), n.close(), e.open(t);
|
|
1445
1454
|
});
|
|
1446
1455
|
}, v = (e) => {
|
|
1447
|
-
navigator.userActivation?.hasBeenActive !== !1 && (e === !0 ?
|
|
1456
|
+
navigator.userActivation?.hasBeenActive !== !1 && (e === !0 ? pn() : (u?.getAttribute("src") !== e && (u = new Audio(e)), u.currentTime = 0, u.play().catch(() => {})));
|
|
1448
1457
|
};
|
|
1449
1458
|
return e.onArrival((e) => {
|
|
1450
1459
|
d?.elected() && e.quiet !== !0 && e.readAt === null && e.archivedAt === null && (c && document.visibilityState === "hidden" && _(e), l !== !1 && v(l));
|
|
@@ -1455,12 +1464,12 @@ function pn(e) {
|
|
|
1455
1464
|
} };
|
|
1456
1465
|
}
|
|
1457
1466
|
// ../js/preferences.ts
|
|
1458
|
-
var
|
|
1467
|
+
var hn = [
|
|
1459
1468
|
"instant",
|
|
1460
1469
|
"hourly",
|
|
1461
1470
|
"daily",
|
|
1462
1471
|
"weekly"
|
|
1463
|
-
],
|
|
1472
|
+
], gn = [
|
|
1464
1473
|
"monday",
|
|
1465
1474
|
"tuesday",
|
|
1466
1475
|
"wednesday",
|
|
@@ -1468,29 +1477,29 @@ var mn = [
|
|
|
1468
1477
|
"friday",
|
|
1469
1478
|
"saturday",
|
|
1470
1479
|
"sunday"
|
|
1471
|
-
],
|
|
1480
|
+
], _n = {
|
|
1472
1481
|
status: "idle",
|
|
1473
1482
|
channels: [],
|
|
1474
1483
|
groups: [],
|
|
1475
1484
|
categories: [],
|
|
1476
1485
|
notificationHours: null,
|
|
1477
|
-
frequencies:
|
|
1478
|
-
},
|
|
1486
|
+
frequencies: hn
|
|
1487
|
+
}, vn = (e, t) => typeof e == "string" ? e : t, yn = (e) => hn.includes(e), bn = (e) => typeof e == "string" && /^([01]\d|2[0-3]):[0-5]\d-([01]\d|2[0-3]):[0-5]\d$/.test(e), xn = (e) => [...e].sort(), Sn = (e) => {
|
|
1479
1488
|
if (!G(e) || !G(e.days)) return null;
|
|
1480
1489
|
let t = e.days;
|
|
1481
1490
|
return {
|
|
1482
1491
|
enabled: e.enabled === !0,
|
|
1483
|
-
days: Object.fromEntries(
|
|
1492
|
+
days: Object.fromEntries(gn.map((e) => [e, xn(Array.isArray(t[e]) ? t[e].filter(bn) : [])]))
|
|
1484
1493
|
};
|
|
1485
|
-
},
|
|
1486
|
-
let t = Array.isArray(e) ?
|
|
1487
|
-
return t.length > 0 ? t :
|
|
1494
|
+
}, Cn = (e) => {
|
|
1495
|
+
let t = Array.isArray(e) ? hn.filter((t) => e.includes(t)) : [];
|
|
1496
|
+
return t.length > 0 ? t : hn;
|
|
1488
1497
|
};
|
|
1489
|
-
function
|
|
1498
|
+
function wn(e) {
|
|
1490
1499
|
if (G(e) && Array.isArray(e.channels) && Array.isArray(e.categories)) return {
|
|
1491
1500
|
channels: e.channels.filter(G).flatMap((e) => typeof e.key == "string" ? [{
|
|
1492
1501
|
key: e.key,
|
|
1493
|
-
label:
|
|
1502
|
+
label: vn(e.label, e.key),
|
|
1494
1503
|
globalSwitch: e.globalSwitch === !0,
|
|
1495
1504
|
enabled: e.enabled !== !1,
|
|
1496
1505
|
digest: e.digest === !0,
|
|
@@ -1499,23 +1508,23 @@ function Cn(e) {
|
|
|
1499
1508
|
}] : []),
|
|
1500
1509
|
groups: (Array.isArray(e.groups) ? e.groups : []).filter(G).flatMap((e) => typeof e.key == "string" ? [{
|
|
1501
1510
|
key: e.key,
|
|
1502
|
-
label:
|
|
1511
|
+
label: vn(e.label, e.key),
|
|
1503
1512
|
description: K(e.description)
|
|
1504
1513
|
}] : []),
|
|
1505
1514
|
categories: e.categories.filter(G).flatMap((e) => typeof e.key == "string" ? [{
|
|
1506
1515
|
key: e.key,
|
|
1507
|
-
label:
|
|
1516
|
+
label: vn(e.label, e.key),
|
|
1508
1517
|
description: K(e.description),
|
|
1509
1518
|
group: K(e.group),
|
|
1510
1519
|
locked: e.locked === !0,
|
|
1511
1520
|
channels: Object.fromEntries(Object.entries(G(e.channels) ? e.channels : {}).filter((e) => typeof e[1] == "boolean")),
|
|
1512
|
-
frequency:
|
|
1521
|
+
frequency: yn(e.frequency) ? e.frequency : null
|
|
1513
1522
|
}] : []),
|
|
1514
|
-
notificationHours:
|
|
1515
|
-
frequencies:
|
|
1523
|
+
notificationHours: Sn(e.notificationHours),
|
|
1524
|
+
frequencies: Cn(e.frequencies)
|
|
1516
1525
|
};
|
|
1517
1526
|
}
|
|
1518
|
-
function
|
|
1527
|
+
function Tn(e) {
|
|
1519
1528
|
let t = new Set(e.groups.map(({ key: e }) => e)), n = e.categories.filter(({ group: e }) => e === null || !t.has(e)), r = e.groups.map((t) => ({
|
|
1520
1529
|
group: t,
|
|
1521
1530
|
categories: e.categories.filter((e) => e.group === t.key)
|
|
@@ -1525,47 +1534,47 @@ function wn(e) {
|
|
|
1525
1534
|
categories: n
|
|
1526
1535
|
}] : [], ...r.filter(({ categories: e }) => e.length > 0)];
|
|
1527
1536
|
}
|
|
1528
|
-
var
|
|
1537
|
+
var En = (e, t) => e.locked || t.enabled && e.channels[t.key] === !0, Dn = (e, t, n) => {
|
|
1529
1538
|
let r = n.find((e) => e.inbox);
|
|
1530
|
-
return !t.push || r === void 0 || r.key === t.key || e.channels[r.key] === void 0 ||
|
|
1531
|
-
},
|
|
1539
|
+
return !t.push || r === void 0 || r.key === t.key || e.channels[r.key] === void 0 || En(e, r);
|
|
1540
|
+
}, On = (e, t, n) => En(e, t) && Dn(e, t, n), kn = (e, t, n) => e.locked || !t.enabled || !Dn(e, t, n), An = (e, t) => e.frequency !== null && t.some((n) => n.digest && e.channels[n.key] !== void 0 && On(e, n, t)), jn = (e, t) => new Intl.DateTimeFormat(t, {
|
|
1532
1541
|
weekday: "long",
|
|
1533
1542
|
timeZone: "UTC"
|
|
1534
|
-
}).format(Date.UTC(2024, 0, 1 +
|
|
1543
|
+
}).format(Date.UTC(2024, 0, 1 + gn.indexOf(e))), Mn = (e) => {
|
|
1535
1544
|
let [t = "", n = ""] = e.split("-");
|
|
1536
1545
|
return [t, n];
|
|
1537
|
-
},
|
|
1538
|
-
function
|
|
1539
|
-
let n =
|
|
1540
|
-
for (let t = 1; t <
|
|
1541
|
-
let [r] = e.days[
|
|
1546
|
+
}, Nn = (e, t) => e.days[t].length > 0 && gn.every((n) => n === t || e.days[n].length === 0);
|
|
1547
|
+
function Pn(e, t) {
|
|
1548
|
+
let n = gn.indexOf(t);
|
|
1549
|
+
for (let t = 1; t < gn.length; t++) {
|
|
1550
|
+
let [r] = e.days[gn[(n + gn.length - t) % gn.length]];
|
|
1542
1551
|
if (r !== void 0) return r;
|
|
1543
1552
|
}
|
|
1544
1553
|
return "09:00-17:00";
|
|
1545
1554
|
}
|
|
1546
|
-
var
|
|
1547
|
-
function
|
|
1548
|
-
let t = e.map((e) =>
|
|
1555
|
+
var Fn = 1440, In = (e) => Number(e.slice(0, 2)) * 60 + Number(e.slice(3)), Ln = (e) => [Math.floor(e / 60) % 24, e % 60].map((e) => String(e).padStart(2, "0")).join(":");
|
|
1556
|
+
function Rn(e) {
|
|
1557
|
+
let t = e.map((e) => Mn(e).map(In));
|
|
1549
1558
|
if (t.length === 0 || t.some(([e, t]) => t <= e)) return;
|
|
1550
1559
|
let n = Math.max(...t.map(([, e]) => e));
|
|
1551
|
-
return n + 120 <=
|
|
1560
|
+
return n + 120 <= Fn ? `${Ln(n + 60)}-${Ln(n + 120)}` : void 0;
|
|
1552
1561
|
}
|
|
1553
|
-
var
|
|
1562
|
+
var zn = (e, t, n) => t?.day === n ? t.ranges : e?.days[n] ?? [], Bn = (e, t, n) => e === null ? [] : gn.map((r) => ({
|
|
1554
1563
|
day: r,
|
|
1555
|
-
name:
|
|
1556
|
-
ranges:
|
|
1557
|
-
locked: !e.enabled ||
|
|
1558
|
-
canAdd: e.enabled &&
|
|
1564
|
+
name: jn(r, n),
|
|
1565
|
+
ranges: zn(e, t, r).map(Mn),
|
|
1566
|
+
locked: !e.enabled || Nn(e, r),
|
|
1567
|
+
canAdd: e.enabled && Rn(e.days[r]) !== void 0
|
|
1559
1568
|
}));
|
|
1560
|
-
function
|
|
1561
|
-
let { day: r } = n, i =
|
|
1569
|
+
function Vn(e, t, n) {
|
|
1570
|
+
let { day: r } = n, i = zn(e, t, r), a;
|
|
1562
1571
|
switch (n.kind) {
|
|
1563
1572
|
case "toggle":
|
|
1564
|
-
if (!e?.enabled ||
|
|
1565
|
-
a = e.days[r].length > 0 ? [] : [
|
|
1573
|
+
if (!e?.enabled || Nn(e, r)) return;
|
|
1574
|
+
a = e.days[r].length > 0 ? [] : [Pn(e, r)];
|
|
1566
1575
|
break;
|
|
1567
1576
|
case "time": {
|
|
1568
|
-
let [e, t] =
|
|
1577
|
+
let [e, t] = Mn(i[n.index] ?? ""), o = n.field === "start" ? `${n.time}-${t}` : `${e}-${n.time}`;
|
|
1569
1578
|
return a = i.map((e, t) => t === n.index ? o : e), {
|
|
1570
1579
|
ranges: a,
|
|
1571
1580
|
editing: () => ({
|
|
@@ -1578,7 +1587,7 @@ function Bn(e, t, n) {
|
|
|
1578
1587
|
a = i.filter((e, t) => t !== n.index);
|
|
1579
1588
|
break;
|
|
1580
1589
|
case "add": {
|
|
1581
|
-
let t =
|
|
1590
|
+
let t = Rn(i);
|
|
1582
1591
|
if (!e?.enabled || t === void 0) return;
|
|
1583
1592
|
a = [...i, t];
|
|
1584
1593
|
}
|
|
@@ -1591,23 +1600,23 @@ function Bn(e, t, n) {
|
|
|
1591
1600
|
} : e
|
|
1592
1601
|
};
|
|
1593
1602
|
}
|
|
1594
|
-
var
|
|
1603
|
+
var Hn = () => {
|
|
1595
1604
|
try {
|
|
1596
1605
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
1597
1606
|
} catch {
|
|
1598
1607
|
return;
|
|
1599
1608
|
}
|
|
1600
|
-
},
|
|
1601
|
-
function
|
|
1609
|
+
}, Un = (e, t) => e.enabled === t.enabled && gn.every((n) => e.days[n].join() === t.days[n].join()), Wn = (e, t) => typeof e == "object" && typeof t == "object" ? Un(e, t) : e === t, Gn = "*", Kn = "*";
|
|
1610
|
+
function qn() {
|
|
1602
1611
|
let e, t, n, r = 0, i = 0, a = 0, o = {
|
|
1603
1612
|
channels: [],
|
|
1604
1613
|
categories: [],
|
|
1605
1614
|
notificationHours: null
|
|
1606
|
-
}, s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u =
|
|
1607
|
-
if (t === null) return n ===
|
|
1615
|
+
}, s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = _n, d = /* @__PURE__ */ new Set(), f = ({ category: e, channel: t }) => JSON.stringify([e, t]), p = (e, { category: t, channel: n }) => {
|
|
1616
|
+
if (t === null) return n === Kn ? e.notificationHours ?? void 0 : e.channels.find(({ key: e }) => e === n)?.enabled;
|
|
1608
1617
|
let r = e.categories.find(({ key: e }) => e === t);
|
|
1609
|
-
return n ===
|
|
1610
|
-
}, m = (e, t, n) => t ===
|
|
1618
|
+
return n === Gn ? r?.frequency ?? void 0 : r?.channels[n];
|
|
1619
|
+
}, m = (e, t, n) => t === Gn ? e.frequency !== null && yn(n) ? {
|
|
1611
1620
|
...e,
|
|
1612
1621
|
frequency: n
|
|
1613
1622
|
} : e : e.channels[t] !== void 0 && typeof n == "boolean" ? {
|
|
@@ -1616,7 +1625,7 @@ function Kn() {
|
|
|
1616
1625
|
...e.channels,
|
|
1617
1626
|
[t]: n
|
|
1618
1627
|
}
|
|
1619
|
-
} : e, h = (e, { category: t, channel: n }, r) => t === null ? n ===
|
|
1628
|
+
} : e, h = (e, { category: t, channel: n }, r) => t === null ? n === Kn ? e.notificationHours !== null && typeof r == "object" ? {
|
|
1620
1629
|
...e,
|
|
1621
1630
|
notificationHours: r
|
|
1622
1631
|
} : e : typeof r == "boolean" ? {
|
|
@@ -1628,12 +1637,12 @@ function Kn() {
|
|
|
1628
1637
|
} : e : {
|
|
1629
1638
|
...e,
|
|
1630
1639
|
categories: e.categories.map((e) => e.key === t ? m(e, n, r) : e)
|
|
1631
|
-
}, g = ({ category: e, channel: t }, n) => e === null ? t ===
|
|
1640
|
+
}, g = ({ category: e, channel: t }, n) => e === null ? t === Kn ? {
|
|
1632
1641
|
notificationHours: n,
|
|
1633
|
-
timezone:
|
|
1634
|
-
} : { channels: { [t]: n } } : t ===
|
|
1642
|
+
timezone: Hn()
|
|
1643
|
+
} : { channels: { [t]: n } } : t === Gn ? {
|
|
1635
1644
|
frequencies: { [e]: n },
|
|
1636
|
-
timezone:
|
|
1645
|
+
timezone: Hn()
|
|
1637
1646
|
} : { preferences: { [e]: { [t]: n } } }, _ = (e) => {
|
|
1638
1647
|
u = {
|
|
1639
1648
|
...u,
|
|
@@ -1645,7 +1654,7 @@ function Kn() {
|
|
|
1645
1654
|
}), y = async (i, c) => {
|
|
1646
1655
|
let u = r, d = s.get(c).value;
|
|
1647
1656
|
try {
|
|
1648
|
-
let t =
|
|
1657
|
+
let t = wn(await e.request("post", `${n}/preferences`, g(i, d)));
|
|
1649
1658
|
if (u !== r) return;
|
|
1650
1659
|
o = h(o, i, (t && p(t, i)) ?? d), l.set(c, {
|
|
1651
1660
|
cell: i,
|
|
@@ -1655,7 +1664,7 @@ function Kn() {
|
|
|
1655
1664
|
if (u !== r) return;
|
|
1656
1665
|
t?.(e);
|
|
1657
1666
|
}
|
|
1658
|
-
(
|
|
1667
|
+
(Wn(s.get(c)?.value, d) || Wn(s.get(c)?.value, p(o, i))) && s.delete(c), v(), s.has(c) && await y(i, c);
|
|
1659
1668
|
}, b = (e, t, n) => {
|
|
1660
1669
|
let i = {
|
|
1661
1670
|
category: e,
|
|
@@ -1685,7 +1694,7 @@ function Kn() {
|
|
|
1685
1694
|
else {
|
|
1686
1695
|
_({ status: "loading" });
|
|
1687
1696
|
try {
|
|
1688
|
-
let t =
|
|
1697
|
+
let t = wn(await e.request("get", `${n}/preferences`));
|
|
1689
1698
|
if (s !== r || c !== i) return;
|
|
1690
1699
|
if (!t) {
|
|
1691
1700
|
_({ status: "error" });
|
|
@@ -1715,36 +1724,36 @@ function Kn() {
|
|
|
1715
1724
|
},
|
|
1716
1725
|
setFrequency(t, r) {
|
|
1717
1726
|
let i = u.categories.find(({ key: e }) => e === t);
|
|
1718
|
-
return !e || n === void 0 || !i || i.frequency === null || i.frequency === r || !u.frequencies.includes(r) ? Promise.resolve() : b(t,
|
|
1727
|
+
return !e || n === void 0 || !i || i.frequency === null || i.frequency === r || !u.frequencies.includes(r) ? Promise.resolve() : b(t, Gn, r);
|
|
1719
1728
|
},
|
|
1720
1729
|
setNotificationHours(t) {
|
|
1721
1730
|
let r = u.notificationHours;
|
|
1722
1731
|
if (!e || n === void 0 || r === null) return Promise.resolve();
|
|
1723
|
-
let i =
|
|
1724
|
-
if (!i.every(([, e]) => Array.isArray(e) && e.every(
|
|
1732
|
+
let i = gn.map((e) => [e, t.days?.[e] ?? r.days[e]]);
|
|
1733
|
+
if (!i.every(([, e]) => Array.isArray(e) && e.every(bn)) || i.every(([, e]) => e.length === 0)) return Promise.resolve();
|
|
1725
1734
|
let a = {
|
|
1726
1735
|
enabled: t.enabled ?? r.enabled,
|
|
1727
|
-
days: Object.fromEntries(i.map(([e, t]) => [e,
|
|
1736
|
+
days: Object.fromEntries(i.map(([e, t]) => [e, xn(t)]))
|
|
1728
1737
|
};
|
|
1729
|
-
return
|
|
1738
|
+
return Wn(a, r) ? Promise.resolve() : b(null, Kn, a);
|
|
1730
1739
|
},
|
|
1731
1740
|
reset(e) {
|
|
1732
1741
|
r++, i++, o = {
|
|
1733
1742
|
channels: [],
|
|
1734
1743
|
categories: [],
|
|
1735
1744
|
notificationHours: null
|
|
1736
|
-
}, s.clear(), c.clear(), l.clear(), n = e, _(
|
|
1745
|
+
}, s.clear(), c.clear(), l.clear(), n = e, _(_n), d.size > 0 && e !== void 0 && x.load(e);
|
|
1737
1746
|
}
|
|
1738
1747
|
};
|
|
1739
1748
|
return x;
|
|
1740
1749
|
}
|
|
1741
|
-
var
|
|
1750
|
+
var Jn = /* @__PURE__ */ "title.category.toggle.locked.global.globalDescription.frequency.frequencyLabel.frequencyInstant.frequencyHourly.frequencyDaily.frequencyWeekly.pushDevice.pushOff.pushOn.pushTurnOn.pushTurnOff.pushTurningOn.pushTurningOff.pushBlocked.pushHomeScreen.pushInsecure.pushBrave.pushFailed.pushFailedOff.pushRetry.pushDevices.pushDeviceName.pushDeviceUnknown.pushDeviceActive.pushDeviceRemove.pushDeviceRemoveLabel.notificationHours.notificationHoursDescription.notificationHoursStart.notificationHoursEnd.notificationHoursDay.notificationHoursOff.notificationHoursAdd.notificationHoursAddLabel.notificationHoursRemove.notificationHoursRemoveLabel.empty.loading.error.retry".split("."), Yn = Xe("preferences_", Jn), Xn = {
|
|
1742
1751
|
instant: "frequencyInstant",
|
|
1743
1752
|
hourly: "frequencyHourly",
|
|
1744
1753
|
daily: "frequencyDaily",
|
|
1745
1754
|
weekly: "frequencyWeekly"
|
|
1746
|
-
},
|
|
1747
|
-
function
|
|
1755
|
+
}, Zn = (e) => Ze("preferences_", Jn, e), Qn = qn();
|
|
1756
|
+
function $n(e, t, n, r) {
|
|
1748
1757
|
let i = t.some(({ frequency: e }) => e !== null);
|
|
1749
1758
|
return {
|
|
1750
1759
|
hasGlobalSwitches: e.some(({ globalSwitch: e }) => e),
|
|
@@ -1752,15 +1761,15 @@ function Qn(e, t, n, r) {
|
|
|
1752
1761
|
columns: e.length + (i ? 2 : 1),
|
|
1753
1762
|
frequencyOptions: n.map((e) => ({
|
|
1754
1763
|
value: e,
|
|
1755
|
-
label:
|
|
1764
|
+
label: qe(r[Xn[e]])
|
|
1756
1765
|
}))
|
|
1757
1766
|
};
|
|
1758
1767
|
}
|
|
1759
|
-
function
|
|
1760
|
-
|
|
1768
|
+
function er(e, t, n) {
|
|
1769
|
+
kn(e, t, n) || Qn.set(e.key, t.key, !e.channels[t.key]);
|
|
1761
1770
|
}
|
|
1762
1771
|
// ../js/push.ts
|
|
1763
|
-
var
|
|
1772
|
+
var tr = {
|
|
1764
1773
|
available: !1,
|
|
1765
1774
|
supported: !1,
|
|
1766
1775
|
permission: "default",
|
|
@@ -1770,11 +1779,11 @@ var er = {
|
|
|
1770
1779
|
request: null,
|
|
1771
1780
|
devices: null
|
|
1772
1781
|
};
|
|
1773
|
-
function
|
|
1782
|
+
function nr(e) {
|
|
1774
1783
|
return !e.available || e.reason === "unsupported" ? null : e.busy ? "busy" : e.reason ?? (e.subscribed ? "on" : "off");
|
|
1775
1784
|
}
|
|
1776
|
-
function
|
|
1777
|
-
let t =
|
|
1785
|
+
function rr(e) {
|
|
1786
|
+
let t = nr(e), n = e.request?.action ?? "subscribe", r = n === "unsubscribe";
|
|
1778
1787
|
switch (t) {
|
|
1779
1788
|
case null: return null;
|
|
1780
1789
|
case "off": return {
|
|
@@ -1847,39 +1856,39 @@ function nr(e) {
|
|
|
1847
1856
|
};
|
|
1848
1857
|
}
|
|
1849
1858
|
}
|
|
1850
|
-
function
|
|
1859
|
+
function ir(e) {
|
|
1851
1860
|
return !G(e) || typeof e.publicKey != "string" || e.publicKey === "" || typeof e.worker != "string" || e.worker === "" ? null : {
|
|
1852
1861
|
publicKey: e.publicKey,
|
|
1853
1862
|
worker: e.worker,
|
|
1854
1863
|
subscribed: e.subscribed === !0
|
|
1855
1864
|
};
|
|
1856
1865
|
}
|
|
1857
|
-
var
|
|
1858
|
-
function
|
|
1866
|
+
var ar = (e) => typeof e == "string" && e !== "" ? e : null;
|
|
1867
|
+
function or(e) {
|
|
1859
1868
|
if (G(e) && Array.isArray(e.devices)) return e.devices.flatMap((e) => G(e) && typeof e.id == "number" && typeof e.activeAt == "string" ? [{
|
|
1860
1869
|
id: e.id,
|
|
1861
|
-
browser:
|
|
1862
|
-
platform:
|
|
1870
|
+
browser: ar(e.browser),
|
|
1871
|
+
platform: ar(e.platform),
|
|
1863
1872
|
activeAt: e.activeAt,
|
|
1864
1873
|
current: e.current === !0
|
|
1865
1874
|
}] : []);
|
|
1866
1875
|
}
|
|
1867
|
-
function
|
|
1876
|
+
function sr(e) {
|
|
1868
1877
|
let t = e.replaceAll("-", "+").replaceAll("_", "/"), n = atob(t.padEnd(t.length + (4 - t.length % 4) % 4, "="));
|
|
1869
1878
|
return Uint8Array.from(n, (e) => e.charCodeAt(0));
|
|
1870
1879
|
}
|
|
1871
|
-
function
|
|
1880
|
+
function cr(e, t) {
|
|
1872
1881
|
let n = e.options?.applicationServerKey;
|
|
1873
1882
|
if (!n) return !0;
|
|
1874
1883
|
let r = new Uint8Array(n);
|
|
1875
1884
|
return r.length === t.length && r.every((e, n) => e === t[n]);
|
|
1876
1885
|
}
|
|
1877
|
-
var
|
|
1878
|
-
function
|
|
1879
|
-
return window.isSecureContext ? navigator.serviceWorker !== void 0 && "PushManager" in window && typeof Notification == "function" ? null :
|
|
1886
|
+
var lr = () => /iPad|iPhone|iPod/.test(navigator.userAgent) || navigator.userAgent.includes("Macintosh") && navigator.maxTouchPoints > 1, ur = () => navigator.standalone === !0 || window.matchMedia?.("(display-mode: standalone)").matches === !0;
|
|
1887
|
+
function dr() {
|
|
1888
|
+
return window.isSecureContext ? navigator.serviceWorker !== void 0 && "PushManager" in window && typeof Notification == "function" ? null : lr() && !ur() ? "home-screen" : "unsupported" : "insecure";
|
|
1880
1889
|
}
|
|
1881
|
-
var
|
|
1882
|
-
function
|
|
1890
|
+
var fr = () => "brave" in navigator, pr = () => typeof Notification == "function" ? Notification.permission : "default", mr = (e) => new URL("./", new URL(e, window.location.href)).href;
|
|
1891
|
+
function hr(e) {
|
|
1883
1892
|
let t = e.installing ?? e.waiting;
|
|
1884
1893
|
return e.active || !t ? e.active ? Promise.resolve(e) : Promise.reject(/* @__PURE__ */ Error("The service worker did not install.")) : new Promise((n, r) => {
|
|
1885
1894
|
let i = () => {
|
|
@@ -1888,8 +1897,8 @@ function mr(e) {
|
|
|
1888
1897
|
t.addEventListener("statechange", i);
|
|
1889
1898
|
});
|
|
1890
1899
|
}
|
|
1891
|
-
function
|
|
1892
|
-
let e, t, n, r, i, a = 0, o = null, s = null, c = "unsupported", l = "default", u = !1, d, f = null, p = !1, m = Promise.resolve(), h = null, g = /* @__PURE__ */ new Set(), _ = null, v = 0, y =
|
|
1900
|
+
function gr() {
|
|
1901
|
+
let e, t, n, r, i, a = 0, o = null, s = null, c = "unsupported", l = "default", u = !1, d, f = null, p = !1, m = Promise.resolve(), h = null, g = /* @__PURE__ */ new Set(), _ = null, v = 0, y = tr, b = /* @__PURE__ */ new Set(), x = () => f?.status === "pending", S = () => {
|
|
1893
1902
|
let e = s !== null, t = c === null, n = {
|
|
1894
1903
|
available: e,
|
|
1895
1904
|
supported: t,
|
|
@@ -1905,11 +1914,11 @@ function hr() {
|
|
|
1905
1914
|
let t = m.then(e);
|
|
1906
1915
|
return m = t.catch(() => {}), t;
|
|
1907
1916
|
}, w = () => t?.getSnapshot().url, T = async (e) => {
|
|
1908
|
-
let t =
|
|
1917
|
+
let t = mr(e.worker), n = await navigator.serviceWorker.getRegistration(t);
|
|
1909
1918
|
return n?.scope === t ? n : void 0;
|
|
1910
1919
|
}, E = async (e, t) => {
|
|
1911
1920
|
let n = new URL(e.worker, window.location.href).href;
|
|
1912
|
-
return
|
|
1921
|
+
return hr(t?.active?.scriptURL === n ? t : await navigator.serviceWorker.register(n, { scope: mr(e.worker) }));
|
|
1913
1922
|
}, D = (t, n, r) => t === a ? e.request("post", `${w()}/${n}`, r) : Promise.reject(/* @__PURE__ */ Error("Another user signed in.")), O = async (e, t, n = !1) => {
|
|
1914
1923
|
let r = await D(e, "push/subscribe", {
|
|
1915
1924
|
...t.toJSON(),
|
|
@@ -1919,14 +1928,14 @@ function hr() {
|
|
|
1919
1928
|
if (!G(r) || r.subscribed !== !0) throw Error("The push endpoint did not save the subscription.");
|
|
1920
1929
|
return !0;
|
|
1921
1930
|
}, k = async (e, t, n, r = !1) => {
|
|
1922
|
-
let i =
|
|
1931
|
+
let i = sr(n.publicKey), a, o;
|
|
1923
1932
|
try {
|
|
1924
|
-
a = await t.pushManager.getSubscription(), a && !
|
|
1933
|
+
a = await t.pushManager.getSubscription(), a && !cr(a, i) && (await a.unsubscribe(), a = null), a ??= o = await t.pushManager.subscribe({
|
|
1925
1934
|
userVisibleOnly: !0,
|
|
1926
1935
|
applicationServerKey: i
|
|
1927
1936
|
});
|
|
1928
1937
|
} catch (e) {
|
|
1929
|
-
throw
|
|
1938
|
+
throw fr() ? Object.assign(/* @__PURE__ */ Error("Brave could not subscribe."), {
|
|
1930
1939
|
brave: !0,
|
|
1931
1940
|
cause: e
|
|
1932
1941
|
}) : e;
|
|
@@ -1950,7 +1959,7 @@ function hr() {
|
|
|
1950
1959
|
};
|
|
1951
1960
|
try {
|
|
1952
1961
|
let i = await E(n, e), a = await i.pushManager.getSubscription();
|
|
1953
|
-
if (a &&
|
|
1962
|
+
if (a && cr(a, sr(n.publicKey))) {
|
|
1954
1963
|
n.subscribed && !await O(t, a, !0).catch(() => !0) && (await a.unsubscribe().catch(() => {}), r());
|
|
1955
1964
|
return;
|
|
1956
1965
|
}
|
|
@@ -1968,7 +1977,7 @@ function hr() {
|
|
|
1968
1977
|
if (s === null || !e) return;
|
|
1969
1978
|
let t = a, n = ++v;
|
|
1970
1979
|
try {
|
|
1971
|
-
let r =
|
|
1980
|
+
let r = or(await e.request("get", `${w()}/push/devices`));
|
|
1972
1981
|
t === a && n === v && r && (h = r, M());
|
|
1973
1982
|
} catch {}
|
|
1974
1983
|
}, P = () => {
|
|
@@ -1979,14 +1988,14 @@ function hr() {
|
|
|
1979
1988
|
let e = t.getSnapshot(), n = e.url === void 0 ? void 0 : e.user ?? "";
|
|
1980
1989
|
n !== i && (i = n, F());
|
|
1981
1990
|
let r = t.pushSettings();
|
|
1982
|
-
r !== o && (o = r, s =
|
|
1991
|
+
r !== o && (o = r, s = ir(r), s === null ? (u = !1, d = void 0, f = x() ? f : null) : s.subscribed !== d && (u = d = s.subscribed)), l = pr(), S(), j();
|
|
1983
1992
|
}, L = () => {
|
|
1984
|
-
l =
|
|
1993
|
+
l = pr(), S(), j();
|
|
1985
1994
|
}, R = (t) => {
|
|
1986
1995
|
let r = t.data;
|
|
1987
1996
|
if (G(r) && r.type === "inertiaui-notifications:shown") {
|
|
1988
|
-
let e = typeof r.tag == "string" ?
|
|
1989
|
-
e !== void 0 && n?.(e) && z([
|
|
1997
|
+
let e = typeof r.tag == "string" ? on(r.tag) : void 0;
|
|
1998
|
+
e !== void 0 && n?.(e) && z([an(e)]);
|
|
1990
1999
|
return;
|
|
1991
2000
|
}
|
|
1992
2001
|
if (!G(r) || r.type !== "inertiaui-notifications:visit") return;
|
|
@@ -2000,13 +2009,13 @@ function hr() {
|
|
|
2000
2009
|
let t = G(e.data) ? e.data.context : void 0;
|
|
2001
2010
|
return n === null || t === void 0 || t === n;
|
|
2002
2011
|
};
|
|
2003
|
-
(e === null ? (await r.getNotifications()).filter((e) =>
|
|
2012
|
+
(e === null ? (await r.getNotifications()).filter((e) => on(e.tag) !== void 0 && i(e) && a(e)) : (await Promise.all(e.map((e) => r.getNotifications({ tag: e })))).flat()).forEach((e) => e.close());
|
|
2004
2013
|
} catch {}
|
|
2005
2014
|
}, B = (e) => {
|
|
2006
2015
|
switch (e.kind) {
|
|
2007
|
-
case "item": return e.readAt !== null || e.archivedAt !== null ? z([
|
|
2008
|
-
case "items": return e.action === "read" || e.action === "archive" ? z(e.ids.map(
|
|
2009
|
-
case "delete": return z(e.ids.map(
|
|
2016
|
+
case "item": return e.readAt !== null || e.archivedAt !== null ? z([an(e.id)]) : Promise.resolve();
|
|
2017
|
+
case "items": return e.action === "read" || e.action === "archive" ? z(e.ids.map(an)) : Promise.resolve();
|
|
2018
|
+
case "delete": return z(e.ids.map(an));
|
|
2010
2019
|
case "read":
|
|
2011
2020
|
case "archive": return e.category === null && !(e.kind === "archive" && e.onlyRead) ? z(null, Date.parse(e.before), t?.context() ?? null) : Promise.resolve();
|
|
2012
2021
|
default: return Promise.resolve();
|
|
@@ -2019,7 +2028,7 @@ function hr() {
|
|
|
2019
2028
|
getSnapshot: () => y,
|
|
2020
2029
|
connect(i, a, o, s) {
|
|
2021
2030
|
if (e = i, t) return;
|
|
2022
|
-
t = a, n = o, r = s, c =
|
|
2031
|
+
t = a, n = o, r = s, c = dr(), c === null && (navigator.serviceWorker.addEventListener("message", R), navigator.serviceWorker.startMessages(), navigator.permissions?.query({ name: "notifications" }).then((e) => e.addEventListener("change", L)).catch(() => {}), document.addEventListener("visibilitychange", L));
|
|
2023
2032
|
let l = (e) => void B(e);
|
|
2024
2033
|
a.onChange(l), a.onSaved(({ change: e }) => l(e)), a.subscribe(I), I();
|
|
2025
2034
|
},
|
|
@@ -2029,7 +2038,7 @@ function hr() {
|
|
|
2029
2038
|
f = {
|
|
2030
2039
|
action: "subscribe",
|
|
2031
2040
|
status: "pending"
|
|
2032
|
-
}, S(), l = Notification.permission === "default" ? await Notification.requestPermission().catch(
|
|
2041
|
+
}, S(), l = Notification.permission === "default" ? await Notification.requestPermission().catch(pr) : Notification.permission, t === a && (l === "granted" && (p = !0, await C(async () => {
|
|
2033
2042
|
if (t === a) try {
|
|
2034
2043
|
await k(t, await E(n, await T(n)), n), t === a && (u = !0, P());
|
|
2035
2044
|
} catch (e) {
|
|
@@ -2072,41 +2081,41 @@ function hr() {
|
|
|
2072
2081
|
}
|
|
2073
2082
|
g.delete(e), M();
|
|
2074
2083
|
},
|
|
2075
|
-
close: (e) => z(e.map(
|
|
2084
|
+
close: (e) => z(e.map(an))
|
|
2076
2085
|
};
|
|
2077
2086
|
}
|
|
2078
|
-
var
|
|
2079
|
-
function
|
|
2087
|
+
var _r = gr();
|
|
2088
|
+
function vr(e, t, n, r) {
|
|
2080
2089
|
return (e ?? []).filter((e) => !e.current).map((e) => {
|
|
2081
|
-
let i = e.browser ??
|
|
2090
|
+
let i = e.browser ?? qe(t.pushDeviceUnknown), a = e.platform === null ? i : qe(t.pushDeviceName, {
|
|
2082
2091
|
browser: i,
|
|
2083
2092
|
platform: e.platform
|
|
2084
2093
|
});
|
|
2085
2094
|
return {
|
|
2086
2095
|
id: e.id,
|
|
2087
2096
|
name: a,
|
|
2088
|
-
active:
|
|
2089
|
-
removeLabel:
|
|
2097
|
+
active: qe(t.pushDeviceActive, { time: Wt(e.activeAt, n, r) }),
|
|
2098
|
+
removeLabel: qe(t.pushDeviceRemoveLabel, { device: a })
|
|
2090
2099
|
};
|
|
2091
2100
|
});
|
|
2092
2101
|
}
|
|
2093
|
-
function
|
|
2102
|
+
function yr(e) {
|
|
2094
2103
|
let t = e?.button;
|
|
2095
|
-
t && e?.state !== "busy" && (t.action === "subscribe" ?
|
|
2104
|
+
t && e?.state !== "busy" && (t.action === "subscribe" ? _r.enable() : _r.disable());
|
|
2096
2105
|
}
|
|
2097
2106
|
// ../js/toastStore.ts
|
|
2098
|
-
var
|
|
2099
|
-
function
|
|
2107
|
+
var br = 1e3;
|
|
2108
|
+
function xr({ title: e, description: t }) {
|
|
2100
2109
|
let n = e.length + (t?.length ?? 0);
|
|
2101
2110
|
return Math.min(Math.max(2e3 + 60 * n, 5e3), 12e3);
|
|
2102
2111
|
}
|
|
2103
|
-
function
|
|
2104
|
-
return typeof t.duration == "function" ? t.duration(e) : e.type === "loading" || e.actions?.some((e) => !e.altText) || e.type === "error" && t.persistentErrors !== !1 ? null : typeof t.duration == "number" ? t.duration : e.type === "warning" ? Math.max(
|
|
2112
|
+
function Sr(e, t = {}) {
|
|
2113
|
+
return typeof t.duration == "function" ? t.duration(e) : e.type === "loading" || e.actions?.some((e) => !e.altText) || e.type === "error" && t.persistentErrors !== !1 ? null : typeof t.duration == "number" ? t.duration : e.type === "warning" ? Math.max(xr(e), 8e3) : xr(e);
|
|
2105
2114
|
}
|
|
2106
|
-
function
|
|
2115
|
+
function Cr(e) {
|
|
2107
2116
|
return (e.type === "error" ? 0 : e.type === "warning" ? 2 : 4) + (e.actions.length > 0 ? 0 : 1);
|
|
2108
2117
|
}
|
|
2109
|
-
var
|
|
2118
|
+
var wr = (e) => e === void 0 || Number.isNaN(e) ? void 0 : Math.min(Math.max(e, 0), 1), Tr = (e) => [...e.action ? [e.action] : [], ...e.actions ?? []], Er = {
|
|
2110
2119
|
duration: !0,
|
|
2111
2120
|
persistentErrors: !0,
|
|
2112
2121
|
durationScale: !0,
|
|
@@ -2116,7 +2125,7 @@ var Cr = (e) => e === void 0 || Number.isNaN(e) ? void 0 : Math.min(Math.max(e,
|
|
|
2116
2125
|
dedupe: !0,
|
|
2117
2126
|
removeDelay: !0
|
|
2118
2127
|
};
|
|
2119
|
-
function
|
|
2128
|
+
function Dr(e = {}) {
|
|
2120
2129
|
let t = {}, n = 0, r = 0, i = [], a = !1, o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Set(), u = [], d = () => {
|
|
2121
2130
|
a && (a = !1, i = Array.from(o.values(), (e) => e.toast));
|
|
2122
2131
|
for (let e of l) e();
|
|
@@ -2125,7 +2134,7 @@ function Er(e = {}) {
|
|
|
2125
2134
|
}, f = (e, t) => {
|
|
2126
2135
|
e.toast = t, a = !0;
|
|
2127
2136
|
}, p = (e, n) => {
|
|
2128
|
-
let r = n === void 0 ?
|
|
2137
|
+
let r = n === void 0 ? Sr(e, t) : n;
|
|
2129
2138
|
return r === null || t.autoDismiss === !1 ? null : Math.round(r * (t.durationScale ?? 1));
|
|
2130
2139
|
}, m = (e) => {
|
|
2131
2140
|
e.handle !== void 0 && (clearTimeout(e.handle), e.handle = void 0, e.remaining -= Date.now() - e.startedAt);
|
|
@@ -2133,7 +2142,7 @@ function Er(e = {}) {
|
|
|
2133
2142
|
let { timer: t } = e;
|
|
2134
2143
|
if (!t) return;
|
|
2135
2144
|
let n = (c.get(e.toast.toaster ?? "") ?? 0) > 0, r = e.toast.state === "visible" && s.size === 0 && e.holds.size === 0 && e.toast.pendingAction === void 0 && n;
|
|
2136
|
-
r && t.handle === void 0 ? (t.remaining = Math.max(t.remaining, Math.min(
|
|
2145
|
+
r && t.handle === void 0 ? (t.remaining = Math.max(t.remaining, Math.min(br, t.duration)), t.startedAt = Date.now(), t.handle = setTimeout(() => E(e.toast.id, "timeout"), t.remaining)) : r || m(t);
|
|
2137
2146
|
}, g = (e) => {
|
|
2138
2147
|
e.timer && m(e.timer);
|
|
2139
2148
|
let { duration: t } = e.toast;
|
|
@@ -2161,7 +2170,7 @@ function Er(e = {}) {
|
|
|
2161
2170
|
let e = t.overflow === "hide" ? -1 : 1;
|
|
2162
2171
|
for (let t of o.values()) {
|
|
2163
2172
|
if (t.toast.state !== "queued") continue;
|
|
2164
|
-
let n = _(t), r = n.filter((e) => e.toast.state === "visible").length, i = n.filter((e) => e.toast.state === "queued").sort((t, n) =>
|
|
2173
|
+
let n = _(t), r = n.filter((e) => e.toast.state === "visible").length, i = n.filter((e) => e.toast.state === "queued").sort((t, n) => Cr(t.toast) - Cr(n.toast) || e * (t.sequence - n.sequence));
|
|
2165
2174
|
for (let e of i) {
|
|
2166
2175
|
if (r >= v()) break;
|
|
2167
2176
|
r++, f(e, {
|
|
@@ -2174,7 +2183,7 @@ function Er(e = {}) {
|
|
|
2174
2183
|
let n = _(e).filter((t) => t !== e && t.toast.state === "visible");
|
|
2175
2184
|
if (n.length < v()) return "visible";
|
|
2176
2185
|
if (t.overflow !== "drop-oldest" && t.overflow !== "hide") return "queued";
|
|
2177
|
-
let r = n.reduce((e, t) =>
|
|
2186
|
+
let r = n.reduce((e, t) => Cr(t.toast) > Cr(e.toast) ? t : e);
|
|
2178
2187
|
return t.overflow === "hide" ? (f(r, {
|
|
2179
2188
|
...r.toast,
|
|
2180
2189
|
state: "queued"
|
|
@@ -2184,7 +2193,7 @@ function Er(e = {}) {
|
|
|
2184
2193
|
type: n.type ?? "default",
|
|
2185
2194
|
title: t,
|
|
2186
2195
|
description: n.description,
|
|
2187
|
-
actions:
|
|
2196
|
+
actions: Tr(n)
|
|
2188
2197
|
};
|
|
2189
2198
|
return {
|
|
2190
2199
|
id: e,
|
|
@@ -2197,14 +2206,14 @@ function Er(e = {}) {
|
|
|
2197
2206
|
toaster: n.toaster,
|
|
2198
2207
|
politeness: n.politeness,
|
|
2199
2208
|
data: n.data,
|
|
2200
|
-
progress:
|
|
2209
|
+
progress: wr(n.progress),
|
|
2201
2210
|
onClose: n.onClose,
|
|
2202
2211
|
onRemove: n.onRemove,
|
|
2203
2212
|
...i
|
|
2204
2213
|
};
|
|
2205
2214
|
}, w = (e, n) => {
|
|
2206
2215
|
let r = n.type ?? "default";
|
|
2207
|
-
if (!(t.dedupe === !1 || n.id !== void 0 || r === "loading" ||
|
|
2216
|
+
if (!(t.dedupe === !1 || n.id !== void 0 || r === "loading" || Tr(n).length > 0 || n.data !== void 0)) return [...o.values()].find(({ toast: t }) => t.state !== "closing" && t.actions.length === 0 && t.data === void 0 && t.toaster === n.toaster && t.type === r && t.title === e && t.description === n.description);
|
|
2208
2217
|
};
|
|
2209
2218
|
function T(e, t = {}) {
|
|
2210
2219
|
let i = t.id === void 0 ? void 0 : o.get(t.id);
|
|
@@ -2262,7 +2271,7 @@ function Er(e = {}) {
|
|
|
2262
2271
|
...c,
|
|
2263
2272
|
title: r ?? n.toast.title
|
|
2264
2273
|
};
|
|
2265
|
-
"description" in t && (u.description = t.description), t.progress !== void 0 && (u.progress =
|
|
2274
|
+
"description" in t && (u.description = t.description), t.progress !== void 0 && (u.progress = wr(t.progress)), (i !== void 0 || a !== void 0) && (u.actions = Tr({
|
|
2266
2275
|
action: i,
|
|
2267
2276
|
actions: a
|
|
2268
2277
|
})), "duration" in t && (n.requested = t.duration), l && (u.duration = p(u, n.requested), u.revision++);
|
|
@@ -2321,7 +2330,7 @@ function Er(e = {}) {
|
|
|
2321
2330
|
};
|
|
2322
2331
|
},
|
|
2323
2332
|
configure(e) {
|
|
2324
|
-
let n = Object.entries(e).filter(([e, t]) => t !== void 0 && e in
|
|
2333
|
+
let n = Object.entries(e).filter(([e, t]) => t !== void 0 && e in Er);
|
|
2325
2334
|
t = {
|
|
2326
2335
|
...t,
|
|
2327
2336
|
...Object.fromEntries(n)
|
|
@@ -2331,11 +2340,11 @@ function Er(e = {}) {
|
|
|
2331
2340
|
return O.configure(e), O;
|
|
2332
2341
|
}
|
|
2333
2342
|
// ../js/toast.ts
|
|
2334
|
-
var Q =
|
|
2335
|
-
Q.subscribe(() =>
|
|
2336
|
-
var
|
|
2337
|
-
function
|
|
2338
|
-
let e = `scope-${++
|
|
2343
|
+
var Q = Dr(), Or = 0;
|
|
2344
|
+
Q.subscribe(() => Or++);
|
|
2345
|
+
var kr = () => Or, Ar = 0;
|
|
2346
|
+
function jr() {
|
|
2347
|
+
let e = `scope-${++Ar}:`, t = /* @__PURE__ */ new Map();
|
|
2339
2348
|
return {
|
|
2340
2349
|
pause(n = "manual", r) {
|
|
2341
2350
|
t.set(JSON.stringify([n, r ?? null]), [n, r]), Q.pause(e + n, r);
|
|
@@ -2348,22 +2357,22 @@ function Ar() {
|
|
|
2348
2357
|
}
|
|
2349
2358
|
};
|
|
2350
2359
|
}
|
|
2351
|
-
var
|
|
2352
|
-
let n = t.id === void 0 ? void 0 :
|
|
2353
|
-
n !== void 0 &&
|
|
2354
|
-
}),
|
|
2360
|
+
var Mr = le, Nr, Pr = "requested", Fr, Ir, Lr, Rr = he((e, t) => {
|
|
2361
|
+
let n = t.id === void 0 ? void 0 : on(t.id);
|
|
2362
|
+
n !== void 0 && Vt.panelOpen() ? Vt.loadArrival(n).then((e) => e && Yr(e)) : Q.add(e, t);
|
|
2363
|
+
}), zr = (e) => Rr(ge(e, Mr)), Br = typeof window < "u", Vr, Hr = [
|
|
2355
2364
|
403,
|
|
2356
2365
|
419,
|
|
2357
2366
|
429,
|
|
2358
2367
|
"5xx",
|
|
2359
2368
|
"network"
|
|
2360
2369
|
];
|
|
2361
|
-
function
|
|
2370
|
+
function Ur(e) {
|
|
2362
2371
|
let t = (t) => {
|
|
2363
2372
|
let n = e(t);
|
|
2364
|
-
return n === void 0 ? "" :
|
|
2373
|
+
return n === void 0 ? "" : qe(n);
|
|
2365
2374
|
};
|
|
2366
|
-
return Object.fromEntries(
|
|
2375
|
+
return Object.fromEntries(Hr.map((e) => {
|
|
2367
2376
|
let n = t(`error_toast_${e}`), r = t(`error_toast_${e}_description`);
|
|
2368
2377
|
return [e, r === "" ? { title: n } : {
|
|
2369
2378
|
title: n,
|
|
@@ -2371,122 +2380,122 @@ function Hr(e) {
|
|
|
2371
2380
|
}];
|
|
2372
2381
|
}));
|
|
2373
2382
|
}
|
|
2374
|
-
var
|
|
2375
|
-
...
|
|
2376
|
-
...
|
|
2383
|
+
var Wr = Ur((e) => Ue[e]), Gr = () => Nr && {
|
|
2384
|
+
...Ur(Ke),
|
|
2385
|
+
...Nr
|
|
2377
2386
|
};
|
|
2378
|
-
function
|
|
2387
|
+
function Kr(e, t) {
|
|
2379
2388
|
return (t[e] ?? (e >= 500 ? t["5xx"] : void 0)) || void 0;
|
|
2380
2389
|
}
|
|
2381
|
-
function
|
|
2390
|
+
function qr(e, t) {
|
|
2382
2391
|
let { code: n, response: r } = e ?? {};
|
|
2383
2392
|
if (n === "ERR_NETWORK") return t.network || void 0;
|
|
2384
2393
|
if (n !== "ERR_HTTP_RESPONSE" || r?.status === void 0) return;
|
|
2385
2394
|
let { status: i, headers: a } = r;
|
|
2386
|
-
if (!(a["x-inertia"] || a["x-inertia-location"] || i === 409 && a["x-inertia-redirect"] || a["x-inertiaui-toasts"])) return
|
|
2395
|
+
if (!(a["x-inertia"] || a["x-inertia-location"] || i === 409 && a["x-inertia-redirect"] || a["x-inertiaui-toasts"])) return Kr(i, t);
|
|
2387
2396
|
}
|
|
2388
|
-
var
|
|
2389
|
-
label:
|
|
2390
|
-
altText:
|
|
2391
|
-
}),
|
|
2392
|
-
let t =
|
|
2393
|
-
t && (typeof document < "u" && document.visibilityState === "visible" &&
|
|
2394
|
-
},
|
|
2395
|
-
e.kind === "delete" ? e.ids.forEach((e) => Q.dismiss(
|
|
2396
|
-
},
|
|
2397
|
-
let t =
|
|
2397
|
+
var Jr = () => ({
|
|
2398
|
+
label: Je("inbox_toast_view"),
|
|
2399
|
+
altText: Je("inbox_toast_view_alt")
|
|
2400
|
+
}), Yr = (e) => {
|
|
2401
|
+
let t = sn(e, Pr, Jr());
|
|
2402
|
+
t && (typeof document < "u" && document.visibilityState === "visible" && _r.close([e.id]), Vt.panelOpen() || Q.getSnapshot().some((e) => e.id === t.options.id && e.state !== "closing") || Q.add(t.title, t.options));
|
|
2403
|
+
}, Xr = (e) => document.visibilityState === "visible" && Q.getSnapshot().some((t) => t.id === an(e) && t.state !== "closing"), Zr = () => Q.getSnapshot().filter((e) => on(e.id) !== void 0 && e.pendingAction === void 0).forEach((e) => Q.dismiss(e.id)), Qr = (e) => {
|
|
2404
|
+
e.kind === "delete" ? e.ids.forEach((e) => Q.dismiss(an(e))) : e.kind === "update" && Q.update(an(e.item.id), cn(e.item, Jr()));
|
|
2405
|
+
}, $r = (e) => {
|
|
2406
|
+
let t = on(e);
|
|
2398
2407
|
t !== void 0 && X.markAsRead(t);
|
|
2399
|
-
},
|
|
2400
|
-
let r =
|
|
2401
|
-
return r === void 0 || n.result === void 0 ? void 0 :
|
|
2408
|
+
}, ei = (e, t, n) => {
|
|
2409
|
+
let r = on(e);
|
|
2410
|
+
return r === void 0 || n.result === void 0 ? void 0 : Vt.completer(r, t);
|
|
2402
2411
|
};
|
|
2403
|
-
function
|
|
2404
|
-
if (
|
|
2405
|
-
if (!
|
|
2406
|
-
|
|
2412
|
+
function ti(e, t = {}) {
|
|
2413
|
+
if (Mr = t.flashKey ?? Mr, Q.configure(t), Pr = t.inbox?.arrivalToasts ?? Pr, Fr = t.inbox?.onArrival ?? Fr, t.errorToasts !== void 0 && (Nr = t.errorToasts === !1 ? void 0 : t.errorToasts === !0 ? {} : t.errorToasts), Br) {
|
|
2414
|
+
if (!Vr) {
|
|
2415
|
+
Vr = e;
|
|
2407
2416
|
let t = (e) => (t) => {
|
|
2408
|
-
let n =
|
|
2409
|
-
n &&
|
|
2417
|
+
let n = Gr();
|
|
2418
|
+
n && qr(t, n) || Q.add(e(), { type: "error" });
|
|
2410
2419
|
};
|
|
2411
|
-
X.connect(e, { onFailure: t(() =>
|
|
2420
|
+
X.connect(e, { onFailure: t(() => Je("inbox_update_failed")) }), Qn.connect(e, { onFailure: t(() => Je("preferences_save_failed")) });
|
|
2412
2421
|
let n = ({ url: e, user: t }) => e === void 0 ? void 0 : t ?? "", r = n(X.getSnapshot()), i = r !== void 0;
|
|
2413
2422
|
X.subscribe(() => {
|
|
2414
2423
|
let e = n(X.getSnapshot());
|
|
2415
|
-
e !== r && (i &&
|
|
2416
|
-
}),
|
|
2424
|
+
e !== r && (i && Qn.reset(X.getSnapshot().url), i ||= e !== void 0, r = e);
|
|
2425
|
+
}), ni(e), X.onArrival((e) => Fr?.(e)), X.onChange(Qr), Vt.onPanelOpened(Zr), Ir = nn(Vt, e, Yr), Lr = mn(X), _r.connect(e, Vt, Xr, t(() => Je("preferences_push_device_remove_failed")));
|
|
2417
2426
|
}
|
|
2418
|
-
X.connect(
|
|
2427
|
+
X.connect(Vr, { prop: t.inbox?.prop }), Ir?.configure({
|
|
2419
2428
|
echo: t.inbox?.echo,
|
|
2420
2429
|
poll: t.inbox?.poll
|
|
2421
|
-
}),
|
|
2430
|
+
}), Lr?.configure(t.inbox ?? {});
|
|
2422
2431
|
}
|
|
2423
2432
|
}
|
|
2424
|
-
function
|
|
2425
|
-
e.onFlash(
|
|
2433
|
+
function ni(e) {
|
|
2434
|
+
e.onFlash(zr), e.onNavigate((e, t) => X.sync(e, t)), e.onRequest((e) => be(e.url) ? {
|
|
2426
2435
|
...e.headers,
|
|
2427
2436
|
[ue]: "1"
|
|
2428
2437
|
} : e.headers), e.onResponse((e) => {
|
|
2429
|
-
|
|
2438
|
+
zr(ve(e)), Rr(_e(e.headers));
|
|
2430
2439
|
}), e.onError((e) => {
|
|
2431
2440
|
let t = e?.response;
|
|
2432
|
-
t?.headers &&
|
|
2433
|
-
let n =
|
|
2441
|
+
t?.headers && Rr(_e(t.headers));
|
|
2442
|
+
let n = Gr(), r = n && qr(e, n);
|
|
2434
2443
|
r && Q.add(r.title, {
|
|
2435
2444
|
type: "error",
|
|
2436
2445
|
description: r.description
|
|
2437
2446
|
});
|
|
2438
2447
|
}), e.onHttpException((e) => {
|
|
2439
|
-
let t =
|
|
2440
|
-
return t && e.status !== void 0 && !e.headers["x-inertia"] &&
|
|
2448
|
+
let t = Gr();
|
|
2449
|
+
return t && e.status !== void 0 && !e.headers["x-inertia"] && Kr(e.status, t) ? !1 : void 0;
|
|
2441
2450
|
});
|
|
2442
2451
|
let t = () => document.visibilityState === "hidden" ? Q.pause("hidden") : Q.resume("hidden");
|
|
2443
2452
|
document.addEventListener("visibilitychange", t), t(), window.addEventListener("blur", () => Q.pause("blur")), window.addEventListener("focus", () => Q.resume("blur"));
|
|
2444
2453
|
}
|
|
2445
|
-
var
|
|
2446
|
-
function
|
|
2454
|
+
var ri = /* @__PURE__ */ new Map();
|
|
2455
|
+
function ii(e, t) {
|
|
2447
2456
|
let n = Q.getSnapshot().find((t) => t.id === e), r = n?.actions[t];
|
|
2448
2457
|
if (!n || !r || n.state === "closing" || n.pendingAction !== void 0) return;
|
|
2449
|
-
|
|
2450
|
-
let i =
|
|
2458
|
+
$r(e);
|
|
2459
|
+
let i = ei(e, t, r), a = {}, o = () => {
|
|
2451
2460
|
r.keepOpen ? Q.setPendingAction(e, void 0) : Q.dismiss(e, "action");
|
|
2452
|
-
}, s =
|
|
2453
|
-
|
|
2461
|
+
}, s = ke(r, n, Vr, (n) => {
|
|
2462
|
+
ri.get(e) === a && (ri.delete(e), Q.getSnapshot().find((t) => t.id === e)?.pendingAction === t && (n ? o() : Q.setPendingAction(e, void 0)));
|
|
2454
2463
|
}, i);
|
|
2455
|
-
s === "pending" ? (
|
|
2464
|
+
s === "pending" ? (ri.set(e, a), Q.setPendingAction(e, t)) : s === "done" && o();
|
|
2456
2465
|
}
|
|
2457
|
-
function
|
|
2466
|
+
function ai(e, t, n) {
|
|
2458
2467
|
let r = Q.getSnapshot().find((t) => t.id === e)?.actions[t];
|
|
2459
2468
|
if (!r) return;
|
|
2460
|
-
let i = ye(r), a =
|
|
2461
|
-
if (i !== void 0 &&
|
|
2462
|
-
if (
|
|
2469
|
+
let i = ye(r), a = ei(e, t, r);
|
|
2470
|
+
if (i !== void 0 && we(r, i, n)) {
|
|
2471
|
+
if (De(i, r, n, () => $r(e), a), Se(n)) return;
|
|
2463
2472
|
r.event && window.dispatchEvent(new CustomEvent(r.event, { detail: r.payload })), r.keepOpen || Q.dismiss(e, "action");
|
|
2464
|
-
} else n.preventDefault(),
|
|
2473
|
+
} else n.preventDefault(), ii(e, t);
|
|
2465
2474
|
}
|
|
2466
|
-
var
|
|
2475
|
+
var oi = (e, t) => Br ? Q.add(e, t) : t?.id ?? "", si = (e) => (t, n) => oi(t, {
|
|
2467
2476
|
...n,
|
|
2468
2477
|
type: e
|
|
2469
|
-
}),
|
|
2478
|
+
}), ci = (e, t, n, r) => {
|
|
2470
2479
|
let { title: i, ...a } = typeof r == "string" ? { title: r } : r;
|
|
2471
|
-
return
|
|
2480
|
+
return oi(i, {
|
|
2472
2481
|
...n,
|
|
2473
2482
|
type: t,
|
|
2474
2483
|
...a,
|
|
2475
2484
|
id: e
|
|
2476
2485
|
});
|
|
2477
|
-
},
|
|
2478
|
-
r === void 0 ? Q.getSnapshot().some((t) => t.id === e && t.type === "loading") && Q.dismiss(e) :
|
|
2479
|
-
},
|
|
2480
|
-
success:
|
|
2481
|
-
info:
|
|
2482
|
-
warning:
|
|
2483
|
-
error:
|
|
2484
|
-
loading:
|
|
2486
|
+
}, li = (e, t, n, r, i) => {
|
|
2487
|
+
r === void 0 ? Q.getSnapshot().some((t) => t.id === e && t.type === "loading") && Q.dismiss(e) : ci(e, t, n, typeof r == "function" ? r(i) : r);
|
|
2488
|
+
}, ui = 0, di = Object.assign(oi, {
|
|
2489
|
+
success: si("success"),
|
|
2490
|
+
info: si("info"),
|
|
2491
|
+
warning: si("warning"),
|
|
2492
|
+
error: si("error"),
|
|
2493
|
+
loading: si("loading"),
|
|
2485
2494
|
update: (e, t) => Q.update(e, t),
|
|
2486
2495
|
dismiss: (e) => Q.dismiss(e),
|
|
2487
2496
|
promise(e, { loading: t, success: n, error: r, ...i }) {
|
|
2488
|
-
let a =
|
|
2489
|
-
throw
|
|
2497
|
+
let a = ci(i.id ?? `iui-promise-${++ui}`, "loading", i, t), o = (typeof e == "function" ? e() : e).then((e) => (typeof Response < "u" && e instanceof Response && !e.ok ? li(a, "error", i, r, e) : li(a, "success", i, n, e), e), (e) => {
|
|
2498
|
+
throw li(a, "error", i, r, e), e;
|
|
2490
2499
|
});
|
|
2491
2500
|
return o.catch(() => {}), {
|
|
2492
2501
|
id: a,
|
|
@@ -2494,21 +2503,21 @@ var ai = (e, t) => zr ? Q.add(e, t) : t?.id ?? "", oi = (e) => (t, n) => ai(t, {
|
|
|
2494
2503
|
};
|
|
2495
2504
|
},
|
|
2496
2505
|
track({ loading: e, success: t, error: n, ...r }, i) {
|
|
2497
|
-
let a = i ?? {}, o = r.id ?? `iui-track-${++
|
|
2506
|
+
let a = i ?? {}, o = r.id ?? `iui-track-${++ui}`, s = !1;
|
|
2498
2507
|
return {
|
|
2499
2508
|
...i,
|
|
2500
2509
|
onStart(t) {
|
|
2501
|
-
s = !1, e !== void 0 &&
|
|
2510
|
+
s = !1, e !== void 0 && ci(o, "loading", r, e), a.onStart?.(t);
|
|
2502
2511
|
},
|
|
2503
2512
|
onProgress(t) {
|
|
2504
2513
|
let n = t?.progress;
|
|
2505
2514
|
e !== void 0 && n !== void 0 && Q.update(o, { progress: n }), a.onProgress?.(t);
|
|
2506
2515
|
},
|
|
2507
2516
|
onSuccess(e) {
|
|
2508
|
-
s = !0,
|
|
2517
|
+
s = !0, li(o, "success", r, t, e), a.onSuccess?.(e);
|
|
2509
2518
|
},
|
|
2510
2519
|
onError(e) {
|
|
2511
|
-
s = !0,
|
|
2520
|
+
s = !0, li(o, "error", r, n, e), a.onError?.(e);
|
|
2512
2521
|
},
|
|
2513
2522
|
onFinish(e) {
|
|
2514
2523
|
s || Q.dismiss(o), a.onFinish?.(e);
|
|
@@ -2517,19 +2526,19 @@ var ai = (e, t) => zr ? Q.add(e, t) : t?.id ?? "", oi = (e) => (t, n) => ai(t, {
|
|
|
2517
2526
|
},
|
|
2518
2527
|
fromHeaders(e) {
|
|
2519
2528
|
let t = e instanceof Headers ? e.get(ue) : e["x-inertiaui-toasts"] ?? e["X-InertiaUI-Toasts"];
|
|
2520
|
-
|
|
2529
|
+
Br && t && Rr(_e({ [ue]: t }));
|
|
2521
2530
|
}
|
|
2522
|
-
}),
|
|
2531
|
+
}), fi = ["F8"], pi = [
|
|
2523
2532
|
"altKey",
|
|
2524
2533
|
"ctrlKey",
|
|
2525
2534
|
"metaKey",
|
|
2526
2535
|
"shiftKey"
|
|
2527
|
-
],
|
|
2536
|
+
], mi = {
|
|
2528
2537
|
altKey: "toaster_hotkey_alt",
|
|
2529
2538
|
ctrlKey: "toaster_hotkey_ctrl",
|
|
2530
2539
|
metaKey: "toaster_hotkey_meta",
|
|
2531
2540
|
shiftKey: "toaster_hotkey_shift"
|
|
2532
|
-
},
|
|
2541
|
+
}, hi = {
|
|
2533
2542
|
width: "0",
|
|
2534
2543
|
height: "0",
|
|
2535
2544
|
margin: "0",
|
|
@@ -2539,31 +2548,31 @@ var ai = (e, t) => zr ? Q.add(e, t) : t?.id ?? "", oi = (e) => (t, n) => ai(t, {
|
|
|
2539
2548
|
background: "none",
|
|
2540
2549
|
color: "inherit",
|
|
2541
2550
|
"pointer-events": "auto"
|
|
2542
|
-
},
|
|
2543
|
-
function
|
|
2544
|
-
return e.map((e) => Object.hasOwn(
|
|
2551
|
+
}, gi = 45, _i = .11;
|
|
2552
|
+
function vi(e) {
|
|
2553
|
+
return e.map((e) => Object.hasOwn(mi, e) ? Je(mi[e]) : e.replace(/^(Key|Digit)/, "")).join(Je("toaster_hotkey_separator"));
|
|
2545
2554
|
}
|
|
2546
|
-
function
|
|
2547
|
-
let n = e ??
|
|
2548
|
-
return t.length > 0 ?
|
|
2555
|
+
function yi(e, t) {
|
|
2556
|
+
let n = e ?? Je("toaster_label");
|
|
2557
|
+
return t.length > 0 ? Je("toaster_label_with_hotkey", {
|
|
2549
2558
|
label: n,
|
|
2550
|
-
hotkey:
|
|
2559
|
+
hotkey: vi(t)
|
|
2551
2560
|
}) : n;
|
|
2552
2561
|
}
|
|
2553
|
-
function
|
|
2554
|
-
return e === void 0 ?
|
|
2555
|
-
}
|
|
2556
|
-
function bi(e, t = {}) {
|
|
2557
|
-
let n = Ae(t, e) ?? Ge(`toast_type_${e}`);
|
|
2558
|
-
return n === void 0 ? "" : Ke(n);
|
|
2562
|
+
function bi(e, t) {
|
|
2563
|
+
return e === void 0 ? Je("toast_dismiss", { title: t.title }) : qe(e, { title: t.title });
|
|
2559
2564
|
}
|
|
2560
2565
|
function xi(e, t = {}) {
|
|
2561
|
-
let n =
|
|
2566
|
+
let n = je(t, e) ?? Ke(`toast_type_${e}`);
|
|
2567
|
+
return n === void 0 ? "" : qe(n);
|
|
2568
|
+
}
|
|
2569
|
+
function Si(e, t = {}) {
|
|
2570
|
+
let n = xi(e.type, t), r = n ? `${n}: ${e.title}` : e.title, i = [/[.!?…]$/.test(r) ? r : `${r}.`];
|
|
2562
2571
|
e.description && i.push(e.description);
|
|
2563
2572
|
for (let t of e.actions) t.altText && i.push(t.altText);
|
|
2564
2573
|
return i.join(" ");
|
|
2565
2574
|
}
|
|
2566
|
-
function
|
|
2575
|
+
function Ci(e, t) {
|
|
2567
2576
|
let n = /* @__PURE__ */ new Map();
|
|
2568
2577
|
for (let r of [...e].reverse()) if (r.state !== "queued") {
|
|
2569
2578
|
let e = r.position ?? t;
|
|
@@ -2571,12 +2580,12 @@ function Si(e, t) {
|
|
|
2571
2580
|
}
|
|
2572
2581
|
return W.filter((e) => n.has(e)).map((e) => [e, n.get(e)]);
|
|
2573
2582
|
}
|
|
2574
|
-
var
|
|
2575
|
-
function
|
|
2583
|
+
var wi = 0;
|
|
2584
|
+
function Ti(e, t, n) {
|
|
2576
2585
|
let { region: r, host: i } = t, a = ne({
|
|
2577
2586
|
polite: t.polite,
|
|
2578
2587
|
assertive: t.assertive
|
|
2579
|
-
}), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = ++
|
|
2588
|
+
}), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = ++wi, u = {
|
|
2580
2589
|
hover: `hover-${l}`,
|
|
2581
2590
|
focus: `focus-${l}`,
|
|
2582
2591
|
swipe: `swipe-${l}`
|
|
@@ -2681,7 +2690,7 @@ function wi(e, t, n) {
|
|
|
2681
2690
|
}, ie = (e) => {
|
|
2682
2691
|
if (!g || e.pointerId !== g.pointerId) return;
|
|
2683
2692
|
let t = Math.abs(g.dx) / Math.max(1, Date.now() - g.time), n = (window.getSelection?.()?.toString() ?? "") !== "";
|
|
2684
|
-
re(!n && V(g.item, g.dx) && (Math.abs(g.dx) >=
|
|
2693
|
+
re(!n && V(g.item, g.dx) && (Math.abs(g.dx) >= gi || t > _i));
|
|
2685
2694
|
}, ae = (e) => {
|
|
2686
2695
|
e.pointerId === g?.pointerId && re(!1);
|
|
2687
2696
|
}, oe = (e) => {
|
|
@@ -2690,7 +2699,7 @@ function wi(e, t, n) {
|
|
|
2690
2699
|
};
|
|
2691
2700
|
ce && window.addEventListener("focusout", t, !0), e.focus(), window.removeEventListener("focusout", t, !0);
|
|
2692
2701
|
}, se = (e) => {
|
|
2693
|
-
let { hotkey: t } = n(), i = t.length > 0 && t.every((t) =>
|
|
2702
|
+
let { hotkey: t } = n(), i = t.length > 0 && t.every((t) => pi.includes(t) ? e[t] : e.code === t), a = w()[0];
|
|
2694
2703
|
i && a && (e.preventDefault(), h = "keyboard", document.activeElement instanceof HTMLElement && document.activeElement !== document.body && !r.contains(document.activeElement) && (m = document.activeElement), oe(a));
|
|
2695
2704
|
}, W = [], ce = !1, le = (e) => e.isConnected && (e instanceof HTMLDialogElement ? e.open && e.matches(":modal") : ce && e.matches(":popover-open")), ue = (e) => e instanceof HTMLElement && e !== i && e.hasAttribute("popover") && /^(alert)?dialog$/.test(e.getAttribute("role") ?? ""), G = (e) => {
|
|
2696
2705
|
let t = W.indexOf(e);
|
|
@@ -2734,9 +2743,9 @@ function wi(e, t, n) {
|
|
|
2734
2743
|
let t = e && typeof i?.showPopover == "function";
|
|
2735
2744
|
if (i && t !== ce) {
|
|
2736
2745
|
if (ce = t, t) {
|
|
2737
|
-
ye(i), i.setAttribute("aria-live", "off"), i.setAttribute("popover", "manual"), Object.entries(
|
|
2746
|
+
ye(i), i.setAttribute("aria-live", "off"), i.setAttribute("popover", "manual"), Object.entries(hi).forEach(([e, t]) => i.style.setProperty(e, t));
|
|
2738
2747
|
for (let e of document.querySelectorAll("[popover]")) ue(e) && le(e) && W.push(e);
|
|
2739
|
-
} else be(i), i.matches(":popover-open") && i.hidePopover(), i.removeAttribute("popover"), i.removeAttribute("aria-live"), Object.keys(
|
|
2748
|
+
} else be(i), i.matches(":popover-open") && i.hidePopover(), i.removeAttribute("popover"), i.removeAttribute("aria-live"), Object.keys(hi).forEach((e) => i.style.removeProperty(e)), W.splice(0, W.length, ...W.filter((e) => e instanceof HTMLDialogElement));
|
|
2740
2749
|
fe();
|
|
2741
2750
|
}
|
|
2742
2751
|
}, Se = i && typeof MutationObserver == "function" ? new MutationObserver((e) => {
|
|
@@ -2754,7 +2763,7 @@ function wi(e, t, n) {
|
|
|
2754
2763
|
let t = y(), { typeLabels: r } = n(), i = !U();
|
|
2755
2764
|
for (let e of t) {
|
|
2756
2765
|
if (e.state === "closing") continue;
|
|
2757
|
-
o.get(e.id) !== e.revision && (o.set(e.id, e.revision), a.announce(
|
|
2766
|
+
o.get(e.id) !== e.revision && (o.set(e.id, e.revision), a.announce(Si(e, r), e.politeness ?? (e.type === "error" ? "assertive" : "polite")));
|
|
2758
2767
|
let t = x(e.id);
|
|
2759
2768
|
t && i && e.count > (s.get(e.id) ?? e.count) && typeof t.animate == "function" && t.animate([
|
|
2760
2769
|
{ scale: "1" },
|
|
@@ -2776,26 +2785,26 @@ function wi(e, t, n) {
|
|
|
2776
2785
|
};
|
|
2777
2786
|
}
|
|
2778
2787
|
// src/classes.ts
|
|
2779
|
-
var
|
|
2788
|
+
var Ei = "iui-toast rounded-iui-toast border-iui-toast-border bg-iui-toast-surface text-iui-toast-foreground focus-visible:ring-iui-toast-ring border shadow-lg focus-visible:ring-2 focus-visible:outline-hidden", Di = "flex items-start gap-3 p-4", Oi = "flex size-5 shrink-0 items-center justify-center", ki = {
|
|
2780
2789
|
default: "text-iui-toast-default",
|
|
2781
2790
|
info: "text-iui-toast-info",
|
|
2782
2791
|
success: "text-iui-toast-success",
|
|
2783
2792
|
warning: "text-iui-toast-warning",
|
|
2784
2793
|
error: "text-iui-toast-error",
|
|
2785
2794
|
loading: "text-iui-toast-loading"
|
|
2786
|
-
}, ki = "bg-iui-toast-default size-2 rounded-full", Ai = "size-5 rounded-full object-cover", ji = "size-5 motion-safe:animate-spin", Mi = "text-sm font-medium wrap-break-word", Ni = "bg-iui-toast-control-hover text-iui-toast-muted-foreground ms-1.5 inline-block rounded-full px-1.5 text-xs font-medium tabular-nums", Pi = "text-iui-toast-muted-foreground mt-1 text-sm wrap-break-word", Fi = "mt-3 flex flex-wrap gap-2", Ii = "rounded-iui-toast focus-visible:ring-iui-toast-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60", Li = `${Ii} border-iui-toast-action text-iui-toast-action hover:bg-iui-toast-action/10 border`, Ri = `${Ii} border-iui-toast-border hover:bg-iui-toast-control-hover border`, zi = "size-3.5 motion-safe:animate-spin", Bi = "rounded-iui-toast text-iui-toast-icon hover:bg-iui-toast-control-hover hover:text-iui-toast-icon-hover focus-visible:ring-iui-toast-ring -m-1 shrink-0 p-1 focus-visible:ring-2 focus-visible:outline-hidden", Vi = "iui-toast-progress", Hi = "bg-iui-toast-control-hover mt-2 h-1.5 overflow-hidden rounded-full", Ui = "h-full rounded-full bg-current transition-[width] duration-300 motion-reduce:transition-none", Wi = "rounded-iui-inbox text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring aria-expanded:bg-iui-inbox-control-hover aria-expanded:text-iui-inbox-icon-hover relative inline-flex size-9 items-center justify-center focus-visible:ring-2 focus-visible:outline-hidden", Gi = "bg-iui-inbox-badge text-iui-inbox-badge-foreground absolute -inset-e-0.5 -top-0.5 flex h-4.5 min-w-4.5 items-center justify-center rounded-full px-1 text-[0.6875rem] leading-none font-semibold tabular-nums", Ki = "bg-iui-inbox-badge absolute inset-e-1.5 top-1.5 size-2 rounded-full forced-color-adjust-none forced-colors:bg-[Highlight]", qi = "iui-inbox-panel border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground shadow-xl focus-visible:outline-hidden", Ji = "iui-inbox-panel-body flex min-h-0 flex-1 flex-col", Yi = "flex items-center justify-between gap-3 px-4 pt-3 pb-1", Xi = "border-iui-inbox-border flex flex-wrap-reverse items-stretch border-b pe-4", Zi = "iui-inbox-fade border-iui-inbox-border -mb-px flex min-w-0 flex-auto gap-1 overflow-x-auto border-b ps-2.5 pe-8 scrollbar-none", Qi = "-me-1.5 flex shrink-0 items-center gap-1 py-2 ps-2.5", $i = "text-base font-semibold", ea = "-me-1.5 flex items-center gap-1", ta = "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring rounded-md px-1.5 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:pointer-events-none aria-disabled:opacity-50", na = "border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground rounded-iui-inbox m-0 w-max min-w-48 border p-1 shadow-lg", ra = "hover:bg-iui-inbox-control-hover focus-visible:bg-iui-inbox-control-hover flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-hidden aria-disabled:pointer-events-none aria-disabled:opacity-50", ia = `${ra} ps-8`, aa = "text-iui-inbox-muted-foreground flex items-center gap-2 px-2 pt-1.5 pb-1 text-xs font-medium", oa = "text-iui-inbox-icon size-4 shrink-0", sa = "bg-iui-inbox-border -mx-1 my-1 h-px", ca = "text-iui-inbox-muted-foreground ms-auto ps-6 tabular-nums", la = "inline-flex", ua = "bg-iui-inbox-tooltip text-iui-inbox-tooltip-foreground pointer-events-none m-0 flex w-max max-w-xs items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium shadow-md", da = "inline-block h-4 min-w-4 content-center rounded border border-current/30 px-1 text-center font-sans text-[0.625rem] leading-none opacity-80 [text-box:trim-both_cap_alphabetic]", fa = "bg-iui-inbox-control-hover text-iui-inbox-foreground mx-4 mt-1 mb-2 flex shrink-0 items-center gap-2 rounded-md px-3 py-2 text-xs", pa = "text-iui-inbox-icon size-4 shrink-0", ma = "text-iui-inbox-foreground hover:bg-iui-inbox-surface focus-visible:ring-iui-inbox-ring -my-1 -me-1.5 shrink-0 rounded-md px-2 py-1 font-semibold focus-visible:ring-2 focus-visible:outline-hidden", ha = "iui-inbox-fade border-iui-inbox-border flex shrink-0 gap-1 overflow-x-auto border-b ps-2.5 pe-8 scrollbar-none", ga = "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring aria-selected:border-iui-inbox-accent aria-selected:text-iui-inbox-accent aria-[current=page]:border-iui-inbox-accent aria-[current=page]:text-iui-inbox-accent -mb-px inline-flex items-center gap-1.5 rounded-t-md border-b-2 border-transparent px-1.5 py-2 text-sm font-medium focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset", _a = "iui-inbox-fade border-iui-inbox-border flex shrink-0 gap-1.5 overflow-x-auto border-b ps-4 pe-8 py-2 scrollbar-none", va = "border-iui-inbox-border text-iui-inbox-muted-foreground hover:bg-iui-inbox-control-hover hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring aria-pressed:border-iui-inbox-accent aria-pressed:bg-iui-inbox-accent-subtle aria-pressed:text-iui-inbox-accent aria-[current=page]:border-iui-inbox-accent aria-[current=page]:bg-iui-inbox-accent-subtle aria-[current=page]:text-iui-inbox-accent inline-flex shrink-0 items-center gap-1 rounded-full border px-2.5 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden", ya = "text-iui-inbox-accent tabular-nums", ba = "bg-iui-inbox-accent-subtle text-iui-inbox-accent rounded-full px-1.5 text-xs/5 tabular-nums", xa = "min-h-0 flex-1 overflow-y-auto overscroll-contain", Sa = "sticky top-0 z-20 flex h-0 justify-center", Ca = "border-iui-inbox-accent bg-iui-inbox-surface text-iui-inbox-accent focus-visible:ring-iui-inbox-ring mt-2 h-fit rounded-full border px-3 py-1 text-xs font-medium shadow-md focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden", wa = "divide-iui-inbox-border divide-y", Ta = "focus-visible:ring-iui-inbox-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:outline-hidden", Ea = "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring ms-15 -mt-2 mb-2.5 rounded-md px-1 py-0.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden", Da = "divide-iui-inbox-border border-iui-inbox-border ms-12 divide-y border-s", Oa = "group/item hover:bg-iui-inbox-control-hover/60 data-[selected=true]:bg-iui-inbox-control-hover/60 has-[[data-inbox-link]:focus-visible]:ring-iui-inbox-ring relative flex flex-wrap gap-3 px-4 py-3 has-[[data-inbox-link]:focus-visible]:ring-2 has-[[data-inbox-link]:focus-visible]:ring-inset", ka = "relative flex shrink-0 self-start", Aa = "bg-iui-inbox-unread ring-iui-inbox-surface absolute end-0 top-0 size-2.5 rounded-full ring-2 forced-color-adjust-none forced-colors:bg-[Highlight]", ja = "bg-iui-inbox-control-hover text-iui-inbox-icon-hover flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full text-sm font-medium", Ma = "text-iui-inbox-foreground text-sm wrap-break-word group-data-[read=false]/item:font-semibold", Na = "after:absolute after:inset-0 focus-visible:outline-hidden", Pa = "text-iui-inbox-muted-foreground mt-0.5 line-clamp-3 text-sm wrap-break-word", Fa = "border-iui-inbox-border mt-2 max-h-40 rounded-md border object-cover", Ia = "text-iui-inbox-muted-foreground mt-1 block text-xs", La = "text-iui-inbox-muted-foreground mt-1 flex items-center gap-1 text-xs", Ra = "text-iui-inbox-muted-foreground mt-1 flex items-center gap-1 text-xs", za = "text-iui-inbox-muted-foreground font-normal", Ba = "relative z-10 mt-2 flex flex-wrap gap-2", Va = "text-iui-inbox-muted-foreground mt-1.5 flex items-center gap-1.5 text-xs", Ha = "isolate flex", Ua = "bg-iui-inbox-control-hover text-iui-inbox-icon-hover ring-iui-inbox-surface relative flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full text-[0.625rem] font-medium ring-2 not-first:-ms-0.5", Wa = "text-iui-inbox-muted-foreground mt-2 flex items-center gap-1.5 text-xs font-medium", Ga = "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60", Ka = `${Ga} border-iui-inbox-accent text-iui-inbox-accent hover:bg-iui-inbox-accent-subtle border`, qa = `${Ga} border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border`, Ja = "iui-inbox-controls border-iui-inbox-border z-10 flex shrink-0 items-center gap-0.5 rounded-md opacity-0 group-focus-within/item:opacity-100 group-hover/item:opacity-100 [@media(hover:none)]:opacity-100", Ya = "bg-iui-inbox-control-hover absolute inset-0 flex items-center justify-center rounded-full opacity-0 group-hover/item:opacity-100 group-data-[selected=true]/item:opacity-100 in-data-inbox-selecting:opacity-100 has-focus-visible:opacity-100 motion-safe:transition-opacity", Xa = "accent-iui-inbox-accent size-4 cursor-pointer", Za = "border-iui-inbox-border flex shrink-0 items-center justify-between gap-3 border-t px-4 py-1.5", Qa = "bg-iui-inbox-surface sticky bottom-0 z-20", $a = "text-iui-inbox-foreground flex items-center gap-2 text-sm font-medium", eo = "accent-iui-inbox-accent size-4 cursor-pointer", to = "flex shrink-0 flex-wrap gap-2 px-4 pt-1 pb-2", no = "text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", ro = "text-iui-inbox-muted-foreground flex flex-col items-center gap-3 px-6 py-12 text-center text-sm", io = "text-iui-inbox-icon size-8", ao = "text-iui-inbox-muted-foreground flex justify-center py-3", oo = "overflow-x-auto", so = "w-full border-collapse text-sm", co = "text-iui-inbox-muted-foreground px-4 py-2.5 text-start text-xs font-medium", lo = "text-iui-inbox-muted-foreground w-20 px-2 py-2.5 text-center text-xs font-medium sm:w-24", uo = "border-iui-inbox-border border-t", fo = "bg-iui-inbox-control-hover/50 px-4 pt-4 pb-2 text-start font-normal", po = "text-iui-inbox-foreground font-semibold", mo = "min-w-36 px-4 py-3 text-start align-top font-normal", ho = "text-iui-inbox-foreground font-medium", go = "text-iui-inbox-foreground me-2 font-medium", _o = "bg-iui-inbox-control-hover text-iui-inbox-muted-foreground inline-block rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap", vo = "text-iui-inbox-muted-foreground mt-0.5 block", yo = "px-2 py-3 text-center align-middle", bo = "text-iui-inbox-muted-foreground w-40 px-4 py-2.5 text-start text-xs font-medium", xo = "px-4 py-3 text-start align-middle", So = "border-iui-inbox-border border-t px-4 py-3 text-sm", Co = "min-w-0 grow", wo = "flex flex-wrap items-start justify-between gap-x-6 gap-y-3", To = "min-w-0 grow basis-64", Eo = "bg-iui-inbox-control-hover text-iui-inbox-foreground mt-2 rounded-md px-3 py-2", Do = "shrink-0 whitespace-nowrap", Oo = "mt-4", ko = "text-iui-inbox-muted-foreground text-xs font-medium", Ao = "divide-iui-inbox-border border-iui-inbox-border mt-2 divide-y rounded-md border", jo = "flex items-center justify-between gap-4 px-3 py-2", Mo = "border-iui-inbox-border border-t px-4 py-3 text-sm", No = "flex items-start gap-3", Po = "mt-3 flex flex-col gap-3 sm:gap-2", Fo = "flex flex-wrap items-start gap-x-4 gap-y-2", Io = "text-iui-inbox-foreground flex h-8 w-36 shrink-0 items-center gap-3 font-medium", Lo = "flex min-w-0 grow basis-60 flex-col items-start gap-2", Ro = "flex flex-wrap items-center gap-x-3 gap-y-2", zo = "text-iui-inbox-muted-foreground flex h-8 items-center", Bo = "text-iui-inbox-muted-foreground -ms-2 hover:bg-iui-inbox-control-hover hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring rounded-md px-2 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-iui-inbox-muted-foreground", Vo = "text-iui-inbox-muted-foreground flex items-center gap-2 text-xs font-medium", Ho = "rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50", Uo = "rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring min-w-full border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50", Wo = "group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors", Go = "bg-iui-inbox-surface ms-0.5 size-4 rounded-full shadow-sm forced-color-adjust-none group-aria-checked/switch:translate-x-4 forced-colors:bg-[ButtonText] forced-colors:group-aria-checked/switch:bg-[Highlight] motion-safe:transition-transform rtl:group-aria-checked/switch:-translate-x-4", Ko = "border-iui-inbox-border text-iui-inbox-accent hover:bg-iui-inbox-control-hover focus-visible:ring-iui-inbox-ring block border-t px-4 py-2.5 text-center text-sm font-medium focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset", qo = {
|
|
2795
|
+
}, Ai = "bg-iui-toast-default size-2 rounded-full", ji = "size-5 rounded-full object-cover", Mi = "size-5 motion-safe:animate-spin", Ni = "text-sm font-medium wrap-break-word", Pi = "bg-iui-toast-control-hover text-iui-toast-muted-foreground ms-1.5 inline-block rounded-full px-1.5 text-xs font-medium tabular-nums", Fi = "text-iui-toast-muted-foreground mt-1 text-sm wrap-break-word", Ii = "mt-3 flex flex-wrap gap-2", Li = "rounded-iui-toast focus-visible:ring-iui-toast-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60", Ri = `${Li} border-iui-toast-action text-iui-toast-action hover:bg-iui-toast-action/10 border`, zi = `${Li} border-iui-toast-border hover:bg-iui-toast-control-hover border`, Bi = "size-3.5 motion-safe:animate-spin", Vi = "rounded-iui-toast text-iui-toast-icon hover:bg-iui-toast-control-hover hover:text-iui-toast-icon-hover focus-visible:ring-iui-toast-ring -m-1 shrink-0 p-1 focus-visible:ring-2 focus-visible:outline-hidden", Hi = "iui-toast-progress", Ui = "bg-iui-toast-control-hover mt-2 h-1.5 overflow-hidden rounded-full", Wi = "h-full rounded-full bg-current transition-[width] duration-300 motion-reduce:transition-none", Gi = "rounded-iui-inbox text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring aria-expanded:bg-iui-inbox-control-hover aria-expanded:text-iui-inbox-icon-hover relative inline-flex size-9 items-center justify-center focus-visible:ring-2 focus-visible:outline-hidden", Ki = "bg-iui-inbox-badge text-iui-inbox-badge-foreground absolute -inset-e-0.5 -top-0.5 flex h-4.5 min-w-4.5 items-center justify-center rounded-full px-1 text-[0.6875rem] leading-none font-semibold tabular-nums", qi = "bg-iui-inbox-badge absolute inset-e-1.5 top-1.5 size-2 rounded-full forced-color-adjust-none forced-colors:bg-[Highlight]", Ji = "iui-inbox-panel border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground shadow-xl focus-visible:outline-hidden", Yi = "iui-inbox-panel-body flex min-h-0 flex-1 flex-col", Xi = "flex items-center justify-between gap-3 px-4 pt-3 pb-1", Zi = "border-iui-inbox-border flex flex-wrap-reverse items-stretch border-b pe-4", Qi = "iui-inbox-fade border-iui-inbox-border -mb-px flex min-w-0 flex-auto gap-1 overflow-x-auto border-b ps-2.5 pe-8 scrollbar-none", $i = "-me-1.5 flex shrink-0 items-center gap-1 py-2 ps-2.5", ea = "text-base font-semibold", ta = "-me-1.5 flex items-center gap-1", na = "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring rounded-md px-1.5 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:pointer-events-none aria-disabled:opacity-50", ra = "border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground rounded-iui-inbox m-0 w-max min-w-48 border p-1 shadow-lg", ia = "hover:bg-iui-inbox-control-hover focus-visible:bg-iui-inbox-control-hover flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-sm outline-hidden aria-disabled:pointer-events-none aria-disabled:opacity-50", aa = `${ia} ps-8`, oa = "text-iui-inbox-muted-foreground flex items-center gap-2 px-2 pt-1.5 pb-1 text-xs font-medium", sa = "text-iui-inbox-icon size-4 shrink-0", ca = "bg-iui-inbox-border -mx-1 my-1 h-px", la = "text-iui-inbox-muted-foreground ms-auto ps-6 tabular-nums", ua = "inline-flex", da = "bg-iui-inbox-tooltip text-iui-inbox-tooltip-foreground pointer-events-none m-0 flex w-max max-w-xs items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium shadow-md", fa = "inline-block h-4 min-w-4 content-center rounded border border-current/30 px-1 text-center font-sans text-[0.625rem] leading-none opacity-80 [text-box:trim-both_cap_alphabetic]", pa = "bg-iui-inbox-control-hover text-iui-inbox-foreground mx-4 mt-1 mb-2 flex shrink-0 items-center gap-2 rounded-md px-3 py-2 text-xs", ma = "text-iui-inbox-icon size-4 shrink-0", ha = "text-iui-inbox-foreground hover:bg-iui-inbox-surface focus-visible:ring-iui-inbox-ring -my-1 -me-1.5 shrink-0 rounded-md px-2 py-1 font-semibold focus-visible:ring-2 focus-visible:outline-hidden", ga = "iui-inbox-fade border-iui-inbox-border flex shrink-0 gap-1 overflow-x-auto border-b ps-2.5 pe-8 scrollbar-none", _a = "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring aria-selected:border-iui-inbox-accent aria-selected:text-iui-inbox-accent aria-[current=page]:border-iui-inbox-accent aria-[current=page]:text-iui-inbox-accent -mb-px inline-flex items-center gap-1.5 rounded-t-md border-b-2 border-transparent px-1.5 py-2 text-sm font-medium focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset", va = "iui-inbox-fade border-iui-inbox-border flex shrink-0 gap-1.5 overflow-x-auto border-b ps-4 pe-8 py-2 scrollbar-none", ya = "border-iui-inbox-border text-iui-inbox-muted-foreground hover:bg-iui-inbox-control-hover hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring aria-pressed:border-iui-inbox-accent aria-pressed:bg-iui-inbox-accent-subtle aria-pressed:text-iui-inbox-accent aria-[current=page]:border-iui-inbox-accent aria-[current=page]:bg-iui-inbox-accent-subtle aria-[current=page]:text-iui-inbox-accent inline-flex shrink-0 items-center gap-1 rounded-full border px-2.5 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden", ba = "text-iui-inbox-accent tabular-nums", xa = "bg-iui-inbox-accent-subtle text-iui-inbox-accent rounded-full px-1.5 text-xs/5 tabular-nums", Sa = "min-h-0 flex-1 overflow-y-auto overscroll-contain", Ca = "sticky top-0 z-20 flex h-0 justify-center", wa = "border-iui-inbox-accent bg-iui-inbox-surface text-iui-inbox-accent focus-visible:ring-iui-inbox-ring mt-2 h-fit rounded-full border px-3 py-1 text-xs font-medium shadow-md focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden", Ta = "divide-iui-inbox-border divide-y", Ea = "focus-visible:ring-iui-inbox-ring focus-visible:ring-2 focus-visible:ring-inset focus-visible:outline-hidden", Da = "text-iui-inbox-muted-foreground hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring ms-15 -mt-2 mb-2.5 rounded-md px-1 py-0.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden", Oa = "divide-iui-inbox-border border-iui-inbox-border ms-12 divide-y border-s", ka = "group/item hover:bg-iui-inbox-control-hover/60 data-[selected=true]:bg-iui-inbox-control-hover/60 has-[[data-inbox-link]:focus-visible]:ring-iui-inbox-ring relative flex flex-wrap gap-3 px-4 py-3 has-[[data-inbox-link]:focus-visible]:ring-2 has-[[data-inbox-link]:focus-visible]:ring-inset", Aa = "relative flex shrink-0 self-start", ja = "bg-iui-inbox-unread ring-iui-inbox-surface absolute end-0 top-0 size-2.5 rounded-full ring-2 forced-color-adjust-none forced-colors:bg-[Highlight]", Ma = "bg-iui-inbox-control-hover text-iui-inbox-icon-hover flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full text-sm font-medium", Na = "text-iui-inbox-foreground text-sm wrap-break-word group-data-[read=false]/item:font-semibold", Pa = "after:absolute after:inset-0 focus-visible:outline-hidden", Fa = "text-iui-inbox-muted-foreground mt-0.5 line-clamp-3 text-sm wrap-break-word", Ia = "border-iui-inbox-border mt-2 max-h-40 rounded-md border object-cover", La = "text-iui-inbox-muted-foreground mt-1 block text-xs", Ra = "text-iui-inbox-muted-foreground mt-1 flex items-center gap-1 text-xs", za = "text-iui-inbox-muted-foreground mt-1 flex items-center gap-1 text-xs", Ba = "text-iui-inbox-muted-foreground font-normal", Va = "relative z-10 mt-2 flex flex-wrap gap-2", Ha = "text-iui-inbox-muted-foreground mt-1.5 flex items-center gap-1.5 text-xs", Ua = "isolate flex", Wa = "bg-iui-inbox-control-hover text-iui-inbox-icon-hover ring-iui-inbox-surface relative flex size-6 shrink-0 items-center justify-center overflow-hidden rounded-full text-[0.625rem] font-medium ring-2 not-first:-ms-0.5", Ga = "text-iui-inbox-muted-foreground mt-2 flex items-center gap-1.5 text-xs font-medium", Ka = "rounded-md focus-visible:ring-iui-inbox-ring inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-60", qa = `${Ka} border-iui-inbox-accent text-iui-inbox-accent hover:bg-iui-inbox-accent-subtle border`, Ja = `${Ka} border-iui-inbox-border bg-iui-inbox-surface hover:bg-iui-inbox-control-hover border`, Ya = "iui-inbox-controls border-iui-inbox-border z-10 flex shrink-0 items-center gap-0.5 rounded-md opacity-0 group-focus-within/item:opacity-100 group-hover/item:opacity-100 [@media(hover:none)]:opacity-100", Xa = "bg-iui-inbox-control-hover absolute inset-0 flex items-center justify-center rounded-full opacity-0 group-hover/item:opacity-100 group-data-[selected=true]/item:opacity-100 in-data-inbox-selecting:opacity-100 has-focus-visible:opacity-100 motion-safe:transition-opacity", Za = "accent-iui-inbox-accent size-4 cursor-pointer", Qa = "border-iui-inbox-border flex shrink-0 items-center justify-between gap-3 border-t px-4 py-1.5", $a = "bg-iui-inbox-surface sticky bottom-0 z-20", eo = "text-iui-inbox-foreground flex items-center gap-2 text-sm font-medium", to = "accent-iui-inbox-accent size-4 cursor-pointer", no = "flex shrink-0 flex-wrap gap-2 px-4 pt-1 pb-2", ro = "text-iui-inbox-icon hover:bg-iui-inbox-control-hover hover:text-iui-inbox-icon-hover focus-visible:ring-iui-inbox-ring rounded-md p-1.5 focus-visible:ring-2 focus-visible:outline-hidden [@media(hover:hover)]:p-1", io = "text-iui-inbox-muted-foreground flex flex-col items-center gap-3 px-6 py-12 text-center text-sm", ao = "text-iui-inbox-icon size-8", oo = "text-iui-inbox-muted-foreground flex justify-center py-3", so = "overflow-x-auto", co = "w-full border-collapse text-sm", lo = "text-iui-inbox-muted-foreground px-4 py-2.5 text-start text-xs font-medium", uo = "text-iui-inbox-muted-foreground w-20 px-2 py-2.5 text-center text-xs font-medium sm:w-24", fo = "border-iui-inbox-border border-t", po = "bg-iui-inbox-control-hover/50 px-4 pt-4 pb-2 text-start font-normal", mo = "text-iui-inbox-foreground font-semibold", ho = "min-w-36 px-4 py-3 text-start align-top font-normal", go = "text-iui-inbox-foreground font-medium", _o = "text-iui-inbox-foreground me-2 font-medium", vo = "bg-iui-inbox-control-hover text-iui-inbox-muted-foreground inline-block rounded-full px-2 py-0.5 text-xs font-medium whitespace-nowrap", yo = "text-iui-inbox-muted-foreground mt-0.5 block", bo = "px-2 py-3 text-center align-middle", xo = "text-iui-inbox-muted-foreground w-40 px-4 py-2.5 text-start text-xs font-medium", So = "px-4 py-3 text-start align-middle", Co = "border-iui-inbox-border border-t px-4 py-3 text-sm", wo = "min-w-0 grow", To = "flex flex-wrap items-start justify-between gap-x-6 gap-y-3", Eo = "min-w-0 grow basis-64", Do = "bg-iui-inbox-control-hover text-iui-inbox-foreground mt-2 rounded-md px-3 py-2", Oo = "shrink-0 whitespace-nowrap", ko = "mt-4", Ao = "text-iui-inbox-muted-foreground text-xs font-medium", jo = "divide-iui-inbox-border border-iui-inbox-border mt-2 divide-y rounded-md border", Mo = "flex items-center justify-between gap-4 px-3 py-2", No = "border-iui-inbox-border border-t px-4 py-3 text-sm", Po = "flex items-start gap-3", Fo = "mt-3 flex flex-col gap-3 sm:gap-2", Io = "flex flex-wrap items-start gap-x-4 gap-y-2", Lo = "text-iui-inbox-foreground flex h-8 w-36 shrink-0 items-center gap-3 font-medium", Ro = "flex min-w-0 grow basis-60 flex-col items-start gap-2", zo = "flex flex-wrap items-center gap-x-3 gap-y-2", Bo = "text-iui-inbox-muted-foreground flex h-8 items-center", Vo = "text-iui-inbox-muted-foreground -ms-2 hover:bg-iui-inbox-control-hover hover:text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring rounded-md px-2 py-1 text-xs font-medium focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50 disabled:hover:bg-transparent disabled:hover:text-iui-inbox-muted-foreground", Ho = "text-iui-inbox-muted-foreground flex items-center gap-2 text-xs font-medium", Uo = "rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50", Wo = "rounded-iui-inbox border-iui-inbox-border bg-iui-inbox-surface text-iui-inbox-foreground focus-visible:ring-iui-inbox-ring min-w-full border px-2 py-1 text-sm focus-visible:ring-2 focus-visible:outline-hidden disabled:cursor-default disabled:opacity-50", Go = "group/switch bg-iui-inbox-icon aria-checked:bg-iui-inbox-accent focus-visible:ring-iui-inbox-ring focus-visible:ring-offset-iui-inbox-surface relative inline-flex h-5 w-9 shrink-0 items-center rounded-full focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden aria-disabled:cursor-default aria-disabled:opacity-50 forced-colors:border motion-safe:transition-colors", Ko = "bg-iui-inbox-surface ms-0.5 size-4 rounded-full shadow-sm forced-color-adjust-none group-aria-checked/switch:translate-x-4 forced-colors:bg-[ButtonText] forced-colors:group-aria-checked/switch:bg-[Highlight] motion-safe:transition-transform rtl:group-aria-checked/switch:-translate-x-4", qo = "border-iui-inbox-border text-iui-inbox-accent hover:bg-iui-inbox-control-hover focus-visible:ring-iui-inbox-ring block border-t px-4 py-2.5 text-center text-sm font-medium focus-visible:ring-2 focus-visible:outline-hidden focus-visible:ring-inset", Jo = {
|
|
2787
2796
|
key: 1,
|
|
2788
2797
|
viewBox: "0 0 20 20",
|
|
2789
2798
|
fill: "none",
|
|
2790
2799
|
stroke: "currentColor",
|
|
2791
2800
|
"stroke-width": "2",
|
|
2792
2801
|
"aria-hidden": "true"
|
|
2793
|
-
},
|
|
2802
|
+
}, Yo = ["d"], Xo = {
|
|
2794
2803
|
key: 2,
|
|
2795
2804
|
viewBox: "0 0 20 20",
|
|
2796
2805
|
fill: "currentColor",
|
|
2797
2806
|
"aria-hidden": "true"
|
|
2798
|
-
},
|
|
2807
|
+
}, Zo = ["d"], $ = /* @__PURE__ */ u({
|
|
2799
2808
|
__name: "Icon",
|
|
2800
2809
|
props: {
|
|
2801
2810
|
name: {},
|
|
@@ -2807,28 +2816,28 @@ var Ti = "iui-toast rounded-iui-toast border-iui-toast-border bg-iui-toast-surfa
|
|
|
2807
2816
|
}
|
|
2808
2817
|
},
|
|
2809
2818
|
setup(t) {
|
|
2810
|
-
let i = t, s = n(() =>
|
|
2819
|
+
let i = t, s = n(() => He(i.name, i.context, i.icons, i.resolver));
|
|
2811
2820
|
return (t, n) => s.value ? (S(), r(E(s.value), {
|
|
2812
2821
|
key: 0,
|
|
2813
2822
|
"aria-hidden": "true"
|
|
2814
|
-
})) : i.name === "spinner" ? (S(), a("svg",
|
|
2823
|
+
})) : i.name === "spinner" ? (S(), a("svg", Jo, [n[0] ||= o("circle", {
|
|
2815
2824
|
cx: "10",
|
|
2816
2825
|
cy: "10",
|
|
2817
2826
|
r: "7",
|
|
2818
2827
|
opacity: "0.25"
|
|
2819
2828
|
}, null, -1), o("path", {
|
|
2820
|
-
d: A(
|
|
2829
|
+
d: A(Pe),
|
|
2821
2830
|
"stroke-linecap": "round"
|
|
2822
|
-
}, null, 8,
|
|
2831
|
+
}, null, 8, Yo)])) : (S(), a("svg", Xo, [(S(!0), a(e, null, w(A(je)(A(Re), i.name), (e) => (S(), a("path", {
|
|
2823
2832
|
key: e,
|
|
2824
2833
|
"fill-rule": "evenodd",
|
|
2825
2834
|
"clip-rule": "evenodd",
|
|
2826
2835
|
d: e
|
|
2827
|
-
}, null, 8,
|
|
2836
|
+
}, null, 8, Zo))), 128))]));
|
|
2828
2837
|
}
|
|
2829
2838
|
});
|
|
2830
2839
|
// ../js/inertia.ts
|
|
2831
|
-
function
|
|
2840
|
+
function Qo(e, t, n) {
|
|
2832
2841
|
return {
|
|
2833
2842
|
onFlash: (t) => void e.on("flash", (e) => t(e.detail.flash)),
|
|
2834
2843
|
onRequest: (e) => void t.onRequest((t) => ({
|
|
@@ -2864,25 +2873,25 @@ function Zo(e, t, n) {
|
|
|
2864
2873
|
};
|
|
2865
2874
|
}
|
|
2866
2875
|
// src/notifications.ts
|
|
2867
|
-
function
|
|
2868
|
-
|
|
2876
|
+
function $o(e) {
|
|
2877
|
+
ti(Qo(R, L, z), e);
|
|
2869
2878
|
}
|
|
2870
2879
|
// src/Toaster.vue?vue&type=script&setup=true&lang.ts
|
|
2871
|
-
var
|
|
2880
|
+
var es = ["aria-label", "data-toaster"], ts = ["data-position"], ns = [
|
|
2872
2881
|
"data-toast-id",
|
|
2873
2882
|
"data-type",
|
|
2874
2883
|
"data-state",
|
|
2875
2884
|
"data-dismissible",
|
|
2876
2885
|
"aria-busy"
|
|
2877
|
-
],
|
|
2886
|
+
], rs = ["src"], is = {
|
|
2878
2887
|
key: 3,
|
|
2879
2888
|
viewBox: "0 0 20 20",
|
|
2880
2889
|
fill: "currentColor",
|
|
2881
2890
|
class: "size-5"
|
|
2882
|
-
},
|
|
2891
|
+
}, as = ["d"], os = { class: "min-w-0 flex-1" }, ss = {
|
|
2883
2892
|
key: 0,
|
|
2884
2893
|
class: "sr-only"
|
|
2885
|
-
},
|
|
2894
|
+
}, cs = ["aria-label", "aria-valuenow"], ls = ["aria-label", "onClick"], us = /* @__PURE__ */ u({
|
|
2886
2895
|
__name: "Toaster",
|
|
2887
2896
|
props: {
|
|
2888
2897
|
position: { default: "bottom-right" },
|
|
@@ -2892,7 +2901,7 @@ var $o = ["aria-label", "data-toaster"], es = ["data-position"], ts = [
|
|
|
2892
2901
|
type: [String, Function],
|
|
2893
2902
|
default: void 0
|
|
2894
2903
|
},
|
|
2895
|
-
hotkey: { default: () =>
|
|
2904
|
+
hotkey: { default: () => fi },
|
|
2896
2905
|
typeLabels: { default: () => ({}) },
|
|
2897
2906
|
visibleToasts: { default: 3 },
|
|
2898
2907
|
expand: {
|
|
@@ -2916,21 +2925,21 @@ var $o = ["aria-label", "data-toaster"], es = ["data-position"], ts = [
|
|
|
2916
2925
|
}
|
|
2917
2926
|
},
|
|
2918
2927
|
setup(s) {
|
|
2919
|
-
let u = s, d = B(), f = D(Q.getSnapshot()), p = n(() =>
|
|
2928
|
+
let u = s, d = B(), f = D(Q.getSnapshot()), p = n(() => Ci(f.value.filter((e) => e.toaster === u.name), u.position)), m = D(), g = C(), k = C(), j = C(), M, F, I = (e) => {
|
|
2920
2929
|
if (typeof e.icon == "object" || typeof e.icon == "function") return e.icon;
|
|
2921
|
-
let t = (t, n) =>
|
|
2930
|
+
let t = (t, n) => He(t, {
|
|
2922
2931
|
component: "Toaster",
|
|
2923
2932
|
part: n,
|
|
2924
2933
|
toast: e
|
|
2925
2934
|
}, u.icons, u.iconResolver);
|
|
2926
2935
|
return (typeof e.icon == "string" ? t(e.icon, "icon") : void 0) ?? t(e.type, "type");
|
|
2927
|
-
}, L = (e) => Q.dismiss(e.id, "user"), R = (e, t, n) =>
|
|
2936
|
+
}, L = (e) => Q.dismiss(e.id, "user"), R = (e, t, n) => ai(e.id, t, n);
|
|
2928
2937
|
return y(() => {
|
|
2929
|
-
|
|
2938
|
+
$o(), F = Q.subscribe(() => f.value = Q.getSnapshot()), zr(d.flash), f.value = Q.getSnapshot();
|
|
2930
2939
|
let e = document.createElement("div");
|
|
2931
2940
|
e.className = "iui-toaster-host", document.body.append(e), m.value = e;
|
|
2932
2941
|
}), N(g, (e) => {
|
|
2933
|
-
e && !M && (M =
|
|
2942
|
+
e && !M && (M = Ti(Q, {
|
|
2934
2943
|
region: e,
|
|
2935
2944
|
host: m.value,
|
|
2936
2945
|
polite: k.value,
|
|
@@ -2951,7 +2960,7 @@ var $o = ["aria-label", "data-toaster"], es = ["data-position"], ts = [
|
|
|
2951
2960
|
}, [o("section", {
|
|
2952
2961
|
ref_key: "region",
|
|
2953
2962
|
ref: g,
|
|
2954
|
-
"aria-label": A(
|
|
2963
|
+
"aria-label": A(yi)(u.label, u.hotkey),
|
|
2955
2964
|
tabindex: "-1",
|
|
2956
2965
|
class: "iui-toaster outline-none",
|
|
2957
2966
|
"data-toaster": u.name
|
|
@@ -2970,11 +2979,11 @@ var $o = ["aria-label", "data-toaster"], es = ["data-position"], ts = [
|
|
|
2970
2979
|
"data-dismissible": String(t.dismissible),
|
|
2971
2980
|
"aria-busy": t.type === "loading" || void 0,
|
|
2972
2981
|
tabindex: "0",
|
|
2973
|
-
class: h(A(J)(
|
|
2982
|
+
class: h(A(J)(Ei, u.classes.toast))
|
|
2974
2983
|
}, [o("div", {
|
|
2975
2984
|
"data-toast-body": "",
|
|
2976
|
-
class: h(
|
|
2977
|
-
}, [A(
|
|
2985
|
+
class: h(Di)
|
|
2986
|
+
}, [A(je)(u.components, t.type) ? (S(), r(E(A(je)(u.components, t.type)), {
|
|
2978
2987
|
key: 0,
|
|
2979
2988
|
toast: t,
|
|
2980
2989
|
dismiss: () => L(t),
|
|
@@ -2991,13 +3000,13 @@ var $o = ["aria-label", "data-toaster"], es = ["data-position"], ts = [
|
|
|
2991
3000
|
t.icon === !1 ? i("", !0) : (S(), a("span", {
|
|
2992
3001
|
key: 0,
|
|
2993
3002
|
"aria-hidden": "true",
|
|
2994
|
-
class: h(A(J)(
|
|
3003
|
+
class: h(A(J)(Oi, A(je)(ki, t.type) ?? ki.default, u.classes.icon))
|
|
2995
3004
|
}, [T(n.$slots, "icon", { toast: t }, () => [t.image ? (S(), a("img", {
|
|
2996
3005
|
key: 0,
|
|
2997
3006
|
src: t.image,
|
|
2998
3007
|
alt: "",
|
|
2999
|
-
class: h(
|
|
3000
|
-
}, null, 10,
|
|
3008
|
+
class: h(ji)
|
|
3009
|
+
}, null, 10, rs)) : I(t) ? (S(), r(E(I(t)), {
|
|
3001
3010
|
key: 1,
|
|
3002
3011
|
class: "size-5"
|
|
3003
3012
|
})) : t.type === "loading" ? (S(), r($, {
|
|
@@ -3010,34 +3019,34 @@ var $o = ["aria-label", "data-toaster"], es = ["data-position"], ts = [
|
|
|
3010
3019
|
},
|
|
3011
3020
|
icons: u.icons,
|
|
3012
3021
|
resolver: u.iconResolver,
|
|
3013
|
-
class: h(
|
|
3022
|
+
class: h(Mi)
|
|
3014
3023
|
}, null, 8, [
|
|
3015
3024
|
"context",
|
|
3016
3025
|
"icons",
|
|
3017
3026
|
"resolver",
|
|
3018
3027
|
"class"
|
|
3019
|
-
])) : A(
|
|
3028
|
+
])) : A(je)(A(Me), t.type) ? (S(), a("svg", is, [o("path", {
|
|
3020
3029
|
"fill-rule": "evenodd",
|
|
3021
3030
|
"clip-rule": "evenodd",
|
|
3022
|
-
d: A(
|
|
3023
|
-
}, null, 8,
|
|
3031
|
+
d: A(je)(A(Me), t.type)
|
|
3032
|
+
}, null, 8, as)])) : (S(), a("span", {
|
|
3024
3033
|
key: 4,
|
|
3025
|
-
class: h(
|
|
3034
|
+
class: h(Ai)
|
|
3026
3035
|
}, null, 2))])], 2)),
|
|
3027
|
-
o("div",
|
|
3028
|
-
o("p", { class: h(A(J)(
|
|
3029
|
-
A(
|
|
3036
|
+
o("div", os, [
|
|
3037
|
+
o("p", { class: h(A(J)(Ni, u.classes.title)) }, [
|
|
3038
|
+
A(xi)(t.type, u.typeLabels) ? (S(), a("span", ss, O(A(xi)(t.type, u.typeLabels)) + ": ", 1)) : i("", !0),
|
|
3030
3039
|
c(O(t.title), 1),
|
|
3031
3040
|
t.count > 1 ? (S(), a("span", {
|
|
3032
3041
|
key: 1,
|
|
3033
3042
|
"data-toast-count": "",
|
|
3034
3043
|
"aria-hidden": "true",
|
|
3035
|
-
class: h(
|
|
3036
|
-
}, O(A(
|
|
3044
|
+
class: h(Pi)
|
|
3045
|
+
}, O(A(Je)("toast_count", { count: t.count })), 3)) : i("", !0)
|
|
3037
3046
|
], 2),
|
|
3038
3047
|
t.description ? (S(), a("p", {
|
|
3039
3048
|
key: 0,
|
|
3040
|
-
class: h(A(J)(
|
|
3049
|
+
class: h(A(J)(Fi, u.classes.description))
|
|
3041
3050
|
}, O(t.description), 3)) : i("", !0),
|
|
3042
3051
|
t.progress === void 0 ? i("", !0) : (S(), a("div", {
|
|
3043
3052
|
key: 1,
|
|
@@ -3047,14 +3056,14 @@ var $o = ["aria-label", "data-toaster"], es = ["data-position"], ts = [
|
|
|
3047
3056
|
"aria-valuemax": "100",
|
|
3048
3057
|
"aria-valuenow": Math.round(t.progress * 100),
|
|
3049
3058
|
"data-toast-progressbar": "",
|
|
3050
|
-
class: h(
|
|
3059
|
+
class: h(Ui)
|
|
3051
3060
|
}, [o("div", {
|
|
3052
|
-
class: h(A(J)(
|
|
3061
|
+
class: h(A(J)(Wi, A(je)(ki, t.type) ?? ki.default)),
|
|
3053
3062
|
style: _({ width: `${t.progress * 100}%` })
|
|
3054
|
-
}, null, 6)], 10,
|
|
3063
|
+
}, null, 6)], 10, cs)),
|
|
3055
3064
|
t.actions.length > 0 ? (S(), a("div", {
|
|
3056
3065
|
key: 2,
|
|
3057
|
-
class: h(A(J)(
|
|
3066
|
+
class: h(A(J)(Ii, u.classes.actions))
|
|
3058
3067
|
}, [(S(!0), a(e, null, w(t.actions, (e, n) => (S(), r(E(A(ye)(e) === void 0 ? "button" : "a"), {
|
|
3059
3068
|
key: n,
|
|
3060
3069
|
type: A(ye)(e) === void 0 ? "button" : void 0,
|
|
@@ -3064,7 +3073,7 @@ var $o = ["aria-label", "data-toaster"], es = ["data-position"], ts = [
|
|
|
3064
3073
|
"aria-disabled": t.pendingAction !== void 0 || void 0,
|
|
3065
3074
|
"aria-busy": t.pendingAction === n || void 0,
|
|
3066
3075
|
"data-toast-action": "",
|
|
3067
|
-
class: h(A(J)(n === 0 ?
|
|
3076
|
+
class: h(A(J)(n === 0 ? Ri : zi, u.classes.action)),
|
|
3068
3077
|
onClick: (e) => R(t, n, e)
|
|
3069
3078
|
}, {
|
|
3070
3079
|
default: P(() => [t.pendingAction === n ? (S(), r($, {
|
|
@@ -3078,7 +3087,7 @@ var $o = ["aria-label", "data-toaster"], es = ["data-position"], ts = [
|
|
|
3078
3087
|
},
|
|
3079
3088
|
icons: u.icons,
|
|
3080
3089
|
resolver: u.iconResolver,
|
|
3081
|
-
class: h(
|
|
3090
|
+
class: h(Bi)
|
|
3082
3091
|
}, null, 8, [
|
|
3083
3092
|
"context",
|
|
3084
3093
|
"icons",
|
|
@@ -3100,8 +3109,8 @@ var $o = ["aria-label", "data-toaster"], es = ["data-position"], ts = [
|
|
|
3100
3109
|
t.dismissible ? (S(), a("button", {
|
|
3101
3110
|
key: 1,
|
|
3102
3111
|
type: "button",
|
|
3103
|
-
"aria-label": A(
|
|
3104
|
-
class: h(A(J)(
|
|
3112
|
+
"aria-label": A(bi)(u.dismissLabel, t),
|
|
3113
|
+
class: h(A(J)(Vi, u.classes.dismiss)),
|
|
3105
3114
|
onClick: (e) => L(t)
|
|
3106
3115
|
}, [l($, {
|
|
3107
3116
|
name: "dismiss",
|
|
@@ -3117,13 +3126,13 @@ var $o = ["aria-label", "data-toaster"], es = ["data-position"], ts = [
|
|
|
3117
3126
|
"context",
|
|
3118
3127
|
"icons",
|
|
3119
3128
|
"resolver"
|
|
3120
|
-
])], 10,
|
|
3129
|
+
])], 10, ls)) : i("", !0)
|
|
3121
3130
|
], void 0, 1)], 2), u.progress && t.duration !== null ? (S(), a("div", {
|
|
3122
3131
|
key: 0,
|
|
3123
3132
|
"data-toast-progress": "",
|
|
3124
3133
|
"aria-hidden": "true",
|
|
3125
|
-
class: h(A(J)(
|
|
3126
|
-
}, null, 2)) : i("", !0)], 10,
|
|
3134
|
+
class: h(A(J)(Hi, A(je)(ki, t.type) ?? ki.default, u.classes.progress))
|
|
3135
|
+
}, null, 2)) : i("", !0)], 10, ns))), 128))], 8, ts))), 128)),
|
|
3127
3136
|
o("div", {
|
|
3128
3137
|
ref_key: "polite",
|
|
3129
3138
|
ref: k,
|
|
@@ -3139,54 +3148,54 @@ var $o = ["aria-label", "data-toaster"], es = ["data-position"], ts = [
|
|
|
3139
3148
|
"aria-atomic": "true",
|
|
3140
3149
|
class: "sr-only"
|
|
3141
3150
|
}, null, 512)
|
|
3142
|
-
], 8,
|
|
3151
|
+
], 8, es)], 8, ["to"])) : i("", !0);
|
|
3143
3152
|
}
|
|
3144
|
-
}),
|
|
3153
|
+
}), ds = [
|
|
3145
3154
|
"all",
|
|
3146
3155
|
"unread",
|
|
3147
3156
|
"snoozed",
|
|
3148
3157
|
"archived"
|
|
3149
|
-
],
|
|
3158
|
+
], fs = {
|
|
3150
3159
|
all: "empty",
|
|
3151
3160
|
unread: "emptyUnread",
|
|
3152
3161
|
snoozed: "emptySnoozed",
|
|
3153
3162
|
archived: "emptyArchived"
|
|
3154
|
-
},
|
|
3155
|
-
function
|
|
3156
|
-
return Object.hasOwn(
|
|
3163
|
+
}, ps = (e) => [...ds, ...Object.keys(e)], ms = (e) => ps(e.tabs).filter((t) => nt(t, e.allowedActions));
|
|
3164
|
+
function hs(e, t, n) {
|
|
3165
|
+
return Object.hasOwn(fs, e) ? Z(t[e]) : Object.hasOwn(n, e) ? n[e].label : e;
|
|
3157
3166
|
}
|
|
3158
|
-
var
|
|
3167
|
+
var gs = (e, t) => Z(t[Object.hasOwn(fs, e) ? fs[e] : "empty"]), _s = (e, t, n) => e.map((e) => ({
|
|
3159
3168
|
filter: e,
|
|
3160
|
-
label:
|
|
3169
|
+
label: hs(e, n, t.tabs),
|
|
3161
3170
|
selected: t.filter === e,
|
|
3162
3171
|
count: e === "unread" ? t.counts.unread : null
|
|
3163
|
-
})),
|
|
3164
|
-
function
|
|
3172
|
+
})), vs = (e, t) => t.length > 0 ? e.filter((e) => !t.includes(e.id)) : e;
|
|
3173
|
+
function ys(e, t) {
|
|
3165
3174
|
return e.status === "idle" || e.status === "loading" && t === 0 ? "loading" : e.status === "error" ? "error" : t === 0 ? "empty" : "items";
|
|
3166
3175
|
}
|
|
3167
|
-
function
|
|
3168
|
-
|
|
3176
|
+
function bs(e, t = e.category) {
|
|
3177
|
+
at({
|
|
3169
3178
|
...e,
|
|
3170
3179
|
category: t
|
|
3171
3180
|
}) > 0 && X.markAllAsRead({ category: t });
|
|
3172
3181
|
}
|
|
3173
|
-
var
|
|
3174
|
-
function
|
|
3182
|
+
var xs = (e) => e.filter === "all" && e.allowedActions.includes("archive");
|
|
3183
|
+
function Ss(e, t) {
|
|
3175
3184
|
e.length > 0 && X.archiveAll({ category: t });
|
|
3176
3185
|
}
|
|
3177
|
-
function
|
|
3186
|
+
function Cs(e, t, n, r) {
|
|
3178
3187
|
let i = new URL(e, "http://localhost"), a = i.searchParams;
|
|
3179
3188
|
return a.delete("filter"), a.delete("category"), r !== void 0 && a.delete(r), t !== "all" && a.set("filter", t), n !== null && a.set("category", n), `${i.pathname}${i.search}`;
|
|
3180
3189
|
}
|
|
3181
|
-
function
|
|
3190
|
+
function ws(e, t, n, r) {
|
|
3182
3191
|
let i = new URL(e, "http://localhost").searchParams, a = i.get("filter");
|
|
3183
3192
|
return {
|
|
3184
|
-
filter: n ?? (a !== null &&
|
|
3193
|
+
filter: n ?? (a !== null && ms(t).includes(a) ? a : "all"),
|
|
3185
3194
|
category: r === void 0 ? i.get("category") || null : r
|
|
3186
3195
|
};
|
|
3187
3196
|
}
|
|
3188
|
-
var
|
|
3189
|
-
function
|
|
3197
|
+
var Ts = (e, t, n, r) => Z(e.pausedUntil, { time: Lt(t, n, r) }), Es = (e, t, n) => Lt(Ft(e.preset, new Date(t)), t, n);
|
|
3198
|
+
function Ds(e, t) {
|
|
3190
3199
|
let n = !t.includes("snooze") || e === "archived" ? [] : [e === "snoozed" ? {
|
|
3191
3200
|
action: "unsnooze",
|
|
3192
3201
|
icon: "unsnooze",
|
|
@@ -3224,12 +3233,12 @@ function Es(e, t) {
|
|
|
3224
3233
|
...i
|
|
3225
3234
|
];
|
|
3226
3235
|
}
|
|
3227
|
-
var
|
|
3228
|
-
function
|
|
3236
|
+
var Os = (e, t, n = /* @__PURE__ */ new Date()) => e ? e(n) : Mt(t, n);
|
|
3237
|
+
function ks(e, t, n) {
|
|
3229
3238
|
let r = e.filter((e) => e !== t);
|
|
3230
3239
|
return n ? [...r, t] : r;
|
|
3231
3240
|
}
|
|
3232
|
-
function
|
|
3241
|
+
function As(e, t, { scroller: n, listed: r }) {
|
|
3233
3242
|
let i = [], a = (e) => {
|
|
3234
3243
|
i = e, t(e);
|
|
3235
3244
|
}, o = n ?? window, s = () => n ? n.scrollTop > 0 : e.getBoundingClientRect().top < 0, c = X.onArrival((t) => {
|
|
@@ -3253,8 +3262,8 @@ function ks(e, t, { scroller: n, listed: r }) {
|
|
|
3253
3262
|
}
|
|
3254
3263
|
};
|
|
3255
3264
|
}
|
|
3256
|
-
var
|
|
3257
|
-
function
|
|
3265
|
+
var js = 1e3, Ms = 250;
|
|
3266
|
+
function Ns(e, t, n = e) {
|
|
3258
3267
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set(), a = [], o, s = () => {
|
|
3259
3268
|
o = void 0;
|
|
3260
3269
|
let e = a, n = t().filter((t) => e.includes(t.id));
|
|
@@ -3264,11 +3273,11 @@ function Ms(e, t, n = e) {
|
|
|
3264
3273
|
}, l = (e) => {
|
|
3265
3274
|
r.delete(e);
|
|
3266
3275
|
let t = e.dataset.inboxId;
|
|
3267
|
-
t !== void 0 && e.dataset.seen === "false" && e.isConnected && (u.unobserve(e), i.delete(e), a.push(t), o ??= setTimeout(s,
|
|
3276
|
+
t !== void 0 && e.dataset.seen === "false" && e.isConnected && (u.unobserve(e), i.delete(e), a.push(t), o ??= setTimeout(s, Ms));
|
|
3268
3277
|
}, u = new IntersectionObserver((e) => {
|
|
3269
3278
|
for (let t of e) {
|
|
3270
3279
|
let e = t.target, n = t.rootBounds !== null && t.intersectionRect.height >= t.rootBounds.height / 2;
|
|
3271
|
-
t.isIntersecting && (t.intersectionRatio >= .5 || n) ? r.set(e, r.get(e) ?? setTimeout(() => l(e),
|
|
3280
|
+
t.isIntersecting && (t.intersectionRatio >= .5 || n) ? r.set(e, r.get(e) ?? setTimeout(() => l(e), js)) : c(e);
|
|
3272
3281
|
}
|
|
3273
3282
|
}, {
|
|
3274
3283
|
root: n,
|
|
@@ -3290,7 +3299,7 @@ function Ms(e, t, n = e) {
|
|
|
3290
3299
|
f.disconnect(), u.disconnect(), r.forEach((e) => clearTimeout(e)), o !== void 0 && (clearTimeout(o), s());
|
|
3291
3300
|
} };
|
|
3292
3301
|
}
|
|
3293
|
-
function
|
|
3302
|
+
function Ps(e, t) {
|
|
3294
3303
|
let n = (e.target instanceof Element ? e.target : null)?.closest("[data-inbox-link], [data-inbox-action]"), r = n?.closest("[data-inbox-item]")?.dataset.inboxId, i = r === void 0 ? void 0 : t.find((e) => e.id === r);
|
|
3295
3304
|
if (!n || !i) return;
|
|
3296
3305
|
if (!n.hasAttribute("data-inbox-action")) return { item: i };
|
|
@@ -3300,7 +3309,7 @@ function Ns(e, t) {
|
|
|
3300
3309
|
action: o
|
|
3301
3310
|
} : void 0;
|
|
3302
3311
|
}
|
|
3303
|
-
var
|
|
3312
|
+
var Fs = 160, Is = [
|
|
3304
3313
|
"position",
|
|
3305
3314
|
"box-sizing",
|
|
3306
3315
|
"inset",
|
|
@@ -3316,7 +3325,7 @@ var Ps = 160, Fs = [
|
|
|
3316
3325
|
"overflow-y",
|
|
3317
3326
|
"overscroll-behavior"
|
|
3318
3327
|
];
|
|
3319
|
-
function
|
|
3328
|
+
function Ls(e, t, n) {
|
|
3320
3329
|
let r, i = null, a, o = t.querySelector("[data-inbox-scroller]"), s = o !== null && typeof ResizeObserver == "function" ? new ResizeObserver(() => {
|
|
3321
3330
|
o.offsetHeight > 0 && o.querySelector(":scope > [role=\"status\"]") === null && t.style.setProperty("--inbox-list-height", `${o.offsetHeight}px`);
|
|
3322
3331
|
}) : void 0;
|
|
@@ -3327,7 +3336,7 @@ function Is(e, t, n) {
|
|
|
3327
3336
|
}, l = () => {
|
|
3328
3337
|
if (!t.matches(":popover-open")) return;
|
|
3329
3338
|
if (getComputedStyle(t).getPropertyValue("--inbox-layout").trim() === "sheet") {
|
|
3330
|
-
a?.(), a = void 0,
|
|
3339
|
+
a?.(), a = void 0, Is.forEach((e) => t.style.removeProperty(e)), delete t.dataset.side;
|
|
3331
3340
|
return;
|
|
3332
3341
|
}
|
|
3333
3342
|
let { placement: r } = oe(e, t, {
|
|
@@ -3353,7 +3362,7 @@ function Is(e, t, n) {
|
|
|
3353
3362
|
e.some((e) => e.isIntersecting) && n.onEndReached();
|
|
3354
3363
|
}, {
|
|
3355
3364
|
root: t,
|
|
3356
|
-
rootMargin: `0px 0px ${
|
|
3365
|
+
rootMargin: `0px 0px ${Fs}px 0px`
|
|
3357
3366
|
}) : void 0), r?.disconnect(), e && r?.observe(e);
|
|
3358
3367
|
},
|
|
3359
3368
|
place: l,
|
|
@@ -3365,7 +3374,7 @@ function Is(e, t, n) {
|
|
|
3365
3374
|
}
|
|
3366
3375
|
};
|
|
3367
3376
|
}
|
|
3368
|
-
var
|
|
3377
|
+
var Rs = {
|
|
3369
3378
|
j: "next",
|
|
3370
3379
|
arrowdown: "next",
|
|
3371
3380
|
k: "previous",
|
|
@@ -3375,15 +3384,15 @@ var Ls = {
|
|
|
3375
3384
|
h: "snooze",
|
|
3376
3385
|
x: "select",
|
|
3377
3386
|
enter: "open"
|
|
3378
|
-
},
|
|
3387
|
+
}, zs = {
|
|
3379
3388
|
read: "[data-inbox-toggle-read]",
|
|
3380
3389
|
archive: "[data-inbox-toggle-archive]",
|
|
3381
3390
|
snooze: "[data-inbox-snooze]",
|
|
3382
3391
|
select: "[data-inbox-select]",
|
|
3383
3392
|
open: "[data-inbox-link]"
|
|
3384
3393
|
};
|
|
3385
|
-
function
|
|
3386
|
-
let n =
|
|
3394
|
+
function Bs(e, t) {
|
|
3395
|
+
let n = Rs[e.key.toLowerCase()], r = e.target instanceof HTMLElement ? e.target : null;
|
|
3387
3396
|
if (!n || !r || e.defaultPrevented || e.ctrlKey || e.metaKey || e.altKey || r.closest("input:not([type=\"checkbox\"]), textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"tab\"]")) return;
|
|
3388
3397
|
let i = [...t.querySelectorAll("[data-inbox-item]")], a = r.closest("[data-inbox-item]"), o = a ? i.indexOf(a) : -1;
|
|
3389
3398
|
if ((n === "open" || e.key.startsWith("Arrow")) && r !== a && r !== t) return;
|
|
@@ -3392,10 +3401,10 @@ function zs(e, t) {
|
|
|
3392
3401
|
t && (e.preventDefault(), t.focus());
|
|
3393
3402
|
return;
|
|
3394
3403
|
}
|
|
3395
|
-
let s = a?.querySelector(
|
|
3404
|
+
let s = a?.querySelector(zs[n]);
|
|
3396
3405
|
a && s && (e.preventDefault(), s.click());
|
|
3397
3406
|
}
|
|
3398
|
-
function
|
|
3407
|
+
function Vs(e, t = () => e) {
|
|
3399
3408
|
let n, r = (t) => e.querySelector(`[data-inbox-item][data-inbox-id="${CSS.escape(t)}"]`), i = () => Array.from(e.querySelectorAll("[data-inbox-item]"), (e) => e.dataset.inboxId ?? ""), a = () => {
|
|
3400
3409
|
let t = document.activeElement, r = t instanceof HTMLElement && e.contains(t) ? t.closest("[data-inbox-item]")?.dataset.inboxId : void 0;
|
|
3401
3410
|
n = r === void 0 ? void 0 : {
|
|
@@ -3426,17 +3435,17 @@ function Bs(e, t = () => e) {
|
|
|
3426
3435
|
e.removeEventListener("focusin", a), e.removeEventListener("focusout", o), s?.disconnect();
|
|
3427
3436
|
};
|
|
3428
3437
|
}
|
|
3429
|
-
function
|
|
3438
|
+
function Hs(e, t, n, r, i = !1) {
|
|
3430
3439
|
let a = t > 0 ? Z(e.bellNew, {
|
|
3431
|
-
count:
|
|
3440
|
+
count: Gt(t, n, r),
|
|
3432
3441
|
number: t
|
|
3433
3442
|
}) : Z(e.bell);
|
|
3434
3443
|
return i ? Z(e.bellPaused, { label: a }) : a;
|
|
3435
3444
|
}
|
|
3436
|
-
function
|
|
3445
|
+
function Us(e) {
|
|
3437
3446
|
return e.trim().split(/\s+/).slice(0, 2).map((e) => Array.from(e)[0]?.toLocaleUpperCase() ?? "").join("");
|
|
3438
3447
|
}
|
|
3439
|
-
function
|
|
3448
|
+
function Ws(e, t, n, r = !1) {
|
|
3440
3449
|
let i = n.indexOf(t), a = {
|
|
3441
3450
|
ArrowRight: r ? -1 : 1,
|
|
3442
3451
|
ArrowLeft: r ? 1 : -1
|
|
@@ -3444,10 +3453,10 @@ function Us(e, t, n, r = !1) {
|
|
|
3444
3453
|
return a === void 0 ? e === "Home" ? n[0] : e === "End" ? n.at(-1) : void 0 : n[(i + a + n.length) % n.length];
|
|
3445
3454
|
}
|
|
3446
3455
|
// ../js/overlay.ts
|
|
3447
|
-
var
|
|
3448
|
-
function
|
|
3456
|
+
var Gs = () => typeof HTMLElement < "u" && "showPopover" in HTMLElement.prototype, Ks = null;
|
|
3457
|
+
function qs(e) {
|
|
3449
3458
|
let t = null, n = (n) => {
|
|
3450
|
-
n &&
|
|
3459
|
+
n && Ks !== t ? (Ks?.hide(), Ks = t) : !n && Ks === t && (Ks = null), e.onOpenChange(n);
|
|
3451
3460
|
}, r = (t) => {
|
|
3452
3461
|
let n = e.tooltip();
|
|
3453
3462
|
if (n) return te(n), U() ? void 0 : V(n, t ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 1 }, { opacity: 0 }], {
|
|
@@ -3461,7 +3470,7 @@ function Ks(e) {
|
|
|
3461
3470
|
transition: r
|
|
3462
3471
|
});
|
|
3463
3472
|
return {
|
|
3464
|
-
native:
|
|
3473
|
+
native: Gs(),
|
|
3465
3474
|
onPointerEnter: (e) => {
|
|
3466
3475
|
e.pointerType !== "touch" && i().onMouseEnter();
|
|
3467
3476
|
},
|
|
@@ -3473,19 +3482,19 @@ function Ks(e) {
|
|
|
3473
3482
|
onFocusOut: (e) => t?.onFocusOut(e),
|
|
3474
3483
|
mount: () => t?.mount(),
|
|
3475
3484
|
cleanup: () => {
|
|
3476
|
-
t?.cleanup(),
|
|
3485
|
+
t?.cleanup(), Ks === t && (Ks = null);
|
|
3477
3486
|
}
|
|
3478
3487
|
};
|
|
3479
3488
|
}
|
|
3480
3489
|
// src/Tooltip.vue?vue&type=script&setup=true&lang.ts
|
|
3481
|
-
var
|
|
3490
|
+
var Js = ["popover"], Ys = /* @__PURE__ */ u({
|
|
3482
3491
|
__name: "Tooltip",
|
|
3483
3492
|
props: {
|
|
3484
3493
|
text: {},
|
|
3485
3494
|
shortcut: {}
|
|
3486
3495
|
},
|
|
3487
3496
|
setup(e) {
|
|
3488
|
-
let t = C(!1), n = C(), r = C(), o =
|
|
3497
|
+
let t = C(!1), n = C(), r = C(), o = qs({
|
|
3489
3498
|
reference: () => n.value ?? null,
|
|
3490
3499
|
tooltip: () => r.value ?? null,
|
|
3491
3500
|
onOpenChange: (e) => t.value = e
|
|
@@ -3495,7 +3504,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3495
3504
|
}), v(o.cleanup), (s, l) => (S(), a("span", {
|
|
3496
3505
|
ref_key: "trigger",
|
|
3497
3506
|
ref: n,
|
|
3498
|
-
class: h(
|
|
3507
|
+
class: h(ua),
|
|
3499
3508
|
onPointerenter: l[0] ||= (...e) => A(o).onPointerEnter && A(o).onPointerEnter(...e),
|
|
3500
3509
|
onPointerleave: l[1] ||= (...e) => A(o).onPointerLeave && A(o).onPointerLeave(...e),
|
|
3501
3510
|
onPointerdown: l[2] ||= (...e) => A(o).onPointerDown && A(o).onPointerDown(...e),
|
|
@@ -3508,32 +3517,32 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3508
3517
|
role: "tooltip",
|
|
3509
3518
|
popover: A(o).native ? "manual" : void 0,
|
|
3510
3519
|
"data-inbox-tooltip": "",
|
|
3511
|
-
class: h(
|
|
3520
|
+
class: h(da)
|
|
3512
3521
|
}, [c(O(e.text) + " ", 1), e.shortcut ? (S(), a("kbd", {
|
|
3513
3522
|
key: 0,
|
|
3514
|
-
class: h(
|
|
3515
|
-
}, O(e.shortcut), 3)) : i("", !0)], 10,
|
|
3523
|
+
class: h(fa)
|
|
3524
|
+
}, O(e.shortcut), 3)) : i("", !0)], 10, Js)) : i("", !0)], 34));
|
|
3516
3525
|
}
|
|
3517
|
-
}),
|
|
3526
|
+
}), Xs = ["id"], Zs = ["aria-disabled"], Qs = [
|
|
3518
3527
|
"aria-label",
|
|
3519
3528
|
"aria-expanded",
|
|
3520
3529
|
"aria-controls"
|
|
3521
|
-
],
|
|
3530
|
+
], $s = [
|
|
3522
3531
|
"id",
|
|
3523
3532
|
"aria-label",
|
|
3524
3533
|
"popover"
|
|
3525
|
-
],
|
|
3534
|
+
], ec = ["aria-disabled"], tc = ["aria-labelledby"], nc = ["id"], rc = ["onClick"], ic = { "aria-live": "polite" }, ac = { class: "min-w-0 flex-1" }, oc = ["aria-labelledby"], sc = [
|
|
3526
3535
|
"id",
|
|
3527
3536
|
"aria-selected",
|
|
3528
3537
|
"aria-controls",
|
|
3529
3538
|
"tabindex",
|
|
3530
3539
|
"data-inbox-tab",
|
|
3531
3540
|
"onClick"
|
|
3532
|
-
],
|
|
3541
|
+
], cc = ["aria-label"], lc = [
|
|
3533
3542
|
"data-inbox-category",
|
|
3534
3543
|
"aria-pressed",
|
|
3535
3544
|
"onClick"
|
|
3536
|
-
],
|
|
3545
|
+
], uc = /* @__PURE__ */ u({
|
|
3537
3546
|
__name: "InboxHeader",
|
|
3538
3547
|
props: {
|
|
3539
3548
|
component: {},
|
|
@@ -3562,19 +3571,19 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3562
3571
|
}
|
|
3563
3572
|
},
|
|
3564
3573
|
setup(t) {
|
|
3565
|
-
let s = t, u = j(), f = j(), _ = (e) => Z(s.labels[e]), y = n(() =>
|
|
3574
|
+
let s = t, u = j(), f = j(), _ = (e) => Z(s.labels[e]), y = n(() => ms(s.state)), b = n(() => _s(y.value, {
|
|
3566
3575
|
...s.state,
|
|
3567
3576
|
filter: s.filter
|
|
3568
|
-
}, s.labels)), x = n(() => Object.entries(s.state.categoryFilter)), E = n(() =>
|
|
3577
|
+
}, s.labels)), x = n(() => Object.entries(s.state.categoryFilter)), E = n(() => at({
|
|
3569
3578
|
...s.state,
|
|
3570
3579
|
category: s.category
|
|
3571
|
-
})), D = n(() =>
|
|
3580
|
+
})), D = n(() => xs({
|
|
3572
3581
|
filter: s.filter,
|
|
3573
3582
|
allowedActions: s.state.allowedActions
|
|
3574
3583
|
})), k = n(() => s.filter === "all" || s.filter === "unread"), M = n(() => D.value || s.state.canPause), F = n(() => k.value || M.value), L = (e) => ({
|
|
3575
3584
|
component: s.component,
|
|
3576
3585
|
part: e
|
|
3577
|
-
}), R = C(), z = C(), B = C(!1), ee = n(() =>
|
|
3586
|
+
}), R = C(), z = C(), B = C(!1), ee = n(() => It(s.state.pausePresets, s.labels, s.locale)), V = re({
|
|
3578
3587
|
reference: () => R.value ?? null,
|
|
3579
3588
|
popover: () => z.value ?? null,
|
|
3580
3589
|
position: {
|
|
@@ -3587,11 +3596,11 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3587
3596
|
N(B, async (e) => {
|
|
3588
3597
|
e && (await m(), V.mount());
|
|
3589
3598
|
}), N(() => s.open, () => V.close(!1)), v(V.cleanup);
|
|
3590
|
-
let H = (e) => void X.pause(
|
|
3599
|
+
let H = (e) => void X.pause(Ft(e.preset)), te = (e) => {
|
|
3591
3600
|
let t = e.currentTarget.closest("[data-inbox-panel], [data-inbox-list]");
|
|
3592
3601
|
X.resume(), (R.value ?? t)?.focus();
|
|
3593
|
-
}, ne = () =>
|
|
3594
|
-
let t = ae(e.currentTarget), n =
|
|
3602
|
+
}, ne = () => bs(s.state, s.category), ie = () => Ss(s.items, s.category), oe = (e, t) => void X.load(e, t), U = (e) => {
|
|
3603
|
+
let t = ae(e.currentTarget), n = Ws(e.key, s.filter, y.value, t);
|
|
3595
3604
|
n !== void 0 && s.panel && (e.preventDefault(), oe(n, s.category), document.getElementById(s.panel.tabId(n))?.focus());
|
|
3596
3605
|
}, se = n(() => ({
|
|
3597
3606
|
...s.panel && {
|
|
@@ -3615,27 +3624,27 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3615
3624
|
return (n, s) => (S(), a(e, null, [
|
|
3616
3625
|
T(n.$slots, "header", g(d(se.value)), () => [t.panel || y.value.length > 1 || F.value ? (S(), a("div", {
|
|
3617
3626
|
key: 0,
|
|
3618
|
-
class: h(t.panel ?
|
|
3627
|
+
class: h(t.panel ? Xi : Zi)
|
|
3619
3628
|
}, [
|
|
3620
3629
|
t.panel ? (S(), a("h2", {
|
|
3621
3630
|
key: 0,
|
|
3622
3631
|
id: t.panel.titleId,
|
|
3623
|
-
class: h(
|
|
3624
|
-
}, O(t.panel.title), 11,
|
|
3632
|
+
class: h(ea)
|
|
3633
|
+
}, O(t.panel.title), 11, Xs)) : i("", !0),
|
|
3625
3634
|
t.href && y.value.length > 1 ? (S(), a("div", {
|
|
3626
3635
|
key: 1,
|
|
3627
|
-
class: h(
|
|
3636
|
+
class: h(Qi)
|
|
3628
3637
|
}, [(S(!0), a(e, null, w(b.value, (e) => (S(), r(A(I), {
|
|
3629
3638
|
key: e.filter,
|
|
3630
3639
|
href: t.href(e.filter, t.category),
|
|
3631
3640
|
"aria-current": e.selected ? "page" : void 0,
|
|
3632
3641
|
"data-inbox-tab": e.filter,
|
|
3633
|
-
class: h(
|
|
3642
|
+
class: h(_a)
|
|
3634
3643
|
}, {
|
|
3635
3644
|
default: P(() => [T(n.$slots, "tab", p({ ref_for: !0 }, e), () => [c(O(e.label) + " ", 1), e.count !== null && e.count > 0 ? (S(), a("span", {
|
|
3636
3645
|
key: 0,
|
|
3637
|
-
class: h(
|
|
3638
|
-
}, O(A(
|
|
3646
|
+
class: h(xa)
|
|
3647
|
+
}, O(A(Gt)(e.count, t.maxCount, t.locale)), 3)) : i("", !0)])]),
|
|
3639
3648
|
_: 2
|
|
3640
3649
|
}, 1032, [
|
|
3641
3650
|
"href",
|
|
@@ -3645,15 +3654,15 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3645
3654
|
]))), 128))], 2)) : i("", !0),
|
|
3646
3655
|
F.value ? (S(), a("div", {
|
|
3647
3656
|
key: 2,
|
|
3648
|
-
class: h(t.panel ?
|
|
3657
|
+
class: h(t.panel ? ta : $i)
|
|
3649
3658
|
}, [k.value ? (S(), a("button", {
|
|
3650
3659
|
key: 0,
|
|
3651
3660
|
type: "button",
|
|
3652
3661
|
"data-inbox-read-all": "",
|
|
3653
3662
|
"aria-disabled": E.value === 0 || void 0,
|
|
3654
|
-
class: h(
|
|
3663
|
+
class: h(na),
|
|
3655
3664
|
onClick: ne
|
|
3656
|
-
}, O(_("markAllAsRead")), 11,
|
|
3665
|
+
}, O(_("markAllAsRead")), 11, Zs)) : i("", !0), M.value ? (S(), a(e, { key: 1 }, [l(Ys, { text: _("moreActions") }, {
|
|
3657
3666
|
default: P(() => [o("button", {
|
|
3658
3667
|
ref_key: "menuButton",
|
|
3659
3668
|
ref: R,
|
|
@@ -3663,7 +3672,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3663
3672
|
"aria-label": _("moreActions"),
|
|
3664
3673
|
"aria-expanded": B.value ? "true" : "false",
|
|
3665
3674
|
"aria-controls": B.value ? A(u) : void 0,
|
|
3666
|
-
class: h(A(J)(
|
|
3675
|
+
class: h(A(J)(ro, t.classes.control)),
|
|
3667
3676
|
onClick: s[0] ||= (...e) => A(V).toggle && A(V).toggle(...e),
|
|
3668
3677
|
onPointerdown: s[1] ||= (...e) => A(V).onPointerDown && A(V).onPointerDown(...e),
|
|
3669
3678
|
onKeydown: s[2] ||= (...e) => A(V).onKeydown && A(V).onKeydown(...e),
|
|
@@ -3678,7 +3687,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3678
3687
|
"context",
|
|
3679
3688
|
"icons",
|
|
3680
3689
|
"resolver"
|
|
3681
|
-
])], 42,
|
|
3690
|
+
])], 42, Qs)]),
|
|
3682
3691
|
_: 1
|
|
3683
3692
|
}, 8, ["text"]), B.value ? (S(), a("div", {
|
|
3684
3693
|
key: 0,
|
|
@@ -3689,7 +3698,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3689
3698
|
"aria-label": _("moreActions"),
|
|
3690
3699
|
popover: A(V).native ? "auto" : void 0,
|
|
3691
3700
|
"data-inbox-menu": "",
|
|
3692
|
-
class: h(
|
|
3701
|
+
class: h(ra)
|
|
3693
3702
|
}, [
|
|
3694
3703
|
D.value ? (S(), a("button", {
|
|
3695
3704
|
key: 0,
|
|
@@ -3697,24 +3706,24 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3697
3706
|
role: "menuitem",
|
|
3698
3707
|
"data-inbox-archive-all": "",
|
|
3699
3708
|
"aria-disabled": t.items.length === 0 || void 0,
|
|
3700
|
-
class: h(
|
|
3709
|
+
class: h(ia),
|
|
3701
3710
|
onClick: ie
|
|
3702
3711
|
}, [l($, {
|
|
3703
3712
|
name: "archive",
|
|
3704
3713
|
context: L("archive-all"),
|
|
3705
3714
|
icons: t.icons,
|
|
3706
3715
|
resolver: t.iconResolver,
|
|
3707
|
-
class: h(
|
|
3716
|
+
class: h(sa)
|
|
3708
3717
|
}, null, 8, [
|
|
3709
3718
|
"context",
|
|
3710
3719
|
"icons",
|
|
3711
3720
|
"resolver",
|
|
3712
3721
|
"class"
|
|
3713
|
-
]), c(" " + O(_("archiveAll")), 1)], 10,
|
|
3722
|
+
]), c(" " + O(_("archiveAll")), 1)], 10, ec)) : i("", !0),
|
|
3714
3723
|
D.value && t.state.canPause ? (S(), a("div", {
|
|
3715
3724
|
key: 1,
|
|
3716
3725
|
role: "separator",
|
|
3717
|
-
class: h(
|
|
3726
|
+
class: h(ca)
|
|
3718
3727
|
}, null, 2)) : i("", !0),
|
|
3719
3728
|
t.state.canPause ? (S(), a("div", {
|
|
3720
3729
|
key: 2,
|
|
@@ -3722,67 +3731,67 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3722
3731
|
"aria-labelledby": A(f)
|
|
3723
3732
|
}, [o("div", {
|
|
3724
3733
|
id: A(f),
|
|
3725
|
-
class: h(
|
|
3734
|
+
class: h(oa)
|
|
3726
3735
|
}, [l($, {
|
|
3727
3736
|
name: "pause",
|
|
3728
3737
|
context: L("pause"),
|
|
3729
3738
|
icons: t.icons,
|
|
3730
3739
|
resolver: t.iconResolver,
|
|
3731
|
-
class: h(
|
|
3740
|
+
class: h(sa)
|
|
3732
3741
|
}, null, 8, [
|
|
3733
3742
|
"context",
|
|
3734
3743
|
"icons",
|
|
3735
3744
|
"resolver",
|
|
3736
3745
|
"class"
|
|
3737
|
-
]), c(" " + O(_("pause")), 1)], 10,
|
|
3746
|
+
]), c(" " + O(_("pause")), 1)], 10, nc), (S(!0), a(e, null, w(ee.value, (e) => (S(), a("button", {
|
|
3738
3747
|
key: e.label,
|
|
3739
3748
|
type: "button",
|
|
3740
3749
|
role: "menuitem",
|
|
3741
3750
|
"data-inbox-pause-option": "",
|
|
3742
|
-
class: h(
|
|
3751
|
+
class: h(aa),
|
|
3743
3752
|
onClick: (t) => H(e)
|
|
3744
|
-
}, [c(O(e.label) + " ", 1), o("span", { class: h(
|
|
3745
|
-
], 10,
|
|
3753
|
+
}, [c(O(e.label) + " ", 1), o("span", { class: h(la) }, O(A(Es)(e, t.now, t.locale)), 3)], 10, rc))), 128))], 8, tc)) : i("", !0)
|
|
3754
|
+
], 10, $s)) : i("", !0)], 64)) : i("", !0)], 2)) : i("", !0)
|
|
3746
3755
|
], 2)) : i("", !0)]),
|
|
3747
|
-
o("div",
|
|
3756
|
+
o("div", ic, [t.state.pausedUntil === null ? i("", !0) : (S(), a("p", {
|
|
3748
3757
|
key: 0,
|
|
3749
3758
|
"data-inbox-paused": "",
|
|
3750
|
-
class: h(
|
|
3759
|
+
class: h(pa)
|
|
3751
3760
|
}, [
|
|
3752
3761
|
l($, {
|
|
3753
3762
|
name: "paused",
|
|
3754
3763
|
context: L("paused"),
|
|
3755
3764
|
icons: t.icons,
|
|
3756
3765
|
resolver: t.iconResolver,
|
|
3757
|
-
class: h(
|
|
3766
|
+
class: h(ma)
|
|
3758
3767
|
}, null, 8, [
|
|
3759
3768
|
"context",
|
|
3760
3769
|
"icons",
|
|
3761
3770
|
"resolver",
|
|
3762
3771
|
"class"
|
|
3763
3772
|
]),
|
|
3764
|
-
o("span",
|
|
3773
|
+
o("span", ac, O(A(Ts)(t.labels, t.state.pausedUntil, t.now, t.locale)), 1),
|
|
3765
3774
|
o("button", {
|
|
3766
3775
|
type: "button",
|
|
3767
3776
|
"data-inbox-resume": "",
|
|
3768
|
-
class: h(
|
|
3777
|
+
class: h(ha),
|
|
3769
3778
|
onClick: te
|
|
3770
3779
|
}, O(_("resume")), 3)
|
|
3771
3780
|
], 2))]),
|
|
3772
3781
|
y.value.length > 1 ? (S(), a(e, { key: 0 }, [t.href && n.$slots.header ? (S(), a("div", {
|
|
3773
3782
|
key: 0,
|
|
3774
|
-
class: h(
|
|
3783
|
+
class: h(ga)
|
|
3775
3784
|
}, [(S(!0), a(e, null, w(b.value, (e) => (S(), r(A(I), {
|
|
3776
3785
|
key: e.filter,
|
|
3777
3786
|
href: t.href(e.filter, t.category),
|
|
3778
3787
|
"aria-current": e.selected ? "page" : void 0,
|
|
3779
3788
|
"data-inbox-tab": e.filter,
|
|
3780
|
-
class: h(
|
|
3789
|
+
class: h(_a)
|
|
3781
3790
|
}, {
|
|
3782
3791
|
default: P(() => [T(n.$slots, "tab", p({ ref_for: !0 }, e), () => [c(O(e.label) + " ", 1), e.count !== null && e.count > 0 ? (S(), a("span", {
|
|
3783
3792
|
key: 0,
|
|
3784
|
-
class: h(
|
|
3785
|
-
}, O(A(
|
|
3793
|
+
class: h(xa)
|
|
3794
|
+
}, O(A(Gt)(e.count, t.maxCount, t.locale)), 3)) : i("", !0)])]),
|
|
3786
3795
|
_: 2
|
|
3787
3796
|
}, 1032, [
|
|
3788
3797
|
"href",
|
|
@@ -3793,7 +3802,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3793
3802
|
key: 1,
|
|
3794
3803
|
role: "tablist",
|
|
3795
3804
|
"aria-labelledby": t.panel.titleId,
|
|
3796
|
-
class: h(
|
|
3805
|
+
class: h(ga),
|
|
3797
3806
|
onKeydown: U
|
|
3798
3807
|
}, [(S(!0), a(e, null, w(b.value, (e) => (S(), a("button", {
|
|
3799
3808
|
id: t.panel.tabId(e.filter),
|
|
@@ -3804,28 +3813,28 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3804
3813
|
"aria-controls": t.panel.listId,
|
|
3805
3814
|
tabindex: e.selected ? 0 : -1,
|
|
3806
3815
|
"data-inbox-tab": e.filter,
|
|
3807
|
-
class: h(
|
|
3816
|
+
class: h(_a),
|
|
3808
3817
|
onClick: (n) => oe(e.filter, t.category)
|
|
3809
3818
|
}, [T(n.$slots, "tab", p({ ref_for: !0 }, e), () => [c(O(e.label) + " ", 1), e.count !== null && e.count > 0 ? (S(), a("span", {
|
|
3810
3819
|
key: 0,
|
|
3811
|
-
class: h(
|
|
3812
|
-
}, O(A(
|
|
3820
|
+
class: h(xa)
|
|
3821
|
+
}, O(A(Gt)(e.count, t.maxCount, t.locale)), 3)) : i("", !0)])], 10, sc))), 128))], 42, oc)) : i("", !0)], 64)) : i("", !0),
|
|
3813
3822
|
x.value.length > 0 ? (S(), a("div", {
|
|
3814
3823
|
key: 1,
|
|
3815
3824
|
role: "group",
|
|
3816
3825
|
"aria-label": _("categories"),
|
|
3817
|
-
class: h(
|
|
3826
|
+
class: h(va)
|
|
3818
3827
|
}, [(S(!0), a(e, null, w([[null, _("allCategories")], ...x.value], ([n, o]) => (S(), a(e, { key: n ?? "" }, [t.href ? (S(), r(A(I), {
|
|
3819
3828
|
key: 0,
|
|
3820
3829
|
href: t.href(t.filter, n),
|
|
3821
3830
|
"data-inbox-category": n ?? "",
|
|
3822
3831
|
"aria-current": t.category === n ? "page" : void 0,
|
|
3823
|
-
class: h(
|
|
3832
|
+
class: h(ya)
|
|
3824
3833
|
}, {
|
|
3825
3834
|
default: P(() => [c(O(o) + " ", 1), n !== null && t.state.categoryCounts[n] ? (S(), a("span", {
|
|
3826
3835
|
key: 0,
|
|
3827
|
-
class: h(
|
|
3828
|
-
}, O(A(
|
|
3836
|
+
class: h(ba)
|
|
3837
|
+
}, O(A(Gt)(t.state.categoryCounts[n], t.maxCount, t.locale)), 3)) : i("", !0)]),
|
|
3829
3838
|
_: 2
|
|
3830
3839
|
}, 1032, [
|
|
3831
3840
|
"href",
|
|
@@ -3837,34 +3846,34 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3837
3846
|
type: "button",
|
|
3838
3847
|
"data-inbox-category": n ?? "",
|
|
3839
3848
|
"aria-pressed": t.category === n ? "true" : "false",
|
|
3840
|
-
class: h(
|
|
3849
|
+
class: h(ya),
|
|
3841
3850
|
onClick: (e) => oe(t.filter, n)
|
|
3842
3851
|
}, [c(O(o) + " ", 1), n !== null && t.state.categoryCounts[n] ? (S(), a("span", {
|
|
3843
3852
|
key: 0,
|
|
3844
|
-
class: h(
|
|
3845
|
-
}, O(A(
|
|
3853
|
+
class: h(ba)
|
|
3854
|
+
}, O(A(Gt)(t.state.categoryCounts[n], t.maxCount, t.locale)), 3)) : i("", !0)], 10, lc))], 64))), 128))], 10, cc)) : i("", !0)
|
|
3846
3855
|
], 64));
|
|
3847
3856
|
}
|
|
3848
|
-
}),
|
|
3857
|
+
}), dc = [
|
|
3849
3858
|
"data-read",
|
|
3850
3859
|
"data-archived",
|
|
3851
3860
|
"data-selected"
|
|
3852
|
-
],
|
|
3861
|
+
], fc = ["src"], pc = ["checked", "aria-label"], mc = { class: "min-w-0 flex-1" }, hc = {
|
|
3853
3862
|
key: 0,
|
|
3854
3863
|
class: "sr-only"
|
|
3855
|
-
},
|
|
3864
|
+
}, gc = {
|
|
3856
3865
|
key: 1,
|
|
3857
3866
|
class: "sr-only"
|
|
3858
|
-
},
|
|
3867
|
+
}, _c = ["href"], vc = ["src"], yc = ["src"], bc = ["datetime", "title"], xc = ["id", "aria-label"], Sc = ["onClick"], Cc = ["aria-label"], wc = [
|
|
3859
3868
|
"aria-label",
|
|
3860
3869
|
"aria-expanded",
|
|
3861
3870
|
"aria-controls"
|
|
3862
|
-
],
|
|
3871
|
+
], Tc = ["aria-label"], Ec = ["aria-label"], Dc = ["aria-label"], Oc = /* @__PURE__ */ u({
|
|
3863
3872
|
__name: "NotificationItem",
|
|
3864
3873
|
props: {
|
|
3865
3874
|
item: {},
|
|
3866
3875
|
now: {},
|
|
3867
|
-
labels: { default: () =>
|
|
3876
|
+
labels: { default: () => Jt() },
|
|
3868
3877
|
icons: { default: () => ({}) },
|
|
3869
3878
|
iconResolver: {
|
|
3870
3879
|
type: [Function, null],
|
|
@@ -3896,10 +3905,10 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3896
3905
|
component: "NotificationItem",
|
|
3897
3906
|
part: e,
|
|
3898
3907
|
item: s.item
|
|
3899
|
-
}), d = n(() => s.item.readAt === null), f = n(() => s.item.archivedAt !== null), p = n(() => s.item.icon ?
|
|
3908
|
+
}), d = n(() => s.item.readAt === null), f = n(() => s.item.archivedAt !== null), p = n(() => s.item.icon ? He(s.item.icon, u("media"), s.icons, s.iconResolver) : void 0), g = n(() => new Date(s.item.createdAt).toLocaleString(s.locale, {
|
|
3900
3909
|
dateStyle: "medium",
|
|
3901
3910
|
timeStyle: "short"
|
|
3902
|
-
})), v = n(() =>
|
|
3911
|
+
})), v = n(() => st(s.item, s.now)), y = n(() => Xt(s.labels, s.item)), b = n(() => Yt(s.item)), x = () => d.value ? X.markAsRead(s.item) : X.markAsUnread(s.item), T = () => f.value ? X.unarchive(s.item) : X.archive(s.item), k = () => s.item.muted ? X.unmute(s.item) : X.mute(s.item), M = (e) => s.allowedActions.includes(e), F = (e) => Z(s.labels.itemControl, {
|
|
3903
3912
|
action: Z(e),
|
|
3904
3913
|
title: s.item.title
|
|
3905
3914
|
}), I = n(() => M("snooze")), L = j(), R = C(!1), z = D([]), B = C();
|
|
@@ -3910,7 +3919,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3910
3919
|
if (v.value) X.unsnooze(s.item);
|
|
3911
3920
|
else if (R.value = !R.value, R.value) {
|
|
3912
3921
|
let e = /* @__PURE__ */ new Date();
|
|
3913
|
-
z.value = s.snooze ? s.snooze(e) :
|
|
3922
|
+
z.value = s.snooze ? s.snooze(e) : Mt(s.labels, e), await m(), B.value?.querySelector("button")?.focus();
|
|
3914
3923
|
}
|
|
3915
3924
|
}, V = (e) => {
|
|
3916
3925
|
R.value = !1, X.snooze(s.item, e);
|
|
@@ -3919,22 +3928,22 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3919
3928
|
"data-read": String(!d.value),
|
|
3920
3929
|
"data-archived": String(f.value),
|
|
3921
3930
|
"data-selected": t.onSelectedChange ? String(t.selected) : void 0,
|
|
3922
|
-
class: h(A(J)(
|
|
3931
|
+
class: h(A(J)(ka, t.classes.item))
|
|
3923
3932
|
}, [
|
|
3924
|
-
(S(), r(E(t.onSelectedChange ? "label" : "span"), { class: h(A(J)(
|
|
3933
|
+
(S(), r(E(t.onSelectedChange ? "label" : "span"), { class: h(A(J)(Aa, t.onSelectedChange && "z-10 cursor-pointer")) }, {
|
|
3925
3934
|
default: P(() => [
|
|
3926
3935
|
o("span", {
|
|
3927
3936
|
"aria-hidden": "true",
|
|
3928
|
-
class: h(A(J)(
|
|
3937
|
+
class: h(A(J)(Ma, t.classes.media))
|
|
3929
3938
|
}, [t.item.actor?.avatar ? (S(), a("img", {
|
|
3930
3939
|
key: 0,
|
|
3931
3940
|
src: t.item.actor.avatar,
|
|
3932
3941
|
alt: "",
|
|
3933
3942
|
class: "size-full object-cover"
|
|
3934
|
-
}, null, 8,
|
|
3943
|
+
}, null, 8, fc)) : p.value ? (S(), r(E(p.value), {
|
|
3935
3944
|
key: 1,
|
|
3936
3945
|
class: "size-5"
|
|
3937
|
-
})) : t.item.actor?.name ? (S(), a(e, { key: 2 }, [c(O(A(
|
|
3946
|
+
})) : t.item.actor?.name ? (S(), a(e, { key: 2 }, [c(O(A(Us)(t.item.actor.name)), 1)], 64)) : (S(), r($, {
|
|
3938
3947
|
key: 3,
|
|
3939
3948
|
name: t.item.announcement ? "announcement" : "notification",
|
|
3940
3949
|
context: u("media"),
|
|
@@ -3949,68 +3958,68 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
3949
3958
|
]))], 2),
|
|
3950
3959
|
t.onSelectedChange ? (S(), a("span", {
|
|
3951
3960
|
key: 0,
|
|
3952
|
-
class: h(
|
|
3961
|
+
class: h(Xa)
|
|
3953
3962
|
}, [o("input", {
|
|
3954
3963
|
type: "checkbox",
|
|
3955
3964
|
"data-inbox-select": "",
|
|
3956
3965
|
"aria-keyshortcuts": "X",
|
|
3957
3966
|
checked: t.selected,
|
|
3958
3967
|
"aria-label": A(Z)(t.labels.select, { title: t.item.title }),
|
|
3959
|
-
class: h(
|
|
3968
|
+
class: h(Za),
|
|
3960
3969
|
onChange: s[0] ||= (e) => t.onSelectedChange(e.target.checked)
|
|
3961
|
-
}, null, 42,
|
|
3970
|
+
}, null, 42, pc)], 2)) : i("", !0),
|
|
3962
3971
|
d.value ? (S(), a("span", {
|
|
3963
3972
|
key: 1,
|
|
3964
3973
|
"aria-hidden": "true",
|
|
3965
|
-
class: h(
|
|
3974
|
+
class: h(ja)
|
|
3966
3975
|
}, null, 2)) : i("", !0)
|
|
3967
3976
|
]),
|
|
3968
3977
|
_: 1
|
|
3969
3978
|
}, 8, ["class"])),
|
|
3970
|
-
o("div",
|
|
3971
|
-
o("p", { class: h(A(J)(
|
|
3972
|
-
d.value ? (S(), a("span",
|
|
3973
|
-
t.item.announcement ? (S(), a("span",
|
|
3979
|
+
o("div", mc, [
|
|
3980
|
+
o("p", { class: h(A(J)(Na, t.classes.title)) }, [
|
|
3981
|
+
d.value ? (S(), a("span", hc, O(A(Z)(t.labels.unreadState)) + ": ", 1)) : i("", !0),
|
|
3982
|
+
t.item.announcement ? (S(), a("span", gc, O(A(Z)(t.labels.announcement)) + ": ", 1)) : i("", !0),
|
|
3974
3983
|
t.item.url ? (S(), a("a", {
|
|
3975
3984
|
key: 2,
|
|
3976
3985
|
"data-inbox-link": "",
|
|
3977
3986
|
href: t.item.url,
|
|
3978
|
-
class: h(
|
|
3987
|
+
class: h(Pa),
|
|
3979
3988
|
onClick: s[1] ||= (e) => A(X).open(t.item, e)
|
|
3980
|
-
}, O(t.item.title), 11,
|
|
3989
|
+
}, O(t.item.title), 11, _c)) : (S(), a(e, { key: 3 }, [c(O(t.item.title), 1)], 64))
|
|
3981
3990
|
], 2),
|
|
3982
3991
|
t.item.body ? (S(), a("p", {
|
|
3983
3992
|
key: 0,
|
|
3984
|
-
class: h(A(J)(
|
|
3993
|
+
class: h(A(J)(Fa, t.classes.body))
|
|
3985
3994
|
}, O(t.item.body), 3)) : i("", !0),
|
|
3986
3995
|
t.item.image ? (S(), a("img", {
|
|
3987
3996
|
key: 1,
|
|
3988
3997
|
src: t.item.image,
|
|
3989
3998
|
alt: "",
|
|
3990
|
-
class: h(
|
|
3991
|
-
}, null, 10,
|
|
3999
|
+
class: h(Ia)
|
|
4000
|
+
}, null, 10, vc)) : i("", !0),
|
|
3992
4001
|
y.value ? (S(), a("p", {
|
|
3993
4002
|
key: 2,
|
|
3994
4003
|
"data-inbox-actors": "",
|
|
3995
|
-
class: h(A(J)(
|
|
4004
|
+
class: h(A(J)(Ha, t.classes.actors))
|
|
3996
4005
|
}, [o("span", {
|
|
3997
4006
|
"aria-hidden": "true",
|
|
3998
|
-
class: h(
|
|
4007
|
+
class: h(Ua)
|
|
3999
4008
|
}, [(S(!0), a(e, null, w(b.value, (t, n) => (S(), a("span", {
|
|
4000
4009
|
key: n,
|
|
4001
4010
|
style: _({ zIndex: b.value.length - n }),
|
|
4002
|
-
class: h(
|
|
4011
|
+
class: h(Wa)
|
|
4003
4012
|
}, [t.avatar ? (S(), a("img", {
|
|
4004
4013
|
key: 0,
|
|
4005
4014
|
src: t.avatar,
|
|
4006
4015
|
alt: "",
|
|
4007
4016
|
class: "size-full object-cover"
|
|
4008
|
-
}, null, 8,
|
|
4017
|
+
}, null, 8, yc)) : t.name ? (S(), a(e, { key: 1 }, [c(O(A(Us)(t.name)), 1)], 64)) : i("", !0)], 6))), 128))], 2), c(" " + O(y.value), 1)], 2)) : i("", !0),
|
|
4009
4018
|
v.value && t.item.snoozedUntil ? (S(), a("p", {
|
|
4010
4019
|
key: 3,
|
|
4011
4020
|
"data-inbox-snoozed-until": "",
|
|
4012
4021
|
"data-allow-mismatch": "",
|
|
4013
|
-
class: h(A(J)(
|
|
4022
|
+
class: h(A(J)(Ra, t.classes.time))
|
|
4014
4023
|
}, [l($, {
|
|
4015
4024
|
name: "snooze",
|
|
4016
4025
|
context: u("snoozed-until"),
|
|
@@ -4021,17 +4030,17 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4021
4030
|
"context",
|
|
4022
4031
|
"icons",
|
|
4023
4032
|
"resolver"
|
|
4024
|
-
]), c(" " + O(A(Z)(t.labels.snoozedUntil, { time: A(
|
|
4033
|
+
]), c(" " + O(A(Z)(t.labels.snoozedUntil, { time: A(Nt)(t.item.snoozedUntil, t.now, t.locale) })), 1)], 2)) : (S(), a("time", {
|
|
4025
4034
|
key: 4,
|
|
4026
4035
|
datetime: t.item.createdAt,
|
|
4027
4036
|
title: g.value,
|
|
4028
4037
|
"data-allow-mismatch": "",
|
|
4029
|
-
class: h(A(J)(
|
|
4030
|
-
}, O(A(
|
|
4038
|
+
class: h(A(J)(La, t.classes.time))
|
|
4039
|
+
}, O(A(Wt)(t.item.createdAt, t.now, t.locale)), 11, bc)),
|
|
4031
4040
|
t.item.muted ? (S(), a("p", {
|
|
4032
4041
|
key: 5,
|
|
4033
4042
|
"data-inbox-muted": "",
|
|
4034
|
-
class: h(A(J)(
|
|
4043
|
+
class: h(A(J)(za, t.classes.time))
|
|
4035
4044
|
}, [l($, {
|
|
4036
4045
|
name: "mute",
|
|
4037
4046
|
context: u("muted"),
|
|
@@ -4045,7 +4054,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4045
4054
|
]), c(" " + O(A(Z)(t.labels.muted)), 1)], 2)) : i("", !0),
|
|
4046
4055
|
t.item.result === null ? t.item.actions.length > 0 ? (S(), a("div", {
|
|
4047
4056
|
key: 7,
|
|
4048
|
-
class: h(
|
|
4057
|
+
class: h(Va)
|
|
4049
4058
|
}, [(S(!0), a(e, null, w(t.item.actions, (e, n) => (S(), r(E(A(ye)(e) === void 0 ? "button" : "a"), {
|
|
4050
4059
|
key: n,
|
|
4051
4060
|
type: A(ye)(e) === void 0 ? "button" : void 0,
|
|
@@ -4055,7 +4064,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4055
4064
|
"aria-disabled": t.pendingAction !== void 0 || void 0,
|
|
4056
4065
|
"aria-busy": t.pendingAction === n || void 0,
|
|
4057
4066
|
"data-inbox-action": n,
|
|
4058
|
-
class: h(A(J)(n === 0 ?
|
|
4067
|
+
class: h(A(J)(n === 0 ? qa : Ja, t.classes.action)),
|
|
4059
4068
|
onClick: (e) => A(X).runAction(t.item, n, e)
|
|
4060
4069
|
}, {
|
|
4061
4070
|
default: P(() => [t.pendingAction === n ? (S(), r($, {
|
|
@@ -4067,7 +4076,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4067
4076
|
},
|
|
4068
4077
|
icons: t.icons,
|
|
4069
4078
|
resolver: t.iconResolver,
|
|
4070
|
-
class: h(
|
|
4079
|
+
class: h(Bi)
|
|
4071
4080
|
}, null, 8, [
|
|
4072
4081
|
"context",
|
|
4073
4082
|
"icons",
|
|
@@ -4088,7 +4097,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4088
4097
|
]))), 128))], 2)) : i("", !0) : (S(), a("p", {
|
|
4089
4098
|
key: 6,
|
|
4090
4099
|
"data-inbox-result": "",
|
|
4091
|
-
class: h(A(J)(
|
|
4100
|
+
class: h(A(J)(Ga, t.classes.result))
|
|
4092
4101
|
}, [l($, {
|
|
4093
4102
|
name: "result",
|
|
4094
4103
|
context: u("result"),
|
|
@@ -4108,17 +4117,17 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4108
4117
|
role: "group",
|
|
4109
4118
|
"aria-label": A(Z)(t.labels.snoozeUntil),
|
|
4110
4119
|
"data-inbox-snooze-options": "",
|
|
4111
|
-
class: h(
|
|
4120
|
+
class: h(Va)
|
|
4112
4121
|
}, [(S(!0), a(e, null, w(z.value, (e) => (S(), a("button", {
|
|
4113
4122
|
key: e.label,
|
|
4114
4123
|
type: "button",
|
|
4115
4124
|
"data-inbox-snooze-option": "",
|
|
4116
|
-
class: h(A(J)(
|
|
4125
|
+
class: h(A(J)(Ja, t.classes.action)),
|
|
4117
4126
|
onClick: (t) => V(e.until)
|
|
4118
|
-
}, [c(O(e.label) + " ", 1), o("span", { class: h(
|
|
4127
|
+
}, [c(O(e.label) + " ", 1), o("span", { class: h(Ba) }, O(A(Nt)(e.until, t.now, t.locale)), 3)], 10, Sc))), 128))], 10, xc)) : i("", !0)
|
|
4119
4128
|
]),
|
|
4120
|
-
o("div", { class: h(
|
|
4121
|
-
l(
|
|
4129
|
+
o("div", { class: h(Ya) }, [
|
|
4130
|
+
l(Ys, {
|
|
4122
4131
|
text: A(Z)(d.value ? t.labels.markAsRead : t.labels.markAsUnread),
|
|
4123
4132
|
shortcut: "U"
|
|
4124
4133
|
}, {
|
|
@@ -4127,7 +4136,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4127
4136
|
"data-inbox-toggle-read": "",
|
|
4128
4137
|
"aria-keyshortcuts": "U",
|
|
4129
4138
|
"aria-label": F(d.value ? t.labels.markAsRead : t.labels.markAsUnread),
|
|
4130
|
-
class: h(A(J)(
|
|
4139
|
+
class: h(A(J)(ro, t.classes.control)),
|
|
4131
4140
|
onClick: x
|
|
4132
4141
|
}, [l($, {
|
|
4133
4142
|
name: d.value ? "read" : "unread",
|
|
@@ -4140,10 +4149,10 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4140
4149
|
"context",
|
|
4141
4150
|
"icons",
|
|
4142
4151
|
"resolver"
|
|
4143
|
-
])], 10,
|
|
4152
|
+
])], 10, Cc)]),
|
|
4144
4153
|
_: 1
|
|
4145
4154
|
}, 8, ["text"]),
|
|
4146
|
-
I.value && !f.value ? (S(), r(
|
|
4155
|
+
I.value && !f.value ? (S(), r(Ys, {
|
|
4147
4156
|
key: 0,
|
|
4148
4157
|
text: A(Z)(v.value ? t.labels.unsnooze : t.labels.snooze),
|
|
4149
4158
|
shortcut: "H"
|
|
@@ -4155,7 +4164,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4155
4164
|
"aria-label": F(v.value ? t.labels.unsnooze : t.labels.snooze),
|
|
4156
4165
|
"aria-expanded": v.value ? void 0 : R.value ? "true" : "false",
|
|
4157
4166
|
"aria-controls": v.value || !R.value ? void 0 : A(L),
|
|
4158
|
-
class: h(A(J)(
|
|
4167
|
+
class: h(A(J)(ro, t.classes.control)),
|
|
4159
4168
|
onClick: ee
|
|
4160
4169
|
}, [l($, {
|
|
4161
4170
|
name: v.value ? "unsnooze" : "snooze",
|
|
@@ -4168,10 +4177,10 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4168
4177
|
"context",
|
|
4169
4178
|
"icons",
|
|
4170
4179
|
"resolver"
|
|
4171
|
-
])], 10,
|
|
4180
|
+
])], 10, wc)]),
|
|
4172
4181
|
_: 1
|
|
4173
4182
|
}, 8, ["text"])) : i("", !0),
|
|
4174
|
-
t.item.group !== null && M("mute") ? (S(), r(
|
|
4183
|
+
t.item.group !== null && M("mute") ? (S(), r(Ys, {
|
|
4175
4184
|
key: 1,
|
|
4176
4185
|
text: A(Z)(t.item.muted ? t.labels.unmute : t.labels.mute)
|
|
4177
4186
|
}, {
|
|
@@ -4179,7 +4188,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4179
4188
|
type: "button",
|
|
4180
4189
|
"data-inbox-mute": "",
|
|
4181
4190
|
"aria-label": F(t.item.muted ? t.labels.unmute : t.labels.mute),
|
|
4182
|
-
class: h(A(J)(
|
|
4191
|
+
class: h(A(J)(ro, t.classes.control)),
|
|
4183
4192
|
onClick: k
|
|
4184
4193
|
}, [l($, {
|
|
4185
4194
|
name: t.item.muted ? "unmute" : "mute",
|
|
@@ -4192,10 +4201,10 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4192
4201
|
"context",
|
|
4193
4202
|
"icons",
|
|
4194
4203
|
"resolver"
|
|
4195
|
-
])], 10,
|
|
4204
|
+
])], 10, Tc)]),
|
|
4196
4205
|
_: 1
|
|
4197
4206
|
}, 8, ["text"])) : i("", !0),
|
|
4198
|
-
M("archive") ? (S(), r(
|
|
4207
|
+
M("archive") ? (S(), r(Ys, {
|
|
4199
4208
|
key: 2,
|
|
4200
4209
|
text: A(Z)(f.value ? t.labels.unarchive : t.labels.archive),
|
|
4201
4210
|
shortcut: "E"
|
|
@@ -4205,7 +4214,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4205
4214
|
"data-inbox-toggle-archive": "",
|
|
4206
4215
|
"aria-keyshortcuts": "E",
|
|
4207
4216
|
"aria-label": F(f.value ? t.labels.unarchive : t.labels.archive),
|
|
4208
|
-
class: h(A(J)(
|
|
4217
|
+
class: h(A(J)(ro, t.classes.control)),
|
|
4209
4218
|
onClick: T
|
|
4210
4219
|
}, [l($, {
|
|
4211
4220
|
name: f.value ? "unarchive" : "archive",
|
|
@@ -4218,10 +4227,10 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4218
4227
|
"context",
|
|
4219
4228
|
"icons",
|
|
4220
4229
|
"resolver"
|
|
4221
|
-
])], 10,
|
|
4230
|
+
])], 10, Ec)]),
|
|
4222
4231
|
_: 1
|
|
4223
4232
|
}, 8, ["text"])) : i("", !0),
|
|
4224
|
-
M("delete") ? (S(), r(
|
|
4233
|
+
M("delete") ? (S(), r(Ys, {
|
|
4225
4234
|
key: 3,
|
|
4226
4235
|
text: A(Z)(t.labels.delete)
|
|
4227
4236
|
}, {
|
|
@@ -4229,7 +4238,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4229
4238
|
type: "button",
|
|
4230
4239
|
"data-inbox-delete": "",
|
|
4231
4240
|
"aria-label": F(t.labels.delete),
|
|
4232
|
-
class: h(A(J)(
|
|
4241
|
+
class: h(A(J)(ro, t.classes.control)),
|
|
4233
4242
|
onClick: s[2] ||= (e) => A(X).delete(t.item)
|
|
4234
4243
|
}, [l($, {
|
|
4235
4244
|
name: "delete",
|
|
@@ -4241,25 +4250,25 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4241
4250
|
"context",
|
|
4242
4251
|
"icons",
|
|
4243
4252
|
"resolver"
|
|
4244
|
-
])], 10,
|
|
4253
|
+
])], 10, Dc)]),
|
|
4245
4254
|
_: 1
|
|
4246
4255
|
}, 8, ["text"])) : i("", !0)
|
|
4247
4256
|
], 2)
|
|
4248
|
-
], 10,
|
|
4257
|
+
], 10, dc));
|
|
4249
4258
|
}
|
|
4250
|
-
}),
|
|
4259
|
+
}), kc = [
|
|
4251
4260
|
"data-inbox-id",
|
|
4252
4261
|
"data-read",
|
|
4253
4262
|
"data-seen",
|
|
4254
4263
|
"data-archived",
|
|
4255
4264
|
"data-announcement"
|
|
4256
|
-
],
|
|
4265
|
+
], Ac = ["aria-expanded", "aria-controls"], jc = ["id"], Mc = [
|
|
4257
4266
|
"data-inbox-id",
|
|
4258
4267
|
"data-read",
|
|
4259
4268
|
"data-seen",
|
|
4260
4269
|
"data-archived",
|
|
4261
4270
|
"data-announcement"
|
|
4262
|
-
],
|
|
4271
|
+
], Nc = /* @__PURE__ */ u({
|
|
4263
4272
|
__name: "ItemGroup",
|
|
4264
4273
|
props: {
|
|
4265
4274
|
group: {},
|
|
@@ -4301,19 +4310,19 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4301
4310
|
"data-seen": String(n.group.item.seenAt !== null),
|
|
4302
4311
|
"data-archived": String(n.group.item.archivedAt !== null),
|
|
4303
4312
|
"data-announcement": n.group.item.announcement ? "true" : void 0,
|
|
4304
|
-
class: h(
|
|
4305
|
-
}, [T(t.$slots, "item", g(d(r(n.group.item))), () => [l(
|
|
4313
|
+
class: h(Ea)
|
|
4314
|
+
}, [T(t.$slots, "item", g(d(r(n.group.item))), () => [l(Oc, g(d(r(n.group.item))), null, 16)]), n.group.others.length > 0 ? (S(), a(e, { key: 0 }, [o("button", {
|
|
4306
4315
|
type: "button",
|
|
4307
4316
|
"data-inbox-group-toggle": "",
|
|
4308
4317
|
"aria-expanded": s.value ? "true" : "false",
|
|
4309
4318
|
"aria-controls": s.value ? A(c) : void 0,
|
|
4310
|
-
class: h(
|
|
4319
|
+
class: h(Da),
|
|
4311
4320
|
onClick: u[0] ||= (e) => s.value = !s.value
|
|
4312
|
-
}, O(s.value ? A(Z)(n.labels.showLess) : A(Z)(n.labels.showMore, { count: n.group.others.length })), 11,
|
|
4321
|
+
}, O(s.value ? A(Z)(n.labels.showLess) : A(Z)(n.labels.showMore, { count: n.group.others.length })), 11, Ac), s.value ? (S(), a("ul", {
|
|
4313
4322
|
key: 0,
|
|
4314
4323
|
id: A(c),
|
|
4315
4324
|
role: "list",
|
|
4316
|
-
class: h(
|
|
4325
|
+
class: h(Oa)
|
|
4317
4326
|
}, [(S(!0), a(e, null, w(n.group.others, (e) => (S(), a("li", {
|
|
4318
4327
|
key: e.id,
|
|
4319
4328
|
tabindex: "-1",
|
|
@@ -4323,21 +4332,21 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4323
4332
|
"data-seen": String(e.seenAt !== null),
|
|
4324
4333
|
"data-archived": String(e.archivedAt !== null),
|
|
4325
4334
|
"data-announcement": e.announcement ? "true" : void 0,
|
|
4326
|
-
class: h(
|
|
4327
|
-
}, [T(t.$slots, "item", p({ ref_for: !0 }, r(e)), () => [l(
|
|
4335
|
+
class: h(Ea)
|
|
4336
|
+
}, [T(t.$slots, "item", p({ ref_for: !0 }, r(e)), () => [l(Oc, p({ ref_for: !0 }, r(e)), null, 16)])], 10, Mc))), 128))], 10, jc)) : i("", !0)], 64)) : i("", !0)], 10, kc));
|
|
4328
4337
|
}
|
|
4329
|
-
}),
|
|
4338
|
+
}), Pc = ["aria-label"], Fc = [
|
|
4330
4339
|
"checked",
|
|
4331
4340
|
"indeterminate",
|
|
4332
4341
|
"aria-label"
|
|
4333
|
-
],
|
|
4342
|
+
], Ic = { "aria-live": "polite" }, Lc = [
|
|
4334
4343
|
"data-inbox-batch",
|
|
4335
4344
|
"aria-label",
|
|
4336
4345
|
"title",
|
|
4337
4346
|
"aria-expanded",
|
|
4338
4347
|
"aria-controls",
|
|
4339
4348
|
"onClick"
|
|
4340
|
-
],
|
|
4349
|
+
], Rc = ["aria-label", "title"], zc = ["id", "aria-label"], Bc = ["onClick"], Vc = /* @__PURE__ */ u({
|
|
4341
4350
|
__name: "SelectionBar",
|
|
4342
4351
|
props: /*@__PURE__*/ f({
|
|
4343
4352
|
component: {},
|
|
@@ -4357,7 +4366,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4357
4366
|
}),
|
|
4358
4367
|
emits: ["update:selected"],
|
|
4359
4368
|
setup(t) {
|
|
4360
|
-
let r = t, s = M(t, "selected"), u = j(), d = (e) => Z(r.labels[e]), f = n(() => r.items.filter((e) => s.value.includes(e.id))), p = n(() => f.value.length === r.items.length), g = n(() =>
|
|
4369
|
+
let r = t, s = M(t, "selected"), u = j(), d = (e) => Z(r.labels[e]), f = n(() => r.items.filter((e) => s.value.includes(e.id))), p = n(() => f.value.length === r.items.length), g = n(() => Ds(r.filter, r.allowedActions)), _ = D(null), v = C();
|
|
4361
4370
|
N(() => f.value.length === 0, (e) => {
|
|
4362
4371
|
e && (_.value = null);
|
|
4363
4372
|
});
|
|
@@ -4365,7 +4374,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4365
4374
|
let n = f.value;
|
|
4366
4375
|
s.value = [], X.batch(e, n, t);
|
|
4367
4376
|
}, b = async () => {
|
|
4368
|
-
_.value = _.value ? null :
|
|
4377
|
+
_.value = _.value ? null : Os(r.snooze, r.labels), _.value && (await m(), v.value?.querySelector("button")?.focus());
|
|
4369
4378
|
}, x = (e) => {
|
|
4370
4379
|
_.value = null, y("snooze", e);
|
|
4371
4380
|
};
|
|
@@ -4374,16 +4383,16 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4374
4383
|
role: "group",
|
|
4375
4384
|
"aria-label": d("selection"),
|
|
4376
4385
|
"data-inbox-selection": "",
|
|
4377
|
-
class: h(
|
|
4378
|
-
}, [o("div", { class: h(
|
|
4386
|
+
class: h(Qa)
|
|
4387
|
+
}, [o("div", { class: h(eo) }, [o("input", {
|
|
4379
4388
|
type: "checkbox",
|
|
4380
4389
|
"data-inbox-select-all": "",
|
|
4381
4390
|
checked: p.value,
|
|
4382
4391
|
indeterminate: !p.value,
|
|
4383
4392
|
"aria-label": d("selectAll"),
|
|
4384
|
-
class: h(
|
|
4393
|
+
class: h(to),
|
|
4385
4394
|
onChange: r[0] ||= (e) => s.value = p.value ? [] : t.items.map((e) => e.id)
|
|
4386
|
-
}, null, 42,
|
|
4395
|
+
}, null, 42, Fc), o("span", Ic, O(A(Z)(t.labels.selected, { count: f.value.length })), 1)], 2), o("div", { class: h(ta) }, [(S(!0), a(e, null, w(g.value, (e) => (S(), a("button", {
|
|
4387
4396
|
key: e.action,
|
|
4388
4397
|
type: "button",
|
|
4389
4398
|
"data-inbox-batch": e.action,
|
|
@@ -4391,7 +4400,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4391
4400
|
title: d(e.label),
|
|
4392
4401
|
"aria-expanded": e.action === "snooze" ? _.value ? "true" : "false" : void 0,
|
|
4393
4402
|
"aria-controls": e.action === "snooze" && _.value ? A(u) : void 0,
|
|
4394
|
-
class: h(A(J)(
|
|
4403
|
+
class: h(A(J)(ro, t.classes.control)),
|
|
4395
4404
|
onClick: (t) => e.action === "snooze" ? b() : y(e.action)
|
|
4396
4405
|
}, [l($, {
|
|
4397
4406
|
name: e.icon,
|
|
@@ -4408,12 +4417,12 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4408
4417
|
"context",
|
|
4409
4418
|
"icons",
|
|
4410
4419
|
"resolver"
|
|
4411
|
-
])], 10,
|
|
4420
|
+
])], 10, Lc))), 128)), o("button", {
|
|
4412
4421
|
type: "button",
|
|
4413
4422
|
"data-inbox-clear-selection": "",
|
|
4414
4423
|
"aria-label": d("clearSelection"),
|
|
4415
4424
|
title: d("clearSelection"),
|
|
4416
|
-
class: h(A(J)(
|
|
4425
|
+
class: h(A(J)(ro, t.classes.control)),
|
|
4417
4426
|
onClick: r[1] ||= (e) => s.value = []
|
|
4418
4427
|
}, [l($, {
|
|
4419
4428
|
name: "dismiss",
|
|
@@ -4428,7 +4437,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4428
4437
|
"context",
|
|
4429
4438
|
"icons",
|
|
4430
4439
|
"resolver"
|
|
4431
|
-
])], 10,
|
|
4440
|
+
])], 10, Rc)], 2)], 10, Pc)) : i("", !0), _.value ? (S(), a("div", {
|
|
4432
4441
|
key: 1,
|
|
4433
4442
|
id: A(u),
|
|
4434
4443
|
ref_key: "choicesElement",
|
|
@@ -4436,30 +4445,30 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4436
4445
|
role: "group",
|
|
4437
4446
|
"aria-label": d("snoozeUntil"),
|
|
4438
4447
|
"data-inbox-batch-snooze-options": "",
|
|
4439
|
-
class: h(
|
|
4448
|
+
class: h(no)
|
|
4440
4449
|
}, [(S(!0), a(e, null, w(_.value, (e) => (S(), a("button", {
|
|
4441
4450
|
key: e.label,
|
|
4442
4451
|
type: "button",
|
|
4443
4452
|
"data-inbox-batch-snooze-option": "",
|
|
4444
|
-
class: h(A(J)(
|
|
4453
|
+
class: h(A(J)(Ja, t.classes.action)),
|
|
4445
4454
|
onClick: (t) => x(e.until)
|
|
4446
|
-
}, [c(O(e.label) + " ", 1), o("span", { class: h(
|
|
4455
|
+
}, [c(O(e.label) + " ", 1), o("span", { class: h(Ba) }, O(A(Nt)(e.until, t.now, t.locale)), 3)], 10, Bc))), 128))], 10, zc)) : i("", !0)], 64));
|
|
4447
4456
|
}
|
|
4448
|
-
}),
|
|
4457
|
+
}), Hc = {
|
|
4449
4458
|
"data-inbox": "",
|
|
4450
4459
|
class: "inline-flex"
|
|
4451
|
-
},
|
|
4460
|
+
}, Uc = [
|
|
4452
4461
|
"popovertarget",
|
|
4453
4462
|
"aria-expanded",
|
|
4454
4463
|
"aria-controls",
|
|
4455
4464
|
"aria-label",
|
|
4456
4465
|
"data-paused"
|
|
4457
|
-
],
|
|
4466
|
+
], Wc = ["id", "aria-labelledby"], Gc = [
|
|
4458
4467
|
"id",
|
|
4459
4468
|
"role",
|
|
4460
4469
|
"aria-labelledby",
|
|
4461
4470
|
"aria-busy"
|
|
4462
|
-
],
|
|
4471
|
+
], Kc = { class: "sr-only" }, qc = { role: "alert" }, Jc = ["data-inbox-selecting"], Yc = { role: "alert" }, Xc = /* @__PURE__ */ u({
|
|
4463
4472
|
__name: "NotificationCenter",
|
|
4464
4473
|
props: /*@__PURE__*/ f({
|
|
4465
4474
|
labels: { default: () => ({}) },
|
|
@@ -4497,16 +4506,16 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4497
4506
|
title: `${x}-title`,
|
|
4498
4507
|
list: `${x}-list`,
|
|
4499
4508
|
tab: (e) => `${x}-tab-${e}`
|
|
4500
|
-
}, k = D(X.getServerSnapshot()), F = C(Date.now()), L = n(() =>
|
|
4509
|
+
}, k = D(X.getServerSnapshot()), F = C(Date.now()), L = n(() => Jt(f.labels)), z = (e) => Z(L.value[e]), ee = n(() => k.value.counts[f.count]), V = n(() => gs(k.value.filter, L.value)), H = n(() => ms(k.value)), te = D([]), ne = n(() => vs(k.value.items, te.value)), re = n(() => ys(k.value, ne.value.length)), ie = n(() => jt(ne.value, f.group)), ae = C(), oe = C(), U = C(), se = C(), W, ce, le = [], ue, G;
|
|
4501
4510
|
y(() => {
|
|
4502
|
-
|
|
4511
|
+
$o(), le.push(X.subscribe(() => k.value = X.getSnapshot())), Bt(b.props), k.value = X.getSnapshot(), le.push(Vs(oe.value)), ce = As(se.value, (e) => te.value = e, {
|
|
4503
4512
|
scroller: se.value,
|
|
4504
4513
|
listed: (e) => X.getSnapshot().items.some((t) => t.id === e)
|
|
4505
4514
|
}), le.push(() => ce?.destroy());
|
|
4506
|
-
let e =
|
|
4507
|
-
le.push(() => e.destroy()), W =
|
|
4515
|
+
let e = Ns(se.value, () => X.getSnapshot().items);
|
|
4516
|
+
le.push(() => e.destroy()), W = Ls(ae.value, oe.value, {
|
|
4508
4517
|
onToggle(e) {
|
|
4509
|
-
m.value = e, ue?.(), ue = void 0, e ? (G = window.location.href, ue =
|
|
4518
|
+
m.value = e, ue?.(), ue = void 0, e ? (G = window.location.href, ue = Ut.subscribe(() => F.value = Ut.getSnapshot()), F.value = Ut.getSnapshot(), X.opened(H.value, {
|
|
4510
4519
|
markAllAsSeen: !1,
|
|
4511
4520
|
categories: Object.keys(k.value.categoryFilter)
|
|
4512
4521
|
})) : X.closed({ markAllAsSeen: !1 });
|
|
@@ -4528,7 +4537,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4528
4537
|
}), v(() => {
|
|
4529
4538
|
m.value && X.closed({ markAllAsSeen: !1 }), le.forEach((e) => e()), ue?.(), W?.destroy();
|
|
4530
4539
|
});
|
|
4531
|
-
let q = (e) =>
|
|
4540
|
+
let q = (e) => Bs(e, oe.value), de = () => W?.close(), fe = n(() => ({
|
|
4532
4541
|
titleId: E.title,
|
|
4533
4542
|
title: z("title"),
|
|
4534
4543
|
tabId: E.tab,
|
|
@@ -4539,12 +4548,12 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4539
4548
|
pe.value = [], ce?.release();
|
|
4540
4549
|
});
|
|
4541
4550
|
let he = (e, t) => {
|
|
4542
|
-
pe.value =
|
|
4551
|
+
pe.value = ks(pe.value, e, t);
|
|
4543
4552
|
}, ge = (e) => {
|
|
4544
|
-
let t =
|
|
4553
|
+
let t = Ps(e, k.value.items);
|
|
4545
4554
|
t?.action ? _("action", t.item, t.action, e) : t && _("itemClick", t.item, e);
|
|
4546
4555
|
};
|
|
4547
|
-
return (t, n) => (S(), a("div",
|
|
4556
|
+
return (t, n) => (S(), a("div", Hc, [o("button", {
|
|
4548
4557
|
ref_key: "trigger",
|
|
4549
4558
|
ref: ae,
|
|
4550
4559
|
type: "button",
|
|
@@ -4552,10 +4561,10 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4552
4561
|
"aria-haspopup": "dialog",
|
|
4553
4562
|
"aria-expanded": m.value ? "true" : "false",
|
|
4554
4563
|
"aria-controls": E.panel,
|
|
4555
|
-
"aria-label": A(
|
|
4564
|
+
"aria-label": A(Hs)(L.value, ee.value, f.maxCount, f.locale, k.value.pausedUntil !== null),
|
|
4556
4565
|
"data-inbox-bell": "",
|
|
4557
4566
|
"data-paused": k.value.pausedUntil === null ? void 0 : "true",
|
|
4558
|
-
class: h(A(J)(
|
|
4567
|
+
class: h(A(J)(Gi, f.classes.bell))
|
|
4559
4568
|
}, [T(t.$slots, "trigger", {
|
|
4560
4569
|
open: m.value,
|
|
4561
4570
|
count: ee.value,
|
|
@@ -4575,18 +4584,18 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4575
4584
|
"resolver"
|
|
4576
4585
|
]), f.badge !== "none" && ee.value > 0 ? T(t.$slots, "badge", {
|
|
4577
4586
|
count: ee.value,
|
|
4578
|
-
text: A(
|
|
4587
|
+
text: A(Gt)(ee.value, f.maxCount, f.locale)
|
|
4579
4588
|
}, () => [f.badge === "count" ? (S(), a("span", {
|
|
4580
4589
|
key: 0,
|
|
4581
4590
|
"data-inbox-badge": "",
|
|
4582
4591
|
"aria-hidden": "true",
|
|
4583
|
-
class: h(A(J)(
|
|
4584
|
-
}, O(A(
|
|
4592
|
+
class: h(A(J)(Ki, f.classes.badge))
|
|
4593
|
+
}, O(A(Gt)(ee.value, f.maxCount, f.locale)), 3)) : (S(), a("span", {
|
|
4585
4594
|
key: 1,
|
|
4586
4595
|
"data-inbox-badge": "",
|
|
4587
4596
|
"aria-hidden": "true",
|
|
4588
|
-
class: h(A(J)(
|
|
4589
|
-
}, null, 2))], void 0, 0) : i("", !0)])], 10,
|
|
4597
|
+
class: h(A(J)(qi, f.classes.badge))
|
|
4598
|
+
}, null, 2))], void 0, 0) : i("", !0)])], 10, Uc), o("div", {
|
|
4590
4599
|
id: E.panel,
|
|
4591
4600
|
ref_key: "panel",
|
|
4592
4601
|
ref: oe,
|
|
@@ -4595,11 +4604,11 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4595
4604
|
"aria-labelledby": E.title,
|
|
4596
4605
|
tabindex: "-1",
|
|
4597
4606
|
"data-inbox-panel": "",
|
|
4598
|
-
class: h(A(J)(
|
|
4607
|
+
class: h(A(J)(Ji, f.classes.panel)),
|
|
4599
4608
|
onKeydown: q,
|
|
4600
4609
|
onClickCapture: ge
|
|
4601
|
-
}, [o("div", { class: h(
|
|
4602
|
-
l(
|
|
4610
|
+
}, [o("div", { class: h(Yi) }, [
|
|
4611
|
+
l(uc, {
|
|
4603
4612
|
component: "NotificationCenter",
|
|
4604
4613
|
state: k.value,
|
|
4605
4614
|
filter: k.value.filter,
|
|
@@ -4645,20 +4654,20 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4645
4654
|
role: H.value.length > 1 ? "tabpanel" : void 0,
|
|
4646
4655
|
"aria-labelledby": H.value.length > 1 ? E.tab(k.value.filter) : void 0,
|
|
4647
4656
|
"aria-busy": k.value.status === "loading" || k.value.loadingMore || void 0,
|
|
4648
|
-
class: h(
|
|
4657
|
+
class: h(Sa)
|
|
4649
4658
|
}, [o("div", {
|
|
4650
4659
|
"aria-live": "polite",
|
|
4651
|
-
class: h(
|
|
4660
|
+
class: h(Ca)
|
|
4652
4661
|
}, [te.value.length > 0 ? (S(), a("button", {
|
|
4653
4662
|
key: 0,
|
|
4654
4663
|
type: "button",
|
|
4655
4664
|
"data-inbox-show-new": "",
|
|
4656
|
-
class: h(
|
|
4665
|
+
class: h(wa),
|
|
4657
4666
|
onClick: n[0] ||= (e) => A(ce)?.reveal()
|
|
4658
4667
|
}, O(A(Z)(L.value.showNew, { count: te.value.length })), 3)) : i("", !0)], 2), re.value === "loading" ? (S(), a("div", {
|
|
4659
4668
|
key: 0,
|
|
4660
4669
|
role: "status",
|
|
4661
|
-
class: h(
|
|
4670
|
+
class: h(io)
|
|
4662
4671
|
}, [T(t.$slots, "loading", {}, () => [l($, {
|
|
4663
4672
|
name: "spinner",
|
|
4664
4673
|
context: {
|
|
@@ -4667,27 +4676,27 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4667
4676
|
},
|
|
4668
4677
|
icons: f.icons,
|
|
4669
4678
|
resolver: f.iconResolver,
|
|
4670
|
-
class: h([
|
|
4679
|
+
class: h([ao, "motion-safe:animate-spin"])
|
|
4671
4680
|
}, null, 8, [
|
|
4672
4681
|
"icons",
|
|
4673
4682
|
"resolver",
|
|
4674
4683
|
"class"
|
|
4675
|
-
]), o("span",
|
|
4684
|
+
]), o("span", Kc, O(z("loading")), 1)])], 2)) : re.value === "error" ? (S(), a("div", {
|
|
4676
4685
|
key: 1,
|
|
4677
4686
|
"data-inbox-error": "",
|
|
4678
|
-
class: h(
|
|
4687
|
+
class: h(io)
|
|
4679
4688
|
}, [T(t.$slots, "error", {
|
|
4680
4689
|
more: !1,
|
|
4681
4690
|
retry: () => void A(X).load()
|
|
4682
|
-
}, () => [o("p",
|
|
4691
|
+
}, () => [o("p", qc, O(z("error")), 1), o("button", {
|
|
4683
4692
|
type: "button",
|
|
4684
4693
|
"data-inbox-retry": "",
|
|
4685
|
-
class: h(
|
|
4694
|
+
class: h(Ja),
|
|
4686
4695
|
onClick: n[1] ||= (e) => A(X).load()
|
|
4687
4696
|
}, O(z("retry")), 3)])], 2)) : re.value === "empty" ? (S(), a("div", {
|
|
4688
4697
|
key: 2,
|
|
4689
4698
|
"data-inbox-empty": "",
|
|
4690
|
-
class: h(
|
|
4699
|
+
class: h(io)
|
|
4691
4700
|
}, [T(t.$slots, "empty", { filter: k.value.filter }, () => [l($, {
|
|
4692
4701
|
name: "empty",
|
|
4693
4702
|
context: {
|
|
@@ -4697,7 +4706,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4697
4706
|
},
|
|
4698
4707
|
icons: f.icons,
|
|
4699
4708
|
resolver: f.iconResolver,
|
|
4700
|
-
class: h(
|
|
4709
|
+
class: h(ao)
|
|
4701
4710
|
}, null, 8, [
|
|
4702
4711
|
"context",
|
|
4703
4712
|
"icons",
|
|
@@ -4706,8 +4715,8 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4706
4715
|
]), o("p", null, O(V.value), 1)])], 2)) : (S(), a(e, { key: 3 }, [o("ul", {
|
|
4707
4716
|
role: "list",
|
|
4708
4717
|
"data-inbox-selecting": me.value || void 0,
|
|
4709
|
-
class: h(A(J)(
|
|
4710
|
-
}, [(S(!0), a(e, null, w(ie.value, (e) => (S(), r(
|
|
4718
|
+
class: h(A(J)(Ta, f.classes.list))
|
|
4719
|
+
}, [(S(!0), a(e, null, w(ie.value, (e) => (S(), r(Nc, {
|
|
4711
4720
|
key: e.key,
|
|
4712
4721
|
group: e,
|
|
4713
4722
|
now: F.value,
|
|
@@ -4738,24 +4747,24 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4738
4747
|
"allowed-actions",
|
|
4739
4748
|
"selected",
|
|
4740
4749
|
"select"
|
|
4741
|
-
]))), 128))], 10,
|
|
4750
|
+
]))), 128))], 10, Jc), k.value.hasMore && k.value.moreFailed ? (S(), a("div", {
|
|
4742
4751
|
key: 0,
|
|
4743
4752
|
"data-inbox-more-failed": "",
|
|
4744
|
-
class: h(
|
|
4753
|
+
class: h(io)
|
|
4745
4754
|
}, [T(t.$slots, "error", {
|
|
4746
4755
|
more: !0,
|
|
4747
4756
|
retry: () => void A(X).loadMore({ retry: !0 })
|
|
4748
|
-
}, () => [o("p",
|
|
4757
|
+
}, () => [o("p", Yc, O(z("error")), 1), o("button", {
|
|
4749
4758
|
type: "button",
|
|
4750
4759
|
"data-inbox-retry": "",
|
|
4751
|
-
class: h(
|
|
4760
|
+
class: h(Ja),
|
|
4752
4761
|
onClick: n[2] ||= (e) => A(X).loadMore({ retry: !0 })
|
|
4753
4762
|
}, O(z("retry")), 3)])], 2)) : k.value.hasMore ? (S(), a("div", {
|
|
4754
4763
|
key: 1,
|
|
4755
4764
|
ref_key: "sentinel",
|
|
4756
4765
|
ref: U,
|
|
4757
4766
|
"aria-hidden": "true",
|
|
4758
|
-
class: h(
|
|
4767
|
+
class: h(oo)
|
|
4759
4768
|
}, [k.value.loadingMore ? (S(), r($, {
|
|
4760
4769
|
key: 0,
|
|
4761
4770
|
name: "spinner",
|
|
@@ -4765,13 +4774,13 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4765
4774
|
},
|
|
4766
4775
|
icons: f.icons,
|
|
4767
4776
|
resolver: f.iconResolver,
|
|
4768
|
-
class: h(
|
|
4777
|
+
class: h(Mi)
|
|
4769
4778
|
}, null, 8, [
|
|
4770
4779
|
"icons",
|
|
4771
4780
|
"resolver",
|
|
4772
4781
|
"class"
|
|
4773
|
-
])) : i("", !0)], 2)) : i("", !0)], 64))], 10,
|
|
4774
|
-
l(
|
|
4782
|
+
])) : i("", !0)], 2)) : i("", !0)], 64))], 10, Gc),
|
|
4783
|
+
l(Vc, {
|
|
4775
4784
|
selected: pe.value,
|
|
4776
4785
|
"onUpdate:selected": n[3] ||= (e) => pe.value = e,
|
|
4777
4786
|
component: "NotificationCenter",
|
|
@@ -4804,14 +4813,14 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4804
4813
|
}, () => [l(A(I), {
|
|
4805
4814
|
href: f.href,
|
|
4806
4815
|
"data-inbox-view-all": "",
|
|
4807
|
-
class: h(
|
|
4816
|
+
class: h(qo)
|
|
4808
4817
|
}, {
|
|
4809
4818
|
default: P(() => [c(O(z("viewAll")), 1)]),
|
|
4810
4819
|
_: 1
|
|
4811
4820
|
}, 8, ["href", "class"])], void 0, 0) : i("", !0)
|
|
4812
|
-
], 2)], 42,
|
|
4821
|
+
], 2)], 42, Wc)]));
|
|
4813
4822
|
}
|
|
4814
|
-
}),
|
|
4823
|
+
}), Zc = { class: "sr-only" }, Qc = ["aria-busy", "onClick"], $c = /* @__PURE__ */ u({
|
|
4815
4824
|
__name: "NotificationList",
|
|
4816
4825
|
props: {
|
|
4817
4826
|
data: {},
|
|
@@ -4846,32 +4855,32 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4846
4855
|
},
|
|
4847
4856
|
emits: ["itemClick", "action"],
|
|
4848
4857
|
setup(t, { emit: c }) {
|
|
4849
|
-
let u = t, f = c, m = B(), _ = D(X.getServerSnapshot()), b = C(Date.now()), x = n(() =>
|
|
4858
|
+
let u = t, f = c, m = B(), _ = D(X.getServerSnapshot()), b = C(Date.now()), x = n(() => Jt(u.labels)), E = n(() => ws(m.url, _.value, u.filter, u.category)), k = n(() => gs(E.value.filter, x.value)), j = C(), M = n(() => {
|
|
4850
4859
|
let e = m.props[u.data];
|
|
4851
|
-
return Array.isArray(e?.data) ? e.data.map(
|
|
4852
|
-
}), I = () =>
|
|
4853
|
-
H.value =
|
|
4860
|
+
return Array.isArray(e?.data) ? e.data.map(pt).filter((e) => e !== void 0) : [];
|
|
4861
|
+
}), I = () => At(X, M.value, E.value.filter, E.value.category), L = D([]), R = n(() => (_.value, vs(I(), L.value))), z = n(() => jt(R.value, u.group)), ee = n(() => !!m.scrollProps?.[u.data]?.nextPage), V = (e, t) => Cs(m.url, e, t, m.scrollProps?.[u.data]?.pageName), H = D([]), te = n(() => R.value.some((e) => H.value.includes(e.id))), ne = (e, t) => {
|
|
4862
|
+
H.value = ks(H.value, e, t);
|
|
4854
4863
|
}, re, ie = [];
|
|
4855
4864
|
N(() => `${E.value.filter}|${E.value.category}|${_.value.selectable}`, () => {
|
|
4856
4865
|
H.value = [], re?.release();
|
|
4857
4866
|
});
|
|
4858
4867
|
let ae = (e) => {
|
|
4859
|
-
let t =
|
|
4868
|
+
let t = Ps(e, R.value);
|
|
4860
4869
|
t?.action ? f("action", t.item, t.action, e) : t && f("itemClick", t.item, e);
|
|
4861
4870
|
};
|
|
4862
4871
|
return y(() => {
|
|
4863
|
-
|
|
4864
|
-
let e =
|
|
4872
|
+
$o(), ie.push(X.subscribe(() => _.value = X.getSnapshot())), ie.push(Ut.subscribe(() => b.value = Ut.getSnapshot())), Bt(m.props), X.remember(M.value), ie.push(N(M, (e) => X.remember(e))), _.value = X.getSnapshot(), b.value = Ut.getSnapshot(), ie.push(Vs(j.value)), re = As(j.value, (e) => L.value = e, { listed: (e) => I().some((t) => t.id === e) }), ie.push(() => re?.destroy());
|
|
4873
|
+
let e = Ns(j.value, () => R.value, null);
|
|
4865
4874
|
ie.push(() => e.destroy());
|
|
4866
4875
|
}), v(() => ie.forEach((e) => e())), (t, n) => (S(), a("div", {
|
|
4867
4876
|
ref_key: "root",
|
|
4868
4877
|
ref: j,
|
|
4869
4878
|
"data-inbox-list": "",
|
|
4870
4879
|
tabindex: "-1",
|
|
4871
|
-
onKeydown: n[2] ||= (e) => A(
|
|
4880
|
+
onKeydown: n[2] ||= (e) => A(Bs)(e, j.value),
|
|
4872
4881
|
onClickCapture: ae
|
|
4873
4882
|
}, [
|
|
4874
|
-
l(
|
|
4883
|
+
l(uc, {
|
|
4875
4884
|
component: "NotificationList",
|
|
4876
4885
|
state: _.value,
|
|
4877
4886
|
filter: E.value.filter,
|
|
@@ -4908,12 +4917,12 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4908
4917
|
]),
|
|
4909
4918
|
o("div", {
|
|
4910
4919
|
"aria-live": "polite",
|
|
4911
|
-
class: h(
|
|
4920
|
+
class: h(Ca)
|
|
4912
4921
|
}, [L.value.length > 0 ? (S(), a("button", {
|
|
4913
4922
|
key: 0,
|
|
4914
4923
|
type: "button",
|
|
4915
4924
|
"data-inbox-show-new": "",
|
|
4916
|
-
class: h(
|
|
4925
|
+
class: h(wa),
|
|
4917
4926
|
onClick: n[0] ||= (e) => A(re)?.reveal()
|
|
4918
4927
|
}, O(A(Z)(x.value.showNew, { count: L.value.length })), 3)) : i("", !0)], 2),
|
|
4919
4928
|
l(A(F), {
|
|
@@ -4925,11 +4934,11 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4925
4934
|
role: "list",
|
|
4926
4935
|
hidden: R.value.length === 0 || void 0,
|
|
4927
4936
|
"data-inbox-selecting": te.value || void 0,
|
|
4928
|
-
class: h(A(J)(
|
|
4937
|
+
class: h(A(J)(Ta, u.classes.list))
|
|
4929
4938
|
}, s({
|
|
4930
4939
|
loading: P(() => [o("div", {
|
|
4931
4940
|
role: "status",
|
|
4932
|
-
class: h(
|
|
4941
|
+
class: h(oo)
|
|
4933
4942
|
}, [l($, {
|
|
4934
4943
|
name: "spinner",
|
|
4935
4944
|
context: {
|
|
@@ -4938,13 +4947,13 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4938
4947
|
},
|
|
4939
4948
|
icons: u.icons,
|
|
4940
4949
|
resolver: u.iconResolver,
|
|
4941
|
-
class: h(
|
|
4950
|
+
class: h(Mi)
|
|
4942
4951
|
}, null, 8, [
|
|
4943
4952
|
"icons",
|
|
4944
4953
|
"resolver",
|
|
4945
4954
|
"class"
|
|
4946
|
-
]), o("span",
|
|
4947
|
-
default: P(() => [(S(!0), a(e, null, w(z.value, (e) => (S(), r(
|
|
4955
|
+
]), o("span", Zc, O(A(Z)(x.value.loading)), 1)], 2)]),
|
|
4956
|
+
default: P(() => [(S(!0), a(e, null, w(z.value, (e) => (S(), r(Nc, {
|
|
4948
4957
|
key: e.key,
|
|
4949
4958
|
group: e,
|
|
4950
4959
|
now: b.value,
|
|
@@ -4981,14 +4990,14 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
4981
4990
|
name: "next",
|
|
4982
4991
|
fn: P(({ fetch: e, hasMore: t, loading: n }) => [t ? (S(), a("div", {
|
|
4983
4992
|
key: 0,
|
|
4984
|
-
class: h(
|
|
4993
|
+
class: h(oo)
|
|
4985
4994
|
}, [o("button", {
|
|
4986
4995
|
type: "button",
|
|
4987
4996
|
"data-inbox-load-more": "",
|
|
4988
4997
|
"aria-busy": n || void 0,
|
|
4989
|
-
class: h(
|
|
4998
|
+
class: h(Ja),
|
|
4990
4999
|
onClick: e
|
|
4991
|
-
}, O(A(Z)(x.value.loadMore)), 11,
|
|
5000
|
+
}, O(A(Z)(x.value.loadMore)), 11, Qc)], 2)) : i("", !0)]),
|
|
4992
5001
|
key: "0"
|
|
4993
5002
|
} : void 0]), 1032, [
|
|
4994
5003
|
"data",
|
|
@@ -5002,7 +5011,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
5002
5011
|
R.value.length === 0 && !ee.value ? (S(), a("div", {
|
|
5003
5012
|
key: 0,
|
|
5004
5013
|
"data-inbox-empty": "",
|
|
5005
|
-
class: h(
|
|
5014
|
+
class: h(io)
|
|
5006
5015
|
}, [T(t.$slots, "empty", { filter: E.value.filter }, () => [l($, {
|
|
5007
5016
|
name: "empty",
|
|
5008
5017
|
context: {
|
|
@@ -5012,7 +5021,7 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
5012
5021
|
},
|
|
5013
5022
|
icons: u.icons,
|
|
5014
5023
|
resolver: u.iconResolver,
|
|
5015
|
-
class: h(
|
|
5024
|
+
class: h(ao)
|
|
5016
5025
|
}, null, 8, [
|
|
5017
5026
|
"context",
|
|
5018
5027
|
"icons",
|
|
@@ -5021,8 +5030,8 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
5021
5030
|
]), o("p", null, O(k.value), 1)])], 2)) : i("", !0),
|
|
5022
5031
|
te.value ? (S(), a("div", {
|
|
5023
5032
|
key: 1,
|
|
5024
|
-
class: h(
|
|
5025
|
-
}, [l(
|
|
5033
|
+
class: h($a)
|
|
5034
|
+
}, [l(Vc, {
|
|
5026
5035
|
selected: H.value,
|
|
5027
5036
|
"onUpdate:selected": n[1] ||= (e) => H.value = e,
|
|
5028
5037
|
component: "NotificationList",
|
|
@@ -5053,10 +5062,10 @@ var qs = ["popover"], Js = /* @__PURE__ */ u({
|
|
|
5053
5062
|
}
|
|
5054
5063
|
});
|
|
5055
5064
|
// src/usePreferences.ts
|
|
5056
|
-
function
|
|
5057
|
-
let e = B(), t = D(
|
|
5065
|
+
function el() {
|
|
5066
|
+
let e = B(), t = D(_n), r, i = () => Qn.load(X.getSnapshot().url);
|
|
5058
5067
|
y(() => {
|
|
5059
|
-
|
|
5068
|
+
$o(), r = Qn.subscribe(() => t.value = Qn.getSnapshot()), Bt(e.props), t.value = Qn.getSnapshot(), i();
|
|
5060
5069
|
}), v(() => r?.());
|
|
5061
5070
|
let a = (e) => n(() => t.value[e]);
|
|
5062
5071
|
return {
|
|
@@ -5066,22 +5075,22 @@ function $c() {
|
|
|
5066
5075
|
categories: a("categories"),
|
|
5067
5076
|
notificationHours: a("notificationHours"),
|
|
5068
5077
|
frequencies: a("frequencies"),
|
|
5069
|
-
sections: n(() =>
|
|
5078
|
+
sections: n(() => Tn(t.value)),
|
|
5070
5079
|
load: i,
|
|
5071
|
-
set:
|
|
5072
|
-
setChannel:
|
|
5073
|
-
setFrequency:
|
|
5074
|
-
setNotificationHours:
|
|
5075
|
-
receives: (e, n) =>
|
|
5076
|
-
frequencyApplies:
|
|
5077
|
-
isDisabled: (e, n) =>
|
|
5080
|
+
set: Qn.set,
|
|
5081
|
+
setChannel: Qn.setChannel,
|
|
5082
|
+
setFrequency: Qn.setFrequency,
|
|
5083
|
+
setNotificationHours: Qn.setNotificationHours,
|
|
5084
|
+
receives: (e, n) => On(e, n, t.value.channels),
|
|
5085
|
+
frequencyApplies: An,
|
|
5086
|
+
isDisabled: (e, n) => kn(e, n, t.value.channels)
|
|
5078
5087
|
};
|
|
5079
5088
|
}
|
|
5080
5089
|
// src/usePush.ts
|
|
5081
|
-
function
|
|
5082
|
-
let e = B(), t = D(
|
|
5090
|
+
function tl() {
|
|
5091
|
+
let e = B(), t = D(tr), r;
|
|
5083
5092
|
y(() => {
|
|
5084
|
-
|
|
5093
|
+
$o(), r = _r.subscribe(() => t.value = _r.getSnapshot()), Bt(e.props), t.value = _r.getSnapshot();
|
|
5085
5094
|
}), v(() => r?.());
|
|
5086
5095
|
let i = (e) => n(() => t.value[e]);
|
|
5087
5096
|
return {
|
|
@@ -5093,59 +5102,59 @@ function el() {
|
|
|
5093
5102
|
reason: i("reason"),
|
|
5094
5103
|
request: i("request"),
|
|
5095
5104
|
devices: i("devices"),
|
|
5096
|
-
deviceState: n(() =>
|
|
5097
|
-
subscribe:
|
|
5098
|
-
unsubscribe:
|
|
5099
|
-
loadDevices:
|
|
5100
|
-
removeDevice:
|
|
5105
|
+
deviceState: n(() => nr(t.value)),
|
|
5106
|
+
subscribe: _r.enable,
|
|
5107
|
+
unsubscribe: _r.disable,
|
|
5108
|
+
loadDevices: _r.loadDevices,
|
|
5109
|
+
removeDevice: _r.removeDevice
|
|
5101
5110
|
};
|
|
5102
5111
|
}
|
|
5103
5112
|
// src/NotificationPreferences.vue?vue&type=script&setup=true&lang.ts
|
|
5104
|
-
var
|
|
5113
|
+
var nl = { "data-inbox-preferences": "" }, rl = { class: "sr-only" }, il = { class: "sr-only" }, al = {
|
|
5105
5114
|
key: 0,
|
|
5106
5115
|
"data-inbox-preferences-global": ""
|
|
5107
|
-
},
|
|
5116
|
+
}, ol = [
|
|
5108
5117
|
"aria-checked",
|
|
5109
5118
|
"aria-label",
|
|
5110
5119
|
"data-inbox-preference-channel",
|
|
5111
5120
|
"onClick"
|
|
5112
|
-
],
|
|
5121
|
+
], sl = { key: 0 }, cl = ["data-inbox-preference-group"], ll = ["colspan"], ul = ["data-inbox-preference-category"], dl = [
|
|
5113
5122
|
"aria-checked",
|
|
5114
5123
|
"aria-disabled",
|
|
5115
5124
|
"aria-label",
|
|
5116
5125
|
"data-inbox-preference",
|
|
5117
5126
|
"onClick"
|
|
5118
|
-
],
|
|
5127
|
+
], fl = [
|
|
5119
5128
|
"value",
|
|
5120
5129
|
"disabled",
|
|
5121
5130
|
"aria-label",
|
|
5122
5131
|
"data-inbox-preference-frequency",
|
|
5123
5132
|
"onChange"
|
|
5124
|
-
],
|
|
5133
|
+
], pl = ["value"], ml = ["data-state", "aria-busy"], hl = {
|
|
5125
5134
|
"aria-live": "polite",
|
|
5126
5135
|
"data-inbox-push-device-status": ""
|
|
5127
|
-
},
|
|
5136
|
+
}, gl = ["aria-disabled"], _l = ["id"], vl = ["aria-labelledby"], yl = ["aria-label", "onClick"], bl = ["aria-checked", "aria-label"], xl = ["aria-label", "data-inbox-notification-hours-day"], Sl = [
|
|
5128
5137
|
"aria-checked",
|
|
5129
5138
|
"aria-disabled",
|
|
5130
5139
|
"aria-label",
|
|
5131
5140
|
"onClick"
|
|
5132
|
-
],
|
|
5141
|
+
], Cl = { class: "sr-only" }, wl = [
|
|
5133
5142
|
"value",
|
|
5134
5143
|
"disabled",
|
|
5135
5144
|
"onChange"
|
|
5136
|
-
],
|
|
5145
|
+
], Tl = { class: "sr-only" }, El = [
|
|
5137
5146
|
"value",
|
|
5138
5147
|
"disabled",
|
|
5139
5148
|
"onChange"
|
|
5140
|
-
],
|
|
5149
|
+
], Dl = [
|
|
5141
5150
|
"disabled",
|
|
5142
5151
|
"aria-label",
|
|
5143
5152
|
"onClick"
|
|
5144
|
-
],
|
|
5153
|
+
], Ol = [
|
|
5145
5154
|
"disabled",
|
|
5146
5155
|
"aria-label",
|
|
5147
5156
|
"onClick"
|
|
5148
|
-
],
|
|
5157
|
+
], kl = /* @__PURE__ */ u({
|
|
5149
5158
|
__name: "NotificationPreferences",
|
|
5150
5159
|
props: {
|
|
5151
5160
|
labels: { default: () => ({}) },
|
|
@@ -5153,7 +5162,7 @@ var tl = { "data-inbox-preferences": "" }, nl = { class: "sr-only" }, rl = { cla
|
|
|
5153
5162
|
locale: { default: void 0 }
|
|
5154
5163
|
},
|
|
5155
5164
|
setup(t) {
|
|
5156
|
-
let s = t, { status: u, channels: d, categories: f, sections: p, notificationHours: m, frequencies: g, load: _, setChannel: b, setFrequency: x, setNotificationHours: C, receives: E, frequencyApplies: k, isDisabled: M } =
|
|
5165
|
+
let s = t, { status: u, channels: d, categories: f, sections: p, notificationHours: m, frequencies: g, load: _, setChannel: b, setFrequency: x, setNotificationHours: C, receives: E, frequencyApplies: k, isDisabled: M } = el(), P = tl(), F = n(() => Zn(s.labels)), I = n(() => $n(d.value, f.value, g.value, F.value)), L = (e) => Z(F.value[e]), R = n(() => d.value.some((e) => e.push) ? rr({
|
|
5157
5166
|
available: P.available.value,
|
|
5158
5167
|
supported: P.supported.value,
|
|
5159
5168
|
permission: P.permission.value,
|
|
@@ -5161,18 +5170,18 @@ var tl = { "data-inbox-preferences": "" }, nl = { class: "sr-only" }, rl = { cla
|
|
|
5161
5170
|
busy: P.busy.value,
|
|
5162
5171
|
reason: P.reason.value,
|
|
5163
5172
|
request: P.request.value
|
|
5164
|
-
}) : null), z = D(0), B = n(() =>
|
|
5173
|
+
}) : null), z = D(0), B = n(() => vr(P.devices.value, F.value, z.value, s.locale)), ee = j(), V;
|
|
5165
5174
|
y(() => {
|
|
5166
|
-
V =
|
|
5175
|
+
V = Ut.subscribe(() => z.value = Ut.getSnapshot()), z.value = Ut.getSnapshot();
|
|
5167
5176
|
}), v(() => V?.()), N(() => R.value !== null, (e) => {
|
|
5168
5177
|
e && P.loadDevices();
|
|
5169
5178
|
}, { immediate: !0 });
|
|
5170
5179
|
let H = (e, t) => {
|
|
5171
5180
|
x(e.key, t.target.value);
|
|
5172
|
-
}, te = D(null), ne = n(() =>
|
|
5181
|
+
}, te = D(null), ne = n(() => Bn(m.value, te.value, s.locale)), re = (e) => {
|
|
5173
5182
|
e.currentTarget.contains(e.relatedTarget) || (te.value = null);
|
|
5174
5183
|
}, ie = (e) => {
|
|
5175
|
-
let t =
|
|
5184
|
+
let t = Vn(m.value, te.value, e);
|
|
5176
5185
|
t && (te.value = t.editing(te.value), C({ days: { [e.day]: t.ranges } }));
|
|
5177
5186
|
}, ae = (e, t, n, r) => ie({
|
|
5178
5187
|
kind: "time",
|
|
@@ -5181,59 +5190,59 @@ var tl = { "data-inbox-preferences": "" }, nl = { class: "sr-only" }, rl = { cla
|
|
|
5181
5190
|
field: n,
|
|
5182
5191
|
time: r.target.value
|
|
5183
5192
|
});
|
|
5184
|
-
return (t, n) => (S(), a("div",
|
|
5193
|
+
return (t, n) => (S(), a("div", nl, [
|
|
5185
5194
|
A(u) === "error" ? (S(), a("div", {
|
|
5186
5195
|
key: 0,
|
|
5187
5196
|
"data-inbox-preferences-error": "",
|
|
5188
|
-
class: h(
|
|
5197
|
+
class: h(io)
|
|
5189
5198
|
}, [o("p", null, O(L("error")), 1), o("button", {
|
|
5190
5199
|
type: "button",
|
|
5191
|
-
class: h(
|
|
5200
|
+
class: h(Ja),
|
|
5192
5201
|
onClick: n[0] ||= (...e) => A(_) && A(_)(...e)
|
|
5193
5202
|
}, O(L("retry")), 3)], 2)) : A(u) !== "ready" && A(f).length === 0 ? (S(), a("div", {
|
|
5194
5203
|
key: 1,
|
|
5195
5204
|
role: "status",
|
|
5196
|
-
class: h(
|
|
5205
|
+
class: h(io)
|
|
5197
5206
|
}, [l($, {
|
|
5198
5207
|
name: "spinner",
|
|
5199
5208
|
context: {
|
|
5200
5209
|
component: "NotificationPreferences",
|
|
5201
5210
|
part: "loading"
|
|
5202
5211
|
},
|
|
5203
|
-
class: h(
|
|
5204
|
-
}, null, 8, ["class"]), o("span",
|
|
5212
|
+
class: h(Mi)
|
|
5213
|
+
}, null, 8, ["class"]), o("span", rl, O(L("loading")), 1)], 2)) : A(f).length === 0 ? (S(), a("div", {
|
|
5205
5214
|
key: 2,
|
|
5206
5215
|
"data-inbox-preferences-empty": "",
|
|
5207
|
-
class: h(
|
|
5216
|
+
class: h(io)
|
|
5208
5217
|
}, [T(t.$slots, "empty", {}, () => [o("p", null, O(L("empty")), 1)])], 2)) : (S(), a("div", {
|
|
5209
5218
|
key: 3,
|
|
5210
|
-
class: h(
|
|
5211
|
-
}, [o("table", { class: h(A(J)(
|
|
5212
|
-
o("caption",
|
|
5219
|
+
class: h(so)
|
|
5220
|
+
}, [o("table", { class: h(A(J)(co, s.classes.table)) }, [
|
|
5221
|
+
o("caption", il, O(L("title")), 1),
|
|
5213
5222
|
o("thead", null, [o("tr", null, [
|
|
5214
5223
|
o("th", {
|
|
5215
5224
|
scope: "col",
|
|
5216
|
-
class: h(A(J)(
|
|
5225
|
+
class: h(A(J)(lo, s.classes.head))
|
|
5217
5226
|
}, O(L("category")), 3),
|
|
5218
5227
|
(S(!0), a(e, null, w(A(d), (e) => (S(), a("th", {
|
|
5219
5228
|
key: e.key,
|
|
5220
5229
|
scope: "col",
|
|
5221
|
-
class: h(A(J)(
|
|
5230
|
+
class: h(A(J)(uo, s.classes.head))
|
|
5222
5231
|
}, [T(t.$slots, "channel", { channel: e }, () => [c(O(e.label), 1)])], 2))), 128)),
|
|
5223
5232
|
I.value.hasFrequencies ? (S(), a("th", {
|
|
5224
5233
|
key: 0,
|
|
5225
5234
|
scope: "col",
|
|
5226
|
-
class: h(A(J)(
|
|
5235
|
+
class: h(A(J)(xo, s.classes.head))
|
|
5227
5236
|
}, O(L("frequency")), 3)) : i("", !0)
|
|
5228
5237
|
])]),
|
|
5229
|
-
I.value.hasGlobalSwitches ? (S(), a("tbody",
|
|
5238
|
+
I.value.hasGlobalSwitches ? (S(), a("tbody", al, [o("tr", { class: h(A(J)(fo, s.classes.row)) }, [
|
|
5230
5239
|
o("th", {
|
|
5231
5240
|
scope: "row",
|
|
5232
|
-
class: h(
|
|
5233
|
-
}, [o("span", { class: h(A(J)(
|
|
5241
|
+
class: h(ho)
|
|
5242
|
+
}, [o("span", { class: h(A(J)(go, s.classes.label)) }, O(L("global")), 3), o("span", { class: h(A(J)(yo, s.classes.description)) }, O(L("globalDescription")), 3)], 2),
|
|
5234
5243
|
(S(!0), a(e, null, w(A(d), (e) => (S(), a("td", {
|
|
5235
5244
|
key: e.key,
|
|
5236
|
-
class: h(
|
|
5245
|
+
class: h(bo)
|
|
5237
5246
|
}, [e.globalSwitch ? (S(), a("button", {
|
|
5238
5247
|
key: 0,
|
|
5239
5248
|
type: "button",
|
|
@@ -5244,49 +5253,49 @@ var tl = { "data-inbox-preferences": "" }, nl = { class: "sr-only" }, rl = { cla
|
|
|
5244
5253
|
channel: e.label
|
|
5245
5254
|
}),
|
|
5246
5255
|
"data-inbox-preference-channel": e.key,
|
|
5247
|
-
class: h(A(J)(
|
|
5256
|
+
class: h(A(J)(Go, s.classes.switch)),
|
|
5248
5257
|
onClick: (t) => A(b)(e.key, !e.enabled)
|
|
5249
5258
|
}, [o("span", {
|
|
5250
5259
|
"aria-hidden": "true",
|
|
5251
|
-
class: h(
|
|
5252
|
-
}, null, 2)], 10,
|
|
5253
|
-
I.value.hasFrequencies ? (S(), a("td",
|
|
5260
|
+
class: h(Ko)
|
|
5261
|
+
}, null, 2)], 10, ol)) : i("", !0)], 2))), 128)),
|
|
5262
|
+
I.value.hasFrequencies ? (S(), a("td", sl)) : i("", !0)
|
|
5254
5263
|
], 2)])) : i("", !0),
|
|
5255
5264
|
(S(!0), a(e, null, w(A(p), (n) => (S(), a("tbody", {
|
|
5256
5265
|
key: n.group?.key ?? "",
|
|
5257
5266
|
"data-inbox-preference-group": n.group?.key
|
|
5258
5267
|
}, [n.group ? (S(), a("tr", {
|
|
5259
5268
|
key: 0,
|
|
5260
|
-
class: h(
|
|
5269
|
+
class: h(fo)
|
|
5261
5270
|
}, [o("th", {
|
|
5262
5271
|
scope: "rowgroup",
|
|
5263
5272
|
colspan: I.value.columns,
|
|
5264
|
-
class: h(A(J)(
|
|
5265
|
-
}, [T(t.$slots, "group", { group: n.group }, () => [o("span", { class: h(
|
|
5273
|
+
class: h(A(J)(po, s.classes.group))
|
|
5274
|
+
}, [T(t.$slots, "group", { group: n.group }, () => [o("span", { class: h(mo) }, O(n.group.label), 3), n.group.description ? (S(), a("span", {
|
|
5266
5275
|
key: 0,
|
|
5267
|
-
class: h(A(J)(
|
|
5268
|
-
}, O(n.group.description), 3)) : i("", !0)])], 10,
|
|
5276
|
+
class: h(A(J)(yo, s.classes.description))
|
|
5277
|
+
}, O(n.group.description), 3)) : i("", !0)])], 10, ll)], 2)) : i("", !0), (S(!0), a(e, null, w(n.categories, (n) => (S(), a("tr", {
|
|
5269
5278
|
key: n.key,
|
|
5270
5279
|
"data-inbox-preference-category": n.key,
|
|
5271
|
-
class: h(A(J)(
|
|
5280
|
+
class: h(A(J)(fo, s.classes.row))
|
|
5272
5281
|
}, [
|
|
5273
5282
|
o("th", {
|
|
5274
5283
|
scope: "row",
|
|
5275
|
-
class: h(
|
|
5284
|
+
class: h(ho)
|
|
5276
5285
|
}, [T(t.$slots, "category", { category: n }, () => [
|
|
5277
|
-
o("span", { class: h(A(J)(
|
|
5286
|
+
o("span", { class: h(A(J)(_o, s.classes.label)) }, O(n.label), 3),
|
|
5278
5287
|
n.locked ? (S(), a("span", {
|
|
5279
5288
|
key: 0,
|
|
5280
|
-
class: h(A(J)(
|
|
5289
|
+
class: h(A(J)(vo, s.classes.badge))
|
|
5281
5290
|
}, O(L("locked")), 3)) : i("", !0),
|
|
5282
5291
|
n.description ? (S(), a("span", {
|
|
5283
5292
|
key: 1,
|
|
5284
|
-
class: h(A(J)(
|
|
5293
|
+
class: h(A(J)(yo, s.classes.description))
|
|
5285
5294
|
}, O(n.description), 3)) : i("", !0)
|
|
5286
5295
|
])], 2),
|
|
5287
5296
|
(S(!0), a(e, null, w(A(d), (e) => (S(), a("td", {
|
|
5288
5297
|
key: e.key,
|
|
5289
|
-
class: h(
|
|
5298
|
+
class: h(bo)
|
|
5290
5299
|
}, [n.channels[e.key] === void 0 ? i("", !0) : (S(), a("button", {
|
|
5291
5300
|
key: 0,
|
|
5292
5301
|
type: "button",
|
|
@@ -5298,48 +5307,48 @@ var tl = { "data-inbox-preferences": "" }, nl = { class: "sr-only" }, rl = { cla
|
|
|
5298
5307
|
channel: e.label
|
|
5299
5308
|
}),
|
|
5300
5309
|
"data-inbox-preference": `${n.key}.${e.key}`,
|
|
5301
|
-
class: h(A(J)(
|
|
5302
|
-
onClick: (t) => A(
|
|
5310
|
+
class: h(A(J)(Go, s.classes.switch)),
|
|
5311
|
+
onClick: (t) => A(er)(n, e, A(d))
|
|
5303
5312
|
}, [o("span", {
|
|
5304
5313
|
"aria-hidden": "true",
|
|
5305
|
-
class: h(
|
|
5306
|
-
}, null, 2)], 10,
|
|
5314
|
+
class: h(Ko)
|
|
5315
|
+
}, null, 2)], 10, dl))], 2))), 128)),
|
|
5307
5316
|
I.value.hasFrequencies ? (S(), a("td", {
|
|
5308
5317
|
key: 0,
|
|
5309
|
-
class: h(
|
|
5318
|
+
class: h(So)
|
|
5310
5319
|
}, [n.frequency === null ? i("", !0) : (S(), a("select", {
|
|
5311
5320
|
key: 0,
|
|
5312
5321
|
value: n.frequency,
|
|
5313
5322
|
disabled: !A(k)(n, A(d)),
|
|
5314
5323
|
"aria-label": A(Z)(F.value.frequencyLabel, { category: n.label }),
|
|
5315
5324
|
"data-inbox-preference-frequency": n.key,
|
|
5316
|
-
class: h(A(J)(
|
|
5325
|
+
class: h(A(J)(Wo, s.classes.select)),
|
|
5317
5326
|
onChange: (e) => H(n, e)
|
|
5318
5327
|
}, [(S(!0), a(e, null, w(I.value.frequencyOptions, (e) => (S(), a("option", {
|
|
5319
5328
|
key: e.value,
|
|
5320
5329
|
value: e.value
|
|
5321
|
-
}, O(e.label), 9,
|
|
5322
|
-
], 10,
|
|
5330
|
+
}, O(e.label), 9, pl))), 128))], 42, fl))], 2)) : i("", !0)
|
|
5331
|
+
], 10, ul))), 128))], 8, cl))), 128))
|
|
5323
5332
|
], 2)], 2)),
|
|
5324
5333
|
R.value !== null && A(u) !== "error" && A(f).length > 0 ? (S(), a("div", {
|
|
5325
5334
|
key: 4,
|
|
5326
5335
|
"data-inbox-push-device": "",
|
|
5327
5336
|
"data-state": R.value.state,
|
|
5328
5337
|
"aria-busy": R.value.state === "busy" ? "true" : void 0,
|
|
5329
|
-
class: h(
|
|
5330
|
-
}, [o("div", { class: h(
|
|
5338
|
+
class: h(Co)
|
|
5339
|
+
}, [o("div", { class: h(To) }, [o("div", { class: h(Eo) }, [o("span", { class: h(A(J)(go, s.classes.label)) }, O(L("pushDevice")), 3), o("div", hl, [R.value.hint ? (S(), a("p", {
|
|
5331
5340
|
key: 0,
|
|
5332
|
-
class: h(A(J)(
|
|
5341
|
+
class: h(A(J)(Do, s.classes.description))
|
|
5333
5342
|
}, O(L(R.value.text)), 3)) : (S(), a("span", {
|
|
5334
5343
|
key: 1,
|
|
5335
|
-
class: h(A(J)(
|
|
5344
|
+
class: h(A(J)(yo, s.classes.description))
|
|
5336
5345
|
}, O(L(R.value.text)), 3))])], 2), R.value.button ? (S(), a("button", {
|
|
5337
5346
|
key: 0,
|
|
5338
5347
|
type: "button",
|
|
5339
5348
|
"aria-disabled": R.value.state === "busy" || void 0,
|
|
5340
5349
|
"data-inbox-push-device-button": "",
|
|
5341
|
-
class: h(A(J)(R.value.button.primary ?
|
|
5342
|
-
onClick: n[1] ||= (e) => A(
|
|
5350
|
+
class: h(A(J)(R.value.button.primary ? qa : Ja, Oo)),
|
|
5351
|
+
onClick: n[1] ||= (e) => A(yr)(R.value)
|
|
5343
5352
|
}, [R.value.state === "busy" ? (S(), r($, {
|
|
5344
5353
|
key: 0,
|
|
5345
5354
|
name: "spinner",
|
|
@@ -5347,94 +5356,94 @@ var tl = { "data-inbox-preferences": "" }, nl = { class: "sr-only" }, rl = { cla
|
|
|
5347
5356
|
component: "NotificationPreferences",
|
|
5348
5357
|
part: "push-busy"
|
|
5349
5358
|
},
|
|
5350
|
-
class: h(
|
|
5351
|
-
}, null, 8, ["class"])) : i("", !0), c(" " + O(L(R.value.button.label)), 1)], 10,
|
|
5359
|
+
class: h(Bi)
|
|
5360
|
+
}, null, 8, ["class"])) : i("", !0), c(" " + O(L(R.value.button.label)), 1)], 10, gl)) : i("", !0)], 2), B.value.length > 0 ? (S(), a("div", {
|
|
5352
5361
|
key: 0,
|
|
5353
5362
|
"data-inbox-push-other-devices": "",
|
|
5354
|
-
class: h(
|
|
5363
|
+
class: h(ko)
|
|
5355
5364
|
}, [o("p", {
|
|
5356
5365
|
id: A(ee),
|
|
5357
|
-
class: h(ko)
|
|
5358
|
-
}, O(L("pushDevices")), 11, gl), o("ul", {
|
|
5359
|
-
"aria-labelledby": A(ee),
|
|
5360
5366
|
class: h(Ao)
|
|
5367
|
+
}, O(L("pushDevices")), 11, _l), o("ul", {
|
|
5368
|
+
"aria-labelledby": A(ee),
|
|
5369
|
+
class: h(jo)
|
|
5361
5370
|
}, [(S(!0), a(e, null, w(B.value, (e) => (S(), a("li", {
|
|
5362
5371
|
key: e.id,
|
|
5363
5372
|
"data-inbox-push-other-device": "",
|
|
5364
|
-
class: h(
|
|
5365
|
-
}, [o("div", { class: h(
|
|
5373
|
+
class: h(Mo)
|
|
5374
|
+
}, [o("div", { class: h(wo) }, [o("span", { class: h(A(J)(go, s.classes.label)) }, O(e.name), 3), o("span", { class: h(A(J)(yo, s.classes.description)) }, O(e.active), 3)], 2), o("button", {
|
|
5366
5375
|
type: "button",
|
|
5367
5376
|
"aria-label": e.removeLabel,
|
|
5368
5377
|
"data-inbox-push-other-device-remove": "",
|
|
5369
|
-
class: h(A(J)(
|
|
5378
|
+
class: h(A(J)(Ja, Oo)),
|
|
5370
5379
|
onClick: (t) => A(P).removeDevice(e.id)
|
|
5371
|
-
}, O(L("pushDeviceRemove")), 11,
|
|
5380
|
+
}, O(L("pushDeviceRemove")), 11, yl)], 2))), 128))], 10, vl)], 2)) : i("", !0)], 10, ml)) : i("", !0),
|
|
5372
5381
|
A(m) !== null && A(u) !== "error" && A(f).length > 0 ? (S(), a("div", {
|
|
5373
5382
|
key: 5,
|
|
5374
5383
|
"data-inbox-preferences-notification-hours": "",
|
|
5375
|
-
class: h(
|
|
5376
|
-
}, [o("div", { class: h(
|
|
5384
|
+
class: h(No)
|
|
5385
|
+
}, [o("div", { class: h(Po) }, [o("button", {
|
|
5377
5386
|
type: "button",
|
|
5378
5387
|
role: "switch",
|
|
5379
5388
|
"aria-checked": A(m).enabled ? "true" : "false",
|
|
5380
5389
|
"aria-label": L("notificationHours"),
|
|
5381
5390
|
"data-inbox-notification-hours": "",
|
|
5382
|
-
class: h(A(J)(
|
|
5391
|
+
class: h(A(J)(Go, s.classes.switch)),
|
|
5383
5392
|
onClick: n[2] ||= (e) => A(C)({ enabled: !A(m).enabled })
|
|
5384
5393
|
}, [o("span", {
|
|
5385
5394
|
"aria-hidden": "true",
|
|
5386
|
-
class: h(
|
|
5387
|
-
}, null, 2)], 10,
|
|
5395
|
+
class: h(Ko)
|
|
5396
|
+
}, null, 2)], 10, bl), o("div", null, [o("span", { class: h(A(J)(go, s.classes.label)) }, O(L("notificationHours")), 3), o("span", { class: h(A(J)(yo, s.classes.description)) }, O(L("notificationHoursDescription")), 3)])], 2), o("div", { class: h(Fo) }, [(S(!0), a(e, null, w(ne.value, (t) => (S(), a("div", {
|
|
5388
5397
|
key: t.day,
|
|
5389
5398
|
role: "group",
|
|
5390
5399
|
"aria-label": t.name,
|
|
5391
5400
|
"data-inbox-notification-hours-day": t.day,
|
|
5392
|
-
class: h(
|
|
5401
|
+
class: h(Io),
|
|
5393
5402
|
onFocusout: re
|
|
5394
|
-
}, [o("div", { class: h(
|
|
5403
|
+
}, [o("div", { class: h(Lo) }, [o("button", {
|
|
5395
5404
|
type: "button",
|
|
5396
5405
|
role: "switch",
|
|
5397
5406
|
"aria-checked": t.ranges.length > 0 ? "true" : "false",
|
|
5398
5407
|
"aria-disabled": t.locked || void 0,
|
|
5399
5408
|
"aria-label": A(Z)(F.value.notificationHoursDay, { day: t.name }),
|
|
5400
5409
|
"data-inbox-notification-hours-day-switch": "",
|
|
5401
|
-
class: h(A(J)(
|
|
5410
|
+
class: h(A(J)(Go, s.classes.switch)),
|
|
5402
5411
|
onClick: (e) => ie({
|
|
5403
5412
|
kind: "toggle",
|
|
5404
5413
|
day: t.day
|
|
5405
5414
|
})
|
|
5406
5415
|
}, [o("span", {
|
|
5407
5416
|
"aria-hidden": "true",
|
|
5408
|
-
class: h(
|
|
5409
|
-
}, null, 2)], 10,
|
|
5417
|
+
class: h(Ko)
|
|
5418
|
+
}, null, 2)], 10, Sl), o("span", null, O(t.name), 1)], 2), t.ranges.length > 0 ? (S(), a("div", {
|
|
5410
5419
|
key: 0,
|
|
5411
|
-
class: h(
|
|
5420
|
+
class: h(Ro)
|
|
5412
5421
|
}, [(S(!0), a(e, null, w(t.ranges, ([e, n], r) => (S(), a("div", {
|
|
5413
5422
|
key: r,
|
|
5414
|
-
class: h(
|
|
5423
|
+
class: h(zo)
|
|
5415
5424
|
}, [
|
|
5416
|
-
o("label", { class: h(
|
|
5425
|
+
o("label", { class: h(Ho) }, [o("span", Cl, O(L("notificationHoursStart")), 1), o("input", {
|
|
5417
5426
|
type: "time",
|
|
5418
5427
|
required: "",
|
|
5419
5428
|
value: e,
|
|
5420
5429
|
disabled: !A(m).enabled,
|
|
5421
5430
|
"data-inbox-notification-hours-start": "",
|
|
5422
|
-
class: h(A(J)(
|
|
5431
|
+
class: h(A(J)(Uo, s.classes.time)),
|
|
5423
5432
|
onChange: (e) => ae(t.day, r, "start", e)
|
|
5424
|
-
}, null, 42,
|
|
5433
|
+
}, null, 42, wl)], 2),
|
|
5425
5434
|
o("span", {
|
|
5426
5435
|
"aria-hidden": "true",
|
|
5427
|
-
class: h(
|
|
5436
|
+
class: h(Ho)
|
|
5428
5437
|
}, "–", 2),
|
|
5429
|
-
o("label", { class: h(
|
|
5438
|
+
o("label", { class: h(Ho) }, [o("span", Tl, O(L("notificationHoursEnd")), 1), o("input", {
|
|
5430
5439
|
type: "time",
|
|
5431
5440
|
required: "",
|
|
5432
5441
|
value: n,
|
|
5433
5442
|
disabled: !A(m).enabled,
|
|
5434
5443
|
"data-inbox-notification-hours-end": "",
|
|
5435
|
-
class: h(A(J)(
|
|
5444
|
+
class: h(A(J)(Uo, s.classes.time)),
|
|
5436
5445
|
onChange: (e) => ae(t.day, r, "end", e)
|
|
5437
|
-
}, null, 42,
|
|
5446
|
+
}, null, 42, El)], 2),
|
|
5438
5447
|
t.ranges.length > 1 ? (S(), a("button", {
|
|
5439
5448
|
key: 0,
|
|
5440
5449
|
type: "button",
|
|
@@ -5445,37 +5454,37 @@ var tl = { "data-inbox-preferences": "" }, nl = { class: "sr-only" }, rl = { cla
|
|
|
5445
5454
|
day: t.name
|
|
5446
5455
|
}),
|
|
5447
5456
|
"data-inbox-notification-hours-remove": "",
|
|
5448
|
-
class: h(
|
|
5457
|
+
class: h(Vo),
|
|
5449
5458
|
onClick: (e) => ie({
|
|
5450
5459
|
kind: "remove",
|
|
5451
5460
|
day: t.day,
|
|
5452
5461
|
index: r
|
|
5453
5462
|
})
|
|
5454
|
-
}, O(L("notificationHoursRemove")), 11,
|
|
5463
|
+
}, O(L("notificationHoursRemove")), 11, Dl)) : i("", !0),
|
|
5455
5464
|
r === t.ranges.length - 1 ? (S(), a("button", {
|
|
5456
5465
|
key: 1,
|
|
5457
5466
|
type: "button",
|
|
5458
5467
|
disabled: !t.canAdd,
|
|
5459
5468
|
"aria-label": A(Z)(F.value.notificationHoursAddLabel, { day: t.name }),
|
|
5460
5469
|
"data-inbox-notification-hours-add": "",
|
|
5461
|
-
class: h(
|
|
5470
|
+
class: h(Vo),
|
|
5462
5471
|
onClick: (e) => ie({
|
|
5463
5472
|
kind: "add",
|
|
5464
5473
|
day: t.day
|
|
5465
5474
|
})
|
|
5466
|
-
}, O(L("notificationHoursAdd")), 11,
|
|
5475
|
+
}, O(L("notificationHoursAdd")), 11, Ol)) : i("", !0)
|
|
5467
5476
|
], 2))), 128))], 2)) : (S(), a("p", {
|
|
5468
5477
|
key: 1,
|
|
5469
|
-
class: h(
|
|
5470
|
-
}, O(L("notificationHoursOff")), 3))], 42,
|
|
5478
|
+
class: h(Bo)
|
|
5479
|
+
}, O(L("notificationHoursOff")), 3))], 42, xl))), 128))], 2)], 2)) : i("", !0)
|
|
5471
5480
|
]));
|
|
5472
5481
|
}
|
|
5473
5482
|
});
|
|
5474
5483
|
// src/useNotifications.ts
|
|
5475
|
-
function
|
|
5484
|
+
function Al() {
|
|
5476
5485
|
let e = B(), t = D(X.getServerSnapshot()), r;
|
|
5477
5486
|
y(() => {
|
|
5478
|
-
|
|
5487
|
+
$o(), r = X.subscribe(() => t.value = X.getSnapshot()), Bt(e.props), t.value = X.getSnapshot();
|
|
5479
5488
|
}), v(() => r?.());
|
|
5480
5489
|
let i = (e) => n(() => t.value[e]);
|
|
5481
5490
|
return {
|
|
@@ -5501,31 +5510,31 @@ function kl() {
|
|
|
5501
5510
|
pausedUntil: i("pausedUntil"),
|
|
5502
5511
|
canPause: i("canPause"),
|
|
5503
5512
|
pausePresets: i("pausePresets"),
|
|
5504
|
-
...
|
|
5505
|
-
toast:
|
|
5513
|
+
...zt,
|
|
5514
|
+
toast: di
|
|
5506
5515
|
};
|
|
5507
5516
|
}
|
|
5508
5517
|
// src/useToasts.ts
|
|
5509
|
-
var
|
|
5510
|
-
function
|
|
5511
|
-
let t = B(), r = D(
|
|
5518
|
+
var jl = [];
|
|
5519
|
+
function Ml(e) {
|
|
5520
|
+
let t = B(), r = D(jl), i = D(kr()), a = jr(), o, s;
|
|
5512
5521
|
return y(() => {
|
|
5513
|
-
|
|
5514
|
-
r.value = Q.getSnapshot(), i.value =
|
|
5515
|
-
}), s = N(() => k(e), (e, t, n) => n(Q.attach(e)), { immediate: !0 }),
|
|
5522
|
+
$o(), o = Q.subscribe(() => {
|
|
5523
|
+
r.value = Q.getSnapshot(), i.value = kr();
|
|
5524
|
+
}), s = N(() => k(e), (e, t, n) => n(Q.attach(e)), { immediate: !0 }), zr(t.flash), r.value = Q.getSnapshot(), i.value = kr();
|
|
5516
5525
|
}), v(() => {
|
|
5517
5526
|
o?.(), s?.(), a.release();
|
|
5518
5527
|
}), {
|
|
5519
5528
|
toasts: n(() => r.value.filter((t) => t.toaster === k(e))),
|
|
5520
|
-
toast:
|
|
5529
|
+
toast: di,
|
|
5521
5530
|
update: Q.update,
|
|
5522
5531
|
dismiss: Q.dismiss,
|
|
5523
5532
|
pause: a.pause,
|
|
5524
5533
|
resume: a.resume,
|
|
5525
5534
|
timer: (e) => (i.value, Q.timer(e)),
|
|
5526
|
-
runAction: (e, t, n) => n ?
|
|
5535
|
+
runAction: (e, t, n) => n ? ai(e, t, n) : ii(e, t)
|
|
5527
5536
|
};
|
|
5528
5537
|
}
|
|
5529
5538
|
// src/iconResolver.ts
|
|
5530
|
-
var
|
|
5531
|
-
export {
|
|
5539
|
+
var Nl = Be, Pl = Ve;
|
|
5540
|
+
export { Wr as DEFAULT_ERROR_MESSAGES, qt as DEFAULT_INBOX_LABELS, Yn as DEFAULT_PREFERENCES_LABELS, Xc as NotificationCenter, Oc as NotificationItem, $c as NotificationList, kl as NotificationPreferences, us as Toaster, jt as groupItems, X as inboxStore, $o as initNotifications, st as isSnoozed, Ft as pauseEnd, Lt as pauseTime, Qn as preferencesStore, Wt as relativeTime, dn as requestNotificationPermission, Pl as resolveIcon, Nl as setIconResolver, Ge as setTranslations, Mt as snoozeOptions, di as toast, Je as trans, Al as useNotifications, el as usePreferences, tl as usePush, Ml as useToasts };
|