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