@burdenoff/microfe-integrations 2026.929.2 → 2026.930.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.
@@ -11,600 +11,630 @@ import { waitForOAuthPopupCompletion as le } from "../utils/oauthPopup.js";
11
11
  import { CredentialStorageSelector as ue } from "./CredentialStorageSelector.js";
12
12
  import { AuthMethodNotice as de, AuthMethodSelector as fe } from "./AuthMethodSelector.js";
13
13
  import { ProviderIcon as a } from "./ProviderIcon.js";
14
- import { SchemaForm as pe, initialValuesFromSchema as me, isSchemaComplete as he, parseFormSchema as ge, visibleValues as _e } from "./SchemaForm.js";
15
- import { useCallback as ve, useEffect as o, useId as ye, useMemo as s, useRef as c, useState as l } from "react";
16
- import { AlertCircle as u, Check as be, CheckCircle2 as xe, Copy as Se, ExternalLink as Ce, Info as we, Link2 as Te, Loader2 as d, Search as Ee, Shield as f, X as De } from "lucide-react";
17
- import { usePermissions as Oe } from "@burdenoff/fe-libs/shared/providers/shell";
14
+ import { ConnectionModalFrame as pe } from "./ConnectionModalFrame.js";
15
+ import { SchemaForm as me, initialValuesFromSchema as he, isSchemaComplete as ge, parseFormSchema as _e, visibleValues as ve } from "./SchemaForm.js";
16
+ import { useCallback as ye, useEffect as o, useId as be, useMemo as s, useRef as c, useState as l } from "react";
17
+ import { AlertCircle as u, Check as xe, CheckCircle2 as Se, Copy as Ce, ExternalLink as we, Info as Te, Link2 as Ee, Loader2 as d, Search as De, Shield as f, X as Oe } from "lucide-react";
18
+ import { usePermissions as ke } from "@burdenoff/fe-libs/shared/providers/shell";
18
19
  import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
19
- import { IllustratedEmptyState as ke } from "@burdenoff/fe-libs/ui";
20
+ import { IllustratedEmptyState as Ae } from "@burdenoff/fe-libs/ui";
20
21
  //#region src/integrations/components/AddConnectionDialog.tsx
21
- var Ae = 1100, je = 1101;
22
- function g({ open: g, onClose: _, preselectedProviderId: v, onConnectionCreated: y }) {
23
- let b = t(), Me = te(), x = ee(), { apiGatewayUrl: S } = e(), { providers: C, loading: w } = ie(), Ne = s(() => v ? (C ?? []).find((e) => e.id === v) ?? null : null, [C, v]), { provider: Pe, loading: Fe } = re(!w && v && !Ne ? v : ""), T = Ne ?? Pe, Ie = !!v && !T && (w || Fe), { hasPermission: Le, isLoading: Re } = Oe(), ze = !Re && Le(r.CONNECTION_CREATE), { createConnection: Be, loading: Ve } = se(), { initiateOAuth: He, loading: Ue } = ce(), { authenticateConnection: We, loading: Ge } = ae(), { authenticateWithServiceAccount: Ke, loading: qe } = oe(), [Je] = ne({ fetchPolicy: "network-only" }), [E, D] = l(null), [O, k] = l(!v), [A, Ye] = l("connection"), [j, Xe] = l(""), [M, N] = l(""), [P, Ze] = l(""), [F, Qe] = l(null), [I, L] = l({}), [R, $e] = l({
22
+ var g = ["connection", "details"];
23
+ function _({ open: _, onClose: v, preselectedProviderId: y, onConnectionCreated: b, presentation: je = "dialog", pickerTitle: Me }) {
24
+ let x = t(), Ne = te(), S = ee(), { apiGatewayUrl: Pe } = e(), { providers: C, loading: w } = ie(), Fe = s(() => y ? (C ?? []).find((e) => e.id === y) ?? null : null, [C, y]), { provider: Ie, loading: Le } = re(!w && y && !Fe ? y : ""), T = Fe ?? Ie, Re = !!y && !T && (w || Le), { hasPermission: ze, isLoading: Be } = ke(), Ve = !Be && ze(r.CONNECTION_CREATE), { createConnection: He, loading: Ue } = se(), { initiateOAuth: We, loading: Ge } = ce(), { authenticateConnection: Ke, loading: qe } = ae(), { authenticateWithServiceAccount: Je, loading: Ye } = oe(), [Xe] = ne({ fetchPolicy: "network-only" }), [E, D] = l(null), [O, k] = l(!y), [A, j] = l("connection"), [M, Ze] = l(""), [N, P] = l(""), [F, Qe] = l(""), [I, $e] = l(null), [L, R] = l({}), [z, et] = l({
24
25
  mode: "managed",
25
26
  vaultId: "",
26
27
  secretId: "",
27
28
  managedSecretName: ""
28
- }), [et, z] = l(""), [tt, nt] = l(!1), [B, V] = l(!1), [rt, H] = l(!1), [, it] = l(null), U = c(null), W = c(null), at = c(null), ot = ye(), G = (e) => `${ot}-${e}`, K = s(() => (E?.authMethods ?? []).filter((e) => e.isEnabled), [E]), q = s(() => K.find((e) => e.key === F) ?? K[0] ?? null, [K, F]), J = q?.flow ?? i(E?.authType), st = q?.authType ?? E?.authType, Y = S ? `${S}/integrations/oauth/callback` : "/integrations/oauth/callback", X = s(() => q?.defaultScopes?.length ? q.defaultScopes : E?.defaultScopes ?? [], [q, E]), Z = s(() => ge(q?.configSchema ?? E?.configSchema), [q, E]);
29
+ }), [tt, B] = l(""), [nt, rt] = l(!1), [it, V] = l(!1), [at, ot] = l(!1), [, st] = l(null), H = c(null), U = c(null), ct = c(null), lt = be(), W = (e) => `${lt}-${e}`, G = s(() => (E?.authMethods ?? []).filter((e) => e.isEnabled), [E]), K = s(() => G.find((e) => e.key === I) ?? G[0] ?? null, [G, I]), q = K?.flow ?? i(E?.authType), ut = K?.authType ?? E?.authType, J = Pe ? `${Pe}/integrations/oauth/callback` : "/integrations/oauth/callback", Y = s(() => K?.defaultScopes?.length ? K.defaultScopes : E?.defaultScopes ?? [], [K, E]), X = s(() => _e(K?.configSchema ?? E?.configSchema), [K, E]);
29
30
  o(() => {
30
- L(me(Z)), z("");
31
- }, [F, E?.id]), o(() => {
32
- if (!g) return;
33
- let e = (e) => {
34
- e.key === "Escape" && _();
35
- };
36
- return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
37
- }, [g, _]), o(() => () => {
38
- W.current?.(), U.current && !U.current.closed && U.current.close();
31
+ R(he(X)), B("");
32
+ }, [I, E?.id]), o(() => () => {
33
+ U.current?.(), H.current && !H.current.closed && H.current.close();
39
34
  }, []), o(() => {
40
- g && (Ye("connection"), Xe(""), N(""), Ze(""), Qe(null), L({}), $e({
35
+ _ && (j("connection"), Ze(""), P(""), Qe(""), $e(null), R({}), et({
41
36
  mode: "managed",
42
37
  vaultId: "",
43
38
  secretId: "",
44
39
  managedSecretName: ""
45
- }), z(""), V(!1), H(!1), it(null), v ? (k(!1), D(null)) : (k(!0), D(null)));
46
- }, [g, v]), o(() => {
47
- g && v && T && !E && (D(T), N(`${T.name} Connection`), k(!1));
40
+ }), B(""), V(!1), ot(!1), st(null), y ? (k(!1), D(null)) : (k(!0), D(null)));
41
+ }, [_, y]), o(() => {
42
+ _ && y && T && !E && (D(T), P(`${T.name} Connection`), k(!1));
48
43
  }, [
49
- g,
50
- v,
44
+ _,
45
+ y,
51
46
  T,
52
47
  E
53
48
  ]), o(() => {
54
- if (g && O) {
55
- let e = setTimeout(() => at.current?.focus(), 100);
49
+ if (_ && O) {
50
+ let e = setTimeout(() => ct.current?.focus(), 100);
56
51
  return () => clearTimeout(e);
57
52
  }
58
- }, [g, O]);
59
- let ct = !!(Z && Object.prototype.hasOwnProperty.call(Z.properties ?? {}, "clientId")), Q = s(() => {
53
+ }, [_, O]);
54
+ let dt = !!(X && Object.prototype.hasOwnProperty.call(X.properties ?? {}, "clientId")), Z = s(() => {
60
55
  let e = (C ?? []).filter((e) => e.pluginStatus === "installed" && e.isEnabled);
61
- if (!j.trim()) return e;
62
- let t = j.toLowerCase();
56
+ if (!M.trim()) return e;
57
+ let t = M.toLowerCase();
63
58
  return e.filter((e) => e.name.toLowerCase().includes(t) || (e.description ?? "").toLowerCase().includes(t) || e.key.toLowerCase().includes(t));
64
- }, [C, j]), lt = s(() => {
59
+ }, [C, M]), ft = s(() => {
65
60
  let e = {};
66
- return Q.forEach((t) => {
61
+ return Z.forEach((t) => {
67
62
  let n = t.category;
68
63
  e[n] || (e[n] = []), e[n].push(t);
69
64
  }), e;
70
- }, [Q]), ut = ve((e) => {
71
- D(e), N(`${e.name} Connection`), k(!1), z("");
72
- }, []), $ = Ve || Ue || rt || Ge || qe, dt = ve(async () => {
73
- if (!E || !M.trim()) return;
74
- let e = J === "minted";
65
+ }, [Z]), pt = ye((e) => {
66
+ D(e), P(`${e.name} Connection`), k(!1), B("");
67
+ }, []), Q = Ue || Ge || at || qe || Ye, mt = ye(async () => {
68
+ if (!E || !N.trim()) return;
69
+ let e = q === "minted";
75
70
  if (!e) {
76
- if (!R.vaultId) {
77
- z(b("integrations.addConnection.errors.vaultRequired", "Please select a vault for storing or referencing credentials"));
71
+ if (!z.vaultId) {
72
+ B(x("integrations.addConnection.errors.vaultRequired", "Please select a vault for storing or referencing credentials"));
78
73
  return;
79
74
  }
80
- if (R.mode === "existing" && !R.secretId) {
81
- z(b("integrations.addConnection.errors.secretRequired", "Please select an existing vault secret to reuse"));
75
+ if (z.mode === "existing" && !z.secretId) {
76
+ B(x("integrations.addConnection.errors.secretRequired", "Please select an existing vault secret to reuse"));
82
77
  return;
83
78
  }
84
79
  }
85
- if (J === "oauth2" && Z && !he(Z, I)) {
86
- z(b("integrations.addConnection.errors.fieldsRequired", "Please fill in all required fields"));
80
+ if (q === "oauth2" && X && !ge(X, L)) {
81
+ B(x("integrations.addConnection.errors.fieldsRequired", "Please fill in all required fields"));
87
82
  return;
88
83
  }
89
- if (q && !q.isConfigured) {
90
- z(b("integrations.addConnection.authentication.methodNotConfigured", "This authentication method is not configured in this environment. Ask an administrator to add its credentials, or pick another method."));
84
+ if (K && !K.isConfigured) {
85
+ B(x("integrations.addConnection.authentication.methodNotConfigured", "This authentication method is not configured in this environment. Ask an administrator to add its credentials, or pick another method."));
91
86
  return;
92
87
  }
93
88
  try {
94
- z("");
95
- let t = await Be({
96
- name: M.trim(),
97
- description: P.trim() || void 0,
89
+ B("");
90
+ let t = await He({
91
+ name: N.trim(),
92
+ description: F.trim() || void 0,
98
93
  providerId: E.id,
99
- authMethodKey: F ?? void 0,
100
- ...J === "oauth2" && Z ? { config: _e(Z, I) } : {},
94
+ authMethodKey: I ?? void 0,
95
+ ...q === "oauth2" && X ? { config: ve(X, L) } : {},
101
96
  ...e ? {} : {
102
- vaultId: R.vaultId,
103
- credentialSecretId: R.mode === "existing" ? R.secretId : void 0,
104
- managedSecretName: R.mode === "managed" && R.managedSecretName.trim() || void 0
97
+ vaultId: z.vaultId,
98
+ credentialSecretId: z.mode === "existing" ? z.secretId : void 0,
99
+ managedSecretName: z.mode === "managed" && z.managedSecretName.trim() || void 0
105
100
  }
106
101
  });
107
102
  if (!t) {
108
- z(b("integrations.addConnection.errors.createFailed", "Failed to create connection"));
103
+ B(x("integrations.addConnection.errors.createFailed", "Failed to create connection"));
109
104
  return;
110
105
  }
111
- switch (it(t), J) {
106
+ switch (st(t), q) {
112
107
  case "oauth2": {
113
- let e = await He(t, Y, E.key);
108
+ let e = await We(t, J, E.key);
114
109
  if (e?.redirectUrl) {
115
110
  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`);
116
111
  if (!i) {
117
- z(b("integrations.addConnection.authentication.popupBlocked", "Popup was blocked. Please allow popups for this site and try again."));
112
+ B(x("integrations.addConnection.authentication.popupBlocked", "Popup was blocked. Please allow popups for this site and try again."));
118
113
  return;
119
114
  }
120
- U.current = i, H(!0), W.current?.(), W.current = le({
115
+ H.current = i, ot(!0), U.current?.(), U.current = le({
121
116
  connectionId: t,
122
117
  popup: i,
123
118
  fetchConnectionStatus: async () => {
124
- let { data: e } = await Je({ variables: { id: t } });
119
+ let { data: e } = await Xe({ variables: { id: t } });
125
120
  return e?.getConnection ?? null;
126
121
  },
127
122
  onSuccess: () => {
128
- V(!0), y?.(t);
123
+ V(!0), b?.(t);
129
124
  },
130
- onError: z,
125
+ onError: B,
131
126
  onSettled: () => {
132
- W.current = null, U.current = null, H(!1);
127
+ U.current = null, H.current = null, ot(!1);
133
128
  }
134
129
  });
135
130
  return;
136
131
  }
137
- V(!0), y?.(t);
132
+ V(!0), b?.(t);
138
133
  break;
139
134
  }
140
135
  case "minted":
141
- st === "service_account" && await Ke(t, X.length > 0 ? X : void 0), V(!0), y?.(t);
136
+ ut === "service_account" && await Je(t, Y.length > 0 ? Y : void 0), V(!0), b?.(t);
142
137
  break;
143
138
  default: {
144
- if (Z && !he(Z, I)) {
145
- z(b("integrations.addConnection.errors.fieldsRequired", "Please fill in all required fields"));
139
+ if (X && !ge(X, L)) {
140
+ B(x("integrations.addConnection.errors.fieldsRequired", "Please fill in all required fields"));
146
141
  return;
147
142
  }
148
143
  let e = {};
149
- for (let [t, n] of Object.entries(_e(Z, I))) if (typeof n == "string") {
144
+ for (let [t, n] of Object.entries(ve(X, L))) if (typeof n == "string") {
150
145
  let r = n.trim();
151
146
  r && (e[t] = r);
152
147
  } else n != null && (e[t] = n);
153
- await We(t, F ?? void 0, e), V(!0), y?.(t);
148
+ await Ke(t, I ?? void 0, e), V(!0), b?.(t);
154
149
  }
155
150
  }
156
151
  } catch (e) {
157
- z(e instanceof Error ? e.message : b("integrations.addConnection.errors.authFailed", "Authentication failed"));
152
+ B(e instanceof Error ? e.message : x("integrations.addConnection.errors.authFailed", "Authentication failed"));
158
153
  }
159
154
  }, [
160
155
  E,
161
- M,
162
- P,
156
+ N,
163
157
  F,
164
- J,
165
- st,
166
- X,
167
- Z,
168
158
  I,
169
159
  q,
170
- Be,
160
+ ut,
161
+ Y,
162
+ X,
163
+ L,
164
+ K,
171
165
  He,
172
- Je,
173
166
  We,
167
+ Xe,
174
168
  Ke,
175
- S,
176
- y,
177
- R,
178
- b
179
- ]), ft = [{
169
+ Je,
170
+ Pe,
171
+ b,
172
+ z,
173
+ x
174
+ ]), ht = [{
180
175
  key: "connection",
181
- label: b("integrations.addConnection.tabs.connection", "Connection"),
182
- icon: Te
176
+ label: x("integrations.addConnection.tabs.connection", "Connection"),
177
+ icon: Ee
183
178
  }, {
184
179
  key: "details",
185
- label: b("integrations.addConnection.tabs.details", "Details"),
186
- icon: we
187
- }];
188
- return g ? !ze && !Re ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
189
- style: { zIndex: Ae },
190
- className: "fixed inset-0 bg-bg-overlay animate-in fade-in-0 duration-200",
191
- onClick: _
192
- }), /* @__PURE__ */ h("div", {
193
- role: "dialog",
194
- "aria-modal": "true",
195
- "aria-labelledby": "add-connection-denied-title",
196
- style: { zIndex: je },
197
- className: "fixed inset-x-4 top-1/2 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",
180
+ label: x("integrations.addConnection.tabs.details", "Details"),
181
+ icon: Te
182
+ }], gt = (e) => W(`tab-${e}`), _t = W("tabpanel"), vt = (e) => {
183
+ let t = g.indexOf(A), n;
184
+ e.key === "ArrowRight" || e.key === "ArrowDown" ? n = g[(t + 1) % g.length] : e.key === "ArrowLeft" || e.key === "ArrowUp" ? n = g[(t - 1 + g.length) % g.length] : e.key === "Home" ? n = g[0] : e.key === "End" && (n = g[g.length - 1]), n && (e.preventDefault(), j(n), document.getElementById(gt(n))?.focus());
185
+ };
186
+ if (!_) return null;
187
+ let $ = "add-connection-dialog-title", yt = "add-connection-denied-title", bt = !!E && !O && !it;
188
+ return !Ve && !Be ? /* @__PURE__ */ h(pe, {
189
+ onClose: v,
190
+ labelledBy: yt,
191
+ presentation: je,
192
+ size: "notice",
193
+ testId: "add-connection-dialog",
198
194
  children: [
199
195
  /* @__PURE__ */ m(f, {
200
196
  size: 40,
201
197
  className: "text-text-secondary"
202
198
  }),
203
199
  /* @__PURE__ */ m("h2", {
204
- id: "add-connection-denied-title",
200
+ id: yt,
205
201
  className: "text-lg font-semibold text-text-primary",
206
- children: b("integrations.addConnection.denied.title", "Access Denied")
202
+ children: x("integrations.addConnection.denied.title", "Access Denied")
207
203
  }),
208
204
  /* @__PURE__ */ m("p", {
209
205
  className: "text-sm text-text-secondary",
210
- children: b("integrations.addConnection.denied.description", "You don't have permission to create connections.")
206
+ children: x("integrations.addConnection.denied.description", "You don't have permission to create connections.")
211
207
  }),
212
208
  /* @__PURE__ */ m("button", {
213
209
  type: "button",
214
- onClick: _,
210
+ onClick: v,
215
211
  className: "px-4 py-2 text-sm font-medium rounded-md border border-border-subtle hover:bg-accent transition-colors",
216
- children: b("integrations.common.close", "Close")
212
+ children: x("integrations.common.close", "Close")
217
213
  })
218
214
  ]
219
- })] }) : /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
220
- style: { zIndex: Ae },
221
- className: "fixed inset-0 bg-bg-overlay animate-in fade-in-0 duration-200",
222
- onClick: _
223
- }), /* @__PURE__ */ h("div", {
224
- role: "dialog",
225
- "aria-modal": "true",
226
- "aria-labelledby": "add-connection-dialog-title",
227
- style: { zIndex: je },
228
- className: "fixed inset-x-4 top-4 bottom-4 mx-auto flex w-auto max-w-3xl 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:max-h-[min(90vh,56rem)] sm:w-full sm:-translate-y-1/2",
229
- children: [/* @__PURE__ */ h("div", {
230
- className: "flex items-center justify-between px-5 py-4 border-b border-border-subtle flex-shrink-0",
231
- children: [/* @__PURE__ */ m("div", {
232
- className: "flex items-center gap-3",
233
- children: E && !O ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(a, {
234
- provider: E,
235
- size: 32
236
- }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h2", {
237
- id: "add-connection-dialog-title",
238
- className: "text-base font-semibold text-text-primary",
239
- children: b("integrations.addConnection.dialog.accountTitle", "{{provider}} account", { provider: E.name })
240
- }), /* @__PURE__ */ m("p", {
241
- className: "text-xs text-text-secondary",
242
- children: x(E.authType)
243
- })] })] }) : /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("h2", {
244
- id: "add-connection-dialog-title",
245
- className: "text-base font-semibold text-text-primary",
246
- children: b("integrations.addConnection.dialog.title", "Add new credential")
247
- }), /* @__PURE__ */ m("p", {
248
- className: "text-xs text-text-secondary",
249
- children: b("integrations.addConnection.dialog.subtitle", "Select an app or service to connect to")
250
- })] })
251
- }), /* @__PURE__ */ h("div", {
252
- className: "flex items-center gap-2",
253
- children: [E && !O && !B && /* @__PURE__ */ h("button", {
254
- type: "button",
255
- onClick: dt,
256
- disabled: $ || !M.trim(),
257
- 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",
258
- children: [$ ? /* @__PURE__ */ m(d, {
259
- size: 14,
260
- className: "animate-spin"
261
- }) : /* @__PURE__ */ m(be, { size: 14 }), rt ? b("integrations.addConnection.actions.waiting", "Waiting...") : b("integrations.addConnection.actions.connect", "Connect")]
215
+ }) : /* @__PURE__ */ h(pe, {
216
+ onClose: v,
217
+ labelledBy: $,
218
+ presentation: je,
219
+ size: "form",
220
+ testId: "add-connection-dialog",
221
+ children: [
222
+ /* @__PURE__ */ h("div", {
223
+ className: "flex items-center justify-between px-5 py-4 border-b border-border-subtle flex-shrink-0",
224
+ children: [/* @__PURE__ */ m("div", {
225
+ className: "flex items-center gap-3 min-w-0",
226
+ children: E && !O ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(a, {
227
+ provider: E,
228
+ size: 32
229
+ }), /* @__PURE__ */ h("div", {
230
+ className: "min-w-0",
231
+ children: [/* @__PURE__ */ m("h2", {
232
+ id: $,
233
+ className: "text-base font-semibold text-text-primary",
234
+ children: x("integrations.addConnection.dialog.accountTitle", "{{provider}} account", { provider: E.name })
235
+ }), /* @__PURE__ */ m("p", {
236
+ className: "text-xs text-text-secondary",
237
+ children: S(E.authType)
238
+ })]
239
+ })] }) : /* @__PURE__ */ h("div", {
240
+ className: "min-w-0",
241
+ children: [/* @__PURE__ */ m("h2", {
242
+ id: $,
243
+ className: "text-base font-semibold text-text-primary",
244
+ children: Me ?? x("integrations.addConnection.dialog.title", "Add new credential")
245
+ }), /* @__PURE__ */ m("p", {
246
+ className: "text-xs text-text-secondary",
247
+ children: x("integrations.addConnection.dialog.subtitle", "Select an app or service to connect to")
248
+ })]
249
+ })
262
250
  }), /* @__PURE__ */ m("button", {
263
251
  type: "button",
264
- onClick: _,
265
- className: "p-1.5 rounded-md hover:bg-accent transition-colors text-text-secondary hover:text-text-primary",
266
- "aria-label": b("integrations.addConnection.actions.close", "Close dialog"),
267
- children: /* @__PURE__ */ m(De, { size: 20 })
252
+ onClick: v,
253
+ className: "flex-shrink-0 p-1.5 rounded-md hover:bg-accent transition-colors text-text-secondary hover:text-text-primary",
254
+ "aria-label": x("integrations.addConnection.actions.close", "Close dialog"),
255
+ children: /* @__PURE__ */ m(Oe, { size: 20 })
268
256
  })]
269
- })]
270
- }), /* @__PURE__ */ h("div", {
271
- className: "flex flex-1 min-h-0 overflow-hidden",
272
- children: [
273
- O && !E && /* @__PURE__ */ h("div", {
274
- className: "flex-1 p-5 overflow-y-auto",
275
- children: [
276
- /* @__PURE__ */ m("p", {
277
- className: "text-sm text-text-secondary mb-3",
278
- children: b("integrations.addConnection.dialog.subtitle", "Select an app or service to connect to")
279
- }),
280
- /* @__PURE__ */ h("div", {
281
- className: "relative mb-4",
282
- children: [/* @__PURE__ */ m(Ee, {
283
- size: 16,
284
- className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
285
- }), /* @__PURE__ */ m("input", {
286
- ref: at,
287
- type: "text",
288
- value: j,
289
- onChange: (e) => Xe(e.target.value),
290
- placeholder: b("integrations.addConnection.search.placeholder", "Search installed providers..."),
291
- "aria-label": b("integrations.addConnection.search.ariaLabel", "Search installed providers"),
292
- 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"
293
- })]
294
- }),
295
- w ? /* @__PURE__ */ m("div", {
296
- className: "flex items-center justify-center py-8",
297
- children: /* @__PURE__ */ m(d, {
298
- size: 24,
299
- className: "animate-spin text-text-secondary"
300
- })
301
- }) : Q.length === 0 ? /* @__PURE__ */ m(ke, {
302
- illustration: j ? "empty-search" : "empty-data",
303
- title: j ? b("integrations.addConnection.empty.noMatchingProviders", "No matching providers") : b("integrations.addConnection.empty.noInstalledProviders", "No installed providers yet"),
304
- description: j ? b("integrations.addConnection.empty.matchingDescription", "No installed provider matches your search. Try a different term or install one from the catalog.", { query: j }) : b("integrations.addConnection.empty.installedDescription", "You need at least one installed, enabled provider before you can create a connection. Install one from the catalog to get started.")
305
- }) : /* @__PURE__ */ m("div", {
306
- className: "max-h-[400px] overflow-y-auto space-y-1",
307
- children: Object.entries(lt).map(([e, t]) => /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
308
- className: "px-2 py-1.5 text-xs font-semibold text-text-secondary uppercase tracking-wider",
309
- children: Me(e)
310
- }), t.map((e) => /* @__PURE__ */ h("button", {
311
- type: "button",
312
- onClick: () => ut(e),
313
- className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent/50 transition-colors text-left",
314
- children: [/* @__PURE__ */ m(a, {
315
- provider: e,
316
- size: 32
317
- }), /* @__PURE__ */ h("div", {
318
- className: "flex-1 min-w-0",
319
- children: [/* @__PURE__ */ m("div", {
320
- className: "text-sm font-medium text-text-primary",
321
- children: e.name
322
- }), /* @__PURE__ */ m("div", {
323
- className: "text-xs text-text-secondary",
324
- children: x(e.authType)
325
- })]
257
+ }),
258
+ /* @__PURE__ */ h("div", {
259
+ "data-testid": "add-connection-body",
260
+ className: "flex flex-1 min-h-0 flex-col overflow-hidden sm:flex-row",
261
+ children: [
262
+ O && !E && /* @__PURE__ */ h("div", {
263
+ className: "flex-1 min-h-0 p-5 overflow-y-auto",
264
+ children: [
265
+ /* @__PURE__ */ m("p", {
266
+ className: "text-sm text-text-secondary mb-3",
267
+ children: x("integrations.addConnection.dialog.subtitle", "Select an app or service to connect to")
268
+ }),
269
+ /* @__PURE__ */ h("div", {
270
+ className: "relative mb-4",
271
+ children: [/* @__PURE__ */ m(De, {
272
+ size: 16,
273
+ className: "absolute left-3 top-1/2 -translate-y-1/2 text-text-secondary"
274
+ }), /* @__PURE__ */ m("input", {
275
+ ref: ct,
276
+ type: "text",
277
+ value: M,
278
+ onChange: (e) => Ze(e.target.value),
279
+ placeholder: x("integrations.addConnection.search.placeholder", "Search installed providers..."),
280
+ "aria-label": x("integrations.addConnection.search.ariaLabel", "Search installed providers"),
281
+ 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"
326
282
  })]
327
- }, e.id))] }, e))
328
- })
329
- ]
330
- }),
331
- !O && !E && Ie && /* @__PURE__ */ m("div", {
332
- className: "flex-1 flex items-center justify-center",
333
- children: /* @__PURE__ */ m(d, {
334
- size: 32,
335
- className: "animate-spin text-text-secondary"
336
- })
337
- }),
338
- !O && !E && !Ie && v && /* @__PURE__ */ h("div", {
339
- className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
340
- children: [/* @__PURE__ */ m(u, {
341
- size: 32,
342
- className: "text-text-secondary mb-3"
343
- }), /* @__PURE__ */ m("p", {
344
- className: "text-sm text-text-secondary",
345
- children: b("integrations.addConnection.providerUnavailable", "This provider isn't available.")
346
- })]
347
- }),
348
- B && E && /* @__PURE__ */ h("div", {
349
- className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
350
- children: [
351
- /* @__PURE__ */ m("div", {
352
- className: "p-3 rounded-full bg-status-success-bg-subtle mb-4",
353
- children: /* @__PURE__ */ m(xe, {
354
- size: 48,
355
- className: "text-status-success-text"
283
+ }),
284
+ w ? /* @__PURE__ */ m("div", {
285
+ className: "flex items-center justify-center py-8",
286
+ children: /* @__PURE__ */ m(d, {
287
+ size: 24,
288
+ className: "animate-spin text-text-secondary"
289
+ })
290
+ }) : Z.length === 0 ? /* @__PURE__ */ m(Ae, {
291
+ illustration: M ? "empty-search" : "empty-data",
292
+ title: M ? x("integrations.addConnection.empty.noMatchingProviders", "No matching providers") : x("integrations.addConnection.empty.noInstalledProviders", "No installed providers yet"),
293
+ description: M ? x("integrations.addConnection.empty.matchingDescription", "No installed provider matches your search. Try a different term or install one from the catalog.", { query: M }) : x("integrations.addConnection.empty.installedDescription", "You need at least one installed, enabled provider before you can create a connection. Install one from the catalog to get started.")
294
+ }) : /* @__PURE__ */ m("div", {
295
+ className: "max-h-[400px] overflow-y-auto space-y-1",
296
+ children: Object.entries(ft).map(([e, t]) => /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
297
+ className: "px-2 py-1.5 text-xs font-semibold text-text-secondary uppercase tracking-wider",
298
+ children: Ne(e)
299
+ }), t.map((e) => /* @__PURE__ */ h("button", {
300
+ type: "button",
301
+ onClick: () => pt(e),
302
+ className: "w-full flex items-center gap-3 px-3 py-2.5 rounded-md hover:bg-accent/50 transition-colors text-left",
303
+ children: [/* @__PURE__ */ m(a, {
304
+ provider: e,
305
+ size: 32
306
+ }), /* @__PURE__ */ h("div", {
307
+ className: "flex-1 min-w-0",
308
+ children: [/* @__PURE__ */ m("div", {
309
+ className: "text-sm font-medium text-text-primary",
310
+ children: e.name
311
+ }), /* @__PURE__ */ m("div", {
312
+ className: "text-xs text-text-secondary",
313
+ children: S(e.authType)
314
+ })]
315
+ })]
316
+ }, e.id))] }, e))
356
317
  })
357
- }),
358
- /* @__PURE__ */ m("h3", {
359
- className: "text-lg font-semibold text-text-primary mb-1",
360
- children: b("integrations.addConnection.success.title", "Connection Created!")
361
- }),
362
- /* @__PURE__ */ m("p", {
363
- className: "text-sm text-text-secondary mb-6",
364
- children: b("integrations.addConnection.success.description", "Your {{provider}} connection has been set up successfully.", { provider: E.name })
365
- }),
366
- /* @__PURE__ */ m("button", {
367
- type: "button",
368
- onClick: _,
369
- 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",
370
- children: b("integrations.addConnection.actions.close", "Close dialog")
318
+ ]
319
+ }),
320
+ !O && !E && Re && /* @__PURE__ */ m("div", {
321
+ className: "flex-1 flex items-center justify-center",
322
+ children: /* @__PURE__ */ m(d, {
323
+ size: 32,
324
+ className: "animate-spin text-text-secondary"
371
325
  })
372
- ]
373
- }),
374
- E && !O && !B && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
375
- 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",
376
- children: ft.map((e) => {
377
- let t = e.icon;
378
- return /* @__PURE__ */ h("button", {
379
- type: "button",
380
- onClick: () => Ye(e.key),
381
- className: n("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"),
382
- children: [/* @__PURE__ */ m(t, { size: 16 }), e.label]
383
- }, e.key);
384
- })
385
- }), /* @__PURE__ */ h("div", {
386
- className: "flex-1 p-5 overflow-y-auto",
387
- children: [A === "connection" && /* @__PURE__ */ h("div", {
388
- className: "space-y-5",
326
+ }),
327
+ !O && !E && !Re && y && /* @__PURE__ */ h("div", {
328
+ className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
329
+ children: [/* @__PURE__ */ m(u, {
330
+ size: 32,
331
+ className: "text-text-secondary mb-3"
332
+ }), /* @__PURE__ */ m("p", {
333
+ className: "text-sm text-text-secondary",
334
+ children: x("integrations.addConnection.providerUnavailable", "This provider isn't available.")
335
+ })]
336
+ }),
337
+ it && E && /* @__PURE__ */ h("div", {
338
+ className: "flex-1 flex flex-col items-center justify-center p-8 text-center",
389
339
  children: [
390
- et && /* @__PURE__ */ h("div", {
391
- className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg/10 border border-status-error-border/20",
392
- children: [/* @__PURE__ */ m(u, {
393
- size: 16,
394
- className: "text-status-error-text flex-shrink-0"
395
- }), /* @__PURE__ */ m("span", {
396
- className: "text-sm text-status-error-text",
397
- children: et
398
- })]
340
+ /* @__PURE__ */ m("div", {
341
+ className: "p-3 rounded-full bg-status-success-bg-subtle mb-4",
342
+ children: /* @__PURE__ */ m(Se, {
343
+ size: 48,
344
+ className: "text-status-success-text"
345
+ })
399
346
  }),
400
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
401
- htmlFor: G("conn-name"),
402
- className: "block text-sm font-medium text-text-primary mb-1.5",
403
- children: [
404
- b("integrations.addConnection.fields.connectionName", "Connection Name"),
405
- " ",
406
- /* @__PURE__ */ m("span", {
407
- className: "text-status-error-text",
408
- children: "*"
409
- })
410
- ]
411
- }), /* @__PURE__ */ m("input", {
412
- id: G("conn-name"),
413
- "aria-label": b("integrations.addConnection.fields.connectionName", "Connection Name"),
414
- type: "text",
415
- value: M,
416
- onChange: (e) => N(e.target.value),
417
- placeholder: b("integrations.addConnection.fields.connectionNamePlaceholder", "e.g., My {{provider}} Connection", { provider: E.name }),
418
- disabled: $,
419
- 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"
420
- })] }),
421
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
422
- htmlFor: G("conn-desc"),
423
- className: "block text-sm font-medium text-text-primary mb-1.5",
424
- children: b("integrations.addConnection.fields.description", "Description")
425
- }), /* @__PURE__ */ m("input", {
426
- id: G("conn-desc"),
427
- "aria-label": b("integrations.addConnection.fields.description", "Description"),
428
- type: "text",
429
- value: P,
430
- onChange: (e) => Ze(e.target.value),
431
- placeholder: b("integrations.addConnection.fields.descriptionPlaceholder", "Optional description..."),
432
- disabled: $,
433
- 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"
434
- })] }),
435
- E.authType !== "service_account" && /* @__PURE__ */ m(ue, {
436
- value: R,
437
- onChange: $e,
438
- providerAuthType: E.authType
347
+ /* @__PURE__ */ m("h3", {
348
+ className: "text-lg font-semibold text-text-primary mb-1",
349
+ children: x("integrations.addConnection.success.title", "Connection Created!")
439
350
  }),
440
- /* @__PURE__ */ h("div", {
441
- className: "rounded-md border border-border-subtle/50 bg-bg-surface p-4 space-y-3",
442
- children: [
443
- /* @__PURE__ */ h("div", {
444
- className: "flex items-center justify-between gap-3",
445
- children: [/* @__PURE__ */ h("h3", {
446
- className: "font-medium text-text-primary flex items-center gap-2 text-sm",
447
- children: [
448
- /* @__PURE__ */ m(f, {
449
- size: 16,
450
- className: "text-primary"
451
- }),
452
- b("integrations.addConnection.authentication.title", "Authentication"),
453
- K.length <= 1 && /* @__PURE__ */ h("span", {
454
- className: "text-text-secondary font-normal",
455
- children: [
456
- "·",
457
- " ",
458
- q?.displayName ?? x(E.authType)
459
- ]
460
- })
461
- ]
462
- }), /* @__PURE__ */ m(fe, {
463
- methods: K,
464
- selectedKey: F,
465
- onSelect: Qe,
466
- disabled: $,
467
- idPrefix: G("auth-method"),
468
- compact: !0
469
- })]
470
- }),
471
- /* @__PURE__ */ m("div", {
472
- className: "space-y-2",
473
- children: /* @__PURE__ */ m(de, { method: q })
474
- }),
475
- J === "oauth2" && /* @__PURE__ */ h(p, { children: [
476
- Z && /* @__PURE__ */ m(pe, {
477
- schema: Z,
478
- values: I,
479
- onChange: L,
480
- disabled: $,
481
- idPrefix: G("oauth-cfg")
482
- }),
483
- ct && /* @__PURE__ */ h("div", {
484
- className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 space-y-1.5",
485
- children: [/* @__PURE__ */ h("div", {
486
- className: "flex items-center justify-between gap-2",
487
- children: [/* @__PURE__ */ m("span", {
488
- className: "text-xs font-medium text-text-primary",
489
- children: b("integrations.addConnection.authentication.redirectUriLabel", "Redirect URL to register in your app")
490
- }), /* @__PURE__ */ h("button", {
491
- type: "button",
492
- onClick: () => {
493
- navigator.clipboard?.writeText(Y), nt(!0), window.setTimeout(() => nt(!1), 2e3);
494
- },
495
- className: "inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",
496
- children: [/* @__PURE__ */ m(Se, { size: 12 }), tt ? b("integrations.addConnection.authentication.copied", "Copied") : b("integrations.addConnection.authentication.copy", "Copy")]
497
- })]
498
- }), /* @__PURE__ */ m("code", {
499
- className: "block break-all text-xs text-text-secondary",
500
- children: Y
351
+ /* @__PURE__ */ m("p", {
352
+ className: "text-sm text-text-secondary mb-6",
353
+ children: x("integrations.addConnection.success.description", "Your {{provider}} connection has been set up successfully.", { provider: E.name })
354
+ }),
355
+ /* @__PURE__ */ m("button", {
356
+ type: "button",
357
+ onClick: v,
358
+ 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",
359
+ children: x("integrations.addConnection.actions.close", "Close dialog")
360
+ })
361
+ ]
362
+ }),
363
+ E && bt && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("div", {
364
+ role: "tablist",
365
+ "aria-labelledby": $,
366
+ "data-testid": "add-connection-tabs",
367
+ className: "flex flex-shrink-0 overflow-x-auto border-b border-border-subtle sm:block sm:w-40 sm:overflow-x-visible sm:border-b-0 sm:border-r sm:py-3",
368
+ children: ht.map((e) => {
369
+ let t = e.icon, r = A === e.key;
370
+ return /* @__PURE__ */ h("button", {
371
+ id: gt(e.key),
372
+ type: "button",
373
+ role: "tab",
374
+ "aria-selected": r,
375
+ "aria-controls": _t,
376
+ tabIndex: r ? 0 : -1,
377
+ onClick: () => j(e.key),
378
+ onKeyDown: vt,
379
+ className: n("flex min-w-max items-center gap-2 px-4 py-2 text-sm font-medium transition-colors sm:w-full", r ? "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"),
380
+ children: [/* @__PURE__ */ m(t, {
381
+ size: 16,
382
+ "aria-hidden": "true"
383
+ }), e.label]
384
+ }, e.key);
385
+ })
386
+ }), /* @__PURE__ */ h("div", {
387
+ id: _t,
388
+ role: "tabpanel",
389
+ "aria-labelledby": gt(A),
390
+ "data-testid": "add-connection-pane",
391
+ className: "flex-1 min-h-0 min-w-0 p-5 overflow-y-auto",
392
+ children: [A === "connection" && /* @__PURE__ */ h("div", {
393
+ className: "space-y-5",
394
+ children: [
395
+ tt && /* @__PURE__ */ h("div", {
396
+ className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg/10 border border-status-error-border/20",
397
+ children: [/* @__PURE__ */ m(u, {
398
+ size: 16,
399
+ className: "text-status-error-text flex-shrink-0"
400
+ }), /* @__PURE__ */ m("span", {
401
+ className: "text-sm text-status-error-text",
402
+ children: tt
403
+ })]
404
+ }),
405
+ /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("label", {
406
+ htmlFor: W("conn-name"),
407
+ className: "block text-sm font-medium text-text-primary mb-1.5",
408
+ children: [
409
+ x("integrations.addConnection.fields.connectionName", "Connection Name"),
410
+ " ",
411
+ /* @__PURE__ */ m("span", {
412
+ className: "text-status-error-text",
413
+ children: "*"
414
+ })
415
+ ]
416
+ }), /* @__PURE__ */ m("input", {
417
+ id: W("conn-name"),
418
+ "aria-label": x("integrations.addConnection.fields.connectionName", "Connection Name"),
419
+ type: "text",
420
+ value: N,
421
+ onChange: (e) => P(e.target.value),
422
+ placeholder: x("integrations.addConnection.fields.connectionNamePlaceholder", "e.g., My {{provider}} Connection", { provider: E.name }),
423
+ disabled: Q,
424
+ 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"
425
+ })] }),
426
+ /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("label", {
427
+ htmlFor: W("conn-desc"),
428
+ className: "block text-sm font-medium text-text-primary mb-1.5",
429
+ children: x("integrations.addConnection.fields.description", "Description")
430
+ }), /* @__PURE__ */ m("input", {
431
+ id: W("conn-desc"),
432
+ "aria-label": x("integrations.addConnection.fields.description", "Description"),
433
+ type: "text",
434
+ value: F,
435
+ onChange: (e) => Qe(e.target.value),
436
+ placeholder: x("integrations.addConnection.fields.descriptionPlaceholder", "Optional description..."),
437
+ disabled: Q,
438
+ 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"
439
+ })] }),
440
+ E.authType !== "service_account" && /* @__PURE__ */ m(ue, {
441
+ value: z,
442
+ onChange: et,
443
+ providerAuthType: E.authType
444
+ }),
445
+ /* @__PURE__ */ h("div", {
446
+ className: "rounded-md border border-border-subtle/50 bg-bg-surface p-4 space-y-3",
447
+ children: [
448
+ /* @__PURE__ */ h("div", {
449
+ className: "flex items-center justify-between gap-3",
450
+ children: [/* @__PURE__ */ h("h3", {
451
+ className: "font-medium text-text-primary flex items-center gap-2 text-sm",
452
+ children: [
453
+ /* @__PURE__ */ m(f, {
454
+ size: 16,
455
+ className: "text-primary"
456
+ }),
457
+ x("integrations.addConnection.authentication.title", "Authentication"),
458
+ G.length <= 1 && /* @__PURE__ */ h("span", {
459
+ className: "text-text-secondary font-normal",
460
+ children: [
461
+ "·",
462
+ " ",
463
+ K?.displayName ?? S(E.authType)
464
+ ]
465
+ })
466
+ ]
467
+ }), /* @__PURE__ */ m(fe, {
468
+ methods: G,
469
+ selectedKey: I,
470
+ onSelect: $e,
471
+ disabled: Q,
472
+ idPrefix: W("auth-method"),
473
+ compact: !0
501
474
  })]
502
475
  }),
503
- /* @__PURE__ */ h("div", {
476
+ /* @__PURE__ */ m("div", {
477
+ className: "space-y-2",
478
+ children: /* @__PURE__ */ m(de, { method: K })
479
+ }),
480
+ q === "oauth2" && /* @__PURE__ */ h(p, { children: [
481
+ X && /* @__PURE__ */ m(me, {
482
+ schema: X,
483
+ values: L,
484
+ onChange: R,
485
+ disabled: Q,
486
+ idPrefix: W("oauth-cfg")
487
+ }),
488
+ dt && /* @__PURE__ */ h("div", {
489
+ className: "rounded-md border border-border-subtle bg-bg-surface px-3 py-2 space-y-1.5",
490
+ children: [/* @__PURE__ */ h("div", {
491
+ className: "flex items-center justify-between gap-2",
492
+ children: [/* @__PURE__ */ m("span", {
493
+ className: "text-xs font-medium text-text-primary",
494
+ children: x("integrations.addConnection.authentication.redirectUriLabel", "Redirect URL to register in your app")
495
+ }), /* @__PURE__ */ h("button", {
496
+ type: "button",
497
+ onClick: () => {
498
+ navigator.clipboard?.writeText(J), rt(!0), window.setTimeout(() => rt(!1), 2e3);
499
+ },
500
+ className: "inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline",
501
+ children: [/* @__PURE__ */ m(Ce, { size: 12 }), nt ? x("integrations.addConnection.authentication.copied", "Copied") : x("integrations.addConnection.authentication.copy", "Copy")]
502
+ })]
503
+ }), /* @__PURE__ */ m("code", {
504
+ className: "block break-all text-xs text-text-secondary",
505
+ children: J
506
+ })]
507
+ }),
508
+ /* @__PURE__ */ h("div", {
509
+ className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default",
510
+ children: [/* @__PURE__ */ m(we, {
511
+ size: 14,
512
+ className: "text-status-info-text flex-shrink-0"
513
+ }), /* @__PURE__ */ m("span", {
514
+ className: "text-xs text-status-info-text",
515
+ children: x("integrations.addConnection.authentication.oauthPopupInfo", "A popup window will open for {{provider}} sign-in", { provider: E.name })
516
+ })]
517
+ })
518
+ ] }),
519
+ q === "minted" && /* @__PURE__ */ h("div", {
504
520
  className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default",
505
- children: [/* @__PURE__ */ m(Ce, {
521
+ children: [/* @__PURE__ */ m(f, {
506
522
  size: 14,
507
523
  className: "text-status-info-text flex-shrink-0"
508
524
  }), /* @__PURE__ */ m("span", {
509
525
  className: "text-xs text-status-info-text",
510
- children: b("integrations.addConnection.authentication.oauthPopupInfo", "A popup window will open for {{provider}} sign-in", { provider: E.name })
526
+ children: x("integrations.addConnection.authentication.serviceAccount.description", "No credentials to enter — access is granted on your behalf and tokens are issued per use.", { provider: E.name })
511
527
  })]
512
- })
513
- ] }),
514
- J === "minted" && /* @__PURE__ */ h("div", {
515
- className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default",
516
- children: [/* @__PURE__ */ m(f, {
517
- size: 14,
518
- className: "text-status-info-text flex-shrink-0"
519
- }), /* @__PURE__ */ m("span", {
520
- className: "text-xs text-status-info-text",
521
- children: b("integrations.addConnection.authentication.serviceAccount.description", "No credentials to enter — access is granted on your behalf and tokens are issued per use.", { provider: E.name })
522
- })]
528
+ }),
529
+ q === "fields" && (X ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("p", {
530
+ className: "text-xs text-text-secondary",
531
+ children: x("integrations.addConnection.authentication.secretsEncrypted", "Secret values are stored encrypted and never shown again.")
532
+ }), /* @__PURE__ */ m(me, {
533
+ schema: X,
534
+ values: L,
535
+ onChange: R,
536
+ disabled: Q,
537
+ idPrefix: W("cred")
538
+ })] }) : /* @__PURE__ */ h("div", {
539
+ className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg-subtle border border-border-default",
540
+ children: [/* @__PURE__ */ m(u, {
541
+ size: 16,
542
+ className: "text-status-error-text flex-shrink-0"
543
+ }), /* @__PURE__ */ m("span", {
544
+ className: "text-sm text-status-error-text",
545
+ children: x("integrations.addConnection.authentication.noForm", "This authentication method does not declare a configuration form.")
546
+ })]
547
+ }))
548
+ ]
549
+ })
550
+ ]
551
+ }), A === "details" && /* @__PURE__ */ h("div", {
552
+ className: "space-y-4",
553
+ children: [/* @__PURE__ */ m("h3", {
554
+ className: "text-sm font-semibold text-text-primary",
555
+ children: x("integrations.addConnection.tabs.details", "Details")
556
+ }), /* @__PURE__ */ h("div", {
557
+ className: "space-y-3",
558
+ children: [
559
+ /* @__PURE__ */ h("div", {
560
+ className: "flex items-center gap-3 p-3 rounded-md border border-border-subtle",
561
+ children: [/* @__PURE__ */ m(a, {
562
+ provider: E,
563
+ size: 40
564
+ }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
565
+ className: "text-sm font-medium text-text-primary",
566
+ children: E.name
567
+ }), /* @__PURE__ */ h("p", {
568
+ className: "text-xs text-text-secondary",
569
+ children: [
570
+ S(E.authType),
571
+ " ·",
572
+ " ",
573
+ Ne(E.category)
574
+ ]
575
+ })] })]
523
576
  }),
524
- J === "fields" && (Z ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("p", {
525
- className: "text-xs text-text-secondary",
526
- children: b("integrations.addConnection.authentication.secretsEncrypted", "Secret values are stored encrypted and never shown again.")
527
- }), /* @__PURE__ */ m(pe, {
528
- schema: Z,
529
- values: I,
530
- onChange: L,
531
- disabled: $,
532
- idPrefix: G("cred")
533
- })] }) : /* @__PURE__ */ h("div", {
534
- className: "flex items-center gap-2 px-3 py-2 rounded-md bg-status-error-bg-subtle border border-border-default",
535
- children: [/* @__PURE__ */ m(u, {
536
- size: 16,
537
- className: "text-status-error-text flex-shrink-0"
538
- }), /* @__PURE__ */ m("span", {
539
- className: "text-sm text-status-error-text",
540
- children: b("integrations.addConnection.authentication.noForm", "This authentication method does not declare a configuration form.")
541
- })]
542
- }))
577
+ E.description && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
578
+ className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
579
+ children: x("integrations.addConnection.fields.description", "Description")
580
+ }), /* @__PURE__ */ m("p", {
581
+ className: "text-sm text-text-primary mt-1",
582
+ children: E.description
583
+ })] }),
584
+ E.website && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
585
+ className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
586
+ children: x("integrations.providerDetail.sections.website", "Website")
587
+ }), /* @__PURE__ */ m("a", {
588
+ href: E.website,
589
+ target: "_blank",
590
+ rel: "noopener noreferrer",
591
+ className: "block text-sm text-primary hover:underline mt-1",
592
+ children: E.website
593
+ })] }),
594
+ E.docsUrl && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
595
+ className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
596
+ children: x("integrations.providerDetail.sections.documentation", "Documentation")
597
+ }), /* @__PURE__ */ m("a", {
598
+ href: E.docsUrl,
599
+ target: "_blank",
600
+ rel: "noopener noreferrer",
601
+ className: "block text-sm text-primary hover:underline mt-1",
602
+ children: E.docsUrl
603
+ })] })
543
604
  ]
544
- })
545
- ]
546
- }), A === "details" && /* @__PURE__ */ h("div", {
547
- className: "space-y-4",
548
- children: [/* @__PURE__ */ m("h3", {
549
- className: "text-sm font-semibold text-text-primary",
550
- children: b("integrations.addConnection.tabs.details", "Details")
551
- }), /* @__PURE__ */ h("div", {
552
- className: "space-y-3",
553
- children: [
554
- /* @__PURE__ */ h("div", {
555
- className: "flex items-center gap-3 p-3 rounded-md border border-border-subtle",
556
- children: [/* @__PURE__ */ m(a, {
557
- provider: E,
558
- size: 40
559
- }), /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
560
- className: "text-sm font-medium text-text-primary",
561
- children: E.name
562
- }), /* @__PURE__ */ h("p", {
563
- className: "text-xs text-text-secondary",
564
- children: [
565
- x(E.authType),
566
- " ·",
567
- " ",
568
- Me(E.category)
569
- ]
570
- })] })]
571
- }),
572
- E.description && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
573
- className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
574
- children: b("integrations.addConnection.fields.description", "Description")
575
- }), /* @__PURE__ */ m("p", {
576
- className: "text-sm text-text-primary mt-1",
577
- children: E.description
578
- })] }),
579
- E.website && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
580
- className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
581
- children: b("integrations.providerDetail.sections.website", "Website")
582
- }), /* @__PURE__ */ m("a", {
583
- href: E.website,
584
- target: "_blank",
585
- rel: "noopener noreferrer",
586
- className: "block text-sm text-primary hover:underline mt-1",
587
- children: E.website
588
- })] }),
589
- E.docsUrl && /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("div", {
590
- className: "text-xs font-medium text-text-secondary uppercase tracking-wider",
591
- children: b("integrations.providerDetail.sections.documentation", "Documentation")
592
- }), /* @__PURE__ */ m("a", {
593
- href: E.docsUrl,
594
- target: "_blank",
595
- rel: "noopener noreferrer",
596
- className: "block text-sm text-primary hover:underline mt-1",
597
- children: E.docsUrl
598
- })] })
599
- ]
605
+ })]
600
606
  })]
601
- })]
602
- })] })
603
- ]
604
- })]
605
- })] }) : null;
607
+ })] })
608
+ ]
609
+ }),
610
+ E && bt && /* @__PURE__ */ h("div", {
611
+ "data-testid": "add-connection-footer",
612
+ className: "flex flex-shrink-0 items-center justify-end gap-2 border-t border-border-subtle px-5 py-3",
613
+ children: [/* @__PURE__ */ m("button", {
614
+ type: "button",
615
+ onClick: v,
616
+ className: "px-4 py-2 text-sm font-medium rounded-md border border-border-subtle text-text-primary hover:bg-accent transition-colors",
617
+ children: x("integrations.addConnection.actions.cancel", "Cancel")
618
+ }), /* @__PURE__ */ h("button", {
619
+ type: "button",
620
+ "data-testid": "add-connection-submit",
621
+ onClick: mt,
622
+ disabled: Q || !N.trim(),
623
+ className: "inline-flex items-center gap-1.5 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 disabled:opacity-50",
624
+ children: [Q ? /* @__PURE__ */ m(d, {
625
+ size: 14,
626
+ className: "animate-spin",
627
+ "aria-hidden": "true"
628
+ }) : /* @__PURE__ */ m(xe, {
629
+ size: 14,
630
+ "aria-hidden": "true"
631
+ }), at ? x("integrations.addConnection.actions.waiting", "Waiting...") : x("integrations.addConnection.actions.connect", "Connect")]
632
+ })]
633
+ })
634
+ ]
635
+ });
606
636
  }
607
637
  //#endregion
608
- export { g as AddConnectionDialog };
638
+ export { _ as AddConnectionDialog };
609
639
 
610
640
  //# sourceMappingURL=AddConnectionDialog.js.map