@edusight/notification-widget 1.0.40 → 1.0.43
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-CJcM_JjP.cjs +70 -0
- package/dist/{components-D9Q1H53S.cjs.map → components-CJcM_JjP.cjs.map} +1 -1
- package/dist/{components-DqQ0ehzG.js → components-DUT08KJF.js} +436 -584
- package/dist/{components-DqQ0ehzG.js.map → components-DUT08KJF.js.map} +1 -1
- package/dist/hooks-C6Z38jT_.cjs +2 -0
- package/dist/hooks-C6Z38jT_.cjs.map +1 -0
- package/dist/{hooks-C7dzVxIU.js → hooks-S0z2_-4B.js} +63 -50
- package/dist/hooks-S0z2_-4B.js.map +1 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.esm.js +177 -156
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/dist/components-D9Q1H53S.cjs +0 -71
- package/dist/hooks-C7dzVxIU.js.map +0 -1
- package/dist/hooks-kLhwdW29.cjs +0 -2
- package/dist/hooks-kLhwdW29.cjs.map +0 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { jsxs as
|
|
3
|
-
var
|
|
1
|
+
import C, { Component as ce, useState as k, useRef as j, useEffect as I, useCallback as z, useMemo as Z } from "react";
|
|
2
|
+
import { jsxs as o, jsx as t, Fragment as H } from "react/jsx-runtime";
|
|
3
|
+
var ee = {
|
|
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
|
+
}, W = C.createContext && /* @__PURE__ */ C.createContext(ee), de = ["attr", "size", "title"];
|
|
10
|
+
function ue(e, r) {
|
|
11
11
|
if (e == null) return {};
|
|
12
|
-
var a =
|
|
12
|
+
var a = he(e, r), n, i;
|
|
13
13
|
if (Object.getOwnPropertySymbols) {
|
|
14
14
|
var l = Object.getOwnPropertySymbols(e);
|
|
15
|
-
for (
|
|
16
|
-
n = l[
|
|
15
|
+
for (i = 0; i < l.length; i++)
|
|
16
|
+
n = l[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 he(e, r) {
|
|
21
21
|
if (e == null) return {};
|
|
22
22
|
var a = {};
|
|
23
23
|
for (var n in e)
|
|
@@ -27,45 +27,45 @@ function pe(e, r) {
|
|
|
27
27
|
}
|
|
28
28
|
return a;
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
return
|
|
30
|
+
function L() {
|
|
31
|
+
return L = Object.assign ? Object.assign.bind() : function(e) {
|
|
32
32
|
for (var r = 1; r < arguments.length; r++) {
|
|
33
33
|
var a = arguments[r];
|
|
34
34
|
for (var n in a)
|
|
35
35
|
Object.prototype.hasOwnProperty.call(a, n) && (e[n] = a[n]);
|
|
36
36
|
}
|
|
37
37
|
return e;
|
|
38
|
-
},
|
|
38
|
+
}, L.apply(this, arguments);
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function K(e, r) {
|
|
41
41
|
var a = Object.keys(e);
|
|
42
42
|
if (Object.getOwnPropertySymbols) {
|
|
43
43
|
var n = Object.getOwnPropertySymbols(e);
|
|
44
|
-
r && (n = n.filter(function(
|
|
45
|
-
return Object.getOwnPropertyDescriptor(e,
|
|
44
|
+
r && (n = n.filter(function(i) {
|
|
45
|
+
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
|
46
46
|
})), a.push.apply(a, n);
|
|
47
47
|
}
|
|
48
48
|
return a;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
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 ? K(Object(a), !0).forEach(function(n) {
|
|
54
|
+
me(e, n, a[n]);
|
|
55
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(a)) : K(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 me(e, r, a) {
|
|
62
|
+
return r = ge(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 ge(e) {
|
|
65
|
+
var r = fe(e, "string");
|
|
66
66
|
return typeof r == "symbol" ? r : r + "";
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function fe(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 xe(e, r) {
|
|
|
75
75
|
}
|
|
76
76
|
return (r === "string" ? String : Number)(e);
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
return e && e.map((r, a) => /* @__PURE__ */
|
|
78
|
+
function te(e) {
|
|
79
|
+
return e && e.map((r, a) => /* @__PURE__ */ C.createElement(r.tag, T({
|
|
80
80
|
key: a
|
|
81
|
-
}, r.attr),
|
|
81
|
+
}, r.attr), te(r.child)));
|
|
82
82
|
}
|
|
83
|
-
function
|
|
84
|
-
return (r) => /* @__PURE__ */
|
|
85
|
-
attr:
|
|
86
|
-
}, r),
|
|
83
|
+
function v(e) {
|
|
84
|
+
return (r) => /* @__PURE__ */ C.createElement(pe, L({
|
|
85
|
+
attr: T({}, e.attr)
|
|
86
|
+
}, r), te(e.child));
|
|
87
87
|
}
|
|
88
|
-
function
|
|
88
|
+
function pe(e) {
|
|
89
89
|
var r = (a) => {
|
|
90
90
|
var {
|
|
91
91
|
attr: n,
|
|
92
|
-
size:
|
|
92
|
+
size: i,
|
|
93
93
|
title: l
|
|
94
|
-
} = e, u =
|
|
95
|
-
return a.className && (
|
|
94
|
+
} = e, u = ue(e, de), h = i || a.size || "1em", c;
|
|
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
99
|
}, a.attr, n, u, {
|
|
100
|
-
className:
|
|
101
|
-
style:
|
|
100
|
+
className: c,
|
|
101
|
+
style: T(T({
|
|
102
102
|
color: e.color || a.color
|
|
103
103
|
}, a.style), e.style),
|
|
104
104
|
height: h,
|
|
105
105
|
width: h,
|
|
106
106
|
xmlns: "http://www.w3.org/2000/svg"
|
|
107
|
-
}), l && /* @__PURE__ */
|
|
107
|
+
}), l && /* @__PURE__ */ C.createElement("title", null, l), e.children);
|
|
108
108
|
};
|
|
109
|
-
return
|
|
109
|
+
return W !== void 0 ? /* @__PURE__ */ C.createElement(W.Consumer, null, (a) => r(a)) : r(ee);
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
return
|
|
111
|
+
function ve(e) {
|
|
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 Ue = ({
|
|
115
115
|
unreadCount: e,
|
|
116
116
|
onClick: r,
|
|
117
117
|
className: a = "",
|
|
118
118
|
disabled: n = !1
|
|
119
119
|
}) => {
|
|
120
|
-
const
|
|
121
|
-
n || (
|
|
122
|
-
}, u =
|
|
123
|
-
return /* @__PURE__ */
|
|
120
|
+
const i = (c) => c === 0 ? "" : c > 99 ? "99+" : c.toString(), l = (c) => {
|
|
121
|
+
n || (c.key === "Enter" || c.key === " ") && (c.preventDefault(), r());
|
|
122
|
+
}, u = i(e), h = e > 0;
|
|
123
|
+
return /* @__PURE__ */ o(
|
|
124
124
|
"button",
|
|
125
125
|
{
|
|
126
126
|
type: "button",
|
|
@@ -146,8 +146,8 @@ const Ge = ({
|
|
|
146
146
|
"data-testid": "bell-component",
|
|
147
147
|
"data-mx-widget": "bell",
|
|
148
148
|
children: [
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */ t(
|
|
149
|
+
/* @__PURE__ */ o("div", { className: "relative inline-flex items-center justify-center text-align-center", children: [
|
|
150
|
+
/* @__PURE__ */ t(ve, { className: "w-6 h-6" }),
|
|
151
151
|
h && /* @__PURE__ */ t(
|
|
152
152
|
"span",
|
|
153
153
|
{
|
|
@@ -175,7 +175,7 @@ const Ge = ({
|
|
|
175
175
|
}
|
|
176
176
|
);
|
|
177
177
|
};
|
|
178
|
-
class
|
|
178
|
+
class q extends ce {
|
|
179
179
|
constructor(r) {
|
|
180
180
|
super(r), this.state = {
|
|
181
181
|
hasError: !1,
|
|
@@ -189,8 +189,8 @@ class X extends me {
|
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
191
|
componentDidCatch(r, a) {
|
|
192
|
-
const { componentName: n = "Unknown Component", onError:
|
|
193
|
-
|
|
192
|
+
const { componentName: n = "Unknown Component", onError: i } = this.props;
|
|
193
|
+
i && i(r, a);
|
|
194
194
|
}
|
|
195
195
|
render() {
|
|
196
196
|
return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ t(
|
|
@@ -198,7 +198,7 @@ class X extends me {
|
|
|
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__ */ o("span", { children: [
|
|
202
202
|
"Unable to load ",
|
|
203
203
|
this.props.componentName || "component"
|
|
204
204
|
] })
|
|
@@ -206,71 +206,68 @@ class X extends me {
|
|
|
206
206
|
) : this.props.children;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
return
|
|
211
|
-
}
|
|
212
|
-
function Ne(e) {
|
|
213
|
-
return w({ 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);
|
|
209
|
+
function V(e) {
|
|
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);
|
|
214
211
|
}
|
|
215
|
-
function
|
|
216
|
-
return
|
|
212
|
+
function be(e) {
|
|
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);
|
|
217
214
|
}
|
|
218
|
-
function
|
|
219
|
-
return
|
|
215
|
+
function xe(e) {
|
|
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);
|
|
220
217
|
}
|
|
221
|
-
function
|
|
222
|
-
return
|
|
218
|
+
function re(e) {
|
|
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);
|
|
223
220
|
}
|
|
224
|
-
function
|
|
225
|
-
return
|
|
221
|
+
function We(e) {
|
|
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);
|
|
226
223
|
}
|
|
227
|
-
function
|
|
228
|
-
return
|
|
224
|
+
function we(e) {
|
|
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);
|
|
229
226
|
}
|
|
230
|
-
function
|
|
231
|
-
return
|
|
227
|
+
function ye(e) {
|
|
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);
|
|
232
229
|
}
|
|
233
|
-
function
|
|
234
|
-
return
|
|
230
|
+
function ae(e) {
|
|
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);
|
|
235
232
|
}
|
|
236
|
-
function
|
|
237
|
-
return
|
|
233
|
+
function Ne(e) {
|
|
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);
|
|
238
235
|
}
|
|
239
|
-
function
|
|
240
|
-
return
|
|
236
|
+
function ke(e) {
|
|
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);
|
|
241
238
|
}
|
|
242
|
-
function
|
|
243
|
-
return
|
|
239
|
+
function Ce(e) {
|
|
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);
|
|
244
241
|
}
|
|
245
|
-
function
|
|
246
|
-
return
|
|
242
|
+
function Me(e) {
|
|
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);
|
|
247
244
|
}
|
|
248
|
-
function
|
|
249
|
-
return
|
|
245
|
+
function ne(e) {
|
|
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);
|
|
250
247
|
}
|
|
251
|
-
function
|
|
252
|
-
return
|
|
248
|
+
function ze(e) {
|
|
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);
|
|
253
250
|
}
|
|
254
|
-
function
|
|
255
|
-
return
|
|
251
|
+
function je(e) {
|
|
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);
|
|
256
253
|
}
|
|
257
|
-
function
|
|
258
|
-
return
|
|
254
|
+
function Ke(e) {
|
|
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);
|
|
259
256
|
}
|
|
260
257
|
function Ee(e) {
|
|
261
|
-
return
|
|
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);
|
|
262
259
|
}
|
|
263
|
-
function
|
|
264
|
-
return
|
|
260
|
+
function G(e) {
|
|
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);
|
|
265
262
|
}
|
|
266
|
-
function
|
|
267
|
-
return
|
|
263
|
+
function He(e) {
|
|
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);
|
|
268
265
|
}
|
|
269
|
-
function
|
|
270
|
-
return
|
|
266
|
+
function ie(e) {
|
|
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);
|
|
271
268
|
}
|
|
272
|
-
const
|
|
273
|
-
/* @__PURE__ */ t("div", { className: "text-[var(--widget-text-tertiary)] mb-2", children: /* @__PURE__ */ t(
|
|
269
|
+
const Le = ({ onRetry: e, error: r }) => /* @__PURE__ */ o("div", { className: "p-3 text-center", "data-testid": "notifications-fallback", children: [
|
|
270
|
+
/* @__PURE__ */ t("div", { className: "text-[var(--widget-text-tertiary)] mb-2", children: /* @__PURE__ */ t(V, { className: "w-12 h-12 mx-auto" }) }),
|
|
274
271
|
/* @__PURE__ */ t("p", { className: "text-sm text-[var(--widget-text-secondary)] mb-3", children: r ? "Failed to load notifications" : "No notifications available" }),
|
|
275
272
|
e && /* @__PURE__ */ t(
|
|
276
273
|
"button",
|
|
@@ -281,10 +278,10 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
281
278
|
children: "Try again"
|
|
282
279
|
}
|
|
283
280
|
)
|
|
284
|
-
] }),
|
|
285
|
-
/* @__PURE__ */ t("div", { className: "text-[var(--widget-text-tertiary)] mb-2", children: /* @__PURE__ */ t(
|
|
281
|
+
] }), J = ({ onRetry: e, onBack: r }) => /* @__PURE__ */ o("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(re, { className: "w-12 h-12 mx-auto" }) }),
|
|
286
283
|
/* @__PURE__ */ t("p", { className: "text-sm text-[var(--widget-text-secondary)] mb-3", children: "Unable to load preferences" }),
|
|
287
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ o("div", { className: "space-x-2", children: [
|
|
288
285
|
e && /* @__PURE__ */ t(
|
|
289
286
|
"button",
|
|
290
287
|
{
|
|
@@ -304,13 +301,13 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
304
301
|
}
|
|
305
302
|
)
|
|
306
303
|
] })
|
|
307
|
-
] }),
|
|
304
|
+
] }), qe = ({ onRetry: e, error: r }) => /* @__PURE__ */ o(
|
|
308
305
|
"div",
|
|
309
306
|
{
|
|
310
307
|
className: "p-3 text-center bg-[var(--widget-warning)]/10 border border-[var(--widget-warning)]/20 rounded-lg",
|
|
311
308
|
"data-testid": "sdk-connection-fallback",
|
|
312
309
|
children: [
|
|
313
|
-
/* @__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(we, { className: "w-12 h-12 mx-auto" }) }),
|
|
314
311
|
/* @__PURE__ */ t("p", { className: "text-sm text-[var(--widget-warning)] mb-3 font-medium", children: "Connection to notification service failed" }),
|
|
315
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 }),
|
|
316
313
|
e && /* @__PURE__ */ t(
|
|
@@ -324,10 +321,10 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
324
321
|
)
|
|
325
322
|
]
|
|
326
323
|
}
|
|
327
|
-
),
|
|
324
|
+
), Ge = ({ message: e = "Loading..." }) => /* @__PURE__ */ o("div", { className: "p-3 text-center", "data-testid": "loading-fallback", children: [
|
|
328
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" }),
|
|
329
326
|
/* @__PURE__ */ t("p", { className: "text-sm text-[var(--widget-text-secondary)]", children: e })
|
|
330
|
-
] }),
|
|
327
|
+
] }), Te = (e, r) => {
|
|
331
328
|
switch (r) {
|
|
332
329
|
case "all":
|
|
333
330
|
return e;
|
|
@@ -340,129 +337,129 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
340
337
|
}
|
|
341
338
|
return e;
|
|
342
339
|
}
|
|
343
|
-
},
|
|
340
|
+
}, Se = (e, r) => {
|
|
344
341
|
if (!r.trim())
|
|
345
342
|
return e;
|
|
346
343
|
const a = r.toLowerCase().trim();
|
|
347
344
|
return e.filter((n) => {
|
|
348
|
-
const
|
|
349
|
-
return
|
|
345
|
+
const i = n.subject.toLowerCase(), l = n.body.toLowerCase(), u = n.tags.join(" ").toLowerCase();
|
|
346
|
+
return i.includes(a) || l.includes(a) || u.includes(a);
|
|
350
347
|
});
|
|
351
|
-
},
|
|
348
|
+
}, Oe = (e, r) => {
|
|
352
349
|
const a = [...e];
|
|
353
350
|
switch (r) {
|
|
354
351
|
case "newest":
|
|
355
|
-
return a.sort((n,
|
|
352
|
+
return a.sort((n, i) => i.timestamp.getTime() - n.timestamp.getTime());
|
|
356
353
|
case "oldest":
|
|
357
|
-
return a.sort((n,
|
|
354
|
+
return a.sort((n, i) => n.timestamp.getTime() - i.timestamp.getTime());
|
|
358
355
|
case "unread-first":
|
|
359
|
-
return a.sort((n,
|
|
356
|
+
return a.sort((n, i) => n.isRead === i.isRead ? i.timestamp.getTime() - n.timestamp.getTime() : n.isRead ? 1 : -1);
|
|
360
357
|
case "read-first":
|
|
361
|
-
return a.sort((n,
|
|
358
|
+
return a.sort((n, i) => n.isRead === i.isRead ? i.timestamp.getTime() - n.timestamp.getTime() : n.isRead ? -1 : 1);
|
|
362
359
|
default:
|
|
363
360
|
return a;
|
|
364
361
|
}
|
|
365
|
-
},
|
|
366
|
-
let
|
|
367
|
-
return
|
|
362
|
+
}, $e = (e, r, a, n = "newest") => {
|
|
363
|
+
let i = e;
|
|
364
|
+
return i = Te(i, r), a && (i = Se(i, a)), i = Oe(i, n), i;
|
|
368
365
|
}, Pe = ({
|
|
369
366
|
selectedNotifications: e,
|
|
370
367
|
onMarkAllAsRead: r,
|
|
371
368
|
onMarkAllAsUnread: a,
|
|
372
369
|
onArchiveAll: n,
|
|
373
|
-
onDeleteAll:
|
|
370
|
+
onDeleteAll: i,
|
|
374
371
|
onClearSelection: l,
|
|
375
372
|
className: u = ""
|
|
376
373
|
}) => {
|
|
377
|
-
const [h,
|
|
374
|
+
const [h, c] = k(!1), [m, f] = k(null), g = e.length, x = async (y, b) => {
|
|
378
375
|
if (g !== 0) {
|
|
379
|
-
|
|
376
|
+
c(!0), f(null);
|
|
380
377
|
try {
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
} catch (
|
|
384
|
-
|
|
378
|
+
const w = await y(e);
|
|
379
|
+
f(w), w.success && l();
|
|
380
|
+
} catch (w) {
|
|
381
|
+
f({
|
|
385
382
|
success: !1,
|
|
386
383
|
processedCount: 0,
|
|
387
384
|
failedCount: g,
|
|
388
|
-
errors: [{ notificationId: "", error:
|
|
385
|
+
errors: [{ notificationId: "", error: w }]
|
|
389
386
|
});
|
|
390
387
|
} finally {
|
|
391
|
-
|
|
388
|
+
c(!1);
|
|
392
389
|
}
|
|
393
390
|
}
|
|
394
391
|
};
|
|
395
|
-
return g === 0 ? null : /* @__PURE__ */
|
|
396
|
-
/* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
398
|
-
/* @__PURE__ */
|
|
392
|
+
return g === 0 ? null : /* @__PURE__ */ o("div", { className: `border-t border-border bg-widget-primary-light p-2 ${u}`, children: [
|
|
393
|
+
/* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
|
|
394
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
395
|
+
/* @__PURE__ */ o("span", { className: "text-sm font-medium text-widget-primary", children: [
|
|
399
396
|
g,
|
|
400
397
|
" notification",
|
|
401
398
|
g !== 1 ? "s" : "",
|
|
402
399
|
" selected"
|
|
403
400
|
] }),
|
|
404
|
-
m && !m.success && /* @__PURE__ */
|
|
401
|
+
m && !m.success && /* @__PURE__ */ o("span", { className: "text-xs text-[var(--widget-error)]", children: [
|
|
405
402
|
m.failedCount,
|
|
406
403
|
" failed"
|
|
407
404
|
] })
|
|
408
405
|
] }),
|
|
409
|
-
/* @__PURE__ */
|
|
410
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
|
|
407
|
+
/* @__PURE__ */ o(
|
|
411
408
|
"button",
|
|
412
409
|
{
|
|
413
410
|
type: "button",
|
|
414
|
-
onClick: () =>
|
|
411
|
+
onClick: () => x(r),
|
|
415
412
|
disabled: h,
|
|
416
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",
|
|
417
414
|
"data-testid": "bulk-mark-read",
|
|
418
415
|
children: [
|
|
419
|
-
/* @__PURE__ */ t(
|
|
416
|
+
/* @__PURE__ */ t(V, { className: "mr-1 w-4 h-4" }),
|
|
420
417
|
"Mark Read"
|
|
421
418
|
]
|
|
422
419
|
}
|
|
423
420
|
),
|
|
424
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ o(
|
|
425
422
|
"button",
|
|
426
423
|
{
|
|
427
424
|
type: "button",
|
|
428
|
-
onClick: () =>
|
|
425
|
+
onClick: () => x(a),
|
|
429
426
|
disabled: h,
|
|
430
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",
|
|
431
428
|
"data-testid": "bulk-mark-unread",
|
|
432
429
|
children: [
|
|
433
|
-
/* @__PURE__ */ t(
|
|
430
|
+
/* @__PURE__ */ t(ie, { className: "mr-1 w-4 h-4" }),
|
|
434
431
|
"Mark Unread"
|
|
435
432
|
]
|
|
436
433
|
}
|
|
437
434
|
),
|
|
438
|
-
/* @__PURE__ */
|
|
435
|
+
/* @__PURE__ */ o(
|
|
439
436
|
"button",
|
|
440
437
|
{
|
|
441
438
|
type: "button",
|
|
442
|
-
onClick: () =>
|
|
439
|
+
onClick: () => x(n),
|
|
443
440
|
disabled: h,
|
|
444
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",
|
|
445
442
|
"data-testid": "bulk-archive",
|
|
446
443
|
children: [
|
|
447
|
-
/* @__PURE__ */ t(
|
|
444
|
+
/* @__PURE__ */ t(ae, { className: "mr-1 w-4 h-4" }),
|
|
448
445
|
"Archive"
|
|
449
446
|
]
|
|
450
447
|
}
|
|
451
448
|
),
|
|
452
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ o(
|
|
453
450
|
"button",
|
|
454
451
|
{
|
|
455
452
|
type: "button",
|
|
456
453
|
onClick: () => {
|
|
457
454
|
window.confirm(
|
|
458
455
|
`Are you sure you want to delete ${g} notification${g !== 1 ? "s" : ""}? This action cannot be undone.`
|
|
459
|
-
) &&
|
|
456
|
+
) && x(i);
|
|
460
457
|
},
|
|
461
458
|
disabled: h,
|
|
462
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",
|
|
463
460
|
"data-testid": "bulk-delete",
|
|
464
461
|
children: [
|
|
465
|
-
/* @__PURE__ */ t(
|
|
462
|
+
/* @__PURE__ */ t(be, { className: "mr-1 w-4 h-4" }),
|
|
466
463
|
"Delete"
|
|
467
464
|
]
|
|
468
465
|
}
|
|
@@ -476,22 +473,22 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
476
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",
|
|
477
474
|
"data-testid": "clear-selection",
|
|
478
475
|
"aria-label": "Clear selection",
|
|
479
|
-
children: /* @__PURE__ */ t(
|
|
476
|
+
children: /* @__PURE__ */ t(ne, { className: "w-5 h-5" })
|
|
480
477
|
}
|
|
481
478
|
)
|
|
482
479
|
] })
|
|
483
480
|
] }),
|
|
484
|
-
h && /* @__PURE__ */
|
|
481
|
+
h && /* @__PURE__ */ o("div", { className: "mt-2 flex items-center gap-2", children: [
|
|
485
482
|
/* @__PURE__ */ t("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--widget-primary)]" }),
|
|
486
483
|
/* @__PURE__ */ t("span", { className: "text-xs text-[var(--widget-primary)]", children: "Processing..." })
|
|
487
484
|
] }),
|
|
488
|
-
m && /* @__PURE__ */ t("div", { className: "mt-2", children: m.success ? /* @__PURE__ */
|
|
485
|
+
m && /* @__PURE__ */ t("div", { className: "mt-2", children: m.success ? /* @__PURE__ */ o("div", { className: "text-xs text-[var(--widget-success)]", children: [
|
|
489
486
|
"Successfully processed ",
|
|
490
487
|
m.processedCount,
|
|
491
488
|
" notification",
|
|
492
489
|
m.processedCount !== 1 ? "s" : ""
|
|
493
|
-
] }) : /* @__PURE__ */
|
|
494
|
-
m.processedCount > 0 && /* @__PURE__ */
|
|
490
|
+
] }) : /* @__PURE__ */ o("div", { className: "text-xs text-[var(--widget-error)]", children: [
|
|
491
|
+
m.processedCount > 0 && /* @__PURE__ */ o("span", { children: [
|
|
495
492
|
"Processed ",
|
|
496
493
|
m.processedCount,
|
|
497
494
|
", "
|
|
@@ -502,116 +499,131 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
502
499
|
m.failedCount !== 1 ? "s" : ""
|
|
503
500
|
] }) })
|
|
504
501
|
] });
|
|
505
|
-
},
|
|
502
|
+
}, Y = ({
|
|
506
503
|
title: e = "No Items",
|
|
507
504
|
description: r = "There are no items to display",
|
|
508
505
|
icon: a
|
|
509
|
-
}) => /* @__PURE__ */
|
|
506
|
+
}) => /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center py-8 px-4", children: [
|
|
510
507
|
a && /* @__PURE__ */ t("div", { className: "mb-4 text-gray-300", children: a }),
|
|
511
508
|
/* @__PURE__ */ t("h3", { className: "text-lg font-medium text-[var(--widget-text)] mb-2", children: e }),
|
|
512
509
|
/* @__PURE__ */ t("p", { className: "text-sm text-text-gray-300 text-center", children: r })
|
|
513
|
-
] }),
|
|
510
|
+
] }), B = ({
|
|
514
511
|
content: e,
|
|
515
512
|
children: r,
|
|
516
513
|
position: a = "top",
|
|
517
514
|
delay: n = 200
|
|
518
515
|
}) => {
|
|
519
|
-
const [
|
|
520
|
-
|
|
516
|
+
const [i, l] = k(!1), [u, h] = k({ x: 0, y: 0 }), c = j(null), m = j(null), f = () => {
|
|
517
|
+
c.current && clearTimeout(c.current), c.current = setTimeout(() => {
|
|
521
518
|
if (m.current) {
|
|
522
|
-
const
|
|
523
|
-
let
|
|
519
|
+
const b = m.current.getBoundingClientRect();
|
|
520
|
+
let w = 0, s = 0;
|
|
524
521
|
switch (a) {
|
|
525
522
|
case "top":
|
|
526
|
-
|
|
523
|
+
w = b.left + b.width / 2, s = b.top - 15;
|
|
527
524
|
break;
|
|
528
525
|
case "bottom":
|
|
529
|
-
|
|
526
|
+
w = b.left + b.width / 2, s = b.bottom + 15;
|
|
530
527
|
break;
|
|
531
528
|
case "left":
|
|
532
|
-
|
|
529
|
+
w = b.left - 15, s = b.top + b.height / 2;
|
|
533
530
|
break;
|
|
534
531
|
case "right":
|
|
535
|
-
|
|
532
|
+
w = b.right + 15, s = b.top + b.height / 2;
|
|
536
533
|
break;
|
|
537
534
|
}
|
|
538
|
-
h({ x:
|
|
535
|
+
h({ x: w, y: s }), l(!0);
|
|
539
536
|
}
|
|
540
537
|
}, n);
|
|
541
538
|
}, g = () => {
|
|
542
|
-
|
|
539
|
+
c.current && clearTimeout(c.current), l(!1);
|
|
543
540
|
};
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
}, [])
|
|
541
|
+
I(() => () => {
|
|
542
|
+
c.current && clearTimeout(c.current);
|
|
543
|
+
}, []);
|
|
544
|
+
const x = () => {
|
|
545
|
+
switch (a) {
|
|
546
|
+
case "top":
|
|
547
|
+
return { marginTop: "-8px" };
|
|
548
|
+
case "bottom":
|
|
549
|
+
return { marginTop: "8px" };
|
|
550
|
+
case "left":
|
|
551
|
+
return { marginLeft: "-8px" };
|
|
552
|
+
case "right":
|
|
553
|
+
return { marginLeft: "8px" };
|
|
554
|
+
default:
|
|
555
|
+
return {};
|
|
556
|
+
}
|
|
557
|
+
};
|
|
558
|
+
return /* @__PURE__ */ o(H, { children: [
|
|
547
559
|
/* @__PURE__ */ t(
|
|
548
560
|
"div",
|
|
549
561
|
{
|
|
550
562
|
ref: m,
|
|
551
|
-
onMouseEnter:
|
|
563
|
+
onMouseEnter: f,
|
|
552
564
|
onMouseLeave: g,
|
|
553
565
|
className: "inline-flex",
|
|
554
566
|
children: r
|
|
555
567
|
}
|
|
556
568
|
),
|
|
557
|
-
|
|
569
|
+
i && /* @__PURE__ */ t(
|
|
558
570
|
"div",
|
|
559
571
|
{
|
|
560
572
|
className: `
|
|
561
|
-
fixed z-50 px-2 py-1 text-xs font-medium text-[var(--widget-text)] rounded-md pointer-events-none
|
|
562
|
-
bg-[var(--widget-
|
|
573
|
+
fixed z-50 px-2 py-1 text-xs font-medium text-[var(--widget-text-secondary)] rounded-md pointer-events-none
|
|
574
|
+
bg-[var(--widget-bg-secondary)] shadow-lg
|
|
563
575
|
${{
|
|
564
576
|
top: "-translate-x-1/2 -translate-y-full",
|
|
565
|
-
bottom: "-translate-x-1/2
|
|
577
|
+
bottom: "-translate-x-1/2",
|
|
566
578
|
left: "-translate-x-full -translate-y-1/2",
|
|
567
|
-
right: "
|
|
579
|
+
right: "-translate-y-1/2"
|
|
568
580
|
}[a]}
|
|
569
581
|
animate-in fade-in-0 zoom-in-95 duration-200
|
|
570
582
|
`,
|
|
571
583
|
style: {
|
|
572
584
|
left: `${u.x}px`,
|
|
573
|
-
top: `${u.y}px
|
|
585
|
+
top: `${u.y}px`,
|
|
586
|
+
...x()
|
|
574
587
|
},
|
|
575
588
|
children: e
|
|
576
589
|
}
|
|
577
590
|
)
|
|
578
591
|
] });
|
|
579
|
-
},
|
|
592
|
+
}, Be = (e) => {
|
|
580
593
|
if (Number.isNaN(e.getTime())) return "Long ago";
|
|
581
|
-
const n = (/* @__PURE__ */ new Date()).getTime() - e.getTime(),
|
|
582
|
-
return
|
|
583
|
-
},
|
|
594
|
+
const n = (/* @__PURE__ */ new Date()).getTime() - e.getTime(), i = Math.floor(n / 6e4), l = Math.floor(n / 36e5), u = Math.floor(n / 864e5);
|
|
595
|
+
return i < 1 ? "Just now" : i < 60 ? `${i}m ago` : l < 24 ? `${l}h ago` : u < 7 ? `${u}d ago` : e.toLocaleDateString();
|
|
596
|
+
}, A = ({ type: e, className: r }) => {
|
|
584
597
|
const a = r || "w-4 h-4";
|
|
585
598
|
switch (e) {
|
|
586
599
|
case "mark_read":
|
|
587
|
-
return /* @__PURE__ */ t(
|
|
600
|
+
return /* @__PURE__ */ t(V, { className: a });
|
|
588
601
|
case "snooze":
|
|
589
|
-
return /* @__PURE__ */ t(
|
|
602
|
+
return /* @__PURE__ */ t(Ne, { className: a });
|
|
590
603
|
case "archive":
|
|
591
|
-
return /* @__PURE__ */ t(
|
|
604
|
+
return /* @__PURE__ */ t(ae, { className: a });
|
|
592
605
|
default:
|
|
593
606
|
return null;
|
|
594
607
|
}
|
|
595
|
-
},
|
|
608
|
+
}, Ae = ({
|
|
596
609
|
notification: e,
|
|
597
610
|
onActionClick: r,
|
|
598
611
|
onSelectionChange: a,
|
|
599
612
|
isSelected: n = !1
|
|
600
613
|
}) => {
|
|
601
|
-
const [
|
|
614
|
+
const [i, l] = k(!1), u = Number.isNaN(e.timestamp.getTime()), h = u ? void 0 : e.timestamp.toISOString(), c = Be(e.timestamp), m = (g) => {
|
|
602
615
|
r && r(e.id, g), l(!1);
|
|
603
|
-
},
|
|
616
|
+
}, f = () => {
|
|
604
617
|
a && a(!n);
|
|
605
618
|
};
|
|
606
|
-
return /* @__PURE__ */
|
|
619
|
+
return /* @__PURE__ */ o(
|
|
607
620
|
"div",
|
|
608
621
|
{
|
|
609
622
|
className: `
|
|
610
623
|
mx-widget-item relative group flex items-start gap-3 px-4 py-3 border-b border-border-light
|
|
611
624
|
transition-all duration-200
|
|
612
|
-
bg-widget-background hover:bg-widget-hover
|
|
613
625
|
min-w-[20rem]
|
|
614
|
-
${n ? "bg-widget-primary-light" : ""}
|
|
626
|
+
${n ? "bg-widget-primary-light" : e.isRead ? "bg-widget-background hover:bg-widget-hover" : "bg-blue-50/50 hover:bg-blue-50/70"}
|
|
615
627
|
`,
|
|
616
628
|
onMouseEnter: () => l(!0),
|
|
617
629
|
onMouseLeave: () => l(!1),
|
|
@@ -624,7 +636,7 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
624
636
|
{
|
|
625
637
|
type: "checkbox",
|
|
626
638
|
checked: n,
|
|
627
|
-
onChange:
|
|
639
|
+
onChange: f,
|
|
628
640
|
className: "w-4 h-4 text-[var(--widget-primary)] border-[var(--widget-border)] rounded cursor-pointer focus:ring-2 focus:ring-[var(--widget-primary)] focus:ring-offset-0",
|
|
629
641
|
"aria-label": `Select notification: ${e.subject}`
|
|
630
642
|
}
|
|
@@ -639,8 +651,8 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
639
651
|
loading: "lazy"
|
|
640
652
|
}
|
|
641
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() }) }) }),
|
|
642
|
-
/* @__PURE__ */
|
|
643
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
|
|
655
|
+
/* @__PURE__ */ o("div", { className: "flex items-start justify-between gap-2 mb-0.5", children: [
|
|
644
656
|
/* @__PURE__ */ t(
|
|
645
657
|
"h3",
|
|
646
658
|
{
|
|
@@ -658,30 +670,30 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
658
670
|
) })
|
|
659
671
|
] }),
|
|
660
672
|
/* @__PURE__ */ t("p", { className: "text-sm text-[var(--widget-text-secondary)] line-clamp-2 leading-relaxed mb-2", children: e.body }),
|
|
661
|
-
e.actions && e.actions.length > 0 && /* @__PURE__ */ t("div", { className: "flex items-center gap-2 mb-2", children: e.actions.map((g,
|
|
673
|
+
e.actions && e.actions.length > 0 && /* @__PURE__ */ t("div", { className: "flex items-center gap-2 mb-2", children: e.actions.map((g, x) => /* @__PURE__ */ t(
|
|
662
674
|
"button",
|
|
663
675
|
{
|
|
664
|
-
onClick: (
|
|
665
|
-
|
|
676
|
+
onClick: (y) => {
|
|
677
|
+
y.stopPropagation(), m(g);
|
|
666
678
|
},
|
|
667
679
|
className: `
|
|
668
680
|
px-3 py-1.5 rounded-md text-sm font-medium transition-colors
|
|
669
|
-
${
|
|
681
|
+
${x === 0 ? "bg-[var(--widget-primary)] text-[var(--widget-text)] hover:bg-[var(--widget-primary-hover)] shadow-sm" : "bg-transparent text-[var(--widget-text-secondary)] hover:bg-[var(--widget-bg-hover)] border border-[var(--widget-border)]"}
|
|
670
682
|
`,
|
|
671
683
|
"data-mx-widget": "action",
|
|
672
684
|
children: g.label
|
|
673
685
|
},
|
|
674
|
-
|
|
686
|
+
x
|
|
675
687
|
)) }),
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ t("time", { className: "text-xs text-[var(--widget-text-tertiary)]", dateTime: h, children:
|
|
678
|
-
/* @__PURE__ */
|
|
688
|
+
/* @__PURE__ */ o("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: h, children: c }) }),
|
|
690
|
+
/* @__PURE__ */ o(
|
|
679
691
|
"div",
|
|
680
692
|
{
|
|
681
|
-
className: `flex items-center gap-1 transition-opacity duration-200 ${
|
|
693
|
+
className: `flex items-center gap-1 transition-opacity duration-200 ${i ? "opacity-100" : "opacity-0"}`,
|
|
682
694
|
onClick: (g) => g.stopPropagation(),
|
|
683
695
|
children: [
|
|
684
|
-
/* @__PURE__ */ t(
|
|
696
|
+
/* @__PURE__ */ t(B, { content: "Mark as read", position: "top", children: /* @__PURE__ */ t(
|
|
685
697
|
"button",
|
|
686
698
|
{
|
|
687
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",
|
|
@@ -692,27 +704,27 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
692
704
|
}
|
|
693
705
|
}),
|
|
694
706
|
"aria-label": "Mark as read",
|
|
695
|
-
children: /* @__PURE__ */ t(
|
|
707
|
+
children: /* @__PURE__ */ t(A, { type: "mark_read" })
|
|
696
708
|
}
|
|
697
709
|
) }),
|
|
698
|
-
/* @__PURE__ */ t(
|
|
710
|
+
/* @__PURE__ */ t(B, { content: "Snooze", position: "top", children: /* @__PURE__ */ t(
|
|
699
711
|
"button",
|
|
700
712
|
{
|
|
701
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",
|
|
702
714
|
onClick: () => m({ type: "custom", label: "Snooze", handler: async () => {
|
|
703
715
|
} }),
|
|
704
716
|
"aria-label": "Snooze",
|
|
705
|
-
children: /* @__PURE__ */ t(
|
|
717
|
+
children: /* @__PURE__ */ t(A, { type: "snooze" })
|
|
706
718
|
}
|
|
707
719
|
) }),
|
|
708
|
-
/* @__PURE__ */ t(
|
|
720
|
+
/* @__PURE__ */ t(B, { content: "Archive", position: "top", children: /* @__PURE__ */ t(
|
|
709
721
|
"button",
|
|
710
722
|
{
|
|
711
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",
|
|
712
724
|
onClick: () => m({ type: "archive", label: "Archive", handler: async () => {
|
|
713
725
|
} }),
|
|
714
726
|
"aria-label": "Archive",
|
|
715
|
-
children: /* @__PURE__ */ t(
|
|
727
|
+
children: /* @__PURE__ */ t(A, { type: "archive" })
|
|
716
728
|
}
|
|
717
729
|
) })
|
|
718
730
|
]
|
|
@@ -720,7 +732,7 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
720
732
|
)
|
|
721
733
|
] })
|
|
722
734
|
] }),
|
|
723
|
-
/* @__PURE__ */
|
|
735
|
+
/* @__PURE__ */ o("div", { className: "sr-only", children: [
|
|
724
736
|
"Notification from",
|
|
725
737
|
" ",
|
|
726
738
|
u ? "Unknown time" : e.timestamp.toLocaleString(),
|
|
@@ -733,15 +745,15 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
733
745
|
]
|
|
734
746
|
}
|
|
735
747
|
);
|
|
736
|
-
},
|
|
748
|
+
}, Q = ({ count: e = 3 }) => /* @__PURE__ */ t(H, { children: Array.from({ length: e }).map((r, a) => /* @__PURE__ */ o(
|
|
737
749
|
"div",
|
|
738
750
|
{
|
|
739
751
|
className: "flex items-start gap-3 px-4 py-3 border-b border-border-light animate-pulse",
|
|
740
752
|
children: [
|
|
741
753
|
/* @__PURE__ */ t("div", { className: "flex-shrink-0", children: /* @__PURE__ */ t("div", { className: "w-10 h-10 rounded-full bg-widget-hover" }) }),
|
|
742
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ o("div", { className: "flex-1 space-y-2", children: [
|
|
743
755
|
/* @__PURE__ */ t("div", { className: "h-4 w-3/4 rounded bg-widget-hover" }),
|
|
744
|
-
/* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ o("div", { className: "space-y-1", children: [
|
|
745
757
|
/* @__PURE__ */ t("div", { className: "h-3 w-full rounded bg-widget-hover" }),
|
|
746
758
|
/* @__PURE__ */ t("div", { className: "h-3 w-5/6 rounded bg-widget-hover" })
|
|
747
759
|
] }),
|
|
@@ -751,50 +763,50 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
751
763
|
]
|
|
752
764
|
},
|
|
753
765
|
a
|
|
754
|
-
)) }),
|
|
766
|
+
)) }), Re = ({
|
|
755
767
|
notifications: e,
|
|
756
768
|
isLoading: r = !1,
|
|
757
769
|
error: a,
|
|
758
770
|
onNotificationAction: n,
|
|
759
|
-
selectedNotifications:
|
|
771
|
+
selectedNotifications: i = [],
|
|
760
772
|
onSelectionChange: l,
|
|
761
773
|
onSelectAll: u,
|
|
762
774
|
onLoadMore: h,
|
|
763
|
-
hasMore:
|
|
775
|
+
hasMore: c = !1,
|
|
764
776
|
className: m = ""
|
|
765
777
|
}) => {
|
|
766
|
-
const
|
|
767
|
-
|
|
768
|
-
if (!(!h || !
|
|
769
|
-
return
|
|
770
|
-
(
|
|
771
|
-
|
|
778
|
+
const f = j(null), g = j(null), [x, y] = k(!1);
|
|
779
|
+
I(() => {
|
|
780
|
+
if (!(!h || !c || x))
|
|
781
|
+
return f.current = new IntersectionObserver(
|
|
782
|
+
(s) => {
|
|
783
|
+
s[0].isIntersecting && c && !x && (y(!0), h(), setTimeout(() => y(!1), 500));
|
|
772
784
|
},
|
|
773
785
|
{
|
|
774
786
|
root: null,
|
|
775
787
|
rootMargin: "100px",
|
|
776
788
|
threshold: 0.1
|
|
777
789
|
}
|
|
778
|
-
), g.current &&
|
|
779
|
-
|
|
790
|
+
), g.current && f.current.observe(g.current), () => {
|
|
791
|
+
f.current && f.current.disconnect();
|
|
780
792
|
};
|
|
781
|
-
}, [h,
|
|
782
|
-
const
|
|
783
|
-
async (
|
|
793
|
+
}, [h, c, x]);
|
|
794
|
+
const b = z(
|
|
795
|
+
async (s, d) => {
|
|
784
796
|
try {
|
|
785
|
-
|
|
797
|
+
d.handler && await d.handler(s), n && d.type && n(s, d);
|
|
786
798
|
} catch {
|
|
787
799
|
}
|
|
788
800
|
},
|
|
789
801
|
[n]
|
|
790
|
-
),
|
|
791
|
-
(
|
|
792
|
-
l && l(
|
|
802
|
+
), w = z(
|
|
803
|
+
(s, d) => {
|
|
804
|
+
l && l(s, d);
|
|
793
805
|
},
|
|
794
806
|
[l]
|
|
795
807
|
);
|
|
796
|
-
return r && e.length === 0 ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background min-w-[20rem] ${m}`, children: /* @__PURE__ */ t(
|
|
797
|
-
|
|
808
|
+
return r && e.length === 0 ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background min-w-[20rem] ${m}`, children: /* @__PURE__ */ t(Q, { count: 5 }) }) : a ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background min-w-[20rem] ${m}`, children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center flex-1 py-12", children: /* @__PURE__ */ t(
|
|
809
|
+
Y,
|
|
798
810
|
{
|
|
799
811
|
title: "Error Loading Notifications",
|
|
800
812
|
description: "Failed to load notifications. Please try again.",
|
|
@@ -818,7 +830,7 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
818
830
|
)
|
|
819
831
|
}
|
|
820
832
|
) }) }) : e.length === 0 ? /* @__PURE__ */ t("div", { className: `flex flex-col h-full bg-widget-background min-w-[20rem] ${m}`, children: /* @__PURE__ */ t("div", { className: "flex items-center justify-center flex-1 py-12", children: /* @__PURE__ */ t(
|
|
821
|
-
|
|
833
|
+
Y,
|
|
822
834
|
{
|
|
823
835
|
title: "No Notifications",
|
|
824
836
|
description: "You're all caught up! No notifications to display.",
|
|
@@ -841,15 +853,15 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
841
853
|
}
|
|
842
854
|
)
|
|
843
855
|
}
|
|
844
|
-
) }) }) : /* @__PURE__ */
|
|
856
|
+
) }) }) : /* @__PURE__ */ o("div", { className: `flex flex-col h-full min-w-[20rem] ${m}`, children: [
|
|
845
857
|
u && n && /* @__PURE__ */ t(
|
|
846
858
|
Pe,
|
|
847
859
|
{
|
|
848
|
-
selectedNotifications:
|
|
849
|
-
onMarkAllAsRead: async (
|
|
860
|
+
selectedNotifications: i,
|
|
861
|
+
onMarkAllAsRead: async (s) => {
|
|
850
862
|
try {
|
|
851
|
-
for (const
|
|
852
|
-
n(
|
|
863
|
+
for (const d of s)
|
|
864
|
+
n(d, {
|
|
853
865
|
type: "mark_read",
|
|
854
866
|
label: "Mark as read",
|
|
855
867
|
handler: async () => {
|
|
@@ -857,23 +869,23 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
857
869
|
});
|
|
858
870
|
return {
|
|
859
871
|
success: !0,
|
|
860
|
-
processedCount:
|
|
872
|
+
processedCount: s.length,
|
|
861
873
|
failedCount: 0,
|
|
862
874
|
errors: []
|
|
863
875
|
};
|
|
864
|
-
} catch (
|
|
876
|
+
} catch (d) {
|
|
865
877
|
return {
|
|
866
878
|
success: !1,
|
|
867
879
|
processedCount: 0,
|
|
868
|
-
failedCount:
|
|
869
|
-
errors: [{ notificationId: "", error:
|
|
880
|
+
failedCount: s.length,
|
|
881
|
+
errors: [{ notificationId: "", error: d }]
|
|
870
882
|
};
|
|
871
883
|
}
|
|
872
884
|
},
|
|
873
|
-
onMarkAllAsUnread: async (
|
|
885
|
+
onMarkAllAsUnread: async (s) => {
|
|
874
886
|
try {
|
|
875
|
-
for (const
|
|
876
|
-
n(
|
|
887
|
+
for (const d of s)
|
|
888
|
+
n(d, {
|
|
877
889
|
type: "mark_unread",
|
|
878
890
|
label: "Mark as unread",
|
|
879
891
|
handler: async () => {
|
|
@@ -881,23 +893,23 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
881
893
|
});
|
|
882
894
|
return {
|
|
883
895
|
success: !0,
|
|
884
|
-
processedCount:
|
|
896
|
+
processedCount: s.length,
|
|
885
897
|
failedCount: 0,
|
|
886
898
|
errors: []
|
|
887
899
|
};
|
|
888
|
-
} catch (
|
|
900
|
+
} catch (d) {
|
|
889
901
|
return {
|
|
890
902
|
success: !1,
|
|
891
903
|
processedCount: 0,
|
|
892
|
-
failedCount:
|
|
893
|
-
errors: [{ notificationId: "", error:
|
|
904
|
+
failedCount: s.length,
|
|
905
|
+
errors: [{ notificationId: "", error: d }]
|
|
894
906
|
};
|
|
895
907
|
}
|
|
896
908
|
},
|
|
897
|
-
onArchiveAll: async (
|
|
909
|
+
onArchiveAll: async (s) => {
|
|
898
910
|
try {
|
|
899
|
-
for (const
|
|
900
|
-
n(
|
|
911
|
+
for (const d of s)
|
|
912
|
+
n(d, {
|
|
901
913
|
type: "archive",
|
|
902
914
|
label: "Archive",
|
|
903
915
|
handler: async () => {
|
|
@@ -905,23 +917,23 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
905
917
|
});
|
|
906
918
|
return {
|
|
907
919
|
success: !0,
|
|
908
|
-
processedCount:
|
|
920
|
+
processedCount: s.length,
|
|
909
921
|
failedCount: 0,
|
|
910
922
|
errors: []
|
|
911
923
|
};
|
|
912
|
-
} catch (
|
|
924
|
+
} catch (d) {
|
|
913
925
|
return {
|
|
914
926
|
success: !1,
|
|
915
927
|
processedCount: 0,
|
|
916
|
-
failedCount:
|
|
917
|
-
errors: [{ notificationId: "", error:
|
|
928
|
+
failedCount: s.length,
|
|
929
|
+
errors: [{ notificationId: "", error: d }]
|
|
918
930
|
};
|
|
919
931
|
}
|
|
920
932
|
},
|
|
921
|
-
onDeleteAll: async (
|
|
933
|
+
onDeleteAll: async (s) => {
|
|
922
934
|
try {
|
|
923
|
-
for (const
|
|
924
|
-
n(
|
|
935
|
+
for (const d of s)
|
|
936
|
+
n(d, {
|
|
925
937
|
type: "delete",
|
|
926
938
|
label: "Delete",
|
|
927
939
|
handler: async () => {
|
|
@@ -929,45 +941,45 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
929
941
|
});
|
|
930
942
|
return {
|
|
931
943
|
success: !0,
|
|
932
|
-
processedCount:
|
|
944
|
+
processedCount: s.length,
|
|
933
945
|
failedCount: 0,
|
|
934
946
|
errors: []
|
|
935
947
|
};
|
|
936
|
-
} catch (
|
|
948
|
+
} catch (d) {
|
|
937
949
|
return {
|
|
938
950
|
success: !1,
|
|
939
951
|
processedCount: 0,
|
|
940
|
-
failedCount:
|
|
941
|
-
errors: [{ notificationId: "", error:
|
|
952
|
+
failedCount: s.length,
|
|
953
|
+
errors: [{ notificationId: "", error: d }]
|
|
942
954
|
};
|
|
943
955
|
}
|
|
944
956
|
},
|
|
945
957
|
onClearSelection: () => u(!1)
|
|
946
958
|
}
|
|
947
959
|
),
|
|
948
|
-
/* @__PURE__ */ t("div", { className: "flex-1", children: /* @__PURE__ */
|
|
949
|
-
e.map((
|
|
950
|
-
|
|
960
|
+
/* @__PURE__ */ t("div", { className: "flex-1", children: /* @__PURE__ */ o("div", { children: [
|
|
961
|
+
e.map((s) => /* @__PURE__ */ t(
|
|
962
|
+
Ae,
|
|
951
963
|
{
|
|
952
|
-
notification:
|
|
953
|
-
onActionClick:
|
|
954
|
-
isSelected:
|
|
955
|
-
onSelectionChange: l ? (
|
|
964
|
+
notification: s,
|
|
965
|
+
onActionClick: b,
|
|
966
|
+
isSelected: i.includes(s.id),
|
|
967
|
+
onSelectionChange: l ? (d) => w(s.id, d) : void 0
|
|
956
968
|
},
|
|
957
|
-
|
|
969
|
+
s.id
|
|
958
970
|
)),
|
|
959
|
-
|
|
971
|
+
c && /* @__PURE__ */ t("div", { ref: g, className: "py-2", children: x && /* @__PURE__ */ t(Q, { count: 3 }) })
|
|
960
972
|
] }) })
|
|
961
973
|
] });
|
|
962
|
-
},
|
|
974
|
+
}, R = ({
|
|
963
975
|
id: e,
|
|
964
976
|
label: r,
|
|
965
977
|
checked: a,
|
|
966
978
|
onChange: n,
|
|
967
|
-
disabled:
|
|
979
|
+
disabled: i = !1,
|
|
968
980
|
icon: l
|
|
969
|
-
}) => /* @__PURE__ */
|
|
970
|
-
r && /* @__PURE__ */
|
|
981
|
+
}) => /* @__PURE__ */ o("div", { className: "flex items-center justify-between py-2.5", children: [
|
|
982
|
+
r && /* @__PURE__ */ o(
|
|
971
983
|
"label",
|
|
972
984
|
{
|
|
973
985
|
htmlFor: e,
|
|
@@ -985,14 +997,14 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
985
997
|
id: e,
|
|
986
998
|
role: "switch",
|
|
987
999
|
"aria-checked": a,
|
|
988
|
-
disabled:
|
|
1000
|
+
disabled: i,
|
|
989
1001
|
className: `relative inline-flex h-5 w-9 flex-shrink-0 rounded-full border-2 border-transparent
|
|
990
1002
|
transition-colors duration-200 ease-in-out
|
|
991
1003
|
focus:outline-none focus:ring-2 focus:ring-widget-primary focus:ring-offset-2
|
|
992
1004
|
${a ? "bg-widget-primary" : "bg-gray-300 dark:bg-gray-600"}
|
|
993
|
-
${
|
|
1005
|
+
${i ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
|
|
994
1006
|
`,
|
|
995
|
-
onClick: () => !
|
|
1007
|
+
onClick: () => !i && n(!a),
|
|
996
1008
|
children: /* @__PURE__ */ t(
|
|
997
1009
|
"span",
|
|
998
1010
|
{
|
|
@@ -1004,321 +1016,168 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
1004
1016
|
)
|
|
1005
1017
|
}
|
|
1006
1018
|
)
|
|
1007
|
-
] }),
|
|
1019
|
+
] }), Ie = {
|
|
1008
1020
|
sm: "w-4 h-4",
|
|
1009
1021
|
md: "w-8 h-8",
|
|
1010
1022
|
lg: "w-12 h-12"
|
|
1011
|
-
},
|
|
1023
|
+
}, X = ({
|
|
1012
1024
|
size: e = "md",
|
|
1013
1025
|
label: r = "Loading..."
|
|
1014
|
-
}) => /* @__PURE__ */
|
|
1026
|
+
}) => /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center gap-2", children: [
|
|
1015
1027
|
/* @__PURE__ */ t(
|
|
1016
1028
|
"div",
|
|
1017
1029
|
{
|
|
1018
|
-
className: `${
|
|
1030
|
+
className: `${Ie[e]} animate-spin rounded-full border-2 border-gray-300 dark:border-gray-600 border-t-blue-500 dark:border-t-blue-400`,
|
|
1019
1031
|
role: "status",
|
|
1020
1032
|
"aria-label": r
|
|
1021
1033
|
}
|
|
1022
1034
|
),
|
|
1023
1035
|
r && /* @__PURE__ */ t("p", { className: "text-sm text-gray-600 dark:text-gray-400", children: r })
|
|
1024
|
-
] }),
|
|
1036
|
+
] }), Ve = ({
|
|
1025
1037
|
preferences: e,
|
|
1026
1038
|
onPreferenceChange: r,
|
|
1027
1039
|
isLoading: a,
|
|
1028
1040
|
specificPreferences: n,
|
|
1029
|
-
onLoadMoreSpecific:
|
|
1041
|
+
onLoadMoreSpecific: i,
|
|
1030
1042
|
hasMoreSpecific: l,
|
|
1031
1043
|
isListLoading: u,
|
|
1032
1044
|
onMorePreferencesClick: h
|
|
1033
1045
|
}) => {
|
|
1034
|
-
const [
|
|
1046
|
+
const [c, m] = k({
|
|
1035
1047
|
global: !0,
|
|
1036
1048
|
schedule: !1
|
|
1037
|
-
}), [
|
|
1038
|
-
m((
|
|
1039
|
-
},
|
|
1040
|
-
|
|
1041
|
-
},
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
r(`subscriptions.${o}.channels.${p}`, M);
|
|
1047
|
-
}, f = (o) => {
|
|
1048
|
-
const p = [...e.deliverySchedule.weekdays];
|
|
1049
|
-
p[o] = !p[o], r("deliverySchedule.weekdays", p);
|
|
1050
|
-
}, A = (o) => {
|
|
1051
|
-
const { scrollTop: p, scrollHeight: M, clientHeight: E } = o.currentTarget;
|
|
1052
|
-
M - p - E < 50 && l && s && !u && s();
|
|
1053
|
-
}, S = (o) => {
|
|
1054
|
-
switch (o) {
|
|
1049
|
+
}), [f, g] = k({}), x = (s) => {
|
|
1050
|
+
m((d) => ({ ...d, [s]: !d[s] }));
|
|
1051
|
+
}, y = (s, d) => {
|
|
1052
|
+
r(`channels.${s}`, d);
|
|
1053
|
+
}, b = (s) => {
|
|
1054
|
+
const { scrollTop: d, scrollHeight: M, clientHeight: E } = s.currentTarget;
|
|
1055
|
+
M - d - E < 50 && l && i && !u && i();
|
|
1056
|
+
}, w = (s) => {
|
|
1057
|
+
switch (s) {
|
|
1055
1058
|
case "email":
|
|
1056
|
-
return /* @__PURE__ */ t(
|
|
1059
|
+
return /* @__PURE__ */ t(ye, { className: "w-4 h-4" });
|
|
1057
1060
|
case "push":
|
|
1058
|
-
return /* @__PURE__ */ t(
|
|
1061
|
+
return /* @__PURE__ */ t(G, { className: "w-4 h-4" });
|
|
1059
1062
|
case "sms":
|
|
1060
1063
|
return /* @__PURE__ */ t(Ee, { className: "w-4 h-4" });
|
|
1061
1064
|
case "inApp":
|
|
1062
|
-
return /* @__PURE__ */ t(
|
|
1065
|
+
return /* @__PURE__ */ t(ke, { className: "w-4 h-4" });
|
|
1063
1066
|
default:
|
|
1064
1067
|
return null;
|
|
1065
1068
|
}
|
|
1066
|
-
}
|
|
1067
|
-
return /* @__PURE__ */
|
|
1069
|
+
};
|
|
1070
|
+
return n || e.subscriptions, /* @__PURE__ */ o(
|
|
1068
1071
|
"div",
|
|
1069
1072
|
{
|
|
1070
|
-
className: "h-full overflow-y-auto widget-scrollbar p-2 bg-[var(--widget-background)]",
|
|
1073
|
+
className: "h-full overflow-y-auto widget-scrollbar min-w-[20rem] p-2 bg-[var(--widget-background)]",
|
|
1071
1074
|
"data-testid": "preferences-view",
|
|
1072
|
-
onScroll:
|
|
1075
|
+
onScroll: b,
|
|
1073
1076
|
children: [
|
|
1074
|
-
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(
|
|
1075
|
-
/* @__PURE__ */
|
|
1076
|
-
/* @__PURE__ */
|
|
1077
|
-
/* @__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(X, { size: "lg" }) }),
|
|
1078
|
+
/* @__PURE__ */ o("div", { className: "space-y-2", children: [
|
|
1079
|
+
/* @__PURE__ */ o("div", { className: "border border-[var(--widget-border)] rounded-lg overflow-hidden", children: [
|
|
1080
|
+
/* @__PURE__ */ o(
|
|
1078
1081
|
"button",
|
|
1079
1082
|
{
|
|
1080
1083
|
type: "button",
|
|
1081
|
-
onClick: () =>
|
|
1084
|
+
onClick: () => x("global"),
|
|
1082
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",
|
|
1083
1086
|
children: [
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
/* @__PURE__ */ t(
|
|
1087
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2 min-w-[20rem]", children: [
|
|
1088
|
+
/* @__PURE__ */ t(G, { className: "w-5 h-5 text-widget-primary" }),
|
|
1086
1089
|
/* @__PURE__ */ t("span", { className: "font-semibold text-sm text-text-primary", children: "Global Preferences" })
|
|
1087
1090
|
] }),
|
|
1088
|
-
|
|
1091
|
+
c.global ? /* @__PURE__ */ t(ze, { className: "w-5 h-5 text-text-secondary" }) : /* @__PURE__ */ t(je, { className: "w-5 h-5 text-text-secondary" })
|
|
1089
1092
|
]
|
|
1090
1093
|
}
|
|
1091
1094
|
),
|
|
1092
|
-
|
|
1095
|
+
c.global && /* @__PURE__ */ o("div", { className: " min-w-[20rem] px-2 pb-1.5 divide-y divide-border-light bg-[var(--widget-background)]", children: [
|
|
1093
1096
|
/* @__PURE__ */ t(
|
|
1094
|
-
|
|
1097
|
+
R,
|
|
1095
1098
|
{
|
|
1096
1099
|
id: "channel-email",
|
|
1097
1100
|
label: "Email",
|
|
1098
|
-
icon:
|
|
1101
|
+
icon: w("email"),
|
|
1099
1102
|
checked: e.channels.email,
|
|
1100
|
-
onChange: (
|
|
1103
|
+
onChange: (s) => y("email", s),
|
|
1101
1104
|
disabled: a
|
|
1102
1105
|
}
|
|
1103
1106
|
),
|
|
1104
1107
|
/* @__PURE__ */ t(
|
|
1105
|
-
|
|
1108
|
+
R,
|
|
1106
1109
|
{
|
|
1107
1110
|
id: "channel-inapp",
|
|
1108
1111
|
label: "In-App",
|
|
1109
|
-
icon:
|
|
1112
|
+
icon: w("inApp"),
|
|
1110
1113
|
checked: e.channels.inApp,
|
|
1111
|
-
onChange: (
|
|
1114
|
+
onChange: (s) => y("inApp", s),
|
|
1112
1115
|
disabled: a
|
|
1113
1116
|
}
|
|
1114
1117
|
),
|
|
1115
1118
|
/* @__PURE__ */ t(
|
|
1116
|
-
|
|
1119
|
+
R,
|
|
1117
1120
|
{
|
|
1118
1121
|
id: "channel-push",
|
|
1119
1122
|
label: "Push",
|
|
1120
|
-
icon:
|
|
1123
|
+
icon: w("push"),
|
|
1121
1124
|
checked: e.channels.push,
|
|
1122
|
-
onChange: (
|
|
1125
|
+
onChange: (s) => y("push", s),
|
|
1123
1126
|
disabled: a
|
|
1124
1127
|
}
|
|
1125
1128
|
)
|
|
1126
1129
|
] })
|
|
1127
1130
|
] }),
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
{
|
|
1132
|
-
type: "button",
|
|
1133
|
-
onClick: () => y("schedule"),
|
|
1134
|
-
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",
|
|
1135
|
-
children: [
|
|
1136
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1137
|
-
/* @__PURE__ */ t(ke, { className: "w-5 h-5 text-widget-primary" }),
|
|
1138
|
-
/* @__PURE__ */ t("span", { className: "font-semibold text-sm text-text-primary", children: "Schedule" })
|
|
1139
|
-
] }),
|
|
1140
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1141
|
-
/* @__PURE__ */ t(
|
|
1142
|
-
H,
|
|
1143
|
-
{
|
|
1144
|
-
id: "schedule-enabled",
|
|
1145
|
-
checked: d.schedule,
|
|
1146
|
-
onChange: () => {
|
|
1147
|
-
},
|
|
1148
|
-
disabled: a
|
|
1149
|
-
}
|
|
1150
|
-
),
|
|
1151
|
-
/* @__PURE__ */ t(
|
|
1152
|
-
"div",
|
|
1153
|
-
{
|
|
1154
|
-
className: `transition-transform duration-200 ${d.schedule ? "rotate-180" : ""}`,
|
|
1155
|
-
"aria-hidden": "true",
|
|
1156
|
-
children: /* @__PURE__ */ t(F, { className: "w-5 h-5 text-text-secondary" })
|
|
1157
|
-
}
|
|
1158
|
-
)
|
|
1159
|
-
] })
|
|
1160
|
-
]
|
|
1161
|
-
}
|
|
1162
|
-
),
|
|
1163
|
-
d.schedule && /* @__PURE__ */ i("div", { className: "px-2 py-1.5 space-y-2 animate-in slide-in-from-top-2 duration-200 bg-[var(--widget-background)]", children: [
|
|
1164
|
-
/* @__PURE__ */ t("div", { className: "text-sm text-[var(--widget-text-secondary)]", children: "Allow notifications between:" }),
|
|
1165
|
-
/* @__PURE__ */ i("div", { className: "grid grid-cols-[auto_1fr_auto_auto] gap-x-4 gap-y-3 items-center", children: [
|
|
1166
|
-
/* @__PURE__ */ t("div", { className: "col-span-2 text-xs font-semibold text-[var(--widget-text-tertiary)] pl-1", children: "Days" }),
|
|
1167
|
-
/* @__PURE__ */ t("div", { className: "text-xs font-semibold text-[var(--widget-text-tertiary)] w-[88px]", children: "From" }),
|
|
1168
|
-
/* @__PURE__ */ t("div", { className: "text-xs font-semibold text-[var(--widget-text-tertiary)] w-[88px]", children: "To" }),
|
|
1169
|
-
Fe.map((o, p) => {
|
|
1170
|
-
const M = e.deliverySchedule.weekdays[p];
|
|
1171
|
-
return /* @__PURE__ */ i(T.Fragment, { children: [
|
|
1172
|
-
/* @__PURE__ */ t("div", { className: "flex items-center h-8", children: /* @__PURE__ */ t(
|
|
1173
|
-
H,
|
|
1174
|
-
{
|
|
1175
|
-
id: `day-${p}`,
|
|
1176
|
-
checked: M,
|
|
1177
|
-
onChange: () => f(p),
|
|
1178
|
-
disabled: a
|
|
1179
|
-
}
|
|
1180
|
-
) }),
|
|
1181
|
-
/* @__PURE__ */ t(
|
|
1182
|
-
"div",
|
|
1183
|
-
{
|
|
1184
|
-
className: `text-sm ${M ? "text-text-primary" : "text-text-tertiary"}`,
|
|
1185
|
-
children: o
|
|
1186
|
-
}
|
|
1187
|
-
),
|
|
1188
|
-
/* @__PURE__ */ t("div", { className: "w-[88px]", children: /* @__PURE__ */ t(
|
|
1189
|
-
"input",
|
|
1190
|
-
{
|
|
1191
|
-
type: "time",
|
|
1192
|
-
className: "w-full px-2 py-1 bg-widget-background border border-border rounded text-sm text-text-primary focus:outline-none focus:ring-1 focus:ring-widget-primary disabled:opacity-50 disabled:bg-widget-hover",
|
|
1193
|
-
value: e.deliverySchedule.quietHours.start,
|
|
1194
|
-
onChange: (E) => r("deliverySchedule.quietHours.start", E.target.value),
|
|
1195
|
-
disabled: a || !M
|
|
1196
|
-
}
|
|
1197
|
-
) }),
|
|
1198
|
-
/* @__PURE__ */ t("div", { className: "w-[88px]", children: /* @__PURE__ */ t(
|
|
1199
|
-
"input",
|
|
1200
|
-
{
|
|
1201
|
-
type: "time",
|
|
1202
|
-
className: "w-full px-2 py-1 bg-widget-background border border-border rounded text-sm text-text-primary focus:outline-none focus:ring-1 focus:ring-widget-primary disabled:opacity-50 disabled:bg-widget-hover",
|
|
1203
|
-
value: e.deliverySchedule.quietHours.end,
|
|
1204
|
-
onChange: (E) => r("deliverySchedule.quietHours.end", E.target.value),
|
|
1205
|
-
disabled: a || !M
|
|
1206
|
-
}
|
|
1207
|
-
) })
|
|
1208
|
-
] }, o);
|
|
1209
|
-
})
|
|
1210
|
-
] })
|
|
1211
|
-
] })
|
|
1212
|
-
] }),
|
|
1213
|
-
$.length > 0 && $.map((o) => /* @__PURE__ */ i(
|
|
1214
|
-
"div",
|
|
1215
|
-
{
|
|
1216
|
-
className: "border border-[var(--widget-border)] rounded-lg overflow-hidden",
|
|
1217
|
-
children: [
|
|
1218
|
-
/* @__PURE__ */ i(
|
|
1219
|
-
"button",
|
|
1220
|
-
{
|
|
1221
|
-
type: "button",
|
|
1222
|
-
onClick: () => x(o.workflowId),
|
|
1223
|
-
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",
|
|
1224
|
-
children: [
|
|
1225
|
-
/* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ t(
|
|
1226
|
-
"span",
|
|
1227
|
-
{
|
|
1228
|
-
className: "text-sm font-medium text-text-primary truncate max-w-[180px]",
|
|
1229
|
-
title: o.name,
|
|
1230
|
-
children: o.name
|
|
1231
|
-
}
|
|
1232
|
-
) }),
|
|
1233
|
-
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
|
|
1234
|
-
/* @__PURE__ */ t(
|
|
1235
|
-
H,
|
|
1236
|
-
{
|
|
1237
|
-
id: `workflow-${o.workflowId}`,
|
|
1238
|
-
checked: o.enabled,
|
|
1239
|
-
onChange: (p) => k(o.workflowId, p),
|
|
1240
|
-
disabled: a
|
|
1241
|
-
}
|
|
1242
|
-
),
|
|
1243
|
-
v[o.workflowId] ? /* @__PURE__ */ t(Z, { className: "w-5 h-5 text-text-secondary" }) : /* @__PURE__ */ t(F, { className: "w-5 h-5 text-text-secondary" })
|
|
1244
|
-
] })
|
|
1245
|
-
]
|
|
1246
|
-
}
|
|
1247
|
-
),
|
|
1248
|
-
v[o.workflowId] && o.enabled && /* @__PURE__ */ i("div", { className: "px-2 pb-1.5 divide-y divide-border-light bg-[var(--widget-background)]", children: [
|
|
1249
|
-
/* @__PURE__ */ t(
|
|
1250
|
-
H,
|
|
1251
|
-
{
|
|
1252
|
-
id: `sub-${o.workflowId}-inapp`,
|
|
1253
|
-
label: "In-App",
|
|
1254
|
-
icon: S("inApp"),
|
|
1255
|
-
checked: o.channels.inApp,
|
|
1256
|
-
onChange: (p) => c(o.workflowId, "inApp", p),
|
|
1257
|
-
disabled: a
|
|
1258
|
-
}
|
|
1259
|
-
),
|
|
1260
|
-
/* @__PURE__ */ t(
|
|
1261
|
-
H,
|
|
1262
|
-
{
|
|
1263
|
-
id: `sub-${o.workflowId}-push`,
|
|
1264
|
-
label: "Push",
|
|
1265
|
-
icon: S("push"),
|
|
1266
|
-
checked: o.channels.push,
|
|
1267
|
-
onChange: (p) => c(o.workflowId, "push", p),
|
|
1268
|
-
disabled: a
|
|
1269
|
-
}
|
|
1270
|
-
)
|
|
1271
|
-
] })
|
|
1272
|
-
]
|
|
1273
|
-
},
|
|
1274
|
-
o.workflowId
|
|
1275
|
-
)),
|
|
1276
|
-
u && /* @__PURE__ */ t("div", { className: "flex justify-center p-2", children: /* @__PURE__ */ t(ne, { size: "md" }) }),
|
|
1131
|
+
!1,
|
|
1132
|
+
!1,
|
|
1133
|
+
u && /* @__PURE__ */ t("div", { className: "flex justify-center p-2", children: /* @__PURE__ */ t(X, { size: "md" }) }),
|
|
1277
1134
|
h && /* @__PURE__ */ t("div", { className: "pt-2 pb-1 flex justify-center", children: /* @__PURE__ */ t(
|
|
1278
1135
|
"button",
|
|
1279
1136
|
{
|
|
1280
|
-
onClick:
|
|
1137
|
+
onClick: () => {
|
|
1138
|
+
h();
|
|
1139
|
+
},
|
|
1281
1140
|
className: "text-sm font-medium text-[var(--widget-primary)] hover:text-[var(--widget-primary-hover)] hover:underline focus:outline-none",
|
|
1282
|
-
children: "More
|
|
1141
|
+
children: "More Settings"
|
|
1283
1142
|
}
|
|
1284
1143
|
) })
|
|
1285
1144
|
] })
|
|
1286
1145
|
]
|
|
1287
1146
|
}
|
|
1288
1147
|
);
|
|
1289
|
-
},
|
|
1148
|
+
}, De = ({
|
|
1290
1149
|
notifications: e,
|
|
1291
1150
|
activeTab: r,
|
|
1292
1151
|
onTabChange: a,
|
|
1293
1152
|
className: n = ""
|
|
1294
1153
|
}) => {
|
|
1295
|
-
const
|
|
1296
|
-
const l = e.length, u = e.filter((
|
|
1297
|
-
e.forEach((
|
|
1298
|
-
|
|
1154
|
+
const i = Z(() => {
|
|
1155
|
+
const l = e.length, u = e.filter((f) => !f.isRead).length, h = /* @__PURE__ */ new Map();
|
|
1156
|
+
e.forEach((f) => {
|
|
1157
|
+
f.tags.forEach((g) => {
|
|
1299
1158
|
h.set(g, (h.get(g) || 0) + 1);
|
|
1300
1159
|
});
|
|
1301
1160
|
});
|
|
1302
|
-
const
|
|
1161
|
+
const c = [
|
|
1303
1162
|
{
|
|
1304
1163
|
id: "all",
|
|
1305
1164
|
label: "All",
|
|
1306
1165
|
count: l,
|
|
1307
|
-
icon: /* @__PURE__ */ t(
|
|
1166
|
+
icon: /* @__PURE__ */ t(He, { className: "w-4 h-4" })
|
|
1308
1167
|
},
|
|
1309
1168
|
{
|
|
1310
1169
|
id: "unread",
|
|
1311
1170
|
label: "Unread",
|
|
1312
1171
|
count: u,
|
|
1313
|
-
icon: /* @__PURE__ */ t(
|
|
1172
|
+
icon: /* @__PURE__ */ t(ie, { className: "w-4 h-4" })
|
|
1314
1173
|
}
|
|
1315
|
-
], m = Array.from(h.entries()).sort(([,
|
|
1316
|
-
id: `tag:${
|
|
1317
|
-
label:
|
|
1174
|
+
], m = Array.from(h.entries()).sort(([, f], [, g]) => g - f).slice(0, 5).map(([f, g]) => ({
|
|
1175
|
+
id: `tag:${f}`,
|
|
1176
|
+
label: f,
|
|
1318
1177
|
count: g,
|
|
1319
|
-
icon: /* @__PURE__ */ t(
|
|
1178
|
+
icon: /* @__PURE__ */ t(Ce, { className: "w-4 h-4" })
|
|
1320
1179
|
}));
|
|
1321
|
-
return [...
|
|
1180
|
+
return [...c, ...m];
|
|
1322
1181
|
}, [e]);
|
|
1323
1182
|
return /* @__PURE__ */ t(
|
|
1324
1183
|
"div",
|
|
@@ -1329,9 +1188,9 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
1329
1188
|
`,
|
|
1330
1189
|
role: "tablist",
|
|
1331
1190
|
"data-mx-widget": "tabs",
|
|
1332
|
-
children:
|
|
1191
|
+
children: i.map((l) => {
|
|
1333
1192
|
const u = r === l.id;
|
|
1334
|
-
return /* @__PURE__ */
|
|
1193
|
+
return /* @__PURE__ */ o(
|
|
1335
1194
|
"button",
|
|
1336
1195
|
{
|
|
1337
1196
|
onClick: () => a(l.id),
|
|
@@ -1351,7 +1210,7 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
1351
1210
|
}
|
|
1352
1211
|
),
|
|
1353
1212
|
/* @__PURE__ */ t("span", { children: l.label }),
|
|
1354
|
-
l.count !== void 0 && l.count > 0 && /* @__PURE__ */
|
|
1213
|
+
l.count !== void 0 && l.count > 0 && /* @__PURE__ */ o(
|
|
1355
1214
|
"span",
|
|
1356
1215
|
{
|
|
1357
1216
|
className: `ml-1 text-[10px] font-semibold ${u ? "text-[var(--widget-text)]" : "text-[var(--widget-text-tertiary)]"}`,
|
|
@@ -1369,88 +1228,80 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
1369
1228
|
})
|
|
1370
1229
|
}
|
|
1371
1230
|
);
|
|
1372
|
-
},
|
|
1231
|
+
}, Je = ({
|
|
1373
1232
|
isOpen: e,
|
|
1374
1233
|
onClose: r,
|
|
1375
1234
|
position: a,
|
|
1376
1235
|
currentView: n,
|
|
1377
|
-
onViewChange:
|
|
1236
|
+
onViewChange: i,
|
|
1378
1237
|
notifications: l,
|
|
1379
1238
|
onNotificationAction: u,
|
|
1380
1239
|
preferences: h,
|
|
1381
|
-
onPreferenceChange:
|
|
1240
|
+
onPreferenceChange: c,
|
|
1382
1241
|
isPreferencesLoading: m = !1,
|
|
1383
|
-
size:
|
|
1242
|
+
size: f = "medium",
|
|
1384
1243
|
onMorePreferencesClick: g,
|
|
1385
|
-
specificPreferences:
|
|
1386
|
-
onLoadMoreSpecific:
|
|
1387
|
-
hasMoreSpecific:
|
|
1388
|
-
isListLoading:
|
|
1244
|
+
specificPreferences: x,
|
|
1245
|
+
onLoadMoreSpecific: y,
|
|
1246
|
+
hasMoreSpecific: b,
|
|
1247
|
+
isListLoading: w
|
|
1389
1248
|
}) => {
|
|
1390
|
-
const
|
|
1391
|
-
|
|
1392
|
-
if (!b || !N) return null;
|
|
1393
|
-
const { tenantId: j, environmentId: L, subscriberId: Y } = b;
|
|
1394
|
-
return !j || !L || !Y ? null : { client: N, tenantId: j, environmentId: L, subscriberId: Y };
|
|
1395
|
-
}, []), M = I(
|
|
1396
|
-
async (b) => {
|
|
1397
|
-
const N = p();
|
|
1398
|
-
if (!N)
|
|
1399
|
-
return { success: !1, processedCount: 0, failedCount: b.length, errors: [] };
|
|
1249
|
+
const s = j(null), d = j(null), [M, E] = k("all"), [S, D] = k(""), se = z(
|
|
1250
|
+
async (p) => {
|
|
1400
1251
|
try {
|
|
1401
|
-
for (const
|
|
1402
|
-
await N
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
);
|
|
1408
|
-
return { success: !0, processedCount:
|
|
1409
|
-
} catch (
|
|
1252
|
+
for (const N of p)
|
|
1253
|
+
await u(N, {
|
|
1254
|
+
type: "mark_read",
|
|
1255
|
+
label: "Mark as read",
|
|
1256
|
+
handler: async () => {
|
|
1257
|
+
}
|
|
1258
|
+
});
|
|
1259
|
+
return { success: !0, processedCount: p.length, failedCount: 0, errors: [] };
|
|
1260
|
+
} catch (N) {
|
|
1410
1261
|
return {
|
|
1411
1262
|
success: !1,
|
|
1412
1263
|
processedCount: 0,
|
|
1413
|
-
failedCount:
|
|
1414
|
-
errors: [{ notificationId: "", error:
|
|
1264
|
+
failedCount: p.length,
|
|
1265
|
+
errors: [{ notificationId: "", error: N }]
|
|
1415
1266
|
};
|
|
1416
1267
|
}
|
|
1417
1268
|
},
|
|
1418
|
-
[
|
|
1419
|
-
),
|
|
1420
|
-
(
|
|
1421
|
-
|
|
1269
|
+
[u]
|
|
1270
|
+
), le = Z(() => $e(l, M, S), [l, M, S]), O = z(
|
|
1271
|
+
(p) => {
|
|
1272
|
+
s.current && !s.current.contains(p.target) && r();
|
|
1422
1273
|
},
|
|
1423
1274
|
[r]
|
|
1424
|
-
),
|
|
1425
|
-
(
|
|
1426
|
-
|
|
1275
|
+
), $ = z(
|
|
1276
|
+
(p) => {
|
|
1277
|
+
p.key === "Escape" && r();
|
|
1427
1278
|
},
|
|
1428
1279
|
[r]
|
|
1429
|
-
),
|
|
1430
|
-
(
|
|
1431
|
-
if (!(!e || !
|
|
1432
|
-
const N =
|
|
1280
|
+
), P = z(
|
|
1281
|
+
(p) => {
|
|
1282
|
+
if (!(!e || !s.current) && p.key === "Tab") {
|
|
1283
|
+
const N = s.current.querySelectorAll(
|
|
1433
1284
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
1434
1285
|
);
|
|
1435
1286
|
if (N.length === 0) return;
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1287
|
+
const F = N[0], U = N[N.length - 1];
|
|
1288
|
+
p.shiftKey ? document.activeElement === F && (U.focus(), p.preventDefault()) : document.activeElement === U && (F.focus(), p.preventDefault());
|
|
1438
1289
|
}
|
|
1439
1290
|
},
|
|
1440
1291
|
[e]
|
|
1441
1292
|
);
|
|
1442
|
-
if (
|
|
1443
|
-
|
|
1293
|
+
if (I(() => (e ? (d.current = document.activeElement, document.addEventListener("mousedown", O), document.addEventListener("keydown", $), document.addEventListener("keydown", P), setTimeout(() => {
|
|
1294
|
+
s.current?.querySelector(
|
|
1444
1295
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
1445
1296
|
)?.focus();
|
|
1446
|
-
}, 0)) : (
|
|
1447
|
-
document.removeEventListener("mousedown",
|
|
1448
|
-
}), [e,
|
|
1449
|
-
const
|
|
1297
|
+
}, 0)) : (d.current && d.current.focus(), E("all"), D("")), () => {
|
|
1298
|
+
document.removeEventListener("mousedown", O), document.removeEventListener("keydown", $), document.removeEventListener("keydown", P);
|
|
1299
|
+
}), [e, O, $, P]), !e) return null;
|
|
1300
|
+
const oe = {
|
|
1450
1301
|
left: "left-0 origin-top-left",
|
|
1451
1302
|
right: "right-0 origin-top-right"
|
|
1452
|
-
},
|
|
1453
|
-
return /* @__PURE__ */
|
|
1303
|
+
}, _ = l.filter((p) => !p.isRead).length;
|
|
1304
|
+
return /* @__PURE__ */ o(H, { children: [
|
|
1454
1305
|
/* @__PURE__ */ t(
|
|
1455
1306
|
"div",
|
|
1456
1307
|
{
|
|
@@ -1459,13 +1310,13 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
1459
1310
|
onClick: r
|
|
1460
1311
|
}
|
|
1461
1312
|
),
|
|
1462
|
-
/* @__PURE__ */
|
|
1313
|
+
/* @__PURE__ */ o(
|
|
1463
1314
|
"div",
|
|
1464
1315
|
{
|
|
1465
|
-
ref:
|
|
1316
|
+
ref: s,
|
|
1466
1317
|
className: `
|
|
1467
|
-
mx-widget-popover absolute top-full mt-2 ${
|
|
1468
|
-
w-[var(--widget-popover-width,
|
|
1318
|
+
mx-widget-popover min-w-[20rem] absolute top-full mt-2 ${oe[a]}
|
|
1319
|
+
w-[var(--widget-popover-width, 20rem)] max-h-[var(--widget-popover-max-height,580px)]
|
|
1469
1320
|
border border-[var(--widget-border)] rounded-2xl overflow-hidden
|
|
1470
1321
|
shadow-[var(--widget-shadow-xl)] bg-[var(--widget-background)]
|
|
1471
1322
|
z-50 flex flex-col
|
|
@@ -1478,19 +1329,20 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
1478
1329
|
"aria-label": "Notifications",
|
|
1479
1330
|
"data-testid": "inbox-popover",
|
|
1480
1331
|
"data-mx-widget": "popover",
|
|
1332
|
+
style: { minWidth: "20rem" },
|
|
1481
1333
|
children: [
|
|
1482
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ o("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: [
|
|
1483
1335
|
/* @__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" }) }),
|
|
1484
|
-
/* @__PURE__ */
|
|
1336
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-1", children: [
|
|
1485
1337
|
n === "notifications" && /* @__PURE__ */ t(
|
|
1486
1338
|
"button",
|
|
1487
1339
|
{
|
|
1488
1340
|
type: "button",
|
|
1489
1341
|
className: "inline-flex items-center justify-center w-6 h-6 rounded-lg text-[var(--widget-text-secondary)] hover:text-[var(--widget-text)] hover:bg-[var(--widget-bg-hover)] transition-colors",
|
|
1490
|
-
onClick: () =>
|
|
1342
|
+
onClick: () => i("preferences"),
|
|
1491
1343
|
"aria-label": "Open preferences",
|
|
1492
1344
|
"data-testid": "preferences-button",
|
|
1493
|
-
children: /* @__PURE__ */ t(
|
|
1345
|
+
children: /* @__PURE__ */ t(re, { className: "w-4 h-4" })
|
|
1494
1346
|
}
|
|
1495
1347
|
),
|
|
1496
1348
|
n === "preferences" && /* @__PURE__ */ t(
|
|
@@ -1498,10 +1350,10 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
1498
1350
|
{
|
|
1499
1351
|
type: "button",
|
|
1500
1352
|
className: "inline-flex items-center justify-center w-6 h-6 rounded-lg text-[var(--widget-text-secondary)] hover:text-[var(--widget-text)] hover:bg-[var(--widget-bg-hover)] transition-colors",
|
|
1501
|
-
onClick: () =>
|
|
1353
|
+
onClick: () => i("notifications"),
|
|
1502
1354
|
"aria-label": "Back to notifications",
|
|
1503
1355
|
"data-testid": "back-button",
|
|
1504
|
-
children: /* @__PURE__ */ t(
|
|
1356
|
+
children: /* @__PURE__ */ t(Me, { className: "w-5 h-5" })
|
|
1505
1357
|
}
|
|
1506
1358
|
),
|
|
1507
1359
|
/* @__PURE__ */ t(
|
|
@@ -1512,14 +1364,14 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
1512
1364
|
onClick: r,
|
|
1513
1365
|
"aria-label": "Close notifications",
|
|
1514
1366
|
"data-testid": "close-button",
|
|
1515
|
-
children: /* @__PURE__ */ t(
|
|
1367
|
+
children: /* @__PURE__ */ t(ne, { className: "w-5 h-5" })
|
|
1516
1368
|
}
|
|
1517
1369
|
)
|
|
1518
1370
|
] })
|
|
1519
1371
|
] }),
|
|
1520
|
-
n === "notifications" ? /* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */ t("div", { className: "flex-shrink-0 px-4 py-2.5 border-b border-[var(--widget-border)] bg-[var(--widget-background)]", children: /* @__PURE__ */
|
|
1522
|
-
/* @__PURE__ */ t("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ t(
|
|
1372
|
+
n === "notifications" ? /* @__PURE__ */ o(H, { children: [
|
|
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__ */ o("div", { className: "relative", children: [
|
|
1374
|
+
/* @__PURE__ */ t("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ t(xe, { className: "w-5 h-5 text-[var(--widget-text-tertiary)]" }) }),
|
|
1523
1375
|
/* @__PURE__ */ t(
|
|
1524
1376
|
"input",
|
|
1525
1377
|
{
|
|
@@ -1535,69 +1387,69 @@ const Ae = ({ onRetry: e, error: r }) => /* @__PURE__ */ i("div", { className: "
|
|
|
1535
1387
|
transition-colors
|
|
1536
1388
|
`,
|
|
1537
1389
|
placeholder: "Search notifications...",
|
|
1538
|
-
value:
|
|
1539
|
-
onChange: (
|
|
1390
|
+
value: S,
|
|
1391
|
+
onChange: (p) => D(p.target.value),
|
|
1540
1392
|
"aria-label": "Search notifications"
|
|
1541
1393
|
}
|
|
1542
1394
|
)
|
|
1543
1395
|
] }) }),
|
|
1544
1396
|
/* @__PURE__ */ t(
|
|
1545
|
-
|
|
1397
|
+
De,
|
|
1546
1398
|
{
|
|
1547
1399
|
notifications: l,
|
|
1548
|
-
activeTab:
|
|
1549
|
-
onTabChange: (
|
|
1550
|
-
size:
|
|
1400
|
+
activeTab: M,
|
|
1401
|
+
onTabChange: (p) => E(p),
|
|
1402
|
+
size: f
|
|
1551
1403
|
}
|
|
1552
1404
|
),
|
|
1553
|
-
/* @__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(
|
|
1554
|
-
|
|
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(q, { fallback: /* @__PURE__ */ t(Le, {}), children: /* @__PURE__ */ t(
|
|
1406
|
+
Re,
|
|
1555
1407
|
{
|
|
1556
|
-
notifications:
|
|
1408
|
+
notifications: le,
|
|
1557
1409
|
onNotificationAction: u
|
|
1558
1410
|
}
|
|
1559
1411
|
) }) }),
|
|
1560
|
-
|
|
1412
|
+
_ > 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(
|
|
1561
1413
|
"button",
|
|
1562
1414
|
{
|
|
1563
1415
|
type: "button",
|
|
1564
1416
|
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",
|
|
1565
1417
|
onClick: () => {
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1418
|
+
const p = l.filter((N) => !N.isRead).map((N) => N.id);
|
|
1419
|
+
se(p);
|
|
1568
1420
|
},
|
|
1569
|
-
"aria-label": `Mark all ${
|
|
1421
|
+
"aria-label": `Mark all ${_} notifications as read`,
|
|
1570
1422
|
children: "Mark all as read"
|
|
1571
1423
|
}
|
|
1572
1424
|
) })
|
|
1573
|
-
] }) : /* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto widget-scrollbar", children: /* @__PURE__ */ t(
|
|
1574
|
-
|
|
1425
|
+
] }) : /* @__PURE__ */ t("div", { className: "flex-1 overflow-y-auto widget-scrollbar", children: /* @__PURE__ */ t(q, { fallback: /* @__PURE__ */ t(J, {}), children: h && c ? /* @__PURE__ */ t(
|
|
1426
|
+
Ve,
|
|
1575
1427
|
{
|
|
1576
1428
|
preferences: h,
|
|
1577
|
-
onPreferenceChange:
|
|
1429
|
+
onPreferenceChange: c,
|
|
1578
1430
|
isLoading: m,
|
|
1579
|
-
onBack: () =>
|
|
1431
|
+
onBack: () => i("notifications"),
|
|
1580
1432
|
onMorePreferencesClick: g,
|
|
1581
|
-
specificPreferences:
|
|
1582
|
-
onLoadMoreSpecific:
|
|
1583
|
-
hasMoreSpecific:
|
|
1584
|
-
isListLoading:
|
|
1433
|
+
specificPreferences: x,
|
|
1434
|
+
onLoadMoreSpecific: y,
|
|
1435
|
+
hasMoreSpecific: b,
|
|
1436
|
+
isListLoading: w
|
|
1585
1437
|
}
|
|
1586
|
-
) : /* @__PURE__ */ t(
|
|
1438
|
+
) : /* @__PURE__ */ t(J, {}) }) })
|
|
1587
1439
|
]
|
|
1588
1440
|
}
|
|
1589
1441
|
)
|
|
1590
1442
|
] });
|
|
1591
1443
|
};
|
|
1592
1444
|
export {
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1445
|
+
Ue as B,
|
|
1446
|
+
q as C,
|
|
1447
|
+
Je as I,
|
|
1448
|
+
Ge as L,
|
|
1449
|
+
We as M,
|
|
1450
|
+
Ae as N,
|
|
1451
|
+
Ve as P,
|
|
1452
|
+
qe as S,
|
|
1453
|
+
Ke as a
|
|
1602
1454
|
};
|
|
1603
|
-
//# sourceMappingURL=components-
|
|
1455
|
+
//# sourceMappingURL=components-DUT08KJF.js.map
|