@burdenoff/microfe-botmanor 2026.1120.5 → 2026.1120.7
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/botlit/components/AssistantChannelPanel.js +3 -3
- package/dist/botlit/components/AssistantChannelPanel.js.map +1 -1
- package/dist/botlit/components/ChannelRoutesPanel.d.ts +9 -0
- package/dist/botlit/components/ChannelRoutesPanel.js +275 -0
- package/dist/botlit/components/ChannelRoutesPanel.js.map +1 -0
- package/dist/botlit/components/CreateChannelRouteDialog.d.ts +13 -0
- package/dist/botlit/components/CreateChannelRouteDialog.js +188 -0
- package/dist/botlit/components/CreateChannelRouteDialog.js.map +1 -0
- package/dist/botlit/hooks/index.d.ts +3 -3
- package/dist/botlit/hooks/index.js +19 -19
- package/dist/botlit/hooks/useAssistantChat.d.ts +32 -0
- package/dist/botlit/hooks/useAssistantChat.js +98 -0
- package/dist/botlit/hooks/useAssistantChat.js.map +1 -0
- package/dist/botlit/hooks/useBots.d.ts +5 -0
- package/dist/botlit/hooks/useBots.js +63 -50
- package/dist/botlit/hooks/useBots.js.map +1 -1
- package/dist/botlit/hooks/useChannels.d.ts +49 -23
- package/dist/botlit/hooks/useChannels.js +141 -135
- package/dist/botlit/hooks/useChannels.js.map +1 -1
- package/dist/botlit/pages/BotChannelsTab.js +12 -3
- package/dist/botlit/pages/BotChannelsTab.js.map +1 -1
- package/dist/botlit/pages/ChannelDetailPage.js +642 -776
- package/dist/botlit/pages/ChannelDetailPage.js.map +1 -1
- package/dist/botlit/pages/ChannelRoutesPage.js +22 -208
- package/dist/botlit/pages/ChannelRoutesPage.js.map +1 -1
- package/dist/botlit/pages/ChannelsPage.js +314 -251
- package/dist/botlit/pages/ChannelsPage.js.map +1 -1
- package/dist/botlit/pages/ChatPage.js +207 -83
- package/dist/botlit/pages/ChatPage.js.map +1 -1
- package/dist/botlit/utils/assistantAvailability.d.ts +34 -0
- package/dist/botlit/utils/assistantAvailability.js +24 -0
- package/dist/botlit/utils/assistantAvailability.js.map +1 -0
- package/dist/botlit/utils/channelConnectors.d.ts +13 -0
- package/dist/botlit/utils/channelConnectors.js +21 -1
- package/dist/botlit/utils/channelConnectors.js.map +1 -1
- package/dist/botlit/utils/errors.d.ts +8 -0
- package/dist/botlit/utils/errors.js +21 -1
- package/dist/botlit/utils/errors.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +200 -12
- package/dist/generated/wspace-operations.js +153 -110
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +40 -0
- package/dist/generated/wspace-types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
import { useBotlit as e } from "../providers/BotlitProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { BotmanorPermissionGate as i } from "../permissions/useBotmanorPermissions.js";
|
|
2
|
+
import { isNative as t, nativeImpact as n, nativeNotify as r } from "../../utils/nativeBridge.js";
|
|
3
|
+
import { useTr as i } from "../../shared/hooks/useTr.js";
|
|
4
|
+
import { useAllBots as ee } from "../hooks/useBots.js";
|
|
6
5
|
import { PageLayout as a } from "../components/PageLayout.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
6
|
+
import { BOTMANOR_PERMISSIONS as o } from "../permissions/botmanorPermissions.js";
|
|
7
|
+
import { BotmanorPermissionGate as s } from "../permissions/useBotmanorPermissions.js";
|
|
8
|
+
import { Card as c, CardContent as l, CardDescription as u, CardHeader as d, CardTitle as f } from "../components/Card.js";
|
|
9
|
+
import { Button as p } from "../components/Button.js";
|
|
10
|
+
import { FormField as m, Input as te, Textarea as ne } from "../components/Input.js";
|
|
11
|
+
import { Badge as re, StatusBadge as ie } from "../components/Badge.js";
|
|
12
|
+
import { EmptyState as ae } from "../components/EmptyState.js";
|
|
13
|
+
import { ErrorState as oe } from "../components/ErrorState.js";
|
|
14
|
+
import { CreateChannelRouteDialog as se } from "../components/CreateChannelRouteDialog.js";
|
|
12
15
|
import "../hooks/index.js";
|
|
13
|
-
import { ChannelCredentialFields as
|
|
14
|
-
import { ChannelType as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { formatRelativeTime as
|
|
18
|
-
import { useGlobalChannels as we, useInitiateSlackConnect as Te, useLinkIntegrationConnection as Ee, useMyUserPlatformConnection as De, useRevokeSlackConnection as Oe, useToggleSlackNotifications as ke } from "../hooks/useUserPlatformConnection.js";
|
|
16
|
+
import { ChannelCredentialFields as ce, InboundWebhookCard as le } from "../components/ChannelSetupPanels.js";
|
|
17
|
+
import { ChannelType as ue } from "../../generated/global-types.js";
|
|
18
|
+
import { routeMetadataString as de, useAllChannelRoutes as fe, useChannelConnector as pe, useCreateChannelConnector as me, useDeleteChannelConnector as he, useFindChannelConnector as ge, useUpdateChannelConnector as _e, useUpdateChannelRoute as ve } from "../hooks/useChannels.js";
|
|
19
|
+
import { PLATFORM_CREDENTIALS as ye, connectorPlatform as be, useActiveOrganizationId as xe, useInboundChannel as Se, useProvisionChannel as Ce, validateCredentials as we } from "../hooks/useChannelSetup.js";
|
|
20
|
+
import { formatRelativeTime as h } from "../utils/formatters.js";
|
|
19
21
|
import { toUnion as g } from "../utils/unions.js";
|
|
22
|
+
import { useGlobalChannels as Te, useInitiateSlackConnect as Ee, useLinkIntegrationConnection as De, useMyUserPlatformConnection as Oe, useRevokeSlackConnection as ke, useToggleSlackNotifications as Ae } from "../hooks/useUserPlatformConnection.js";
|
|
23
|
+
import { confirmAction as je } from "../utils/confirmAction.js";
|
|
24
|
+
import { graphqlErrorMessage as _, isNotFoundError as Me } from "../utils/errors.js";
|
|
25
|
+
import { PROVISIONED_CHANNEL_KEY as Ne, channelTypeLabel as Pe, provisionedChannelOf as Fe } from "../utils/channelConnectors.js";
|
|
20
26
|
import "../permissions/index.js";
|
|
21
|
-
import { useEffect as
|
|
22
|
-
import { GlassCard as
|
|
23
|
-
import { Fragment as
|
|
24
|
-
import { useParams as
|
|
25
|
-
import { ArrowLeft as
|
|
26
|
-
import { toast as
|
|
27
|
+
import { useEffect as Ie, useMemo as Le, useRef as Re, useState as v } from "react";
|
|
28
|
+
import { GlassCard as ze, NextSteps as Be, PagePurpose as Ve } from "@burdenoff/fe-libs/ui";
|
|
29
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
30
|
+
import { useParams as He, useSearchParams as Ue } from "react-router";
|
|
31
|
+
import { ArrowLeft as We, Bell as Ge, BellOff as Ke, CheckCircle2 as qe, Edit as Je, Globe as S, Hash as C, Info as Ye, Loader2 as Xe, MessageSquare as Ze, Plus as Qe, Power as $e, PowerOff as et, Radio as tt, Save as nt, Settings as rt, Shield as it, Slack as w, Trash2 as at, Unlink as ot, X as st } from "lucide-react";
|
|
32
|
+
import { toast as T } from "sonner";
|
|
27
33
|
// src/botlit/pages/ChannelDetailPage.tsx
|
|
28
|
-
var
|
|
34
|
+
var E = [
|
|
29
35
|
"WEB_WIDGET",
|
|
30
36
|
"SLACK",
|
|
31
37
|
"TEAMS",
|
|
@@ -33,1067 +39,927 @@ var D = [
|
|
|
33
39
|
"WHATSAPP",
|
|
34
40
|
"WEBHOOK",
|
|
35
41
|
"CUSTOM"
|
|
36
|
-
],
|
|
42
|
+
], ct = [
|
|
37
43
|
"PRIVATE",
|
|
38
44
|
"WORKSPACE",
|
|
39
45
|
"PUBLIC"
|
|
40
|
-
]
|
|
41
|
-
function nt(e) {
|
|
42
|
-
return e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
43
|
-
}
|
|
44
|
-
var rt = ({ type: e }) => {
|
|
46
|
+
], lt = 255, ut = 2e3, dt = "channel-connector-create-form", ft = "channel-connector-edit-form", D = "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm", pt = ({ type: e }) => {
|
|
45
47
|
switch (e) {
|
|
46
|
-
case "SLACK": return /* @__PURE__ */
|
|
47
|
-
case "WEB_WIDGET": return /* @__PURE__ */
|
|
48
|
-
case "TEAMS": return /* @__PURE__ */
|
|
49
|
-
default: return /* @__PURE__ */
|
|
48
|
+
case "SLACK": return /* @__PURE__ */ b(C, { size: 18 });
|
|
49
|
+
case "WEB_WIDGET": return /* @__PURE__ */ b(S, { size: 18 });
|
|
50
|
+
case "TEAMS": return /* @__PURE__ */ b(Ze, { size: 18 });
|
|
51
|
+
default: return /* @__PURE__ */ b(tt, { size: 18 });
|
|
50
52
|
}
|
|
51
|
-
}, O = ({ isNew:
|
|
52
|
-
let { connectorId:
|
|
53
|
-
channelType:
|
|
54
|
-
organizationId:
|
|
55
|
-
}), [
|
|
56
|
-
|
|
57
|
-
if (
|
|
58
|
-
let e =
|
|
53
|
+
}, O = ({ isNew: S }) => {
|
|
54
|
+
let C = i(), { connectorId: O } = He(), { navigateTo: k, workspaceId: mt } = e(), [A, ht] = Ue(), { data: j, loading: gt, error: M, refetch: _t } = pe(S ? void 0 : O), { data: N, loading: vt, error: P, refetch: F } = fe(S ? void 0 : O), I = !vt && !P, { data: yt } = ee(), [bt, xt] = me(), [St, Ct] = _e(), [wt, Tt] = he(), [Et] = ve(), L = xe(), Dt = ge(), { provision: Ot, discard: kt, loading: At } = Ce(), jt = Le(() => ({
|
|
55
|
+
channelType: ue.Communication,
|
|
56
|
+
organizationId: L ?? void 0
|
|
57
|
+
}), [L]), { data: Mt } = Te(jt), Nt = j && be(j.type) ? j.credentialsRefId : void 0, { data: Pt, loading: Ft, error: It, refetch: Lt } = Se(Nt), Rt = j?.type === "SLACK" && j?.credentialsRefId ? j.credentialsRefId : void 0, { data: R, loading: zt, refetch: z } = Oe(Rt), { initiate: Bt } = Ee(), { link: Vt, loading: Ht } = De(), { toggle: Ut, loading: Wt } = Ae(), { revoke: Gt, loading: Kt } = ke(), [qt, Jt] = v(null), Yt = Re(!1);
|
|
58
|
+
Ie(() => {
|
|
59
|
+
if (Yt.current) return;
|
|
60
|
+
let e = A.get("integrationConnectionId"), t = A.get("channelId");
|
|
59
61
|
if (!e || !t) return;
|
|
60
|
-
|
|
61
|
-
let n = new URLSearchParams(
|
|
62
|
-
n.delete("integrationConnectionId"), n.delete("channelId"),
|
|
63
|
-
e ?
|
|
62
|
+
Yt.current = !0;
|
|
63
|
+
let n = new URLSearchParams(A);
|
|
64
|
+
n.delete("integrationConnectionId"), n.delete("channelId"), ht(n, { replace: !0 }), Jt(null), Vt(e, t).then((e) => {
|
|
65
|
+
e ? z() : Jt(C("botlit.channelDetail.slack.linkFailed", "Failed to link Slack connection. Please try again."));
|
|
64
66
|
});
|
|
65
67
|
}, [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
A,
|
|
69
|
+
ht,
|
|
70
|
+
Vt,
|
|
71
|
+
z,
|
|
72
|
+
C
|
|
70
73
|
]);
|
|
71
|
-
let
|
|
72
|
-
if (!
|
|
74
|
+
let Xt = () => {
|
|
75
|
+
if (!Rt) return;
|
|
73
76
|
let e = `${window.location.origin}${window.location.pathname}`;
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
}, [
|
|
80
|
-
locationId: "*",
|
|
81
|
-
locationName: "",
|
|
82
|
-
botId: ""
|
|
83
|
-
}), [U, W] = _({
|
|
77
|
+
Bt(Rt, e);
|
|
78
|
+
}, Zt = async () => {
|
|
79
|
+
R && await Ut(R.id, !R.notificationsEnabled) && await z();
|
|
80
|
+
}, Qt = async () => {
|
|
81
|
+
R && await Gt(R.id) && await z();
|
|
82
|
+
}, [B, $t] = v(!1), [en, V] = v(!1), [tn, nn] = v(null), rn = {
|
|
84
83
|
name: "",
|
|
85
84
|
description: "",
|
|
86
|
-
type: g(
|
|
85
|
+
type: g(A.get("type") ?? "WEB_WIDGET", E, "WEB_WIDGET"),
|
|
87
86
|
visibility: "PRIVATE",
|
|
88
87
|
credentialsRefId: ""
|
|
89
|
-
}), [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
88
|
+
}, [H, U] = v(rn), [an, W] = v(rn), [on, G] = v(!1), [sn, K] = v(null), [cn, ln] = v(!0), [un, dn] = v("new"), [q, fn] = v({}), J = be(H.type), Y = ye[H.type], X = Y ? un : "existing", pn = J && L ? Mt.filter((e) => e.organizationId === L && e.platform === J && e.status === "ACTIVE") : [], mn = pn.some((e) => e.id === H.credentialsRefId), hn = JSON.stringify(H) !== JSON.stringify(an) || Object.values(q).some((e) => e.trim() !== "") || !!S && (!cn || un !== "new"), Z = {};
|
|
89
|
+
H.name.trim() || (Z.name = C("botlit.channelDetail.form.errors.nameRequired", "Enter a name for the connector.")), S && J && X === "existing" && !mn && (Z.channel = C("botlit.channelDetail.form.errors.channelRequired", "Select the channel this connector routes."));
|
|
90
|
+
let Q = (e) => on ? Z[e] : void 0;
|
|
91
|
+
Ie(() => {
|
|
92
|
+
if (!(S || B) || !hn) return;
|
|
93
|
+
let e = (e) => {
|
|
94
|
+
e.preventDefault(), e.returnValue = "";
|
|
95
|
+
};
|
|
96
|
+
return window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
|
|
97
|
+
}, [
|
|
98
|
+
S,
|
|
99
|
+
B,
|
|
100
|
+
hn
|
|
101
|
+
]);
|
|
102
|
+
let gn = async () => !hn || je({
|
|
103
|
+
title: C("botlit.channelDetail.discard.title", "Discard changes?"),
|
|
104
|
+
message: C("botlit.channelDetail.discard.message", "You have unsaved changes. If you leave now they will be lost."),
|
|
105
|
+
confirmLabel: C("botlit.common.discard", "Discard"),
|
|
106
|
+
cancelLabel: C("botlit.common.keepEditing", "Keep editing")
|
|
107
|
+
}), _n = async () => {
|
|
108
|
+
await gn() && (W(H), fn({}), k("channels"));
|
|
109
|
+
}, vn = async () => {
|
|
110
|
+
await gn() && ($t(!1), G(!1), K(null));
|
|
111
|
+
}, yn = async (e) => {
|
|
112
|
+
(!B || await gn()) && k(e);
|
|
113
|
+
}, bn = async (e) => {
|
|
114
|
+
if (e.preventDefault(), G(!0), K(null), Z.name || Z.channel) return;
|
|
115
|
+
let t = cn ? "ACTIVE" : "DRAFT", n = H.name.trim(), r;
|
|
116
|
+
if (J && X === "new" && Y) {
|
|
117
|
+
let e = we(Y, q);
|
|
111
118
|
if (e) {
|
|
112
|
-
|
|
119
|
+
K(e);
|
|
113
120
|
return;
|
|
114
121
|
}
|
|
115
|
-
if (!
|
|
116
|
-
|
|
122
|
+
if (!L) {
|
|
123
|
+
K(C("botlit.channelDetail.form.errors.organizationRequired", "Select an organization before connecting a channel."));
|
|
117
124
|
return;
|
|
118
125
|
}
|
|
119
126
|
try {
|
|
120
|
-
|
|
121
|
-
name:
|
|
122
|
-
description:
|
|
123
|
-
organizationId:
|
|
124
|
-
definition:
|
|
125
|
-
credentials:
|
|
127
|
+
r = await Ot({
|
|
128
|
+
name: n,
|
|
129
|
+
description: H.description || void 0,
|
|
130
|
+
organizationId: L,
|
|
131
|
+
definition: Y,
|
|
132
|
+
credentials: q
|
|
126
133
|
});
|
|
127
134
|
} catch (e) {
|
|
128
|
-
|
|
135
|
+
K(_(e, C("botlit.channelDetail.form.errors.provisionFailed", "Failed to create the channel.")));
|
|
129
136
|
return;
|
|
130
137
|
}
|
|
131
138
|
}
|
|
132
139
|
try {
|
|
133
|
-
let
|
|
134
|
-
name:
|
|
135
|
-
type:
|
|
136
|
-
description:
|
|
137
|
-
visibility:
|
|
138
|
-
status:
|
|
139
|
-
credentialsRefId:
|
|
140
|
-
metadata:
|
|
140
|
+
let e = await bt({
|
|
141
|
+
name: n,
|
|
142
|
+
type: H.type,
|
|
143
|
+
description: H.description || void 0,
|
|
144
|
+
visibility: H.visibility,
|
|
145
|
+
status: t,
|
|
146
|
+
credentialsRefId: J ? r ?? (X === "existing" ? H.credentialsRefId : void 0) : void 0,
|
|
147
|
+
metadata: r ? { [Ne]: r } : void 0
|
|
141
148
|
});
|
|
142
|
-
|
|
149
|
+
fn({}), W(H), T.success(C("botlit.channelDetail.create.success", "Channel \"{{name}}\" created", { name: e.name })), k(`channels/${e.id}`);
|
|
143
150
|
} catch (e) {
|
|
144
|
-
if (
|
|
145
|
-
let e =
|
|
146
|
-
await
|
|
151
|
+
if (r) {
|
|
152
|
+
let e = r;
|
|
153
|
+
await Dt(e).catch(() => void 0) === null && await kt(e).catch(() => void 0);
|
|
147
154
|
}
|
|
148
|
-
|
|
155
|
+
K(_(e, C("botlit.channelDetail.create.error", "Failed to create channel connector.")));
|
|
149
156
|
}
|
|
150
|
-
},
|
|
151
|
-
if (!
|
|
152
|
-
let e =
|
|
157
|
+
}, xn = async () => {
|
|
158
|
+
if (!O || !j) return;
|
|
159
|
+
let e = j.status !== "ACTIVE";
|
|
153
160
|
try {
|
|
154
|
-
await
|
|
155
|
-
connectorId:
|
|
161
|
+
await St({
|
|
162
|
+
connectorId: O,
|
|
156
163
|
input: { status: e ? "ACTIVE" : "DRAFT" }
|
|
157
|
-
}),
|
|
164
|
+
}), T.success(e ? C("botlit.channelDetail.status.activated", "Connector activated") : C("botlit.channelDetail.status.deactivated", "Connector deactivated")), _t(), Lt();
|
|
158
165
|
} catch (e) {
|
|
159
|
-
|
|
166
|
+
T.error(_(e, C("botlit.channelDetail.status.failed", "Failed to change the connector status.")));
|
|
160
167
|
}
|
|
161
|
-
},
|
|
162
|
-
if (
|
|
163
|
-
await
|
|
164
|
-
connectorId:
|
|
168
|
+
}, Sn = async (e) => {
|
|
169
|
+
if (e.preventDefault(), G(!0), K(null), O && !Z.name) try {
|
|
170
|
+
await St({
|
|
171
|
+
connectorId: O,
|
|
165
172
|
input: {
|
|
166
|
-
name:
|
|
167
|
-
description:
|
|
168
|
-
visibility:
|
|
169
|
-
credentialsRefId:
|
|
170
|
-
metadata: Xt()
|
|
173
|
+
name: H.name.trim(),
|
|
174
|
+
description: H.description || void 0,
|
|
175
|
+
visibility: H.visibility,
|
|
176
|
+
credentialsRefId: H.credentialsRefId || void 0
|
|
171
177
|
}
|
|
172
|
-
}),
|
|
178
|
+
}), W(H), T.success(C("botlit.channelDetail.update.success", "Channel updated")), $t(!1), G(!1), _t();
|
|
173
179
|
} catch (e) {
|
|
174
|
-
|
|
180
|
+
K(_(e, C("botlit.channelDetail.update.error", "Failed to update channel connector.")));
|
|
175
181
|
}
|
|
176
|
-
},
|
|
177
|
-
if (
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
182
|
+
}, Cn = async () => {
|
|
183
|
+
if (!O || !j || !I) return;
|
|
184
|
+
let e = N.length, i = Fe(j);
|
|
185
|
+
if (await je({
|
|
186
|
+
title: C("botlit.channelDetail.delete.title", "Delete connector?"),
|
|
187
|
+
message: [e > 0 ? C("botlit.channelDetail.delete.messageWithRoutes", "Delete \"{{name}}\"? Its {{count}} route(s) are deleted with it and this channel stops answering. This cannot be undone.", {
|
|
188
|
+
name: j.name,
|
|
189
|
+
count: e
|
|
190
|
+
}) : C("botlit.channelDetail.delete.message", "Delete \"{{name}}\"? This cannot be undone.", { name: j.name }), i ? C("botlit.channelDetail.delete.ownChannel", "The {{platform}} channel and the credentials saved for this connector are deleted too.", { platform: Pe(j.type, C) }) : ""].filter(Boolean).join(" "),
|
|
191
|
+
confirmLabel: C("botlit.common.delete", "Delete"),
|
|
192
|
+
cancelLabel: C("botlit.common.cancel", "Cancel")
|
|
193
|
+
})) {
|
|
194
|
+
n("medium");
|
|
195
|
+
try {
|
|
196
|
+
await wt(O);
|
|
197
|
+
} catch (e) {
|
|
198
|
+
t() && r("error"), T.error(_(e, C("botlit.channelDetail.delete.error", "The connector could not be deleted.")));
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (t() && r("success"), T.success(C("botlit.channelDetail.delete.success", "Connector \"{{name}}\" deleted", { name: j.name })), i) try {
|
|
202
|
+
await Dt(i) === null && await kt(i);
|
|
203
|
+
} catch (e) {
|
|
204
|
+
T.warning(_(e, C("botlit.channelDetail.delete.channelLeft", "The connector was deleted, but its channel could not be removed. Delete it from Channels in Settings.")));
|
|
205
|
+
}
|
|
206
|
+
k("channels");
|
|
181
207
|
}
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
let
|
|
208
|
+
}, wn = async (e) => {
|
|
209
|
+
nn(e.id);
|
|
210
|
+
let t = de(e, "locationName") ?? e.locationId;
|
|
185
211
|
try {
|
|
186
|
-
await
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
metadata: {
|
|
191
|
-
locationName: V.locationName || V.locationId,
|
|
192
|
-
appName: e?.name
|
|
193
|
-
}
|
|
194
|
-
});
|
|
212
|
+
await Et({
|
|
213
|
+
routeId: e.id,
|
|
214
|
+
input: { isActive: !e.isActive }
|
|
215
|
+
}), T.success(e.isActive ? C("botlit.channelRoutes.toggle.off", "Route turned off: {{location}}", { location: t }) : C("botlit.channelRoutes.toggle.on", "Route turned on: {{location}}", { location: t })), F();
|
|
195
216
|
} catch (e) {
|
|
196
|
-
|
|
197
|
-
|
|
217
|
+
T.error(_(e, C("botlit.channelRoutes.toggle.failed", "The route could not be changed.")));
|
|
218
|
+
} finally {
|
|
219
|
+
nn(null);
|
|
198
220
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
221
|
+
}, Tn = () => {
|
|
222
|
+
if (!j) return;
|
|
223
|
+
let e = {
|
|
224
|
+
name: j.name,
|
|
225
|
+
description: j.description || "",
|
|
226
|
+
type: g(j.type, E, "CUSTOM"),
|
|
227
|
+
visibility: g(j.visibility, ct, "PRIVATE"),
|
|
228
|
+
credentialsRefId: j.credentialsRefId || ""
|
|
229
|
+
};
|
|
230
|
+
U(e), W(e), G(!1), K(null), $t(!0);
|
|
231
|
+
}, En = /* @__PURE__ */ x(y, { children: [
|
|
232
|
+
/* @__PURE__ */ b("option", {
|
|
233
|
+
value: "PRIVATE",
|
|
234
|
+
children: C("botlit.visibility.private", "Private")
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ b("option", {
|
|
237
|
+
value: "WORKSPACE",
|
|
238
|
+
children: C("botlit.visibility.workspace", "Workspace")
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ b("option", {
|
|
241
|
+
value: "PUBLIC",
|
|
242
|
+
children: C("botlit.visibility.public", "Public")
|
|
243
|
+
})
|
|
244
|
+
] }), Dn = sn && /* @__PURE__ */ b("p", {
|
|
245
|
+
role: "alert",
|
|
246
|
+
className: "rounded-lg border border-status-error-border bg-status-error-bg-subtle px-3 py-2 text-sm text-status-error-text",
|
|
247
|
+
children: sn
|
|
248
|
+
});
|
|
249
|
+
if (S) return /* @__PURE__ */ b(a, {
|
|
250
|
+
title: C("botlit.channelDetail.create.title", "Create Channel Connector"),
|
|
251
|
+
description: C("botlit.channelDetail.create.description", "Set up a new channel for your AI agents"),
|
|
252
|
+
actions: /* @__PURE__ */ x("div", {
|
|
225
253
|
className: "flex gap-2",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
254
|
+
children: [/* @__PURE__ */ b(p, {
|
|
255
|
+
type: "button",
|
|
227
256
|
variant: "outline",
|
|
228
|
-
onClick: () =>
|
|
229
|
-
children: "Cancel"
|
|
230
|
-
}), /* @__PURE__ */
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
children: "Create"
|
|
257
|
+
onClick: () => void _n(),
|
|
258
|
+
children: C("botlit.common.cancel", "Cancel")
|
|
259
|
+
}), /* @__PURE__ */ b(p, {
|
|
260
|
+
type: "submit",
|
|
261
|
+
form: dt,
|
|
262
|
+
leftIcon: /* @__PURE__ */ b(nt, { size: 16 }),
|
|
263
|
+
isLoading: At || xt.loading || Ct.loading,
|
|
264
|
+
children: C("botlit.common.create", "Create")
|
|
236
265
|
})]
|
|
237
266
|
}),
|
|
238
|
-
children: /* @__PURE__ */
|
|
267
|
+
children: /* @__PURE__ */ x("form", {
|
|
268
|
+
id: dt,
|
|
269
|
+
noValidate: !0,
|
|
239
270
|
className: "max-w-2xl space-y-6",
|
|
271
|
+
onSubmit: (e) => void bn(e),
|
|
240
272
|
children: [
|
|
241
|
-
|
|
273
|
+
Dn,
|
|
274
|
+
on && (Z.name || Z.channel) && /* @__PURE__ */ b("p", {
|
|
275
|
+
role: "alert",
|
|
276
|
+
className: "text-sm text-status-error-text",
|
|
277
|
+
children: C("botlit.channelDetail.form.errors.summary", "Fix the highlighted fields to create the connector.")
|
|
278
|
+
}),
|
|
279
|
+
/* @__PURE__ */ x(c, { children: [/* @__PURE__ */ b(d, { children: /* @__PURE__ */ b(f, { children: C("botlit.channelDetail.form.basics", "Basic Information") }) }), /* @__PURE__ */ x(l, {
|
|
242
280
|
className: "space-y-4",
|
|
243
281
|
children: [
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
label: "Connector Name",
|
|
282
|
+
/* @__PURE__ */ b(m, {
|
|
283
|
+
label: C("botlit.channelDetail.form.name", "Connector Name"),
|
|
284
|
+
htmlFor: "channel-connector-name",
|
|
246
285
|
required: !0,
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
286
|
+
error: Q("name"),
|
|
287
|
+
children: /* @__PURE__ */ b(te, {
|
|
288
|
+
id: "channel-connector-name",
|
|
289
|
+
placeholder: C("botlit.channelDetail.form.namePlaceholder", "e.g., Production Slack"),
|
|
290
|
+
value: H.name,
|
|
291
|
+
maxLength: lt,
|
|
292
|
+
"aria-invalid": !!Q("name"),
|
|
293
|
+
onChange: (e) => U({
|
|
294
|
+
...H,
|
|
252
295
|
name: e.target.value
|
|
253
296
|
})
|
|
254
297
|
})
|
|
255
298
|
}),
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
label: "Description",
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
299
|
+
/* @__PURE__ */ b(m, {
|
|
300
|
+
label: C("botlit.channelDetail.form.description", "Description"),
|
|
301
|
+
htmlFor: "channel-connector-description",
|
|
302
|
+
children: /* @__PURE__ */ b(ne, {
|
|
303
|
+
id: "channel-connector-description",
|
|
304
|
+
placeholder: C("botlit.channelDetail.form.descriptionPlaceholder", "What is this channel connector for?"),
|
|
305
|
+
value: H.description,
|
|
306
|
+
maxLength: ut,
|
|
307
|
+
onChange: (e) => U({
|
|
308
|
+
...H,
|
|
263
309
|
description: e.target.value
|
|
264
310
|
}),
|
|
265
311
|
rows: 3
|
|
266
312
|
})
|
|
267
313
|
}),
|
|
268
|
-
/* @__PURE__ */
|
|
314
|
+
/* @__PURE__ */ x("div", {
|
|
269
315
|
className: "grid grid-cols-2 gap-4",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
271
|
-
label: "Channel Type",
|
|
316
|
+
children: [/* @__PURE__ */ b(m, {
|
|
317
|
+
label: C("botlit.channelDetail.form.type", "Channel Type"),
|
|
318
|
+
htmlFor: "channel-connector-type",
|
|
272
319
|
required: !0,
|
|
273
|
-
children: /* @__PURE__ */
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
320
|
+
children: /* @__PURE__ */ b("select", {
|
|
321
|
+
id: "channel-connector-type",
|
|
322
|
+
className: D,
|
|
323
|
+
value: H.type,
|
|
324
|
+
onChange: (e) => U({
|
|
325
|
+
...H,
|
|
278
326
|
type: e.target.value,
|
|
279
327
|
credentialsRefId: ""
|
|
280
328
|
}),
|
|
281
|
-
children:
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}),
|
|
286
|
-
/* @__PURE__ */ v("option", {
|
|
287
|
-
value: "SLACK",
|
|
288
|
-
children: "Slack"
|
|
289
|
-
}),
|
|
290
|
-
/* @__PURE__ */ v("option", {
|
|
291
|
-
value: "TEAMS",
|
|
292
|
-
children: "Microsoft Teams"
|
|
293
|
-
}),
|
|
294
|
-
/* @__PURE__ */ v("option", {
|
|
295
|
-
value: "DISCORD",
|
|
296
|
-
children: "Discord"
|
|
297
|
-
}),
|
|
298
|
-
/* @__PURE__ */ v("option", {
|
|
299
|
-
value: "WHATSAPP",
|
|
300
|
-
children: "WhatsApp"
|
|
301
|
-
}),
|
|
302
|
-
/* @__PURE__ */ v("option", {
|
|
303
|
-
value: "WEBHOOK",
|
|
304
|
-
children: "Webhook"
|
|
305
|
-
}),
|
|
306
|
-
/* @__PURE__ */ v("option", {
|
|
307
|
-
value: "CUSTOM",
|
|
308
|
-
children: "Custom"
|
|
309
|
-
})
|
|
310
|
-
]
|
|
329
|
+
children: E.map((e) => /* @__PURE__ */ b("option", {
|
|
330
|
+
value: e,
|
|
331
|
+
children: Pe(e, C)
|
|
332
|
+
}, e))
|
|
311
333
|
})
|
|
312
|
-
}), /* @__PURE__ */
|
|
313
|
-
label: "Visibility",
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
334
|
+
}), /* @__PURE__ */ b(m, {
|
|
335
|
+
label: C("botlit.channelDetail.form.visibility", "Visibility"),
|
|
336
|
+
htmlFor: "channel-connector-visibility",
|
|
337
|
+
children: /* @__PURE__ */ b("select", {
|
|
338
|
+
id: "channel-connector-visibility",
|
|
339
|
+
className: D,
|
|
340
|
+
value: H.visibility,
|
|
341
|
+
onChange: (e) => U({
|
|
342
|
+
...H,
|
|
319
343
|
visibility: e.target.value
|
|
320
344
|
}),
|
|
321
|
-
children:
|
|
322
|
-
/* @__PURE__ */ v("option", {
|
|
323
|
-
value: "PRIVATE",
|
|
324
|
-
children: "Private"
|
|
325
|
-
}),
|
|
326
|
-
/* @__PURE__ */ v("option", {
|
|
327
|
-
value: "WORKSPACE",
|
|
328
|
-
children: "Workspace"
|
|
329
|
-
}),
|
|
330
|
-
/* @__PURE__ */ v("option", {
|
|
331
|
-
value: "PUBLIC",
|
|
332
|
-
children: "Public"
|
|
333
|
-
})
|
|
334
|
-
]
|
|
345
|
+
children: En
|
|
335
346
|
})
|
|
336
347
|
})]
|
|
337
348
|
}),
|
|
338
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ x("label", {
|
|
339
350
|
className: "flex items-start gap-2 text-sm",
|
|
340
|
-
children: [/* @__PURE__ */
|
|
351
|
+
children: [/* @__PURE__ */ b("input", {
|
|
341
352
|
type: "checkbox",
|
|
342
353
|
className: "mt-1",
|
|
343
|
-
checked:
|
|
344
|
-
onChange: (e) =>
|
|
345
|
-
}), /* @__PURE__ */
|
|
354
|
+
checked: cn,
|
|
355
|
+
onChange: (e) => ln(e.target.checked)
|
|
356
|
+
}), /* @__PURE__ */ x("span", { children: [/* @__PURE__ */ b("span", {
|
|
346
357
|
className: "font-medium",
|
|
347
|
-
children: "Activate now"
|
|
348
|
-
}), /* @__PURE__ */
|
|
358
|
+
children: C("botlit.channelDetail.form.activateNow", "Activate now")
|
|
359
|
+
}), /* @__PURE__ */ b("span", {
|
|
349
360
|
className: "block text-text-secondary",
|
|
350
|
-
children: "Only an active connector receives messages. Leave unchecked to save it as a draft and activate it later."
|
|
361
|
+
children: C("botlit.channelDetail.form.activateNowHint", "Only an active connector receives messages. Leave unchecked to save it as a draft and activate it later.")
|
|
351
362
|
})] })]
|
|
352
363
|
})
|
|
353
364
|
]
|
|
354
365
|
})] }),
|
|
355
|
-
|
|
366
|
+
J && /* @__PURE__ */ x(c, { children: [/* @__PURE__ */ x(d, { children: [/* @__PURE__ */ x(f, {
|
|
356
367
|
className: "flex items-center gap-2",
|
|
357
|
-
children: [/* @__PURE__ */
|
|
358
|
-
}), /* @__PURE__ */
|
|
368
|
+
children: [/* @__PURE__ */ b(tt, { size: 18 }), C("botlit.channelDetail.platform.title", "Platform Connection")]
|
|
369
|
+
}), /* @__PURE__ */ b(u, { children: Y ? C("botlit.channelDetail.platform.descriptionCredentials", "Enter the credentials of your platform app, or link a channel that is already set up.") : C("botlit.channelDetail.platform.descriptionExisting", "Link a channel that is already set up for this platform.") })] }), /* @__PURE__ */ x(l, {
|
|
359
370
|
className: "space-y-4",
|
|
360
|
-
children: [
|
|
371
|
+
children: [Y && /* @__PURE__ */ x("div", {
|
|
361
372
|
className: "flex gap-4 text-sm",
|
|
362
373
|
role: "radiogroup",
|
|
363
|
-
|
|
374
|
+
"aria-label": C("botlit.channelDetail.platform.mode", "Connection method"),
|
|
375
|
+
children: [/* @__PURE__ */ x("label", {
|
|
364
376
|
className: "flex items-center gap-2",
|
|
365
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ b("input", {
|
|
366
378
|
type: "radio",
|
|
367
379
|
name: "connection-mode",
|
|
368
|
-
checked:
|
|
369
|
-
onChange: () =>
|
|
370
|
-
}), "Connect with credentials"]
|
|
371
|
-
}), /* @__PURE__ */
|
|
380
|
+
checked: X === "new",
|
|
381
|
+
onChange: () => dn("new")
|
|
382
|
+
}), C("botlit.channelDetail.platform.modeNew", "Connect with credentials")]
|
|
383
|
+
}), /* @__PURE__ */ x("label", {
|
|
372
384
|
className: "flex items-center gap-2",
|
|
373
|
-
children: [/* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ b("input", {
|
|
374
386
|
type: "radio",
|
|
375
387
|
name: "connection-mode",
|
|
376
|
-
checked:
|
|
377
|
-
onChange: () =>
|
|
378
|
-
}), "Use an existing channel"]
|
|
388
|
+
checked: X === "existing",
|
|
389
|
+
onChange: () => dn("existing")
|
|
390
|
+
}), C("botlit.channelDetail.platform.modeExisting", "Use an existing channel")]
|
|
379
391
|
})]
|
|
380
|
-
}),
|
|
381
|
-
definition:
|
|
382
|
-
values:
|
|
383
|
-
onChange:
|
|
384
|
-
}) : /* @__PURE__ */
|
|
385
|
-
label: "Channel",
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
392
|
+
}), X === "new" && Y ? /* @__PURE__ */ b(ce, {
|
|
393
|
+
definition: Y,
|
|
394
|
+
values: q,
|
|
395
|
+
onChange: fn
|
|
396
|
+
}) : /* @__PURE__ */ b(m, {
|
|
397
|
+
label: C("botlit.channelDetail.platform.channel", "Channel"),
|
|
398
|
+
htmlFor: "channel-connector-channel",
|
|
399
|
+
description: C("botlit.channelDetail.platform.channelHint", "Channels of this platform in your organization"),
|
|
400
|
+
required: !0,
|
|
401
|
+
error: Q("channel"),
|
|
402
|
+
children: /* @__PURE__ */ x("select", {
|
|
403
|
+
id: "channel-connector-channel",
|
|
404
|
+
className: D,
|
|
405
|
+
value: H.credentialsRefId,
|
|
406
|
+
"aria-invalid": !!Q("channel"),
|
|
407
|
+
onChange: (e) => U({
|
|
408
|
+
...H,
|
|
393
409
|
credentialsRefId: e.target.value
|
|
394
410
|
}),
|
|
395
|
-
children: [/* @__PURE__ */
|
|
411
|
+
children: [/* @__PURE__ */ b("option", {
|
|
396
412
|
value: "",
|
|
397
|
-
children:
|
|
398
|
-
}),
|
|
413
|
+
children: pn.length > 0 ? C("botlit.channelDetail.platform.channelPlaceholder", "Select a channel...") : C("botlit.channelDetail.platform.noChannels", "No channels of this platform yet")
|
|
414
|
+
}), pn.map((e) => /* @__PURE__ */ b("option", {
|
|
399
415
|
value: e.id,
|
|
400
416
|
children: e.name
|
|
401
417
|
}, e.id))]
|
|
402
418
|
})
|
|
403
419
|
})]
|
|
404
420
|
})] }),
|
|
405
|
-
|
|
406
|
-
className: "flex items-
|
|
407
|
-
children: [/* @__PURE__ */
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
value: X.allowedOrigins,
|
|
417
|
-
onChange: (e) => Z({
|
|
418
|
-
...X,
|
|
419
|
-
allowedOrigins: e.target.value
|
|
420
|
-
})
|
|
421
|
-
})
|
|
422
|
-
}),
|
|
423
|
-
/* @__PURE__ */ y("div", {
|
|
424
|
-
className: "grid grid-cols-2 gap-4",
|
|
425
|
-
children: [/* @__PURE__ */ v(f, {
|
|
426
|
-
label: "Primary Color",
|
|
427
|
-
children: /* @__PURE__ */ y("div", {
|
|
428
|
-
className: "flex gap-2",
|
|
429
|
-
children: [/* @__PURE__ */ v("input", {
|
|
430
|
-
type: "color",
|
|
431
|
-
value: X.primaryColor,
|
|
432
|
-
onChange: (e) => Z({
|
|
433
|
-
...X,
|
|
434
|
-
primaryColor: e.target.value
|
|
435
|
-
}),
|
|
436
|
-
className: "h-10 w-16 rounded border border-border-default"
|
|
437
|
-
}), /* @__PURE__ */ v(p, {
|
|
438
|
-
value: X.primaryColor,
|
|
439
|
-
onChange: (e) => Z({
|
|
440
|
-
...X,
|
|
441
|
-
primaryColor: e.target.value
|
|
442
|
-
})
|
|
443
|
-
})]
|
|
444
|
-
})
|
|
445
|
-
}), /* @__PURE__ */ v(f, {
|
|
446
|
-
label: "Font Family",
|
|
447
|
-
children: /* @__PURE__ */ v(p, {
|
|
448
|
-
value: X.fontFamily,
|
|
449
|
-
onChange: (e) => Z({
|
|
450
|
-
...X,
|
|
451
|
-
fontFamily: e.target.value
|
|
452
|
-
})
|
|
453
|
-
})
|
|
454
|
-
})]
|
|
455
|
-
}),
|
|
456
|
-
/* @__PURE__ */ v(f, {
|
|
457
|
-
label: "Starter Prompts",
|
|
458
|
-
description: "One per line",
|
|
459
|
-
children: /* @__PURE__ */ v(m, {
|
|
460
|
-
placeholder: "What can you help me with?",
|
|
461
|
-
value: X.starterPrompts,
|
|
462
|
-
onChange: (e) => Z({
|
|
463
|
-
...X,
|
|
464
|
-
starterPrompts: e.target.value
|
|
465
|
-
}),
|
|
466
|
-
rows: 3
|
|
467
|
-
})
|
|
468
|
-
})
|
|
469
|
-
]
|
|
470
|
-
})] })
|
|
421
|
+
H.type === "WEB_WIDGET" && /* @__PURE__ */ x("div", {
|
|
422
|
+
className: "flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-sunken p-4 text-sm",
|
|
423
|
+
children: [/* @__PURE__ */ b(Ye, {
|
|
424
|
+
size: 18,
|
|
425
|
+
"aria-hidden": "true",
|
|
426
|
+
className: "mt-0.5 shrink-0 text-text-secondary"
|
|
427
|
+
}), /* @__PURE__ */ b("p", {
|
|
428
|
+
className: "text-text-secondary",
|
|
429
|
+
children: C("botlit.channelDetail.webWidget.note", "To put an assistant on your website, publish it from the agent: open the agent and use its Website panel, which sets the allowed sites and gives you the embed code.")
|
|
430
|
+
})]
|
|
431
|
+
})
|
|
471
432
|
]
|
|
472
433
|
})
|
|
473
434
|
});
|
|
474
|
-
if (
|
|
475
|
-
title: "Loading...",
|
|
476
|
-
children: /* @__PURE__ */
|
|
435
|
+
if (gt) return /* @__PURE__ */ b(a, {
|
|
436
|
+
title: C("botlit.common.loading", "Loading..."),
|
|
437
|
+
children: /* @__PURE__ */ b("div", { className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
|
|
438
|
+
});
|
|
439
|
+
if (M && !Me(M)) return /* @__PURE__ */ b(a, {
|
|
440
|
+
title: C("botlit.channelDetail.loadError.title", "Connector unavailable"),
|
|
441
|
+
children: /* @__PURE__ */ b(oe, {
|
|
442
|
+
resource: C("botlit.channelDetail.resource", "this channel connector"),
|
|
443
|
+
error: M,
|
|
444
|
+
onRetry: () => void _t()
|
|
445
|
+
})
|
|
477
446
|
});
|
|
478
|
-
if (!
|
|
479
|
-
title: "Connector Not Found",
|
|
480
|
-
children: /* @__PURE__ */
|
|
447
|
+
if (!j) return /* @__PURE__ */ b(a, {
|
|
448
|
+
title: C("botlit.channelDetail.notFound.title", "Connector Not Found"),
|
|
449
|
+
children: /* @__PURE__ */ b(ae, {
|
|
481
450
|
illustration: "empty-notifications",
|
|
482
|
-
title: "Connector Not Found",
|
|
483
|
-
description: "This channel connector doesn't exist.",
|
|
484
|
-
action: /* @__PURE__ */
|
|
485
|
-
onClick: () =>
|
|
486
|
-
children: "Back to Channels"
|
|
451
|
+
title: C("botlit.channelDetail.notFound.title", "Connector Not Found"),
|
|
452
|
+
description: C("botlit.channelDetail.notFound.description", "This channel connector doesn't exist in this workspace."),
|
|
453
|
+
action: /* @__PURE__ */ b(p, {
|
|
454
|
+
onClick: () => k("channels"),
|
|
455
|
+
children: C("botlit.channelDetail.backToChannels", "Back to Channels")
|
|
487
456
|
})
|
|
488
457
|
})
|
|
489
458
|
});
|
|
490
|
-
let
|
|
491
|
-
return /* @__PURE__ */
|
|
492
|
-
title: /* @__PURE__ */
|
|
459
|
+
let $ = g(j.type, E, "CUSTOM"), On = N.filter((e) => e.isActive).length, kn = (e) => yt.find((t) => t.id === e.appId)?.name ?? de(e, "appName") ?? C("botlit.channelRoutes.unknownBot", "Unknown bot");
|
|
460
|
+
return /* @__PURE__ */ b(a, {
|
|
461
|
+
title: /* @__PURE__ */ x("div", {
|
|
493
462
|
className: "flex items-center gap-3",
|
|
494
463
|
children: [
|
|
495
|
-
/* @__PURE__ */
|
|
464
|
+
/* @__PURE__ */ b(p, {
|
|
496
465
|
variant: "ghost",
|
|
497
466
|
size: "icon",
|
|
498
|
-
|
|
499
|
-
|
|
467
|
+
"aria-label": C("botlit.channelDetail.backToChannels", "Back to Channels"),
|
|
468
|
+
onClick: () => void yn("channels"),
|
|
469
|
+
children: /* @__PURE__ */ b(We, { size: 20 })
|
|
500
470
|
}),
|
|
501
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ b("div", {
|
|
502
472
|
className: "p-2 rounded-lg bg-action-primary-bg/10",
|
|
503
|
-
children: /* @__PURE__ */
|
|
473
|
+
children: /* @__PURE__ */ b(pt, { type: $ })
|
|
504
474
|
}),
|
|
505
|
-
/* @__PURE__ */
|
|
475
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("div", {
|
|
506
476
|
className: "flex items-center gap-2",
|
|
507
|
-
children: [/* @__PURE__ */
|
|
508
|
-
}), /* @__PURE__ */
|
|
477
|
+
children: [/* @__PURE__ */ b("span", { children: j.name }), /* @__PURE__ */ b(ie, { status: j.status })]
|
|
478
|
+
}), /* @__PURE__ */ b("p", {
|
|
509
479
|
className: "text-sm font-normal text-text-secondary",
|
|
510
|
-
children:
|
|
480
|
+
children: j.description
|
|
511
481
|
})] })
|
|
512
482
|
]
|
|
513
483
|
}),
|
|
514
|
-
actions: /* @__PURE__ */
|
|
484
|
+
actions: /* @__PURE__ */ x("div", {
|
|
515
485
|
className: "flex gap-2",
|
|
516
|
-
children: [/* @__PURE__ */
|
|
517
|
-
permission:
|
|
518
|
-
children: /* @__PURE__ */
|
|
486
|
+
children: [/* @__PURE__ */ b(s, {
|
|
487
|
+
permission: o.CHANNEL_CREATE,
|
|
488
|
+
children: /* @__PURE__ */ b(p, {
|
|
519
489
|
variant: "outline",
|
|
520
|
-
leftIcon: /* @__PURE__ */
|
|
521
|
-
onClick: () =>
|
|
522
|
-
children: "Add Route"
|
|
490
|
+
leftIcon: /* @__PURE__ */ b(Qe, { size: 16 }),
|
|
491
|
+
onClick: () => V(!0),
|
|
492
|
+
children: C("botlit.channelDetail.routes.add", "Add Route")
|
|
523
493
|
})
|
|
524
|
-
}),
|
|
494
|
+
}), B ? /* @__PURE__ */ x(y, { children: [/* @__PURE__ */ b(p, {
|
|
495
|
+
type: "button",
|
|
525
496
|
variant: "outline",
|
|
526
|
-
onClick: () =>
|
|
527
|
-
children: "Cancel"
|
|
528
|
-
}), /* @__PURE__ */
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
497
|
+
onClick: () => void vn(),
|
|
498
|
+
children: C("botlit.common.cancel", "Cancel")
|
|
499
|
+
}), /* @__PURE__ */ b(p, {
|
|
500
|
+
type: "submit",
|
|
501
|
+
form: ft,
|
|
502
|
+
leftIcon: /* @__PURE__ */ b(nt, { size: 16 }),
|
|
503
|
+
isLoading: Ct.loading,
|
|
504
|
+
children: C("botlit.common.save", "Save")
|
|
505
|
+
})] }) : /* @__PURE__ */ x(y, { children: [
|
|
506
|
+
/* @__PURE__ */ b(s, {
|
|
507
|
+
permission: o.CHANNEL_UPDATE,
|
|
508
|
+
children: /* @__PURE__ */ b(p, {
|
|
509
|
+
variant: j.status === "ACTIVE" ? "outline" : "primary",
|
|
510
|
+
leftIcon: j.status === "ACTIVE" ? /* @__PURE__ */ b(et, { size: 16 }) : /* @__PURE__ */ b($e, { size: 16 }),
|
|
511
|
+
onClick: () => void xn(),
|
|
512
|
+
isLoading: Ct.loading && !B,
|
|
513
|
+
children: j.status === "ACTIVE" ? C("botlit.channelDetail.actions.deactivate", "Deactivate") : C("botlit.channelDetail.actions.activate", "Activate")
|
|
542
514
|
})
|
|
543
515
|
}),
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
permission:
|
|
546
|
-
children: /* @__PURE__ */
|
|
516
|
+
/* @__PURE__ */ b(s, {
|
|
517
|
+
permission: o.CHANNEL_UPDATE,
|
|
518
|
+
children: /* @__PURE__ */ b(p, {
|
|
547
519
|
variant: "outline",
|
|
548
|
-
leftIcon: /* @__PURE__ */
|
|
549
|
-
onClick:
|
|
550
|
-
children: "Edit"
|
|
520
|
+
leftIcon: /* @__PURE__ */ b(Je, { size: 16 }),
|
|
521
|
+
onClick: Tn,
|
|
522
|
+
children: C("botlit.common.edit", "Edit")
|
|
551
523
|
})
|
|
552
524
|
}),
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
children:
|
|
556
|
-
variant: "outline",
|
|
557
|
-
size: "sm",
|
|
558
|
-
onClick: () => Ht(!1),
|
|
559
|
-
children: "Cancel"
|
|
560
|
-
}), /* @__PURE__ */ v(d, {
|
|
561
|
-
variant: "destructive",
|
|
562
|
-
size: "sm",
|
|
563
|
-
onClick: () => {
|
|
564
|
-
ee("medium"), en();
|
|
565
|
-
},
|
|
566
|
-
isLoading: mt.loading,
|
|
567
|
-
children: "Confirm"
|
|
568
|
-
})]
|
|
569
|
-
}) : /* @__PURE__ */ v(i, {
|
|
570
|
-
permission: r.CHANNEL_DELETE,
|
|
571
|
-
children: /* @__PURE__ */ v(d, {
|
|
525
|
+
/* @__PURE__ */ b(s, {
|
|
526
|
+
permission: o.CHANNEL_DELETE,
|
|
527
|
+
children: /* @__PURE__ */ b(p, {
|
|
572
528
|
variant: "destructive",
|
|
573
|
-
leftIcon: /* @__PURE__ */
|
|
574
|
-
|
|
575
|
-
|
|
529
|
+
leftIcon: /* @__PURE__ */ b(at, { size: 16 }),
|
|
530
|
+
isLoading: Tt.loading,
|
|
531
|
+
disabled: !I,
|
|
532
|
+
title: I ? void 0 : C("botlit.channelDetail.delete.waitForRoutes", "Available once this connector’s routes have loaded."),
|
|
533
|
+
onClick: () => void Cn(),
|
|
534
|
+
children: C("botlit.common.delete", "Delete")
|
|
576
535
|
})
|
|
577
536
|
})
|
|
578
537
|
] })]
|
|
579
538
|
}),
|
|
580
|
-
children: /* @__PURE__ */
|
|
539
|
+
children: /* @__PURE__ */ x("div", {
|
|
581
540
|
className: "space-y-6",
|
|
582
541
|
children: [
|
|
583
|
-
/* @__PURE__ */
|
|
584
|
-
icon: /* @__PURE__ */
|
|
585
|
-
children: "This connector links BotManor to one messaging platform. From here you add routes — each mapping a
|
|
542
|
+
/* @__PURE__ */ b(Ve, {
|
|
543
|
+
icon: /* @__PURE__ */ b(tt, { size: 18 }),
|
|
544
|
+
children: C("botlit.channelDetail.purpose", "This connector links BotManor to one messaging platform. From here you add routes — each mapping a location on the channel (a Slack channel, a number, or * for every location) to the bot that should answer there — change the connector settings, and manage its connection. Add at least one route that is turned on so messages on this channel reach a bot.")
|
|
586
545
|
}),
|
|
587
|
-
/* @__PURE__ */
|
|
588
|
-
storageKey: `botlit-channel-${
|
|
546
|
+
/* @__PURE__ */ b(Be, {
|
|
547
|
+
storageKey: `botlit-channel-${j.id}`,
|
|
589
548
|
steps: [
|
|
590
549
|
{
|
|
591
550
|
id: "route",
|
|
592
|
-
label: "Add a route",
|
|
593
|
-
description: "Point an incoming location on this channel at one of your bots.",
|
|
594
|
-
icon: /* @__PURE__ */
|
|
595
|
-
onClick: () =>
|
|
596
|
-
done:
|
|
551
|
+
label: C("botlit.channelDetail.next.route", "Add a route"),
|
|
552
|
+
description: C("botlit.channelDetail.next.routeDescription", "Point an incoming location on this channel at one of your bots."),
|
|
553
|
+
icon: /* @__PURE__ */ b(Qe, { size: 16 }),
|
|
554
|
+
onClick: () => V(!0),
|
|
555
|
+
done: On > 0
|
|
597
556
|
},
|
|
598
557
|
{
|
|
599
558
|
id: "edit",
|
|
600
|
-
label: "Review connector settings",
|
|
601
|
-
description: "Confirm the name, visibility and channel-specific configuration.",
|
|
602
|
-
icon: /* @__PURE__ */
|
|
603
|
-
onClick:
|
|
559
|
+
label: C("botlit.channelDetail.next.edit", "Review connector settings"),
|
|
560
|
+
description: C("botlit.channelDetail.next.editDescription", "Confirm the name, visibility and channel-specific configuration."),
|
|
561
|
+
icon: /* @__PURE__ */ b(rt, { size: 16 }),
|
|
562
|
+
onClick: Tn
|
|
604
563
|
},
|
|
605
564
|
{
|
|
606
565
|
id: "bots",
|
|
607
|
-
label: "Check your bots",
|
|
608
|
-
description: "Make sure the bot you are routing to is active and configured.",
|
|
609
|
-
icon: /* @__PURE__ */
|
|
610
|
-
onClick: () =>
|
|
566
|
+
label: C("botlit.channelDetail.next.bots", "Check your bots"),
|
|
567
|
+
description: C("botlit.channelDetail.next.botsDescription", "Make sure the bot you are routing to is active and configured."),
|
|
568
|
+
icon: /* @__PURE__ */ b(Ze, { size: 16 }),
|
|
569
|
+
onClick: () => void yn("bots")
|
|
611
570
|
}
|
|
612
571
|
]
|
|
613
572
|
}),
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
variant: "ghost",
|
|
618
|
-
size: "icon",
|
|
619
|
-
onClick: () => B(!1),
|
|
620
|
-
children: /* @__PURE__ */ v(et, { size: 16 })
|
|
621
|
-
})]
|
|
622
|
-
}), /* @__PURE__ */ y(s, {
|
|
623
|
-
className: "space-y-4",
|
|
624
|
-
children: [
|
|
625
|
-
/* @__PURE__ */ y("div", {
|
|
626
|
-
className: "grid grid-cols-2 gap-4",
|
|
627
|
-
children: [/* @__PURE__ */ v(f, {
|
|
628
|
-
label: "Location ID",
|
|
629
|
-
required: !0,
|
|
630
|
-
children: /* @__PURE__ */ v(p, {
|
|
631
|
-
placeholder: "* for every location, or a Slack channel ID",
|
|
632
|
-
value: V.locationId,
|
|
633
|
-
onChange: (e) => H({
|
|
634
|
-
...V,
|
|
635
|
-
locationId: e.target.value
|
|
636
|
-
})
|
|
637
|
-
})
|
|
638
|
-
}), /* @__PURE__ */ v(f, {
|
|
639
|
-
label: "Location Name",
|
|
640
|
-
children: /* @__PURE__ */ v(p, {
|
|
641
|
-
placeholder: "Friendly name (optional)",
|
|
642
|
-
value: V.locationName,
|
|
643
|
-
onChange: (e) => H({
|
|
644
|
-
...V,
|
|
645
|
-
locationName: e.target.value
|
|
646
|
-
})
|
|
647
|
-
})
|
|
648
|
-
})]
|
|
649
|
-
}),
|
|
650
|
-
/* @__PURE__ */ v(f, {
|
|
651
|
-
label: "Connect to Bot",
|
|
652
|
-
required: !0,
|
|
653
|
-
children: /* @__PURE__ */ y("select", {
|
|
654
|
-
className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
|
|
655
|
-
value: V.botId,
|
|
656
|
-
onChange: (e) => H({
|
|
657
|
-
...V,
|
|
658
|
-
botId: e.target.value
|
|
659
|
-
}),
|
|
660
|
-
children: [/* @__PURE__ */ v("option", {
|
|
661
|
-
value: "",
|
|
662
|
-
children: "Select a bot..."
|
|
663
|
-
}), ut?.map((e) => /* @__PURE__ */ v("option", {
|
|
664
|
-
value: e.id,
|
|
665
|
-
children: e.name
|
|
666
|
-
}, e.id))]
|
|
667
|
-
})
|
|
668
|
-
}),
|
|
669
|
-
/* @__PURE__ */ y("div", {
|
|
670
|
-
className: "flex justify-end gap-2",
|
|
671
|
-
children: [/* @__PURE__ */ v(d, {
|
|
672
|
-
variant: "outline",
|
|
673
|
-
onClick: () => B(!1),
|
|
674
|
-
children: "Cancel"
|
|
675
|
-
}), /* @__PURE__ */ v(d, {
|
|
676
|
-
onClick: tn,
|
|
677
|
-
isLoading: gt.loading,
|
|
678
|
-
disabled: !V.locationId || !V.botId,
|
|
679
|
-
children: "Add Route"
|
|
680
|
-
})]
|
|
681
|
-
})
|
|
682
|
-
]
|
|
683
|
-
})] }),
|
|
684
|
-
R && /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ v(l, { children: /* @__PURE__ */ v(u, { children: "Edit Channel" }) }), /* @__PURE__ */ y(s, {
|
|
573
|
+
B && /* @__PURE__ */ x(c, { children: [/* @__PURE__ */ b(d, { children: /* @__PURE__ */ b(f, { children: C("botlit.channelDetail.edit.title", "Edit Channel") }) }), /* @__PURE__ */ b(l, { children: /* @__PURE__ */ x("form", {
|
|
574
|
+
id: ft,
|
|
575
|
+
noValidate: !0,
|
|
685
576
|
className: "space-y-4",
|
|
577
|
+
onSubmit: (e) => void Sn(e),
|
|
686
578
|
children: [
|
|
687
|
-
|
|
688
|
-
|
|
579
|
+
Dn,
|
|
580
|
+
/* @__PURE__ */ b(m, {
|
|
581
|
+
label: C("botlit.channelDetail.form.name", "Connector Name"),
|
|
582
|
+
htmlFor: "channel-connector-edit-name",
|
|
689
583
|
required: !0,
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
584
|
+
error: Q("name"),
|
|
585
|
+
children: /* @__PURE__ */ b(te, {
|
|
586
|
+
id: "channel-connector-edit-name",
|
|
587
|
+
value: H.name,
|
|
588
|
+
maxLength: lt,
|
|
589
|
+
"aria-invalid": !!Q("name"),
|
|
590
|
+
onChange: (e) => U({
|
|
591
|
+
...H,
|
|
694
592
|
name: e.target.value
|
|
695
593
|
})
|
|
696
594
|
})
|
|
697
595
|
}),
|
|
698
|
-
/* @__PURE__ */
|
|
699
|
-
label: "Description",
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
596
|
+
/* @__PURE__ */ b(m, {
|
|
597
|
+
label: C("botlit.channelDetail.form.description", "Description"),
|
|
598
|
+
htmlFor: "channel-connector-edit-description",
|
|
599
|
+
children: /* @__PURE__ */ b(ne, {
|
|
600
|
+
id: "channel-connector-edit-description",
|
|
601
|
+
value: H.description,
|
|
602
|
+
maxLength: ut,
|
|
603
|
+
onChange: (e) => U({
|
|
604
|
+
...H,
|
|
704
605
|
description: e.target.value
|
|
705
606
|
}),
|
|
706
607
|
rows: 2
|
|
707
608
|
})
|
|
708
609
|
}),
|
|
709
|
-
/* @__PURE__ */
|
|
710
|
-
label: "Visibility",
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
610
|
+
/* @__PURE__ */ b(m, {
|
|
611
|
+
label: C("botlit.channelDetail.form.visibility", "Visibility"),
|
|
612
|
+
htmlFor: "channel-connector-edit-visibility",
|
|
613
|
+
children: /* @__PURE__ */ b("select", {
|
|
614
|
+
id: "channel-connector-edit-visibility",
|
|
615
|
+
className: D,
|
|
616
|
+
value: H.visibility,
|
|
617
|
+
onChange: (e) => U({
|
|
618
|
+
...H,
|
|
716
619
|
visibility: e.target.value
|
|
717
620
|
}),
|
|
718
|
-
children:
|
|
719
|
-
/* @__PURE__ */ v("option", {
|
|
720
|
-
value: "PRIVATE",
|
|
721
|
-
children: "Private"
|
|
722
|
-
}),
|
|
723
|
-
/* @__PURE__ */ v("option", {
|
|
724
|
-
value: "WORKSPACE",
|
|
725
|
-
children: "Workspace"
|
|
726
|
-
}),
|
|
727
|
-
/* @__PURE__ */ v("option", {
|
|
728
|
-
value: "PUBLIC",
|
|
729
|
-
children: "Public"
|
|
730
|
-
})
|
|
731
|
-
]
|
|
621
|
+
children: En
|
|
732
622
|
})
|
|
733
623
|
})
|
|
734
624
|
]
|
|
735
|
-
})] }),
|
|
736
|
-
/* @__PURE__ */
|
|
625
|
+
}) })] }),
|
|
626
|
+
/* @__PURE__ */ x("div", {
|
|
737
627
|
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
738
628
|
children: [
|
|
739
|
-
/* @__PURE__ */
|
|
629
|
+
/* @__PURE__ */ b(c, { children: /* @__PURE__ */ x(l, {
|
|
740
630
|
className: "pt-6 text-center",
|
|
741
631
|
children: [
|
|
742
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ b("div", {
|
|
743
633
|
className: "p-3 rounded-full bg-action-primary-bg/10 w-fit mx-auto mb-2",
|
|
744
|
-
children: /* @__PURE__ */
|
|
634
|
+
children: /* @__PURE__ */ b(pt, { type: $ })
|
|
745
635
|
}),
|
|
746
|
-
/* @__PURE__ */
|
|
747
|
-
className: "text-lg font-bold
|
|
748
|
-
children:
|
|
636
|
+
/* @__PURE__ */ b("p", {
|
|
637
|
+
className: "text-lg font-bold",
|
|
638
|
+
children: Pe(j.type, C)
|
|
749
639
|
}),
|
|
750
|
-
/* @__PURE__ */
|
|
640
|
+
/* @__PURE__ */ b("p", {
|
|
751
641
|
className: "text-sm text-text-secondary",
|
|
752
|
-
children: "Channel Type"
|
|
642
|
+
children: C("botlit.channelDetail.overview.type", "Channel Type")
|
|
753
643
|
})
|
|
754
644
|
]
|
|
755
645
|
}) }),
|
|
756
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ x(ze, {
|
|
757
647
|
treatment: "glass",
|
|
758
648
|
glow: !0,
|
|
759
649
|
className: "p-6 text-center",
|
|
760
|
-
children: [/* @__PURE__ */
|
|
650
|
+
children: [/* @__PURE__ */ b("p", {
|
|
761
651
|
className: "text-3xl font-bold tabular-nums text-text-primary",
|
|
762
|
-
children:
|
|
763
|
-
}), /* @__PURE__ */
|
|
652
|
+
children: I ? On : "—"
|
|
653
|
+
}), /* @__PURE__ */ b("p", {
|
|
764
654
|
className: "text-sm text-text-secondary",
|
|
765
|
-
children: "Active Routes"
|
|
655
|
+
children: I ? C("botlit.channelDetail.overview.activeRoutes", "Active routes of {{count}}", { count: N.length }) : P ? C("botlit.channelDetail.overview.routesUnavailable", "Routes could not be loaded") : C("botlit.channelDetail.overview.routesLoading", "Counting routes...")
|
|
766
656
|
})]
|
|
767
657
|
}),
|
|
768
|
-
/* @__PURE__ */
|
|
658
|
+
/* @__PURE__ */ b(c, { children: /* @__PURE__ */ x(l, {
|
|
769
659
|
className: "pt-6 text-center",
|
|
770
|
-
children: [
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
660
|
+
children: [
|
|
661
|
+
/* @__PURE__ */ b("p", {
|
|
662
|
+
className: "text-3xl font-bold tabular-nums text-text-primary",
|
|
663
|
+
children: j.unroutedMessageCount
|
|
664
|
+
}),
|
|
665
|
+
/* @__PURE__ */ b("p", {
|
|
666
|
+
className: "text-sm text-text-secondary",
|
|
667
|
+
children: C("botlit.channelDetail.overview.unrouted", "Unanswered inbound messages")
|
|
668
|
+
}),
|
|
669
|
+
j.lastUnroutedAt && /* @__PURE__ */ b("p", {
|
|
670
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
671
|
+
children: C("botlit.channelDetail.overview.lastUnrouted", "Last {{when}}", { when: h(j.lastUnroutedAt) })
|
|
672
|
+
})
|
|
673
|
+
]
|
|
777
674
|
}) }),
|
|
778
|
-
/* @__PURE__ */
|
|
675
|
+
/* @__PURE__ */ b(c, { children: /* @__PURE__ */ x(l, {
|
|
779
676
|
className: "pt-6 text-center",
|
|
780
|
-
children: [/* @__PURE__ */
|
|
677
|
+
children: [/* @__PURE__ */ b("p", {
|
|
781
678
|
className: "text-3xl font-bold text-text-primary",
|
|
782
|
-
children:
|
|
783
|
-
}), /* @__PURE__ */
|
|
679
|
+
children: C(`botlit.visibility.${j.visibility.toLowerCase()}`, j.visibility.charAt(0) + j.visibility.slice(1).toLowerCase())
|
|
680
|
+
}), /* @__PURE__ */ b("p", {
|
|
784
681
|
className: "text-sm text-text-secondary",
|
|
785
|
-
children: "
|
|
682
|
+
children: C("botlit.channelDetail.overview.visibility", "Visibility")
|
|
786
683
|
})]
|
|
787
684
|
}) })
|
|
788
685
|
]
|
|
789
686
|
}),
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
className: "flex flex-wrap gap-1 mt-1",
|
|
801
|
-
children: $.allowedOrigins.map((e) => /* @__PURE__ */ v(h, {
|
|
802
|
-
variant: "outline",
|
|
803
|
-
className: "font-mono text-xs",
|
|
804
|
-
children: e
|
|
805
|
-
}, e))
|
|
806
|
-
}) : /* @__PURE__ */ v("p", {
|
|
807
|
-
className: "font-medium",
|
|
808
|
-
children: "Any origin"
|
|
809
|
-
})] }),
|
|
810
|
-
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
811
|
-
className: "text-sm text-text-secondary",
|
|
812
|
-
children: "Theme"
|
|
813
|
-
}), /* @__PURE__ */ y("div", {
|
|
814
|
-
className: "flex items-center gap-2 mt-1",
|
|
815
|
-
children: [/* @__PURE__ */ v("div", {
|
|
816
|
-
className: "w-6 h-6 rounded border border-border-subtle",
|
|
817
|
-
style: { backgroundColor: $.primaryColor }
|
|
818
|
-
}), /* @__PURE__ */ v("span", {
|
|
819
|
-
className: "font-mono text-sm",
|
|
820
|
-
children: $.primaryColor
|
|
821
|
-
})]
|
|
822
|
-
})] }),
|
|
823
|
-
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
824
|
-
className: "text-sm text-text-secondary",
|
|
825
|
-
children: "Font Family"
|
|
826
|
-
}), /* @__PURE__ */ v("p", {
|
|
827
|
-
className: "font-medium",
|
|
828
|
-
children: $.fontFamily
|
|
829
|
-
})] })
|
|
830
|
-
]
|
|
831
|
-
}), $.starterPrompts.length > 0 && /* @__PURE__ */ y("div", {
|
|
832
|
-
className: "mt-4 pt-4 border-t border-border-subtle",
|
|
833
|
-
children: [/* @__PURE__ */ v("p", {
|
|
834
|
-
className: "text-sm text-text-secondary mb-2",
|
|
835
|
-
children: "Starter Prompts"
|
|
836
|
-
}), /* @__PURE__ */ v("div", {
|
|
837
|
-
className: "flex flex-wrap gap-2",
|
|
838
|
-
children: $.starterPrompts.map((e, t) => /* @__PURE__ */ v(h, {
|
|
839
|
-
variant: "secondary",
|
|
840
|
-
children: e
|
|
841
|
-
}, t))
|
|
687
|
+
j.unroutedMessageCount > 0 && /* @__PURE__ */ x("div", {
|
|
688
|
+
role: "status",
|
|
689
|
+
className: "flex items-start gap-3 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle p-4 text-sm",
|
|
690
|
+
children: [/* @__PURE__ */ b(Ye, {
|
|
691
|
+
size: 18,
|
|
692
|
+
"aria-hidden": "true",
|
|
693
|
+
className: "mt-0.5 shrink-0 text-status-warning-text"
|
|
694
|
+
}), /* @__PURE__ */ b("p", {
|
|
695
|
+
className: "text-text-primary",
|
|
696
|
+
children: C("botlit.channelDetail.unroutedHint", "Some messages on this channel got no answer: no route matched their location, the route was turned off, or its bot was not active. Add or turn on a route, or activate the bot.")
|
|
842
697
|
})]
|
|
843
|
-
})] })] }),
|
|
844
|
-
Ct && /* @__PURE__ */ v(ae, {
|
|
845
|
-
channel: wt,
|
|
846
|
-
loading: Tt,
|
|
847
|
-
error: Et,
|
|
848
|
-
connectorActive: A.status === "ACTIVE",
|
|
849
|
-
workspaceId: it,
|
|
850
|
-
hint: se[A.type]?.inboundHint,
|
|
851
|
-
onRefresh: () => void Dt()
|
|
852
698
|
}),
|
|
853
|
-
|
|
854
|
-
className: "flex
|
|
855
|
-
children: [/* @__PURE__ */
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
children: "Add Route"
|
|
863
|
-
})
|
|
699
|
+
$ === "WEB_WIDGET" && /* @__PURE__ */ x("div", {
|
|
700
|
+
className: "flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-sunken p-4 text-sm",
|
|
701
|
+
children: [/* @__PURE__ */ b(Ye, {
|
|
702
|
+
size: 18,
|
|
703
|
+
"aria-hidden": "true",
|
|
704
|
+
className: "mt-0.5 shrink-0 text-text-secondary"
|
|
705
|
+
}), /* @__PURE__ */ b("p", {
|
|
706
|
+
className: "text-text-secondary",
|
|
707
|
+
children: C("botlit.channelDetail.webWidget.note", "To put an assistant on your website, publish it from the agent: open the agent and use its Website panel, which sets the allowed sites and gives you the embed code.")
|
|
864
708
|
})]
|
|
865
|
-
}),
|
|
709
|
+
}),
|
|
710
|
+
Nt && /* @__PURE__ */ b(le, {
|
|
711
|
+
channel: Pt,
|
|
712
|
+
loading: Ft,
|
|
713
|
+
error: It,
|
|
714
|
+
connectorActive: j.status === "ACTIVE",
|
|
715
|
+
workspaceId: mt,
|
|
716
|
+
hint: ye[j.type]?.inboundHint,
|
|
717
|
+
onRefresh: () => void Lt()
|
|
718
|
+
}),
|
|
719
|
+
/* @__PURE__ */ x(c, { children: [/* @__PURE__ */ b(d, {
|
|
720
|
+
className: "flex flex-row items-center justify-between",
|
|
721
|
+
children: /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b(f, { children: C("botlit.channelDetail.routes.title", "Routes") }), /* @__PURE__ */ b(u, { children: C("botlit.channelDetail.routes.description", "Routes connect this channel to your bots. A route that is off is ignored.") })] })
|
|
722
|
+
}), /* @__PURE__ */ b(l, { children: P ? /* @__PURE__ */ b(oe, {
|
|
723
|
+
resource: C("botlit.channelRoutes.resource", "channel routes"),
|
|
724
|
+
error: P,
|
|
725
|
+
onRetry: () => void F()
|
|
726
|
+
}) : N.length > 0 ? /* @__PURE__ */ b("ul", {
|
|
866
727
|
className: "space-y-3",
|
|
867
|
-
children:
|
|
868
|
-
className: "flex items-center justify-between p-4 border border-border-subtle rounded-lg",
|
|
869
|
-
children: [/* @__PURE__ */
|
|
728
|
+
children: N.map((e) => /* @__PURE__ */ x("li", {
|
|
729
|
+
className: "flex flex-wrap items-center justify-between gap-3 p-4 border border-border-subtle rounded-lg",
|
|
730
|
+
children: [/* @__PURE__ */ x("div", {
|
|
870
731
|
className: "flex items-center gap-4",
|
|
871
|
-
children: [/* @__PURE__ */
|
|
732
|
+
children: [/* @__PURE__ */ b("div", {
|
|
872
733
|
className: "p-2 rounded-lg bg-bg-sunken",
|
|
873
|
-
children: /* @__PURE__ */
|
|
734
|
+
children: /* @__PURE__ */ b(Ze, {
|
|
874
735
|
size: 18,
|
|
875
736
|
className: "text-text-secondary"
|
|
876
737
|
})
|
|
877
|
-
}), /* @__PURE__ */
|
|
878
|
-
className: "font-medium",
|
|
879
|
-
children:
|
|
880
|
-
|
|
738
|
+
}), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("p", {
|
|
739
|
+
className: "flex items-center gap-2 font-medium",
|
|
740
|
+
children: [de(e, "locationName") ?? e.locationId, /* @__PURE__ */ b(re, {
|
|
741
|
+
variant: e.isActive ? "success" : "outline",
|
|
742
|
+
children: e.isActive ? C("botlit.channelRoutes.status.on", "On") : C("botlit.channelRoutes.status.off", "Off")
|
|
743
|
+
})]
|
|
744
|
+
}), /* @__PURE__ */ b("p", {
|
|
881
745
|
className: "text-sm text-text-secondary",
|
|
882
|
-
children:
|
|
746
|
+
children: C("botlit.channelDetail.routes.connectedTo", "Connected to: {{bot}}", { bot: kn(e) })
|
|
883
747
|
})] })]
|
|
884
|
-
}), /* @__PURE__ */
|
|
885
|
-
|
|
886
|
-
children:
|
|
748
|
+
}), /* @__PURE__ */ b(s, {
|
|
749
|
+
permission: o.CHANNEL_UPDATE,
|
|
750
|
+
children: /* @__PURE__ */ b(p, {
|
|
887
751
|
variant: "outline",
|
|
888
|
-
children: ["Rev ", e.revision]
|
|
889
|
-
}), /* @__PURE__ */ v(d, {
|
|
890
|
-
variant: "ghost",
|
|
891
752
|
size: "sm",
|
|
892
|
-
|
|
893
|
-
|
|
753
|
+
leftIcon: e.isActive ? /* @__PURE__ */ b(et, { size: 14 }) : /* @__PURE__ */ b($e, { size: 14 }),
|
|
754
|
+
isLoading: tn === e.id,
|
|
755
|
+
onClick: () => void wn(e),
|
|
756
|
+
children: e.isActive ? C("botlit.channelRoutes.actions.turnOff", "Turn off") : C("botlit.channelRoutes.actions.turnOn", "Turn on")
|
|
757
|
+
})
|
|
894
758
|
})]
|
|
895
759
|
}, e.id))
|
|
896
|
-
}) : /* @__PURE__ */
|
|
760
|
+
}) : /* @__PURE__ */ b(ae, {
|
|
897
761
|
illustration: "empty-data",
|
|
898
|
-
title: "No routes configured",
|
|
899
|
-
description: "Add a route to connect this channel to a bot.",
|
|
900
|
-
action: /* @__PURE__ */
|
|
901
|
-
permission:
|
|
902
|
-
children: /* @__PURE__ */
|
|
903
|
-
leftIcon: /* @__PURE__ */
|
|
904
|
-
onClick: () =>
|
|
905
|
-
children: "Add Route"
|
|
762
|
+
title: C("botlit.channels.empty.routes.title", "No routes configured"),
|
|
763
|
+
description: C("botlit.channelDetail.routes.emptyDescription", "Add a route to connect this channel to a bot."),
|
|
764
|
+
action: /* @__PURE__ */ b(s, {
|
|
765
|
+
permission: o.CHANNEL_CREATE,
|
|
766
|
+
children: /* @__PURE__ */ b(p, {
|
|
767
|
+
leftIcon: /* @__PURE__ */ b(Qe, { size: 16 }),
|
|
768
|
+
onClick: () => V(!0),
|
|
769
|
+
children: C("botlit.channelDetail.routes.add", "Add Route")
|
|
906
770
|
})
|
|
907
771
|
})
|
|
908
772
|
}) })] }),
|
|
909
|
-
|
|
773
|
+
/* @__PURE__ */ b(se, {
|
|
774
|
+
open: en,
|
|
775
|
+
onOpenChange: V,
|
|
776
|
+
connectorId: j.id,
|
|
777
|
+
onCreated: () => void F()
|
|
778
|
+
}),
|
|
779
|
+
j.type === "SLACK" && j.credentialsRefId && /* @__PURE__ */ x(c, { children: [/* @__PURE__ */ x(d, { children: [/* @__PURE__ */ x(f, {
|
|
910
780
|
className: "flex items-center gap-2",
|
|
911
|
-
children: [/* @__PURE__ */
|
|
912
|
-
}), /* @__PURE__ */
|
|
781
|
+
children: [/* @__PURE__ */ b(w, { size: 18 }), C("botlit.channelDetail.slack.title", "Your Slack Account")]
|
|
782
|
+
}), /* @__PURE__ */ b(u, { children: C("botlit.channelDetail.slack.description", "Connect your personal Slack account to receive direct messages from this bot") })] }), /* @__PURE__ */ x(l, { children: [qt && /* @__PURE__ */ x("div", {
|
|
783
|
+
role: "alert",
|
|
913
784
|
className: "mb-4 flex items-start gap-2 rounded-lg border border-status-error-border/40 bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text",
|
|
914
|
-
children: [/* @__PURE__ */
|
|
915
|
-
|
|
785
|
+
children: [/* @__PURE__ */ b("span", { children: qt }), /* @__PURE__ */ b("button", {
|
|
786
|
+
type: "button",
|
|
787
|
+
"aria-label": C("botlit.common.dismiss", "Dismiss"),
|
|
788
|
+
onClick: () => Jt(null),
|
|
916
789
|
className: "ml-auto cursor-pointer text-status-error-text/70 hover:text-status-error-text",
|
|
917
|
-
children: /* @__PURE__ */
|
|
790
|
+
children: /* @__PURE__ */ b(st, { size: 14 })
|
|
918
791
|
})]
|
|
919
|
-
}),
|
|
792
|
+
}), Ht ? /* @__PURE__ */ x("div", {
|
|
920
793
|
className: "flex items-center gap-2 py-4 text-text-secondary",
|
|
921
|
-
children: [/* @__PURE__ */
|
|
794
|
+
children: [/* @__PURE__ */ b(Xe, {
|
|
922
795
|
size: 16,
|
|
923
796
|
className: "animate-spin"
|
|
924
|
-
}), /* @__PURE__ */
|
|
797
|
+
}), /* @__PURE__ */ b("span", {
|
|
925
798
|
className: "text-sm",
|
|
926
|
-
children: "Linking Slack connection..."
|
|
799
|
+
children: C("botlit.channelDetail.slack.linking", "Linking Slack connection...")
|
|
927
800
|
})]
|
|
928
|
-
}) :
|
|
801
|
+
}) : zt ? /* @__PURE__ */ x("div", {
|
|
929
802
|
className: "flex items-center gap-2 py-4 text-text-secondary",
|
|
930
|
-
children: [/* @__PURE__ */
|
|
803
|
+
children: [/* @__PURE__ */ b(Xe, {
|
|
931
804
|
size: 16,
|
|
932
805
|
className: "animate-spin"
|
|
933
|
-
}), /* @__PURE__ */
|
|
806
|
+
}), /* @__PURE__ */ b("span", {
|
|
934
807
|
className: "text-sm",
|
|
935
|
-
children: "Checking connection..."
|
|
808
|
+
children: C("botlit.channelDetail.slack.checking", "Checking connection...")
|
|
936
809
|
})]
|
|
937
|
-
}) :
|
|
810
|
+
}) : R && R.dmAllowed ? /* @__PURE__ */ x("div", {
|
|
938
811
|
className: "space-y-4",
|
|
939
812
|
children: [
|
|
940
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ x("div", {
|
|
941
814
|
className: "flex items-center gap-3 p-3 rounded-lg bg-bg-sunken",
|
|
942
815
|
children: [
|
|
943
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ b(qe, {
|
|
944
817
|
size: 20,
|
|
945
818
|
className: "text-status-success-text shrink-0"
|
|
946
819
|
}),
|
|
947
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ x("div", {
|
|
948
821
|
className: "min-w-0 flex-1",
|
|
949
822
|
children: [
|
|
950
|
-
/* @__PURE__ */
|
|
823
|
+
/* @__PURE__ */ b("p", {
|
|
951
824
|
className: "font-medium text-sm",
|
|
952
|
-
children:
|
|
825
|
+
children: R.externalDisplayName || R.externalUsername || R.externalUserId
|
|
953
826
|
}),
|
|
954
|
-
|
|
827
|
+
R.externalUsername && R.externalDisplayName && /* @__PURE__ */ x("p", {
|
|
955
828
|
className: "text-xs text-text-secondary",
|
|
956
|
-
children: ["@",
|
|
829
|
+
children: ["@", R.externalUsername]
|
|
957
830
|
}),
|
|
958
|
-
|
|
831
|
+
R.connectedAt && /* @__PURE__ */ b("p", {
|
|
959
832
|
className: "text-xs text-text-secondary",
|
|
960
|
-
children:
|
|
833
|
+
children: C("botlit.channelDetail.slack.connectedOn", "Connected {{date}}", { date: new Date(R.connectedAt).toLocaleDateString() })
|
|
961
834
|
})
|
|
962
835
|
]
|
|
963
836
|
}),
|
|
964
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ b("div", {
|
|
965
838
|
className: "flex items-center gap-1",
|
|
966
|
-
children:
|
|
839
|
+
children: R.isTokenExpired && /* @__PURE__ */ b(re, {
|
|
967
840
|
variant: "outline",
|
|
968
841
|
className: "text-xs text-status-warning-text border-status-warning-border",
|
|
969
|
-
children: "Token expired"
|
|
842
|
+
children: C("botlit.channelDetail.slack.tokenExpired", "Token expired")
|
|
970
843
|
})
|
|
971
844
|
})
|
|
972
845
|
]
|
|
973
846
|
}),
|
|
974
|
-
/* @__PURE__ */
|
|
847
|
+
/* @__PURE__ */ x("div", {
|
|
975
848
|
className: "flex items-center justify-between p-3 border border-border-subtle rounded-lg",
|
|
976
|
-
children: [/* @__PURE__ */
|
|
849
|
+
children: [/* @__PURE__ */ x("div", {
|
|
977
850
|
className: "flex items-center gap-2",
|
|
978
|
-
children: [
|
|
851
|
+
children: [R.notificationsEnabled ? /* @__PURE__ */ b(Ge, {
|
|
979
852
|
size: 16,
|
|
980
853
|
className: "text-primary"
|
|
981
|
-
}) : /* @__PURE__ */
|
|
854
|
+
}) : /* @__PURE__ */ b(Ke, {
|
|
982
855
|
size: 16,
|
|
983
856
|
className: "text-text-secondary"
|
|
984
|
-
}), /* @__PURE__ */
|
|
857
|
+
}), /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
985
858
|
className: "text-sm font-medium",
|
|
986
|
-
children: "DM Notifications"
|
|
987
|
-
}), /* @__PURE__ */
|
|
859
|
+
children: C("botlit.channelDetail.slack.notifications", "DM Notifications")
|
|
860
|
+
}), /* @__PURE__ */ b("p", {
|
|
988
861
|
className: "text-xs text-text-secondary",
|
|
989
|
-
children:
|
|
862
|
+
children: R.notificationsEnabled ? C("botlit.channelDetail.slack.notificationsOn", "You will receive bot DMs") : C("botlit.channelDetail.slack.notificationsOff", "DM notifications are paused")
|
|
990
863
|
})] })]
|
|
991
|
-
}), /* @__PURE__ */
|
|
864
|
+
}), /* @__PURE__ */ b(p, {
|
|
992
865
|
variant: "outline",
|
|
993
866
|
size: "sm",
|
|
994
|
-
onClick:
|
|
995
|
-
isLoading:
|
|
996
|
-
children:
|
|
867
|
+
onClick: () => void Zt(),
|
|
868
|
+
isLoading: Wt,
|
|
869
|
+
children: R.notificationsEnabled ? C("botlit.common.disable", "Disable") : C("botlit.common.enable", "Enable")
|
|
997
870
|
})]
|
|
998
871
|
}),
|
|
999
|
-
/* @__PURE__ */
|
|
872
|
+
/* @__PURE__ */ x("div", {
|
|
1000
873
|
className: "flex gap-2 justify-end pt-2",
|
|
1001
|
-
children: [
|
|
874
|
+
children: [R.isTokenExpired && /* @__PURE__ */ b(p, {
|
|
1002
875
|
variant: "outline",
|
|
1003
876
|
size: "sm",
|
|
1004
|
-
leftIcon: /* @__PURE__ */
|
|
1005
|
-
onClick:
|
|
1006
|
-
children: "Reconnect"
|
|
1007
|
-
}), /* @__PURE__ */
|
|
877
|
+
leftIcon: /* @__PURE__ */ b(w, { size: 14 }),
|
|
878
|
+
onClick: Xt,
|
|
879
|
+
children: C("botlit.channelDetail.slack.reconnect", "Reconnect")
|
|
880
|
+
}), /* @__PURE__ */ b(p, {
|
|
1008
881
|
variant: "destructive",
|
|
1009
882
|
size: "sm",
|
|
1010
|
-
leftIcon: /* @__PURE__ */
|
|
1011
|
-
onClick:
|
|
1012
|
-
isLoading:
|
|
1013
|
-
children: "Disconnect"
|
|
883
|
+
leftIcon: /* @__PURE__ */ b(ot, { size: 14 }),
|
|
884
|
+
onClick: () => void Qt(),
|
|
885
|
+
isLoading: Kt,
|
|
886
|
+
children: C("botlit.channelDetail.slack.disconnect", "Disconnect")
|
|
1014
887
|
})]
|
|
1015
888
|
})
|
|
1016
889
|
]
|
|
1017
|
-
}) : /* @__PURE__ */
|
|
890
|
+
}) : /* @__PURE__ */ x("div", {
|
|
1018
891
|
className: "flex flex-col items-center gap-4 py-8 text-center",
|
|
1019
892
|
children: [
|
|
1020
|
-
/* @__PURE__ */
|
|
893
|
+
/* @__PURE__ */ b("div", {
|
|
1021
894
|
className: "p-4 rounded-full bg-bg-sunken",
|
|
1022
|
-
children: /* @__PURE__ */
|
|
895
|
+
children: /* @__PURE__ */ b(w, {
|
|
1023
896
|
size: 32,
|
|
1024
897
|
className: "text-text-secondary"
|
|
1025
898
|
})
|
|
1026
899
|
}),
|
|
1027
|
-
/* @__PURE__ */
|
|
900
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
|
|
1028
901
|
className: "font-medium",
|
|
1029
|
-
children: "No personal account connected"
|
|
1030
|
-
}), /* @__PURE__ */
|
|
902
|
+
children: C("botlit.channelDetail.slack.notConnected", "No personal account connected")
|
|
903
|
+
}), /* @__PURE__ */ b("p", {
|
|
1031
904
|
className: "text-sm text-text-secondary mt-1",
|
|
1032
|
-
children: "Connect your Slack account so the bot can send you direct messages"
|
|
905
|
+
children: C("botlit.channelDetail.slack.notConnectedHint", "Connect your Slack account so the bot can send you direct messages")
|
|
1033
906
|
})] }),
|
|
1034
|
-
/* @__PURE__ */
|
|
1035
|
-
leftIcon: /* @__PURE__ */
|
|
1036
|
-
onClick:
|
|
1037
|
-
children: "Connect with Slack"
|
|
907
|
+
/* @__PURE__ */ b(p, {
|
|
908
|
+
leftIcon: /* @__PURE__ */ b(w, { size: 16 }),
|
|
909
|
+
onClick: Xt,
|
|
910
|
+
children: C("botlit.channelDetail.slack.connect", "Connect with Slack")
|
|
1038
911
|
})
|
|
1039
912
|
]
|
|
1040
913
|
})] })] }),
|
|
1041
|
-
|
|
914
|
+
j.defaultPolicyBindings && /* @__PURE__ */ x(c, { children: [/* @__PURE__ */ x(d, { children: [/* @__PURE__ */ x(f, {
|
|
1042
915
|
className: "flex items-center gap-2",
|
|
1043
|
-
children: [/* @__PURE__ */
|
|
1044
|
-
}), /* @__PURE__ */
|
|
916
|
+
children: [/* @__PURE__ */ b(it, { size: 18 }), C("botlit.channelDetail.policies.title", "Default Policy Bindings")]
|
|
917
|
+
}), /* @__PURE__ */ b(u, { children: C("botlit.channelDetail.policies.description", "Default policies applied to all routes on this connector") })] }), /* @__PURE__ */ b(l, { children: /* @__PURE__ */ b("div", {
|
|
1045
918
|
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
1046
|
-
children: Object.entries(
|
|
919
|
+
children: Object.entries(j.defaultPolicyBindings).map(([e, t]) => t ? /* @__PURE__ */ x("div", {
|
|
1047
920
|
className: "p-3 bg-bg-sunken rounded-lg",
|
|
1048
|
-
children: [/* @__PURE__ */
|
|
921
|
+
children: [/* @__PURE__ */ b("p", {
|
|
1049
922
|
className: "text-xs text-text-secondary capitalize",
|
|
1050
923
|
children: e.replace("PolicyId", "").replace(/([A-Z])/g, " $1")
|
|
1051
|
-
}), /* @__PURE__ */
|
|
924
|
+
}), /* @__PURE__ */ b("p", {
|
|
1052
925
|
className: "font-medium text-sm truncate",
|
|
1053
926
|
children: String(t)
|
|
1054
927
|
})]
|
|
1055
928
|
}, e) : null)
|
|
1056
929
|
}) })] }),
|
|
1057
|
-
/* @__PURE__ */
|
|
930
|
+
/* @__PURE__ */ x(c, { children: [/* @__PURE__ */ b(d, { children: /* @__PURE__ */ x(f, {
|
|
1058
931
|
className: "flex items-center gap-2",
|
|
1059
|
-
children: [/* @__PURE__ */
|
|
1060
|
-
}) }), /* @__PURE__ */
|
|
932
|
+
children: [/* @__PURE__ */ b(rt, { size: 18 }), C("botlit.channelDetail.metadata.title", "Details")]
|
|
933
|
+
}) }), /* @__PURE__ */ b(l, { children: /* @__PURE__ */ x("dl", {
|
|
1061
934
|
className: "grid grid-cols-2 md:grid-cols-4 gap-6 text-sm",
|
|
1062
935
|
children: [
|
|
1063
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
1064
937
|
className: "text-text-secondary",
|
|
1065
|
-
children: "Created"
|
|
1066
|
-
}), /* @__PURE__ */
|
|
938
|
+
children: C("botlit.channelDetail.metadata.created", "Created")
|
|
939
|
+
}), /* @__PURE__ */ b("dd", {
|
|
1067
940
|
className: "font-medium",
|
|
1068
|
-
children:
|
|
941
|
+
children: h(j.createdAt)
|
|
1069
942
|
})] }),
|
|
1070
|
-
/* @__PURE__ */
|
|
943
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
1071
944
|
className: "text-text-secondary",
|
|
1072
|
-
children: "Updated"
|
|
1073
|
-
}), /* @__PURE__ */
|
|
945
|
+
children: C("botlit.channelDetail.metadata.updated", "Updated")
|
|
946
|
+
}), /* @__PURE__ */ b("dd", {
|
|
1074
947
|
className: "font-medium",
|
|
1075
|
-
children:
|
|
948
|
+
children: h(j.updatedAt)
|
|
1076
949
|
})] }),
|
|
1077
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
1078
951
|
className: "text-text-secondary",
|
|
1079
|
-
children: "Linked channel"
|
|
1080
|
-
}), /* @__PURE__ */
|
|
952
|
+
children: C("botlit.channelDetail.metadata.linkedChannel", "Linked channel")
|
|
953
|
+
}), /* @__PURE__ */ b("dd", {
|
|
1081
954
|
className: "font-medium break-all",
|
|
1082
|
-
children:
|
|
955
|
+
children: Pt?.name ?? j.credentialsRefId ?? C("botlit.channelDetail.metadata.notConfigured", "Not configured")
|
|
1083
956
|
})] }),
|
|
1084
|
-
/* @__PURE__ */
|
|
957
|
+
/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("dt", {
|
|
1085
958
|
className: "text-text-secondary",
|
|
1086
|
-
children: "
|
|
1087
|
-
}), /* @__PURE__ */
|
|
1088
|
-
className: "
|
|
1089
|
-
children:
|
|
1090
|
-
variant: "secondary",
|
|
1091
|
-
className: "text-xs",
|
|
1092
|
-
children: e
|
|
1093
|
-
}, e)) : /* @__PURE__ */ v("span", {
|
|
1094
|
-
className: "text-text-secondary",
|
|
1095
|
-
children: "None"
|
|
1096
|
-
})
|
|
959
|
+
children: C("botlit.channelDetail.metadata.revision", "Revision")
|
|
960
|
+
}), /* @__PURE__ */ b("dd", {
|
|
961
|
+
className: "font-medium tabular-nums",
|
|
962
|
+
children: j.revision
|
|
1097
963
|
})] })
|
|
1098
964
|
]
|
|
1099
965
|
}) })] })
|