@burdenoff/microfe-botmanor 2026.813.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/botlit/BotlitRoutes.js +357 -0
- package/dist/botlit/BotlitRoutes.js.map +1 -0
- package/dist/botlit/BotmanorRoot.js +12 -0
- package/dist/botlit/BotmanorRoot.js.map +1 -0
- package/dist/botlit/BotmanorRootInner.js +101 -0
- package/dist/botlit/BotmanorRootInner.js.map +1 -0
- package/dist/botlit/components/Badge.js +39 -0
- package/dist/botlit/components/Badge.js.map +1 -0
- package/dist/botlit/components/Button.js +46 -0
- package/dist/botlit/components/Button.js.map +1 -0
- package/dist/botlit/components/Card.js +31 -0
- package/dist/botlit/components/Card.js.map +1 -0
- package/dist/botlit/components/ChannelSelectorSheet.js +130 -0
- package/dist/botlit/components/ChannelSelectorSheet.js.map +1 -0
- package/dist/botlit/components/EmptyState.js +35 -0
- package/dist/botlit/components/EmptyState.js.map +1 -0
- package/dist/botlit/components/ErrorState.js +33 -0
- package/dist/botlit/components/ErrorState.js.map +1 -0
- package/dist/botlit/components/Input.js +59 -0
- package/dist/botlit/components/Input.js.map +1 -0
- package/dist/botlit/components/PageLayout.js +34 -0
- package/dist/botlit/components/PageLayout.js.map +1 -0
- package/dist/botlit/components/QuotaExhaustedDialog.js +20 -0
- package/dist/botlit/components/QuotaExhaustedDialog.js.map +1 -0
- package/dist/botlit/components/RouteLoader.js +52 -0
- package/dist/botlit/components/RouteLoader.js.map +1 -0
- package/dist/botlit/components/VersionHistoryPanel.js +144 -0
- package/dist/botlit/components/VersionHistoryPanel.js.map +1 -0
- package/dist/botlit/components/WorkspaceRequired.js +70 -0
- package/dist/botlit/components/WorkspaceRequired.js.map +1 -0
- package/dist/botlit/hooks/index.js +16 -0
- package/dist/botlit/hooks/internal/mutationInput.js +16 -0
- package/dist/botlit/hooks/internal/mutationInput.js.map +1 -0
- package/dist/botlit/hooks/internal/workspaceGateway.js +99 -0
- package/dist/botlit/hooks/internal/workspaceGateway.js.map +1 -0
- package/dist/botlit/hooks/useA2A.js +184 -0
- package/dist/botlit/hooks/useA2A.js.map +1 -0
- package/dist/botlit/hooks/useAgents.js +469 -0
- package/dist/botlit/hooks/useAgents.js.map +1 -0
- package/dist/botlit/hooks/useBots.js +306 -0
- package/dist/botlit/hooks/useBots.js.map +1 -0
- package/dist/botlit/hooks/useBuckets.js +119 -0
- package/dist/botlit/hooks/useBuckets.js.map +1 -0
- package/dist/botlit/hooks/useChannels.js +213 -0
- package/dist/botlit/hooks/useChannels.js.map +1 -0
- package/dist/botlit/hooks/useConversations.js +64 -0
- package/dist/botlit/hooks/useConversations.js.map +1 -0
- package/dist/botlit/hooks/useExecutions.js +86 -0
- package/dist/botlit/hooks/useExecutions.js.map +1 -0
- package/dist/botlit/hooks/useKnowledgeBases.js +113 -0
- package/dist/botlit/hooks/useKnowledgeBases.js.map +1 -0
- package/dist/botlit/hooks/useLLMProviders.js +83 -0
- package/dist/botlit/hooks/useLLMProviders.js.map +1 -0
- package/dist/botlit/hooks/useMCPServers.js +134 -0
- package/dist/botlit/hooks/useMCPServers.js.map +1 -0
- package/dist/botlit/hooks/usePolicies.js +120 -0
- package/dist/botlit/hooks/usePolicies.js.map +1 -0
- package/dist/botlit/hooks/usePromptTemplates.js +161 -0
- package/dist/botlit/hooks/usePromptTemplates.js.map +1 -0
- package/dist/botlit/hooks/useRetrievalProfiles.js +146 -0
- package/dist/botlit/hooks/useRetrievalProfiles.js.map +1 -0
- package/dist/botlit/hooks/useSkills.js +132 -0
- package/dist/botlit/hooks/useSkills.js.map +1 -0
- package/dist/botlit/hooks/useStore.js +167 -0
- package/dist/botlit/hooks/useStore.js.map +1 -0
- package/dist/botlit/hooks/useUserPlatformConnection.js +172 -0
- package/dist/botlit/hooks/useUserPlatformConnection.js.map +1 -0
- package/dist/botlit/index.js +11 -0
- package/dist/botlit/pages/A2AAgentDetailPage.js +589 -0
- package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -0
- package/dist/botlit/pages/A2ARegistryPage.js +240 -0
- package/dist/botlit/pages/A2ARegistryPage.js.map +1 -0
- package/dist/botlit/pages/AgentBuilderPage.js +486 -0
- package/dist/botlit/pages/AgentBuilderPage.js.map +1 -0
- package/dist/botlit/pages/AgentDetailPage.js +517 -0
- package/dist/botlit/pages/AgentDetailPage.js.map +1 -0
- package/dist/botlit/pages/AgentsListPage.js +294 -0
- package/dist/botlit/pages/AgentsListPage.js.map +1 -0
- package/dist/botlit/pages/BotChannelsTab.js +530 -0
- package/dist/botlit/pages/BotChannelsTab.js.map +1 -0
- package/dist/botlit/pages/BotDetailPage.js +872 -0
- package/dist/botlit/pages/BotDetailPage.js.map +1 -0
- package/dist/botlit/pages/BotWorkflowTab.js +229 -0
- package/dist/botlit/pages/BotWorkflowTab.js.map +1 -0
- package/dist/botlit/pages/BotsListPage.js +313 -0
- package/dist/botlit/pages/BotsListPage.js.map +1 -0
- package/dist/botlit/pages/BucketsPage.js +604 -0
- package/dist/botlit/pages/BucketsPage.js.map +1 -0
- package/dist/botlit/pages/ChannelDetailPage.js +955 -0
- package/dist/botlit/pages/ChannelDetailPage.js.map +1 -0
- package/dist/botlit/pages/ChannelRoutesPage.js +218 -0
- package/dist/botlit/pages/ChannelRoutesPage.js.map +1 -0
- package/dist/botlit/pages/ChannelsPage.js +304 -0
- package/dist/botlit/pages/ChannelsPage.js.map +1 -0
- package/dist/botlit/pages/ChatPage.js +247 -0
- package/dist/botlit/pages/ChatPage.js.map +1 -0
- package/dist/botlit/pages/DashboardPage.js +318 -0
- package/dist/botlit/pages/DashboardPage.js.map +1 -0
- package/dist/botlit/pages/ExecutionDetailPage.js +313 -0
- package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -0
- package/dist/botlit/pages/ExecutionsPage.js +294 -0
- package/dist/botlit/pages/ExecutionsPage.js.map +1 -0
- package/dist/botlit/pages/InstalledPackagesPage.js +619 -0
- package/dist/botlit/pages/InstalledPackagesPage.js.map +1 -0
- package/dist/botlit/pages/KnowledgeBaseDetailPage.js +473 -0
- package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -0
- package/dist/botlit/pages/KnowledgeBasesPage.js +150 -0
- package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -0
- package/dist/botlit/pages/MCPServerDetailPage.js +550 -0
- package/dist/botlit/pages/MCPServerDetailPage.js.map +1 -0
- package/dist/botlit/pages/MCPServersPage.js +321 -0
- package/dist/botlit/pages/MCPServersPage.js.map +1 -0
- package/dist/botlit/pages/PoliciesPage.js +224 -0
- package/dist/botlit/pages/PoliciesPage.js.map +1 -0
- package/dist/botlit/pages/PolicyDetailPage.js +861 -0
- package/dist/botlit/pages/PolicyDetailPage.js.map +1 -0
- package/dist/botlit/pages/PromptStudioPage.js +236 -0
- package/dist/botlit/pages/PromptStudioPage.js.map +1 -0
- package/dist/botlit/pages/PromptTemplateDetailPage.js +812 -0
- package/dist/botlit/pages/PromptTemplateDetailPage.js.map +1 -0
- package/dist/botlit/pages/PromptTemplatesPage.js +269 -0
- package/dist/botlit/pages/PromptTemplatesPage.js.map +1 -0
- package/dist/botlit/pages/RetrievalProfileDetailPage.js +559 -0
- package/dist/botlit/pages/RetrievalProfileDetailPage.js.map +1 -0
- package/dist/botlit/pages/RetrievalProfilesPage.js +219 -0
- package/dist/botlit/pages/RetrievalProfilesPage.js.map +1 -0
- package/dist/botlit/pages/SettingsPage.js +655 -0
- package/dist/botlit/pages/SettingsPage.js.map +1 -0
- package/dist/botlit/pages/SkillDetailPage.js +778 -0
- package/dist/botlit/pages/SkillDetailPage.js.map +1 -0
- package/dist/botlit/pages/SkillsPage.js +206 -0
- package/dist/botlit/pages/SkillsPage.js.map +1 -0
- package/dist/botlit/pages/StorePackageDetailPage.js +462 -0
- package/dist/botlit/pages/StorePackageDetailPage.js.map +1 -0
- package/dist/botlit/pages/StorePage.js +315 -0
- package/dist/botlit/pages/StorePage.js.map +1 -0
- package/dist/botlit/providers/BotlitProvider.js +93 -0
- package/dist/botlit/providers/BotlitProvider.js.map +1 -0
- package/dist/botlit/store/botlitStore.js +101 -0
- package/dist/botlit/store/botlitStore.js.map +1 -0
- package/dist/botlit/utils/cn.js +10 -0
- package/dist/botlit/utils/cn.js.map +1 -0
- package/dist/botlit/utils/formatters.js +37 -0
- package/dist/botlit/utils/formatters.js.map +1 -0
- package/dist/botlit/utils/navigation.js +9 -0
- package/dist/botlit/utils/navigation.js.map +1 -0
- package/dist/botlit/utils/unions.js +14 -0
- package/dist/botlit/utils/unions.js.map +1 -0
- package/dist/generated/global-operations.js +66 -0
- package/dist/generated/global-operations.js.map +1 -0
- package/dist/generated/global-types.js +8 -0
- package/dist/generated/global-types.js.map +1 -0
- package/dist/generated/wspace-operations.js +1591 -0
- package/dist/generated/wspace-operations.js.map +1 -0
- package/dist/generated/wspace-types.js +12 -0
- package/dist/generated/wspace-types.js.map +1 -0
- package/dist/index.js +13 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/package.json +133 -0
|
@@ -0,0 +1,955 @@
|
|
|
1
|
+
import { useBotlit as e } from "../providers/BotlitProvider.js";
|
|
2
|
+
import { useBots as t } from "../hooks/useBots.js";
|
|
3
|
+
import { formatRelativeTime as n } from "../utils/formatters.js";
|
|
4
|
+
import { PageLayout as r } from "../components/PageLayout.js";
|
|
5
|
+
import { Card as i, CardContent as a, CardDescription as o, CardHeader as s, CardTitle as c } from "../components/Card.js";
|
|
6
|
+
import { Button as l } from "../components/Button.js";
|
|
7
|
+
import { Badge as u, StatusBadge as ee } from "../components/Badge.js";
|
|
8
|
+
import { isNative as te, nativeImpact as ne, nativeNotify as re } from "../../utils/nativeBridge.js";
|
|
9
|
+
import { EmptyState as d } from "../components/EmptyState.js";
|
|
10
|
+
import { FormField as f, Input as p, Textarea as m } from "../components/Input.js";
|
|
11
|
+
import { WIDGET_METADATA_KEY as ie, readWidgetConfig as h, routeMetadataString as g, useChannelConnector as ae, useChannelRoutes as oe, useCreateChannelConnector as se, useCreateChannelRoute as ce, useDeleteChannelConnector as le, useUpdateChannelConnector as ue } from "../hooks/useChannels.js";
|
|
12
|
+
import { toUnion as _ } from "../utils/unions.js";
|
|
13
|
+
import { useInitiateSlackConnect as de, useLinkIntegrationConnection as fe, useMyUserPlatformConnection as pe, useRevokeSlackConnection as me, useToggleSlackNotifications as he } from "../hooks/useUserPlatformConnection.js";
|
|
14
|
+
import "../hooks/index.js";
|
|
15
|
+
import { useEffect as ge, useRef as _e, useState as v } from "react";
|
|
16
|
+
import { GlassCard as ve, NextSteps as ye, PagePurpose as be } from "@burdenoff/fe-libs/ui";
|
|
17
|
+
import { Fragment as xe, jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
18
|
+
import { useParams as Se, useSearchParams as Ce } from "react-router";
|
|
19
|
+
import { ArrowLeft as we, Bell as Te, BellOff as Ee, CheckCircle2 as De, Edit as Oe, ExternalLink as ke, Globe as x, Hash as S, Loader2 as Ae, MessageSquare as C, Palette as je, Plus as w, Radio as T, Save as E, Settings as D, Shield as Me, Slack as O, Trash2 as Ne, Unlink as Pe, X as k } from "lucide-react";
|
|
20
|
+
import { toast as A } from "sonner";
|
|
21
|
+
//#region src/botlit/pages/ChannelDetailPage.tsx
|
|
22
|
+
var j = [
|
|
23
|
+
"WEB_WIDGET",
|
|
24
|
+
"SLACK",
|
|
25
|
+
"TEAMS",
|
|
26
|
+
"DISCORD",
|
|
27
|
+
"WHATSAPP",
|
|
28
|
+
"WEBHOOK",
|
|
29
|
+
"CUSTOM"
|
|
30
|
+
], Fe = [
|
|
31
|
+
"PRIVATE",
|
|
32
|
+
"WORKSPACE",
|
|
33
|
+
"PUBLIC"
|
|
34
|
+
];
|
|
35
|
+
function M(e) {
|
|
36
|
+
return e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
37
|
+
}
|
|
38
|
+
var N = ({ type: e }) => {
|
|
39
|
+
switch (e) {
|
|
40
|
+
case "SLACK": return /* @__PURE__ */ y(S, { size: 18 });
|
|
41
|
+
case "WEB_WIDGET": return /* @__PURE__ */ y(x, { size: 18 });
|
|
42
|
+
case "TEAMS": return /* @__PURE__ */ y(C, { size: 18 });
|
|
43
|
+
default: return /* @__PURE__ */ y(T, { size: 18 });
|
|
44
|
+
}
|
|
45
|
+
}, P = ({ isNew: x }) => {
|
|
46
|
+
let { connectorId: S } = Se(), { navigateTo: P } = e(), [F, I] = Ce(), { data: L, loading: Ie } = ae(x ? void 0 : S), { data: Le, refetch: Re } = oe(S), { data: R } = t(), [ze, Be] = se(), [Ve, He] = ue(), [Ue, We] = le(), [Ge, Ke] = ce(), z = L?.type === "SLACK" && L?.credentialsRefId ? L.credentialsRefId : void 0, { data: B, loading: qe, refetch: V } = pe(z), { initiate: Je } = de(), { link: Ye, loading: Xe } = fe(), { toggle: Ze, loading: Qe } = he(), { revoke: $e, loading: et } = me(), [tt, H] = v(null), nt = _e(!1);
|
|
47
|
+
ge(() => {
|
|
48
|
+
if (nt.current) return;
|
|
49
|
+
let e = F.get("integrationConnectionId"), t = F.get("channelId");
|
|
50
|
+
if (!e || !t) return;
|
|
51
|
+
nt.current = !0;
|
|
52
|
+
let n = new URLSearchParams(F);
|
|
53
|
+
n.delete("integrationConnectionId"), n.delete("channelId"), I(n, { replace: !0 }), H(null), Ye(e, t).then((e) => {
|
|
54
|
+
e ? V() : H("Failed to link Slack connection. Please try again.");
|
|
55
|
+
});
|
|
56
|
+
}, [
|
|
57
|
+
F,
|
|
58
|
+
I,
|
|
59
|
+
Ye,
|
|
60
|
+
V
|
|
61
|
+
]);
|
|
62
|
+
let rt = () => {
|
|
63
|
+
z && Je(z, `${window.location.origin}${window.location.pathname}`);
|
|
64
|
+
}, it = async () => {
|
|
65
|
+
B && await Ze(B.id, !B.notificationsEnabled) && await V();
|
|
66
|
+
}, at = async () => {
|
|
67
|
+
B && await $e(B.id) && await V();
|
|
68
|
+
}, [ot, U] = v(!1), [st, ct] = v(!1), [lt, W] = v(!1), [G, K] = v({
|
|
69
|
+
locationId: "",
|
|
70
|
+
locationName: "",
|
|
71
|
+
botId: ""
|
|
72
|
+
}), [q, J] = v({
|
|
73
|
+
name: "",
|
|
74
|
+
description: "",
|
|
75
|
+
type: "WEB_WIDGET",
|
|
76
|
+
visibility: "PRIVATE",
|
|
77
|
+
credentialsRefId: ""
|
|
78
|
+
}), [Y, X] = v({
|
|
79
|
+
allowedOrigins: "",
|
|
80
|
+
primaryColor: "#3b82f6",
|
|
81
|
+
fontFamily: "Inter, sans-serif",
|
|
82
|
+
starterPrompts: ""
|
|
83
|
+
}), ut = () => {
|
|
84
|
+
if (q.type === "WEB_WIDGET") return { [ie]: {
|
|
85
|
+
allowedOrigins: M(Y.allowedOrigins),
|
|
86
|
+
primaryColor: Y.primaryColor,
|
|
87
|
+
fontFamily: Y.fontFamily,
|
|
88
|
+
starterPrompts: M(Y.starterPrompts)
|
|
89
|
+
} };
|
|
90
|
+
}, dt = async () => {
|
|
91
|
+
if (q.name) try {
|
|
92
|
+
let e = await ze({
|
|
93
|
+
name: q.name,
|
|
94
|
+
type: q.type,
|
|
95
|
+
description: q.description || void 0,
|
|
96
|
+
visibility: q.visibility,
|
|
97
|
+
credentialsRefId: q.credentialsRefId || void 0,
|
|
98
|
+
metadata: ut()
|
|
99
|
+
});
|
|
100
|
+
A.success(`Channel "${e.name}" created`), P(`channels/${e.id}`);
|
|
101
|
+
} catch (e) {
|
|
102
|
+
A.error(e instanceof Error ? e.message : "Failed to create channel connector");
|
|
103
|
+
}
|
|
104
|
+
}, ft = async () => {
|
|
105
|
+
if (!(!S || !q.name)) try {
|
|
106
|
+
await Ve({
|
|
107
|
+
connectorId: S,
|
|
108
|
+
input: {
|
|
109
|
+
name: q.name,
|
|
110
|
+
description: q.description || void 0,
|
|
111
|
+
visibility: q.visibility,
|
|
112
|
+
credentialsRefId: q.credentialsRefId || void 0,
|
|
113
|
+
metadata: ut()
|
|
114
|
+
}
|
|
115
|
+
}), A.success("Channel updated"), U(!1);
|
|
116
|
+
} catch (e) {
|
|
117
|
+
A.error(e instanceof Error ? e.message : "Failed to update channel connector");
|
|
118
|
+
}
|
|
119
|
+
}, pt = async () => {
|
|
120
|
+
if (S) try {
|
|
121
|
+
await Ue(S), te() && re("success"), P("channels");
|
|
122
|
+
} catch (e) {
|
|
123
|
+
throw te() && re("error"), e;
|
|
124
|
+
}
|
|
125
|
+
}, mt = async () => {
|
|
126
|
+
if (!S || !G.locationId || !G.botId) return;
|
|
127
|
+
let e = R?.find((e) => e.id === G.botId);
|
|
128
|
+
try {
|
|
129
|
+
await Ge({
|
|
130
|
+
connectorId: S,
|
|
131
|
+
locationId: G.locationId,
|
|
132
|
+
appId: G.botId,
|
|
133
|
+
metadata: {
|
|
134
|
+
locationName: G.locationName || G.locationId,
|
|
135
|
+
appName: e?.name
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
} catch (e) {
|
|
139
|
+
A.error(e instanceof Error ? e.message : "Failed to create route");
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
A.success("Route created"), Re(), K({
|
|
143
|
+
locationId: "",
|
|
144
|
+
locationName: "",
|
|
145
|
+
botId: ""
|
|
146
|
+
}), W(!1);
|
|
147
|
+
}, ht = () => {
|
|
148
|
+
if (!L) return;
|
|
149
|
+
J({
|
|
150
|
+
name: L.name,
|
|
151
|
+
description: L.description || "",
|
|
152
|
+
type: _(L.type, j, "CUSTOM"),
|
|
153
|
+
visibility: _(L.visibility, Fe, "PRIVATE"),
|
|
154
|
+
credentialsRefId: L.credentialsRefId || ""
|
|
155
|
+
});
|
|
156
|
+
let e = h(L);
|
|
157
|
+
e && X({
|
|
158
|
+
allowedOrigins: e.allowedOrigins.join(", "),
|
|
159
|
+
primaryColor: e.primaryColor,
|
|
160
|
+
fontFamily: e.fontFamily,
|
|
161
|
+
starterPrompts: e.starterPrompts.join(", ")
|
|
162
|
+
}), U(!0);
|
|
163
|
+
};
|
|
164
|
+
if (x) return /* @__PURE__ */ y(r, {
|
|
165
|
+
title: "Create Channel Connector",
|
|
166
|
+
description: "Set up a new channel for your AI agents",
|
|
167
|
+
actions: /* @__PURE__ */ b("div", {
|
|
168
|
+
className: "flex gap-2",
|
|
169
|
+
children: [/* @__PURE__ */ y(l, {
|
|
170
|
+
variant: "outline",
|
|
171
|
+
onClick: () => P("channels"),
|
|
172
|
+
children: "Cancel"
|
|
173
|
+
}), /* @__PURE__ */ y(l, {
|
|
174
|
+
leftIcon: /* @__PURE__ */ y(E, { size: 16 }),
|
|
175
|
+
onClick: dt,
|
|
176
|
+
isLoading: Be.loading || He.loading,
|
|
177
|
+
disabled: !q.name,
|
|
178
|
+
children: "Create"
|
|
179
|
+
})]
|
|
180
|
+
}),
|
|
181
|
+
children: /* @__PURE__ */ b("div", {
|
|
182
|
+
className: "max-w-2xl space-y-6",
|
|
183
|
+
children: [/* @__PURE__ */ b(i, { children: [/* @__PURE__ */ y(s, { children: /* @__PURE__ */ y(c, { children: "Basic Information" }) }), /* @__PURE__ */ b(a, {
|
|
184
|
+
className: "space-y-4",
|
|
185
|
+
children: [
|
|
186
|
+
/* @__PURE__ */ y(f, {
|
|
187
|
+
label: "Connector Name",
|
|
188
|
+
required: !0,
|
|
189
|
+
children: /* @__PURE__ */ y(p, {
|
|
190
|
+
placeholder: "e.g., Production Web Widget",
|
|
191
|
+
value: q.name,
|
|
192
|
+
onChange: (e) => J({
|
|
193
|
+
...q,
|
|
194
|
+
name: e.target.value
|
|
195
|
+
})
|
|
196
|
+
})
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ y(f, {
|
|
199
|
+
label: "Description",
|
|
200
|
+
children: /* @__PURE__ */ y(m, {
|
|
201
|
+
placeholder: "What is this channel connector for?",
|
|
202
|
+
value: q.description,
|
|
203
|
+
onChange: (e) => J({
|
|
204
|
+
...q,
|
|
205
|
+
description: e.target.value
|
|
206
|
+
}),
|
|
207
|
+
rows: 3
|
|
208
|
+
})
|
|
209
|
+
}),
|
|
210
|
+
/* @__PURE__ */ b("div", {
|
|
211
|
+
className: "grid grid-cols-2 gap-4",
|
|
212
|
+
children: [/* @__PURE__ */ y(f, {
|
|
213
|
+
label: "Channel Type",
|
|
214
|
+
required: !0,
|
|
215
|
+
children: /* @__PURE__ */ b("select", {
|
|
216
|
+
className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
|
|
217
|
+
value: q.type,
|
|
218
|
+
onChange: (e) => J({
|
|
219
|
+
...q,
|
|
220
|
+
type: e.target.value
|
|
221
|
+
}),
|
|
222
|
+
children: [
|
|
223
|
+
/* @__PURE__ */ y("option", {
|
|
224
|
+
value: "WEB_WIDGET",
|
|
225
|
+
children: "Web Widget"
|
|
226
|
+
}),
|
|
227
|
+
/* @__PURE__ */ y("option", {
|
|
228
|
+
value: "SLACK",
|
|
229
|
+
children: "Slack"
|
|
230
|
+
}),
|
|
231
|
+
/* @__PURE__ */ y("option", {
|
|
232
|
+
value: "TEAMS",
|
|
233
|
+
children: "Microsoft Teams"
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ y("option", {
|
|
236
|
+
value: "DISCORD",
|
|
237
|
+
children: "Discord"
|
|
238
|
+
}),
|
|
239
|
+
/* @__PURE__ */ y("option", {
|
|
240
|
+
value: "WHATSAPP",
|
|
241
|
+
children: "WhatsApp"
|
|
242
|
+
}),
|
|
243
|
+
/* @__PURE__ */ y("option", {
|
|
244
|
+
value: "WEBHOOK",
|
|
245
|
+
children: "Webhook"
|
|
246
|
+
}),
|
|
247
|
+
/* @__PURE__ */ y("option", {
|
|
248
|
+
value: "CUSTOM",
|
|
249
|
+
children: "Custom"
|
|
250
|
+
})
|
|
251
|
+
]
|
|
252
|
+
})
|
|
253
|
+
}), /* @__PURE__ */ y(f, {
|
|
254
|
+
label: "Visibility",
|
|
255
|
+
children: /* @__PURE__ */ b("select", {
|
|
256
|
+
className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
|
|
257
|
+
value: q.visibility,
|
|
258
|
+
onChange: (e) => J({
|
|
259
|
+
...q,
|
|
260
|
+
visibility: e.target.value
|
|
261
|
+
}),
|
|
262
|
+
children: [
|
|
263
|
+
/* @__PURE__ */ y("option", {
|
|
264
|
+
value: "PRIVATE",
|
|
265
|
+
children: "Private"
|
|
266
|
+
}),
|
|
267
|
+
/* @__PURE__ */ y("option", {
|
|
268
|
+
value: "WORKSPACE",
|
|
269
|
+
children: "Workspace"
|
|
270
|
+
}),
|
|
271
|
+
/* @__PURE__ */ y("option", {
|
|
272
|
+
value: "PUBLIC",
|
|
273
|
+
children: "Public"
|
|
274
|
+
})
|
|
275
|
+
]
|
|
276
|
+
})
|
|
277
|
+
})]
|
|
278
|
+
}),
|
|
279
|
+
q.type !== "WEB_WIDGET" && /* @__PURE__ */ y(f, {
|
|
280
|
+
label: "Credentials Reference",
|
|
281
|
+
children: /* @__PURE__ */ y(p, {
|
|
282
|
+
placeholder: "e.g., secret-slack-token",
|
|
283
|
+
value: q.credentialsRefId,
|
|
284
|
+
onChange: (e) => J({
|
|
285
|
+
...q,
|
|
286
|
+
credentialsRefId: e.target.value
|
|
287
|
+
})
|
|
288
|
+
})
|
|
289
|
+
})
|
|
290
|
+
]
|
|
291
|
+
})] }), q.type === "WEB_WIDGET" && /* @__PURE__ */ b(i, { children: [/* @__PURE__ */ y(s, { children: /* @__PURE__ */ b(c, {
|
|
292
|
+
className: "flex items-center gap-2",
|
|
293
|
+
children: [/* @__PURE__ */ y(je, { size: 18 }), "Widget Configuration"]
|
|
294
|
+
}) }), /* @__PURE__ */ b(a, {
|
|
295
|
+
className: "space-y-4",
|
|
296
|
+
children: [
|
|
297
|
+
/* @__PURE__ */ y(f, {
|
|
298
|
+
label: "Allowed Origins",
|
|
299
|
+
description: "Comma-separated list of domains",
|
|
300
|
+
children: /* @__PURE__ */ y(p, {
|
|
301
|
+
placeholder: "e.g., https://example.com, https://app.example.com",
|
|
302
|
+
value: Y.allowedOrigins,
|
|
303
|
+
onChange: (e) => X({
|
|
304
|
+
...Y,
|
|
305
|
+
allowedOrigins: e.target.value
|
|
306
|
+
})
|
|
307
|
+
})
|
|
308
|
+
}),
|
|
309
|
+
/* @__PURE__ */ b("div", {
|
|
310
|
+
className: "grid grid-cols-2 gap-4",
|
|
311
|
+
children: [/* @__PURE__ */ y(f, {
|
|
312
|
+
label: "Primary Color",
|
|
313
|
+
children: /* @__PURE__ */ b("div", {
|
|
314
|
+
className: "flex gap-2",
|
|
315
|
+
children: [/* @__PURE__ */ y("input", {
|
|
316
|
+
type: "color",
|
|
317
|
+
value: Y.primaryColor,
|
|
318
|
+
onChange: (e) => X({
|
|
319
|
+
...Y,
|
|
320
|
+
primaryColor: e.target.value
|
|
321
|
+
}),
|
|
322
|
+
className: "h-10 w-16 rounded border border-border-default"
|
|
323
|
+
}), /* @__PURE__ */ y(p, {
|
|
324
|
+
value: Y.primaryColor,
|
|
325
|
+
onChange: (e) => X({
|
|
326
|
+
...Y,
|
|
327
|
+
primaryColor: e.target.value
|
|
328
|
+
})
|
|
329
|
+
})]
|
|
330
|
+
})
|
|
331
|
+
}), /* @__PURE__ */ y(f, {
|
|
332
|
+
label: "Font Family",
|
|
333
|
+
children: /* @__PURE__ */ y(p, {
|
|
334
|
+
value: Y.fontFamily,
|
|
335
|
+
onChange: (e) => X({
|
|
336
|
+
...Y,
|
|
337
|
+
fontFamily: e.target.value
|
|
338
|
+
})
|
|
339
|
+
})
|
|
340
|
+
})]
|
|
341
|
+
}),
|
|
342
|
+
/* @__PURE__ */ y(f, {
|
|
343
|
+
label: "Starter Prompts",
|
|
344
|
+
description: "One per line",
|
|
345
|
+
children: /* @__PURE__ */ y(m, {
|
|
346
|
+
placeholder: "What can you help me with?",
|
|
347
|
+
value: Y.starterPrompts,
|
|
348
|
+
onChange: (e) => X({
|
|
349
|
+
...Y,
|
|
350
|
+
starterPrompts: e.target.value
|
|
351
|
+
}),
|
|
352
|
+
rows: 3
|
|
353
|
+
})
|
|
354
|
+
})
|
|
355
|
+
]
|
|
356
|
+
})] })]
|
|
357
|
+
})
|
|
358
|
+
});
|
|
359
|
+
if (Ie) return /* @__PURE__ */ y(r, {
|
|
360
|
+
title: "Loading...",
|
|
361
|
+
children: /* @__PURE__ */ y("div", { className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
|
|
362
|
+
});
|
|
363
|
+
if (!L) return /* @__PURE__ */ y(r, {
|
|
364
|
+
title: "Connector Not Found",
|
|
365
|
+
children: /* @__PURE__ */ y(d, {
|
|
366
|
+
illustration: "empty-notifications",
|
|
367
|
+
title: "Connector Not Found",
|
|
368
|
+
description: "This channel connector doesn't exist.",
|
|
369
|
+
action: /* @__PURE__ */ y(l, {
|
|
370
|
+
onClick: () => P("channels"),
|
|
371
|
+
children: "Back to Channels"
|
|
372
|
+
})
|
|
373
|
+
})
|
|
374
|
+
});
|
|
375
|
+
let Z = Le?.filter((e) => e.connectorId === L.id) || [], Q = _(L.type, j, "CUSTOM"), $ = h(L);
|
|
376
|
+
return /* @__PURE__ */ y(r, {
|
|
377
|
+
title: /* @__PURE__ */ b("div", {
|
|
378
|
+
className: "flex items-center gap-3",
|
|
379
|
+
children: [
|
|
380
|
+
/* @__PURE__ */ y(l, {
|
|
381
|
+
variant: "ghost",
|
|
382
|
+
size: "icon",
|
|
383
|
+
onClick: () => P("channels"),
|
|
384
|
+
children: /* @__PURE__ */ y(we, { size: 20 })
|
|
385
|
+
}),
|
|
386
|
+
/* @__PURE__ */ y("div", {
|
|
387
|
+
className: "p-2 rounded-lg bg-action-primary-bg/10",
|
|
388
|
+
children: /* @__PURE__ */ y(N, { type: Q })
|
|
389
|
+
}),
|
|
390
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ b("div", {
|
|
391
|
+
className: "flex items-center gap-2",
|
|
392
|
+
children: [/* @__PURE__ */ y("span", { children: L.name }), /* @__PURE__ */ y(ee, { status: L.status })]
|
|
393
|
+
}), /* @__PURE__ */ y("p", {
|
|
394
|
+
className: "text-sm font-normal text-text-secondary",
|
|
395
|
+
children: L.description
|
|
396
|
+
})] })
|
|
397
|
+
]
|
|
398
|
+
}),
|
|
399
|
+
actions: /* @__PURE__ */ b("div", {
|
|
400
|
+
className: "flex gap-2",
|
|
401
|
+
children: [/* @__PURE__ */ y(l, {
|
|
402
|
+
variant: "outline",
|
|
403
|
+
leftIcon: /* @__PURE__ */ y(w, { size: 16 }),
|
|
404
|
+
onClick: () => W(!0),
|
|
405
|
+
children: "Add Route"
|
|
406
|
+
}), ot ? /* @__PURE__ */ b(xe, { children: [/* @__PURE__ */ y(l, {
|
|
407
|
+
variant: "outline",
|
|
408
|
+
onClick: () => U(!1),
|
|
409
|
+
children: "Cancel"
|
|
410
|
+
}), /* @__PURE__ */ y(l, {
|
|
411
|
+
leftIcon: /* @__PURE__ */ y(E, { size: 16 }),
|
|
412
|
+
onClick: ft,
|
|
413
|
+
isLoading: He.loading,
|
|
414
|
+
children: "Save"
|
|
415
|
+
})] }) : /* @__PURE__ */ b(xe, { children: [/* @__PURE__ */ y(l, {
|
|
416
|
+
variant: "outline",
|
|
417
|
+
leftIcon: /* @__PURE__ */ y(Oe, { size: 16 }),
|
|
418
|
+
onClick: ht,
|
|
419
|
+
children: "Edit"
|
|
420
|
+
}), st ? /* @__PURE__ */ b("div", {
|
|
421
|
+
className: "flex gap-2",
|
|
422
|
+
children: [/* @__PURE__ */ y(l, {
|
|
423
|
+
variant: "outline",
|
|
424
|
+
size: "sm",
|
|
425
|
+
onClick: () => ct(!1),
|
|
426
|
+
children: "Cancel"
|
|
427
|
+
}), /* @__PURE__ */ y(l, {
|
|
428
|
+
variant: "destructive",
|
|
429
|
+
size: "sm",
|
|
430
|
+
onClick: () => {
|
|
431
|
+
ne("medium"), pt();
|
|
432
|
+
},
|
|
433
|
+
isLoading: We.loading,
|
|
434
|
+
children: "Confirm"
|
|
435
|
+
})]
|
|
436
|
+
}) : /* @__PURE__ */ y(l, {
|
|
437
|
+
variant: "destructive",
|
|
438
|
+
leftIcon: /* @__PURE__ */ y(Ne, { size: 16 }),
|
|
439
|
+
onClick: () => ct(!0),
|
|
440
|
+
children: "Delete"
|
|
441
|
+
})] })]
|
|
442
|
+
}),
|
|
443
|
+
children: /* @__PURE__ */ b("div", {
|
|
444
|
+
className: "space-y-6",
|
|
445
|
+
children: [
|
|
446
|
+
/* @__PURE__ */ y(be, {
|
|
447
|
+
icon: /* @__PURE__ */ y(T, { size: 18 }),
|
|
448
|
+
children: "This connector links Botlit 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."
|
|
449
|
+
}),
|
|
450
|
+
/* @__PURE__ */ y(ye, {
|
|
451
|
+
storageKey: `botlit-channel-${L.id}`,
|
|
452
|
+
steps: [
|
|
453
|
+
{
|
|
454
|
+
id: "route",
|
|
455
|
+
label: "Add a route",
|
|
456
|
+
description: "Point an incoming location on this channel at one of your bots.",
|
|
457
|
+
icon: /* @__PURE__ */ y(w, { size: 16 }),
|
|
458
|
+
onClick: () => W(!0),
|
|
459
|
+
done: Z.length > 0
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
id: "edit",
|
|
463
|
+
label: "Review connector settings",
|
|
464
|
+
description: "Confirm the name, visibility and channel-specific configuration.",
|
|
465
|
+
icon: /* @__PURE__ */ y(D, { size: 16 }),
|
|
466
|
+
onClick: ht
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
id: "bots",
|
|
470
|
+
label: "Check your bots",
|
|
471
|
+
description: "Make sure the bot you are routing to is active and configured.",
|
|
472
|
+
icon: /* @__PURE__ */ y(C, { size: 16 }),
|
|
473
|
+
onClick: () => P("bots")
|
|
474
|
+
}
|
|
475
|
+
]
|
|
476
|
+
}),
|
|
477
|
+
lt && /* @__PURE__ */ b(i, { children: [/* @__PURE__ */ b(s, {
|
|
478
|
+
className: "flex flex-row items-center justify-between",
|
|
479
|
+
children: [/* @__PURE__ */ y(c, { children: "Add Route" }), /* @__PURE__ */ y(l, {
|
|
480
|
+
variant: "ghost",
|
|
481
|
+
size: "icon",
|
|
482
|
+
onClick: () => W(!1),
|
|
483
|
+
children: /* @__PURE__ */ y(k, { size: 16 })
|
|
484
|
+
})]
|
|
485
|
+
}), /* @__PURE__ */ b(a, {
|
|
486
|
+
className: "space-y-4",
|
|
487
|
+
children: [
|
|
488
|
+
/* @__PURE__ */ b("div", {
|
|
489
|
+
className: "grid grid-cols-2 gap-4",
|
|
490
|
+
children: [/* @__PURE__ */ y(f, {
|
|
491
|
+
label: "Location ID",
|
|
492
|
+
required: !0,
|
|
493
|
+
children: /* @__PURE__ */ y(p, {
|
|
494
|
+
placeholder: "e.g., #general or channel ID",
|
|
495
|
+
value: G.locationId,
|
|
496
|
+
onChange: (e) => K({
|
|
497
|
+
...G,
|
|
498
|
+
locationId: e.target.value
|
|
499
|
+
})
|
|
500
|
+
})
|
|
501
|
+
}), /* @__PURE__ */ y(f, {
|
|
502
|
+
label: "Location Name",
|
|
503
|
+
children: /* @__PURE__ */ y(p, {
|
|
504
|
+
placeholder: "Friendly name (optional)",
|
|
505
|
+
value: G.locationName,
|
|
506
|
+
onChange: (e) => K({
|
|
507
|
+
...G,
|
|
508
|
+
locationName: e.target.value
|
|
509
|
+
})
|
|
510
|
+
})
|
|
511
|
+
})]
|
|
512
|
+
}),
|
|
513
|
+
/* @__PURE__ */ y(f, {
|
|
514
|
+
label: "Connect to Bot",
|
|
515
|
+
required: !0,
|
|
516
|
+
children: /* @__PURE__ */ b("select", {
|
|
517
|
+
className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
|
|
518
|
+
value: G.botId,
|
|
519
|
+
onChange: (e) => K({
|
|
520
|
+
...G,
|
|
521
|
+
botId: e.target.value
|
|
522
|
+
}),
|
|
523
|
+
children: [/* @__PURE__ */ y("option", {
|
|
524
|
+
value: "",
|
|
525
|
+
children: "Select a bot..."
|
|
526
|
+
}), R?.map((e) => /* @__PURE__ */ y("option", {
|
|
527
|
+
value: e.id,
|
|
528
|
+
children: e.name
|
|
529
|
+
}, e.id))]
|
|
530
|
+
})
|
|
531
|
+
}),
|
|
532
|
+
/* @__PURE__ */ b("div", {
|
|
533
|
+
className: "flex justify-end gap-2",
|
|
534
|
+
children: [/* @__PURE__ */ y(l, {
|
|
535
|
+
variant: "outline",
|
|
536
|
+
onClick: () => W(!1),
|
|
537
|
+
children: "Cancel"
|
|
538
|
+
}), /* @__PURE__ */ y(l, {
|
|
539
|
+
onClick: mt,
|
|
540
|
+
isLoading: Ke.loading,
|
|
541
|
+
disabled: !G.locationId || !G.botId,
|
|
542
|
+
children: "Add Route"
|
|
543
|
+
})]
|
|
544
|
+
})
|
|
545
|
+
]
|
|
546
|
+
})] }),
|
|
547
|
+
ot && /* @__PURE__ */ b(i, { children: [/* @__PURE__ */ y(s, { children: /* @__PURE__ */ y(c, { children: "Edit Channel" }) }), /* @__PURE__ */ b(a, {
|
|
548
|
+
className: "space-y-4",
|
|
549
|
+
children: [
|
|
550
|
+
/* @__PURE__ */ y(f, {
|
|
551
|
+
label: "Connector Name",
|
|
552
|
+
required: !0,
|
|
553
|
+
children: /* @__PURE__ */ y(p, {
|
|
554
|
+
value: q.name,
|
|
555
|
+
onChange: (e) => J({
|
|
556
|
+
...q,
|
|
557
|
+
name: e.target.value
|
|
558
|
+
})
|
|
559
|
+
})
|
|
560
|
+
}),
|
|
561
|
+
/* @__PURE__ */ y(f, {
|
|
562
|
+
label: "Description",
|
|
563
|
+
children: /* @__PURE__ */ y(m, {
|
|
564
|
+
value: q.description,
|
|
565
|
+
onChange: (e) => J({
|
|
566
|
+
...q,
|
|
567
|
+
description: e.target.value
|
|
568
|
+
}),
|
|
569
|
+
rows: 2
|
|
570
|
+
})
|
|
571
|
+
}),
|
|
572
|
+
/* @__PURE__ */ y(f, {
|
|
573
|
+
label: "Visibility",
|
|
574
|
+
children: /* @__PURE__ */ b("select", {
|
|
575
|
+
className: "flex h-10 w-full rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
|
|
576
|
+
value: q.visibility,
|
|
577
|
+
onChange: (e) => J({
|
|
578
|
+
...q,
|
|
579
|
+
visibility: e.target.value
|
|
580
|
+
}),
|
|
581
|
+
children: [
|
|
582
|
+
/* @__PURE__ */ y("option", {
|
|
583
|
+
value: "PRIVATE",
|
|
584
|
+
children: "Private"
|
|
585
|
+
}),
|
|
586
|
+
/* @__PURE__ */ y("option", {
|
|
587
|
+
value: "WORKSPACE",
|
|
588
|
+
children: "Workspace"
|
|
589
|
+
}),
|
|
590
|
+
/* @__PURE__ */ y("option", {
|
|
591
|
+
value: "PUBLIC",
|
|
592
|
+
children: "Public"
|
|
593
|
+
})
|
|
594
|
+
]
|
|
595
|
+
})
|
|
596
|
+
})
|
|
597
|
+
]
|
|
598
|
+
})] }),
|
|
599
|
+
/* @__PURE__ */ b("div", {
|
|
600
|
+
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
601
|
+
children: [
|
|
602
|
+
/* @__PURE__ */ y(i, { children: /* @__PURE__ */ b(a, {
|
|
603
|
+
className: "pt-6 text-center",
|
|
604
|
+
children: [
|
|
605
|
+
/* @__PURE__ */ y("div", {
|
|
606
|
+
className: "p-3 rounded-full bg-action-primary-bg/10 w-fit mx-auto mb-2",
|
|
607
|
+
children: /* @__PURE__ */ y(N, { type: Q })
|
|
608
|
+
}),
|
|
609
|
+
/* @__PURE__ */ y("p", {
|
|
610
|
+
className: "text-lg font-bold capitalize",
|
|
611
|
+
children: L.type.toLowerCase().replace("_", " ")
|
|
612
|
+
}),
|
|
613
|
+
/* @__PURE__ */ y("p", {
|
|
614
|
+
className: "text-sm text-text-secondary",
|
|
615
|
+
children: "Channel Type"
|
|
616
|
+
})
|
|
617
|
+
]
|
|
618
|
+
}) }),
|
|
619
|
+
/* @__PURE__ */ b(ve, {
|
|
620
|
+
treatment: "glass",
|
|
621
|
+
glow: !0,
|
|
622
|
+
className: "p-6 text-center",
|
|
623
|
+
children: [/* @__PURE__ */ y("p", {
|
|
624
|
+
className: "text-3xl font-bold tabular-nums text-text-primary",
|
|
625
|
+
children: Z.length
|
|
626
|
+
}), /* @__PURE__ */ y("p", {
|
|
627
|
+
className: "text-sm text-text-secondary",
|
|
628
|
+
children: "Active Routes"
|
|
629
|
+
})]
|
|
630
|
+
}),
|
|
631
|
+
/* @__PURE__ */ y(i, { children: /* @__PURE__ */ b(a, {
|
|
632
|
+
className: "pt-6 text-center",
|
|
633
|
+
children: [/* @__PURE__ */ y("p", {
|
|
634
|
+
className: "text-3xl font-bold text-text-primary capitalize",
|
|
635
|
+
children: L.visibility.toLowerCase()
|
|
636
|
+
}), /* @__PURE__ */ y("p", {
|
|
637
|
+
className: "text-sm text-text-secondary",
|
|
638
|
+
children: "Visibility"
|
|
639
|
+
})]
|
|
640
|
+
}) }),
|
|
641
|
+
/* @__PURE__ */ y(i, { children: /* @__PURE__ */ b(a, {
|
|
642
|
+
className: "pt-6 text-center",
|
|
643
|
+
children: [/* @__PURE__ */ y("p", {
|
|
644
|
+
className: "text-3xl font-bold text-text-primary",
|
|
645
|
+
children: L.revision
|
|
646
|
+
}), /* @__PURE__ */ y("p", {
|
|
647
|
+
className: "text-sm text-text-secondary",
|
|
648
|
+
children: "Revision"
|
|
649
|
+
})]
|
|
650
|
+
}) })
|
|
651
|
+
]
|
|
652
|
+
}),
|
|
653
|
+
$ && /* @__PURE__ */ b(i, { children: [/* @__PURE__ */ y(s, { children: /* @__PURE__ */ b(c, {
|
|
654
|
+
className: "flex items-center gap-2",
|
|
655
|
+
children: [/* @__PURE__ */ y(je, { size: 18 }), "Widget Configuration"]
|
|
656
|
+
}) }), /* @__PURE__ */ b(a, { children: [/* @__PURE__ */ b("div", {
|
|
657
|
+
className: "grid grid-cols-2 md:grid-cols-3 gap-6",
|
|
658
|
+
children: [
|
|
659
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
660
|
+
className: "text-sm text-text-secondary",
|
|
661
|
+
children: "Allowed Origins"
|
|
662
|
+
}), $.allowedOrigins.length > 0 ? /* @__PURE__ */ y("div", {
|
|
663
|
+
className: "flex flex-wrap gap-1 mt-1",
|
|
664
|
+
children: $.allowedOrigins.map((e) => /* @__PURE__ */ y(u, {
|
|
665
|
+
variant: "outline",
|
|
666
|
+
className: "font-mono text-xs",
|
|
667
|
+
children: e
|
|
668
|
+
}, e))
|
|
669
|
+
}) : /* @__PURE__ */ y("p", {
|
|
670
|
+
className: "font-medium",
|
|
671
|
+
children: "Any origin"
|
|
672
|
+
})] }),
|
|
673
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
674
|
+
className: "text-sm text-text-secondary",
|
|
675
|
+
children: "Theme"
|
|
676
|
+
}), /* @__PURE__ */ b("div", {
|
|
677
|
+
className: "flex items-center gap-2 mt-1",
|
|
678
|
+
children: [/* @__PURE__ */ y("div", {
|
|
679
|
+
className: "w-6 h-6 rounded border border-border-subtle",
|
|
680
|
+
style: { backgroundColor: $.primaryColor }
|
|
681
|
+
}), /* @__PURE__ */ y("span", {
|
|
682
|
+
className: "font-mono text-sm",
|
|
683
|
+
children: $.primaryColor
|
|
684
|
+
})]
|
|
685
|
+
})] }),
|
|
686
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
687
|
+
className: "text-sm text-text-secondary",
|
|
688
|
+
children: "Font Family"
|
|
689
|
+
}), /* @__PURE__ */ y("p", {
|
|
690
|
+
className: "font-medium",
|
|
691
|
+
children: $.fontFamily
|
|
692
|
+
})] })
|
|
693
|
+
]
|
|
694
|
+
}), $.starterPrompts.length > 0 && /* @__PURE__ */ b("div", {
|
|
695
|
+
className: "mt-4 pt-4 border-t border-border-subtle",
|
|
696
|
+
children: [/* @__PURE__ */ y("p", {
|
|
697
|
+
className: "text-sm text-text-secondary mb-2",
|
|
698
|
+
children: "Starter Prompts"
|
|
699
|
+
}), /* @__PURE__ */ y("div", {
|
|
700
|
+
className: "flex flex-wrap gap-2",
|
|
701
|
+
children: $.starterPrompts.map((e, t) => /* @__PURE__ */ y(u, {
|
|
702
|
+
variant: "secondary",
|
|
703
|
+
children: e
|
|
704
|
+
}, t))
|
|
705
|
+
})]
|
|
706
|
+
})] })] }),
|
|
707
|
+
/* @__PURE__ */ b(i, { children: [/* @__PURE__ */ b(s, {
|
|
708
|
+
className: "flex flex-row items-center justify-between",
|
|
709
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y(c, { children: "Routes" }), /* @__PURE__ */ y(o, { children: "Routes connect this channel to your bots" })] }), /* @__PURE__ */ y(l, {
|
|
710
|
+
variant: "outline",
|
|
711
|
+
size: "sm",
|
|
712
|
+
leftIcon: /* @__PURE__ */ y(w, { size: 14 }),
|
|
713
|
+
onClick: () => W(!0),
|
|
714
|
+
children: "Add Route"
|
|
715
|
+
})]
|
|
716
|
+
}), /* @__PURE__ */ y(a, { children: Z.length > 0 ? /* @__PURE__ */ y("div", {
|
|
717
|
+
className: "space-y-3",
|
|
718
|
+
children: Z.map((e) => /* @__PURE__ */ b("div", {
|
|
719
|
+
className: "flex items-center justify-between p-4 border border-border-subtle rounded-lg",
|
|
720
|
+
children: [/* @__PURE__ */ b("div", {
|
|
721
|
+
className: "flex items-center gap-4",
|
|
722
|
+
children: [/* @__PURE__ */ y("div", {
|
|
723
|
+
className: "p-2 rounded-lg bg-bg-sunken",
|
|
724
|
+
children: /* @__PURE__ */ y(C, {
|
|
725
|
+
size: 18,
|
|
726
|
+
className: "text-text-secondary"
|
|
727
|
+
})
|
|
728
|
+
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
729
|
+
className: "font-medium",
|
|
730
|
+
children: g(e, "locationName") ?? e.locationId
|
|
731
|
+
}), /* @__PURE__ */ b("p", {
|
|
732
|
+
className: "text-sm text-text-secondary",
|
|
733
|
+
children: ["Connected to: ", g(e, "appName") ?? e.appId]
|
|
734
|
+
})] })]
|
|
735
|
+
}), /* @__PURE__ */ b("div", {
|
|
736
|
+
className: "flex items-center gap-2",
|
|
737
|
+
children: [/* @__PURE__ */ b(u, {
|
|
738
|
+
variant: "outline",
|
|
739
|
+
children: ["Rev ", e.revision]
|
|
740
|
+
}), /* @__PURE__ */ y(l, {
|
|
741
|
+
variant: "ghost",
|
|
742
|
+
size: "sm",
|
|
743
|
+
children: /* @__PURE__ */ y(ke, { size: 14 })
|
|
744
|
+
})]
|
|
745
|
+
})]
|
|
746
|
+
}, e.id))
|
|
747
|
+
}) : /* @__PURE__ */ y(d, {
|
|
748
|
+
illustration: "empty-data",
|
|
749
|
+
title: "No routes configured",
|
|
750
|
+
description: "Add a route to connect this channel to a bot.",
|
|
751
|
+
action: /* @__PURE__ */ y(l, {
|
|
752
|
+
leftIcon: /* @__PURE__ */ y(w, { size: 16 }),
|
|
753
|
+
onClick: () => W(!0),
|
|
754
|
+
children: "Add Route"
|
|
755
|
+
})
|
|
756
|
+
}) })] }),
|
|
757
|
+
L.type === "SLACK" && L.credentialsRefId && /* @__PURE__ */ b(i, { children: [/* @__PURE__ */ b(s, { children: [/* @__PURE__ */ b(c, {
|
|
758
|
+
className: "flex items-center gap-2",
|
|
759
|
+
children: [/* @__PURE__ */ y(O, { size: 18 }), "Your Slack Account"]
|
|
760
|
+
}), /* @__PURE__ */ y(o, { children: "Connect your personal Slack account to receive direct messages from this bot" })] }), /* @__PURE__ */ b(a, { children: [tt && /* @__PURE__ */ b("div", {
|
|
761
|
+
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",
|
|
762
|
+
children: [/* @__PURE__ */ y("span", { children: tt }), /* @__PURE__ */ y("button", {
|
|
763
|
+
onClick: () => H(null),
|
|
764
|
+
className: "ml-auto cursor-pointer text-status-error-text/70 hover:text-status-error-text",
|
|
765
|
+
children: /* @__PURE__ */ y(k, { size: 14 })
|
|
766
|
+
})]
|
|
767
|
+
}), Xe ? /* @__PURE__ */ b("div", {
|
|
768
|
+
className: "flex items-center gap-2 py-4 text-text-secondary",
|
|
769
|
+
children: [/* @__PURE__ */ y(Ae, {
|
|
770
|
+
size: 16,
|
|
771
|
+
className: "animate-spin"
|
|
772
|
+
}), /* @__PURE__ */ y("span", {
|
|
773
|
+
className: "text-sm",
|
|
774
|
+
children: "Linking Slack connection..."
|
|
775
|
+
})]
|
|
776
|
+
}) : qe ? /* @__PURE__ */ b("div", {
|
|
777
|
+
className: "flex items-center gap-2 py-4 text-text-secondary",
|
|
778
|
+
children: [/* @__PURE__ */ y(Ae, {
|
|
779
|
+
size: 16,
|
|
780
|
+
className: "animate-spin"
|
|
781
|
+
}), /* @__PURE__ */ y("span", {
|
|
782
|
+
className: "text-sm",
|
|
783
|
+
children: "Checking connection..."
|
|
784
|
+
})]
|
|
785
|
+
}) : B && B.dmAllowed ? /* @__PURE__ */ b("div", {
|
|
786
|
+
className: "space-y-4",
|
|
787
|
+
children: [
|
|
788
|
+
/* @__PURE__ */ b("div", {
|
|
789
|
+
className: "flex items-center gap-3 p-3 rounded-lg bg-bg-sunken",
|
|
790
|
+
children: [
|
|
791
|
+
/* @__PURE__ */ y(De, {
|
|
792
|
+
size: 20,
|
|
793
|
+
className: "text-green-600 shrink-0"
|
|
794
|
+
}),
|
|
795
|
+
/* @__PURE__ */ b("div", {
|
|
796
|
+
className: "min-w-0 flex-1",
|
|
797
|
+
children: [
|
|
798
|
+
/* @__PURE__ */ y("p", {
|
|
799
|
+
className: "font-medium text-sm",
|
|
800
|
+
children: B.externalDisplayName || B.externalUsername || B.externalUserId
|
|
801
|
+
}),
|
|
802
|
+
B.externalUsername && B.externalDisplayName && /* @__PURE__ */ b("p", {
|
|
803
|
+
className: "text-xs text-text-secondary",
|
|
804
|
+
children: ["@", B.externalUsername]
|
|
805
|
+
}),
|
|
806
|
+
B.connectedAt && /* @__PURE__ */ b("p", {
|
|
807
|
+
className: "text-xs text-text-secondary",
|
|
808
|
+
children: ["Connected ", new Date(B.connectedAt).toLocaleDateString()]
|
|
809
|
+
})
|
|
810
|
+
]
|
|
811
|
+
}),
|
|
812
|
+
/* @__PURE__ */ y("div", {
|
|
813
|
+
className: "flex items-center gap-1",
|
|
814
|
+
children: B.isTokenExpired && /* @__PURE__ */ y(u, {
|
|
815
|
+
variant: "outline",
|
|
816
|
+
className: "text-xs text-amber-600 border-amber-400",
|
|
817
|
+
children: "Token expired"
|
|
818
|
+
})
|
|
819
|
+
})
|
|
820
|
+
]
|
|
821
|
+
}),
|
|
822
|
+
/* @__PURE__ */ b("div", {
|
|
823
|
+
className: "flex items-center justify-between p-3 border border-border-subtle rounded-lg",
|
|
824
|
+
children: [/* @__PURE__ */ b("div", {
|
|
825
|
+
className: "flex items-center gap-2",
|
|
826
|
+
children: [B.notificationsEnabled ? /* @__PURE__ */ y(Te, {
|
|
827
|
+
size: 16,
|
|
828
|
+
className: "text-primary"
|
|
829
|
+
}) : /* @__PURE__ */ y(Ee, {
|
|
830
|
+
size: 16,
|
|
831
|
+
className: "text-text-secondary"
|
|
832
|
+
}), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
833
|
+
className: "text-sm font-medium",
|
|
834
|
+
children: "DM Notifications"
|
|
835
|
+
}), /* @__PURE__ */ y("p", {
|
|
836
|
+
className: "text-xs text-text-secondary",
|
|
837
|
+
children: B.notificationsEnabled ? "You will receive bot DMs" : "DM notifications are paused"
|
|
838
|
+
})] })]
|
|
839
|
+
}), /* @__PURE__ */ y(l, {
|
|
840
|
+
variant: "outline",
|
|
841
|
+
size: "sm",
|
|
842
|
+
onClick: it,
|
|
843
|
+
isLoading: Qe,
|
|
844
|
+
children: B.notificationsEnabled ? "Disable" : "Enable"
|
|
845
|
+
})]
|
|
846
|
+
}),
|
|
847
|
+
/* @__PURE__ */ b("div", {
|
|
848
|
+
className: "flex gap-2 justify-end pt-2",
|
|
849
|
+
children: [B.isTokenExpired && /* @__PURE__ */ y(l, {
|
|
850
|
+
variant: "outline",
|
|
851
|
+
size: "sm",
|
|
852
|
+
leftIcon: /* @__PURE__ */ y(O, { size: 14 }),
|
|
853
|
+
onClick: rt,
|
|
854
|
+
children: "Reconnect"
|
|
855
|
+
}), /* @__PURE__ */ y(l, {
|
|
856
|
+
variant: "destructive",
|
|
857
|
+
size: "sm",
|
|
858
|
+
leftIcon: /* @__PURE__ */ y(Pe, { size: 14 }),
|
|
859
|
+
onClick: at,
|
|
860
|
+
isLoading: et,
|
|
861
|
+
children: "Disconnect"
|
|
862
|
+
})]
|
|
863
|
+
})
|
|
864
|
+
]
|
|
865
|
+
}) : /* @__PURE__ */ b("div", {
|
|
866
|
+
className: "flex flex-col items-center gap-4 py-8 text-center",
|
|
867
|
+
children: [
|
|
868
|
+
/* @__PURE__ */ y("div", {
|
|
869
|
+
className: "p-4 rounded-full bg-bg-sunken",
|
|
870
|
+
children: /* @__PURE__ */ y(O, {
|
|
871
|
+
size: 32,
|
|
872
|
+
className: "text-text-secondary"
|
|
873
|
+
})
|
|
874
|
+
}),
|
|
875
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
876
|
+
className: "font-medium",
|
|
877
|
+
children: "No personal account connected"
|
|
878
|
+
}), /* @__PURE__ */ y("p", {
|
|
879
|
+
className: "text-sm text-text-secondary mt-1",
|
|
880
|
+
children: "Connect your Slack account so the bot can send you direct messages"
|
|
881
|
+
})] }),
|
|
882
|
+
/* @__PURE__ */ y(l, {
|
|
883
|
+
leftIcon: /* @__PURE__ */ y(O, { size: 16 }),
|
|
884
|
+
onClick: rt,
|
|
885
|
+
children: "Connect with Slack"
|
|
886
|
+
})
|
|
887
|
+
]
|
|
888
|
+
})] })] }),
|
|
889
|
+
L.defaultPolicyBindings && /* @__PURE__ */ b(i, { children: [/* @__PURE__ */ b(s, { children: [/* @__PURE__ */ b(c, {
|
|
890
|
+
className: "flex items-center gap-2",
|
|
891
|
+
children: [/* @__PURE__ */ y(Me, { size: 18 }), "Default Policy Bindings"]
|
|
892
|
+
}), /* @__PURE__ */ y(o, { children: "Default policies applied to all routes on this connector" })] }), /* @__PURE__ */ y(a, { children: /* @__PURE__ */ y("div", {
|
|
893
|
+
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
894
|
+
children: Object.entries(L.defaultPolicyBindings).map(([e, t]) => t ? /* @__PURE__ */ b("div", {
|
|
895
|
+
className: "p-3 bg-bg-sunken rounded-lg",
|
|
896
|
+
children: [/* @__PURE__ */ y("p", {
|
|
897
|
+
className: "text-xs text-text-secondary capitalize",
|
|
898
|
+
children: e.replace("PolicyId", "").replace(/([A-Z])/g, " $1")
|
|
899
|
+
}), /* @__PURE__ */ y("p", {
|
|
900
|
+
className: "font-medium text-sm truncate",
|
|
901
|
+
children: String(t)
|
|
902
|
+
})]
|
|
903
|
+
}, e) : null)
|
|
904
|
+
}) })] }),
|
|
905
|
+
/* @__PURE__ */ b(i, { children: [/* @__PURE__ */ y(s, { children: /* @__PURE__ */ b(c, {
|
|
906
|
+
className: "flex items-center gap-2",
|
|
907
|
+
children: [/* @__PURE__ */ y(D, { size: 18 }), "Metadata"]
|
|
908
|
+
}) }), /* @__PURE__ */ y(a, { children: /* @__PURE__ */ b("div", {
|
|
909
|
+
className: "grid grid-cols-2 md:grid-cols-4 gap-6 text-sm",
|
|
910
|
+
children: [
|
|
911
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
912
|
+
className: "text-text-secondary",
|
|
913
|
+
children: "Created"
|
|
914
|
+
}), /* @__PURE__ */ y("p", {
|
|
915
|
+
className: "font-medium",
|
|
916
|
+
children: n(L.createdAt)
|
|
917
|
+
})] }),
|
|
918
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
919
|
+
className: "text-text-secondary",
|
|
920
|
+
children: "Updated"
|
|
921
|
+
}), /* @__PURE__ */ y("p", {
|
|
922
|
+
className: "font-medium",
|
|
923
|
+
children: n(L.updatedAt)
|
|
924
|
+
})] }),
|
|
925
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
926
|
+
className: "text-text-secondary",
|
|
927
|
+
children: "Credentials"
|
|
928
|
+
}), /* @__PURE__ */ y("p", {
|
|
929
|
+
className: "font-medium",
|
|
930
|
+
children: L.credentialsRefId || "Not configured"
|
|
931
|
+
})] }),
|
|
932
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
933
|
+
className: "text-text-secondary",
|
|
934
|
+
children: "Tags"
|
|
935
|
+
}), /* @__PURE__ */ y("div", {
|
|
936
|
+
className: "flex gap-1",
|
|
937
|
+
children: L.tags.length > 0 ? L.tags.map((e) => /* @__PURE__ */ y(u, {
|
|
938
|
+
variant: "secondary",
|
|
939
|
+
className: "text-xs",
|
|
940
|
+
children: e
|
|
941
|
+
}, e)) : /* @__PURE__ */ y("span", {
|
|
942
|
+
className: "text-text-secondary",
|
|
943
|
+
children: "None"
|
|
944
|
+
})
|
|
945
|
+
})] })
|
|
946
|
+
]
|
|
947
|
+
}) })] })
|
|
948
|
+
]
|
|
949
|
+
})
|
|
950
|
+
});
|
|
951
|
+
};
|
|
952
|
+
//#endregion
|
|
953
|
+
export { P as ChannelDetailPage };
|
|
954
|
+
|
|
955
|
+
//# sourceMappingURL=ChannelDetailPage.js.map
|