@edusight/notification-widget 1.0.45 → 1.0.46
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/{components-DUT08KJF.js → components-B4vlr39f.js} +349 -350
- package/dist/{components-DUT08KJF.js.map → components-B4vlr39f.js.map} +1 -1
- package/dist/{components-CJcM_JjP.cjs → components-nLbNGQuo.cjs} +14 -14
- package/dist/{components-CJcM_JjP.cjs.map → components-nLbNGQuo.cjs.map} +1 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.esm.js +342 -279
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import C, { Component as
|
|
2
|
-
import { jsxs as
|
|
3
|
-
var
|
|
1
|
+
import C, { Component as de, useState as k, useRef as j, useEffect as R, useCallback as z, useMemo as ee } from "react";
|
|
2
|
+
import { jsxs as l, jsx as t, Fragment as H } from "react/jsx-runtime";
|
|
3
|
+
var te = {
|
|
4
4
|
color: void 0,
|
|
5
5
|
size: void 0,
|
|
6
6
|
className: void 0,
|
|
7
7
|
style: void 0,
|
|
8
8
|
attr: void 0
|
|
9
|
-
},
|
|
10
|
-
function
|
|
9
|
+
}, K = C.createContext && /* @__PURE__ */ C.createContext(te), ue = ["attr", "size", "title"];
|
|
10
|
+
function he(e, r) {
|
|
11
11
|
if (e == null) return {};
|
|
12
|
-
var a =
|
|
12
|
+
var a = me(e, r), n, i;
|
|
13
13
|
if (Object.getOwnPropertySymbols) {
|
|
14
|
-
var
|
|
15
|
-
for (i = 0; i <
|
|
16
|
-
n =
|
|
14
|
+
var s = Object.getOwnPropertySymbols(e);
|
|
15
|
+
for (i = 0; i < s.length; i++)
|
|
16
|
+
n = s[i], !(r.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(e, n) && (a[n] = e[n]);
|
|
17
17
|
}
|
|
18
18
|
return a;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function me(e, r) {
|
|
21
21
|
if (e == null) return {};
|
|
22
22
|
var a = {};
|
|
23
23
|
for (var n in e)
|
|
@@ -37,7 +37,7 @@ function L() {
|
|
|
37
37
|
return e;
|
|
38
38
|
}, L.apply(this, arguments);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function q(e, r) {
|
|
41
41
|
var a = Object.keys(e);
|
|
42
42
|
if (Object.getOwnPropertySymbols) {
|
|
43
43
|
var n = Object.getOwnPropertySymbols(e);
|
|
@@ -50,22 +50,22 @@ function K(e, r) {
|
|
|
50
50
|
function T(e) {
|
|
51
51
|
for (var r = 1; r < arguments.length; r++) {
|
|
52
52
|
var a = arguments[r] != null ? arguments[r] : {};
|
|
53
|
-
r % 2 ?
|
|
54
|
-
|
|
55
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(a)) :
|
|
53
|
+
r % 2 ? q(Object(a), !0).forEach(function(n) {
|
|
54
|
+
ge(e, n, a[n]);
|
|
55
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(a)) : q(Object(a)).forEach(function(n) {
|
|
56
56
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(a, n));
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
return e;
|
|
60
60
|
}
|
|
61
|
-
function
|
|
62
|
-
return r =
|
|
61
|
+
function ge(e, r, a) {
|
|
62
|
+
return r = fe(r), r in e ? Object.defineProperty(e, r, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = a, e;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
var r =
|
|
64
|
+
function fe(e) {
|
|
65
|
+
var r = pe(e, "string");
|
|
66
66
|
return typeof r == "symbol" ? r : r + "";
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function pe(e, r) {
|
|
69
69
|
if (typeof e != "object" || !e) return e;
|
|
70
70
|
var a = e[Symbol.toPrimitive];
|
|
71
71
|
if (a !== void 0) {
|
|
@@ -75,52 +75,52 @@ function fe(e, r) {
|
|
|
75
75
|
}
|
|
76
76
|
return (r === "string" ? String : Number)(e);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function re(e) {
|
|
79
79
|
return e && e.map((r, a) => /* @__PURE__ */ C.createElement(r.tag, T({
|
|
80
80
|
key: a
|
|
81
|
-
}, r.attr),
|
|
81
|
+
}, r.attr), re(r.child)));
|
|
82
82
|
}
|
|
83
83
|
function v(e) {
|
|
84
|
-
return (r) => /* @__PURE__ */ C.createElement(
|
|
84
|
+
return (r) => /* @__PURE__ */ C.createElement(ve, L({
|
|
85
85
|
attr: T({}, e.attr)
|
|
86
|
-
}, r),
|
|
86
|
+
}, r), re(e.child));
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function ve(e) {
|
|
89
89
|
var r = (a) => {
|
|
90
90
|
var {
|
|
91
91
|
attr: n,
|
|
92
92
|
size: i,
|
|
93
|
-
title:
|
|
94
|
-
} = e,
|
|
93
|
+
title: s
|
|
94
|
+
} = e, m = he(e, ue), u = i || a.size || "1em", c;
|
|
95
95
|
return a.className && (c = a.className), e.className && (c = (c ? c + " " : "") + e.className), /* @__PURE__ */ C.createElement("svg", L({
|
|
96
96
|
stroke: "currentColor",
|
|
97
97
|
fill: "currentColor",
|
|
98
98
|
strokeWidth: "0"
|
|
99
|
-
}, a.attr, n,
|
|
99
|
+
}, a.attr, n, m, {
|
|
100
100
|
className: c,
|
|
101
101
|
style: T(T({
|
|
102
102
|
color: e.color || a.color
|
|
103
103
|
}, a.style), e.style),
|
|
104
|
-
height:
|
|
105
|
-
width:
|
|
104
|
+
height: u,
|
|
105
|
+
width: u,
|
|
106
106
|
xmlns: "http://www.w3.org/2000/svg"
|
|
107
|
-
}),
|
|
107
|
+
}), s && /* @__PURE__ */ C.createElement("title", null, s), e.children);
|
|
108
108
|
};
|
|
109
|
-
return
|
|
109
|
+
return K !== void 0 ? /* @__PURE__ */ C.createElement(K.Consumer, null, (a) => r(a)) : r(te);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function be(e) {
|
|
112
112
|
return v({ attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M257 120.471c7.083 0 23.911 4.479 23.911 4.479 45.589 10.447 77.678 52.439 77.678 99.85V352.412l9.321 9.364 7.788 7.823H136.302l7.788-7.823 9.321-9.364V224.8c0-47.41 32.089-89.403 77.678-99.85 0 0 18.043-4.479 23.911-4.479M256 48c-17.602 0-31.059 13.518-31.059 31.2v14.559c-59.015 13.523-103.53 67.601-103.53 131.041v114.4L80 380.8v20.8h352v-20.8l-41.411-41.6V224.8c0-63.44-44.516-117.518-103.53-131.041V79.2c0-17.682-13.457-31.2-31.059-31.2zm41.411 374.4h-82.823c0 22.881 18.633 41.6 41.412 41.6s41.411-18.719 41.411-41.6z" }, child: [] }] })(e);
|
|
113
113
|
}
|
|
114
|
-
const
|
|
114
|
+
const We = ({
|
|
115
115
|
unreadCount: e,
|
|
116
116
|
onClick: r,
|
|
117
117
|
className: a = "",
|
|
118
118
|
disabled: n = !1
|
|
119
119
|
}) => {
|
|
120
|
-
const i = (c) => c === 0 ? "" : c > 99 ? "99+" : c.toString(),
|
|
120
|
+
const i = (c) => c === 0 ? "" : c > 99 ? "99+" : c.toString(), s = (c) => {
|
|
121
121
|
n || (c.key === "Enter" || c.key === " ") && (c.preventDefault(), r());
|
|
122
|
-
},
|
|
123
|
-
return /* @__PURE__ */
|
|
122
|
+
}, m = i(e), u = e > 0;
|
|
123
|
+
return /* @__PURE__ */ l(
|
|
124
124
|
"button",
|
|
125
125
|
{
|
|
126
126
|
type: "button",
|
|
@@ -138,17 +138,17 @@ const Ue = ({
|
|
|
138
138
|
${a}
|
|
139
139
|
`,
|
|
140
140
|
onClick: r,
|
|
141
|
-
onKeyDown:
|
|
141
|
+
onKeyDown: s,
|
|
142
142
|
disabled: n,
|
|
143
|
-
"aria-label":
|
|
143
|
+
"aria-label": u ? `Notifications (${e} unread)` : "Notifications",
|
|
144
144
|
"aria-expanded": !1,
|
|
145
145
|
"aria-haspopup": "dialog",
|
|
146
146
|
"data-testid": "bell-component",
|
|
147
147
|
"data-mx-widget": "bell",
|
|
148
148
|
children: [
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */ t(
|
|
151
|
-
|
|
149
|
+
/* @__PURE__ */ l("div", { className: "relative inline-flex items-center justify-center text-align-center", children: [
|
|
150
|
+
/* @__PURE__ */ t(be, { className: "w-6 h-6" }),
|
|
151
|
+
u && /* @__PURE__ */ t(
|
|
152
152
|
"span",
|
|
153
153
|
{
|
|
154
154
|
className: `
|
|
@@ -166,16 +166,16 @@ const Ue = ({
|
|
|
166
166
|
"aria-hidden": "true",
|
|
167
167
|
"data-testid": "unread-badge",
|
|
168
168
|
style: { marginTop: "-25px", marginRight: "-25px" },
|
|
169
|
-
children:
|
|
169
|
+
children: m
|
|
170
170
|
}
|
|
171
171
|
)
|
|
172
172
|
] }),
|
|
173
|
-
/* @__PURE__ */ t("span", { className: "sr-only", children:
|
|
173
|
+
/* @__PURE__ */ t("span", { className: "sr-only", children: u ? `${e} unread notifications` : "No unread notifications" })
|
|
174
174
|
]
|
|
175
175
|
}
|
|
176
176
|
);
|
|
177
177
|
};
|
|
178
|
-
class
|
|
178
|
+
class G extends de {
|
|
179
179
|
constructor(r) {
|
|
180
180
|
super(r), this.state = {
|
|
181
181
|
hasError: !1,
|
|
@@ -198,7 +198,7 @@ class q extends ce {
|
|
|
198
198
|
{
|
|
199
199
|
className: "p-2 text-sm text-gray-500 bg-gray-50 border border-gray-200 rounded",
|
|
200
200
|
"data-testid": "component-error-fallback",
|
|
201
|
-
children: /* @__PURE__ */
|
|
201
|
+
children: /* @__PURE__ */ l("span", { children: [
|
|
202
202
|
"Unable to load ",
|
|
203
203
|
this.props.componentName || "component"
|
|
204
204
|
] })
|
|
@@ -209,64 +209,64 @@ class q extends ce {
|
|
|
209
209
|
function V(e) {
|
|
210
210
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }, child: [] }] })(e);
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function xe(e) {
|
|
213
213
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z" }, child: [] }] })(e);
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function we(e) {
|
|
216
216
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" }, child: [] }] })(e);
|
|
217
217
|
}
|
|
218
|
-
function
|
|
218
|
+
function ae(e) {
|
|
219
219
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.488.488 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 0 0-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z" }, child: [] }] })(e);
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function Ke(e) {
|
|
222
222
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" }, child: [] }] })(e);
|
|
223
223
|
}
|
|
224
|
-
function
|
|
224
|
+
function ye(e) {
|
|
225
225
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z" }, child: [] }] })(e);
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function Ne(e) {
|
|
228
228
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z" }, child: [] }] })(e);
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function ne(e) {
|
|
231
231
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m20.54 5.23-1.39-1.68C18.88 3.21 18.47 3 18 3H6c-.47 0-.88.21-1.16.55L3.46 5.23C3.17 5.57 3 6.02 3 6.5V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6.5c0-.48-.17-.93-.46-1.27zM12 17.5 6.5 12H10v-2h4v2h3.5L12 17.5zM5.12 5l.81-1h12l.94 1H5.12z" }, child: [] }] })(e);
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function ke(e) {
|
|
234
234
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z" }, child: [] }, { tag: "path", attr: { d: "M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z" }, child: [] }] })(e);
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function Ce(e) {
|
|
237
237
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M17 1.01 7 1c-1.1 0-2 .9-2 2v18c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V3c0-1.1-.9-1.99-2-1.99zM17 19H7V5h10v14z" }, child: [] }] })(e);
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function Me(e) {
|
|
240
240
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m21.41 11.58-9-9C12.05 2.22 11.55 2 11 2H4c-1.1 0-2 .9-2 2v7c0 .55.22 1.05.59 1.42l9 9c.36.36.86.58 1.41.58.55 0 1.05-.22 1.41-.59l7-7c.37-.36.59-.86.59-1.41 0-.55-.23-1.06-.59-1.42zM5.5 7C4.67 7 4 6.33 4 5.5S4.67 4 5.5 4 7 4.67 7 5.5 6.33 7 5.5 7z" }, child: [] }] })(e);
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function ze(e) {
|
|
243
243
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" }, child: [] }] })(e);
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function ie(e) {
|
|
246
246
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }, child: [] }] })(e);
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function je(e) {
|
|
249
249
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z" }, child: [] }] })(e);
|
|
250
250
|
}
|
|
251
|
-
function
|
|
251
|
+
function Ee(e) {
|
|
252
252
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }, child: [] }] })(e);
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function qe(e) {
|
|
255
255
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M17.65 6.35A7.958 7.958 0 0 0 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35z" }, child: [] }] })(e);
|
|
256
256
|
}
|
|
257
|
-
function
|
|
257
|
+
function He(e) {
|
|
258
258
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM9 11H7V9h2v2zm4 0h-2V9h2v2zm4 0h-2V9h2v2z" }, child: [] }] })(e);
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function J(e) {
|
|
261
261
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22c1.1 0 2-.9 2-2h-4a2 2 0 0 0 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z" }, child: [] }] })(e);
|
|
262
262
|
}
|
|
263
|
-
function
|
|
263
|
+
function Le(e) {
|
|
264
264
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z" }, child: [] }, { tag: "path", attr: { d: "M14 17H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z" }, child: [] }] })(e);
|
|
265
265
|
}
|
|
266
|
-
function
|
|
266
|
+
function se(e) {
|
|
267
267
|
return v({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0V0z" }, child: [] }, { tag: "path", attr: { d: "M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z" }, child: [] }] })(e);
|
|
268
268
|
}
|
|
269
|
-
const
|
|
269
|
+
const Te = ({ onRetry: e, error: r }) => /* @__PURE__ */ l("div", { className: "p-3 text-center", "data-testid": "notifications-fallback", children: [
|
|
270
270
|
/* @__PURE__ */ t("div", { className: "text-[var(--widget-text-tertiary)] mb-2", children: /* @__PURE__ */ t(V, { className: "w-12 h-12 mx-auto" }) }),
|
|
271
271
|
/* @__PURE__ */ t("p", { className: "text-sm text-[var(--widget-text-secondary)] mb-3", children: r ? "Failed to load notifications" : "No notifications available" }),
|
|
272
272
|
e && /* @__PURE__ */ t(
|
|
@@ -278,10 +278,10 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
278
278
|
children: "Try again"
|
|
279
279
|
}
|
|
280
280
|
)
|
|
281
|
-
] }),
|
|
282
|
-
/* @__PURE__ */ t("div", { className: "text-[var(--widget-text-tertiary)] mb-2", children: /* @__PURE__ */ t(
|
|
281
|
+
] }), Y = ({ onRetry: e, onBack: r }) => /* @__PURE__ */ l("div", { className: "p-3 text-center", "data-testid": "preferences-fallback", children: [
|
|
282
|
+
/* @__PURE__ */ t("div", { className: "text-[var(--widget-text-tertiary)] mb-2", children: /* @__PURE__ */ t(ae, { className: "w-12 h-12 mx-auto" }) }),
|
|
283
283
|
/* @__PURE__ */ t("p", { className: "text-sm text-[var(--widget-text-secondary)] mb-3", children: "Unable to load preferences" }),
|
|
284
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ l("div", { className: "space-x-2", children: [
|
|
285
285
|
e && /* @__PURE__ */ t(
|
|
286
286
|
"button",
|
|
287
287
|
{
|
|
@@ -301,13 +301,13 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
301
301
|
}
|
|
302
302
|
)
|
|
303
303
|
] })
|
|
304
|
-
] }),
|
|
304
|
+
] }), Ge = ({ onRetry: e, error: r }) => /* @__PURE__ */ l(
|
|
305
305
|
"div",
|
|
306
306
|
{
|
|
307
307
|
className: "p-3 text-center bg-[var(--widget-warning)]/10 border border-[var(--widget-warning)]/20 rounded-lg",
|
|
308
308
|
"data-testid": "sdk-connection-fallback",
|
|
309
309
|
children: [
|
|
310
|
-
/* @__PURE__ */ t("div", { className: "text-[var(--widget-warning)] mb-2", children: /* @__PURE__ */ t(
|
|
310
|
+
/* @__PURE__ */ t("div", { className: "text-[var(--widget-warning)] mb-2", children: /* @__PURE__ */ t(ye, { className: "w-12 h-12 mx-auto" }) }),
|
|
311
311
|
/* @__PURE__ */ t("p", { className: "text-sm text-[var(--widget-warning)] mb-3 font-medium", children: "Connection to notification service failed" }),
|
|
312
312
|
r && process.env.NODE_ENV === "development" && /* @__PURE__ */ t("p", { className: "text-xs text-[var(--widget-warning)] mb-3 font-mono opacity-80", children: r }),
|
|
313
313
|
e && /* @__PURE__ */ t(
|
|
@@ -321,10 +321,10 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
321
321
|
)
|
|
322
322
|
]
|
|
323
323
|
}
|
|
324
|
-
),
|
|
324
|
+
), Je = ({ message: e = "Loading..." }) => /* @__PURE__ */ l("div", { className: "p-3 text-center", "data-testid": "loading-fallback", children: [
|
|
325
325
|
/* @__PURE__ */ t("div", { className: "w-6 h-6 border-2 border-[var(--widget-primary)] border-t-transparent rounded-full animate-spin mx-auto mb-2" }),
|
|
326
326
|
/* @__PURE__ */ t("p", { className: "text-sm text-[var(--widget-text-secondary)]", children: e })
|
|
327
|
-
] }),
|
|
327
|
+
] }), Se = (e, r) => {
|
|
328
328
|
switch (r) {
|
|
329
329
|
case "all":
|
|
330
330
|
return e;
|
|
@@ -337,15 +337,15 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
337
337
|
}
|
|
338
338
|
return e;
|
|
339
339
|
}
|
|
340
|
-
},
|
|
340
|
+
}, Oe = (e, r) => {
|
|
341
341
|
if (!r.trim())
|
|
342
342
|
return e;
|
|
343
343
|
const a = r.toLowerCase().trim();
|
|
344
344
|
return e.filter((n) => {
|
|
345
|
-
const i = n.subject.toLowerCase(),
|
|
346
|
-
return i.includes(a) ||
|
|
345
|
+
const i = n.subject.toLowerCase(), s = n.body.toLowerCase(), m = n.tags.join(" ").toLowerCase();
|
|
346
|
+
return i.includes(a) || s.includes(a) || m.includes(a);
|
|
347
347
|
});
|
|
348
|
-
},
|
|
348
|
+
}, $e = (e, r) => {
|
|
349
349
|
const a = [...e];
|
|
350
350
|
switch (r) {
|
|
351
351
|
case "newest":
|
|
@@ -359,24 +359,24 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
359
359
|
default:
|
|
360
360
|
return a;
|
|
361
361
|
}
|
|
362
|
-
},
|
|
362
|
+
}, Pe = (e, r, a, n = "newest") => {
|
|
363
363
|
let i = e;
|
|
364
|
-
return i =
|
|
365
|
-
},
|
|
364
|
+
return i = Se(i, r), a && (i = Oe(i, a)), i = $e(i, n), i;
|
|
365
|
+
}, Be = ({
|
|
366
366
|
selectedNotifications: e,
|
|
367
367
|
onMarkAllAsRead: r,
|
|
368
368
|
onMarkAllAsUnread: a,
|
|
369
369
|
onArchiveAll: n,
|
|
370
370
|
onDeleteAll: i,
|
|
371
|
-
onClearSelection:
|
|
372
|
-
className:
|
|
371
|
+
onClearSelection: s,
|
|
372
|
+
className: m = ""
|
|
373
373
|
}) => {
|
|
374
|
-
const [
|
|
374
|
+
const [u, c] = k(!1), [h, f] = k(null), g = e.length, x = async (y, b) => {
|
|
375
375
|
if (g !== 0) {
|
|
376
376
|
c(!0), f(null);
|
|
377
377
|
try {
|
|
378
378
|
const w = await y(e);
|
|
379
|
-
f(w), w.success &&
|
|
379
|
+
f(w), w.success && s();
|
|
380
380
|
} catch (w) {
|
|
381
381
|
f({
|
|
382
382
|
success: !1,
|
|
@@ -389,27 +389,27 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
};
|
|
392
|
-
return g === 0 ? null : /* @__PURE__ */
|
|
393
|
-
/* @__PURE__ */
|
|
394
|
-
/* @__PURE__ */
|
|
395
|
-
/* @__PURE__ */
|
|
392
|
+
return g === 0 ? null : /* @__PURE__ */ l("div", { className: `border-t border-border bg-widget-primary-light p-2 ${m}`, children: [
|
|
393
|
+
/* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
|
|
394
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
395
|
+
/* @__PURE__ */ l("span", { className: "text-sm font-medium text-widget-primary", children: [
|
|
396
396
|
g,
|
|
397
397
|
" notification",
|
|
398
398
|
g !== 1 ? "s" : "",
|
|
399
399
|
" selected"
|
|
400
400
|
] }),
|
|
401
|
-
|
|
402
|
-
|
|
401
|
+
h && !h.success && /* @__PURE__ */ l("span", { className: "text-xs text-[var(--widget-error)]", children: [
|
|
402
|
+
h.failedCount,
|
|
403
403
|
" failed"
|
|
404
404
|
] })
|
|
405
405
|
] }),
|
|
406
|
-
/* @__PURE__ */
|
|
407
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
407
|
+
/* @__PURE__ */ l(
|
|
408
408
|
"button",
|
|
409
409
|
{
|
|
410
410
|
type: "button",
|
|
411
411
|
onClick: () => x(r),
|
|
412
|
-
disabled:
|
|
412
|
+
disabled: u,
|
|
413
413
|
className: "inline-flex items-center px-2 py-1 text-xs font-medium text-blue-700 bg-white border border-blue-300 rounded hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
414
414
|
"data-testid": "bulk-mark-read",
|
|
415
415
|
children: [
|
|
@@ -418,35 +418,35 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
418
418
|
]
|
|
419
419
|
}
|
|
420
420
|
),
|
|
421
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ l(
|
|
422
422
|
"button",
|
|
423
423
|
{
|
|
424
424
|
type: "button",
|
|
425
425
|
onClick: () => x(a),
|
|
426
|
-
disabled:
|
|
426
|
+
disabled: u,
|
|
427
427
|
className: "inline-flex items-center px-2 py-1 text-xs font-medium text-blue-700 bg-white border border-blue-300 rounded hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
428
428
|
"data-testid": "bulk-mark-unread",
|
|
429
429
|
children: [
|
|
430
|
-
/* @__PURE__ */ t(
|
|
430
|
+
/* @__PURE__ */ t(se, { className: "mr-1 w-4 h-4" }),
|
|
431
431
|
"Mark Unread"
|
|
432
432
|
]
|
|
433
433
|
}
|
|
434
434
|
),
|
|
435
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ l(
|
|
436
436
|
"button",
|
|
437
437
|
{
|
|
438
438
|
type: "button",
|
|
439
439
|
onClick: () => x(n),
|
|
440
|
-
disabled:
|
|
440
|
+
disabled: u,
|
|
441
441
|
className: "inline-flex items-center px-2 py-1 text-xs font-medium text-text-secondary bg-white border border-border rounded hover:bg-widget-hover focus:outline-none focus:ring-2 focus:ring-text-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
442
442
|
"data-testid": "bulk-archive",
|
|
443
443
|
children: [
|
|
444
|
-
/* @__PURE__ */ t(
|
|
444
|
+
/* @__PURE__ */ t(ne, { className: "mr-1 w-4 h-4" }),
|
|
445
445
|
"Archive"
|
|
446
446
|
]
|
|
447
447
|
}
|
|
448
448
|
),
|
|
449
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ l(
|
|
450
450
|
"button",
|
|
451
451
|
{
|
|
452
452
|
type: "button",
|
|
@@ -455,11 +455,11 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
455
455
|
`Are you sure you want to delete ${g} notification${g !== 1 ? "s" : ""}? This action cannot be undone.`
|
|
456
456
|
) && x(i);
|
|
457
457
|
},
|
|
458
|
-
disabled:
|
|
458
|
+
disabled: u,
|
|
459
459
|
className: "inline-flex items-center px-2 py-1 text-xs font-medium text-[var(--widget-error)] bg-white border border-[var(--widget-error)]/30 rounded hover:bg-[var(--widget-error)]/10 focus:outline-none focus:ring-2 focus:ring-[var(--widget-error)] disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
460
460
|
"data-testid": "bulk-delete",
|
|
461
461
|
children: [
|
|
462
|
-
/* @__PURE__ */ t(
|
|
462
|
+
/* @__PURE__ */ t(xe, { className: "mr-1 w-4 h-4" }),
|
|
463
463
|
"Delete"
|
|
464
464
|
]
|
|
465
465
|
}
|
|
@@ -468,42 +468,42 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
468
468
|
"button",
|
|
469
469
|
{
|
|
470
470
|
type: "button",
|
|
471
|
-
onClick:
|
|
472
|
-
disabled:
|
|
471
|
+
onClick: s,
|
|
472
|
+
disabled: u,
|
|
473
473
|
className: "inline-flex items-center px-1 py-1 text-xs font-medium text-text-secondary hover:text-text-primary focus:outline-none focus:ring-2 focus:ring-text-secondary disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
474
474
|
"data-testid": "clear-selection",
|
|
475
475
|
"aria-label": "Clear selection",
|
|
476
|
-
children: /* @__PURE__ */ t(
|
|
476
|
+
children: /* @__PURE__ */ t(ie, { className: "w-5 h-5" })
|
|
477
477
|
}
|
|
478
478
|
)
|
|
479
479
|
] })
|
|
480
480
|
] }),
|
|
481
|
-
|
|
481
|
+
u && /* @__PURE__ */ l("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
482
482
|
/* @__PURE__ */ t("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--widget-primary)]" }),
|
|
483
483
|
/* @__PURE__ */ t("span", { className: "text-xs text-[var(--widget-primary)]", children: "Processing..." })
|
|
484
484
|
] }),
|
|
485
|
-
|
|
485
|
+
h && /* @__PURE__ */ t("div", { className: "mt-2", children: h.success ? /* @__PURE__ */ l("div", { className: "text-xs text-[var(--widget-success)]", children: [
|
|
486
486
|
"Successfully processed ",
|
|
487
|
-
|
|
487
|
+
h.processedCount,
|
|
488
488
|
" notification",
|
|
489
|
-
|
|
490
|
-
] }) : /* @__PURE__ */
|
|
491
|
-
|
|
489
|
+
h.processedCount !== 1 ? "s" : ""
|
|
490
|
+
] }) : /* @__PURE__ */ l("div", { className: "text-xs text-[var(--widget-error)]", children: [
|
|
491
|
+
h.processedCount > 0 && /* @__PURE__ */ l("span", { children: [
|
|
492
492
|
"Processed ",
|
|
493
|
-
|
|
493
|
+
h.processedCount,
|
|
494
494
|
", "
|
|
495
495
|
] }),
|
|
496
496
|
"Failed to process ",
|
|
497
|
-
|
|
497
|
+
h.failedCount,
|
|
498
498
|
" notification",
|
|
499
|
-
|
|
499
|
+
h.failedCount !== 1 ? "s" : ""
|
|
500
500
|
] }) })
|
|
501
501
|
] });
|
|
502
|
-
},
|
|
502
|
+
}, Q = ({
|
|
503
503
|
title: e = "No Items",
|
|
504
504
|
description: r = "There are no items to display",
|
|
505
505
|
icon: a
|
|
506
|
-
}) => /* @__PURE__ */
|
|
506
|
+
}) => /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center py-8 px-4", children: [
|
|
507
507
|
a && /* @__PURE__ */ t("div", { className: "mb-4 text-gray-300", children: a }),
|
|
508
508
|
/* @__PURE__ */ t("h3", { className: "text-lg font-medium text-[var(--widget-text)] mb-2", children: e }),
|
|
509
509
|
/* @__PURE__ */ t("p", { className: "text-sm text-text-gray-300 text-center", children: r })
|
|
@@ -513,32 +513,32 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
513
513
|
position: a = "top",
|
|
514
514
|
delay: n = 200
|
|
515
515
|
}) => {
|
|
516
|
-
const [i,
|
|
516
|
+
const [i, s] = k(!1), [m, u] = k({ x: 0, y: 0 }), c = j(null), h = j(null), f = () => {
|
|
517
517
|
c.current && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
518
|
-
if (
|
|
519
|
-
const b =
|
|
520
|
-
let w = 0,
|
|
518
|
+
if (h.current) {
|
|
519
|
+
const b = h.current.getBoundingClientRect();
|
|
520
|
+
let w = 0, o = 0;
|
|
521
521
|
switch (a) {
|
|
522
522
|
case "top":
|
|
523
|
-
w = b.left + b.width / 2,
|
|
523
|
+
w = b.left + b.width / 2, o = b.top - 15;
|
|
524
524
|
break;
|
|
525
525
|
case "bottom":
|
|
526
|
-
w = b.left + b.width / 2,
|
|
526
|
+
w = b.left + b.width / 2, o = b.bottom + 15;
|
|
527
527
|
break;
|
|
528
528
|
case "left":
|
|
529
|
-
w = b.left - 15,
|
|
529
|
+
w = b.left - 15, o = b.top + b.height / 2;
|
|
530
530
|
break;
|
|
531
531
|
case "right":
|
|
532
|
-
w = b.right + 15,
|
|
532
|
+
w = b.right + 15, o = b.top + b.height / 2;
|
|
533
533
|
break;
|
|
534
534
|
}
|
|
535
|
-
|
|
535
|
+
u({ x: w, y: o }), s(!0);
|
|
536
536
|
}
|
|
537
537
|
}, n);
|
|
538
538
|
}, g = () => {
|
|
539
|
-
c.current && clearTimeout(c.current),
|
|
539
|
+
c.current && clearTimeout(c.current), s(!1);
|
|
540
540
|
};
|
|
541
|
-
|
|
541
|
+
R(() => () => {
|
|
542
542
|
c.current && clearTimeout(c.current);
|
|
543
543
|
}, []);
|
|
544
544
|
const x = () => {
|
|
@@ -555,11 +555,11 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
555
555
|
return {};
|
|
556
556
|
}
|
|
557
557
|
};
|
|
558
|
-
return /* @__PURE__ */
|
|
558
|
+
return /* @__PURE__ */ l(H, { children: [
|
|
559
559
|
/* @__PURE__ */ t(
|
|
560
560
|
"div",
|
|
561
561
|
{
|
|
562
|
-
ref:
|
|
562
|
+
ref: h,
|
|
563
563
|
onMouseEnter: f,
|
|
564
564
|
onMouseLeave: g,
|
|
565
565
|
className: "inline-flex",
|
|
@@ -581,42 +581,42 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
581
581
|
animate-in fade-in-0 zoom-in-95 duration-200
|
|
582
582
|
`,
|
|
583
583
|
style: {
|
|
584
|
-
left: `${
|
|
585
|
-
top: `${
|
|
584
|
+
left: `${m.x}px`,
|
|
585
|
+
top: `${m.y}px`,
|
|
586
586
|
...x()
|
|
587
587
|
},
|
|
588
588
|
children: e
|
|
589
589
|
}
|
|
590
590
|
)
|
|
591
591
|
] });
|
|
592
|
-
},
|
|
592
|
+
}, Ae = (e) => {
|
|
593
593
|
if (Number.isNaN(e.getTime())) return "Long ago";
|
|
594
|
-
const n = (/* @__PURE__ */ new Date()).getTime() - e.getTime(), i = Math.floor(n / 6e4),
|
|
595
|
-
return i < 1 ? "Just now" : i < 60 ? `${i}m ago` :
|
|
594
|
+
const n = (/* @__PURE__ */ new Date()).getTime() - e.getTime(), i = Math.floor(n / 6e4), s = Math.floor(n / 36e5), m = Math.floor(n / 864e5);
|
|
595
|
+
return i < 1 ? "Just now" : i < 60 ? `${i}m ago` : s < 24 ? `${s}h ago` : m < 7 ? `${m}d ago` : e.toLocaleDateString();
|
|
596
596
|
}, A = ({ type: e, className: r }) => {
|
|
597
597
|
const a = r || "w-4 h-4";
|
|
598
598
|
switch (e) {
|
|
599
599
|
case "mark_read":
|
|
600
600
|
return /* @__PURE__ */ t(V, { className: a });
|
|
601
601
|
case "snooze":
|
|
602
|
-
return /* @__PURE__ */ t(
|
|
602
|
+
return /* @__PURE__ */ t(ke, { className: a });
|
|
603
603
|
case "archive":
|
|
604
|
-
return /* @__PURE__ */ t(
|
|
604
|
+
return /* @__PURE__ */ t(ne, { className: a });
|
|
605
605
|
default:
|
|
606
606
|
return null;
|
|
607
607
|
}
|
|
608
|
-
},
|
|
608
|
+
}, Ie = ({
|
|
609
609
|
notification: e,
|
|
610
610
|
onActionClick: r,
|
|
611
611
|
onSelectionChange: a,
|
|
612
612
|
isSelected: n = !1
|
|
613
613
|
}) => {
|
|
614
|
-
const [i,
|
|
615
|
-
r && r(e.id, g),
|
|
614
|
+
const [i, s] = k(!1), m = Number.isNaN(e.timestamp.getTime()), u = m ? void 0 : e.timestamp.toISOString(), c = Ae(e.timestamp), h = (g) => {
|
|
615
|
+
r && r(e.id, g), s(!1);
|
|
616
616
|
}, f = () => {
|
|
617
617
|
a && a(!n);
|
|
618
618
|
};
|
|
619
|
-
return /* @__PURE__ */
|
|
619
|
+
return /* @__PURE__ */ l(
|
|
620
620
|
"div",
|
|
621
621
|
{
|
|
622
622
|
className: `
|
|
@@ -625,8 +625,8 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
625
625
|
min-w-[20rem]
|
|
626
626
|
${n ? "bg-widget-primary-light" : e.isRead ? "bg-widget-background hover:bg-widget-hover" : "bg-blue-50/50 hover:bg-blue-50/70"}
|
|
627
627
|
`,
|
|
628
|
-
onMouseEnter: () =>
|
|
629
|
-
onMouseLeave: () =>
|
|
628
|
+
onMouseEnter: () => s(!0),
|
|
629
|
+
onMouseLeave: () => s(!1),
|
|
630
630
|
"data-testid": "notification-item",
|
|
631
631
|
"data-notification-id": e.id,
|
|
632
632
|
"data-mx-widget": "item",
|
|
@@ -651,8 +651,8 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
651
651
|
loading: "lazy"
|
|
652
652
|
}
|
|
653
653
|
) : /* @__PURE__ */ t("div", { className: "w-10 h-10 rounded-full bg-gradient-to-br from-widget-primary to-widget-primary-hover flex items-center justify-center shadow-sm", children: /* @__PURE__ */ t("span", { className: "text-[var(--widget-text)] font-semibold text-base", children: e.subject.charAt(0).toUpperCase() }) }) }),
|
|
654
|
-
/* @__PURE__ */
|
|
655
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ l("div", { className: "flex-1 min-w-0", children: [
|
|
655
|
+
/* @__PURE__ */ l("div", { className: "flex items-start justify-between gap-2 mb-0.5", children: [
|
|
656
656
|
/* @__PURE__ */ t(
|
|
657
657
|
"h3",
|
|
658
658
|
{
|
|
@@ -674,7 +674,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
674
674
|
"button",
|
|
675
675
|
{
|
|
676
676
|
onClick: (y) => {
|
|
677
|
-
y.stopPropagation(),
|
|
677
|
+
y.stopPropagation(), h(g);
|
|
678
678
|
},
|
|
679
679
|
className: `
|
|
680
680
|
px-3 py-1.5 rounded-md text-sm font-medium transition-colors
|
|
@@ -685,9 +685,9 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
685
685
|
},
|
|
686
686
|
x
|
|
687
687
|
)) }),
|
|
688
|
-
/* @__PURE__ */
|
|
689
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ t("time", { className: "text-xs text-[var(--widget-text-tertiary)]", dateTime:
|
|
690
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ l("div", { className: "flex items-center justify-between min-h-[20px]", children: [
|
|
689
|
+
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ t("time", { className: "text-xs text-[var(--widget-text-tertiary)]", dateTime: u, children: c }) }),
|
|
690
|
+
/* @__PURE__ */ l(
|
|
691
691
|
"div",
|
|
692
692
|
{
|
|
693
693
|
className: `flex items-center gap-1 transition-opacity duration-200 ${i ? "opacity-100" : "opacity-0"}`,
|
|
@@ -697,7 +697,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
697
697
|
"button",
|
|
698
698
|
{
|
|
699
699
|
className: "inline-flex items-center justify-center w-7 h-7 rounded-md text-[var(--widget-text-secondary)] hover:text-[var(--widget-text)] hover:bg-[var(--widget-bg-hover)] transition-colors",
|
|
700
|
-
onClick: () =>
|
|
700
|
+
onClick: () => h({
|
|
701
701
|
type: "mark_read",
|
|
702
702
|
label: "Mark as read",
|
|
703
703
|
handler: async () => {
|
|
@@ -711,7 +711,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
711
711
|
"button",
|
|
712
712
|
{
|
|
713
713
|
className: "inline-flex items-center justify-center w-7 h-7 rounded-md text-[var(--widget-text-secondary)] hover:text-[var(--widget-text)] hover:bg-[var(--widget-bg-hover)] transition-colors",
|
|
714
|
-
onClick: () =>
|
|
714
|
+
onClick: () => h({ type: "custom", label: "Snooze", handler: async () => {
|
|
715
715
|
} }),
|
|
716
716
|
"aria-label": "Snooze",
|
|
717
717
|
children: /* @__PURE__ */ t(A, { type: "snooze" })
|
|
@@ -721,7 +721,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
721
721
|
"button",
|
|
722
722
|
{
|
|
723
723
|
className: "inline-flex items-center justify-center w-7 h-7 rounded-md text-[var(--widget-text-secondary)] hover:text-[var(--widget-text)] hover:bg-[var(--widget-bg-hover)] transition-colors",
|
|
724
|
-
onClick: () =>
|
|
724
|
+
onClick: () => h({ type: "archive", label: "Archive", handler: async () => {
|
|
725
725
|
} }),
|
|
726
726
|
"aria-label": "Archive",
|
|
727
727
|
children: /* @__PURE__ */ t(A, { type: "archive" })
|
|
@@ -732,10 +732,10 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
732
732
|
)
|
|
733
733
|
] })
|
|
734
734
|
] }),
|
|
735
|
-
/* @__PURE__ */
|
|
735
|
+
/* @__PURE__ */ l("div", { className: "sr-only", children: [
|
|
736
736
|
"Notification from",
|
|
737
737
|
" ",
|
|
738
|
-
|
|
738
|
+
m ? "Unknown time" : e.timestamp.toLocaleString(),
|
|
739
739
|
".",
|
|
740
740
|
e.isRead ? "Read" : "Unread",
|
|
741
741
|
".",
|
|
@@ -745,15 +745,15 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
745
745
|
]
|
|
746
746
|
}
|
|
747
747
|
);
|
|
748
|
-
},
|
|
748
|
+
}, X = ({ count: e = 3 }) => /* @__PURE__ */ t(H, { children: Array.from({ length: e }).map((r, a) => /* @__PURE__ */ l(
|
|
749
749
|
"div",
|
|
750
750
|
{
|
|
751
751
|
className: "flex items-start gap-3 px-4 py-3 border-b border-border-light animate-pulse",
|
|
752
752
|
children: [
|
|
753
753
|
/* @__PURE__ */ t("div", { className: "flex-shrink-0", children: /* @__PURE__ */ t("div", { className: "w-10 h-10 rounded-full bg-widget-hover" }) }),
|
|
754
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ l("div", { className: "flex-1 space-y-2", children: [
|
|
755
755
|
/* @__PURE__ */ t("div", { className: "h-4 w-3/4 rounded bg-widget-hover" }),
|
|
756
|
-
/* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ l("div", { className: "space-y-1", children: [
|
|
757
757
|
/* @__PURE__ */ t("div", { className: "h-3 w-full rounded bg-widget-hover" }),
|
|
758
758
|
/* @__PURE__ */ t("div", { className: "h-3 w-5/6 rounded bg-widget-hover" })
|
|
759
759
|
] }),
|
|
@@ -769,18 +769,18 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
769
769
|
error: a,
|
|
770
770
|
onNotificationAction: n,
|
|
771
771
|
selectedNotifications: i = [],
|
|
772
|
-
onSelectionChange:
|
|
773
|
-
onSelectAll:
|
|
774
|
-
onLoadMore:
|
|
772
|
+
onSelectionChange: s,
|
|
773
|
+
onSelectAll: m,
|
|
774
|
+
onLoadMore: u,
|
|
775
775
|
hasMore: c = !1,
|
|
776
|
-
className:
|
|
776
|
+
className: h = ""
|
|
777
777
|
}) => {
|
|
778
778
|
const f = j(null), g = j(null), [x, y] = k(!1);
|
|
779
|
-
|
|
780
|
-
if (!(!
|
|
779
|
+
R(() => {
|
|
780
|
+
if (!(!u || !c || x))
|
|
781
781
|
return f.current = new IntersectionObserver(
|
|
782
|
-
(
|
|
783
|
-
|
|
782
|
+
(o) => {
|
|
783
|
+
o[0].isIntersecting && c && !x && (y(!0), u(), setTimeout(() => y(!1), 500));
|
|
784
784
|
},
|
|
785
785
|
{
|
|
786
786
|
root: null,
|
|
@@ -790,23 +790,23 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
790
790
|
), g.current && f.current.observe(g.current), () => {
|
|
791
791
|
f.current && f.current.disconnect();
|
|
792
792
|
};
|
|
793
|
-
}, [
|
|
793
|
+
}, [u, c, x]);
|
|
794
794
|
const b = z(
|
|
795
|
-
async (
|
|
795
|
+
async (o, d) => {
|
|
796
796
|
try {
|
|
797
|
-
d.handler && await d.handler(
|
|
797
|
+
d.handler && await d.handler(o), n && d.type && n(o, d);
|
|
798
798
|
} catch {
|
|
799
799
|
}
|
|
800
800
|
},
|
|
801
801
|
[n]
|
|
802
802
|
), w = z(
|
|
803
|
-
(
|
|
804
|
-
|
|
803
|
+
(o, d) => {
|
|
804
|
+
s && s(o, d);
|
|
805
805
|
},
|
|
806
|
-
[
|
|
806
|
+
[s]
|
|
807
807
|
);
|
|
808
|
-
return r && e.length === 0 ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background min-w-[20rem] ${
|
|
809
|
-
|
|
808
|
+
return r && e.length === 0 ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background min-w-[20rem] ${h}`, children: /* @__PURE__ */ t(X, { count: 5 }) }) : a ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background min-w-[20rem] ${h}`, children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center flex-1 py-12", children: /* @__PURE__ */ t(
|
|
809
|
+
Q,
|
|
810
810
|
{
|
|
811
811
|
title: "Error Loading Notifications",
|
|
812
812
|
description: "Failed to load notifications. Please try again.",
|
|
@@ -829,8 +829,8 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
829
829
|
}
|
|
830
830
|
)
|
|
831
831
|
}
|
|
832
|
-
) }) }) : e.length === 0 ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background min-w-[20rem] ${
|
|
833
|
-
|
|
832
|
+
) }) }) : e.length === 0 ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background min-w-[20rem] ${h}`, children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center flex-1 py-12", children: /* @__PURE__ */ t(
|
|
833
|
+
Q,
|
|
834
834
|
{
|
|
835
835
|
title: "No Notifications",
|
|
836
836
|
description: "You're all caught up! No notifications to display.",
|
|
@@ -853,14 +853,14 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
853
853
|
}
|
|
854
854
|
)
|
|
855
855
|
}
|
|
856
|
-
) }) }) : /* @__PURE__ */
|
|
857
|
-
|
|
858
|
-
|
|
856
|
+
) }) }) : /* @__PURE__ */ l("div", { className: `flex flex-col h-full min-w-[20rem] ${h}`, children: [
|
|
857
|
+
m && n && /* @__PURE__ */ t(
|
|
858
|
+
Be,
|
|
859
859
|
{
|
|
860
860
|
selectedNotifications: i,
|
|
861
|
-
onMarkAllAsRead: async (
|
|
861
|
+
onMarkAllAsRead: async (o) => {
|
|
862
862
|
try {
|
|
863
|
-
for (const d of
|
|
863
|
+
for (const d of o)
|
|
864
864
|
n(d, {
|
|
865
865
|
type: "mark_read",
|
|
866
866
|
label: "Mark as read",
|
|
@@ -869,7 +869,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
869
869
|
});
|
|
870
870
|
return {
|
|
871
871
|
success: !0,
|
|
872
|
-
processedCount:
|
|
872
|
+
processedCount: o.length,
|
|
873
873
|
failedCount: 0,
|
|
874
874
|
errors: []
|
|
875
875
|
};
|
|
@@ -877,14 +877,14 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
877
877
|
return {
|
|
878
878
|
success: !1,
|
|
879
879
|
processedCount: 0,
|
|
880
|
-
failedCount:
|
|
880
|
+
failedCount: o.length,
|
|
881
881
|
errors: [{ notificationId: "", error: d }]
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
884
|
},
|
|
885
|
-
onMarkAllAsUnread: async (
|
|
885
|
+
onMarkAllAsUnread: async (o) => {
|
|
886
886
|
try {
|
|
887
|
-
for (const d of
|
|
887
|
+
for (const d of o)
|
|
888
888
|
n(d, {
|
|
889
889
|
type: "mark_unread",
|
|
890
890
|
label: "Mark as unread",
|
|
@@ -893,7 +893,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
893
893
|
});
|
|
894
894
|
return {
|
|
895
895
|
success: !0,
|
|
896
|
-
processedCount:
|
|
896
|
+
processedCount: o.length,
|
|
897
897
|
failedCount: 0,
|
|
898
898
|
errors: []
|
|
899
899
|
};
|
|
@@ -901,14 +901,14 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
901
901
|
return {
|
|
902
902
|
success: !1,
|
|
903
903
|
processedCount: 0,
|
|
904
|
-
failedCount:
|
|
904
|
+
failedCount: o.length,
|
|
905
905
|
errors: [{ notificationId: "", error: d }]
|
|
906
906
|
};
|
|
907
907
|
}
|
|
908
908
|
},
|
|
909
|
-
onArchiveAll: async (
|
|
909
|
+
onArchiveAll: async (o) => {
|
|
910
910
|
try {
|
|
911
|
-
for (const d of
|
|
911
|
+
for (const d of o)
|
|
912
912
|
n(d, {
|
|
913
913
|
type: "archive",
|
|
914
914
|
label: "Archive",
|
|
@@ -917,7 +917,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
917
917
|
});
|
|
918
918
|
return {
|
|
919
919
|
success: !0,
|
|
920
|
-
processedCount:
|
|
920
|
+
processedCount: o.length,
|
|
921
921
|
failedCount: 0,
|
|
922
922
|
errors: []
|
|
923
923
|
};
|
|
@@ -925,14 +925,14 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
925
925
|
return {
|
|
926
926
|
success: !1,
|
|
927
927
|
processedCount: 0,
|
|
928
|
-
failedCount:
|
|
928
|
+
failedCount: o.length,
|
|
929
929
|
errors: [{ notificationId: "", error: d }]
|
|
930
930
|
};
|
|
931
931
|
}
|
|
932
932
|
},
|
|
933
|
-
onDeleteAll: async (
|
|
933
|
+
onDeleteAll: async (o) => {
|
|
934
934
|
try {
|
|
935
|
-
for (const d of
|
|
935
|
+
for (const d of o)
|
|
936
936
|
n(d, {
|
|
937
937
|
type: "delete",
|
|
938
938
|
label: "Delete",
|
|
@@ -941,7 +941,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
941
941
|
});
|
|
942
942
|
return {
|
|
943
943
|
success: !0,
|
|
944
|
-
processedCount:
|
|
944
|
+
processedCount: o.length,
|
|
945
945
|
failedCount: 0,
|
|
946
946
|
errors: []
|
|
947
947
|
};
|
|
@@ -949,43 +949,43 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
949
949
|
return {
|
|
950
950
|
success: !1,
|
|
951
951
|
processedCount: 0,
|
|
952
|
-
failedCount:
|
|
952
|
+
failedCount: o.length,
|
|
953
953
|
errors: [{ notificationId: "", error: d }]
|
|
954
954
|
};
|
|
955
955
|
}
|
|
956
956
|
},
|
|
957
|
-
onClearSelection: () =>
|
|
957
|
+
onClearSelection: () => m(!1)
|
|
958
958
|
}
|
|
959
959
|
),
|
|
960
|
-
/* @__PURE__ */ t("div", { className: "flex-1", children: /* @__PURE__ */
|
|
961
|
-
e.map((
|
|
962
|
-
|
|
960
|
+
/* @__PURE__ */ t("div", { className: "flex-1", children: /* @__PURE__ */ l("div", { children: [
|
|
961
|
+
e.map((o) => /* @__PURE__ */ t(
|
|
962
|
+
Ie,
|
|
963
963
|
{
|
|
964
|
-
notification:
|
|
964
|
+
notification: o,
|
|
965
965
|
onActionClick: b,
|
|
966
|
-
isSelected: i.includes(
|
|
967
|
-
onSelectionChange:
|
|
966
|
+
isSelected: i.includes(o.id),
|
|
967
|
+
onSelectionChange: s ? (d) => w(o.id, d) : void 0
|
|
968
968
|
},
|
|
969
|
-
|
|
969
|
+
o.id
|
|
970
970
|
)),
|
|
971
|
-
c && /* @__PURE__ */ t("div", { ref: g, className: "py-2", children: x && /* @__PURE__ */ t(
|
|
971
|
+
c && /* @__PURE__ */ t("div", { ref: g, className: "py-2", children: x && /* @__PURE__ */ t(X, { count: 3 }) })
|
|
972
972
|
] }) })
|
|
973
973
|
] });
|
|
974
|
-
},
|
|
974
|
+
}, I = ({
|
|
975
975
|
id: e,
|
|
976
976
|
label: r,
|
|
977
977
|
checked: a,
|
|
978
978
|
onChange: n,
|
|
979
979
|
disabled: i = !1,
|
|
980
|
-
icon:
|
|
981
|
-
}) => /* @__PURE__ */
|
|
982
|
-
r && /* @__PURE__ */
|
|
980
|
+
icon: s
|
|
981
|
+
}) => /* @__PURE__ */ l("div", { className: "flex items-center justify-between py-2.5", children: [
|
|
982
|
+
r && /* @__PURE__ */ l(
|
|
983
983
|
"label",
|
|
984
984
|
{
|
|
985
985
|
htmlFor: e,
|
|
986
986
|
className: "flex items-center gap-2 text-sm font-medium text-text-primary cursor-pointer",
|
|
987
987
|
children: [
|
|
988
|
-
|
|
988
|
+
s && /* @__PURE__ */ t("span", { className: "text-widget-primary", children: s }),
|
|
989
989
|
/* @__PURE__ */ t("span", { children: r })
|
|
990
990
|
]
|
|
991
991
|
}
|
|
@@ -1016,113 +1016,113 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
1016
1016
|
)
|
|
1017
1017
|
}
|
|
1018
1018
|
)
|
|
1019
|
-
] }),
|
|
1019
|
+
] }), Ve = {
|
|
1020
1020
|
sm: "w-4 h-4",
|
|
1021
1021
|
md: "w-8 h-8",
|
|
1022
1022
|
lg: "w-12 h-12"
|
|
1023
|
-
},
|
|
1023
|
+
}, Z = ({
|
|
1024
1024
|
size: e = "md",
|
|
1025
1025
|
label: r = "Loading..."
|
|
1026
|
-
}) => /* @__PURE__ */
|
|
1026
|
+
}) => /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center gap-2", children: [
|
|
1027
1027
|
/* @__PURE__ */ t(
|
|
1028
1028
|
"div",
|
|
1029
1029
|
{
|
|
1030
|
-
className: `${
|
|
1030
|
+
className: `${Ve[e]} animate-spin rounded-full border-2 border-gray-300 dark:border-gray-600 border-t-blue-500 dark:border-t-blue-400`,
|
|
1031
1031
|
role: "status",
|
|
1032
1032
|
"aria-label": r
|
|
1033
1033
|
}
|
|
1034
1034
|
),
|
|
1035
1035
|
r && /* @__PURE__ */ t("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: r })
|
|
1036
|
-
] }),
|
|
1036
|
+
] }), De = ({
|
|
1037
1037
|
preferences: e,
|
|
1038
1038
|
onPreferenceChange: r,
|
|
1039
1039
|
isLoading: a,
|
|
1040
1040
|
specificPreferences: n,
|
|
1041
1041
|
onLoadMoreSpecific: i,
|
|
1042
|
-
hasMoreSpecific:
|
|
1043
|
-
isListLoading:
|
|
1044
|
-
onMorePreferencesClick:
|
|
1042
|
+
hasMoreSpecific: s,
|
|
1043
|
+
isListLoading: m,
|
|
1044
|
+
onMorePreferencesClick: u
|
|
1045
1045
|
}) => {
|
|
1046
|
-
const [c,
|
|
1046
|
+
const [c, h] = k({
|
|
1047
1047
|
global: !0,
|
|
1048
1048
|
schedule: !1
|
|
1049
|
-
}), [f, g] = k({}), x = (
|
|
1050
|
-
|
|
1051
|
-
}, y = (
|
|
1052
|
-
r(`channels.${
|
|
1053
|
-
}, b = (
|
|
1054
|
-
const { scrollTop: d, scrollHeight: M, clientHeight: E } =
|
|
1055
|
-
M - d - E < 50 &&
|
|
1056
|
-
}, w = (
|
|
1057
|
-
switch (
|
|
1049
|
+
}), [f, g] = k({}), x = (o) => {
|
|
1050
|
+
h((d) => ({ ...d, [o]: !d[o] }));
|
|
1051
|
+
}, y = (o, d) => {
|
|
1052
|
+
r(`channels.${o}`, d);
|
|
1053
|
+
}, b = (o) => {
|
|
1054
|
+
const { scrollTop: d, scrollHeight: M, clientHeight: E } = o.currentTarget;
|
|
1055
|
+
M - d - E < 50 && s && i && !m && i();
|
|
1056
|
+
}, w = (o) => {
|
|
1057
|
+
switch (o) {
|
|
1058
1058
|
case "email":
|
|
1059
|
-
return /* @__PURE__ */ t(
|
|
1059
|
+
return /* @__PURE__ */ t(Ne, { className: "w-4 h-4" });
|
|
1060
1060
|
case "push":
|
|
1061
|
-
return /* @__PURE__ */ t(
|
|
1061
|
+
return /* @__PURE__ */ t(J, { className: "w-4 h-4" });
|
|
1062
1062
|
case "sms":
|
|
1063
|
-
return /* @__PURE__ */ t(
|
|
1063
|
+
return /* @__PURE__ */ t(He, { className: "w-4 h-4" });
|
|
1064
1064
|
case "inApp":
|
|
1065
|
-
return /* @__PURE__ */ t(
|
|
1065
|
+
return /* @__PURE__ */ t(Ce, { className: "w-4 h-4" });
|
|
1066
1066
|
default:
|
|
1067
1067
|
return null;
|
|
1068
1068
|
}
|
|
1069
1069
|
};
|
|
1070
|
-
return n || e.subscriptions, /* @__PURE__ */
|
|
1070
|
+
return n || e.subscriptions, /* @__PURE__ */ l(
|
|
1071
1071
|
"div",
|
|
1072
1072
|
{
|
|
1073
1073
|
className: "h-full overflow-y-auto widget-scrollbar min-w-[20rem] p-2 bg-[var(--widget-background)]",
|
|
1074
1074
|
"data-testid": "preferences-view",
|
|
1075
1075
|
onScroll: b,
|
|
1076
1076
|
children: [
|
|
1077
|
-
a && /* @__PURE__ */ t("div", { className: "absolute inset-0 bg-[var(--widget-bg)]/75 backdrop-blur-sm flex items-center justify-center z-10 transition-all duration-200", children: /* @__PURE__ */ t(
|
|
1078
|
-
/* @__PURE__ */
|
|
1079
|
-
/* @__PURE__ */
|
|
1080
|
-
/* @__PURE__ */
|
|
1077
|
+
a && /* @__PURE__ */ t("div", { className: "absolute inset-0 bg-[var(--widget-bg)]/75 backdrop-blur-sm flex items-center justify-center z-10 transition-all duration-200", children: /* @__PURE__ */ t(Z, { size: "lg" }) }),
|
|
1078
|
+
/* @__PURE__ */ l("div", { className: "space-y-2", children: [
|
|
1079
|
+
/* @__PURE__ */ l("div", { className: "border border-[var(--widget-border)] rounded-lg overflow-hidden", children: [
|
|
1080
|
+
/* @__PURE__ */ l(
|
|
1081
1081
|
"button",
|
|
1082
1082
|
{
|
|
1083
1083
|
type: "button",
|
|
1084
1084
|
onClick: () => x("global"),
|
|
1085
1085
|
className: "w-full flex items-center justify-between px-2 py-1.5 bg-[var(--widget-bg-secondary)] hover:bg-[var(--widget-bg-hover)] transition-colors",
|
|
1086
1086
|
children: [
|
|
1087
|
-
/* @__PURE__ */
|
|
1088
|
-
/* @__PURE__ */ t(
|
|
1087
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-2 min-w-[20rem]", children: [
|
|
1088
|
+
/* @__PURE__ */ t(J, { className: "w-5 h-5 text-widget-primary" }),
|
|
1089
1089
|
/* @__PURE__ */ t("span", { className: "font-semibold text-sm text-text-primary", children: "Global Preferences" })
|
|
1090
1090
|
] }),
|
|
1091
|
-
c.global ? /* @__PURE__ */ t(
|
|
1091
|
+
c.global ? /* @__PURE__ */ t(je, { className: "w-5 h-5 text-text-secondary" }) : /* @__PURE__ */ t(Ee, { className: "w-5 h-5 text-text-secondary" })
|
|
1092
1092
|
]
|
|
1093
1093
|
}
|
|
1094
1094
|
),
|
|
1095
|
-
c.global && /* @__PURE__ */
|
|
1095
|
+
c.global && /* @__PURE__ */ l("div", { className: " min-w-[20rem] px-2 pb-1.5 divide-y divide-border-light bg-[var(--widget-background)]", children: [
|
|
1096
1096
|
/* @__PURE__ */ t(
|
|
1097
|
-
|
|
1097
|
+
I,
|
|
1098
1098
|
{
|
|
1099
1099
|
id: "channel-email",
|
|
1100
1100
|
label: "Email",
|
|
1101
1101
|
icon: w("email"),
|
|
1102
1102
|
checked: e.channels.email,
|
|
1103
|
-
onChange: (
|
|
1103
|
+
onChange: (o) => y("email", o),
|
|
1104
1104
|
disabled: a
|
|
1105
1105
|
}
|
|
1106
1106
|
),
|
|
1107
1107
|
/* @__PURE__ */ t(
|
|
1108
|
-
|
|
1108
|
+
I,
|
|
1109
1109
|
{
|
|
1110
1110
|
id: "channel-inapp",
|
|
1111
1111
|
label: "In-App",
|
|
1112
1112
|
icon: w("inApp"),
|
|
1113
1113
|
checked: e.channels.inApp,
|
|
1114
|
-
onChange: (
|
|
1114
|
+
onChange: (o) => y("inApp", o),
|
|
1115
1115
|
disabled: a
|
|
1116
1116
|
}
|
|
1117
1117
|
),
|
|
1118
1118
|
/* @__PURE__ */ t(
|
|
1119
|
-
|
|
1119
|
+
I,
|
|
1120
1120
|
{
|
|
1121
1121
|
id: "channel-push",
|
|
1122
1122
|
label: "Push",
|
|
1123
1123
|
icon: w("push"),
|
|
1124
1124
|
checked: e.channels.push,
|
|
1125
|
-
onChange: (
|
|
1125
|
+
onChange: (o) => y("push", o),
|
|
1126
1126
|
disabled: a
|
|
1127
1127
|
}
|
|
1128
1128
|
)
|
|
@@ -1130,12 +1130,12 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
1130
1130
|
] }),
|
|
1131
1131
|
!1,
|
|
1132
1132
|
!1,
|
|
1133
|
-
|
|
1134
|
-
|
|
1133
|
+
m && /* @__PURE__ */ t("div", { className: "flex justify-center p-2", children: /* @__PURE__ */ t(Z, { size: "md" }) }),
|
|
1134
|
+
u && /* @__PURE__ */ t("div", { className: "pt-2 pb-1 flex justify-center", children: /* @__PURE__ */ t(
|
|
1135
1135
|
"button",
|
|
1136
1136
|
{
|
|
1137
1137
|
onClick: () => {
|
|
1138
|
-
|
|
1138
|
+
u();
|
|
1139
1139
|
},
|
|
1140
1140
|
className: "text-sm font-medium text-[var(--widget-primary)] hover:text-[var(--widget-primary-hover)] hover:underline focus:outline-none",
|
|
1141
1141
|
children: "More Settings"
|
|
@@ -1145,39 +1145,39 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
1145
1145
|
]
|
|
1146
1146
|
}
|
|
1147
1147
|
);
|
|
1148
|
-
},
|
|
1148
|
+
}, _e = ({
|
|
1149
1149
|
notifications: e,
|
|
1150
1150
|
activeTab: r,
|
|
1151
1151
|
onTabChange: a,
|
|
1152
1152
|
className: n = ""
|
|
1153
1153
|
}) => {
|
|
1154
|
-
const i =
|
|
1155
|
-
const
|
|
1154
|
+
const i = ee(() => {
|
|
1155
|
+
const s = e.length, m = e.filter((f) => !f.isRead).length, u = /* @__PURE__ */ new Map();
|
|
1156
1156
|
e.forEach((f) => {
|
|
1157
1157
|
f.tags.forEach((g) => {
|
|
1158
|
-
|
|
1158
|
+
u.set(g, (u.get(g) || 0) + 1);
|
|
1159
1159
|
});
|
|
1160
1160
|
});
|
|
1161
1161
|
const c = [
|
|
1162
1162
|
{
|
|
1163
1163
|
id: "all",
|
|
1164
1164
|
label: "All",
|
|
1165
|
-
count:
|
|
1166
|
-
icon: /* @__PURE__ */ t(
|
|
1165
|
+
count: s,
|
|
1166
|
+
icon: /* @__PURE__ */ t(Le, { className: "w-4 h-4" })
|
|
1167
1167
|
},
|
|
1168
1168
|
{
|
|
1169
1169
|
id: "unread",
|
|
1170
1170
|
label: "Unread",
|
|
1171
|
-
count:
|
|
1172
|
-
icon: /* @__PURE__ */ t(
|
|
1171
|
+
count: m,
|
|
1172
|
+
icon: /* @__PURE__ */ t(se, { className: "w-4 h-4" })
|
|
1173
1173
|
}
|
|
1174
|
-
],
|
|
1174
|
+
], h = Array.from(u.entries()).sort(([, f], [, g]) => g - f).slice(0, 5).map(([f, g]) => ({
|
|
1175
1175
|
id: `tag:${f}`,
|
|
1176
1176
|
label: f,
|
|
1177
1177
|
count: g,
|
|
1178
|
-
icon: /* @__PURE__ */ t(
|
|
1178
|
+
icon: /* @__PURE__ */ t(Me, { className: "w-4 h-4" })
|
|
1179
1179
|
}));
|
|
1180
|
-
return [...c, ...
|
|
1180
|
+
return [...c, ...h];
|
|
1181
1181
|
}, [e]);
|
|
1182
1182
|
return /* @__PURE__ */ t(
|
|
1183
1183
|
"div",
|
|
@@ -1188,75 +1188,74 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
1188
1188
|
`,
|
|
1189
1189
|
role: "tablist",
|
|
1190
1190
|
"data-mx-widget": "tabs",
|
|
1191
|
-
children: i.map((
|
|
1192
|
-
const
|
|
1193
|
-
return /* @__PURE__ */
|
|
1191
|
+
children: i.map((s) => {
|
|
1192
|
+
const m = r === s.id;
|
|
1193
|
+
return /* @__PURE__ */ l(
|
|
1194
1194
|
"button",
|
|
1195
1195
|
{
|
|
1196
|
-
onClick: () => a(
|
|
1196
|
+
onClick: () => a(s.id),
|
|
1197
1197
|
className: `
|
|
1198
1198
|
flex items-center gap-2 px-3 py-1.5 rounded-full text-sm font-medium transition-all whitespace-nowrap outline-none focus:ring-2 focus:ring-offset-1
|
|
1199
|
-
${
|
|
1199
|
+
${m ? "shadow-sm bg-[var(--widget-primary)] text-[var(--widget-text)]" : "tab-inactive text-[var(--widget-text-secondary)]"}
|
|
1200
1200
|
`,
|
|
1201
1201
|
role: "tab",
|
|
1202
|
-
"aria-selected":
|
|
1203
|
-
"data-testid": `tab-${
|
|
1202
|
+
"aria-selected": m,
|
|
1203
|
+
"data-testid": `tab-${s.id}`,
|
|
1204
1204
|
children: [
|
|
1205
|
-
|
|
1205
|
+
s.icon && /* @__PURE__ */ t(
|
|
1206
1206
|
"span",
|
|
1207
1207
|
{
|
|
1208
|
-
className:
|
|
1209
|
-
children:
|
|
1208
|
+
className: m ? "text-[var(--widget-text)]" : "text-[var(--widget-text-tertiary)]",
|
|
1209
|
+
children: s.icon
|
|
1210
1210
|
}
|
|
1211
1211
|
),
|
|
1212
|
-
/* @__PURE__ */ t("span", { children:
|
|
1213
|
-
|
|
1212
|
+
/* @__PURE__ */ t("span", { children: s.label }),
|
|
1213
|
+
s.count !== void 0 && s.count > 0 && /* @__PURE__ */ l(
|
|
1214
1214
|
"span",
|
|
1215
1215
|
{
|
|
1216
|
-
className: `ml-1 text-[10px] font-semibold ${
|
|
1216
|
+
className: `ml-1 text-[10px] font-semibold ${m ? "text-[var(--widget-text)]" : "text-[var(--widget-text-tertiary)]"}`,
|
|
1217
1217
|
children: [
|
|
1218
1218
|
"(",
|
|
1219
|
-
|
|
1219
|
+
s.count > 99 ? "99+" : s.count,
|
|
1220
1220
|
")"
|
|
1221
1221
|
]
|
|
1222
1222
|
}
|
|
1223
1223
|
)
|
|
1224
1224
|
]
|
|
1225
1225
|
},
|
|
1226
|
-
|
|
1226
|
+
s.id
|
|
1227
1227
|
);
|
|
1228
1228
|
})
|
|
1229
1229
|
}
|
|
1230
1230
|
);
|
|
1231
|
-
},
|
|
1231
|
+
}, Ye = ({
|
|
1232
1232
|
isOpen: e,
|
|
1233
1233
|
onClose: r,
|
|
1234
1234
|
position: a,
|
|
1235
1235
|
currentView: n,
|
|
1236
1236
|
onViewChange: i,
|
|
1237
|
-
notifications:
|
|
1238
|
-
onNotificationAction:
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1237
|
+
notifications: s,
|
|
1238
|
+
onNotificationAction: m,
|
|
1239
|
+
onBulkMarkAllAsRead: u,
|
|
1240
|
+
preferences: c,
|
|
1241
|
+
onPreferenceChange: h,
|
|
1242
|
+
isPreferencesLoading: f = !1,
|
|
1243
|
+
size: g = "medium",
|
|
1244
|
+
onMorePreferencesClick: x,
|
|
1245
|
+
specificPreferences: y,
|
|
1246
|
+
onLoadMoreSpecific: b,
|
|
1247
|
+
hasMoreSpecific: w,
|
|
1248
|
+
isListLoading: o
|
|
1248
1249
|
}) => {
|
|
1249
|
-
const
|
|
1250
|
+
const d = j(null), M = j(null), [E, D] = k("all"), [S, _] = k(""), le = z(
|
|
1250
1251
|
async (p) => {
|
|
1251
1252
|
try {
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
});
|
|
1259
|
-
return { success: !0, processedCount: p.length, failedCount: 0, errors: [] };
|
|
1253
|
+
return u ? await u(p) : {
|
|
1254
|
+
success: !1,
|
|
1255
|
+
processedCount: 0,
|
|
1256
|
+
failedCount: p.length,
|
|
1257
|
+
errors: [{ notificationId: "", error: new Error("Bulk mark as read not available") }]
|
|
1258
|
+
};
|
|
1260
1259
|
} catch (N) {
|
|
1261
1260
|
return {
|
|
1262
1261
|
success: !1,
|
|
@@ -1267,9 +1266,9 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
1267
1266
|
}
|
|
1268
1267
|
},
|
|
1269
1268
|
[u]
|
|
1270
|
-
),
|
|
1269
|
+
), oe = ee(() => Pe(s, E, S), [s, E, S]), O = z(
|
|
1271
1270
|
(p) => {
|
|
1272
|
-
|
|
1271
|
+
d.current && !d.current.contains(p.target) && r();
|
|
1273
1272
|
},
|
|
1274
1273
|
[r]
|
|
1275
1274
|
), $ = z(
|
|
@@ -1279,29 +1278,29 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
1279
1278
|
[r]
|
|
1280
1279
|
), P = z(
|
|
1281
1280
|
(p) => {
|
|
1282
|
-
if (!(!e || !
|
|
1283
|
-
const N =
|
|
1281
|
+
if (!(!e || !d.current) && p.key === "Tab") {
|
|
1282
|
+
const N = d.current.querySelectorAll(
|
|
1284
1283
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
1285
1284
|
);
|
|
1286
1285
|
if (N.length === 0) return;
|
|
1287
|
-
const
|
|
1288
|
-
p.shiftKey ? document.activeElement ===
|
|
1286
|
+
const U = N[0], W = N[N.length - 1];
|
|
1287
|
+
p.shiftKey ? document.activeElement === U && (W.focus(), p.preventDefault()) : document.activeElement === W && (U.focus(), p.preventDefault());
|
|
1289
1288
|
}
|
|
1290
1289
|
},
|
|
1291
1290
|
[e]
|
|
1292
1291
|
);
|
|
1293
|
-
if (
|
|
1294
|
-
|
|
1292
|
+
if (R(() => (e ? (M.current = document.activeElement, document.addEventListener("mousedown", O), document.addEventListener("keydown", $), document.addEventListener("keydown", P), setTimeout(() => {
|
|
1293
|
+
d.current?.querySelector(
|
|
1295
1294
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
1296
1295
|
)?.focus();
|
|
1297
|
-
}, 0)) : (
|
|
1296
|
+
}, 0)) : (M.current && M.current.focus(), D("all"), _("")), () => {
|
|
1298
1297
|
document.removeEventListener("mousedown", O), document.removeEventListener("keydown", $), document.removeEventListener("keydown", P);
|
|
1299
1298
|
}), [e, O, $, P]), !e) return null;
|
|
1300
|
-
const
|
|
1299
|
+
const ce = {
|
|
1301
1300
|
left: "left-0 origin-top-left",
|
|
1302
1301
|
right: "right-0 origin-top-right"
|
|
1303
|
-
},
|
|
1304
|
-
return /* @__PURE__ */
|
|
1302
|
+
}, F = s.filter((p) => !p.isRead).length;
|
|
1303
|
+
return /* @__PURE__ */ l(H, { children: [
|
|
1305
1304
|
/* @__PURE__ */ t(
|
|
1306
1305
|
"div",
|
|
1307
1306
|
{
|
|
@@ -1310,12 +1309,12 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
1310
1309
|
onClick: r
|
|
1311
1310
|
}
|
|
1312
1311
|
),
|
|
1313
|
-
/* @__PURE__ */
|
|
1312
|
+
/* @__PURE__ */ l(
|
|
1314
1313
|
"div",
|
|
1315
1314
|
{
|
|
1316
|
-
ref:
|
|
1315
|
+
ref: d,
|
|
1317
1316
|
className: `
|
|
1318
|
-
mx-widget-popover min-w-[20rem] absolute top-full mt-2 ${
|
|
1317
|
+
mx-widget-popover min-w-[20rem] absolute top-full mt-2 ${ce[a]}
|
|
1319
1318
|
w-[var(--widget-popover-width, 20rem)] max-h-[var(--widget-popover-max-height,580px)]
|
|
1320
1319
|
border border-[var(--widget-border)] rounded-2xl overflow-hidden
|
|
1321
1320
|
shadow-[var(--widget-shadow-xl)] bg-[var(--widget-background)]
|
|
@@ -1331,9 +1330,9 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
1331
1330
|
"data-mx-widget": "popover",
|
|
1332
1331
|
style: { minWidth: "20rem" },
|
|
1333
1332
|
children: [
|
|
1334
|
-
/* @__PURE__ */
|
|
1333
|
+
/* @__PURE__ */ l("div", { className: "flex-shrink-0 flex items-center justify-between px-4 py-3 border-b border-[var(--widget-border)] bg-[var(--widget-background)]", children: [
|
|
1335
1334
|
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ t("h2", { className: "text-base font-semibold text-[var(--widget-text)]", children: n === "notifications" ? "Notifications" : "Preferences" }) }),
|
|
1336
|
-
/* @__PURE__ */
|
|
1335
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
|
|
1337
1336
|
n === "notifications" && /* @__PURE__ */ t(
|
|
1338
1337
|
"button",
|
|
1339
1338
|
{
|
|
@@ -1342,7 +1341,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
1342
1341
|
onClick: () => i("preferences"),
|
|
1343
1342
|
"aria-label": "Open preferences",
|
|
1344
1343
|
"data-testid": "preferences-button",
|
|
1345
|
-
children: /* @__PURE__ */ t(
|
|
1344
|
+
children: /* @__PURE__ */ t(ae, { className: "w-4 h-4" })
|
|
1346
1345
|
}
|
|
1347
1346
|
),
|
|
1348
1347
|
n === "preferences" && /* @__PURE__ */ t(
|
|
@@ -1353,7 +1352,7 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
1353
1352
|
onClick: () => i("notifications"),
|
|
1354
1353
|
"aria-label": "Back to notifications",
|
|
1355
1354
|
"data-testid": "back-button",
|
|
1356
|
-
children: /* @__PURE__ */ t(
|
|
1355
|
+
children: /* @__PURE__ */ t(ze, { className: "w-5 h-5" })
|
|
1357
1356
|
}
|
|
1358
1357
|
),
|
|
1359
1358
|
/* @__PURE__ */ t(
|
|
@@ -1364,14 +1363,14 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
1364
1363
|
onClick: r,
|
|
1365
1364
|
"aria-label": "Close notifications",
|
|
1366
1365
|
"data-testid": "close-button",
|
|
1367
|
-
children: /* @__PURE__ */ t(
|
|
1366
|
+
children: /* @__PURE__ */ t(ie, { className: "w-5 h-5" })
|
|
1368
1367
|
}
|
|
1369
1368
|
)
|
|
1370
1369
|
] })
|
|
1371
1370
|
] }),
|
|
1372
|
-
n === "notifications" ? /* @__PURE__ */
|
|
1373
|
-
/* @__PURE__ */ t("div", { className: "flex-shrink-0 px-4 py-2.5 border-b border-[var(--widget-border)] bg-[var(--widget-background)]", children: /* @__PURE__ */
|
|
1374
|
-
/* @__PURE__ */ t("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ t(
|
|
1371
|
+
n === "notifications" ? /* @__PURE__ */ l(H, { children: [
|
|
1372
|
+
/* @__PURE__ */ t("div", { className: "flex-shrink-0 px-4 py-2.5 border-b border-[var(--widget-border)] bg-[var(--widget-background)]", children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
1373
|
+
/* @__PURE__ */ t("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ t(we, { className: "w-5 h-5 text-[var(--widget-text-tertiary)]" }) }),
|
|
1375
1374
|
/* @__PURE__ */ t(
|
|
1376
1375
|
"input",
|
|
1377
1376
|
{
|
|
@@ -1388,68 +1387,68 @@ const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "
|
|
|
1388
1387
|
`,
|
|
1389
1388
|
placeholder: "Search notifications...",
|
|
1390
1389
|
value: S,
|
|
1391
|
-
onChange: (p) =>
|
|
1390
|
+
onChange: (p) => _(p.target.value),
|
|
1392
1391
|
"aria-label": "Search notifications"
|
|
1393
1392
|
}
|
|
1394
1393
|
)
|
|
1395
1394
|
] }) }),
|
|
1396
1395
|
/* @__PURE__ */ t(
|
|
1397
|
-
|
|
1396
|
+
_e,
|
|
1398
1397
|
{
|
|
1399
|
-
notifications:
|
|
1400
|
-
activeTab:
|
|
1401
|
-
onTabChange: (p) =>
|
|
1402
|
-
size:
|
|
1398
|
+
notifications: s,
|
|
1399
|
+
activeTab: E,
|
|
1400
|
+
onTabChange: (p) => D(p),
|
|
1401
|
+
size: g
|
|
1403
1402
|
}
|
|
1404
1403
|
),
|
|
1405
|
-
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto widget-scrollbar bg-[var(--widget-background)] max-h-[calc(var(--widget-popover-max-height)-200px)]", children: /* @__PURE__ */ t(
|
|
1404
|
+
/* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto widget-scrollbar bg-[var(--widget-background)] max-h-[calc(var(--widget-popover-max-height)-200px)]", children: /* @__PURE__ */ t(G, { fallback: /* @__PURE__ */ t(Te, {}), children: /* @__PURE__ */ t(
|
|
1406
1405
|
Re,
|
|
1407
1406
|
{
|
|
1408
|
-
notifications:
|
|
1409
|
-
onNotificationAction:
|
|
1407
|
+
notifications: oe,
|
|
1408
|
+
onNotificationAction: m
|
|
1410
1409
|
}
|
|
1411
1410
|
) }) }),
|
|
1412
|
-
|
|
1411
|
+
F > 0 && /* @__PURE__ */ t("div", { className: "flex-shrink-0 px-4 py-2.5 border-t border-[var(--widget-border)] bg-[var(--widget-bg-hover)]", children: /* @__PURE__ */ t(
|
|
1413
1412
|
"button",
|
|
1414
1413
|
{
|
|
1415
1414
|
type: "button",
|
|
1416
1415
|
className: "w-full px-4 py-2 text-sm font-medium text-[var(--widget-primary)] hover:text-[var(--widget-primary-hover)] hover:bg-[var(--widget-primary-light)] rounded-lg transition-colors",
|
|
1417
1416
|
onClick: () => {
|
|
1418
|
-
const p =
|
|
1419
|
-
|
|
1417
|
+
const p = s.filter((N) => !N.isRead).map((N) => N.id);
|
|
1418
|
+
le(p);
|
|
1420
1419
|
},
|
|
1421
|
-
"aria-label": `Mark all ${
|
|
1420
|
+
"aria-label": `Mark all ${F} notifications as read`,
|
|
1422
1421
|
children: "Mark all as read"
|
|
1423
1422
|
}
|
|
1424
1423
|
) })
|
|
1425
|
-
] }) : /* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto widget-scrollbar", children: /* @__PURE__ */ t(
|
|
1426
|
-
|
|
1424
|
+
] }) : /* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto widget-scrollbar", children: /* @__PURE__ */ t(G, { fallback: /* @__PURE__ */ t(Y, {}), children: c && h ? /* @__PURE__ */ t(
|
|
1425
|
+
De,
|
|
1427
1426
|
{
|
|
1428
|
-
preferences:
|
|
1429
|
-
onPreferenceChange:
|
|
1430
|
-
isLoading:
|
|
1427
|
+
preferences: c,
|
|
1428
|
+
onPreferenceChange: h,
|
|
1429
|
+
isLoading: f,
|
|
1431
1430
|
onBack: () => i("notifications"),
|
|
1432
|
-
onMorePreferencesClick:
|
|
1433
|
-
specificPreferences:
|
|
1434
|
-
onLoadMoreSpecific:
|
|
1435
|
-
hasMoreSpecific:
|
|
1436
|
-
isListLoading:
|
|
1431
|
+
onMorePreferencesClick: x,
|
|
1432
|
+
specificPreferences: y,
|
|
1433
|
+
onLoadMoreSpecific: b,
|
|
1434
|
+
hasMoreSpecific: w,
|
|
1435
|
+
isListLoading: o
|
|
1437
1436
|
}
|
|
1438
|
-
) : /* @__PURE__ */ t(
|
|
1437
|
+
) : /* @__PURE__ */ t(Y, {}) }) })
|
|
1439
1438
|
]
|
|
1440
1439
|
}
|
|
1441
1440
|
)
|
|
1442
1441
|
] });
|
|
1443
1442
|
};
|
|
1444
1443
|
export {
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1444
|
+
We as B,
|
|
1445
|
+
G as C,
|
|
1446
|
+
Ye as I,
|
|
1447
|
+
Je as L,
|
|
1448
|
+
Ke as M,
|
|
1449
|
+
Ie as N,
|
|
1450
|
+
De as P,
|
|
1451
|
+
Ge as S,
|
|
1452
|
+
qe as a
|
|
1454
1453
|
};
|
|
1455
|
-
//# sourceMappingURL=components-
|
|
1454
|
+
//# sourceMappingURL=components-B4vlr39f.js.map
|