@burdenoff/microfe-integrations 2026.801.1 → 2026.807.2

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.
Files changed (54) hide show
  1. package/dist/generated/wspace-operations.d.ts +351 -0
  2. package/dist/generated/wspace-operations.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.js +131 -71
  4. package/dist/generated/wspace-operations.js.map +1 -1
  5. package/dist/generated/wspace-types.d.ts +70519 -34096
  6. package/dist/generated/wspace-types.d.ts.map +1 -1
  7. package/dist/integrations/components/AddConnectionDialog.d.ts.map +1 -1
  8. package/dist/integrations/components/AddConnectionDialog.js +291 -521
  9. package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
  10. package/dist/integrations/components/AuthMethodSelector.d.ts +13 -0
  11. package/dist/integrations/components/AuthMethodSelector.d.ts.map +1 -0
  12. package/dist/integrations/components/AuthMethodSelector.js +49 -0
  13. package/dist/integrations/components/AuthMethodSelector.js.map +1 -0
  14. package/dist/integrations/components/AuthMethodsEditor.d.ts +10 -0
  15. package/dist/integrations/components/AuthMethodsEditor.d.ts.map +1 -0
  16. package/dist/integrations/components/AuthMethodsEditor.js +390 -0
  17. package/dist/integrations/components/AuthMethodsEditor.js.map +1 -0
  18. package/dist/integrations/components/ProviderIcon.d.ts +5 -4
  19. package/dist/integrations/components/ProviderIcon.d.ts.map +1 -1
  20. package/dist/integrations/components/ProviderIcon.js +18 -14
  21. package/dist/integrations/components/ProviderIcon.js.map +1 -1
  22. package/dist/integrations/components/SchemaForm.d.ts +60 -0
  23. package/dist/integrations/components/SchemaForm.d.ts.map +1 -0
  24. package/dist/integrations/components/SchemaForm.js +189 -0
  25. package/dist/integrations/components/SchemaForm.js.map +1 -0
  26. package/dist/integrations/hooks/useConnections.d.ts +12 -0
  27. package/dist/integrations/hooks/useConnections.d.ts.map +1 -1
  28. package/dist/integrations/hooks/useConnections.js +63 -52
  29. package/dist/integrations/hooks/useConnections.js.map +1 -1
  30. package/dist/integrations/hooks/useProviders.d.ts +27 -0
  31. package/dist/integrations/hooks/useProviders.d.ts.map +1 -1
  32. package/dist/integrations/hooks/useProviders.js +49 -33
  33. package/dist/integrations/hooks/useProviders.js.map +1 -1
  34. package/dist/integrations/pages/ConnectionsList.js +7 -7
  35. package/dist/integrations/pages/ProviderCatalog.js +10 -10
  36. package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
  37. package/dist/integrations/pages/ProviderEditorPage.d.ts.map +1 -1
  38. package/dist/integrations/pages/ProviderEditorPage.js +326 -315
  39. package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
  40. package/dist/integrations/types/index.d.ts +25 -1
  41. package/dist/integrations/types/index.d.ts.map +1 -1
  42. package/dist/integrations/utils/constants.d.ts +12 -13
  43. package/dist/integrations/utils/constants.d.ts.map +1 -1
  44. package/dist/integrations/utils/constants.js +1 -18
  45. package/dist/integrations/utils/constants.js.map +1 -1
  46. package/dist/integrations/utils/integrationsHelpers.d.ts +7 -0
  47. package/dist/integrations/utils/integrationsHelpers.d.ts.map +1 -1
  48. package/dist/integrations/utils/integrationsHelpers.js +4 -1
  49. package/dist/integrations/utils/integrationsHelpers.js.map +1 -1
  50. package/dist/integrations/utils/mappers.d.ts +0 -3
  51. package/dist/integrations/utils/mappers.d.ts.map +1 -1
  52. package/dist/integrations/utils/mappers.js +25 -4
  53. package/dist/integrations/utils/mappers.js.map +1 -1
  54. package/package.json +2 -2
@@ -1,332 +1,317 @@
1
1
  import { useIntegrations as e } from "../providers/IntegrationsProvider.js";
2
2
  import { cn as t } from "../utils/cn.js";
3
3
  import { INTEGRATION_PERMISSIONS as n } from "../constants/permissions.js";
4
- import { getAuthTypeLabel as r, getCategoryLabel as i, parseConfigSchema as a } from "../utils/integrationsHelpers.js";
5
- import { useGetConnectionLazyQuery as ee } from "../../generated/wspace-operations.js";
6
- import { useProvider as te, useProviders as ne } from "../hooks/useProviders.js";
7
- import { useAuthenticateWithApiKey as re, useAuthenticateWithBasicAuth as ie, useAuthenticateWithBearerToken as ae, useAuthenticateWithCustomConfig as oe, useAuthenticateWithServiceAccount as se, useCreateConnection as ce, useInitiateOAuth as le } from "../hooks/useConnections.js";
8
- import { waitForOAuthPopupCompletion as ue } from "../utils/oauthPopup.js";
9
- import { CredentialStorageSelector as de } from "./CredentialStorageSelector.js";
10
- import { ProviderIcon as o } from "./ProviderIcon.js";
11
- import { useCallback as fe, useEffect as s, useId as pe, useMemo as c, useRef as l, useState as u } from "react";
12
- import { AlertCircle as d, Check as me, CheckCircle2 as he, ExternalLink as ge, Info as _e, Key as f, Link2 as ve, Loader2 as p, Lock as m, Search as ye, Shield as be, X as xe } from "lucide-react";
13
- import { usePermissions as Se } from "@burdenoff/fe-libs/shared/providers/shell";
14
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
15
- import { IllustratedEmptyState as Ce } from "@burdenoff/fe-libs/ui";
4
+ import { getAuthTypeLabel as r, getCategoryLabel as i, legacyFlowForAuthType as ee } from "../utils/integrationsHelpers.js";
5
+ import { useGetConnectionLazyQuery as te } from "../../generated/wspace-operations.js";
6
+ import { useProvider as ne, useProviders as re } from "../hooks/useProviders.js";
7
+ import { useAuthenticateConnection as ie, useAuthenticateWithServiceAccount as ae, useCreateConnection as oe, useInitiateOAuth as se } from "../hooks/useConnections.js";
8
+ import { waitForOAuthPopupCompletion as ce } from "../utils/oauthPopup.js";
9
+ import { CredentialStorageSelector as le } from "./CredentialStorageSelector.js";
10
+ import { AuthMethodSelector as ue } from "./AuthMethodSelector.js";
11
+ import { ProviderIcon as a } from "./ProviderIcon.js";
12
+ import { SchemaForm as de, initialValuesFromSchema as fe, isSchemaComplete as pe, parseFormSchema as me, visibleValues as he } from "./SchemaForm.js";
13
+ import { useCallback as ge, useEffect as o, useId as _e, useMemo as s, useRef as c, useState as l } from "react";
14
+ import { AlertCircle as u, Check as ve, CheckCircle2 as ye, ExternalLink as be, Info as xe, Link2 as Se, Loader2 as d, Search as Ce, Shield as f, X as we } from "lucide-react";
15
+ import { usePermissions as Te } from "@burdenoff/fe-libs/shared/providers/shell";
16
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
17
+ import { IllustratedEmptyState as Ee } from "@burdenoff/fe-libs/ui";
16
18
  //#region src/integrations/components/AddConnectionDialog.tsx
17
- function v({ open: v, onClose: y, preselectedProviderId: b, onConnectionCreated: x }) {
18
- let { apiGatewayUrl: S } = e(), { providers: C, loading: w } = ne(), we = c(() => b ? (C ?? []).find((e) => e.id === b) ?? null : null, [C, b]), { provider: Te, loading: Ee } = te(!w && b && !we ? b : ""), T = we ?? Te, De = !!b && !T && (w || Ee), { hasPermission: Oe, isLoading: ke } = Se(), Ae = !ke && Oe(n.CONNECTION_CREATE), { createConnection: je, loading: Me } = ce(), { initiateOAuth: Ne, loading: Pe } = le(), { authenticateWithApiKey: Fe, loading: Ie } = re(), { authenticateWithBasicAuth: Le, loading: Re } = ie(), { authenticateWithBearerToken: ze, loading: Be } = ae(), { authenticateWithServiceAccount: Ve, loading: He } = se(), { authenticateWithCustomConfig: Ue, loading: We } = oe(), [E] = ee({ fetchPolicy: "network-only" }), [D, O] = u(null), [k, A] = u(!b), [j, Ge] = u("connection"), [M, Ke] = u(""), [N, P] = u(""), [F, qe] = u(""), [I, Je] = u(""), [L, Ye] = u(""), [R, Xe] = u(""), [z, Ze] = u(""), [B, V] = u({}), [H, Qe] = u({
19
+ function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated: y }) {
20
+ let { apiGatewayUrl: b } = e(), { providers: x, loading: S } = re(), C = s(() => v ? (x ?? []).find((e) => e.id === v) ?? null : null, [x, v]), { provider: De, loading: Oe } = ne(!S && v && !C ? v : ""), w = C ?? De, T = !!v && !w && (S || Oe), { hasPermission: ke, isLoading: Ae } = Te(), je = !Ae && ke(n.CONNECTION_CREATE), { createConnection: Me, loading: Ne } = oe(), { initiateOAuth: Pe, loading: Fe } = se(), { authenticateConnection: Ie, loading: Le } = ie(), { authenticateWithServiceAccount: Re, loading: ze } = ae(), [Be] = te({ fetchPolicy: "network-only" }), [E, D] = l(null), [O, k] = l(!v), [A, Ve] = l("connection"), [j, He] = l(""), [M, N] = l(""), [P, Ue] = l(""), [F, We] = l(null), [I, L] = l({}), [R, Ge] = l({
19
21
  mode: "managed",
20
22
  vaultId: "",
21
23
  secretId: "",
22
24
  managedSecretName: ""
23
- }), [U, $e] = u(!1), [et, W] = u(""), [G, K] = u(!1), [q, J] = u(!1), [, tt] = u(null), Y = l(null), X = l(null), nt = l(null), rt = pe(), Z = (e) => `${rt}-${e}`;
24
- s(() => {
25
- if (!v) return;
25
+ }), [Ke, z] = l(""), [B, V] = l(!1), [qe, H] = l(!1), [, U] = l(null), W = c(null), G = c(null), Je = c(null), Ye = _e(), K = (e) => `${Ye}-${e}`, q = s(() => (E?.authMethods ?? []).filter((e) => e.isEnabled), [E]), J = s(() => q.find((e) => e.key === F) ?? q[0] ?? null, [q, F]), Y = J?.flow ?? ee(E?.authType), Xe = J?.authType ?? E?.authType, X = s(() => J?.defaultScopes?.length ? J.defaultScopes : E?.defaultScopes ?? [], [J, E]), Z = s(() => me(J?.configSchema ?? E?.configSchema), [J, E]);
26
+ o(() => {
27
+ L(fe(Z)), z("");
28
+ }, [F, E?.id]), o(() => {
29
+ if (!g) return;
26
30
  let e = (e) => {
27
- e.key === "Escape" && y();
31
+ e.key === "Escape" && _();
28
32
  };
29
33
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
30
- }, [v, y]), s(() => () => {
31
- X.current?.(), Y.current && !Y.current.closed && Y.current.close();
32
- }, []), s(() => {
33
- v && (Ge("connection"), Ke(""), P(""), qe(""), Je(""), Ye(""), Xe(""), Ze(""), V({}), Qe({
34
+ }, [g, _]), o(() => () => {
35
+ G.current?.(), W.current && !W.current.closed && W.current.close();
36
+ }, []), o(() => {
37
+ g && (Ve("connection"), He(""), N(""), Ue(""), We(null), L({}), Ge({
34
38
  mode: "managed",
35
39
  vaultId: "",
36
40
  secretId: "",
37
41
  managedSecretName: ""
38
- }), $e(!1), W(""), K(!1), J(!1), tt(null), b ? (A(!1), O(null)) : (A(!0), O(null)));
39
- }, [v, b]), s(() => {
40
- v && b && T && !D && (O(T), P(`${T.name} Connection`), A(!1));
42
+ }), z(""), V(!1), H(!1), U(null), v ? (k(!1), D(null)) : (k(!0), D(null)));
43
+ }, [g, v]), o(() => {
44
+ g && v && w && !E && (D(w), N(`${w.name} Connection`), k(!1));
41
45
  }, [
46
+ g,
42
47
  v,
43
- b,
44
- T,
45
- D
46
- ]), s(() => {
47
- if (v && k) {
48
- let e = setTimeout(() => nt.current?.focus(), 100);
48
+ w,
49
+ E
50
+ ]), o(() => {
51
+ if (g && O) {
52
+ let e = setTimeout(() => Je.current?.focus(), 100);
49
53
  return () => clearTimeout(e);
50
54
  }
51
- }, [v, k]);
52
- let Q = c(() => {
53
- let e = (C ?? []).filter((e) => e.pluginStatus === "installed" && e.isEnabled);
54
- if (!M.trim()) return e;
55
- let t = M.toLowerCase();
55
+ }, [g, O]);
56
+ let Q = s(() => {
57
+ let e = (x ?? []).filter((e) => e.pluginStatus === "installed" && e.isEnabled);
58
+ if (!j.trim()) return e;
59
+ let t = j.toLowerCase();
56
60
  return e.filter((e) => e.name.toLowerCase().includes(t) || (e.description ?? "").toLowerCase().includes(t) || e.key.toLowerCase().includes(t));
57
- }, [C, M]), it = c(() => {
61
+ }, [x, j]), Ze = s(() => {
58
62
  let e = {};
59
63
  return Q.forEach((t) => {
60
64
  let n = t.category;
61
65
  e[n] || (e[n] = []), e[n].push(t);
62
66
  }), e;
63
- }, [Q]), at = fe((e) => {
64
- O(e), P(`${e.name} Connection`), A(!1), W("");
65
- }, []), $ = Me || Pe || q || Ie || Re || Be || He || We, ot = fe(async () => {
66
- if (!D || !N.trim()) return;
67
- let e = D.authType === "service_account";
67
+ }, [Q]), Qe = ge((e) => {
68
+ D(e), N(`${e.name} Connection`), k(!1), z("");
69
+ }, []), $ = Ne || Fe || qe || Le || ze, $e = ge(async () => {
70
+ if (!E || !M.trim()) return;
71
+ let e = Y === "minted";
68
72
  if (!e) {
69
- if (!H.vaultId) {
70
- W("Please select a vault for this connection");
73
+ if (!R.vaultId) {
74
+ z("Please select a vault for this connection");
71
75
  return;
72
76
  }
73
- if (H.mode === "existing" && !H.secretId) {
74
- W("Please select an existing vault secret");
77
+ if (R.mode === "existing" && !R.secretId) {
78
+ z("Please select an existing vault secret");
75
79
  return;
76
80
  }
77
81
  }
82
+ if (Y === "oauth2" && Z && !pe(Z, I)) {
83
+ z("Please fill in all required fields");
84
+ return;
85
+ }
86
+ if (J && !J.isConfigured) {
87
+ z("This authentication method is not configured in this environment. Ask an administrator to add its credentials, or pick another method.");
88
+ return;
89
+ }
78
90
  try {
79
- W("");
80
- let t = await je({
81
- name: N.trim(),
82
- description: F.trim() || void 0,
83
- providerId: D.id,
91
+ z("");
92
+ let t = await Me({
93
+ name: M.trim(),
94
+ description: P.trim() || void 0,
95
+ providerId: E.id,
96
+ authMethodKey: F ?? void 0,
97
+ ...Y === "oauth2" && Z ? { config: he(Z, I) } : {},
84
98
  ...e ? {} : {
85
- vaultId: H.vaultId,
86
- credentialSecretId: H.mode === "existing" ? H.secretId : void 0,
87
- managedSecretName: H.mode === "managed" && H.managedSecretName.trim() || void 0
99
+ vaultId: R.vaultId,
100
+ credentialSecretId: R.mode === "existing" ? R.secretId : void 0,
101
+ managedSecretName: R.mode === "managed" && R.managedSecretName.trim() || void 0
88
102
  }
89
103
  });
90
104
  if (!t) {
91
- W("Failed to create connection");
105
+ z("Failed to create connection");
92
106
  return;
93
107
  }
94
- switch (tt(t), D.authType) {
108
+ switch (U(t), Y) {
95
109
  case "oauth2": {
96
- let e = await Ne(t, S ? `${S}/integrations/oauth/callback` : "/integrations/oauth/callback", D.key);
110
+ let e = await Pe(t, b ? `${b}/integrations/oauth/callback` : "/integrations/oauth/callback", E.key);
97
111
  if (e?.redirectUrl) {
98
112
  let n = window.screenX + (window.innerWidth - 600) / 2, r = window.screenY + (window.innerHeight - 700) / 2, i = window.open(e.redirectUrl, "oauth_popup", `width=600,height=700,left=${n},top=${r},toolbar=no,menubar=no,scrollbars=yes,resizable=yes`);
99
113
  if (!i) {
100
- W("Popup was blocked. Please allow popups for this site and try again.");
114
+ z("Popup was blocked. Please allow popups for this site and try again.");
101
115
  return;
102
116
  }
103
- Y.current = i, J(!0), X.current?.(), X.current = ue({
117
+ W.current = i, H(!0), G.current?.(), G.current = ce({
104
118
  connectionId: t,
105
119
  popup: i,
106
120
  fetchConnectionStatus: async () => {
107
- let { data: e } = await E({ variables: { id: t } });
121
+ let { data: e } = await Be({ variables: { id: t } });
108
122
  return e?.getConnection ?? null;
109
123
  },
110
124
  onSuccess: () => {
111
- K(!0), x?.(t);
125
+ V(!0), y?.(t);
112
126
  },
113
- onError: W,
127
+ onError: z,
114
128
  onSettled: () => {
115
- X.current = null, Y.current = null, J(!1);
129
+ G.current = null, W.current = null, H(!1);
116
130
  }
117
131
  });
118
132
  return;
119
133
  }
120
- K(!0), x?.(t);
134
+ V(!0), y?.(t);
121
135
  break;
122
136
  }
123
- case "api_key":
124
- if (!I.trim()) {
125
- W("API key is required");
126
- return;
127
- }
128
- await Fe(t, I.trim()), K(!0), x?.(t);
129
- break;
130
- case "basic_auth":
131
- if (!L.trim() || !R.trim()) {
132
- W("Username and password are required");
133
- return;
134
- }
135
- await Le(t, L.trim(), R.trim()), K(!0), x?.(t);
136
- break;
137
- case "bearer_token":
138
- if (!z.trim()) {
139
- W("Bearer token is required");
140
- return;
141
- }
142
- await ze(t, z.trim()), K(!0), x?.(t);
137
+ case "minted":
138
+ Xe === "service_account" && await Re(t, X.length > 0 ? X : void 0), V(!0), y?.(t);
143
139
  break;
144
- case "service_account":
145
- await Ve(t, D.defaultScopes && D.defaultScopes.length > 0 ? D.defaultScopes : void 0), K(!0), x?.(t);
146
- break;
147
- case "custom": {
148
- let e = a(D.configSchema);
149
- if (!e) {
150
- W("This provider does not declare a configuration form");
151
- return;
152
- }
153
- for (let t of e.required) if (!B[t]?.trim()) {
154
- W(`${e.properties[t]?.title ?? t} is required`);
140
+ default: {
141
+ if (Z && !pe(Z, I)) {
142
+ z("Please fill in all required fields");
155
143
  return;
156
144
  }
157
- let n = {};
158
- for (let t of Object.keys(e.properties)) {
159
- let e = B[t]?.trim();
160
- e && (n[t] = e);
161
- }
162
- await Ue(t, n), K(!0), x?.(t);
163
- break;
145
+ let e = {};
146
+ for (let [t, n] of Object.entries(he(Z, I))) if (typeof n == "string") {
147
+ let r = n.trim();
148
+ r && (e[t] = r);
149
+ } else n != null && (e[t] = n);
150
+ await Ie(t, F ?? void 0, e), V(!0), y?.(t);
164
151
  }
165
- default: K(!0), x?.(t);
166
152
  }
167
153
  } catch (e) {
168
- W(e instanceof Error ? e.message : "Connection failed");
154
+ z(e instanceof Error ? e.message : "Connection failed");
169
155
  }
170
156
  }, [
171
- D,
172
- N,
157
+ E,
158
+ M,
159
+ P,
173
160
  F,
161
+ Y,
162
+ Xe,
163
+ X,
164
+ Z,
174
165
  I,
175
- L,
176
- R,
177
- z,
178
- B,
179
- je,
180
- Ne,
181
- E,
182
- Fe,
183
- Le,
184
- ze,
185
- Ve,
186
- Ue,
187
- S,
188
- x,
189
- H
190
- ]), st = [{
166
+ J,
167
+ Me,
168
+ Pe,
169
+ Be,
170
+ Ie,
171
+ Re,
172
+ b,
173
+ y,
174
+ R
175
+ ]), et = [{
191
176
  key: "connection",
192
177
  label: "Connection",
193
- icon: ve
178
+ icon: Se
194
179
  }, {
195
180
  key: "details",
196
181
  label: "Details",
197
- icon: _e
182
+ icon: xe
198
183
  }];
199
- return v ? !Ae && !ke ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
184
+ return g ? !je && !Ae ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
200
185
  className: "fixed inset-0 bg-bg-overlay z-50 animate-in fade-in-0 duration-200",
201
- onClick: y
202
- }), /* @__PURE__ */ _("div", {
186
+ onClick: _
187
+ }), /* @__PURE__ */ h("div", {
203
188
  role: "dialog",
204
189
  "aria-modal": "true",
205
190
  "aria-labelledby": "add-connection-denied-title",
206
191
  className: "fixed inset-x-4 top-1/2 z-50 mx-auto flex max-w-md -translate-y-1/2 flex-col items-center gap-4 rounded-xl border border-border-subtle bg-bg-surface p-8 shadow-2xl text-center",
207
192
  children: [
208
- /* @__PURE__ */ g(be, {
193
+ /* @__PURE__ */ m(f, {
209
194
  size: 40,
210
195
  className: "text-text-secondary"
211
196
  }),
212
- /* @__PURE__ */ g("h2", {
197
+ /* @__PURE__ */ m("h2", {
213
198
  id: "add-connection-denied-title",
214
199
  className: "text-lg font-semibold text-text-primary",
215
200
  children: "Access Denied"
216
201
  }),
217
- /* @__PURE__ */ g("p", {
202
+ /* @__PURE__ */ m("p", {
218
203
  className: "text-sm text-text-secondary",
219
204
  children: "You don't have permission to create connections."
220
205
  }),
221
- /* @__PURE__ */ g("button", {
206
+ /* @__PURE__ */ m("button", {
222
207
  type: "button",
223
- onClick: y,
208
+ onClick: _,
224
209
  className: "px-4 py-2 text-sm font-medium rounded-md border border-border-subtle hover:bg-accent transition-colors",
225
210
  children: "Close"
226
211
  })
227
212
  ]
228
- })] }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
213
+ })] }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
229
214
  className: "fixed inset-0 bg-bg-overlay z-50 animate-in fade-in-0 duration-200",
230
- onClick: y
231
- }), /* @__PURE__ */ _("div", {
215
+ onClick: _
216
+ }), /* @__PURE__ */ h("div", {
232
217
  role: "dialog",
233
218
  "aria-modal": "true",
234
219
  "aria-labelledby": "add-connection-dialog-title",
235
220
  className: "fixed inset-x-4 top-4 bottom-4 z-50 mx-auto flex w-auto max-w-2xl flex-col overflow-hidden rounded-xl border border-border-subtle bg-bg-surface shadow-2xl animate-in fade-in-0 zoom-in-95 duration-200 sm:inset-x-6 sm:top-1/2 sm:bottom-auto sm:w-full sm:-translate-y-1/2",
236
- children: [/* @__PURE__ */ _("div", {
221
+ children: [/* @__PURE__ */ h("div", {
237
222
  className: "flex items-center justify-between px-5 py-4 border-b border-border-subtle flex-shrink-0",
238
- children: [/* @__PURE__ */ g("div", {
223
+ children: [/* @__PURE__ */ m("div", {
239
224
  className: "flex items-center gap-3",
240
- children: D && !k ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(o, {
241
- provider: D,
225
+ children: E && !O ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(a, {
226
+ provider: E,
242
227
  size: 32
243
- }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("h2", {
228
+ }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("h2", {
244
229
  id: "add-connection-dialog-title",
245
230
  className: "text-base font-semibold text-text-primary",
246
- children: [D.name, " account"]
247
- }), /* @__PURE__ */ g("p", {
231
+ children: [E.name, " account"]
232
+ }), /* @__PURE__ */ m("p", {
248
233
  className: "text-xs text-text-secondary",
249
- children: r(D.authType)
250
- })] })] }) : /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("h2", {
234
+ children: r(E.authType)
235
+ })] })] }) : /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h2", {
251
236
  id: "add-connection-dialog-title",
252
237
  className: "text-base font-semibold text-text-primary",
253
238
  children: "Add new credential"
254
- }), /* @__PURE__ */ g("p", {
239
+ }), /* @__PURE__ */ m("p", {
255
240
  className: "text-xs text-text-secondary",
256
241
  children: "Select an app or service to connect to"
257
242
  })] })
258
- }), /* @__PURE__ */ _("div", {
243
+ }), /* @__PURE__ */ h("div", {
259
244
  className: "flex items-center gap-2",
260
- children: [D && !k && !G && /* @__PURE__ */ _("button", {
245
+ children: [E && !O && !B && /* @__PURE__ */ h("button", {
261
246
  type: "button",
262
- onClick: ot,
263
- disabled: $ || !N.trim(),
247
+ onClick: $e,
248
+ disabled: $ || !M.trim(),
264
249
  className: "inline-flex items-center gap-1.5 px-4 py-1.5 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors disabled:opacity-50",
265
- children: [$ ? /* @__PURE__ */ g(p, {
250
+ children: [$ ? /* @__PURE__ */ m(d, {
266
251
  size: 14,
267
252
  className: "animate-spin"
268
- }) : /* @__PURE__ */ g(me, { size: 14 }), q ? "Waiting..." : "Save"]
269
- }), /* @__PURE__ */ g("button", {
253
+ }) : /* @__PURE__ */ m(ve, { size: 14 }), qe ? "Waiting..." : "Save"]
254
+ }), /* @__PURE__ */ m("button", {
270
255
  type: "button",
271
- onClick: y,
256
+ onClick: _,
272
257
  className: "p-1.5 rounded-md hover:bg-accent transition-colors text-text-secondary hover:text-text-primary",
273
258
  "aria-label": "Close",
274
- children: /* @__PURE__ */ g(xe, { size: 20 })
259
+ children: /* @__PURE__ */ m(we, { size: 20 })
275
260
  })]
276
261
  })]
277
- }), /* @__PURE__ */ _("div", {
262
+ }), /* @__PURE__ */ h("div", {
278
263
  className: "flex flex-1 min-h-0 overflow-hidden",
279
264
  children: [
280
- k && !D && /* @__PURE__ */ _("div", {
265
+ O && !E && /* @__PURE__ */ h("div", {
281
266
  className: "flex-1 p-5 overflow-y-auto",
282
267
  children: [
283
- /* @__PURE__ */ g("p", {
268
+ /* @__PURE__ */ m("p", {
284
269
  className: "text-sm text-text-secondary mb-3",
285
270
  children: "Select an app or service to connect to"
286
271
  }),
287
- /* @__PURE__ */ _("div", {
272
+ /* @__PURE__ */ h("div", {
288
273
  className: "relative mb-4",
289
- children: [/* @__PURE__ */ g(ye, {
274
+ children: [/* @__PURE__ */ m(Ce, {
290
275
  size: 16,
291
276
  className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
292
- }), /* @__PURE__ */ g("input", {
293
- ref: nt,
277
+ }), /* @__PURE__ */ m("input", {
278
+ ref: Je,
294
279
  type: "text",
295
- value: M,
296
- onChange: (e) => Ke(e.target.value),
280
+ value: j,
281
+ onChange: (e) => He(e.target.value),
297
282
  placeholder: "Search providers...",
298
283
  "aria-label": "Search providers",
299
284
  className: "w-full pl-9 pr-3 py-2.5 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary"
300
285
  })]
301
286
  }),
302
- w ? /* @__PURE__ */ g("div", {
287
+ S ? /* @__PURE__ */ m("div", {
303
288
  className: "flex items-center justify-center py-8",
304
- children: /* @__PURE__ */ g(p, {
289
+ children: /* @__PURE__ */ m(d, {
305
290
  size: 24,
306
291
  className: "animate-spin text-text-secondary"
307
292
  })
308
- }) : Q.length === 0 ? /* @__PURE__ */ g(Ce, {
309
- illustration: M ? "empty-search" : "empty-data",
310
- title: M ? "No matching providers" : "No providers available",
311
- description: M ? `No installed provider matches “${M}”. Try a different term.` : "Install and enable a provider from the catalog to create a connection."
312
- }) : /* @__PURE__ */ g("div", {
293
+ }) : Q.length === 0 ? /* @__PURE__ */ m(Ee, {
294
+ illustration: j ? "empty-search" : "empty-data",
295
+ title: j ? "No matching providers" : "No providers available",
296
+ description: j ? `No installed provider matches “${j}”. Try a different term.` : "Install and enable a provider from the catalog to create a connection."
297
+ }) : /* @__PURE__ */ m("div", {
313
298
  className: "max-h-[400px] overflow-y-auto space-y-1",
314
- children: Object.entries(it).map(([e, t]) => /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("div", {
299
+ children: Object.entries(Ze).map(([e, t]) => /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
315
300
  className: "px-2 py-1.5 text-xs font-semibold text-text-secondary uppercase tracking-wider",
316
301
  children: i(e)
317
- }), t.map((e) => /* @__PURE__ */ _("button", {
302
+ }), t.map((e) => /* @__PURE__ */ h("button", {
318
303
  type: "button",
319
- onClick: () => at(e),
304
+ onClick: () => Qe(e),
320
305
  className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent/50 transition-colors text-left",
321
- children: [/* @__PURE__ */ g(o, {
306
+ children: [/* @__PURE__ */ m(a, {
322
307
  provider: e,
323
308
  size: 32
324
- }), /* @__PURE__ */ _("div", {
309
+ }), /* @__PURE__ */ h("div", {
325
310
  className: "flex-1 min-w-0",
326
- children: [/* @__PURE__ */ g("div", {
311
+ children: [/* @__PURE__ */ m("div", {
327
312
  className: "text-sm font-medium text-text-primary",
328
313
  children: e.name
329
- }), /* @__PURE__ */ g("div", {
314
+ }), /* @__PURE__ */ m("div", {
330
315
  className: "text-xs text-text-secondary",
331
316
  children: r(e.authType)
332
317
  })]
@@ -335,462 +320,247 @@ function v({ open: v, onClose: y, preselectedProviderId: b, onConnectionCreated:
335
320
  })
336
321
  ]
337
322
  }),
338
- !k && !D && De && /* @__PURE__ */ g("div", {
323
+ !O && !E && T && /* @__PURE__ */ m("div", {
339
324
  className: "flex-1 flex items-center justify-center",
340
- children: /* @__PURE__ */ g(p, {
325
+ children: /* @__PURE__ */ m(d, {
341
326
  size: 32,
342
327
  className: "animate-spin text-text-secondary"
343
328
  })
344
329
  }),
345
- !k && !D && !De && b && /* @__PURE__ */ _("div", {
330
+ !O && !E && !T && v && /* @__PURE__ */ h("div", {
346
331
  className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
347
- children: [/* @__PURE__ */ g(d, {
332
+ children: [/* @__PURE__ */ m(u, {
348
333
  size: 32,
349
334
  className: "text-text-secondary mb-3"
350
- }), /* @__PURE__ */ g("p", {
335
+ }), /* @__PURE__ */ m("p", {
351
336
  className: "text-sm text-text-secondary",
352
337
  children: "This provider isn't available."
353
338
  })]
354
339
  }),
355
- G && D && /* @__PURE__ */ _("div", {
340
+ B && E && /* @__PURE__ */ h("div", {
356
341
  className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
357
342
  children: [
358
- /* @__PURE__ */ g("div", {
343
+ /* @__PURE__ */ m("div", {
359
344
  className: "p-3 rounded-full bg-status-success-bg-subtle mb-4",
360
- children: /* @__PURE__ */ g(he, {
345
+ children: /* @__PURE__ */ m(ye, {
361
346
  size: 48,
362
347
  className: "text-status-success-text"
363
348
  })
364
349
  }),
365
- /* @__PURE__ */ g("h3", {
350
+ /* @__PURE__ */ m("h3", {
366
351
  className: "text-lg font-semibold text-text-primary mb-1",
367
352
  children: "Connection Created!"
368
353
  }),
369
- /* @__PURE__ */ _("p", {
354
+ /* @__PURE__ */ h("p", {
370
355
  className: "text-sm text-text-secondary mb-6",
371
356
  children: [
372
357
  "Your ",
373
- D.name,
358
+ E.name,
374
359
  " connection has been set up successfully."
375
360
  ]
376
361
  }),
377
- /* @__PURE__ */ g("button", {
362
+ /* @__PURE__ */ m("button", {
378
363
  type: "button",
379
- onClick: y,
364
+ onClick: _,
380
365
  className: "px-4 py-2 text-sm font-medium rounded-md bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
381
366
  children: "Close dialog"
382
367
  })
383
368
  ]
384
369
  }),
385
- D && !k && !G && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g("div", {
370
+ E && !O && !B && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
386
371
  className: "w-full border-b border-border-subtle sm:w-40 sm:border-b-0 sm:border-r flex-shrink-0 py-3 overflow-x-auto",
387
- children: st.map((e) => {
372
+ children: et.map((e) => {
388
373
  let n = e.icon;
389
- return /* @__PURE__ */ _("button", {
374
+ return /* @__PURE__ */ h("button", {
390
375
  type: "button",
391
- onClick: () => Ge(e.key),
392
- className: t("flex min-w-max items-center gap-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full", j === e.key ? "text-text-primary bg-accent/50 border-b-2 border-primary sm:border-b-0 sm:border-l-2" : "text-text-secondary hover:text-text-primary hover:bg-accent/30 border-b-2 border-transparent sm:border-b-0 sm:border-l-2"),
393
- children: [/* @__PURE__ */ g(n, { size: 16 }), e.label]
376
+ onClick: () => Ve(e.key),
377
+ className: t("flex min-w-max items-center gap-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full", A === e.key ? "text-text-primary bg-accent/50 border-b-2 border-primary sm:border-b-0 sm:border-l-2" : "text-text-secondary hover:text-text-primary hover:bg-accent/30 border-b-2 border-transparent sm:border-b-0 sm:border-l-2"),
378
+ children: [/* @__PURE__ */ m(n, { size: 16 }), e.label]
394
379
  }, e.key);
395
380
  })
396
- }), /* @__PURE__ */ _("div", {
381
+ }), /* @__PURE__ */ h("div", {
397
382
  className: "flex-1 p-5 overflow-y-auto",
398
- children: [j === "connection" && /* @__PURE__ */ _("div", {
383
+ children: [A === "connection" && /* @__PURE__ */ h("div", {
399
384
  className: "space-y-5",
400
385
  children: [
401
- et && /* @__PURE__ */ _("div", {
386
+ Ke && /* @__PURE__ */ h("div", {
402
387
  className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg/10 border border-status-error-border/20",
403
- children: [/* @__PURE__ */ g(d, {
388
+ children: [/* @__PURE__ */ m(u, {
404
389
  size: 16,
405
390
  className: "text-status-error-text flex-shrink-0"
406
- }), /* @__PURE__ */ g("span", {
391
+ }), /* @__PURE__ */ m("span", {
407
392
  className: "text-sm text-status-error-text",
408
- children: et
393
+ children: Ke
409
394
  })]
410
395
  }),
411
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
412
- htmlFor: Z("conn-name"),
396
+ /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
397
+ htmlFor: K("conn-name"),
413
398
  className: "block text-sm font-medium text-text-primary mb-1.5",
414
- children: ["Connection Name ", /* @__PURE__ */ g("span", {
399
+ children: ["Connection Name ", /* @__PURE__ */ m("span", {
415
400
  className: "text-status-error-text",
416
401
  children: "*"
417
402
  })]
418
- }), /* @__PURE__ */ g("input", {
419
- id: Z("conn-name"),
403
+ }), /* @__PURE__ */ m("input", {
404
+ id: K("conn-name"),
420
405
  "aria-label": "Connection Name",
421
406
  type: "text",
422
- value: N,
423
- onChange: (e) => P(e.target.value),
424
- placeholder: `My ${D.name} Connection`,
407
+ value: M,
408
+ onChange: (e) => N(e.target.value),
409
+ placeholder: `My ${E.name} Connection`,
425
410
  disabled: $,
426
411
  className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
427
412
  })] }),
428
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("label", {
429
- htmlFor: Z("conn-desc"),
413
+ /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
414
+ htmlFor: K("conn-desc"),
430
415
  className: "block text-sm font-medium text-text-primary mb-1.5",
431
416
  children: "Description"
432
- }), /* @__PURE__ */ g("input", {
433
- id: Z("conn-desc"),
417
+ }), /* @__PURE__ */ m("input", {
418
+ id: K("conn-desc"),
434
419
  "aria-label": "Description",
435
420
  type: "text",
436
- value: F,
437
- onChange: (e) => qe(e.target.value),
421
+ value: P,
422
+ onChange: (e) => Ue(e.target.value),
438
423
  placeholder: "Optional description",
439
424
  disabled: $,
440
425
  className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
441
426
  })] }),
442
- D.authType !== "service_account" && /* @__PURE__ */ g(de, {
443
- value: H,
444
- onChange: Qe,
445
- providerAuthType: D.authType
427
+ E.authType !== "service_account" && /* @__PURE__ */ m(le, {
428
+ value: R,
429
+ onChange: Ge,
430
+ providerAuthType: E.authType
446
431
  }),
447
- /* @__PURE__ */ _("div", {
448
- className: "rounded-md border border-border-subtle/50 bg-bg-surface p-4",
432
+ /* @__PURE__ */ h("div", {
433
+ className: "rounded-md border border-border-subtle/50 bg-bg-surface p-4 space-y-3",
449
434
  children: [
450
- /* @__PURE__ */ _("h3", {
451
- className: "font-medium text-text-primary flex items-center gap-2 mb-3 text-sm",
435
+ /* @__PURE__ */ h("h3", {
436
+ className: "font-medium text-text-primary flex items-center gap-2 text-sm",
452
437
  children: [
453
- /* @__PURE__ */ g(be, {
438
+ /* @__PURE__ */ m(f, {
454
439
  size: 16,
455
440
  className: "text-primary"
456
441
  }),
457
- "Authentication: ",
458
- r(D.authType)
459
- ]
460
- }),
461
- D.authType === "oauth2" && /* @__PURE__ */ g("div", {
462
- className: "space-y-3",
463
- children: q ? /* @__PURE__ */ _("div", {
464
- className: "flex flex-col items-center gap-3 py-4",
465
- children: [
466
- /* @__PURE__ */ g(p, {
467
- size: 28,
468
- className: "animate-spin text-primary"
469
- }),
470
- /* @__PURE__ */ _("p", {
471
- className: "text-sm font-medium text-text-primary",
472
- children: [
473
- "Waiting for ",
474
- D.name,
475
- " authorization…"
476
- ]
477
- }),
478
- /* @__PURE__ */ g("p", {
479
- className: "text-xs text-text-secondary",
480
- children: "Complete the sign-in in the popup window"
481
- }),
482
- /* @__PURE__ */ _("div", {
483
- className: "p-2 rounded-md bg-status-warning-bg-subtle border border-border-default text-xs text-status-warning-text flex items-center gap-1.5",
484
- children: [/* @__PURE__ */ g(ge, { size: 12 }), "Don't see the popup? Check if it was blocked"]
485
- })
486
- ]
487
- }) : /* @__PURE__ */ _("div", {
488
- className: "space-y-3",
489
- children: [/* @__PURE__ */ _("div", {
490
- className: "p-2.5 rounded-md bg-status-info-bg-subtle border border-border-default text-sm text-status-info-text flex items-center gap-2",
491
- children: [
492
- /* @__PURE__ */ g(ge, { size: 14 }),
493
- "A popup window will open for",
494
- " ",
495
- D.name,
496
- " sign-in"
497
- ]
498
- }), /* @__PURE__ */ _("button", {
499
- type: "button",
500
- onClick: ot,
501
- disabled: $ || !N.trim(),
502
- className: "w-full inline-flex items-center justify-center gap-2.5 rounded-md border border-primary bg-action-primary-bg px-4 py-2.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
442
+ "Authentication",
443
+ q.length <= 1 && /* @__PURE__ */ h("span", {
444
+ className: "text-text-secondary font-normal",
503
445
  children: [
504
- /* @__PURE__ */ g(o, {
505
- provider: D,
506
- size: 20
507
- }),
508
- "Sign in with",
446
+ "·",
509
447
  " ",
510
- D.name.replace(/^(Google|Microsoft)\s/, "")
511
- ]
512
- })]
513
- })
514
- }),
515
- D.authType === "api_key" && /* @__PURE__ */ _("div", {
516
- className: "space-y-3",
517
- children: [/* @__PURE__ */ _("p", {
518
- className: "text-xs text-text-secondary",
519
- children: [
520
- "Enter your ",
521
- D.name,
522
- " API key."
523
- ]
524
- }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
525
- htmlFor: Z("api-key"),
526
- className: "block text-sm font-medium text-text-primary mb-1.5",
527
- children: ["API Key ", /* @__PURE__ */ g("span", {
528
- className: "text-status-error-text",
529
- children: "*"
530
- })]
531
- }), /* @__PURE__ */ _("div", {
532
- className: "relative",
533
- children: [
534
- /* @__PURE__ */ g(f, {
535
- size: 14,
536
- className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
537
- }),
538
- /* @__PURE__ */ g("input", {
539
- id: Z("api-key"),
540
- "aria-label": "API Key",
541
- type: U ? "text" : "password",
542
- value: I,
543
- onChange: (e) => Je(e.target.value),
544
- placeholder: "Enter your API key",
545
- disabled: $,
546
- className: "w-full pl-9 pr-10 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
547
- }),
548
- /* @__PURE__ */ g("button", {
549
- type: "button",
550
- onClick: () => $e(!U),
551
- "aria-label": U ? "Hide secret" : "Show secret",
552
- className: "absolute right-3 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary",
553
- children: g(U ? m : f, { size: 14 })
554
- })
555
- ]
556
- })] })]
557
- }),
558
- D.authType === "basic_auth" && /* @__PURE__ */ _("div", {
559
- className: "space-y-3",
560
- children: [
561
- /* @__PURE__ */ _("p", {
562
- className: "text-xs text-text-secondary",
563
- children: [
564
- "Enter your ",
565
- D.name,
566
- " credentials."
448
+ J?.displayName ?? r(E.authType)
567
449
  ]
568
- }),
569
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
570
- htmlFor: Z("username"),
571
- className: "block text-sm font-medium text-text-primary mb-1.5",
572
- children: ["Username ", /* @__PURE__ */ g("span", {
573
- className: "text-status-error-text",
574
- children: "*"
575
- })]
576
- }), /* @__PURE__ */ g("input", {
577
- id: Z("username"),
578
- "aria-label": "Username",
579
- type: "text",
580
- value: L,
581
- onChange: (e) => Ye(e.target.value),
582
- placeholder: "Username or email",
583
- disabled: $,
584
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
585
- })] }),
586
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
587
- htmlFor: Z("password"),
588
- className: "block text-sm font-medium text-text-primary mb-1.5",
589
- children: ["Password ", /* @__PURE__ */ g("span", {
590
- className: "text-status-error-text",
591
- children: "*"
592
- })]
593
- }), /* @__PURE__ */ _("div", {
594
- className: "relative",
595
- children: [/* @__PURE__ */ g(m, {
596
- size: 14,
597
- className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
598
- }), /* @__PURE__ */ g("input", {
599
- id: Z("password"),
600
- "aria-label": "Password",
601
- type: "password",
602
- value: R,
603
- onChange: (e) => Xe(e.target.value),
604
- placeholder: "Password",
605
- disabled: $,
606
- className: "w-full pl-9 pr-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
607
- })]
608
- })] })
450
+ })
609
451
  ]
610
452
  }),
611
- D.authType === "bearer_token" && /* @__PURE__ */ _("div", {
612
- className: "space-y-3",
613
- children: [/* @__PURE__ */ _("p", {
614
- className: "text-xs text-text-secondary",
615
- children: [
616
- "Enter your ",
617
- D.name,
618
- " bearer token."
619
- ]
620
- }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("label", {
621
- htmlFor: Z("bearer-token"),
622
- className: "block text-sm font-medium text-text-primary mb-1.5",
623
- children: ["Bearer Token ", /* @__PURE__ */ g("span", {
624
- className: "text-status-error-text",
625
- children: "*"
626
- })]
627
- }), /* @__PURE__ */ _("div", {
628
- className: "relative",
629
- children: [/* @__PURE__ */ g(f, {
630
- size: 14,
631
- className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
632
- }), /* @__PURE__ */ g("input", {
633
- id: Z("bearer-token"),
634
- "aria-label": "Bearer Token",
635
- type: "password",
636
- value: z,
637
- onChange: (e) => Ze(e.target.value),
638
- placeholder: "Enter your token",
639
- disabled: $,
640
- className: "w-full pl-9 pr-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
641
- })]
642
- })] })]
453
+ /* @__PURE__ */ m(ue, {
454
+ methods: q,
455
+ selectedKey: J?.key ?? null,
456
+ onSelect: We,
457
+ disabled: $,
458
+ idPrefix: K("auth-method")
643
459
  }),
644
- D.authType === "service_account" && /* @__PURE__ */ g("div", {
645
- className: "space-y-3",
646
- children: /* @__PURE__ */ _("div", {
647
- className: "rounded-md border border-border bg-status-success-bg-subtle p-3",
460
+ Y === "oauth2" && /* @__PURE__ */ h(p, { children: [Z && /* @__PURE__ */ m(de, {
461
+ schema: Z,
462
+ values: I,
463
+ onChange: L,
464
+ disabled: $,
465
+ idPrefix: K("oauth-cfg")
466
+ }), /* @__PURE__ */ h("div", {
467
+ className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default",
468
+ children: [/* @__PURE__ */ m(be, {
469
+ size: 14,
470
+ className: "text-status-info-text flex-shrink-0"
471
+ }), /* @__PURE__ */ h("span", {
472
+ className: "text-xs text-status-info-text",
648
473
  children: [
649
- /* @__PURE__ */ g("p", {
650
- className: "text-sm font-medium text-foreground",
651
- children: "No credentials needed"
652
- }),
653
- /* @__PURE__ */ _("p", {
654
- className: "text-xs text-muted-foreground mt-1",
655
- children: [
656
- D.name,
657
- " is a first-party integration. Connecting grants ",
658
- D.name,
659
- " permission to act on your behalf; access tokens are issued securely per use — there are no keys or secrets to manage."
660
- ]
661
- }),
662
- D.defaultScopes && D.defaultScopes.length > 0 && /* @__PURE__ */ _("p", {
663
- className: "text-xs text-muted-foreground mt-2",
664
- children: ["Scopes: ", D.defaultScopes.join(", ")]
665
- })
474
+ "A popup window will open for ",
475
+ E.name,
476
+ " sign-in"
666
477
  ]
667
- })
478
+ })]
479
+ })] }),
480
+ Y === "minted" && /* @__PURE__ */ h("div", {
481
+ className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default",
482
+ children: [/* @__PURE__ */ m(f, {
483
+ size: 14,
484
+ className: "text-status-info-text flex-shrink-0"
485
+ }), /* @__PURE__ */ m("span", {
486
+ className: "text-xs text-status-info-text",
487
+ children: "No credentials to enter — access is granted on your behalf and tokens are issued per use."
488
+ })]
668
489
  }),
669
- D.authType === "custom" && (() => {
670
- let e = a(D.configSchema);
671
- if (!e) return /* @__PURE__ */ _("div", {
672
- className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg-subtle border border-border-default",
673
- children: [/* @__PURE__ */ g(d, {
674
- size: 16,
675
- className: "text-status-error-text flex-shrink-0"
676
- }), /* @__PURE__ */ g("span", {
677
- className: "text-sm text-status-error-text",
678
- children: "This provider does not declare a configuration form."
679
- })]
680
- });
681
- let t = new Set(e.required);
682
- return /* @__PURE__ */ _("div", {
683
- className: "space-y-3",
684
- children: [/* @__PURE__ */ _("p", {
685
- className: "text-xs text-text-secondary",
686
- children: [
687
- "Enter your ",
688
- D.name,
689
- " configuration. Secret fields are stored encrypted and never shown again."
690
- ]
691
- }), Object.entries(e.properties).map(([e, n]) => /* @__PURE__ */ _("div", { children: [
692
- /* @__PURE__ */ _("label", {
693
- htmlFor: Z(`custom-${e}`),
694
- className: "block text-sm font-medium text-text-primary mb-1.5",
695
- children: [
696
- n?.title ?? e,
697
- " ",
698
- t.has(e) && /* @__PURE__ */ g("span", {
699
- className: "text-status-error-text",
700
- children: "*"
701
- })
702
- ]
703
- }),
704
- n?.secret ? /* @__PURE__ */ g("textarea", {
705
- id: Z(`custom-${e}`),
706
- "aria-label": n?.title ?? e,
707
- value: B[e] ?? "",
708
- onChange: (t) => V((n) => ({
709
- ...n,
710
- [e]: t.target.value
711
- })),
712
- placeholder: n?.description,
713
- disabled: $,
714
- rows: 4,
715
- autoComplete: "off",
716
- spellCheck: !1,
717
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm font-mono focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
718
- }) : /* @__PURE__ */ g("input", {
719
- id: Z(`custom-${e}`),
720
- "aria-label": n?.title ?? e,
721
- type: "text",
722
- value: B[e] ?? "",
723
- onChange: (t) => V((n) => ({
724
- ...n,
725
- [e]: t.target.value
726
- })),
727
- placeholder: n?.description,
728
- disabled: $,
729
- autoComplete: "off",
730
- className: "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50"
731
- }),
732
- n?.description && /* @__PURE__ */ g("p", {
733
- className: "mt-1 text-xs text-text-secondary",
734
- children: n.description
735
- })
736
- ] }, e))]
737
- });
738
- })()
490
+ Y === "fields" && (Z ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("p", {
491
+ className: "text-xs text-text-secondary",
492
+ children: "Secret values are stored encrypted and never shown again."
493
+ }), /* @__PURE__ */ m(de, {
494
+ schema: Z,
495
+ values: I,
496
+ onChange: L,
497
+ disabled: $,
498
+ idPrefix: K("cred")
499
+ })] }) : /* @__PURE__ */ h("div", {
500
+ className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg-subtle border border-border-default",
501
+ children: [/* @__PURE__ */ m(u, {
502
+ size: 16,
503
+ className: "text-status-error-text flex-shrink-0"
504
+ }), /* @__PURE__ */ m("span", {
505
+ className: "text-sm text-status-error-text",
506
+ children: "This authentication method does not declare a configuration form."
507
+ })]
508
+ }))
739
509
  ]
740
510
  })
741
511
  ]
742
- }), j === "details" && /* @__PURE__ */ _("div", {
512
+ }), A === "details" && /* @__PURE__ */ h("div", {
743
513
  className: "space-y-4",
744
- children: [/* @__PURE__ */ g("h3", {
514
+ children: [/* @__PURE__ */ m("h3", {
745
515
  className: "text-sm font-semibold text-text-primary",
746
516
  children: "Details"
747
- }), /* @__PURE__ */ _("div", {
517
+ }), /* @__PURE__ */ h("div", {
748
518
  className: "space-y-3",
749
519
  children: [
750
- /* @__PURE__ */ _("div", {
520
+ /* @__PURE__ */ h("div", {
751
521
  className: "flex items-center gap-3 p-3 rounded-md border border-border-subtle",
752
- children: [/* @__PURE__ */ g(o, {
753
- provider: D,
522
+ children: [/* @__PURE__ */ m(a, {
523
+ provider: E,
754
524
  size: 40
755
- }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
525
+ }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
756
526
  className: "text-sm font-medium text-text-primary",
757
- children: D.name
758
- }), /* @__PURE__ */ _("p", {
527
+ children: E.name
528
+ }), /* @__PURE__ */ h("p", {
759
529
  className: "text-xs text-text-secondary",
760
530
  children: [
761
- r(D.authType),
531
+ r(E.authType),
762
532
  " ·",
763
533
  " ",
764
- i(D.category)
534
+ i(E.category)
765
535
  ]
766
536
  })] })]
767
537
  }),
768
- D.description && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("div", {
538
+ E.description && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
769
539
  className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
770
540
  children: "Description"
771
- }), /* @__PURE__ */ g("p", {
541
+ }), /* @__PURE__ */ m("p", {
772
542
  className: "text-sm text-text-primary mt-1",
773
- children: D.description
543
+ children: E.description
774
544
  })] }),
775
- D.website && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("div", {
545
+ E.website && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
776
546
  className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
777
547
  children: "Website"
778
- }), /* @__PURE__ */ g("a", {
779
- href: D.website,
548
+ }), /* @__PURE__ */ m("a", {
549
+ href: E.website,
780
550
  target: "_blank",
781
551
  rel: "noopener noreferrer",
782
552
  className: "block text-sm text-primary hover:underline mt-1",
783
- children: D.website
553
+ children: E.website
784
554
  })] }),
785
- D.docsUrl && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("div", {
555
+ E.docsUrl && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
786
556
  className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
787
557
  children: "Documentation"
788
- }), /* @__PURE__ */ g("a", {
789
- href: D.docsUrl,
558
+ }), /* @__PURE__ */ m("a", {
559
+ href: E.docsUrl,
790
560
  target: "_blank",
791
561
  rel: "noopener noreferrer",
792
562
  className: "block text-sm text-primary hover:underline mt-1",
793
- children: D.docsUrl
563
+ children: E.docsUrl
794
564
  })] })
795
565
  ]
796
566
  })]
@@ -801,6 +571,6 @@ function v({ open: v, onClose: y, preselectedProviderId: b, onConnectionCreated:
801
571
  })] }) : null;
802
572
  }
803
573
  //#endregion
804
- export { v as AddConnectionDialog };
574
+ export { g as AddConnectionDialog };
805
575
 
806
576
  //# sourceMappingURL=AddConnectionDialog.js.map