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