@burdenoff/microfe-notification 2026.1029.2 → 2026.1113.1
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/AdminNotificationRoot.d.ts +33 -0
- package/dist/AdminNotificationRoot.js +9 -6
- package/dist/AdminNotificationRoot.js.map +1 -1
- package/dist/AdminNotificationRoutes.d.ts +1 -0
- package/dist/AdminNotificationRoutes.js +22 -23
- package/dist/AdminNotificationRoutes.js.map +1 -1
- package/dist/NotificationRoot.d.ts +29 -0
- package/dist/NotificationRoot.js +9 -6
- package/dist/NotificationRoot.js.map +1 -1
- package/dist/NotificationRoutes.d.ts +18 -0
- package/dist/NotificationRoutes.js +109 -38
- package/dist/NotificationRoutes.js.map +1 -1
- package/dist/UserNotificationRoot.d.ts +32 -0
- package/dist/UserNotificationRoot.js +9 -6
- package/dist/UserNotificationRoot.js.map +1 -1
- package/dist/UserNotificationRoutes.d.ts +16 -0
- package/dist/UserNotificationRoutes.js +9 -10
- package/dist/UserNotificationRoutes.js.map +1 -1
- package/dist/components/ConfirmDeleteDialog.d.ts +17 -0
- package/dist/components/ConfirmDeleteDialog.js +22 -0
- package/dist/components/ConfirmDeleteDialog.js.map +1 -0
- package/dist/components/FeatureDisabledPage.d.ts +6 -0
- package/dist/components/FeatureDisabledPage.js +1 -2
- package/dist/components/FeatureDisabledPage.js.map +1 -1
- package/dist/components/NotificationBell.d.ts +13 -0
- package/dist/components/NotificationBell.js +6 -7
- package/dist/components/NotificationBell.js.map +1 -1
- package/dist/components/NotificationCard.d.ts +27 -0
- package/dist/components/NotificationCard.js +106 -76
- package/dist/components/NotificationCard.js.map +1 -1
- package/dist/components/NotificationPanel.d.ts +10 -0
- package/dist/components/NotificationPanel.js +5 -6
- package/dist/components/NotificationPanel.js.map +1 -1
- package/dist/components/RecipientSelector.d.ts +32 -0
- package/dist/components/RecipientSelector.js +2 -3
- package/dist/components/RecipientSelector.js.map +1 -1
- package/dist/components/TemplatePreview.d.ts +21 -0
- package/dist/components/TemplatePreview.js +3 -4
- package/dist/components/TemplatePreview.js.map +1 -1
- package/dist/components/VariableInserter.d.ts +11 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +4 -3
- package/dist/constants/permissions.d.ts +23 -0
- package/dist/constants/permissions.js +1 -2
- package/dist/constants/permissions.js.map +1 -1
- package/dist/dev/main.d.ts +0 -0
- package/dist/generated/global-operations.d.ts +2119 -0
- package/dist/generated/global-operations.js +80 -69
- package/dist/generated/global-operations.js.map +1 -1
- package/dist/generated/global-types.d.ts +23507 -0
- package/dist/generated/wspace-operations.d.ts +4 -0
- package/dist/generated/wspace-types.d.ts +57831 -0
- package/dist/graphql/global-client.d.ts +32 -0
- package/dist/graphql/global-client.js +23 -30
- package/dist/graphql/global-client.js.map +1 -1
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +7 -6
- package/dist/hooks/useNotificationAdmin.d.ts +46 -0
- package/dist/hooks/useNotificationAdmin.js +18 -17
- package/dist/hooks/useNotificationAdmin.js.map +1 -1
- package/dist/hooks/useNotificationAnalytics.d.ts +65 -0
- package/dist/hooks/useNotificationAnalytics.js +1 -2
- package/dist/hooks/useNotificationAnalytics.js.map +1 -1
- package/dist/hooks/useNotificationPreferences.d.ts +10 -0
- package/dist/hooks/useNotificationPreferences.js +7 -7
- package/dist/hooks/useNotificationPreferences.js.map +1 -1
- package/dist/hooks/useNotificationTemplates.d.ts +131 -0
- package/dist/hooks/useNotificationTemplates.js +1 -2
- package/dist/hooks/useNotificationTemplates.js.map +1 -1
- package/dist/hooks/useNotificationTopics.d.ts +35 -0
- package/dist/hooks/useNotificationTopics.js +22 -22
- package/dist/hooks/useNotificationTopics.js.map +1 -1
- package/dist/hooks/useNotifications.d.ts +39 -0
- package/dist/hooks/useNotifications.js +6 -4
- package/dist/hooks/useNotifications.js.map +1 -1
- package/dist/hooks/usePreferenceToggles.d.ts +27 -0
- package/dist/hooks/usePreferenceToggles.js +84 -0
- package/dist/hooks/usePreferenceToggles.js.map +1 -0
- package/dist/hooks/useSendNotification.d.ts +158 -0
- package/dist/hooks/useSendNotification.js +12 -10
- package/dist/hooks/useSendNotification.js.map +1 -1
- package/dist/hooks/useUserSearch.d.ts +26 -0
- package/dist/hooks/useUserSearch.js +8 -10
- package/dist/hooks/useUserSearch.js.map +1 -1
- package/dist/index.d.ts +36 -0
- package/dist/index.js +8 -8
- package/dist/navigation-v2/AdminPageV2.d.ts +14 -0
- package/dist/navigation-v2/AdminPageV2.js +51 -0
- package/dist/navigation-v2/AdminPageV2.js.map +1 -0
- package/dist/navigation-v2/AdminToolsMenu.d.ts +6 -0
- package/dist/navigation-v2/AdminToolsMenu.js +32 -0
- package/dist/navigation-v2/AdminToolsMenu.js.map +1 -0
- package/dist/navigation-v2/BackToNotifications.d.ts +2 -0
- package/dist/navigation-v2/BackToNotifications.js +20 -0
- package/dist/navigation-v2/BackToNotifications.js.map +1 -0
- package/dist/navigation-v2/FilterControls.d.ts +25 -0
- package/dist/navigation-v2/FilterControls.js +64 -0
- package/dist/navigation-v2/FilterControls.js.map +1 -0
- package/dist/navigation-v2/NotificationArchivedV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationArchivedV2.js +174 -0
- package/dist/navigation-v2/NotificationArchivedV2.js.map +1 -0
- package/dist/navigation-v2/NotificationInboxV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationInboxV2.js +309 -0
- package/dist/navigation-v2/NotificationInboxV2.js.map +1 -0
- package/dist/navigation-v2/NotificationSettingsV2.d.ts +9 -0
- package/dist/navigation-v2/NotificationSettingsV2.js +203 -0
- package/dist/navigation-v2/NotificationSettingsV2.js.map +1 -0
- package/dist/navigation-v2/NotificationsV2Landing.d.ts +9 -0
- package/dist/navigation-v2/NotificationsV2Landing.js +37 -0
- package/dist/navigation-v2/NotificationsV2Landing.js.map +1 -0
- package/dist/navigation-v2/__tests__/uiMocks.d.ts +71 -0
- package/dist/navigation-v2/inboxFilters.d.ts +8 -0
- package/dist/navigation-v2/inboxFilters.js +10 -0
- package/dist/navigation-v2/inboxFilters.js.map +1 -0
- package/dist/navigation-v2/paths.d.ts +24 -0
- package/dist/navigation-v2/paths.js +31 -0
- package/dist/navigation-v2/paths.js.map +1 -0
- package/dist/navigation-v2/settingsOptions.d.ts +12 -0
- package/dist/navigation-v2/settingsOptions.js +58 -0
- package/dist/navigation-v2/settingsOptions.js.map +1 -0
- package/dist/navigation-v2/useAdminTools.d.ts +22 -0
- package/dist/navigation-v2/useAdminTools.js +76 -0
- package/dist/navigation-v2/useAdminTools.js.map +1 -0
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js +1 -2
- package/dist/node_modules/@apollo/client/errors/CombinedGraphQLErrors.js.map +1 -1
- package/dist/node_modules/@apollo/client/errors/utils.js +1 -2
- package/dist/node_modules/@apollo/client/errors/utils.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js +7 -8
- package/dist/node_modules/@apollo/client/link/core/ApolloLink.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js +9 -10
- package/dist/node_modules/@apollo/client/link/subscriptions/index.js.map +1 -1
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js +5 -6
- package/dist/node_modules/@apollo/client/link/utils/createOperation.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js +0 -1
- package/dist/node_modules/@apollo/client/utilities/caching/sizes.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js +4 -5
- package/dist/node_modules/@apollo/client/utilities/graphql/print.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/caches.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/checkDocument.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js +2 -3
- package/dist/node_modules/@apollo/client/utilities/internal/getMainDefinition.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getMemoryInternals.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationDefinition.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/getOperationName.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/memoize.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +1 -2
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js.map +1 -1
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js +2 -3
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js.map +1 -1
- package/dist/node_modules/@apollo/client/version.js +2 -3
- package/dist/node_modules/@apollo/client/version.js.map +1 -1
- package/dist/node_modules/@wry/caches/lib/weak.js +1 -2
- package/dist/node_modules/@wry/caches/lib/weak.js.map +1 -1
- package/dist/node_modules/@wry/trie/lib/index.js +2 -3
- package/dist/node_modules/@wry/trie/lib/index.js.map +1 -1
- package/dist/node_modules/graphql-ws/dist/client.js +76 -69
- package/dist/node_modules/graphql-ws/dist/client.js.map +1 -1
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js +2 -3
- package/dist/node_modules/graphql-ws/dist/common-CGW11Fyb.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +2 -3
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js +41 -42
- package/dist/node_modules/rxjs/dist/esm5/internal/Observable.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +14 -15
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +21 -18
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/observable/empty.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +2 -3
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/symbol/observable.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/identity.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/pipe.js.map +1 -1
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +1 -2
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js.map +1 -1
- package/dist/node_modules/{rxjs/node_modules/tslib → tslib}/tslib.es6.js +1 -2
- package/dist/node_modules/tslib/tslib.es6.js.map +1 -0
- package/dist/pages/CreateNotificationPage.d.ts +5 -0
- package/dist/pages/CreateNotificationPage.js +591 -573
- package/dist/pages/CreateNotificationPage.js.map +1 -1
- package/dist/pages/NotificationCenterPage.d.ts +8 -0
- package/dist/pages/NotificationCenterPage.js +87 -83
- package/dist/pages/NotificationCenterPage.js.map +1 -1
- package/dist/pages/NotificationHistoryAdminPage.d.ts +2 -0
- package/dist/pages/NotificationHistoryAdminPage.js +7 -8
- package/dist/pages/NotificationHistoryAdminPage.js.map +1 -1
- package/dist/pages/NotificationHistoryPage.d.ts +6 -0
- package/dist/pages/NotificationHistoryPage.js +59 -55
- package/dist/pages/NotificationHistoryPage.js.map +1 -1
- package/dist/pages/NotificationLandingPage.d.ts +10 -0
- package/dist/pages/NotificationLandingPage.js +5 -6
- package/dist/pages/NotificationLandingPage.js.map +1 -1
- package/dist/pages/NotificationPreferencesPage.d.ts +5 -0
- package/dist/pages/NotificationPreferencesPage.js +97 -159
- package/dist/pages/NotificationPreferencesPage.js.map +1 -1
- package/dist/pages/NotificationTemplatesPage.d.ts +7 -0
- package/dist/pages/NotificationTemplatesPage.js +192 -172
- package/dist/pages/NotificationTemplatesPage.js.map +1 -1
- package/dist/pages/NotificationTopicsPage.d.ts +1 -0
- package/dist/pages/NotificationTopicsPage.js +126 -112
- package/dist/pages/NotificationTopicsPage.js.map +1 -1
- package/dist/pages/TemplateEditorPage.d.ts +12 -0
- package/dist/pages/TemplateEditorPage.js +381 -341
- package/dist/pages/TemplateEditorPage.js.map +1 -1
- package/dist/providers/NotificationProvider.d.ts +11 -0
- package/dist/providers/NotificationProvider.js +7 -7
- package/dist/providers/NotificationProvider.js.map +1 -1
- package/dist/shared/hooks/useTr.d.ts +13 -0
- package/dist/shared/hooks/useTr.js +1 -2
- package/dist/shared/hooks/useTr.js.map +1 -1
- package/dist/store/notificationStore.d.ts +30 -0
- package/dist/store/notificationStore.js +1 -2
- package/dist/store/notificationStore.js.map +1 -1
- package/dist/test/happydom.d.ts +1 -0
- package/dist/translations/en.d.ts +468 -0
- package/dist/types/index.d.ts +257 -0
- package/dist/utils/inAppNavigation.d.ts +37 -0
- package/dist/utils/inAppNavigation.js +2 -3
- package/dist/utils/inAppNavigation.js.map +1 -1
- package/dist/utils/index.d.ts +68 -0
- package/dist/utils/index.js +1 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/nativeBridge.d.ts +2 -0
- package/dist/utils/nativeBridge.js +1 -2
- package/dist/utils/notificationHistoryExport.d.ts +12 -0
- package/dist/utils/notificationHistoryExport.js +1 -2
- package/dist/utils/notificationHistoryExport.js.map +1 -1
- package/package.json +67 -49
- package/dist/node_modules/rxjs/node_modules/tslib/tslib.es6.js.map +0 -1
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { isPermissionError as e } from "../utils/index.js";
|
|
2
|
+
import { useSendNotification as t } from "../hooks/useSendNotification.js";
|
|
3
|
+
import { useNotificationTemplates as n } from "../hooks/useNotificationTemplates.js";
|
|
4
|
+
import { useUserSearch as r } from "../hooks/useUserSearch.js";
|
|
5
|
+
import { useNotificationTopics as ee } from "../hooks/useNotificationTopics.js";
|
|
6
|
+
import { useNotificationAnalytics as te } from "../hooks/useNotificationAnalytics.js";
|
|
7
|
+
import { RecipientSelector as ne } from "../components/RecipientSelector.js";
|
|
8
|
+
import { NOTIFICATION_PERMISSIONS as re } from "../constants/permissions.js";
|
|
9
|
+
import { useTr as ie } from "../shared/hooks/useTr.js";
|
|
10
|
+
import { nativeImpact as ae, nativeNotify as i } from "../utils/nativeBridge.js";
|
|
11
|
+
import { useNavigationV2 as oe, useNotificationPaths as se } from "../navigation-v2/paths.js";
|
|
11
12
|
import { useMemo as a, useState as o } from "react";
|
|
12
|
-
import { useGlobalUi as
|
|
13
|
-
import { AlertCircle as
|
|
14
|
-
import { useNavigate as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { CTAOverflowMenu as Ce, GlassCard as we, IllustratedEmptyState as Te, NextSteps as Ee,
|
|
17
|
-
|
|
18
|
-
var
|
|
13
|
+
import { useGlobalUi as ce, usePermissions as le } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
14
|
+
import { AlertCircle as ue, ArrowLeft as de, Bell as fe, CheckCircle2 as s, Eye as pe, EyeOff as me, FileText as he, ImagePlus as ge, Link2 as _e, Loader2 as c, Mail as ve, MessageSquare as l, Send as ye, Smartphone as u, User as d, Users as be, X as xe } from "lucide-react";
|
|
15
|
+
import { useNavigate as Se } from "react-router";
|
|
16
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
17
|
+
import { CTAOverflowMenu as Ce, GlassCard as we, IllustratedEmptyState as Te, NextSteps as Ee, OptionalFields as De, PagePurpose as Oe } from "@burdenoff/fe-libs/ui";
|
|
18
|
+
// src/pages/CreateNotificationPage.tsx
|
|
19
|
+
var ke = [
|
|
19
20
|
{
|
|
20
21
|
value: "EMAIL",
|
|
21
22
|
label: "Email",
|
|
22
|
-
icon:
|
|
23
|
+
icon: ve,
|
|
23
24
|
description: "Send via email"
|
|
24
25
|
},
|
|
25
26
|
{
|
|
@@ -31,13 +32,13 @@ var Oe = [
|
|
|
31
32
|
{
|
|
32
33
|
value: "PUSH",
|
|
33
34
|
label: "Push",
|
|
34
|
-
icon:
|
|
35
|
+
icon: u,
|
|
35
36
|
description: "Mobile push notification"
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
value: "WEBHOOK",
|
|
39
40
|
label: "Webhook",
|
|
40
|
-
icon:
|
|
41
|
+
icon: _e,
|
|
41
42
|
description: "POST to a webhook URL"
|
|
42
43
|
},
|
|
43
44
|
{
|
|
@@ -70,7 +71,7 @@ var Oe = [
|
|
|
70
71
|
icon: l,
|
|
71
72
|
description: "Send to Discord"
|
|
72
73
|
}
|
|
73
|
-
],
|
|
74
|
+
], Ae = [
|
|
74
75
|
{
|
|
75
76
|
value: "TRANSACTIONAL",
|
|
76
77
|
label: "Transactional",
|
|
@@ -91,7 +92,7 @@ var Oe = [
|
|
|
91
92
|
label: "Alert",
|
|
92
93
|
description: "Important alerts and warnings"
|
|
93
94
|
}
|
|
94
|
-
],
|
|
95
|
+
], je = [
|
|
95
96
|
{
|
|
96
97
|
value: "LOW",
|
|
97
98
|
label: "Low",
|
|
@@ -112,7 +113,7 @@ var Oe = [
|
|
|
112
113
|
label: "Urgent",
|
|
113
114
|
color: "bg-status-error-bg-subtle text-status-error-text"
|
|
114
115
|
}
|
|
115
|
-
],
|
|
116
|
+
], Me = [
|
|
116
117
|
{
|
|
117
118
|
value: "",
|
|
118
119
|
labelKey: "notifications.userRole.allRoles",
|
|
@@ -148,7 +149,7 @@ var Oe = [
|
|
|
148
149
|
labelKey: "notifications.userRole.guest",
|
|
149
150
|
label: "Guest"
|
|
150
151
|
}
|
|
151
|
-
],
|
|
152
|
+
], Ne = [
|
|
152
153
|
{
|
|
153
154
|
value: "",
|
|
154
155
|
labelKey: "notifications.userStatus.allStatuses",
|
|
@@ -175,24 +176,24 @@ var Oe = [
|
|
|
175
176
|
label: "Inactive"
|
|
176
177
|
}
|
|
177
178
|
];
|
|
178
|
-
function
|
|
179
|
-
let
|
|
179
|
+
function h() {
|
|
180
|
+
let ve = Se(), l = ie(), u = se(), h = oe(), { hasPermission: Pe, isLoading: Fe, refreshPermissions: Ie } = le(), { showToast: Le } = ce(), { sendNotification: Re, sendBatch: ze, sendWithTemplate: Be, isSending: g, error: Ve, lastResult: He, clearError: Ue, clearResult: We } = t(), { templates: _, isLoading: Ge } = n(), { trackNotificationSent: Ke } = te(), { searchUsers: v, fetchAllUsers: qe, results: Je, isLoading: Ye, error: y } = r(), { topics: Xe } = ee({ isActive: !0 }), [b, Ze] = o("compose"), [x, Qe] = o("EMAIL"), [S, $e] = o("MARKETING"), [C, et] = o("MEDIUM"), [w, tt] = o([]), [T, E] = o("manual"), [D, O] = o([]), [k, nt] = o(!1), [A, rt] = o(""), [j, it] = o(""), [M, at] = o(""), [N, ot] = o(""), [st, ct] = o(""), [lt, ut] = o(!1), [P, dt] = o(""), [ft, F] = o([{
|
|
180
181
|
url: "",
|
|
181
182
|
label: "",
|
|
182
183
|
kind: "image"
|
|
183
|
-
}]), [
|
|
184
|
+
}]), [pt, I] = o([{
|
|
184
185
|
id: "primary-action",
|
|
185
186
|
label: "",
|
|
186
187
|
url: "",
|
|
187
188
|
style: "primary"
|
|
188
|
-
}]), [L,
|
|
189
|
+
}]), [L, mt] = o(!1), [R, z] = o([]), [B, V] = o(""), [H, ht] = o(""), [U, gt] = o({}), [W, _t] = o(!1), [G, vt] = o(""), [K, yt] = o(!0), [bt, q] = o(null), [J, Y] = o(!1), X = a(() => _.find((e) => e.slug === H), [_, H]), Z = a(() => {
|
|
189
190
|
if (!X?.variables) return null;
|
|
190
191
|
try {
|
|
191
192
|
return typeof X.variables == "string" ? JSON.parse(X.variables) : X.variables;
|
|
192
193
|
} catch {
|
|
193
194
|
return null;
|
|
194
195
|
}
|
|
195
|
-
}, [X]),
|
|
196
|
+
}, [X]), xt = a(() => Z ? Array.isArray(Z) ? Z.filter((e) => e && typeof e.name == "string").map((e) => ({
|
|
196
197
|
key: e.name,
|
|
197
198
|
type: e.type || "string",
|
|
198
199
|
required: !!e.required,
|
|
@@ -204,60 +205,60 @@ function Ne() {
|
|
|
204
205
|
required: !1,
|
|
205
206
|
description: "",
|
|
206
207
|
defaultValue: ""
|
|
207
|
-
})) : [] : [], [Z]),
|
|
208
|
+
})) : [] : [], [Z]), St = (e) => {
|
|
208
209
|
let t = e;
|
|
209
210
|
for (let [e, n] of Object.entries(U)) t = t.replace(RegExp(`\\{\\{${e}\\}\\}`, "g"), n || `{{${e}}}`);
|
|
210
211
|
return t;
|
|
211
|
-
},
|
|
212
|
-
|
|
212
|
+
}, Ct = a(() => b === "template" && X ? St(X.bodyTemplate || "") : N, [
|
|
213
|
+
b,
|
|
213
214
|
X,
|
|
214
215
|
U,
|
|
215
|
-
|
|
216
|
-
]),
|
|
217
|
-
|
|
216
|
+
N
|
|
217
|
+
]), wt = a(() => b === "template" && X?.subject ? St(X.subject) : M, [
|
|
218
|
+
b,
|
|
218
219
|
X,
|
|
219
220
|
U,
|
|
220
|
-
|
|
221
|
-
]),
|
|
221
|
+
M
|
|
222
|
+
]), Tt = [
|
|
222
223
|
"EMAIL",
|
|
223
224
|
"SMS",
|
|
224
225
|
"WHATSAPP"
|
|
225
|
-
].includes(
|
|
226
|
+
].includes(x), Q = a(() => pt.filter((e) => e.label.trim() && e.url.trim()).map((e) => ({
|
|
226
227
|
id: e.id,
|
|
227
228
|
label: e.label.trim(),
|
|
228
229
|
url: e.url.trim(),
|
|
229
230
|
style: e.style
|
|
230
|
-
})), [
|
|
231
|
+
})), [pt]), $ = a(() => ft.filter((e) => e.url.trim()).map((e) => ({
|
|
231
232
|
url: e.url.trim(),
|
|
232
233
|
label: e.label.trim() || void 0,
|
|
233
234
|
kind: e.kind
|
|
234
|
-
})), [
|
|
235
|
-
if (
|
|
235
|
+
})), [ft]);
|
|
236
|
+
if (Fe) return /* @__PURE__ */ p("div", {
|
|
236
237
|
className: "flex h-64 items-center justify-center",
|
|
237
|
-
children: /* @__PURE__ */
|
|
238
|
+
children: /* @__PURE__ */ p("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" })
|
|
238
239
|
});
|
|
239
|
-
let
|
|
240
|
-
if (!
|
|
240
|
+
let Et = Pe(re.NOTIFICATION_CREATE), Dt = Pe(re.NOTIFICATION_SEND);
|
|
241
|
+
if (!Et || !Dt) return /* @__PURE__ */ p("div", {
|
|
241
242
|
className: "p-8 text-center text-text-secondary",
|
|
242
243
|
children: l("notifications.noPermissionCreateAndSend", "You don't have permission to create and send notifications.")
|
|
243
244
|
});
|
|
244
|
-
let
|
|
245
|
+
let Ot = (e) => x === "EMAIL" ? {
|
|
245
246
|
userId: e.id,
|
|
246
247
|
email: e.email
|
|
247
|
-
} :
|
|
248
|
+
} : x === "SMS" ? e.phoneNumber ? {
|
|
248
249
|
userId: e.id,
|
|
249
250
|
phoneNumber: e.phoneNumber
|
|
250
|
-
} : null :
|
|
251
|
+
} : null : x === "WHATSAPP" ? e.phoneNumber ? {
|
|
251
252
|
userId: e.id,
|
|
252
253
|
whatsappNumber: e.phoneNumber
|
|
253
254
|
} : null : {
|
|
254
255
|
userId: e.id,
|
|
255
256
|
email: e.email
|
|
256
|
-
},
|
|
257
|
+
}, kt = async () => (k ? await qe({
|
|
257
258
|
search: B,
|
|
258
|
-
role:
|
|
259
|
-
status:
|
|
260
|
-
}) :
|
|
259
|
+
role: A || void 0,
|
|
260
|
+
status: j || void 0
|
|
261
|
+
}) : D).map((e) => Ot(e)).filter((e) => !!e), At = () => w.map((e) => ({
|
|
261
262
|
email: e.email,
|
|
262
263
|
phoneNumber: e.phoneNumber,
|
|
263
264
|
pushToken: e.pushToken,
|
|
@@ -266,27 +267,27 @@ function Ne() {
|
|
|
266
267
|
teamsUserId: e.teamsUserId,
|
|
267
268
|
webhookUrl: e.webhookUrl,
|
|
268
269
|
userId: e.userId
|
|
269
|
-
})),
|
|
270
|
-
if (q(null),
|
|
271
|
-
if (
|
|
270
|
+
})), jt = () => {
|
|
271
|
+
if (q(null), T === "manual" && w.length === 0) return q(l("notifications.addRecipientRequired", "Please add at least one recipient")), !1;
|
|
272
|
+
if (T === "directory" && D.length === 0 && !k) return q(l("notifications.selectDirectoryUsersRequired", "Please select at least one user")), !1;
|
|
272
273
|
if (L && R.length === 0) return q(l("notifications.selectUsersRequired", "Please select users for in-app notifications")), !1;
|
|
273
|
-
if (
|
|
274
|
-
if (
|
|
275
|
-
if (!
|
|
276
|
-
if (
|
|
274
|
+
if (S === "MARKETING" && !P) return q(l("notifications.selectTopicRequired", "Please choose a topic for promotional notifications")), !1;
|
|
275
|
+
if (b === "compose") {
|
|
276
|
+
if (!N.trim()) return q(l("notifications.bodyRequired", "Message body is required")), !1;
|
|
277
|
+
if (x === "EMAIL" && !M.trim()) return q(l("notifications.subjectRequired", "Subject is required for email notifications")), !1;
|
|
277
278
|
} else if (!H) return q(l("notifications.selectTemplateRequired", "Please select a template")), !1;
|
|
278
279
|
return !0;
|
|
279
|
-
},
|
|
280
|
-
if (
|
|
281
|
-
|
|
280
|
+
}, Mt = async () => {
|
|
281
|
+
if (ae("light"), jt()) {
|
|
282
|
+
Ue(), We(), Y(!1);
|
|
282
283
|
try {
|
|
283
|
-
let e =
|
|
284
|
-
|
|
285
|
-
mode:
|
|
286
|
-
channel:
|
|
287
|
-
type:
|
|
288
|
-
priority:
|
|
289
|
-
recipientSource:
|
|
284
|
+
let e = T === "directory" ? await kt() : At(), t = e.length + (L ? R.length : 0), n = (e, n) => {
|
|
285
|
+
Ke({
|
|
286
|
+
mode: b,
|
|
287
|
+
channel: x,
|
|
288
|
+
type: b === "template" && X?.type || S,
|
|
289
|
+
priority: C,
|
|
290
|
+
recipientSource: T,
|
|
290
291
|
recipientCount: t,
|
|
291
292
|
successCount: e,
|
|
292
293
|
failedCount: n,
|
|
@@ -300,13 +301,13 @@ function Ne() {
|
|
|
300
301
|
q(l("notifications.noDeliverableRecipients", "No valid recipients matched the selected channel and filters"));
|
|
301
302
|
return;
|
|
302
303
|
}
|
|
303
|
-
if (
|
|
304
|
-
let t = await
|
|
304
|
+
if (b === "template") {
|
|
305
|
+
let t = await Be({
|
|
305
306
|
templateSlug: H,
|
|
306
307
|
variables: U,
|
|
307
308
|
recipients: e,
|
|
308
|
-
platform:
|
|
309
|
-
priority:
|
|
309
|
+
platform: x,
|
|
310
|
+
priority: C,
|
|
310
311
|
topicId: P || void 0,
|
|
311
312
|
actions: Q,
|
|
312
313
|
media: $,
|
|
@@ -323,20 +324,20 @@ function Ne() {
|
|
|
323
324
|
t && t.totalTriggered > 0 && (n(t.totalTriggered, t.totalFailed), Y(!0), i("success"));
|
|
324
325
|
} else {
|
|
325
326
|
let t = e.map((e) => ({
|
|
326
|
-
body:
|
|
327
|
-
channel:
|
|
327
|
+
body: N,
|
|
328
|
+
channel: x,
|
|
328
329
|
recipient: e,
|
|
329
|
-
subject:
|
|
330
|
-
htmlBody:
|
|
331
|
-
type:
|
|
332
|
-
priority:
|
|
330
|
+
subject: x === "EMAIL" ? M : void 0,
|
|
331
|
+
htmlBody: lt && st ? st : void 0,
|
|
332
|
+
type: S,
|
|
333
|
+
priority: C,
|
|
333
334
|
topicId: P || void 0,
|
|
334
335
|
redirectUrl: Q[0]?.url,
|
|
335
336
|
actions: Q,
|
|
336
337
|
media: $
|
|
337
338
|
}));
|
|
338
339
|
if (W || t.length > 1) {
|
|
339
|
-
let e = await
|
|
340
|
+
let e = await ze({
|
|
340
341
|
notifications: t,
|
|
341
342
|
...W && G && {
|
|
342
343
|
scheduledFor: new Date(G).toISOString(),
|
|
@@ -344,25 +345,25 @@ function Ne() {
|
|
|
344
345
|
}
|
|
345
346
|
});
|
|
346
347
|
e && (e.successCount > 0 || e.totalRequested > 0) && (n(e.successCount, e.failureCount), Y(!0), i("success"));
|
|
347
|
-
} else (await
|
|
348
|
+
} else (await Re({
|
|
348
349
|
notification: t[0],
|
|
349
|
-
platform:
|
|
350
|
+
platform: x,
|
|
350
351
|
...L && {
|
|
351
352
|
includeInApp: L,
|
|
352
353
|
userIds: R.map((e) => e.id)
|
|
353
354
|
}
|
|
354
355
|
}))?.status && (n(1, 0), Y(!0), i("success"));
|
|
355
356
|
}
|
|
356
|
-
} catch (
|
|
357
|
-
if (i("error"), t
|
|
358
|
-
|
|
357
|
+
} catch (t) {
|
|
358
|
+
if (i("error"), e(t)) {
|
|
359
|
+
Ue(), Le(l("notifications.permissionDeniedOnSend", "You don't have permission to send that notification. Refreshing access…"), "warning"), Ie().catch((e) => console.warn("[permissions] refresh failed after send denial:", e));
|
|
359
360
|
return;
|
|
360
361
|
}
|
|
361
|
-
console.error("Failed to send notification:",
|
|
362
|
+
console.error("Failed to send notification:", t);
|
|
362
363
|
}
|
|
363
364
|
}
|
|
364
|
-
},
|
|
365
|
-
|
|
365
|
+
}, Nt = () => {
|
|
366
|
+
tt([]), E("manual"), O([]), nt(!1), rt(""), it(""), at(""), ot(""), ct(""), dt(""), F([{
|
|
366
367
|
url: "",
|
|
367
368
|
label: "",
|
|
368
369
|
kind: "image"
|
|
@@ -371,243 +372,439 @@ function Ne() {
|
|
|
371
372
|
label: "",
|
|
372
373
|
url: "",
|
|
373
374
|
style: "primary"
|
|
374
|
-
}]),
|
|
375
|
-
},
|
|
376
|
-
|
|
375
|
+
}]), ht(""), gt({}), mt(!1), z([]), V(""), _t(!1), vt(""), Y(!1), Ue(), We();
|
|
376
|
+
}, Pt = bt || Ve, Ft = /* @__PURE__ */ p(f, { children: /* @__PURE__ */ m("div", {
|
|
377
|
+
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
378
|
+
children: [/* @__PURE__ */ m("label", {
|
|
379
|
+
className: "flex items-center gap-3 cursor-pointer",
|
|
380
|
+
children: [/* @__PURE__ */ p("input", {
|
|
381
|
+
type: "checkbox",
|
|
382
|
+
checked: W,
|
|
383
|
+
onChange: (e) => {
|
|
384
|
+
_t(e.target.checked), e.target.checked || vt("");
|
|
385
|
+
},
|
|
386
|
+
className: "w-4 h-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
|
|
387
|
+
}), /* @__PURE__ */ p("span", {
|
|
388
|
+
className: "text-sm font-medium text-text-primary",
|
|
389
|
+
children: l("notifications.scheduleForLater", "Schedule for later")
|
|
390
|
+
})]
|
|
391
|
+
}), W && /* @__PURE__ */ m("div", {
|
|
392
|
+
className: "mt-3 ml-7",
|
|
393
|
+
children: [/* @__PURE__ */ p("input", {
|
|
394
|
+
type: "datetime-local",
|
|
395
|
+
"aria-label": l("notifications.scheduleDateTime", "Send date and time"),
|
|
396
|
+
value: G,
|
|
397
|
+
min: (/* @__PURE__ */ new Date()).toISOString().slice(0, 16),
|
|
398
|
+
onChange: (e) => vt(e.target.value),
|
|
399
|
+
className: "px-4 py-2 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
|
400
|
+
}), /* @__PURE__ */ m("p", {
|
|
401
|
+
className: "text-xs text-text-tertiary mt-1",
|
|
402
|
+
children: [
|
|
403
|
+
l("notifications.timezone", "Timezone"),
|
|
404
|
+
":",
|
|
405
|
+
" ",
|
|
406
|
+
Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
407
|
+
]
|
|
408
|
+
})]
|
|
409
|
+
})]
|
|
410
|
+
}) }), It = /* @__PURE__ */ p(f, { children: /* @__PURE__ */ p("div", {
|
|
411
|
+
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
412
|
+
children: /* @__PURE__ */ m("div", {
|
|
413
|
+
className: "grid grid-cols-2 gap-4",
|
|
414
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
415
|
+
className: "block text-sm font-medium text-text-primary mb-2",
|
|
416
|
+
children: l("notifications.typeLabel", "Type")
|
|
417
|
+
}), /* @__PURE__ */ p("select", {
|
|
418
|
+
"aria-label": l("notifications.typeLabel", "Type"),
|
|
419
|
+
value: S,
|
|
420
|
+
onChange: (e) => $e(e.target.value),
|
|
421
|
+
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
422
|
+
children: Ae.map((e) => /* @__PURE__ */ p("option", {
|
|
423
|
+
value: e.value,
|
|
424
|
+
children: l(`notifications.type.${e.value}`, e.label)
|
|
425
|
+
}, e.value))
|
|
426
|
+
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
427
|
+
className: "block text-sm font-medium text-text-primary mb-2",
|
|
428
|
+
children: l("notifications.priorityLabel", "Priority")
|
|
429
|
+
}), /* @__PURE__ */ p("select", {
|
|
430
|
+
"aria-label": l("notifications.priorityLabel", "Priority"),
|
|
431
|
+
value: C,
|
|
432
|
+
onChange: (e) => et(e.target.value),
|
|
433
|
+
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
434
|
+
children: je.map((e) => /* @__PURE__ */ p("option", {
|
|
435
|
+
value: e.value,
|
|
436
|
+
children: l(`notifications.priority.${e.value}`, e.label)
|
|
437
|
+
}, e.value))
|
|
438
|
+
})] })]
|
|
439
|
+
})
|
|
440
|
+
}) }), Lt = /* @__PURE__ */ p(f, { children: /* @__PURE__ */ m("div", {
|
|
441
|
+
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
442
|
+
children: [/* @__PURE__ */ m("div", {
|
|
443
|
+
className: "mb-4 flex items-center gap-2",
|
|
444
|
+
children: [/* @__PURE__ */ p(_e, {
|
|
445
|
+
size: 18,
|
|
446
|
+
className: "text-text-secondary"
|
|
447
|
+
}), /* @__PURE__ */ p("h2", {
|
|
448
|
+
className: "text-sm font-medium text-text-primary",
|
|
449
|
+
children: l("notifications.actions", "Actions")
|
|
450
|
+
})]
|
|
451
|
+
}), /* @__PURE__ */ m("div", {
|
|
452
|
+
className: "space-y-3",
|
|
453
|
+
children: [pt.map((e, t) => /* @__PURE__ */ m("div", {
|
|
454
|
+
className: "grid gap-3 rounded-lg border border-border-subtle bg-bg-canvas p-3 md:grid-cols-[1fr,1fr,160px,auto]",
|
|
455
|
+
children: [
|
|
456
|
+
/* @__PURE__ */ p("input", {
|
|
457
|
+
type: "text",
|
|
458
|
+
value: e.label,
|
|
459
|
+
onChange: (e) => I((n) => n.map((n, r) => r === t ? {
|
|
460
|
+
...n,
|
|
461
|
+
label: e.target.value
|
|
462
|
+
} : n)),
|
|
463
|
+
placeholder: l("notifications.actionLabel", "Action label"),
|
|
464
|
+
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
|
|
465
|
+
}),
|
|
466
|
+
/* @__PURE__ */ p("input", {
|
|
467
|
+
type: "url",
|
|
468
|
+
value: e.url,
|
|
469
|
+
onChange: (e) => I((n) => n.map((n, r) => r === t ? {
|
|
470
|
+
...n,
|
|
471
|
+
url: e.target.value
|
|
472
|
+
} : n)),
|
|
473
|
+
placeholder: l("notifications.actionUrl", "https://..."),
|
|
474
|
+
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
|
|
475
|
+
}),
|
|
476
|
+
/* @__PURE__ */ m("select", {
|
|
477
|
+
"aria-label": l("notifications.actionStyle", "Action style"),
|
|
478
|
+
value: e.style,
|
|
479
|
+
onChange: (e) => I((n) => n.map((n, r) => r === t ? {
|
|
480
|
+
...n,
|
|
481
|
+
style: e.target.value
|
|
482
|
+
} : n)),
|
|
483
|
+
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
484
|
+
children: [
|
|
485
|
+
/* @__PURE__ */ p("option", {
|
|
486
|
+
value: "primary",
|
|
487
|
+
children: l("notifications.actionStyle.primary", "Primary")
|
|
488
|
+
}),
|
|
489
|
+
/* @__PURE__ */ p("option", {
|
|
490
|
+
value: "secondary",
|
|
491
|
+
children: l("notifications.actionStyle.secondary", "Secondary")
|
|
492
|
+
}),
|
|
493
|
+
/* @__PURE__ */ p("option", {
|
|
494
|
+
value: "danger",
|
|
495
|
+
children: l("notifications.actionStyle.danger", "Danger")
|
|
496
|
+
})
|
|
497
|
+
]
|
|
498
|
+
}),
|
|
499
|
+
/* @__PURE__ */ p("button", {
|
|
500
|
+
type: "button",
|
|
501
|
+
onClick: () => I((e) => e.length === 1 ? [{
|
|
502
|
+
id: "primary-action",
|
|
503
|
+
label: "",
|
|
504
|
+
url: "",
|
|
505
|
+
style: "primary"
|
|
506
|
+
}] : e.filter((e, n) => n !== t)),
|
|
507
|
+
className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken",
|
|
508
|
+
children: l("notifications.remove", "Remove")
|
|
509
|
+
})
|
|
510
|
+
]
|
|
511
|
+
}, e.id)), /* @__PURE__ */ p("button", {
|
|
512
|
+
type: "button",
|
|
513
|
+
onClick: () => I((e) => [...e, {
|
|
514
|
+
id: `action-${e.length + 1}`,
|
|
515
|
+
label: "",
|
|
516
|
+
url: "",
|
|
517
|
+
style: "secondary"
|
|
518
|
+
}]),
|
|
519
|
+
className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken",
|
|
520
|
+
children: l("notifications.addAction", "Add action")
|
|
521
|
+
})]
|
|
522
|
+
})]
|
|
523
|
+
}) }), Rt = /* @__PURE__ */ p(f, { children: /* @__PURE__ */ m("div", {
|
|
524
|
+
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
525
|
+
children: [/* @__PURE__ */ m("div", {
|
|
526
|
+
className: "mb-4 flex items-center gap-2",
|
|
527
|
+
children: [/* @__PURE__ */ p(ge, {
|
|
528
|
+
size: 18,
|
|
529
|
+
className: "text-text-secondary"
|
|
530
|
+
}), /* @__PURE__ */ p("h2", {
|
|
531
|
+
className: "text-sm font-medium text-text-primary",
|
|
532
|
+
children: l("notifications.media", "Media")
|
|
533
|
+
})]
|
|
534
|
+
}), /* @__PURE__ */ m("div", {
|
|
535
|
+
className: "space-y-3",
|
|
536
|
+
children: [ft.map((e, t) => /* @__PURE__ */ m("div", {
|
|
537
|
+
className: "grid gap-3 rounded-lg border border-border-subtle bg-bg-canvas p-3 md:grid-cols-[1fr,220px,140px,auto]",
|
|
538
|
+
children: [
|
|
539
|
+
/* @__PURE__ */ p("input", {
|
|
540
|
+
type: "url",
|
|
541
|
+
value: e.url,
|
|
542
|
+
onChange: (e) => F((n) => n.map((n, r) => r === t ? {
|
|
543
|
+
...n,
|
|
544
|
+
url: e.target.value
|
|
545
|
+
} : n)),
|
|
546
|
+
placeholder: l("notifications.mediaUrl", "Media URL"),
|
|
547
|
+
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
|
|
548
|
+
}),
|
|
549
|
+
/* @__PURE__ */ p("input", {
|
|
550
|
+
type: "text",
|
|
551
|
+
value: e.label,
|
|
552
|
+
onChange: (e) => F((n) => n.map((n, r) => r === t ? {
|
|
553
|
+
...n,
|
|
554
|
+
label: e.target.value
|
|
555
|
+
} : n)),
|
|
556
|
+
placeholder: l("notifications.mediaLabel", "Caption / label"),
|
|
557
|
+
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
|
|
558
|
+
}),
|
|
559
|
+
/* @__PURE__ */ m("select", {
|
|
560
|
+
"aria-label": l("notifications.mediaKindLabel", "Media kind"),
|
|
561
|
+
value: e.kind,
|
|
562
|
+
onChange: (e) => F((n) => n.map((n, r) => r === t ? {
|
|
563
|
+
...n,
|
|
564
|
+
kind: e.target.value
|
|
565
|
+
} : n)),
|
|
566
|
+
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
567
|
+
children: [
|
|
568
|
+
/* @__PURE__ */ p("option", {
|
|
569
|
+
value: "image",
|
|
570
|
+
children: l("notifications.mediaKind.image", "Image")
|
|
571
|
+
}),
|
|
572
|
+
/* @__PURE__ */ p("option", {
|
|
573
|
+
value: "video",
|
|
574
|
+
children: l("notifications.mediaKind.video", "Video")
|
|
575
|
+
}),
|
|
576
|
+
/* @__PURE__ */ p("option", {
|
|
577
|
+
value: "file",
|
|
578
|
+
children: l("notifications.mediaKind.file", "File")
|
|
579
|
+
})
|
|
580
|
+
]
|
|
581
|
+
}),
|
|
582
|
+
/* @__PURE__ */ p("button", {
|
|
583
|
+
type: "button",
|
|
584
|
+
onClick: () => F((e) => e.length === 1 ? [{
|
|
585
|
+
url: "",
|
|
586
|
+
label: "",
|
|
587
|
+
kind: "image"
|
|
588
|
+
}] : e.filter((e, n) => n !== t)),
|
|
589
|
+
className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken",
|
|
590
|
+
children: l("notifications.remove", "Remove")
|
|
591
|
+
})
|
|
592
|
+
]
|
|
593
|
+
}, `${e.kind}-${t}`)), /* @__PURE__ */ p("button", {
|
|
594
|
+
type: "button",
|
|
595
|
+
onClick: () => F((e) => [...e, {
|
|
596
|
+
url: "",
|
|
597
|
+
label: "",
|
|
598
|
+
kind: "image"
|
|
599
|
+
}]),
|
|
600
|
+
className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken",
|
|
601
|
+
children: l("notifications.addMedia", "Add media")
|
|
602
|
+
})]
|
|
603
|
+
})]
|
|
604
|
+
}) });
|
|
605
|
+
return /* @__PURE__ */ m("div", {
|
|
377
606
|
className: "min-h-screen bg-bg-canvas",
|
|
378
607
|
children: [
|
|
379
|
-
/* @__PURE__ */
|
|
608
|
+
/* @__PURE__ */ m("div", {
|
|
380
609
|
className: "sticky top-0 z-10 flex items-center justify-between gap-3 px-6 py-4 bg-bg-surface border-b border-border-seam",
|
|
381
|
-
children: [/* @__PURE__ */
|
|
610
|
+
children: [/* @__PURE__ */ m("div", {
|
|
382
611
|
className: "flex items-center gap-4",
|
|
383
|
-
children: [/* @__PURE__ */
|
|
384
|
-
onClick: () =>
|
|
612
|
+
children: [/* @__PURE__ */ p("button", {
|
|
613
|
+
onClick: () => ve(h ? u.inbox : u.center),
|
|
614
|
+
"aria-label": l("notifications.back", "Back"),
|
|
385
615
|
className: "p-2 text-text-secondary hover:text-text-primary hover:bg-bg-sunken rounded-lg transition-colors",
|
|
386
|
-
children: /* @__PURE__ */
|
|
387
|
-
}), /* @__PURE__ */
|
|
616
|
+
children: /* @__PURE__ */ p(de, { size: 20 })
|
|
617
|
+
}), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("h1", {
|
|
388
618
|
className: "text-xl font-semibold text-text-primary",
|
|
389
619
|
children: l("notifications.sendTitle", "Send Notification")
|
|
390
|
-
}), /* @__PURE__ */
|
|
620
|
+
}), /* @__PURE__ */ p("p", {
|
|
391
621
|
className: "text-sm text-text-secondary",
|
|
392
622
|
children: l("notifications.sendSubtitle", "Compose and send notifications to users")
|
|
393
623
|
})] })]
|
|
394
|
-
}), /* @__PURE__ */
|
|
624
|
+
}), /* @__PURE__ */ p(Ce, {
|
|
395
625
|
primary: {
|
|
396
|
-
label:
|
|
397
|
-
onSelect:
|
|
398
|
-
disabled:
|
|
399
|
-
icon:
|
|
626
|
+
label: g ? l("notifications.sending", "Sending...") : J ? l("notifications.sent", "Sent!") : W ? l("notifications.schedule", "Schedule") : l("notifications.sendNotification", "Send Notification"),
|
|
627
|
+
onSelect: Mt,
|
|
628
|
+
disabled: g || J,
|
|
629
|
+
icon: g ? /* @__PURE__ */ p(c, {
|
|
400
630
|
size: 16,
|
|
401
631
|
className: "animate-spin"
|
|
402
|
-
}) :
|
|
632
|
+
}) : p(J ? s : ye, { size: 16 })
|
|
403
633
|
},
|
|
404
634
|
actions: [{
|
|
405
635
|
label: K ? l("notifications.hidePreview", "Hide preview") : l("notifications.showPreview", "Show preview"),
|
|
406
|
-
onSelect: () =>
|
|
407
|
-
icon:
|
|
636
|
+
onSelect: () => yt(!K),
|
|
637
|
+
icon: p(K ? me : pe, { size: 16 })
|
|
408
638
|
}]
|
|
409
639
|
})]
|
|
410
640
|
}),
|
|
411
|
-
J && /* @__PURE__ */
|
|
641
|
+
J && /* @__PURE__ */ m("div", {
|
|
412
642
|
className: "mx-6 mt-4 flex items-center justify-between p-4 bg-status-success-bg-subtle border border-border-seam rounded-lg",
|
|
413
|
-
children: [/* @__PURE__ */
|
|
643
|
+
children: [/* @__PURE__ */ m("div", {
|
|
414
644
|
className: "flex items-center gap-3",
|
|
415
|
-
children: [/* @__PURE__ */
|
|
645
|
+
children: [/* @__PURE__ */ p(s, {
|
|
416
646
|
size: 20,
|
|
417
647
|
className: "text-status-success-text"
|
|
418
|
-
}), /* @__PURE__ */
|
|
648
|
+
}), /* @__PURE__ */ m("p", {
|
|
419
649
|
className: "text-sm text-status-success-text",
|
|
420
650
|
children: [
|
|
421
651
|
l("notifications.sentSuccessfully", "Notification sent successfully to"),
|
|
422
652
|
" ",
|
|
423
|
-
|
|
653
|
+
w.length,
|
|
424
654
|
" ",
|
|
425
655
|
l("notifications.recipientCount", "recipient"),
|
|
426
|
-
|
|
656
|
+
w.length === 1 ? "" : "s",
|
|
427
657
|
"!"
|
|
428
658
|
]
|
|
429
659
|
})]
|
|
430
|
-
}), /* @__PURE__ */
|
|
431
|
-
onClick:
|
|
660
|
+
}), /* @__PURE__ */ p("button", {
|
|
661
|
+
onClick: Nt,
|
|
432
662
|
className: "px-3 py-1.5 text-sm font-medium text-status-success-text hover:bg-status-success-bg-subtle rounded-lg transition-colors",
|
|
433
663
|
children: l("notifications.sendAnother", "Send Another")
|
|
434
664
|
})]
|
|
435
665
|
}),
|
|
436
|
-
|
|
666
|
+
Pt && /* @__PURE__ */ m("div", {
|
|
437
667
|
className: "mx-6 mt-4 flex items-center gap-3 p-4 bg-status-error-bg-subtle border border-border-seam rounded-lg",
|
|
438
|
-
children: [/* @__PURE__ */
|
|
668
|
+
children: [/* @__PURE__ */ p(ue, {
|
|
439
669
|
size: 20,
|
|
440
670
|
className: "text-status-error-text flex-shrink-0"
|
|
441
|
-
}), /* @__PURE__ */
|
|
671
|
+
}), /* @__PURE__ */ p("p", {
|
|
442
672
|
className: "text-sm text-status-error-text",
|
|
443
|
-
children:
|
|
673
|
+
children: Pt
|
|
444
674
|
})]
|
|
445
675
|
}),
|
|
446
|
-
/* @__PURE__ */
|
|
676
|
+
/* @__PURE__ */ m("div", {
|
|
447
677
|
className: "px-6 pt-4 space-y-4",
|
|
448
|
-
children: [/* @__PURE__ */
|
|
449
|
-
icon: /* @__PURE__ */
|
|
678
|
+
children: [/* @__PURE__ */ p(Oe, {
|
|
679
|
+
icon: /* @__PURE__ */ p(ye, { size: 16 }),
|
|
450
680
|
children: l("notifications.sendPurpose", "Compose and dispatch a one-off notification to specific people. Pick a delivery channel (email, SMS, push, Slack, webhook…), write the message or start from a saved template, choose recipients individually or by directory query, and send now or schedule it for later. A live preview on the right shows exactly what each recipient will get.")
|
|
451
|
-
}), /* @__PURE__ */
|
|
681
|
+
}), /* @__PURE__ */ p(Ee, {
|
|
452
682
|
storageKey: "notification-create",
|
|
453
683
|
steps: [
|
|
454
684
|
{
|
|
455
685
|
id: "template",
|
|
456
686
|
label: l("notifications.nextUseTemplateLabel", "Start from a template"),
|
|
457
687
|
description: l("notifications.nextUseTemplateDesc", "Reuse an approved template instead of writing the message from scratch."),
|
|
458
|
-
onClick: () =>
|
|
688
|
+
onClick: () => Ze("template")
|
|
459
689
|
},
|
|
460
690
|
{
|
|
461
691
|
id: "recipients",
|
|
462
692
|
label: l("notifications.nextRecipientsLabel", "Target by directory"),
|
|
463
693
|
description: l("notifications.nextRecipientsDesc", "Send to everyone matching a role or status filter instead of picking users one by one."),
|
|
464
|
-
onClick: () =>
|
|
694
|
+
onClick: () => E("directory")
|
|
465
695
|
},
|
|
466
696
|
{
|
|
467
697
|
id: "preview",
|
|
468
698
|
label: l("notifications.nextPreviewLabel", "Check the live preview"),
|
|
469
699
|
description: l("notifications.nextPreviewDesc", "Confirm the rendered message, recipients and actions look right before you send."),
|
|
470
|
-
onClick: () =>
|
|
700
|
+
onClick: () => yt(!0)
|
|
471
701
|
}
|
|
472
702
|
]
|
|
473
703
|
})]
|
|
474
704
|
}),
|
|
475
|
-
/* @__PURE__ */
|
|
705
|
+
/* @__PURE__ */ m("div", {
|
|
476
706
|
className: "flex gap-6 p-6",
|
|
477
|
-
children: [/* @__PURE__ */
|
|
707
|
+
children: [/* @__PURE__ */ m("div", {
|
|
478
708
|
className: `flex-1 space-y-6 ${K ? "max-w-2xl" : ""}`,
|
|
479
709
|
children: [
|
|
480
|
-
/* @__PURE__ */
|
|
710
|
+
/* @__PURE__ */ m("div", {
|
|
481
711
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
482
|
-
children: [/* @__PURE__ */
|
|
712
|
+
children: [/* @__PURE__ */ m("div", {
|
|
483
713
|
className: "flex items-center gap-2 mb-4",
|
|
484
|
-
children: [/* @__PURE__ */
|
|
714
|
+
children: [/* @__PURE__ */ p(he, {
|
|
485
715
|
size: 18,
|
|
486
716
|
className: "text-text-secondary"
|
|
487
|
-
}), /* @__PURE__ */
|
|
717
|
+
}), /* @__PURE__ */ p("h2", {
|
|
488
718
|
className: "text-sm font-medium text-text-primary",
|
|
489
719
|
children: l("notifications.sendMode", "Send Mode")
|
|
490
720
|
})]
|
|
491
|
-
}), /* @__PURE__ */
|
|
721
|
+
}), /* @__PURE__ */ m("div", {
|
|
492
722
|
className: "flex gap-2",
|
|
493
|
-
children: [/* @__PURE__ */
|
|
494
|
-
onClick: () =>
|
|
495
|
-
className: `flex-1 px-4 py-3 text-sm font-medium rounded-lg border transition-colors ${
|
|
723
|
+
children: [/* @__PURE__ */ p("button", {
|
|
724
|
+
onClick: () => Ze("compose"),
|
|
725
|
+
className: `flex-1 px-4 py-3 text-sm font-medium rounded-lg border transition-colors ${b === "compose" ? "bg-primary-50 dark:bg-primary-900/30 border-primary-500 text-primary-700 dark:text-primary-300" : "bg-bg-canvas border-border-subtle text-text-secondary hover:bg-bg-sunken"}`,
|
|
496
726
|
children: l("notifications.composeMessage", "Compose Message")
|
|
497
|
-
}), /* @__PURE__ */
|
|
498
|
-
onClick: () =>
|
|
499
|
-
className: `flex-1 px-4 py-3 text-sm font-medium rounded-lg border transition-colors ${
|
|
727
|
+
}), /* @__PURE__ */ p("button", {
|
|
728
|
+
onClick: () => Ze("template"),
|
|
729
|
+
className: `flex-1 px-4 py-3 text-sm font-medium rounded-lg border transition-colors ${b === "template" ? "bg-primary-50 dark:bg-primary-900/30 border-primary-500 text-primary-700 dark:text-primary-300" : "bg-bg-canvas border-border-subtle text-text-secondary hover:bg-bg-sunken"}`,
|
|
500
730
|
children: l("notifications.useTemplate", "Use Template")
|
|
501
731
|
})]
|
|
502
732
|
})]
|
|
503
733
|
}),
|
|
504
|
-
/* @__PURE__ */
|
|
734
|
+
/* @__PURE__ */ m("div", {
|
|
505
735
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
506
736
|
children: [
|
|
507
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ p("h2", {
|
|
508
738
|
className: "text-sm font-medium text-text-primary mb-4",
|
|
509
739
|
children: l("notifications.channel", "Channel")
|
|
510
740
|
}),
|
|
511
|
-
/* @__PURE__ */
|
|
741
|
+
/* @__PURE__ */ p("div", {
|
|
512
742
|
className: "grid grid-cols-2 sm:grid-cols-4 gap-2",
|
|
513
|
-
children:
|
|
743
|
+
children: ke.map((e) => {
|
|
514
744
|
let t = e.icon;
|
|
515
|
-
return /* @__PURE__ */
|
|
745
|
+
return /* @__PURE__ */ m("button", {
|
|
516
746
|
onClick: () => {
|
|
517
|
-
|
|
747
|
+
Qe(e.value), tt([]), O([]), [
|
|
518
748
|
"EMAIL",
|
|
519
749
|
"SMS",
|
|
520
750
|
"WHATSAPP"
|
|
521
|
-
].includes(e.value) || (
|
|
751
|
+
].includes(e.value) || (E("manual"), nt(!1));
|
|
522
752
|
},
|
|
523
|
-
className: `flex flex-col items-center gap-2 p-3 rounded-lg border transition-colors ${
|
|
524
|
-
children: [/* @__PURE__ */
|
|
753
|
+
className: `flex flex-col items-center gap-2 p-3 rounded-lg border transition-colors ${x === e.value ? "bg-primary-50 dark:bg-primary-900/30 border-primary-500 text-primary-700 dark:text-primary-300" : "bg-bg-canvas border-border-subtle text-text-secondary hover:bg-bg-sunken"}`,
|
|
754
|
+
children: [/* @__PURE__ */ p(t, { size: 20 }), /* @__PURE__ */ p("span", {
|
|
525
755
|
className: "text-xs font-medium",
|
|
526
756
|
children: l(`notifications.channel.${e.value}`, e.label)
|
|
527
757
|
})]
|
|
528
758
|
}, e.value);
|
|
529
759
|
})
|
|
530
760
|
}),
|
|
531
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ m("div", {
|
|
532
762
|
className: "mt-4 pt-4 border-t border-border-subtle",
|
|
533
|
-
children: [/* @__PURE__ */
|
|
763
|
+
children: [/* @__PURE__ */ m("label", {
|
|
534
764
|
className: "flex items-center gap-3 cursor-pointer",
|
|
535
|
-
children: [/* @__PURE__ */
|
|
765
|
+
children: [/* @__PURE__ */ p("input", {
|
|
536
766
|
type: "checkbox",
|
|
537
767
|
checked: L,
|
|
538
768
|
onChange: (e) => {
|
|
539
|
-
|
|
769
|
+
mt(e.target.checked), e.target.checked || (z([]), V(""));
|
|
540
770
|
},
|
|
541
771
|
className: "w-4 h-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
|
|
542
|
-
}), /* @__PURE__ */
|
|
772
|
+
}), /* @__PURE__ */ m("div", {
|
|
543
773
|
className: "flex items-center gap-2",
|
|
544
|
-
children: [/* @__PURE__ */
|
|
774
|
+
children: [/* @__PURE__ */ p(fe, {
|
|
545
775
|
size: 16,
|
|
546
776
|
className: "text-primary-500"
|
|
547
|
-
}), /* @__PURE__ */
|
|
777
|
+
}), /* @__PURE__ */ p("span", {
|
|
548
778
|
className: "text-sm font-medium text-text-primary",
|
|
549
779
|
children: l("notifications.alsoSendInApp", "Also send as In-App notification")
|
|
550
780
|
})]
|
|
551
781
|
})]
|
|
552
|
-
}), /* @__PURE__ */
|
|
782
|
+
}), /* @__PURE__ */ p("p", {
|
|
553
783
|
className: "text-xs text-text-secondary ml-7 mt-1",
|
|
554
784
|
children: l("notifications.inAppDescription", "Show this notification in the app's notification center alongside the selected channel")
|
|
555
785
|
})]
|
|
556
786
|
})
|
|
557
787
|
]
|
|
558
788
|
}),
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
children: [/* @__PURE__ */ f("label", {
|
|
562
|
-
className: "flex items-center gap-3 cursor-pointer",
|
|
563
|
-
children: [/* @__PURE__ */ d("input", {
|
|
564
|
-
type: "checkbox",
|
|
565
|
-
checked: W,
|
|
566
|
-
onChange: (e) => {
|
|
567
|
-
ft(e.target.checked), e.target.checked || pt("");
|
|
568
|
-
},
|
|
569
|
-
className: "w-4 h-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
|
|
570
|
-
}), /* @__PURE__ */ d("span", {
|
|
571
|
-
className: "text-sm font-medium text-text-primary",
|
|
572
|
-
children: l("notifications.scheduleForLater", "Schedule for later")
|
|
573
|
-
})]
|
|
574
|
-
}), W && /* @__PURE__ */ f("div", {
|
|
575
|
-
className: "mt-3 ml-7",
|
|
576
|
-
children: [/* @__PURE__ */ d("input", {
|
|
577
|
-
type: "datetime-local",
|
|
578
|
-
value: G,
|
|
579
|
-
min: (/* @__PURE__ */ new Date()).toISOString().slice(0, 16),
|
|
580
|
-
onChange: (e) => pt(e.target.value),
|
|
581
|
-
className: "px-4 py-2 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
|
582
|
-
}), /* @__PURE__ */ f("p", {
|
|
583
|
-
className: "text-xs text-text-tertiary mt-1",
|
|
584
|
-
children: [
|
|
585
|
-
l("notifications.timezone", "Timezone"),
|
|
586
|
-
":",
|
|
587
|
-
" ",
|
|
588
|
-
Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
589
|
-
]
|
|
590
|
-
})]
|
|
591
|
-
})]
|
|
592
|
-
}),
|
|
593
|
-
/* @__PURE__ */ f("div", {
|
|
789
|
+
!h && Ft,
|
|
790
|
+
/* @__PURE__ */ m("div", {
|
|
594
791
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
595
792
|
children: [
|
|
596
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ m("label", {
|
|
597
794
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
598
|
-
children: [l("notifications.topic", "Topic"),
|
|
795
|
+
children: [l("notifications.topic", "Topic"), S === "MARKETING" && /* @__PURE__ */ p("span", {
|
|
599
796
|
className: "text-status-error-text ml-1",
|
|
600
797
|
children: "*"
|
|
601
798
|
})]
|
|
602
799
|
}),
|
|
603
|
-
/* @__PURE__ */
|
|
800
|
+
/* @__PURE__ */ m("select", {
|
|
604
801
|
value: P,
|
|
605
|
-
onChange: (e) =>
|
|
802
|
+
onChange: (e) => dt(e.target.value),
|
|
606
803
|
className: "w-full rounded-lg border border-border-subtle bg-bg-canvas px-4 py-3 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-primary-500 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
607
|
-
children: [/* @__PURE__ */
|
|
804
|
+
children: [/* @__PURE__ */ p("option", {
|
|
608
805
|
value: "",
|
|
609
806
|
children: l("notifications.selectTopic", "Select a topic")
|
|
610
|
-
}),
|
|
807
|
+
}), Xe.map((e) => /* @__PURE__ */ m("option", {
|
|
611
808
|
value: e.id,
|
|
612
809
|
children: [
|
|
613
810
|
e.name,
|
|
@@ -617,189 +814,189 @@ function Ne() {
|
|
|
617
814
|
]
|
|
618
815
|
}, e.id))]
|
|
619
816
|
}),
|
|
620
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ p("p", {
|
|
621
818
|
className: "mt-2 text-xs text-text-secondary",
|
|
622
819
|
children: l("notifications.topicHelper", "Topics help users unsubscribe from promotional content they do not want.")
|
|
623
820
|
})
|
|
624
821
|
]
|
|
625
822
|
}),
|
|
626
|
-
/* @__PURE__ */
|
|
823
|
+
/* @__PURE__ */ m("div", {
|
|
627
824
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
628
825
|
children: [
|
|
629
|
-
/* @__PURE__ */
|
|
826
|
+
/* @__PURE__ */ m("div", {
|
|
630
827
|
className: "flex items-center gap-2 mb-4",
|
|
631
|
-
children: [/* @__PURE__ */
|
|
828
|
+
children: [/* @__PURE__ */ p(be, {
|
|
632
829
|
size: 18,
|
|
633
830
|
className: "text-text-secondary"
|
|
634
|
-
}), /* @__PURE__ */
|
|
831
|
+
}), /* @__PURE__ */ m("h2", {
|
|
635
832
|
className: "text-sm font-medium text-text-primary",
|
|
636
833
|
children: [
|
|
637
834
|
l("notifications.recipients", "Recipients"),
|
|
638
835
|
" ",
|
|
639
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ p("span", {
|
|
640
837
|
className: "text-status-error-text",
|
|
641
838
|
children: "*"
|
|
642
839
|
})
|
|
643
840
|
]
|
|
644
841
|
})]
|
|
645
842
|
}),
|
|
646
|
-
|
|
843
|
+
Tt && /* @__PURE__ */ m("div", {
|
|
647
844
|
className: "mb-4 flex gap-2",
|
|
648
|
-
children: [/* @__PURE__ */
|
|
649
|
-
onClick: () =>
|
|
650
|
-
className: `flex-1 rounded-lg border px-4 py-2 text-sm font-medium ${
|
|
845
|
+
children: [/* @__PURE__ */ p("button", {
|
|
846
|
+
onClick: () => E("manual"),
|
|
847
|
+
className: `flex-1 rounded-lg border px-4 py-2 text-sm font-medium ${T === "manual" ? "border-primary-500 bg-primary-50 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300" : "border-border-subtle bg-bg-canvas text-text-secondary hover:bg-bg-sunken"}`,
|
|
651
848
|
children: l("notifications.manualRecipients", "Manual recipients")
|
|
652
|
-
}), /* @__PURE__ */
|
|
653
|
-
onClick: () =>
|
|
654
|
-
className: `flex-1 rounded-lg border px-4 py-2 text-sm font-medium ${
|
|
849
|
+
}), /* @__PURE__ */ p("button", {
|
|
850
|
+
onClick: () => E("directory"),
|
|
851
|
+
className: `flex-1 rounded-lg border px-4 py-2 text-sm font-medium ${T === "directory" ? "border-primary-500 bg-primary-50 text-primary-700 dark:bg-primary-900/30 dark:text-primary-300" : "border-border-subtle bg-bg-canvas text-text-secondary hover:bg-bg-sunken"}`,
|
|
655
852
|
children: l("notifications.userDirectory", "User directory")
|
|
656
853
|
})]
|
|
657
854
|
}),
|
|
658
|
-
|
|
659
|
-
recipients:
|
|
660
|
-
onChange:
|
|
661
|
-
channel:
|
|
662
|
-
disabled:
|
|
663
|
-
}) : /* @__PURE__ */
|
|
855
|
+
T === "manual" || !Tt ? /* @__PURE__ */ p(ne, {
|
|
856
|
+
recipients: w,
|
|
857
|
+
onChange: tt,
|
|
858
|
+
channel: x,
|
|
859
|
+
disabled: g || J
|
|
860
|
+
}) : /* @__PURE__ */ m("div", {
|
|
664
861
|
className: "space-y-4",
|
|
665
862
|
children: [
|
|
666
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ m("div", {
|
|
667
864
|
className: "grid gap-3 md:grid-cols-[minmax(0,1fr),180px,180px]",
|
|
668
865
|
children: [
|
|
669
|
-
/* @__PURE__ */
|
|
866
|
+
/* @__PURE__ */ m("div", {
|
|
670
867
|
className: "relative",
|
|
671
|
-
children: [/* @__PURE__ */
|
|
868
|
+
children: [/* @__PURE__ */ p("input", {
|
|
672
869
|
type: "text",
|
|
673
870
|
value: B,
|
|
674
871
|
onChange: (e) => {
|
|
675
|
-
V(e.target.value),
|
|
676
|
-
role:
|
|
677
|
-
status:
|
|
872
|
+
V(e.target.value), v(e.target.value, {
|
|
873
|
+
role: A || void 0,
|
|
874
|
+
status: j || void 0
|
|
678
875
|
});
|
|
679
876
|
},
|
|
680
877
|
placeholder: l("notifications.searchUsersPlaceholder", "Search users by email or name..."),
|
|
681
878
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
|
682
|
-
}),
|
|
879
|
+
}), Ye && /* @__PURE__ */ p("div", {
|
|
683
880
|
className: "absolute right-3 top-1/2 -translate-y-1/2",
|
|
684
|
-
children: /* @__PURE__ */
|
|
881
|
+
children: /* @__PURE__ */ p(c, {
|
|
685
882
|
size: 16,
|
|
686
883
|
className: "animate-spin text-text-tertiary"
|
|
687
884
|
})
|
|
688
885
|
})]
|
|
689
886
|
}),
|
|
690
|
-
/* @__PURE__ */
|
|
691
|
-
value:
|
|
887
|
+
/* @__PURE__ */ p("select", {
|
|
888
|
+
value: A,
|
|
692
889
|
onChange: (e) => {
|
|
693
|
-
|
|
890
|
+
rt(e.target.value), v(B, {
|
|
694
891
|
role: e.target.value || void 0,
|
|
695
|
-
status:
|
|
892
|
+
status: j || void 0
|
|
696
893
|
});
|
|
697
894
|
},
|
|
698
895
|
className: "rounded-lg border border-border-subtle bg-bg-canvas px-4 py-3 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
699
|
-
children:
|
|
896
|
+
children: Me.map((e) => /* @__PURE__ */ p("option", {
|
|
700
897
|
value: e.value,
|
|
701
898
|
children: l(e.labelKey, e.label)
|
|
702
899
|
}, e.value))
|
|
703
900
|
}),
|
|
704
|
-
/* @__PURE__ */
|
|
705
|
-
value:
|
|
901
|
+
/* @__PURE__ */ p("select", {
|
|
902
|
+
value: j,
|
|
706
903
|
onChange: (e) => {
|
|
707
|
-
|
|
708
|
-
role:
|
|
904
|
+
it(e.target.value), v(B, {
|
|
905
|
+
role: A || void 0,
|
|
709
906
|
status: e.target.value || void 0
|
|
710
907
|
});
|
|
711
908
|
},
|
|
712
909
|
className: "rounded-lg border border-border-subtle bg-bg-canvas px-4 py-3 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
713
|
-
children:
|
|
910
|
+
children: Ne.map((e) => /* @__PURE__ */ p("option", {
|
|
714
911
|
value: e.value,
|
|
715
912
|
children: l(e.labelKey, e.label)
|
|
716
913
|
}, e.value))
|
|
717
914
|
})
|
|
718
915
|
]
|
|
719
916
|
}),
|
|
720
|
-
/* @__PURE__ */
|
|
917
|
+
/* @__PURE__ */ m("label", {
|
|
721
918
|
className: "flex items-center gap-3 text-sm text-text-secondary",
|
|
722
|
-
children: [/* @__PURE__ */
|
|
919
|
+
children: [/* @__PURE__ */ p("input", {
|
|
723
920
|
type: "checkbox",
|
|
724
|
-
checked:
|
|
725
|
-
onChange: (e) =>
|
|
921
|
+
checked: k,
|
|
922
|
+
onChange: (e) => nt(e.target.checked),
|
|
726
923
|
className: "h-4 w-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
|
|
727
|
-
}), /* @__PURE__ */
|
|
924
|
+
}), /* @__PURE__ */ p("span", { children: l("notifications.sendToAllMatchingUsers", "Send to all users matching the current search and filters") })]
|
|
728
925
|
}),
|
|
729
|
-
B && /* @__PURE__ */
|
|
926
|
+
B && /* @__PURE__ */ p("div", {
|
|
730
927
|
className: "max-h-56 overflow-y-auto rounded-lg border border-border-subtle",
|
|
731
|
-
children:
|
|
732
|
-
let t =
|
|
733
|
-
return /* @__PURE__ */
|
|
928
|
+
children: Je.length > 0 ? Je.map((e) => {
|
|
929
|
+
let t = D.some((t) => t.id === e.id), n = x === "EMAIL" ? !!e.email : x === "SMS" || x === "WHATSAPP" ? !!e.phoneNumber : !0;
|
|
930
|
+
return /* @__PURE__ */ m("button", {
|
|
734
931
|
type: "button",
|
|
735
932
|
disabled: !n,
|
|
736
933
|
onClick: () => {
|
|
737
|
-
|
|
934
|
+
O(t ? (t) => t.filter((t) => t.id !== e.id) : (t) => [...t, e]);
|
|
738
935
|
},
|
|
739
936
|
className: `flex w-full items-center gap-3 p-3 text-left transition-colors ${t ? "bg-primary-50 dark:bg-primary-900/30" : "hover:bg-bg-canvas"} ${n ? "" : "cursor-not-allowed opacity-50"}`,
|
|
740
937
|
children: [
|
|
741
|
-
/* @__PURE__ */ d
|
|
938
|
+
/* @__PURE__ */ p(d, {
|
|
742
939
|
size: 16,
|
|
743
940
|
className: t ? "text-primary-500" : "text-text-tertiary"
|
|
744
941
|
}),
|
|
745
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ m("div", {
|
|
746
943
|
className: "flex-1",
|
|
747
944
|
children: [
|
|
748
|
-
/* @__PURE__ */
|
|
945
|
+
/* @__PURE__ */ p("div", {
|
|
749
946
|
className: "text-sm font-medium text-text-primary",
|
|
750
947
|
children: e.name
|
|
751
948
|
}),
|
|
752
|
-
/* @__PURE__ */
|
|
949
|
+
/* @__PURE__ */ p("div", {
|
|
753
950
|
className: "text-xs text-text-secondary",
|
|
754
951
|
children: e.email
|
|
755
952
|
}),
|
|
756
|
-
e.phoneNumber && /* @__PURE__ */
|
|
953
|
+
e.phoneNumber && /* @__PURE__ */ p("div", {
|
|
757
954
|
className: "text-xs text-text-tertiary",
|
|
758
955
|
children: e.phoneNumber
|
|
759
956
|
})
|
|
760
957
|
]
|
|
761
958
|
}),
|
|
762
|
-
!n && /* @__PURE__ */
|
|
959
|
+
!n && /* @__PURE__ */ p("span", {
|
|
763
960
|
className: "text-xs text-status-error-text",
|
|
764
961
|
children: l("notifications.missingChannelTarget", "Missing channel target")
|
|
765
962
|
}),
|
|
766
|
-
t && /* @__PURE__ */
|
|
963
|
+
t && /* @__PURE__ */ p(s, {
|
|
767
964
|
size: 16,
|
|
768
965
|
className: "text-primary-500"
|
|
769
966
|
})
|
|
770
967
|
]
|
|
771
968
|
}, e.id);
|
|
772
|
-
}) : /* @__PURE__ */
|
|
969
|
+
}) : /* @__PURE__ */ p("div", {
|
|
773
970
|
className: "p-4 text-center text-sm text-text-secondary",
|
|
774
|
-
children:
|
|
971
|
+
children: y ? `${l("notifications.error", "Error")}: ${y}` : l("notifications.noUsersFound", "No users found")
|
|
775
972
|
})
|
|
776
973
|
}),
|
|
777
|
-
|
|
974
|
+
D.length > 0 && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("h3", {
|
|
778
975
|
className: "mb-2 text-sm font-medium text-text-secondary",
|
|
779
976
|
children: [
|
|
780
977
|
l("notifications.selectedUsers", "Selected Users"),
|
|
781
978
|
" (",
|
|
782
|
-
|
|
979
|
+
D.length,
|
|
783
980
|
")"
|
|
784
981
|
]
|
|
785
|
-
}), /* @__PURE__ */
|
|
982
|
+
}), /* @__PURE__ */ p("div", {
|
|
786
983
|
className: "flex flex-wrap gap-2",
|
|
787
|
-
children:
|
|
984
|
+
children: D.map((e) => /* @__PURE__ */ m("div", {
|
|
788
985
|
className: "flex items-center gap-2 rounded-full border border-primary-200 bg-primary-50 px-3 py-1.5 text-sm dark:border-primary-800 dark:bg-primary-900/30",
|
|
789
986
|
children: [
|
|
790
|
-
/* @__PURE__ */ d
|
|
987
|
+
/* @__PURE__ */ p(d, {
|
|
791
988
|
size: 12,
|
|
792
989
|
className: "text-primary-500"
|
|
793
990
|
}),
|
|
794
|
-
/* @__PURE__ */
|
|
991
|
+
/* @__PURE__ */ p("span", {
|
|
795
992
|
className: "text-primary-700 dark:text-primary-300",
|
|
796
993
|
children: e.name
|
|
797
994
|
}),
|
|
798
|
-
/* @__PURE__ */
|
|
995
|
+
/* @__PURE__ */ p("button", {
|
|
799
996
|
type: "button",
|
|
800
|
-
onClick: () =>
|
|
997
|
+
onClick: () => O((t) => t.filter((t) => t.id !== e.id)),
|
|
801
998
|
className: "rounded-full p-0.5 hover:bg-primary-100 dark:hover:bg-primary-800",
|
|
802
|
-
children: /* @__PURE__ */
|
|
999
|
+
children: /* @__PURE__ */ p(xe, {
|
|
803
1000
|
size: 12,
|
|
804
1001
|
className: "text-primary-500"
|
|
805
1002
|
})
|
|
@@ -811,87 +1008,87 @@ function Ne() {
|
|
|
811
1008
|
})
|
|
812
1009
|
]
|
|
813
1010
|
}),
|
|
814
|
-
L && /* @__PURE__ */
|
|
1011
|
+
L && /* @__PURE__ */ m("div", {
|
|
815
1012
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
816
1013
|
children: [
|
|
817
|
-
/* @__PURE__ */
|
|
1014
|
+
/* @__PURE__ */ m("div", {
|
|
818
1015
|
className: "flex items-center gap-2 mb-4",
|
|
819
|
-
children: [/* @__PURE__ */
|
|
1016
|
+
children: [/* @__PURE__ */ p(fe, {
|
|
820
1017
|
size: 18,
|
|
821
1018
|
className: "text-primary-500"
|
|
822
|
-
}), /* @__PURE__ */
|
|
1019
|
+
}), /* @__PURE__ */ m("h2", {
|
|
823
1020
|
className: "text-sm font-medium text-text-primary",
|
|
824
1021
|
children: [
|
|
825
1022
|
l("notifications.inAppUsers", "In-App Notification Users"),
|
|
826
1023
|
" ",
|
|
827
|
-
/* @__PURE__ */
|
|
1024
|
+
/* @__PURE__ */ p("span", {
|
|
828
1025
|
className: "text-status-error-text",
|
|
829
1026
|
children: "*"
|
|
830
1027
|
})
|
|
831
1028
|
]
|
|
832
1029
|
})]
|
|
833
1030
|
}),
|
|
834
|
-
/* @__PURE__ */
|
|
1031
|
+
/* @__PURE__ */ m("div", {
|
|
835
1032
|
className: "relative mb-4",
|
|
836
|
-
children: [/* @__PURE__ */
|
|
1033
|
+
children: [/* @__PURE__ */ p("input", {
|
|
837
1034
|
type: "text",
|
|
838
1035
|
value: B,
|
|
839
1036
|
onChange: (e) => {
|
|
840
|
-
V(e.target.value),
|
|
841
|
-
role:
|
|
842
|
-
status:
|
|
1037
|
+
V(e.target.value), v(e.target.value, {
|
|
1038
|
+
role: A || void 0,
|
|
1039
|
+
status: j || void 0
|
|
843
1040
|
});
|
|
844
1041
|
},
|
|
845
1042
|
placeholder: l("notifications.searchUsersPlaceholder", "Search users by email or name..."),
|
|
846
1043
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
|
847
|
-
}),
|
|
1044
|
+
}), Ye && /* @__PURE__ */ p("div", {
|
|
848
1045
|
className: "absolute right-3 top-1/2 transform -translate-y-1/2",
|
|
849
|
-
children: /* @__PURE__ */
|
|
1046
|
+
children: /* @__PURE__ */ p(c, {
|
|
850
1047
|
size: 16,
|
|
851
1048
|
className: "animate-spin text-text-tertiary"
|
|
852
1049
|
})
|
|
853
1050
|
})]
|
|
854
1051
|
}),
|
|
855
|
-
B && /* @__PURE__ */
|
|
1052
|
+
B && /* @__PURE__ */ p("div", {
|
|
856
1053
|
className: "mb-4",
|
|
857
|
-
children:
|
|
1054
|
+
children: Je.length > 0 ? /* @__PURE__ */ p("div", {
|
|
858
1055
|
className: "max-h-48 overflow-y-auto border border-border-subtle rounded-lg",
|
|
859
|
-
children:
|
|
1056
|
+
children: Je.map((e) => {
|
|
860
1057
|
let t = R.some((t) => t.id === e.id);
|
|
861
|
-
return /* @__PURE__ */
|
|
1058
|
+
return /* @__PURE__ */ m("button", {
|
|
862
1059
|
type: "button",
|
|
863
1060
|
onClick: () => {
|
|
864
1061
|
z(t ? (t) => t.filter((t) => t.id !== e.id) : (t) => [...t, e]);
|
|
865
1062
|
},
|
|
866
1063
|
className: `w-full flex items-center gap-3 p-3 text-left hover:bg-bg-canvas transition-colors ${t ? "bg-primary-50 dark:bg-primary-900/30" : ""}`,
|
|
867
1064
|
children: [
|
|
868
|
-
/* @__PURE__ */ d
|
|
1065
|
+
/* @__PURE__ */ p(d, {
|
|
869
1066
|
size: 16,
|
|
870
1067
|
className: t ? "text-primary-500" : "text-text-tertiary"
|
|
871
1068
|
}),
|
|
872
|
-
/* @__PURE__ */
|
|
1069
|
+
/* @__PURE__ */ m("div", {
|
|
873
1070
|
className: "flex-1",
|
|
874
|
-
children: [/* @__PURE__ */
|
|
1071
|
+
children: [/* @__PURE__ */ p("div", {
|
|
875
1072
|
className: "text-sm font-medium text-text-primary",
|
|
876
1073
|
children: e.name
|
|
877
|
-
}), /* @__PURE__ */
|
|
1074
|
+
}), /* @__PURE__ */ p("div", {
|
|
878
1075
|
className: "text-xs text-text-secondary",
|
|
879
1076
|
children: e.email
|
|
880
1077
|
})]
|
|
881
1078
|
}),
|
|
882
|
-
t && /* @__PURE__ */
|
|
1079
|
+
t && /* @__PURE__ */ p(s, {
|
|
883
1080
|
size: 16,
|
|
884
1081
|
className: "text-primary-500"
|
|
885
1082
|
})
|
|
886
1083
|
]
|
|
887
1084
|
}, e.id);
|
|
888
1085
|
})
|
|
889
|
-
}) : /* @__PURE__ */
|
|
1086
|
+
}) : /* @__PURE__ */ p("div", {
|
|
890
1087
|
className: "text-center py-4 text-sm text-text-secondary",
|
|
891
|
-
children:
|
|
1088
|
+
children: y ? `${l("notifications.error", "Error")}: ${y}` : l("notifications.noUsersFound", "No users found")
|
|
892
1089
|
})
|
|
893
1090
|
}),
|
|
894
|
-
R.length > 0 && /* @__PURE__ */
|
|
1091
|
+
R.length > 0 && /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ m("h3", {
|
|
895
1092
|
className: "text-sm font-medium text-text-secondary mb-2",
|
|
896
1093
|
children: [
|
|
897
1094
|
l("notifications.selectedUsers", "Selected Users"),
|
|
@@ -899,24 +1096,24 @@ function Ne() {
|
|
|
899
1096
|
R.length,
|
|
900
1097
|
")"
|
|
901
1098
|
]
|
|
902
|
-
}), /* @__PURE__ */
|
|
1099
|
+
}), /* @__PURE__ */ p("div", {
|
|
903
1100
|
className: "flex flex-wrap gap-2",
|
|
904
|
-
children: R.map((e) => /* @__PURE__ */
|
|
1101
|
+
children: R.map((e) => /* @__PURE__ */ m("div", {
|
|
905
1102
|
className: "flex items-center gap-2 px-3 py-1.5 bg-primary-50 dark:bg-primary-900/30 border border-primary-200 dark:border-primary-800 rounded-full text-sm",
|
|
906
1103
|
children: [
|
|
907
|
-
/* @__PURE__ */ d
|
|
1104
|
+
/* @__PURE__ */ p(d, {
|
|
908
1105
|
size: 12,
|
|
909
1106
|
className: "text-primary-500"
|
|
910
1107
|
}),
|
|
911
|
-
/* @__PURE__ */
|
|
1108
|
+
/* @__PURE__ */ p("span", {
|
|
912
1109
|
className: "text-primary-700 dark:text-primary-300",
|
|
913
1110
|
children: e.name
|
|
914
1111
|
}),
|
|
915
|
-
/* @__PURE__ */
|
|
1112
|
+
/* @__PURE__ */ p("button", {
|
|
916
1113
|
type: "button",
|
|
917
1114
|
onClick: () => z((t) => t.filter((t) => t.id !== e.id)),
|
|
918
1115
|
className: "p-0.5 hover:bg-primary-100 dark:hover:bg-primary-800 rounded-full transition-colors",
|
|
919
|
-
children: /* @__PURE__ */
|
|
1116
|
+
children: /* @__PURE__ */ p(xe, {
|
|
920
1117
|
size: 12,
|
|
921
1118
|
className: "text-primary-500"
|
|
922
1119
|
})
|
|
@@ -926,45 +1123,45 @@ function Ne() {
|
|
|
926
1123
|
})] })
|
|
927
1124
|
]
|
|
928
1125
|
}),
|
|
929
|
-
|
|
1126
|
+
b === "template" && /* @__PURE__ */ m("div", {
|
|
930
1127
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
931
1128
|
children: [
|
|
932
|
-
/* @__PURE__ */
|
|
1129
|
+
/* @__PURE__ */ m("h2", {
|
|
933
1130
|
className: "text-sm font-medium text-text-primary mb-4",
|
|
934
1131
|
children: [
|
|
935
1132
|
l("notifications.selectTemplate", "Select Template"),
|
|
936
1133
|
" ",
|
|
937
|
-
/* @__PURE__ */
|
|
1134
|
+
/* @__PURE__ */ p("span", {
|
|
938
1135
|
className: "text-status-error-text",
|
|
939
1136
|
children: "*"
|
|
940
1137
|
})
|
|
941
1138
|
]
|
|
942
1139
|
}),
|
|
943
|
-
|
|
1140
|
+
Ge ? /* @__PURE__ */ p("div", {
|
|
944
1141
|
className: "flex items-center justify-center py-8",
|
|
945
|
-
children: /* @__PURE__ */
|
|
1142
|
+
children: /* @__PURE__ */ p(c, {
|
|
946
1143
|
size: 24,
|
|
947
1144
|
className: "animate-spin text-text-tertiary"
|
|
948
1145
|
})
|
|
949
|
-
}) :
|
|
1146
|
+
}) : _.length === 0 ? /* @__PURE__ */ p(Te, {
|
|
950
1147
|
illustration: "empty-files",
|
|
951
1148
|
title: l("notifications.noTemplatesAvailable", "No templates available"),
|
|
952
1149
|
description: l("notifications.noTemplatesAvailableDesc", "Create a reusable template once and pick it here every time you send."),
|
|
953
|
-
action: /* @__PURE__ */
|
|
954
|
-
onClick: () =>
|
|
1150
|
+
action: /* @__PURE__ */ p("button", {
|
|
1151
|
+
onClick: () => ve(u.newTemplate),
|
|
955
1152
|
className: "text-sm text-primary-600 hover:text-primary-700",
|
|
956
1153
|
children: l("notifications.createATemplate", "Create a template")
|
|
957
1154
|
})
|
|
958
|
-
}) : /* @__PURE__ */
|
|
1155
|
+
}) : /* @__PURE__ */ m("select", {
|
|
959
1156
|
value: H,
|
|
960
1157
|
onChange: (e) => {
|
|
961
|
-
|
|
1158
|
+
ht(e.target.value), gt({});
|
|
962
1159
|
},
|
|
963
1160
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
964
|
-
children: [/* @__PURE__ */
|
|
1161
|
+
children: [/* @__PURE__ */ p("option", {
|
|
965
1162
|
value: "",
|
|
966
1163
|
children: l("notifications.selectATemplate", "Select a template...")
|
|
967
|
-
}),
|
|
1164
|
+
}), _.filter((e) => e.enabled).map((e) => /* @__PURE__ */ m("option", {
|
|
968
1165
|
value: e.slug,
|
|
969
1166
|
children: [
|
|
970
1167
|
e.name,
|
|
@@ -974,21 +1171,21 @@ function Ne() {
|
|
|
974
1171
|
]
|
|
975
1172
|
}, e.id))]
|
|
976
1173
|
}),
|
|
977
|
-
X &&
|
|
1174
|
+
X && xt.length > 0 && /* @__PURE__ */ m("div", {
|
|
978
1175
|
className: "mt-4 space-y-3",
|
|
979
|
-
children: [/* @__PURE__ */
|
|
1176
|
+
children: [/* @__PURE__ */ p("h3", {
|
|
980
1177
|
className: "text-sm font-medium text-text-secondary",
|
|
981
1178
|
children: l("notifications.templateVariables", "Template Variables")
|
|
982
|
-
}),
|
|
983
|
-
/* @__PURE__ */
|
|
1179
|
+
}), xt.map((e) => /* @__PURE__ */ m("div", { children: [
|
|
1180
|
+
/* @__PURE__ */ m("label", {
|
|
984
1181
|
className: "block text-xs text-text-secondary mb-1",
|
|
985
1182
|
children: [
|
|
986
1183
|
e.key,
|
|
987
|
-
e.required && /* @__PURE__ */
|
|
1184
|
+
e.required && /* @__PURE__ */ p("span", {
|
|
988
1185
|
className: "text-status-error-text ml-0.5",
|
|
989
1186
|
children: "*"
|
|
990
1187
|
}),
|
|
991
|
-
/* @__PURE__ */
|
|
1188
|
+
/* @__PURE__ */ m("span", {
|
|
992
1189
|
className: "text-text-tertiary ml-1",
|
|
993
1190
|
children: [
|
|
994
1191
|
"(",
|
|
@@ -998,14 +1195,14 @@ function Ne() {
|
|
|
998
1195
|
})
|
|
999
1196
|
]
|
|
1000
1197
|
}),
|
|
1001
|
-
e.description && /* @__PURE__ */
|
|
1198
|
+
e.description && /* @__PURE__ */ p("p", {
|
|
1002
1199
|
className: "text-xs text-text-tertiary mb-1",
|
|
1003
1200
|
children: e.description
|
|
1004
1201
|
}),
|
|
1005
|
-
/* @__PURE__ */
|
|
1202
|
+
/* @__PURE__ */ p("input", {
|
|
1006
1203
|
type: "text",
|
|
1007
1204
|
value: U[e.key] || "",
|
|
1008
|
-
onChange: (t) =>
|
|
1205
|
+
onChange: (t) => gt((n) => ({
|
|
1009
1206
|
...n,
|
|
1010
1207
|
[e.key]: t.target.value
|
|
1011
1208
|
})),
|
|
@@ -1016,97 +1213,69 @@ function Ne() {
|
|
|
1016
1213
|
})
|
|
1017
1214
|
]
|
|
1018
1215
|
}),
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
children: /* @__PURE__ */ f("div", {
|
|
1023
|
-
className: "grid grid-cols-2 gap-4",
|
|
1024
|
-
children: [/* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
1025
|
-
className: "block text-sm font-medium text-text-primary mb-2",
|
|
1026
|
-
children: l("notifications.typeLabel", "Type")
|
|
1027
|
-
}), /* @__PURE__ */ d("select", {
|
|
1028
|
-
value: b,
|
|
1029
|
-
onChange: (e) => Xe(e.target.value),
|
|
1030
|
-
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
1031
|
-
children: ke.map((e) => /* @__PURE__ */ d("option", {
|
|
1032
|
-
value: e.value,
|
|
1033
|
-
children: l(`notifications.type.${e.value}`, e.label)
|
|
1034
|
-
}, e.value))
|
|
1035
|
-
})] }), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("label", {
|
|
1036
|
-
className: "block text-sm font-medium text-text-primary mb-2",
|
|
1037
|
-
children: l("notifications.priorityLabel", "Priority")
|
|
1038
|
-
}), /* @__PURE__ */ d("select", {
|
|
1039
|
-
value: x,
|
|
1040
|
-
onChange: (e) => Ze(e.target.value),
|
|
1041
|
-
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
1042
|
-
children: Ae.map((e) => /* @__PURE__ */ d("option", {
|
|
1043
|
-
value: e.value,
|
|
1044
|
-
children: l(`notifications.priority.${e.value}`, e.label)
|
|
1045
|
-
}, e.value))
|
|
1046
|
-
})] })]
|
|
1047
|
-
})
|
|
1048
|
-
}),
|
|
1049
|
-
y === "EMAIL" && /* @__PURE__ */ f("div", {
|
|
1216
|
+
b === "compose" && /* @__PURE__ */ m(f, { children: [
|
|
1217
|
+
!h && It,
|
|
1218
|
+
x === "EMAIL" && /* @__PURE__ */ m("div", {
|
|
1050
1219
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
1051
|
-
children: [/* @__PURE__ */
|
|
1220
|
+
children: [/* @__PURE__ */ m("label", {
|
|
1052
1221
|
className: "block text-sm font-medium text-text-primary mb-2",
|
|
1053
1222
|
children: [
|
|
1054
1223
|
l("notifications.subjectLabel", "Subject"),
|
|
1055
1224
|
" ",
|
|
1056
|
-
/* @__PURE__ */
|
|
1225
|
+
/* @__PURE__ */ p("span", {
|
|
1057
1226
|
className: "text-status-error-text",
|
|
1058
1227
|
children: "*"
|
|
1059
1228
|
})
|
|
1060
1229
|
]
|
|
1061
|
-
}), /* @__PURE__ */
|
|
1230
|
+
}), /* @__PURE__ */ p("input", {
|
|
1062
1231
|
type: "text",
|
|
1063
|
-
value:
|
|
1064
|
-
onChange: (e) =>
|
|
1232
|
+
value: M,
|
|
1233
|
+
onChange: (e) => at(e.target.value),
|
|
1065
1234
|
placeholder: l("notifications.enterSubjectPlaceholder", "Enter email subject..."),
|
|
1066
1235
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500"
|
|
1067
1236
|
})]
|
|
1068
1237
|
}),
|
|
1069
|
-
/* @__PURE__ */
|
|
1238
|
+
/* @__PURE__ */ m("div", {
|
|
1070
1239
|
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
1071
1240
|
children: [
|
|
1072
|
-
/* @__PURE__ */
|
|
1241
|
+
/* @__PURE__ */ m("div", {
|
|
1073
1242
|
className: "flex items-center justify-between mb-2",
|
|
1074
|
-
children: [/* @__PURE__ */
|
|
1243
|
+
children: [/* @__PURE__ */ m("label", {
|
|
1075
1244
|
className: "block text-sm font-medium text-text-primary",
|
|
1076
1245
|
children: [
|
|
1077
1246
|
l("notifications.messageLabel", "Message"),
|
|
1078
1247
|
" ",
|
|
1079
|
-
/* @__PURE__ */
|
|
1248
|
+
/* @__PURE__ */ p("span", {
|
|
1080
1249
|
className: "text-status-error-text",
|
|
1081
1250
|
children: "*"
|
|
1082
1251
|
})
|
|
1083
1252
|
]
|
|
1084
|
-
}),
|
|
1253
|
+
}), x === "EMAIL" && /* @__PURE__ */ m("label", {
|
|
1085
1254
|
className: "flex items-center gap-2 text-sm text-text-secondary cursor-pointer",
|
|
1086
|
-
children: [/* @__PURE__ */
|
|
1255
|
+
children: [/* @__PURE__ */ p("input", {
|
|
1087
1256
|
type: "checkbox",
|
|
1088
|
-
checked:
|
|
1089
|
-
onChange: (e) =>
|
|
1257
|
+
checked: lt,
|
|
1258
|
+
onChange: (e) => ut(e.target.checked),
|
|
1090
1259
|
className: "w-4 h-4 rounded border-border-default text-primary-600 focus:ring-primary-500"
|
|
1091
1260
|
}), l("notifications.includeHtmlVersion", "Include HTML version")]
|
|
1092
1261
|
})]
|
|
1093
1262
|
}),
|
|
1094
|
-
/* @__PURE__ */
|
|
1263
|
+
/* @__PURE__ */ p("textarea", {
|
|
1095
1264
|
rows: 6,
|
|
1096
|
-
value:
|
|
1097
|
-
onChange: (e) =>
|
|
1265
|
+
value: N,
|
|
1266
|
+
onChange: (e) => ot(e.target.value),
|
|
1098
1267
|
placeholder: l("notifications.enterMessagePlaceholder", "Enter your message..."),
|
|
1099
1268
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 resize-none"
|
|
1100
1269
|
}),
|
|
1101
|
-
|
|
1270
|
+
x === "EMAIL" && lt && /* @__PURE__ */ m("div", {
|
|
1102
1271
|
className: "mt-4",
|
|
1103
|
-
children: [/* @__PURE__ */
|
|
1272
|
+
children: [/* @__PURE__ */ p("label", {
|
|
1104
1273
|
className: "block text-sm font-medium text-text-secondary mb-2",
|
|
1105
1274
|
children: l("notifications.htmlContent", "HTML Content")
|
|
1106
|
-
}), /* @__PURE__ */
|
|
1275
|
+
}), /* @__PURE__ */ p("textarea", {
|
|
1107
1276
|
rows: 8,
|
|
1108
|
-
value:
|
|
1109
|
-
onChange: (e) =>
|
|
1277
|
+
value: st,
|
|
1278
|
+
onChange: (e) => ct(e.target.value),
|
|
1110
1279
|
placeholder: l("notifications.htmlPlaceholder", "<html>...</html>"),
|
|
1111
1280
|
className: "w-full px-4 py-3 text-sm bg-bg-canvas border border-border-subtle rounded-lg focus:outline-none focus:ring-2 focus:ring-primary-500 resize-none font-mono"
|
|
1112
1281
|
})]
|
|
@@ -1114,292 +1283,142 @@ function Ne() {
|
|
|
1114
1283
|
]
|
|
1115
1284
|
})
|
|
1116
1285
|
] }),
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
children: [ct.map((e, t) => /* @__PURE__ */ f("div", {
|
|
1131
|
-
className: "grid gap-3 rounded-lg border border-border-subtle bg-bg-canvas p-3 md:grid-cols-[1fr,1fr,160px,auto]",
|
|
1132
|
-
children: [
|
|
1133
|
-
/* @__PURE__ */ d("input", {
|
|
1134
|
-
type: "text",
|
|
1135
|
-
value: e.label,
|
|
1136
|
-
onChange: (e) => I((n) => n.map((n, r) => r === t ? {
|
|
1137
|
-
...n,
|
|
1138
|
-
label: e.target.value
|
|
1139
|
-
} : n)),
|
|
1140
|
-
placeholder: l("notifications.actionLabel", "Action label"),
|
|
1141
|
-
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
|
|
1142
|
-
}),
|
|
1143
|
-
/* @__PURE__ */ d("input", {
|
|
1144
|
-
type: "url",
|
|
1145
|
-
value: e.url,
|
|
1146
|
-
onChange: (e) => I((n) => n.map((n, r) => r === t ? {
|
|
1147
|
-
...n,
|
|
1148
|
-
url: e.target.value
|
|
1149
|
-
} : n)),
|
|
1150
|
-
placeholder: l("notifications.actionUrl", "https://..."),
|
|
1151
|
-
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
|
|
1152
|
-
}),
|
|
1153
|
-
/* @__PURE__ */ f("select", {
|
|
1154
|
-
value: e.style,
|
|
1155
|
-
onChange: (e) => I((n) => n.map((n, r) => r === t ? {
|
|
1156
|
-
...n,
|
|
1157
|
-
style: e.target.value
|
|
1158
|
-
} : n)),
|
|
1159
|
-
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
1160
|
-
children: [
|
|
1161
|
-
/* @__PURE__ */ d("option", {
|
|
1162
|
-
value: "primary",
|
|
1163
|
-
children: l("notifications.actionStyle.primary", "Primary")
|
|
1164
|
-
}),
|
|
1165
|
-
/* @__PURE__ */ d("option", {
|
|
1166
|
-
value: "secondary",
|
|
1167
|
-
children: l("notifications.actionStyle.secondary", "Secondary")
|
|
1168
|
-
}),
|
|
1169
|
-
/* @__PURE__ */ d("option", {
|
|
1170
|
-
value: "danger",
|
|
1171
|
-
children: l("notifications.actionStyle.danger", "Danger")
|
|
1172
|
-
})
|
|
1173
|
-
]
|
|
1174
|
-
}),
|
|
1175
|
-
/* @__PURE__ */ d("button", {
|
|
1176
|
-
type: "button",
|
|
1177
|
-
onClick: () => I((e) => e.length === 1 ? [{
|
|
1178
|
-
id: "primary-action",
|
|
1179
|
-
label: "",
|
|
1180
|
-
url: "",
|
|
1181
|
-
style: "primary"
|
|
1182
|
-
}] : e.filter((e, n) => n !== t)),
|
|
1183
|
-
className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken",
|
|
1184
|
-
children: l("notifications.remove", "Remove")
|
|
1185
|
-
})
|
|
1186
|
-
]
|
|
1187
|
-
}, e.id)), /* @__PURE__ */ d("button", {
|
|
1188
|
-
type: "button",
|
|
1189
|
-
onClick: () => I((e) => [...e, {
|
|
1190
|
-
id: `action-${e.length + 1}`,
|
|
1191
|
-
label: "",
|
|
1192
|
-
url: "",
|
|
1193
|
-
style: "secondary"
|
|
1194
|
-
}]),
|
|
1195
|
-
className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken",
|
|
1196
|
-
children: l("notifications.addAction", "Add action")
|
|
1197
|
-
})]
|
|
1198
|
-
})]
|
|
1199
|
-
}),
|
|
1200
|
-
/* @__PURE__ */ f("div", {
|
|
1201
|
-
className: "bg-bg-surface rounded-lg border border-border-seam p-4",
|
|
1202
|
-
children: [/* @__PURE__ */ f("div", {
|
|
1203
|
-
className: "mb-4 flex items-center gap-2",
|
|
1204
|
-
children: [/* @__PURE__ */ d(me, {
|
|
1205
|
-
size: 18,
|
|
1206
|
-
className: "text-text-secondary"
|
|
1207
|
-
}), /* @__PURE__ */ d("h2", {
|
|
1208
|
-
className: "text-sm font-medium text-text-primary",
|
|
1209
|
-
children: l("notifications.media", "Media")
|
|
1210
|
-
})]
|
|
1211
|
-
}), /* @__PURE__ */ f("div", {
|
|
1212
|
-
className: "space-y-3",
|
|
1213
|
-
children: [st.map((e, t) => /* @__PURE__ */ f("div", {
|
|
1214
|
-
className: "grid gap-3 rounded-lg border border-border-subtle bg-bg-canvas p-3 md:grid-cols-[1fr,220px,140px,auto]",
|
|
1215
|
-
children: [
|
|
1216
|
-
/* @__PURE__ */ d("input", {
|
|
1217
|
-
type: "url",
|
|
1218
|
-
value: e.url,
|
|
1219
|
-
onChange: (e) => F((n) => n.map((n, r) => r === t ? {
|
|
1220
|
-
...n,
|
|
1221
|
-
url: e.target.value
|
|
1222
|
-
} : n)),
|
|
1223
|
-
placeholder: l("notifications.mediaUrl", "Media URL"),
|
|
1224
|
-
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
|
|
1225
|
-
}),
|
|
1226
|
-
/* @__PURE__ */ d("input", {
|
|
1227
|
-
type: "text",
|
|
1228
|
-
value: e.label,
|
|
1229
|
-
onChange: (e) => F((n) => n.map((n, r) => r === t ? {
|
|
1230
|
-
...n,
|
|
1231
|
-
label: e.target.value
|
|
1232
|
-
} : n)),
|
|
1233
|
-
placeholder: l("notifications.mediaLabel", "Caption / label"),
|
|
1234
|
-
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary"
|
|
1235
|
-
}),
|
|
1236
|
-
/* @__PURE__ */ f("select", {
|
|
1237
|
-
value: e.kind,
|
|
1238
|
-
onChange: (e) => F((n) => n.map((n, r) => r === t ? {
|
|
1239
|
-
...n,
|
|
1240
|
-
kind: e.target.value
|
|
1241
|
-
} : n)),
|
|
1242
|
-
className: "rounded-md border border-border-subtle bg-surface px-3 py-2 text-sm text-text-primary scheme-normal dark:scheme-dark [&_option]:bg-bg-surface [&_option]:text-text-primary",
|
|
1243
|
-
children: [
|
|
1244
|
-
/* @__PURE__ */ d("option", {
|
|
1245
|
-
value: "image",
|
|
1246
|
-
children: l("notifications.mediaKind.image", "Image")
|
|
1247
|
-
}),
|
|
1248
|
-
/* @__PURE__ */ d("option", {
|
|
1249
|
-
value: "video",
|
|
1250
|
-
children: l("notifications.mediaKind.video", "Video")
|
|
1251
|
-
}),
|
|
1252
|
-
/* @__PURE__ */ d("option", {
|
|
1253
|
-
value: "file",
|
|
1254
|
-
children: l("notifications.mediaKind.file", "File")
|
|
1255
|
-
})
|
|
1256
|
-
]
|
|
1257
|
-
}),
|
|
1258
|
-
/* @__PURE__ */ d("button", {
|
|
1259
|
-
type: "button",
|
|
1260
|
-
onClick: () => F((e) => e.length === 1 ? [{
|
|
1261
|
-
url: "",
|
|
1262
|
-
label: "",
|
|
1263
|
-
kind: "image"
|
|
1264
|
-
}] : e.filter((e, n) => n !== t)),
|
|
1265
|
-
className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken",
|
|
1266
|
-
children: l("notifications.remove", "Remove")
|
|
1267
|
-
})
|
|
1268
|
-
]
|
|
1269
|
-
}, `${e.kind}-${t}`)), /* @__PURE__ */ d("button", {
|
|
1270
|
-
type: "button",
|
|
1271
|
-
onClick: () => F((e) => [...e, {
|
|
1272
|
-
url: "",
|
|
1273
|
-
label: "",
|
|
1274
|
-
kind: "image"
|
|
1275
|
-
}]),
|
|
1276
|
-
className: "rounded-md border border-border-subtle px-3 py-2 text-sm text-text-secondary hover:bg-bg-sunken",
|
|
1277
|
-
children: l("notifications.addMedia", "Add media")
|
|
1278
|
-
})]
|
|
1279
|
-
})]
|
|
1286
|
+
!h && Lt,
|
|
1287
|
+
!h && Rt,
|
|
1288
|
+
h && /* @__PURE__ */ p(De, {
|
|
1289
|
+
storageKey: "notifications.send.more",
|
|
1290
|
+
children: /* @__PURE__ */ m("div", {
|
|
1291
|
+
className: "space-y-6",
|
|
1292
|
+
children: [
|
|
1293
|
+
Ft,
|
|
1294
|
+
b === "compose" && It,
|
|
1295
|
+
Lt,
|
|
1296
|
+
Rt
|
|
1297
|
+
]
|
|
1298
|
+
})
|
|
1280
1299
|
})
|
|
1281
1300
|
]
|
|
1282
|
-
}), K && /* @__PURE__ */
|
|
1301
|
+
}), K && /* @__PURE__ */ p("div", {
|
|
1283
1302
|
className: "w-96 flex-shrink-0",
|
|
1284
|
-
children: /* @__PURE__ */
|
|
1303
|
+
children: /* @__PURE__ */ m(we, {
|
|
1285
1304
|
treatment: "glass",
|
|
1286
1305
|
glow: !0,
|
|
1287
1306
|
className: "sticky top-24 border-border-seam p-0 overflow-hidden",
|
|
1288
|
-
children: [/* @__PURE__ */
|
|
1307
|
+
children: [/* @__PURE__ */ p("div", {
|
|
1289
1308
|
className: "px-4 py-3 bg-accent-wash border-b border-border-seam",
|
|
1290
|
-
children: /* @__PURE__ */
|
|
1309
|
+
children: /* @__PURE__ */ p("h3", {
|
|
1291
1310
|
className: "text-sm font-medium text-text-primary",
|
|
1292
1311
|
children: l("notifications.preview", "Preview")
|
|
1293
1312
|
})
|
|
1294
|
-
}), /* @__PURE__ */
|
|
1313
|
+
}), /* @__PURE__ */ m("div", {
|
|
1295
1314
|
className: "p-4",
|
|
1296
1315
|
children: [
|
|
1297
|
-
/* @__PURE__ */
|
|
1316
|
+
/* @__PURE__ */ m("div", {
|
|
1298
1317
|
className: "flex items-center gap-2 mb-4",
|
|
1299
1318
|
children: [
|
|
1300
|
-
/* @__PURE__ */
|
|
1319
|
+
/* @__PURE__ */ p("span", {
|
|
1301
1320
|
className: "px-2 py-1 text-xs font-medium bg-primary-100 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300 rounded",
|
|
1302
|
-
children: l(`notifications.channel.${
|
|
1321
|
+
children: l(`notifications.channel.${x}`, x)
|
|
1303
1322
|
}),
|
|
1304
|
-
/* @__PURE__ */
|
|
1323
|
+
/* @__PURE__ */ p("span", {
|
|
1305
1324
|
className: "px-2 py-1 text-xs font-medium bg-bg-sunken text-text-secondary rounded",
|
|
1306
|
-
children: l(`notifications.type.${
|
|
1325
|
+
children: l(`notifications.type.${S}`, S)
|
|
1307
1326
|
}),
|
|
1308
|
-
/* @__PURE__ */
|
|
1309
|
-
className: `px-2 py-1 text-xs font-medium rounded ${
|
|
1310
|
-
children: l(`notifications.priority.${
|
|
1327
|
+
/* @__PURE__ */ p("span", {
|
|
1328
|
+
className: `px-2 py-1 text-xs font-medium rounded ${je.find((e) => e.value === C)?.color || ""}`,
|
|
1329
|
+
children: l(`notifications.priority.${C}`, C)
|
|
1311
1330
|
})
|
|
1312
1331
|
]
|
|
1313
1332
|
}),
|
|
1314
|
-
/* @__PURE__ */
|
|
1333
|
+
/* @__PURE__ */ m("div", {
|
|
1315
1334
|
className: "mb-4",
|
|
1316
|
-
children: [/* @__PURE__ */
|
|
1335
|
+
children: [/* @__PURE__ */ p("p", {
|
|
1317
1336
|
className: "text-xs text-text-secondary mb-1",
|
|
1318
1337
|
children: l("notifications.recipients", "Recipients")
|
|
1319
|
-
}),
|
|
1338
|
+
}), w.length === 0 ? T === "directory" ? /* @__PURE__ */ p("p", {
|
|
1320
1339
|
className: "text-sm text-text-primary",
|
|
1321
|
-
children:
|
|
1322
|
-
}) : /* @__PURE__ */
|
|
1340
|
+
children: k ? l("notifications.allMatchingUsers", "All matching directory users") : `${D.length} ${l("notifications.recipientCount", "recipient")}${D.length === 1 ? "" : "s"}`
|
|
1341
|
+
}) : /* @__PURE__ */ p("p", {
|
|
1323
1342
|
className: "text-sm text-text-tertiary italic",
|
|
1324
1343
|
children: l("notifications.noRecipientsSelected", "No recipients selected")
|
|
1325
|
-
}) : /* @__PURE__ */
|
|
1344
|
+
}) : /* @__PURE__ */ m("p", {
|
|
1326
1345
|
className: "text-sm text-text-primary",
|
|
1327
1346
|
children: [
|
|
1328
|
-
|
|
1347
|
+
w.length,
|
|
1329
1348
|
" ",
|
|
1330
1349
|
l("notifications.recipientCount", "recipient"),
|
|
1331
|
-
|
|
1350
|
+
w.length === 1 ? "" : "s"
|
|
1332
1351
|
]
|
|
1333
1352
|
})]
|
|
1334
1353
|
}),
|
|
1335
|
-
|
|
1354
|
+
x === "EMAIL" && wt && /* @__PURE__ */ m("div", {
|
|
1336
1355
|
className: "mb-4",
|
|
1337
|
-
children: [/* @__PURE__ */
|
|
1356
|
+
children: [/* @__PURE__ */ p("p", {
|
|
1338
1357
|
className: "text-xs text-text-secondary mb-1",
|
|
1339
1358
|
children: l("notifications.subjectLabel", "Subject")
|
|
1340
|
-
}), /* @__PURE__ */
|
|
1359
|
+
}), /* @__PURE__ */ p("p", {
|
|
1341
1360
|
className: "text-sm font-medium text-text-primary",
|
|
1342
|
-
children:
|
|
1361
|
+
children: wt
|
|
1343
1362
|
})]
|
|
1344
1363
|
}),
|
|
1345
|
-
/* @__PURE__ */
|
|
1364
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
1346
1365
|
className: "text-xs text-text-secondary mb-1",
|
|
1347
1366
|
children: l("notifications.messageLabel", "Message")
|
|
1348
|
-
}),
|
|
1367
|
+
}), Ct ? /* @__PURE__ */ p("div", {
|
|
1349
1368
|
className: "p-3 bg-bg-canvas rounded-lg",
|
|
1350
|
-
children: /* @__PURE__ */
|
|
1369
|
+
children: /* @__PURE__ */ p("p", {
|
|
1351
1370
|
className: "text-sm text-text-secondary whitespace-pre-wrap",
|
|
1352
|
-
children:
|
|
1371
|
+
children: Ct
|
|
1353
1372
|
})
|
|
1354
|
-
}) : /* @__PURE__ */
|
|
1373
|
+
}) : /* @__PURE__ */ p("p", {
|
|
1355
1374
|
className: "text-sm text-text-tertiary italic",
|
|
1356
1375
|
children: l("notifications.noMessageContent", "No message content")
|
|
1357
1376
|
})] }),
|
|
1358
|
-
P && /* @__PURE__ */
|
|
1377
|
+
P && /* @__PURE__ */ m("div", {
|
|
1359
1378
|
className: "mt-4",
|
|
1360
|
-
children: [/* @__PURE__ */
|
|
1379
|
+
children: [/* @__PURE__ */ p("p", {
|
|
1361
1380
|
className: "text-xs text-text-secondary mb-1",
|
|
1362
1381
|
children: l("notifications.topic", "Topic")
|
|
1363
|
-
}), /* @__PURE__ */
|
|
1382
|
+
}), /* @__PURE__ */ p("p", {
|
|
1364
1383
|
className: "text-sm text-text-primary",
|
|
1365
|
-
children:
|
|
1384
|
+
children: Xe.find((e) => e.id === P)?.name || P
|
|
1366
1385
|
})]
|
|
1367
1386
|
}),
|
|
1368
|
-
Q.length > 0 && /* @__PURE__ */
|
|
1387
|
+
Q.length > 0 && /* @__PURE__ */ m("div", {
|
|
1369
1388
|
className: "mt-4",
|
|
1370
|
-
children: [/* @__PURE__ */
|
|
1389
|
+
children: [/* @__PURE__ */ p("p", {
|
|
1371
1390
|
className: "text-xs text-text-secondary mb-1",
|
|
1372
1391
|
children: l("notifications.actions", "Actions")
|
|
1373
|
-
}), /* @__PURE__ */
|
|
1392
|
+
}), /* @__PURE__ */ p("div", {
|
|
1374
1393
|
className: "flex flex-wrap gap-2",
|
|
1375
|
-
children: Q.map((e) => /* @__PURE__ */
|
|
1394
|
+
children: Q.map((e) => /* @__PURE__ */ p("span", {
|
|
1376
1395
|
className: "rounded-full bg-bg-sunken px-2 py-1 text-xs text-secondary",
|
|
1377
1396
|
children: e.label
|
|
1378
1397
|
}, e.id))
|
|
1379
1398
|
})]
|
|
1380
1399
|
}),
|
|
1381
|
-
$.length > 0 && /* @__PURE__ */
|
|
1400
|
+
$.length > 0 && /* @__PURE__ */ m("div", {
|
|
1382
1401
|
className: "mt-4 space-y-2",
|
|
1383
|
-
children: [/* @__PURE__ */
|
|
1402
|
+
children: [/* @__PURE__ */ p("p", {
|
|
1384
1403
|
className: "text-xs text-text-secondary",
|
|
1385
1404
|
children: l("notifications.media", "Media")
|
|
1386
|
-
}), $.map((e) => /* @__PURE__ */
|
|
1405
|
+
}), $.map((e) => /* @__PURE__ */ p("div", {
|
|
1387
1406
|
className: "rounded-lg border border-border-subtle bg-bg-canvas p-2 text-xs text-text-secondary",
|
|
1388
1407
|
children: e.label || e.url
|
|
1389
1408
|
}, e.url))]
|
|
1390
1409
|
}),
|
|
1391
|
-
|
|
1410
|
+
b === "template" && X && /* @__PURE__ */ m("div", {
|
|
1392
1411
|
className: "mt-4 pt-4 border-t border-border-subtle",
|
|
1393
1412
|
children: [
|
|
1394
|
-
/* @__PURE__ */
|
|
1413
|
+
/* @__PURE__ */ p("p", {
|
|
1395
1414
|
className: "text-xs text-text-secondary mb-1",
|
|
1396
1415
|
children: l("notifications.usingTemplate", "Using Template")
|
|
1397
1416
|
}),
|
|
1398
|
-
/* @__PURE__ */
|
|
1417
|
+
/* @__PURE__ */ p("p", {
|
|
1399
1418
|
className: "text-sm font-medium text-text-primary",
|
|
1400
1419
|
children: X.name
|
|
1401
1420
|
}),
|
|
1402
|
-
/* @__PURE__ */
|
|
1421
|
+
/* @__PURE__ */ p("p", {
|
|
1403
1422
|
className: "text-xs text-text-secondary font-mono",
|
|
1404
1423
|
children: X.slug
|
|
1405
1424
|
})
|
|
@@ -1413,7 +1432,6 @@ function Ne() {
|
|
|
1413
1432
|
]
|
|
1414
1433
|
});
|
|
1415
1434
|
}
|
|
1416
|
-
|
|
1417
|
-
export { Ne as CreateNotificationPage };
|
|
1435
|
+
export { h as CreateNotificationPage };
|
|
1418
1436
|
|
|
1419
1437
|
//# sourceMappingURL=CreateNotificationPage.js.map
|