@w6w/ui 0.1.1 → 0.2.0

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 (37) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +7 -5
  3. package/dist/AppPicker.d.ts +1 -0
  4. package/dist/ConfirmModal-ChoiGy2K.cjs +11 -0
  5. package/dist/ConfirmModal-ChoiGy2K.cjs.map +1 -0
  6. package/dist/{ConfirmModal-CD-P8mhN.js → ConfirmModal-Wx3i8F1n.js} +1588 -1564
  7. package/dist/ConfirmModal-Wx3i8F1n.js.map +1 -0
  8. package/dist/ConnectionHeader.d.ts +19 -0
  9. package/dist/EditConnectionModal.d.ts +21 -0
  10. package/dist/app-pages.d.ts +3 -0
  11. package/dist/components/AuthFieldsForm.d.ts +8 -1
  12. package/dist/components/CallableList.d.ts +57 -0
  13. package/dist/components/ConnectionList.d.ts +44 -0
  14. package/dist/components/ListItem.d.ts +16 -6
  15. package/dist/components/ReliabilityChart.d.ts +10 -0
  16. package/dist/components/ReliabilityList.d.ts +47 -0
  17. package/dist/connection-app-meta.d.ts +32 -0
  18. package/dist/flow.cjs +1 -1
  19. package/dist/flow.mjs +2 -2
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.ts +16 -0
  23. package/dist/index.mjs +1700 -891
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/provider.d.ts +19 -0
  26. package/dist/reliability-board-layout.d.ts +121 -0
  27. package/dist/types.d.ts +8 -0
  28. package/package.json +2 -2
  29. package/src/styles/_callable-list.scss +60 -0
  30. package/src/styles/_connections.scss +100 -0
  31. package/src/styles/_lists.scss +4 -0
  32. package/src/styles/_reliability.scss +339 -0
  33. package/src/styles.css +592 -0
  34. package/src/styles.scss +3 -0
  35. package/dist/ConfirmModal-8avl9Nv8.cjs +0 -11
  36. package/dist/ConfirmModal-8avl9Nv8.cjs.map +0 -1
  37. package/dist/ConfirmModal-CD-P8mhN.js.map +0 -1
package/dist/index.mjs CHANGED
@@ -1,44 +1,44 @@
1
1
  "use client";
2
- var Tt = Object.defineProperty;
3
- var At = (e, s, n) => s in e ? Tt(e, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[s] = n;
4
- var V = (e, s, n) => At(e, typeof s != "symbol" ? s + "" : s, n);
5
- import { j as Et, a0 as Mt, J as z, ab as _t, M as Ve, L as Pt, l as It, am as L } from "./ConfirmModal-CD-P8mhN.js";
6
- import { aa as en, Q as tn, a9 as sn, an as nn, ao as an, ap as rn, H as ln, a1 as on, a8 as cn, aq as dn, S as un, ar as wn, as as mn, at as hn, au as pn, av as fn, Y as vn, aw as yn, ax as Nn, ay as gn, u as bn } from "./ConfirmModal-CD-P8mhN.js";
7
- import { jsxs as o, jsx as t, Fragment as k } from "react/jsx-runtime";
8
- import { useMemo as ye, useState as v, useEffect as G, useId as Ut, useRef as Ft } from "react";
9
- import { C as ke } from "./CodeBlock-Dot3Pd7P.js";
10
- import { yaml as Lt } from "@codemirror/lang-yaml";
11
- import { EditorView as Bt } from "@codemirror/view";
12
- import Jt from "@uiw/react-codemirror";
13
- import { u as Dt, a as Ht, b as jt, C as qt, I as ze } from "./Copyable-1niV9gUa.js";
14
- import { i as xn } from "./Copyable-1niV9gUa.js";
15
- class ce extends Error {
16
- constructor(n, l, d, a) {
17
- super(d);
18
- V(this, "status");
19
- V(this, "code");
2
+ var jt = Object.defineProperty;
3
+ var Kt = (e, n, a) => n in e ? jt(e, n, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[n] = a;
4
+ var ne = (e, n, a) => Kt(e, typeof n != "symbol" ? n + "" : n, a);
5
+ import { j as ut, a0 as Wt, J as ae, ab as qt, M as Ae, L as Ht, l as zt, am as z, Q as de, an as Vt, ao as Yt } from "./ConfirmModal-Wx3i8F1n.js";
6
+ import { aa as Oa, a9 as Ma, ap as Ia, aq as Ea, H as Pa, a1 as _a, a8 as La, ar as Ua, S as Da, as as Ba, at as Fa, au as Ja, av as ja, aw as Ka, Y as Wa, ax as qa, ay as Ha, u as za } from "./ConfirmModal-Wx3i8F1n.js";
7
+ import { jsxs as l, jsx as t, Fragment as C } from "react/jsx-runtime";
8
+ import { useMemo as Te, useState as y, useEffect as q, useId as Gt, useRef as Qt } from "react";
9
+ import { C as Me } from "./CodeBlock-Dot3Pd7P.js";
10
+ import { yaml as Zt } from "@codemirror/lang-yaml";
11
+ import { EditorView as Xt } from "@codemirror/view";
12
+ import en from "@uiw/react-codemirror";
13
+ import { u as tn, a as nn, b as an, C as sn, I as et } from "./Copyable-1niV9gUa.js";
14
+ import { i as Ya } from "./Copyable-1niV9gUa.js";
15
+ class se extends Error {
16
+ constructor(a, i, c, r) {
17
+ super(c);
18
+ ne(this, "status");
19
+ ne(this, "code");
20
20
  /**
21
21
  * The parsed error response body, when the server sent one. Carries the
22
22
  * fields that ride alongside an error — e.g. an invoke's `logs` and
23
23
  * `apiCalls` — which the message alone would drop.
24
24
  */
25
- V(this, "body");
26
- this.name = "ApiError", this.status = n, this.code = l, this.body = a;
25
+ ne(this, "body");
26
+ this.name = "ApiError", this.status = a, this.code = i, this.body = r;
27
27
  }
28
28
  }
29
- function _s(e) {
30
- const s = e.baseUrl.replace(/\/$/, ""), n = e.fetch ?? globalThis.fetch, l = async () => typeof e.token == "function" ? await e.token() : e.token;
31
- async function d(r, c) {
32
- const u = new Headers(c == null ? void 0 : c.headers), w = await l();
33
- w && u.set("authorization", `Bearer ${w}`), c != null && c.body && !u.has("content-type") && u.set("content-type", "application/json");
29
+ function ra(e) {
30
+ const n = e.baseUrl.replace(/\/$/, ""), a = e.fetch ?? globalThis.fetch, i = async () => typeof e.token == "function" ? await e.token() : e.token;
31
+ async function c(s, o) {
32
+ const u = new Headers(o == null ? void 0 : o.headers), w = await i();
33
+ w && u.set("authorization", `Bearer ${w}`), o != null && o.body && !u.has("content-type") && u.set("content-type", "application/json");
34
34
  let h;
35
35
  try {
36
- h = await n(`${s}${r}`, { ...c, headers: u });
37
- } catch (N) {
38
- throw new ce(
36
+ h = await a(`${n}${s}`, { ...o, headers: u });
37
+ } catch (g) {
38
+ throw new se(
39
39
  0,
40
40
  "network_error",
41
- `Could not reach the w6w server (${(c == null ? void 0 : c.method) ?? "GET"} ${s}${r}). It may be down or unreachable. (${N.message})`
41
+ `Could not reach the w6w server (${(o == null ? void 0 : o.method) ?? "GET"} ${n}${s}). It may be down or unreachable. (${g.message})`
42
42
  );
43
43
  }
44
44
  const m = await h.text();
@@ -48,66 +48,82 @@ function _s(e) {
48
48
  p = JSON.parse(m);
49
49
  } catch {
50
50
  if (!h.ok)
51
- throw new ce(
51
+ throw new se(
52
52
  h.status,
53
53
  "bad_response",
54
54
  `Server returned a non-JSON ${h.status} response: ${m.slice(0, 200)}`
55
55
  );
56
56
  }
57
57
  if (!h.ok) {
58
- const N = (p == null ? void 0 : p.error) ?? {};
59
- throw new ce(h.status, N.code ?? "error", N.message ?? h.statusText, p);
58
+ const g = (p == null ? void 0 : p.error) ?? {};
59
+ throw new se(h.status, g.code ?? "error", g.message ?? h.statusText, p);
60
60
  }
61
61
  return { status: h.status, data: p };
62
62
  }
63
- async function a(r, c) {
64
- const { data: u } = await d(r, c);
63
+ async function r(s, o) {
64
+ const { data: u } = await c(s, o);
65
65
  return u;
66
66
  }
67
67
  return {
68
68
  // A bare GET only returns the server's default page (50) — every consumer
69
- // of this client treats the result as the complete catalog, so page
70
- // through it here. Capped at 20 pages as a runaway backstop.
69
+ // of this client treats the result as the complete catalog, so walk one
70
+ // server snapshot by `nextCursor` (opaque; the cursor encodes the
71
+ // snapshot, so `snapshot`/`offset` are never sent). No page cap: the walk
72
+ // ends when the cursor is absent or fails to advance. If the snapshot
73
+ // expired mid-walk (410 `snapshot_expired` / 404 `unknown_snapshot`, alike
74
+ // to a token holder), drop what was gathered and restart once.
71
75
  listApps: async () => {
72
- const r = [];
73
- let c;
74
- for (let u = 0; u < 20; u++) {
75
- const w = new URLSearchParams({ limit: "200" });
76
- c && w.set("cursor", c);
77
- const h = await a(`/apps?${w}`);
78
- if (r.push(...h.apps), !h.nextCursor) break;
79
- c = h.nextCursor;
76
+ const s = async () => {
77
+ const o = [];
78
+ let u;
79
+ for (; ; ) {
80
+ const w = new URLSearchParams({ limit: "200" });
81
+ u && w.set("cursor", u);
82
+ const h = await r(`/apps?${w}`);
83
+ if (o.push(...h.apps), !h.nextCursor || h.nextCursor === u) return o;
84
+ u = h.nextCursor;
85
+ }
86
+ };
87
+ try {
88
+ return await s();
89
+ } catch (o) {
90
+ if (o instanceof se && (o.code === "snapshot_expired" || o.code === "unknown_snapshot"))
91
+ return await s();
92
+ throw o;
80
93
  }
81
- return r;
82
94
  },
83
95
  // Bounded lookup: dedupe; `[]` sends nothing; chunks of <= 100 (the server's
84
96
  // `MAX_IDS_PER_QUERY`), each `GET /apps?ids=a,b` with no limit/cursor.
85
- listAppsByIds: async (r) => {
86
- const c = Array.from(new Set(r)), u = [];
87
- for (let w = 0; w < c.length; w += 100) {
88
- const m = c.slice(w, w + 100).map(encodeURIComponent).join(","), p = await a(`/apps?ids=${m}`);
97
+ listAppsByIds: async (s) => {
98
+ const o = Array.from(new Set(s)), u = [];
99
+ for (let w = 0; w < o.length; w += 100) {
100
+ const m = o.slice(w, w + 100).map(encodeURIComponent).join(","), p = await r(`/apps?ids=${m}`);
89
101
  u.push(...p.apps);
90
102
  }
91
103
  return u;
92
104
  },
93
- getAppAuth: async (r) => (await a(`/apps/${encodeURIComponent(r)}/auths`)).auths ?? [],
94
- createConnection: (r, c) => a(`/apps/${encodeURIComponent(r)}/connections`, {
105
+ getAppAuth: async (s) => (await r(`/apps/${encodeURIComponent(s)}/auths`)).auths ?? [],
106
+ createConnection: (s, o) => r(`/apps/${encodeURIComponent(s)}/connections`, {
95
107
  method: "POST",
96
- body: JSON.stringify(c)
108
+ body: JSON.stringify(o)
97
109
  }).then((u) => u.connection),
98
- startAppOAuthFlow: (r, c, u) => a(
99
- `/apps/${encodeURIComponent(r)}/oauth-config/${encodeURIComponent(c)}/authorize-url`,
110
+ updateConnection: (s, o) => r(`/connections/${encodeURIComponent(s)}`, {
111
+ method: "PATCH",
112
+ body: JSON.stringify(o)
113
+ }).then((u) => u.connection),
114
+ startAppOAuthFlow: (s, o, u) => r(
115
+ `/apps/${encodeURIComponent(s)}/oauth-config/${encodeURIComponent(o)}/authorize-url`,
100
116
  { method: "POST", body: JSON.stringify(u) }
101
117
  ),
102
- getAppActions: (r) => a(`/apps/${encodeURIComponent(r)}`).then(
103
- (c) => c.actions ?? []
118
+ getAppActions: (s) => r(`/apps/${encodeURIComponent(s)}`).then(
119
+ (o) => o.actions ?? []
104
120
  ),
105
- listConnectionsForApp: (r) => a(
106
- `/apps/${encodeURIComponent(r)}/connections`
107
- ).then((c) => c.connections ?? []),
108
- listConnections: () => a("/connections").then((r) => r.connections ?? []),
109
- invokeAction: (r, c, u, w = {}) => a(
110
- `/apps/${encodeURIComponent(r)}/actions/${encodeURIComponent(c)}/invoke`,
121
+ listConnectionsForApp: (s) => r(
122
+ `/apps/${encodeURIComponent(s)}/connections`
123
+ ).then((o) => o.connections ?? []),
124
+ listConnections: () => r("/connections").then((s) => s.connections ?? []),
125
+ invokeAction: (s, o, u, w = {}) => r(
126
+ `/apps/${encodeURIComponent(s)}/actions/${encodeURIComponent(o)}/invoke`,
111
127
  // This body is built KEY BY KEY, not by spreading `opts` — so every new
112
128
  // option has to be named here or it is silently dropped before the wire
113
129
  // (the caller compiles, the UI looks right, the field never leaves the
@@ -126,69 +142,69 @@ function _s(e) {
126
142
  })
127
143
  }
128
144
  ),
129
- listSavedTests: (r) => a(
130
- `/connections/${encodeURIComponent(r)}/saved-tests`
131
- ).then((c) => c.savedTests ?? []),
132
- createSavedTest: (r, c) => a(
133
- `/connections/${encodeURIComponent(r)}/saved-tests`,
134
- { method: "POST", body: JSON.stringify(c) }
145
+ listSavedTests: (s) => r(
146
+ `/connections/${encodeURIComponent(s)}/saved-tests`
147
+ ).then((o) => o.savedTests ?? []),
148
+ createSavedTest: (s, o) => r(
149
+ `/connections/${encodeURIComponent(s)}/saved-tests`,
150
+ { method: "POST", body: JSON.stringify(o) }
135
151
  ).then((u) => u.savedTest),
136
- updateSavedTest: (r, c, u) => a(
137
- `/connections/${encodeURIComponent(r)}/saved-tests/${encodeURIComponent(c)}`,
152
+ updateSavedTest: (s, o, u) => r(
153
+ `/connections/${encodeURIComponent(s)}/saved-tests/${encodeURIComponent(o)}`,
138
154
  { method: "PATCH", body: JSON.stringify(u) }
139
155
  ).then((w) => w.savedTest),
140
- deleteSavedTest: (r, c) => a(
141
- `/connections/${encodeURIComponent(r)}/saved-tests/${encodeURIComponent(c)}`,
156
+ deleteSavedTest: (s, o) => r(
157
+ `/connections/${encodeURIComponent(s)}/saved-tests/${encodeURIComponent(o)}`,
142
158
  { method: "DELETE" }
143
159
  ).then(() => {
144
160
  }),
145
- recordTestRun: (r, c) => a(`/connections/${encodeURIComponent(r)}/test-runs`, {
161
+ recordTestRun: (s, o) => r(`/connections/${encodeURIComponent(s)}/test-runs`, {
146
162
  method: "POST",
147
- body: JSON.stringify(c)
163
+ body: JSON.stringify(o)
148
164
  }).then(() => {
149
165
  }),
150
- listTestRuns: (r) => a(
151
- `/connections/${encodeURIComponent(r)}/test-runs`
152
- ).then((c) => c.runs ?? []),
153
- saveStepTest: (r, c, u) => a(
154
- `/workflows/${encodeURIComponent(r)}/steps/${encodeURIComponent(c)}/tests`,
166
+ listTestRuns: (s) => r(
167
+ `/connections/${encodeURIComponent(s)}/test-runs`
168
+ ).then((o) => o.runs ?? []),
169
+ saveStepTest: (s, o, u) => r(
170
+ `/workflows/${encodeURIComponent(s)}/steps/${encodeURIComponent(o)}/tests`,
155
171
  { method: "POST", body: JSON.stringify(u) }
156
172
  ).then((w) => w.stepTest),
157
- listStepTests: (r, c) => a(
158
- `/workflows/${encodeURIComponent(r)}/steps/${encodeURIComponent(c)}/tests`
173
+ listStepTests: (s, o) => r(
174
+ `/workflows/${encodeURIComponent(s)}/steps/${encodeURIComponent(o)}/tests`
159
175
  ).then((u) => u.stepTests ?? []),
160
- recordStepTestRun: (r, c, u) => a(
161
- `/workflows/${encodeURIComponent(r)}/steps/${encodeURIComponent(c)}/test-runs`,
176
+ recordStepTestRun: (s, o, u) => r(
177
+ `/workflows/${encodeURIComponent(s)}/steps/${encodeURIComponent(o)}/test-runs`,
162
178
  { method: "POST", body: JSON.stringify(u) }
163
179
  ).then(() => {
164
180
  }),
165
- listFunctions: () => a("/functions").then((r) => r.functions ?? []),
166
- getFunction: (r) => a(
167
- `/functions/${encodeURIComponent(r)}`
168
- ).then((c) => ({ ...c.function, valid: c.valid })),
181
+ listFunctions: () => r("/functions").then((s) => s.functions ?? []),
182
+ getFunction: (s) => r(
183
+ `/functions/${encodeURIComponent(s)}`
184
+ ).then((o) => ({ ...o.function, valid: o.valid })),
169
185
  // The real synchronous route (`/functions/:id/invoke`) — deliberately NOT
170
186
  // `POST /run`, which would give the test stage a different code path than
171
187
  // the `@w6w/call` node it's standing in for. Returns the raw output,
172
188
  // pinned against the committed `studio/src/repos/functions.ts` signature.
173
- invokeFunction: (r, c) => a(`/functions/${encodeURIComponent(r)}/invoke`, {
189
+ invokeFunction: (s, o) => r(`/functions/${encodeURIComponent(s)}/invoke`, {
174
190
  method: "POST",
175
- body: JSON.stringify({ inputs: c })
191
+ body: JSON.stringify({ inputs: o })
176
192
  }).then((u) => u.output),
177
- listWorkflows: () => a("/workflows").then((r) => r.workflows ?? []),
178
- getWorkflow: (r) => a(`/workflows/${encodeURIComponent(r)}`).then(
179
- (c) => c.workflow
193
+ listWorkflows: () => r("/workflows").then((s) => s.workflows ?? []),
194
+ getWorkflow: (s) => r(`/workflows/${encodeURIComponent(s)}`).then(
195
+ (o) => o.workflow
180
196
  ),
181
197
  // `rawReq`, not `req<T>` — the ONE caller that needs the response's own
182
198
  // status code: `200` (the run reached a terminal state inside the wait
183
199
  // window) vs `202` (the server's own wait-timeout, still running). Both
184
200
  // are 2xx successes; `rawReq` already throws on a non-2xx.
185
- runWorkflow: (r, c = {}) => d(`/workflows/${encodeURIComponent(r)}/run?wait=true`, {
201
+ runWorkflow: (s, o = {}) => c(`/workflows/${encodeURIComponent(s)}/run?wait=true`, {
186
202
  method: "POST",
187
- body: JSON.stringify({ variables: c.variables, input: c.input })
203
+ body: JSON.stringify({ variables: o.variables, input: o.input })
188
204
  }).then(({ status: u, data: w }) => ({ ...w ?? {}, terminal: u === 200 }))
189
205
  };
190
206
  }
191
- function Ge(e) {
207
+ function tt(e) {
192
208
  if (!e) return "";
193
209
  try {
194
210
  return JSON.stringify(JSON.parse(e), null, 2);
@@ -196,308 +212,319 @@ function Ge(e) {
196
212
  return e;
197
213
  }
198
214
  }
199
- function Kt(e, s) {
200
- return `${e.method}-${e.url ?? e.host}-${s}`;
215
+ function ln(e, n) {
216
+ return `${e.method}-${e.url ?? e.host}-${n}`;
201
217
  }
202
- function Wt({ calls: e, defaultOpen: s, keyOf: n, title: l }) {
218
+ function rn({ calls: e, defaultOpen: n, keyOf: a, title: i }) {
203
219
  if (e.length === 0) return null;
204
- const d = n ?? Kt;
205
- return /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: 4 }, children: [
206
- l !== !1 && /* @__PURE__ */ t("strong", { className: "w6w-small", children: l ?? /* @__PURE__ */ o(k, { children: [
220
+ const c = a ?? ln;
221
+ return /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: 4 }, children: [
222
+ i !== !1 && /* @__PURE__ */ t("strong", { className: "w6w-small", children: i ?? /* @__PURE__ */ l(C, { children: [
207
223
  "API ",
208
224
  e.length === 1 ? "call" : "calls",
209
225
  " (",
210
226
  e.length,
211
227
  ")"
212
228
  ] }) }),
213
- e.map((a, r) => /* @__PURE__ */ o(
229
+ e.map((r, s) => /* @__PURE__ */ l(
214
230
  "details",
215
231
  {
216
- open: s,
232
+ open: n,
217
233
  className: "w6w-result",
218
234
  style: { padding: 8 },
219
235
  children: [
220
- /* @__PURE__ */ t("summary", { style: { cursor: "pointer" }, children: /* @__PURE__ */ o("span", { className: "w6w-small", children: [
221
- a.method,
236
+ /* @__PURE__ */ t("summary", { style: { cursor: "pointer" }, children: /* @__PURE__ */ l("span", { className: "w6w-small", children: [
237
+ r.method,
222
238
  " ",
223
- a.url ?? a.host,
239
+ r.url ?? r.host,
224
240
  " →",
225
241
  " ",
226
- /* @__PURE__ */ t("strong", { children: a.error ? "failed" : a.status }),
227
- a.durationMs !== void 0 && /* @__PURE__ */ o("span", { className: "w6w-muted", children: [
242
+ /* @__PURE__ */ t("strong", { children: r.error ? "failed" : r.status }),
243
+ r.durationMs !== void 0 && /* @__PURE__ */ l("span", { className: "w6w-muted", children: [
228
244
  " · ",
229
- a.durationMs,
245
+ r.durationMs,
230
246
  "ms"
231
247
  ] })
232
248
  ] }) }),
233
- /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: 6, marginTop: 8 }, children: [
234
- a.error && /* @__PURE__ */ t("div", { className: "w6w-error w6w-small", children: a.error }),
249
+ /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: 6, marginTop: 8 }, children: [
250
+ r.error && /* @__PURE__ */ t("div", { className: "w6w-error w6w-small", children: r.error }),
235
251
  /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "Request headers" }),
236
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(a.requestHeaders ?? {}, null, 2) }),
237
- a.requestBody && /* @__PURE__ */ o(k, { children: [
252
+ /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(r.requestHeaders ?? {}, null, 2) }),
253
+ r.requestBody && /* @__PURE__ */ l(C, { children: [
238
254
  /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "Request body" }),
239
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: Ge(a.requestBody) })
255
+ /* @__PURE__ */ t("pre", { className: "w6w-result", children: tt(r.requestBody) })
240
256
  ] }),
241
257
  /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "Response headers" }),
242
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(a.responseHeaders ?? {}, null, 2) }),
243
- a.responseBody && /* @__PURE__ */ o(k, { children: [
258
+ /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(r.responseHeaders ?? {}, null, 2) }),
259
+ r.responseBody && /* @__PURE__ */ l(C, { children: [
244
260
  /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "Response body" }),
245
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: Ge(a.responseBody) })
261
+ /* @__PURE__ */ t("pre", { className: "w6w-result", children: tt(r.responseBody) })
246
262
  ] }),
247
- a.truncated && /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "A captured body exceeded the size cap and was truncated." })
263
+ r.truncated && /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "A captured body exceeded the size cap and was truncated." })
248
264
  ] })
249
265
  ]
250
266
  },
251
- d(a, r)
267
+ c(r, s)
252
268
  ))
253
269
  ] });
254
270
  }
255
- function Ne({
271
+ function H({
256
272
  title: e,
257
- subtitle: s,
258
- icon: n,
259
- trailing: l,
260
- active: d = !1,
261
- onClick: a,
262
- ariaLabel: r
273
+ subtitle: n,
274
+ icon: a,
275
+ trailing: i,
276
+ active: c = !1,
277
+ onClick: r,
278
+ href: s,
279
+ ariaLabel: o
263
280
  }) {
264
- const c = /* @__PURE__ */ o(k, { children: [
265
- n != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-icon", children: n }),
266
- /* @__PURE__ */ o("span", { className: "w6w-list-item-body", children: [
281
+ const u = /* @__PURE__ */ l(C, { children: [
282
+ a != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-icon", children: a }),
283
+ /* @__PURE__ */ l("span", { className: "w6w-list-item-body", children: [
267
284
  /* @__PURE__ */ t("span", { className: "w6w-list-item-title", children: e }),
268
- s != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-subtitle", children: s })
285
+ n != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-subtitle", children: n })
269
286
  ] }),
270
- l != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-trailing", children: l })
271
- ] }), u = `w6w-list-item${d ? " active" : ""}`;
272
- return a ? /* @__PURE__ */ t(
287
+ i != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-trailing", children: i })
288
+ ] }), w = `w6w-list-item${c ? " active" : ""}`;
289
+ return s !== void 0 ? /* @__PURE__ */ t(
290
+ "a",
291
+ {
292
+ className: w,
293
+ href: s,
294
+ "aria-current": c ? "true" : void 0,
295
+ "aria-label": o,
296
+ onClick: r,
297
+ children: u
298
+ }
299
+ ) : r ? /* @__PURE__ */ t(
273
300
  "button",
274
301
  {
275
302
  type: "button",
276
- className: u,
277
- "aria-pressed": d,
278
- "aria-label": r,
279
- onClick: a,
280
- children: c
303
+ className: w,
304
+ "aria-pressed": c,
305
+ "aria-label": o,
306
+ onClick: r,
307
+ children: u
281
308
  }
282
- ) : /* @__PURE__ */ t("div", { className: u, "aria-label": r, children: c });
283
- }
284
- function de(e) {
285
- const s = Date.parse(e);
286
- if (Number.isNaN(s)) return "";
287
- const n = Math.max(0, Math.round((Date.now() - s) / 1e3));
288
- if (n < 45) return "just now";
289
- const l = Math.round(n / 60);
290
- if (l < 60) return `${l}m ago`;
291
- const d = Math.round(l / 60);
292
- if (d < 24) return `${d}h ago`;
293
- const a = Math.round(d / 24);
294
- return a < 7 ? `${a}d ago` : new Date(s).toLocaleDateString();
295
- }
296
- function Qe(e) {
297
- const s = {};
298
- for (const n of (e == null ? void 0 : e.params) ?? [])
299
- n.key && n.default !== void 0 && (s[n.key] = n.default);
300
- return s;
301
- }
302
- function Vt(e) {
303
- var n, l, d;
304
- const s = e.indexOf("{");
305
- if (s >= 0)
309
+ ) : /* @__PURE__ */ t("div", { className: w, "aria-label": o, children: u });
310
+ }
311
+ function ye(e) {
312
+ const n = Date.parse(e);
313
+ if (Number.isNaN(n)) return "";
314
+ const a = Math.max(0, Math.round((Date.now() - n) / 1e3));
315
+ if (a < 45) return "just now";
316
+ const i = Math.round(a / 60);
317
+ if (i < 60) return `${i}m ago`;
318
+ const c = Math.round(i / 60);
319
+ if (c < 24) return `${c}h ago`;
320
+ const r = Math.round(c / 24);
321
+ return r < 7 ? `${r}d ago` : new Date(n).toLocaleDateString();
322
+ }
323
+ function nt(e) {
324
+ const n = {};
325
+ for (const a of (e == null ? void 0 : e.params) ?? [])
326
+ a.key && a.default !== void 0 && (n[a.key] = a.default);
327
+ return n;
328
+ }
329
+ function on(e) {
330
+ var a, i, c;
331
+ const n = e.indexOf("{");
332
+ if (n >= 0)
306
333
  try {
307
- const a = JSON.parse(e.slice(s)), r = ((l = (n = a == null ? void 0 : a.errors) == null ? void 0 : n[0]) == null ? void 0 : l.message) ?? (typeof (a == null ? void 0 : a.error) == "object" ? (d = a.error) == null ? void 0 : d.message : a == null ? void 0 : a.error) ?? (a == null ? void 0 : a.message);
308
- if (typeof r == "string" && r.trim()) {
309
- const c = e.slice(0, s).replace(/[:\s]+$/, "");
310
- return c ? `${c}: ${r.trim()}` : r.trim();
334
+ const r = JSON.parse(e.slice(n)), s = ((i = (a = r == null ? void 0 : r.errors) == null ? void 0 : a[0]) == null ? void 0 : i.message) ?? (typeof (r == null ? void 0 : r.error) == "object" ? (c = r.error) == null ? void 0 : c.message : r == null ? void 0 : r.error) ?? (r == null ? void 0 : r.message);
335
+ if (typeof s == "string" && s.trim()) {
336
+ const o = e.slice(0, n).replace(/[:\s]+$/, "");
337
+ return o ? `${o}: ${s.trim()}` : s.trim();
311
338
  }
312
339
  } catch {
313
340
  }
314
341
  return e;
315
342
  }
316
- function tt(e) {
343
+ function wt(e) {
317
344
  return typeof e == "object" && e !== null && typeof e.status == "number" && typeof e.code == "string";
318
345
  }
319
- function zt(e) {
320
- if (!tt(e))
346
+ function cn(e) {
347
+ if (!wt(e))
321
348
  return { headline: (e == null ? void 0 : e.message) ?? "The action failed to run." };
322
- const s = Vt(e.message ?? ""), n = `${e.status} ${e.code} ${e.message ?? ""}`.toLowerCase();
349
+ const n = on(e.message ?? ""), a = `${e.status} ${e.code} ${e.message ?? ""}`.toLowerCase();
323
350
  return e.status === 401 || e.status === 403 || /\b(401|403)\b|forbidden|unauthorized|not authorized|permission|scope|access denied|invalid api key|invalid credential/.test(
324
- n
351
+ a
325
352
  ) ? {
326
353
  headline: "Permission denied by the provider — this is a credential/scope problem, not a w6w error.",
327
354
  hint: "The connection's API key is missing the permissions this action needs. Fix it at the provider — e.g. SendGrid → Settings → API Keys → give the key the required scopes (or Full Access), or create a new key — then update this connection's credential and try again.",
328
- detail: s
329
- } : { headline: "The action returned an error.", detail: s };
330
- }
331
- function Gt(e) {
332
- const s = tt(e) ? e.body ?? e.raw : null;
333
- return (s == null ? void 0 : s.apiCalls) ?? [];
334
- }
335
- function ue() {
336
- const [e, s] = v(""), [n, l] = v(void 0), [d, a] = v(!1);
337
- return { text: e, value: n, invalid: d, onChange: (c) => {
338
- s(c);
339
- const u = c.trim();
355
+ detail: n
356
+ } : { headline: "The action returned an error.", detail: n };
357
+ }
358
+ function dn(e) {
359
+ const n = wt(e) ? e.body ?? e.raw : null;
360
+ return (n == null ? void 0 : n.apiCalls) ?? [];
361
+ }
362
+ function ge() {
363
+ const [e, n] = y(""), [a, i] = y(void 0), [c, r] = y(!1);
364
+ return { text: e, value: a, invalid: c, onChange: (o) => {
365
+ n(o);
366
+ const u = o.trim();
340
367
  if (u === "") {
341
- a(!1);
368
+ r(!1);
342
369
  return;
343
370
  }
344
371
  try {
345
372
  const w = JSON.parse(u);
346
- w !== null && typeof w == "object" && !Array.isArray(w) ? (l(w), a(!1)) : a(!0);
373
+ w !== null && typeof w == "object" && !Array.isArray(w) ? (i(w), r(!1)) : r(!0);
347
374
  } catch {
348
- a(!0);
375
+ r(!0);
349
376
  }
350
377
  } };
351
378
  }
352
- function Ps({
379
+ function oa({
353
380
  appId: e,
354
- actions: s,
355
- connectionId: n,
356
- action: l,
357
- seedValues: d,
358
- onSavedTestsChanged: a,
359
- seedTestId: r,
360
- onDirtyChange: c,
381
+ actions: n,
382
+ connectionId: a,
383
+ action: i,
384
+ seedValues: c,
385
+ onSavedTestsChanged: r,
386
+ seedTestId: s,
387
+ onDirtyChange: o,
361
388
  onTestSaved: u,
362
389
  onDeleted: w,
363
390
  embedded: h = !1
364
391
  }) {
365
- var qe;
366
- const m = Et(), p = ye(() => {
367
- const i = [...s];
368
- return i.sort((f, g) => (f.title || f.key).localeCompare(g.title || g.key)), i;
369
- }, [s]), [N, ee] = v((l == null ? void 0 : l.key) ?? ""), y = l ?? s.find((i) => i.key === N) ?? null, [Ce, Oe] = v(!1), [A, _] = v(null), [Re, P] = v(void 0), [nt, E] = v([]), C = ue(), O = ue(), R = ue(), [te, at] = v(""), [se, rt] = v(""), Te = C.invalid || O.invalid || R.invalid, lt = () => {
370
- const i = {};
371
- return C.text.trim() !== "" && C.value !== void 0 && (i.body = C.value), O.text.trim() !== "" && O.value !== void 0 && (i.query = O.value), R.text.trim() !== "" && R.value !== void 0 && (i.headers = R.value), te && (i.target = te), se.trim() !== "" && (i.match = se.trim()), Object.keys(i).length > 0 ? i : void 0;
372
- }, [I, ne] = v("form"), [it, Ae] = v(""), [ot, Ee] = v(!1), [T, Me] = v(!1), b = (y == null ? void 0 : y.key) ?? null, _e = d ? { ...d } : Qe(y), [Pe, D] = v(() => ({
373
- key: b,
374
- values: _e
375
- })), [x, U] = v(r ?? null), [Ie, H] = v(_e);
376
- if (Pe.key !== b) {
377
- const i = Qe(y);
378
- D({ key: b, values: i }), H(i), U(r ?? null), _(null), P(void 0), E([]);
392
+ var Qe;
393
+ const m = ut(), p = Te(() => {
394
+ const d = [...n];
395
+ return d.sort((b, I) => (b.title || b.key).localeCompare(I.title || I.key)), d;
396
+ }, [n]), [g, S] = y((i == null ? void 0 : i.key) ?? ""), v = i ?? n.find((d) => d.key === g) ?? null, [f, A] = y(!1), [T, R] = y(null), [O, k] = y(void 0), [$, N] = y([]), x = ge(), _ = ge(), E = ge(), [ue, Nt] = y(""), [we, vt] = y(""), Le = x.invalid || _.invalid || E.invalid, yt = () => {
397
+ const d = {};
398
+ return x.text.trim() !== "" && x.value !== void 0 && (d.body = x.value), _.text.trim() !== "" && _.value !== void 0 && (d.query = _.value), E.text.trim() !== "" && E.value !== void 0 && (d.headers = E.value), ue && (d.target = ue), we.trim() !== "" && (d.match = we.trim()), Object.keys(d).length > 0 ? d : void 0;
399
+ }, [J, me] = y("form"), [gt, Ue] = y(""), [bt, De] = y(!1), [B, Be] = y(!1), P = (v == null ? void 0 : v.key) ?? null, Fe = c ? { ...c } : nt(v), [Je, G] = y(() => ({
400
+ key: P,
401
+ values: Fe
402
+ })), [L, j] = y(s ?? null), [je, Q] = y(Fe);
403
+ if (Je.key !== P) {
404
+ const d = nt(v);
405
+ G({ key: P, values: d }), Q(d), j(s ?? null), R(null), k(void 0), N([]);
379
406
  }
380
- const [ct, dt] = v(r);
381
- r !== ct && (dt(r), U(r ?? null));
382
- const [Ue, ut] = v(d);
383
- if (d !== Ue) {
384
- const i = JSON.stringify(d ?? null) !== JSON.stringify(Ue ?? null);
385
- if (ut(d), d && i) {
386
- const f = { ...d };
387
- D({ key: b, values: f }), H(f), _(null), P(void 0), E([]);
407
+ const [kt, xt] = y(s);
408
+ s !== kt && (xt(s), j(s ?? null));
409
+ const [Ke, St] = y(c);
410
+ if (c !== Ke) {
411
+ const d = JSON.stringify(c ?? null) !== JSON.stringify(Ke ?? null);
412
+ if (St(c), c && d) {
413
+ const b = { ...c };
414
+ G({ key: P, values: b }), Q(b), R(null), k(void 0), N([]);
388
415
  }
389
416
  }
390
- const S = Pe.values, Fe = (i) => D({ key: b, values: i }), Le = ye(
391
- () => JSON.stringify(S) !== JSON.stringify(Ie),
392
- [S, Ie]
417
+ const U = Je.values, We = (d) => G({ key: P, values: d }), qe = Te(
418
+ () => JSON.stringify(U) !== JSON.stringify(je),
419
+ [U, je]
393
420
  );
394
- G(() => {
395
- c == null || c(Le);
396
- }, [Le]);
397
- const wt = () => {
398
- Ae(JSON.stringify(S, null, 2)), Ee(!1), ne("json");
399
- }, mt = async (i) => {
400
- if (!y || Te) return;
401
- const f = y.key;
402
- Oe(!0), _(null), P(void 0), E([]);
403
- let g;
404
- const Ke = lt();
421
+ q(() => {
422
+ o == null || o(qe);
423
+ }, [qe]);
424
+ const Ct = () => {
425
+ Ue(JSON.stringify(U, null, 2)), De(!1), me("json");
426
+ }, $t = async (d) => {
427
+ if (!v || Le) return;
428
+ const b = v.key;
429
+ A(!0), R(null), k(void 0), N([]);
430
+ let I;
431
+ const Ze = yt();
405
432
  try {
406
- const M = await m.invokeAction(e, f, i, {
407
- connectionId: n,
408
- ...Ke ? { overrides: Ke } : {}
433
+ const F = await m.invokeAction(e, b, d, {
434
+ connectionId: a,
435
+ ...Ze ? { overrides: Ze } : {}
409
436
  });
410
- P(M.value), E(M.apiCalls ?? []), g = { ok: !0, summary: "OK", result: M.value };
411
- } catch (M) {
412
- const We = zt(M);
413
- _(We), E(Gt(M)), g = { ok: !1, summary: We.headline };
437
+ k(F.value), N(F.apiCalls ?? []), I = { ok: !0, summary: "OK", result: F.value };
438
+ } catch (F) {
439
+ const Xe = cn(F);
440
+ R(Xe), N(dn(F)), I = { ok: !1, summary: Xe.headline };
414
441
  } finally {
415
- Oe(!1);
442
+ A(!1);
416
443
  }
417
- if (n)
444
+ if (a)
418
445
  try {
419
- await m.recordTestRun(n, {
420
- savedTestId: x ?? null,
421
- actionKey: f,
422
- ok: g.ok,
423
- summary: g.summary.slice(0, 200),
424
- result: g.result
425
- }), ie(), kt(), a == null || a();
446
+ await m.recordTestRun(a, {
447
+ savedTestId: L ?? null,
448
+ actionKey: b,
449
+ ok: I.ok,
450
+ summary: I.summary.slice(0, 200),
451
+ result: I.result
452
+ }), Ne(), _t(), r == null || r();
426
453
  } catch {
427
454
  }
428
- }, ht = () => mt(S), [j, Be] = v(null), [q, F] = v(null), [pt, ft] = v(0), [vt, K] = v(!1), [ae, re] = v(""), [yt, le] = v(!1), ie = () => ft((i) => i + 1);
429
- G(() => {
430
- if (!n) {
431
- Be(null);
455
+ }, At = () => $t(U), [Z, He] = y(null), [X, K] = y(null), [Tt, Rt] = y(0), [Ot, ee] = y(!1), [he, pe] = y(""), [Mt, fe] = y(!1), Ne = () => Rt((d) => d + 1);
456
+ q(() => {
457
+ if (!a) {
458
+ He(null);
432
459
  return;
433
460
  }
434
- let i = !1;
435
- return F(null), m.listSavedTests(n).then((f) => !i && Be(f)).catch((f) => !i && F(f.message)), () => {
436
- i = !0;
461
+ let d = !1;
462
+ return K(null), m.listSavedTests(a).then((b) => !d && He(b)).catch((b) => !d && K(b.message)), () => {
463
+ d = !0;
437
464
  };
438
- }, [m, n, pt]);
439
- const Je = b ? (j ?? []).filter((i) => i.actionKey === b) : [], [Nt, oe] = v(null), [gt, bt] = v(0), kt = () => bt((i) => i + 1);
440
- G(() => {
441
- const i = m.listTestRuns;
442
- if (!n || !i) {
443
- oe(null);
465
+ }, [m, a, Tt]);
466
+ const ze = P ? (Z ?? []).filter((d) => d.actionKey === P) : [], [It, ve] = y(null), [Et, Pt] = y(0), _t = () => Pt((d) => d + 1);
467
+ q(() => {
468
+ const d = m.listTestRuns;
469
+ if (!a || !d) {
470
+ ve(null);
444
471
  return;
445
472
  }
446
- let f = !1;
447
- return i(n).then((g) => !f && oe(g)).catch(() => !f && oe(null)), () => {
448
- f = !0;
473
+ let b = !1;
474
+ return d(a).then((I) => !b && ve(I)).catch(() => !b && ve(null)), () => {
475
+ b = !0;
449
476
  };
450
- }, [m, n, gt]);
451
- const De = b ? (Nt ?? []).filter((i) => i.actionKey === b).slice().sort((i, f) => Date.parse(f.occurredAt) - Date.parse(i.occurredAt)) : [], xt = () => {
452
- !n || !y || (re(""), F(null), K(!0));
453
- }, St = () => {
454
- !n || !y || (x ? He() : xt());
455
- }, He = async () => {
456
- if (!(!n || !y))
477
+ }, [m, a, Et]);
478
+ const Ve = P ? (It ?? []).filter((d) => d.actionKey === P).slice().sort((d, b) => Date.parse(b.occurredAt) - Date.parse(d.occurredAt)) : [], Lt = () => {
479
+ !a || !v || (pe(""), K(null), ee(!0));
480
+ }, Ut = () => {
481
+ !a || !v || (L ? Ye() : Lt());
482
+ }, Ye = async () => {
483
+ if (!(!a || !v))
457
484
  try {
458
- let i;
459
- if (x)
460
- i = await m.updateSavedTest(n, x, { values: S });
485
+ let d;
486
+ if (L)
487
+ d = await m.updateSavedTest(a, L, { values: U });
461
488
  else {
462
- const f = ae.trim();
463
- if (!f) return;
464
- i = await m.createSavedTest(n, {
465
- actionKey: y.key,
466
- name: f,
467
- values: S
468
- }), U(i.id);
489
+ const b = he.trim();
490
+ if (!b) return;
491
+ d = await m.createSavedTest(a, {
492
+ actionKey: v.key,
493
+ name: b,
494
+ values: U
495
+ }), j(d.id);
469
496
  }
470
- H({ ...S }), K(!1), re(""), ie(), a == null || a(), u == null || u(i);
471
- } catch (i) {
472
- F(i.message);
497
+ Q({ ...U }), ee(!1), pe(""), Ne(), r == null || r(), u == null || u(d);
498
+ } catch (d) {
499
+ K(d.message);
473
500
  }
474
- }, $t = (i) => {
475
- const f = { ...i.values };
476
- D({ key: b, values: f }), H(f), U(i.id), ne("form"), _(null), P(void 0), E([]);
477
- }, Ct = async () => {
478
- if (!n || !x) return;
479
- const i = x;
501
+ }, Dt = (d) => {
502
+ const b = { ...d.values };
503
+ G({ key: P, values: b }), Q(b), j(d.id), me("form"), R(null), k(void 0), N([]);
504
+ }, Bt = async () => {
505
+ if (!a || !L) return;
506
+ const d = L;
480
507
  try {
481
- await m.deleteSavedTest(n, i), U(null), ie(), a == null || a(), w == null || w(i);
482
- } catch (f) {
483
- F(f.message);
508
+ await m.deleteSavedTest(a, d), j(null), Ne(), r == null || r(), w == null || w(d);
509
+ } catch (b) {
510
+ K(b.message);
484
511
  }
485
- }, Ot = /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1-5)" }, children: [
486
- /* @__PURE__ */ o(
512
+ }, Ft = /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1-5)" }, children: [
513
+ /* @__PURE__ */ l(
487
514
  "div",
488
515
  {
489
516
  className: "w6w-field-labelrow",
490
517
  style: { display: "flex", justifyContent: "space-between", alignItems: "center" },
491
518
  children: [
492
519
  /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "Parameters" }),
493
- /* @__PURE__ */ o("div", { style: { display: "flex", gap: "var(--w6w-sp-1)" }, children: [
520
+ /* @__PURE__ */ l("div", { style: { display: "flex", gap: "var(--w6w-sp-1)" }, children: [
494
521
  /* @__PURE__ */ t(
495
522
  "button",
496
523
  {
497
524
  type: "button",
498
- className: `w6w-btn w6w-btn-sm w6w-btn-ghost${I === "form" ? " active" : ""}`,
499
- "aria-pressed": I === "form",
500
- onClick: () => ne("form"),
525
+ className: `w6w-btn w6w-btn-sm w6w-btn-ghost${J === "form" ? " active" : ""}`,
526
+ "aria-pressed": J === "form",
527
+ onClick: () => me("form"),
501
528
  children: "Form"
502
529
  }
503
530
  ),
@@ -505,9 +532,9 @@ function Ps({
505
532
  "button",
506
533
  {
507
534
  type: "button",
508
- className: `w6w-btn w6w-btn-sm w6w-btn-ghost${I === "json" ? " active" : ""}`,
509
- "aria-pressed": I === "json",
510
- onClick: wt,
535
+ className: `w6w-btn w6w-btn-sm w6w-btn-ghost${J === "json" ? " active" : ""}`,
536
+ "aria-pressed": J === "json",
537
+ onClick: Ct,
511
538
  children: "JSON"
512
539
  }
513
540
  ),
@@ -516,86 +543,86 @@ function Ps({
516
543
  {
517
544
  type: "button",
518
545
  className: "w6w-btn w6w-btn-sm w6w-btn-ghost",
519
- "aria-pressed": T,
520
- title: T ? "Collapse the params editor" : "Open the params editor in a larger view",
521
- "aria-label": T ? "Collapse the params editor" : "Open the params editor in a larger view",
522
- onClick: () => Me((i) => !i),
523
- children: T ? "⤡" : "⤢"
546
+ "aria-pressed": B,
547
+ title: B ? "Collapse the params editor" : "Open the params editor in a larger view",
548
+ "aria-label": B ? "Collapse the params editor" : "Open the params editor in a larger view",
549
+ onClick: () => Be((d) => !d),
550
+ children: B ? "⤡" : "⤢"
524
551
  }
525
552
  )
526
553
  ] })
527
554
  ]
528
555
  }
529
556
  ),
530
- I === "form" ? /* @__PURE__ */ t(Mt, { params: (y == null ? void 0 : y.params) ?? [], values: S, onChange: Fe }) : /* @__PURE__ */ o(k, { children: [
557
+ J === "form" ? /* @__PURE__ */ t(Wt, { params: (v == null ? void 0 : v.params) ?? [], values: U, onChange: We }) : /* @__PURE__ */ l(C, { children: [
531
558
  /* @__PURE__ */ t(
532
- z,
559
+ ae,
533
560
  {
534
- value: it,
535
- onChange: Ae,
536
- minHeight: T ? "50vh" : "200px",
561
+ value: gt,
562
+ onChange: Ue,
563
+ minHeight: B ? "50vh" : "200px",
537
564
  "aria-label": "Params JSON",
538
- onValidChange: (i) => {
539
- i !== null && typeof i == "object" && !Array.isArray(i) && Fe(i);
565
+ onValidChange: (d) => {
566
+ d !== null && typeof d == "object" && !Array.isArray(d) && We(d);
540
567
  },
541
- onValidityChange: ({ valid: i }) => Ee(!i)
568
+ onValidityChange: ({ valid: d }) => De(!d)
542
569
  }
543
570
  ),
544
- ot && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
571
+ bt && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
545
572
  ] })
546
- ] }), Rt = /* @__PURE__ */ o("details", { className: "w6w-section", "data-testid": "overrides-region", children: [
547
- /* @__PURE__ */ o("summary", { className: "w6w-section-summary", children: [
573
+ ] }), Jt = /* @__PURE__ */ l("details", { className: "w6w-section", "data-testid": "overrides-region", children: [
574
+ /* @__PURE__ */ l("summary", { className: "w6w-section-summary", children: [
548
575
  /* @__PURE__ */ t("span", { className: "w6w-section-title", children: "Overrides" }),
549
576
  /* @__PURE__ */ t("span", { className: "w6w-section-subtitle", children: "Reach a vendor field this action's own params don't declare" })
550
577
  ] }),
551
- /* @__PURE__ */ o("div", { className: "w6w-stack w6w-section-body", style: { gap: "var(--w6w-sp-2)" }, children: [
552
- /* @__PURE__ */ o("div", { className: "w6w-field", children: [
578
+ /* @__PURE__ */ l("div", { className: "w6w-stack w6w-section-body", style: { gap: "var(--w6w-sp-2)" }, children: [
579
+ /* @__PURE__ */ l("div", { className: "w6w-field", children: [
553
580
  /* @__PURE__ */ t("span", { children: "Body" }),
554
581
  /* @__PURE__ */ t(
555
- z,
582
+ ae,
556
583
  {
557
- value: C.text,
558
- onChange: C.onChange,
584
+ value: x.text,
585
+ onChange: x.onChange,
559
586
  minHeight: "80px",
560
587
  "aria-label": "Overrides body (JSON)"
561
588
  }
562
589
  ),
563
- C.invalid && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
590
+ x.invalid && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
564
591
  ] }),
565
- /* @__PURE__ */ o("div", { className: "w6w-field", children: [
592
+ /* @__PURE__ */ l("div", { className: "w6w-field", children: [
566
593
  /* @__PURE__ */ t("span", { children: "Query" }),
567
594
  /* @__PURE__ */ t(
568
- z,
595
+ ae,
569
596
  {
570
- value: O.text,
571
- onChange: O.onChange,
597
+ value: _.text,
598
+ onChange: _.onChange,
572
599
  minHeight: "80px",
573
600
  "aria-label": "Overrides query (JSON)"
574
601
  }
575
602
  ),
576
- O.invalid && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
603
+ _.invalid && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
577
604
  ] }),
578
- /* @__PURE__ */ o("div", { className: "w6w-field", children: [
605
+ /* @__PURE__ */ l("div", { className: "w6w-field", children: [
579
606
  /* @__PURE__ */ t("span", { children: "Headers" }),
580
607
  /* @__PURE__ */ t(
581
- z,
608
+ ae,
582
609
  {
583
- value: R.text,
584
- onChange: R.onChange,
610
+ value: E.text,
611
+ onChange: E.onChange,
585
612
  minHeight: "80px",
586
613
  "aria-label": "Overrides headers (JSON)"
587
614
  }
588
615
  ),
589
- R.invalid && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
616
+ E.invalid && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: "Invalid JSON" })
590
617
  ] }),
591
- /* @__PURE__ */ o("label", { className: "w6w-field", children: [
618
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
592
619
  /* @__PURE__ */ t("span", { children: "Target" }),
593
- /* @__PURE__ */ o(
620
+ /* @__PURE__ */ l(
594
621
  "select",
595
622
  {
596
623
  "aria-label": "Overrides target",
597
- value: te,
598
- onChange: (i) => at(i.target.value),
624
+ value: ue,
625
+ onChange: (d) => Nt(d.target.value),
599
626
  children: [
600
627
  /* @__PURE__ */ t("option", { value: "", children: "— default (first) —" }),
601
628
  /* @__PURE__ */ t("option", { value: "first", children: "first" }),
@@ -605,22 +632,22 @@ function Ps({
605
632
  }
606
633
  )
607
634
  ] }),
608
- /* @__PURE__ */ o("label", { className: "w6w-field", children: [
635
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
609
636
  /* @__PURE__ */ t("span", { children: "Match" }),
610
637
  /* @__PURE__ */ t(
611
638
  "input",
612
639
  {
613
640
  type: "text",
614
641
  "aria-label": "Overrides match",
615
- value: se,
642
+ value: we,
616
643
  placeholder: "Restrict to requests whose URL contains…",
617
- onChange: (i) => rt(i.target.value)
644
+ onChange: (d) => vt(d.target.value)
618
645
  }
619
646
  )
620
647
  ] }),
621
648
  /* @__PURE__ */ t("span", { className: "w6w-hint", children: "Merged onto the outbound request at the wire, never into the params above — name a field the way the vendor's own API documents it." })
622
649
  ] })
623
- ] }), W = n ? /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1-5)" }, children: [
650
+ ] }), te = a ? /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1-5)" }, children: [
624
651
  /* @__PURE__ */ t(
625
652
  "div",
626
653
  {
@@ -629,35 +656,35 @@ function Ps({
629
656
  children: /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "Saved tests" })
630
657
  }
631
658
  ),
632
- q && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: q }),
633
- Je.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "No saved tests for this action yet." }) : /* @__PURE__ */ t(
659
+ X && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: X }),
660
+ ze.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "No saved tests for this action yet." }) : /* @__PURE__ */ t(
634
661
  "ul",
635
662
  {
636
663
  className: "w6w-stack",
637
664
  style: { listStyle: "none", margin: 0, padding: 0, gap: "var(--w6w-sp-1-5)" },
638
- children: Je.map((i) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
639
- Ne,
665
+ children: ze.map((d) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
666
+ H,
640
667
  {
641
- title: i.name,
642
- subtitle: i.lastRunAt ? /* @__PURE__ */ o("span", { children: [
668
+ title: d.name,
669
+ subtitle: d.lastRunAt ? /* @__PURE__ */ l("span", { children: [
643
670
  /* @__PURE__ */ t(
644
671
  "span",
645
672
  {
646
- style: { color: i.lastRunOk ? "var(--w6w-success)" : "var(--w6w-danger)" },
647
- children: i.lastRunOk ? "✓" : "✗"
673
+ style: { color: d.lastRunOk ? "var(--w6w-success)" : "var(--w6w-danger)" },
674
+ children: d.lastRunOk ? "✓" : "✗"
648
675
  }
649
676
  ),
650
677
  " ",
651
- i.lastRunSummary ? `${i.lastRunSummary} · ` : "",
652
- de(i.lastRunAt)
653
- ] }) : `saved ${de(i.updatedAt)}`,
654
- active: i.id === x,
655
- onClick: () => $t(i)
678
+ d.lastRunSummary ? `${d.lastRunSummary} · ` : "",
679
+ ye(d.lastRunAt)
680
+ ] }) : `saved ${ye(d.updatedAt)}`,
681
+ active: d.id === L,
682
+ onClick: () => Dt(d)
656
683
  }
657
- ) }, i.id))
684
+ ) }, d.id))
658
685
  }
659
686
  ),
660
- m.listTestRuns && De.length > 0 && /* @__PURE__ */ o(k, { children: [
687
+ m.listTestRuns && Ve.length > 0 && /* @__PURE__ */ l(C, { children: [
661
688
  /* @__PURE__ */ t(
662
689
  "div",
663
690
  {
@@ -671,63 +698,63 @@ function Ps({
671
698
  {
672
699
  className: "w6w-stack",
673
700
  style: { listStyle: "none", margin: 0, padding: 0, gap: "var(--w6w-sp-1-5)" },
674
- children: De.map((i) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
675
- Ne,
701
+ children: Ve.map((d) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
702
+ H,
676
703
  {
677
- title: /* @__PURE__ */ o("span", { children: [
678
- /* @__PURE__ */ t("span", { style: { color: i.ok ? "var(--w6w-success)" : "var(--w6w-danger)" }, children: i.ok ? "✓" : "✗" }),
704
+ title: /* @__PURE__ */ l("span", { children: [
705
+ /* @__PURE__ */ t("span", { style: { color: d.ok ? "var(--w6w-success)" : "var(--w6w-danger)" }, children: d.ok ? "✓" : "✗" }),
679
706
  " ",
680
- i.actionKey
707
+ d.actionKey
681
708
  ] }),
682
- subtitle: /* @__PURE__ */ o("span", { children: [
683
- i.summary ? `${i.summary} · ` : "",
684
- de(i.occurredAt)
709
+ subtitle: /* @__PURE__ */ l("span", { children: [
710
+ d.summary ? `${d.summary} · ` : "",
711
+ ye(d.occurredAt)
685
712
  ] })
686
713
  }
687
- ) }, i.id))
714
+ ) }, d.id))
688
715
  }
689
716
  )
690
717
  ] })
691
- ] }) : null, je = (qe = j == null ? void 0 : j.find((i) => i.id === x)) == null ? void 0 : qe.name;
692
- return /* @__PURE__ */ o("div", { className: `w6w-stack${h ? " w6w-tester-embedded-root" : ""}`, children: [
693
- !l && (s.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "This app exposes no actions." }) : (
718
+ ] }) : null, Ge = (Qe = Z == null ? void 0 : Z.find((d) => d.id === L)) == null ? void 0 : Qe.name;
719
+ return /* @__PURE__ */ l("div", { className: `w6w-stack${h ? " w6w-tester-embedded-root" : ""}`, children: [
720
+ !i && (n.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "This app exposes no actions." }) : (
694
721
  // biome-ignore lint/a11y/noLabelWithoutControl: Combobox renders its own <select>/<input> INSIDE this label, so the field text labels the control at runtime; the rule cannot see through the component boundary.
695
- /* @__PURE__ */ o("label", { className: "w6w-field", children: [
696
- /* @__PURE__ */ o("span", { children: [
722
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
723
+ /* @__PURE__ */ l("span", { children: [
697
724
  "Action",
698
- b ? "" : " *"
725
+ P ? "" : " *"
699
726
  ] }),
700
727
  /* @__PURE__ */ t(
701
- _t,
728
+ qt,
702
729
  {
703
- value: N,
730
+ value: g,
704
731
  placeholder: "— pick an action —",
705
- onChange: ee,
706
- options: p.map((i) => ({
707
- value: i.key,
708
- label: `${i.title ?? i.key} (${i.key})`
732
+ onChange: S,
733
+ options: p.map((d) => ({
734
+ value: d.key,
735
+ label: `${d.title ?? d.key} (${d.key})`
709
736
  }))
710
737
  }
711
738
  )
712
739
  ] })
713
740
  )),
714
- y ? /* @__PURE__ */ o(k, { children: [
715
- /* @__PURE__ */ o("div", { children: [
716
- /* @__PURE__ */ o("strong", { children: [
717
- y.title ?? y.key,
741
+ v ? /* @__PURE__ */ l(C, { children: [
742
+ /* @__PURE__ */ l("div", { children: [
743
+ /* @__PURE__ */ l("strong", { children: [
744
+ v.title ?? v.key,
718
745
  " ",
719
- /* @__PURE__ */ t("code", { className: "w6w-muted", children: y.key })
746
+ /* @__PURE__ */ t("code", { className: "w6w-muted", children: v.key })
720
747
  ] }),
721
- y.description && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", style: { margin: "var(--w6w-sp-0-5) 0 0" }, children: y.description })
748
+ v.description && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", style: { margin: "var(--w6w-sp-0-5) 0 0" }, children: v.description })
722
749
  ] }),
723
750
  (() => {
724
- const i = /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
725
- Ot,
726
- Rt,
727
- A && /* @__PURE__ */ o("div", { className: "w6w-result w6w-error", children: [
728
- /* @__PURE__ */ t("strong", { children: A.headline }),
729
- A.hint && /* @__PURE__ */ t("div", { style: { marginTop: "var(--w6w-sp-1-5)" }, children: A.hint }),
730
- A.detail && /* @__PURE__ */ t(
751
+ const d = /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
752
+ Ft,
753
+ Jt,
754
+ T && /* @__PURE__ */ l("div", { className: "w6w-result w6w-error", children: [
755
+ /* @__PURE__ */ t("strong", { children: T.headline }),
756
+ T.hint && /* @__PURE__ */ t("div", { style: { marginTop: "var(--w6w-sp-1-5)" }, children: T.hint }),
757
+ T.detail && /* @__PURE__ */ t(
731
758
  "div",
732
759
  {
733
760
  className: "w6w-muted w6w-small",
@@ -736,19 +763,19 @@ function Ps({
736
763
  whiteSpace: "pre-wrap",
737
764
  wordBreak: "break-word"
738
765
  },
739
- children: A.detail
766
+ children: T.detail
740
767
  }
741
768
  )
742
769
  ] }),
743
- Re !== void 0 && /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1)" }, children: [
770
+ O !== void 0 && /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1)" }, children: [
744
771
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: "Result" }),
745
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(Re, null, 2) })
772
+ /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(O, null, 2) })
746
773
  ] }),
747
- /* @__PURE__ */ t(Wt, { calls: nt })
748
- ] }), f = /* @__PURE__ */ o(
774
+ /* @__PURE__ */ t(rn, { calls: $ })
775
+ ] }), b = /* @__PURE__ */ l(
749
776
  "div",
750
777
  {
751
- className: `w6w-tester-actions${h || T ? " w6w-tester-actions-footer" : ""}`,
778
+ className: `w6w-tester-actions${h || B ? " w6w-tester-actions-footer" : ""}`,
752
779
  style: { display: "flex", gap: "var(--w6w-sp-2)" },
753
780
  children: [
754
781
  /* @__PURE__ */ t(
@@ -756,42 +783,42 @@ function Ps({
756
783
  {
757
784
  type: "button",
758
785
  className: "w6w-btn",
759
- disabled: Ce || Te,
760
- onClick: ht,
761
- children: Ce ? "Running…" : "Run action"
786
+ disabled: f || Le,
787
+ onClick: At,
788
+ children: f ? "Running…" : "Run action"
762
789
  }
763
790
  ),
764
- n && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: St, children: "Save test" }),
765
- n && x && /* @__PURE__ */ t(
791
+ a && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: Ut, children: "Save test" }),
792
+ a && L && /* @__PURE__ */ t(
766
793
  "button",
767
794
  {
768
795
  type: "button",
769
796
  className: "w6w-btn w6w-btn-ghost",
770
797
  style: { marginLeft: "auto", color: "var(--w6w-danger)" },
771
- onClick: () => le(!0),
798
+ onClick: () => fe(!0),
772
799
  children: "Delete"
773
800
  }
774
801
  )
775
802
  ]
776
803
  }
777
- ), g = /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
778
- i,
779
- f
804
+ ), I = /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
805
+ d,
806
+ b
780
807
  ] });
781
- return h ? /* @__PURE__ */ o("div", { className: "w6w-tester-embedded", children: [
782
- /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-scroll", children: W ? /* @__PURE__ */ o("div", { className: "w6w-tester-embedded-cols", children: [
783
- /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-main", children: i }),
784
- /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-rail", children: W })
785
- ] }) : i }),
786
- f
787
- ] }) : T ? /* @__PURE__ */ t(
788
- Ve,
808
+ return h ? /* @__PURE__ */ l("div", { className: "w6w-tester-embedded", children: [
809
+ /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-scroll", children: te ? /* @__PURE__ */ l("div", { className: "w6w-tester-embedded-cols", children: [
810
+ /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-main", children: d }),
811
+ /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-rail", children: te })
812
+ ] }) : d }),
813
+ b
814
+ ] }) : B ? /* @__PURE__ */ t(
815
+ Ae,
789
816
  {
790
- title: `Edit params — ${y.title ?? y.key}`,
791
- onClose: () => Me(!1),
817
+ title: `Edit params — ${v.title ?? v.key}`,
818
+ onClose: () => Be(!1),
792
819
  size: "full",
793
- children: /* @__PURE__ */ o("div", { className: "w6w-tester-popout", children: [
794
- /* @__PURE__ */ t("div", { className: "w6w-tester-popout-scroll", children: W ? /* @__PURE__ */ o(
820
+ children: /* @__PURE__ */ l("div", { className: "w6w-tester-popout", children: [
821
+ /* @__PURE__ */ t("div", { className: "w6w-tester-popout-scroll", children: te ? /* @__PURE__ */ l(
795
822
  "div",
796
823
  {
797
824
  style: {
@@ -800,39 +827,39 @@ function Ps({
800
827
  alignItems: "flex-start"
801
828
  },
802
829
  children: [
803
- /* @__PURE__ */ t("div", { style: { flex: 1, minWidth: 0 }, children: i }),
804
- /* @__PURE__ */ t("div", { style: { width: 260, flexShrink: 0 }, children: W })
830
+ /* @__PURE__ */ t("div", { style: { flex: 1, minWidth: 0 }, children: d }),
831
+ /* @__PURE__ */ t("div", { style: { width: 260, flexShrink: 0 }, children: te })
805
832
  ]
806
833
  }
807
- ) : i }),
808
- f
834
+ ) : d }),
835
+ b
809
836
  ] })
810
837
  }
811
- ) : g;
838
+ ) : I;
812
839
  })(),
813
- vt && /* @__PURE__ */ t(Ve, { title: "Save test", onClose: () => K(!1), children: /* @__PURE__ */ o(
840
+ Ot && /* @__PURE__ */ t(Ae, { title: "Save test", onClose: () => ee(!1), children: /* @__PURE__ */ l(
814
841
  "form",
815
842
  {
816
843
  className: "w6w-stack",
817
844
  style: { gap: "var(--w6w-sp-3)" },
818
- onSubmit: (i) => {
819
- i.preventDefault(), He();
845
+ onSubmit: (d) => {
846
+ d.preventDefault(), Ye();
820
847
  },
821
848
  children: [
822
- /* @__PURE__ */ o("label", { className: "w6w-field", children: [
849
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
823
850
  /* @__PURE__ */ t("span", { children: "Name this saved test" }),
824
851
  /* @__PURE__ */ t(
825
852
  "input",
826
853
  {
827
854
  type: "text",
828
- value: ae,
855
+ value: he,
829
856
  placeholder: "e.g. valid sender",
830
- onChange: (i) => re(i.target.value)
857
+ onChange: (d) => pe(d.target.value)
831
858
  }
832
859
  )
833
860
  ] }),
834
- q && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: q }),
835
- /* @__PURE__ */ o(
861
+ X && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: X }),
862
+ /* @__PURE__ */ l(
836
863
  "div",
837
864
  {
838
865
  style: { display: "flex", gap: "var(--w6w-sp-2)", justifyContent: "flex-end" },
@@ -842,37 +869,37 @@ function Ps({
842
869
  {
843
870
  type: "button",
844
871
  className: "w6w-btn w6w-btn-ghost",
845
- onClick: () => K(!1),
872
+ onClick: () => ee(!1),
846
873
  children: "Cancel"
847
874
  }
848
875
  ),
849
- /* @__PURE__ */ t("button", { type: "submit", className: "w6w-btn", disabled: !ae.trim(), children: "Save" })
876
+ /* @__PURE__ */ t("button", { type: "submit", className: "w6w-btn", disabled: !he.trim(), children: "Save" })
850
877
  ]
851
878
  }
852
879
  )
853
880
  ]
854
881
  }
855
882
  ) }),
856
- yt && /* @__PURE__ */ t(
857
- Pt,
883
+ Mt && /* @__PURE__ */ t(
884
+ Ht,
858
885
  {
859
886
  title: "Delete saved test",
860
- message: je ? `Delete "${je}"? This cannot be undone.` : "Delete this saved test? This cannot be undone.",
887
+ message: Ge ? `Delete "${Ge}"? This cannot be undone.` : "Delete this saved test? This cannot be undone.",
861
888
  confirmLabel: "Delete",
862
889
  onConfirm: () => {
863
- le(!1), Ct();
890
+ fe(!1), Bt();
864
891
  },
865
- onClose: () => le(!1)
892
+ onClose: () => fe(!1)
866
893
  }
867
894
  )
868
- ] }) : !l && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Pick an action above to test it." })
895
+ ] }) : !i && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Pick an action above to test it." })
869
896
  ] });
870
897
  }
871
- function Is(e) {
872
- const s = It(e.theme), { copied: n, copy: l } = Dt(e.value), d = ye(
898
+ function ca(e) {
899
+ const n = zt(e.theme), { copied: a, copy: i } = tn(e.value), c = Te(
873
900
  () => [
874
- Lt(),
875
- Bt.theme({
901
+ Zt(),
902
+ Xt.theme({
876
903
  "&": {
877
904
  fontSize: "13px",
878
905
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
@@ -893,20 +920,20 @@ function Is(e) {
893
920
  ],
894
921
  []
895
922
  );
896
- function a(r) {
897
- e.onChange(r);
923
+ function r(s) {
924
+ e.onChange(s);
898
925
  }
899
- return /* @__PURE__ */ o("div", { className: "w6w-yaml-editor", "aria-label": e["aria-label"] ?? "YAML editor", children: [
926
+ return /* @__PURE__ */ l("div", { className: "w6w-yaml-editor", "aria-label": e["aria-label"] ?? "YAML editor", children: [
900
927
  /* @__PURE__ */ t(
901
- Jt,
928
+ en,
902
929
  {
903
930
  value: e.value,
904
- onChange: a,
905
- extensions: d,
931
+ onChange: r,
932
+ extensions: c,
906
933
  placeholder: e.placeholder,
907
934
  readOnly: e.readOnly,
908
935
  editable: !e.readOnly,
909
- theme: s,
936
+ theme: n,
910
937
  height: e.height,
911
938
  minHeight: e.minHeight ?? "240px",
912
939
  maxHeight: e.maxHeight,
@@ -920,128 +947,128 @@ function Is(e) {
920
947
  }
921
948
  }
922
949
  ),
923
- e.copyable && /* @__PURE__ */ o(k, { children: [
950
+ e.copyable && /* @__PURE__ */ l(C, { children: [
924
951
  /* @__PURE__ */ t(
925
952
  "button",
926
953
  {
927
954
  type: "button",
928
- className: `w6w-icon-btn w6w-copyable-btn${n ? " is-copied" : ""}`,
955
+ className: `w6w-icon-btn w6w-copyable-btn${a ? " is-copied" : ""}`,
929
956
  "aria-label": "Copy",
930
- onClick: () => void l(),
931
- children: n ? /* @__PURE__ */ t(Ht, {}) : /* @__PURE__ */ t(jt, {})
957
+ onClick: () => void i(),
958
+ children: a ? /* @__PURE__ */ t(nn, {}) : /* @__PURE__ */ t(an, {})
932
959
  }
933
960
  ),
934
- /* @__PURE__ */ t("span", { className: "w6w-copyable-status", "aria-live": "polite", children: n ? "Copied" : "" })
961
+ /* @__PURE__ */ t("span", { className: "w6w-copyable-status", "aria-live": "polite", children: a ? "Copied" : "" })
935
962
  ] })
936
963
  ] });
937
964
  }
938
- const we = "…";
939
- function Qt(e, s, n = "end") {
940
- if (s === void 0 || s < 1 || s >= e.length) return e;
941
- if (n === "start")
942
- return `${we}${e.slice(e.length - s)}`;
943
- if (n === "end")
944
- return `${e.slice(0, s)}${we}`;
945
- const l = Math.ceil(s / 2), d = s - l;
946
- return `${e.slice(0, l)}${we}${e.slice(e.length - d)}`;
947
- }
948
- function Us(e) {
949
- const { value: s, chars: n, crop: l = "end", label: d, className: a, copiedMs: r } = e, c = Qt(s, n, l), u = ["w6w-copyable--bare", a].filter(Boolean).join(" ");
950
- return /* @__PURE__ */ t(qt, { value: s, readOnly: !0, label: d, className: u, copiedMs: r, children: /* @__PURE__ */ t("span", { children: c }) });
951
- }
952
- const Yt = {
965
+ const be = "…";
966
+ function un(e, n, a = "end") {
967
+ if (n === void 0 || n < 1 || n >= e.length) return e;
968
+ if (a === "start")
969
+ return `${be}${e.slice(e.length - n)}`;
970
+ if (a === "end")
971
+ return `${e.slice(0, n)}${be}`;
972
+ const i = Math.ceil(n / 2), c = n - i;
973
+ return `${e.slice(0, i)}${be}${e.slice(e.length - c)}`;
974
+ }
975
+ function wn(e) {
976
+ const { value: n, chars: a, crop: i = "end", label: c, className: r, copiedMs: s } = e, o = un(n, a, i), u = ["w6w-copyable--bare", r].filter(Boolean).join(" ");
977
+ return /* @__PURE__ */ t(sn, { value: n, readOnly: !0, label: c, className: u, copiedMs: s, children: /* @__PURE__ */ t("span", { children: o }) });
978
+ }
979
+ const mn = {
953
980
  ok: "Operational",
954
981
  degraded: "Degraded",
955
982
  down: "Down",
956
983
  unknown: "Unknown"
957
984
  };
958
- function Fs({ state: e, label: s, ariaLabel: n }) {
959
- const l = s ?? Yt[e];
960
- return /* @__PURE__ */ o("span", { className: `w6w-health-pill w6w-health-pill-${e}`, "aria-label": n, children: [
985
+ function Ie({ state: e, label: n, ariaLabel: a }) {
986
+ const i = n ?? mn[e];
987
+ return /* @__PURE__ */ l("span", { className: `w6w-health-pill w6w-health-pill-${e}`, "aria-label": a, children: [
961
988
  /* @__PURE__ */ t("span", { className: "w6w-health-pill-dot", "aria-hidden": "true" }),
962
- /* @__PURE__ */ t("span", { className: "w6w-health-pill-label", children: l })
989
+ /* @__PURE__ */ t("span", { className: "w6w-health-pill-label", children: i })
963
990
  ] });
964
991
  }
965
- const Zt = {
992
+ const hn = {
966
993
  ok: "Operational",
967
994
  degraded: "Degraded",
968
995
  down: "Down",
969
996
  unknown: "Unknown"
970
997
  };
971
- function Ls({ days: e, ariaLabel: s }) {
998
+ function pn({ days: e, ariaLabel: n }) {
972
999
  return e.length === 0 ? null : /* @__PURE__ */ t(
973
1000
  "div",
974
1001
  {
975
1002
  className: "w6w-uptime-strip",
976
1003
  role: "img",
977
- "aria-label": s ?? `${e.length}-day status`,
978
- children: e.map((n, l) => /* @__PURE__ */ t(
1004
+ "aria-label": n ?? `${e.length}-day status`,
1005
+ children: e.map((a, i) => /* @__PURE__ */ t(
979
1006
  "span",
980
1007
  {
981
- className: `w6w-uptime-cell w6w-uptime-cell-${n.state}`,
982
- title: n.label ?? `${n.day} — ${Zt[n.state]}`
1008
+ className: `w6w-uptime-cell w6w-uptime-cell-${a.state}`,
1009
+ title: a.label ?? `${a.day} — ${hn[a.state]}`
983
1010
  },
984
- `${n.day}-${l}`
1011
+ `${a.day}-${i}`
985
1012
  ))
986
1013
  }
987
1014
  );
988
1015
  }
989
- const st = "—", Ye = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
990
- function Xt(e) {
991
- if (e === null || !Number.isFinite(e)) return st;
1016
+ const mt = "—", at = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
1017
+ function fn(e) {
1018
+ if (e === null || !Number.isFinite(e)) return mt;
992
1019
  if (e < 1024) return `${Math.round(e)} B`;
993
- let s = e, n = 0;
994
- for (; s >= 1024 && n < Ye.length - 1; )
995
- s /= 1024, n += 1;
996
- return `${s.toFixed(1)} ${Ye[n]}`;
1020
+ let n = e, a = 0;
1021
+ for (; n >= 1024 && a < at.length - 1; )
1022
+ n /= 1024, a += 1;
1023
+ return `${n.toFixed(1)} ${at[a]}`;
997
1024
  }
998
- function $(e) {
999
- return e === null || !Number.isFinite(e) ? st : `${Math.round(e * 100)}%`;
1025
+ function D(e) {
1026
+ return e === null || !Number.isFinite(e) ? mt : `${Math.round(e * 100)}%`;
1000
1027
  }
1001
- function B(e) {
1028
+ function V(e) {
1002
1029
  if (e === void 0 || e.load1 === null) return null;
1003
- const s = e.cpuLimit ?? e.cpus;
1004
- return s === null || s <= 0 ? null : e.load1 / s;
1030
+ const n = e.cpuLimit ?? e.cpus;
1031
+ return n === null || n <= 0 ? null : e.load1 / n;
1005
1032
  }
1006
- function J(e) {
1033
+ function Y(e) {
1007
1034
  if (e === void 0) return null;
1008
- const { memoryTotal: s, memoryAvailable: n } = e;
1009
- return s === null || n === null || s <= 0 ? null : (s - n) / s;
1010
- }
1011
- function es(e, s, n) {
1012
- return e < s ? s : e > n ? n : e;
1013
- }
1014
- function ts(e, s, n, l) {
1015
- const d = e.length;
1016
- if (d < 2) return "";
1017
- const a = [];
1018
- for (let r = 0; r < d; r++) {
1019
- const c = e[r];
1020
- if (c === null) continue;
1021
- const u = r / (d - 1) * s, w = l <= 0 ? n : n - es(c, 0, l) / l * n;
1022
- a.push(`${Number(u.toFixed(2))},${Number(w.toFixed(2))}`);
1035
+ const { memoryTotal: n, memoryAvailable: a } = e;
1036
+ return n === null || a === null || n <= 0 ? null : (n - a) / n;
1037
+ }
1038
+ function Nn(e, n, a) {
1039
+ return e < n ? n : e > a ? a : e;
1040
+ }
1041
+ function vn(e, n, a, i) {
1042
+ const c = e.length;
1043
+ if (c < 2) return "";
1044
+ const r = [];
1045
+ for (let s = 0; s < c; s++) {
1046
+ const o = e[s];
1047
+ if (o === null) continue;
1048
+ const u = s / (c - 1) * n, w = i <= 0 ? a : a - Nn(o, 0, i) / i * a;
1049
+ r.push(`${Number(u.toFixed(2))},${Number(w.toFixed(2))}`);
1023
1050
  }
1024
- return a.join(" ");
1051
+ return r.join(" ");
1025
1052
  }
1026
- const ss = "—", Ze = 100, Xe = 24;
1027
- function ge({
1053
+ const yn = "—", st = 100, lt = 24;
1054
+ function Re({
1028
1055
  values: e,
1029
- max: s,
1030
- className: n
1056
+ max: n,
1057
+ className: a
1031
1058
  }) {
1032
- const l = ts(e, Ze, Xe, s);
1033
- return l === "" ? null : /* @__PURE__ */ t(
1059
+ const i = vn(e, st, lt, n);
1060
+ return i === "" ? null : /* @__PURE__ */ t(
1034
1061
  "svg",
1035
1062
  {
1036
- className: n,
1037
- viewBox: `0 0 ${Ze} ${Xe}`,
1063
+ className: a,
1064
+ viewBox: `0 0 ${st} ${lt}`,
1038
1065
  preserveAspectRatio: "none",
1039
1066
  "aria-hidden": "true",
1040
1067
  focusable: "false",
1041
1068
  children: /* @__PURE__ */ t(
1042
1069
  "polyline",
1043
1070
  {
1044
- points: l,
1071
+ points: i,
1045
1072
  fill: "none",
1046
1073
  stroke: "var(--w6w-accent)",
1047
1074
  strokeWidth: 2,
@@ -1051,172 +1078,172 @@ function ge({
1051
1078
  }
1052
1079
  );
1053
1080
  }
1054
- function me(e) {
1055
- return e === null ? ss : e.toFixed(2);
1081
+ function ke(e) {
1082
+ return e === null ? yn : e.toFixed(2);
1056
1083
  }
1057
- function Z(e) {
1058
- let s = 1;
1059
- for (const n of e) n !== null && n > s && (s = n);
1060
- return s;
1084
+ function oe(e) {
1085
+ let n = 1;
1086
+ for (const a of e) a !== null && a > n && (n = a);
1087
+ return n;
1061
1088
  }
1062
- function Q({
1089
+ function ie({
1063
1090
  label: e,
1064
- value: s,
1065
- values: n,
1066
- max: l
1091
+ value: n,
1092
+ values: a,
1093
+ max: i
1067
1094
  }) {
1068
- return /* @__PURE__ */ o("li", { className: "w6w-server-resources__row", children: [
1095
+ return /* @__PURE__ */ l("li", { className: "w6w-server-resources__row", children: [
1069
1096
  /* @__PURE__ */ t("span", { className: "w6w-server-resources__label", children: e }),
1070
- /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: s }),
1071
- /* @__PURE__ */ t(ge, { className: "w6w-server-resources__spark", values: n, max: l })
1097
+ /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: n }),
1098
+ /* @__PURE__ */ t(Re, { className: "w6w-server-resources__spark", values: a, max: i })
1072
1099
  ] });
1073
1100
  }
1074
- function xe(e) {
1075
- const s = e[e.length - 1], n = e.map((a) => B(a)), l = e.map((a) => J(a)), d = e.map((a) => a.processRss);
1076
- return { last: s, cpuValues: n, memoryValues: l, rssValues: d };
1101
+ function Ee(e) {
1102
+ const n = e[e.length - 1], a = e.map((r) => V(r)), i = e.map((r) => Y(r)), c = e.map((r) => r.processRss);
1103
+ return { last: n, cpuValues: a, memoryValues: i, rssValues: c };
1077
1104
  }
1078
- function Bs({
1105
+ function da({
1079
1106
  samples: e,
1080
- title: s = "Server resources",
1081
- intervalMs: n
1107
+ title: n = "Server resources",
1108
+ intervalMs: a
1082
1109
  }) {
1083
- const { last: l, cpuValues: d, memoryValues: a, rssValues: r } = xe(e);
1084
- return /* @__PURE__ */ o("section", { className: "w6w-server-resources w6w-server-resources--card", "aria-label": s, children: [
1085
- /* @__PURE__ */ t("h3", { className: "w6w-server-resources__title", children: s }),
1086
- /* @__PURE__ */ o("ul", { className: "w6w-server-resources__rows", children: [
1110
+ const { last: i, cpuValues: c, memoryValues: r, rssValues: s } = Ee(e);
1111
+ return /* @__PURE__ */ l("section", { className: "w6w-server-resources w6w-server-resources--card", "aria-label": n, children: [
1112
+ /* @__PURE__ */ t("h3", { className: "w6w-server-resources__title", children: n }),
1113
+ /* @__PURE__ */ l("ul", { className: "w6w-server-resources__rows", children: [
1087
1114
  /* @__PURE__ */ t(
1088
- Q,
1115
+ ie,
1089
1116
  {
1090
1117
  label: "CPU",
1091
- value: $(B(l)),
1092
- values: d,
1093
- max: Z(d)
1118
+ value: D(V(i)),
1119
+ values: c,
1120
+ max: oe(c)
1094
1121
  }
1095
1122
  ),
1096
1123
  /* @__PURE__ */ t(
1097
- Q,
1124
+ ie,
1098
1125
  {
1099
1126
  label: "Memory",
1100
- value: $(J(l)),
1101
- values: a,
1127
+ value: D(Y(i)),
1128
+ values: r,
1102
1129
  max: 1
1103
1130
  }
1104
1131
  ),
1105
1132
  /* @__PURE__ */ t(
1106
- Q,
1133
+ ie,
1107
1134
  {
1108
1135
  label: "Process",
1109
- value: Xt((l == null ? void 0 : l.processRss) ?? null),
1110
- values: r,
1111
- max: Z(r)
1136
+ value: fn((i == null ? void 0 : i.processRss) ?? null),
1137
+ values: s,
1138
+ max: oe(s)
1112
1139
  }
1113
1140
  )
1114
1141
  ] }),
1115
- /* @__PURE__ */ t("p", { className: "w6w-server-resources__meta", children: `Load ${me((l == null ? void 0 : l.load1) ?? null)} / ${me((l == null ? void 0 : l.load5) ?? null)} / ${me(
1116
- (l == null ? void 0 : l.load15) ?? null
1142
+ /* @__PURE__ */ t("p", { className: "w6w-server-resources__meta", children: `Load ${ke((i == null ? void 0 : i.load1) ?? null)} / ${ke((i == null ? void 0 : i.load5) ?? null)} / ${ke(
1143
+ (i == null ? void 0 : i.load15) ?? null
1117
1144
  )}` }),
1118
- n !== void 0 && /* @__PURE__ */ t("p", { className: "w6w-server-resources__meta", children: `Sampled every ${n / 1e3}s` })
1145
+ a !== void 0 && /* @__PURE__ */ t("p", { className: "w6w-server-resources__meta", children: `Sampled every ${a / 1e3}s` })
1119
1146
  ] });
1120
1147
  }
1121
- function Js({ samples: e, title: s = "Server" }) {
1122
- const { last: n, cpuValues: l } = xe(e);
1123
- return /* @__PURE__ */ o("section", { className: "w6w-server-resources w6w-server-resources--small", "aria-label": s, children: [
1124
- /* @__PURE__ */ t("h3", { className: "w6w-server-resources__title", children: s }),
1125
- /* @__PURE__ */ o("ul", { className: "w6w-server-resources__rows", children: [
1148
+ function ua({ samples: e, title: n = "Server" }) {
1149
+ const { last: a, cpuValues: i } = Ee(e);
1150
+ return /* @__PURE__ */ l("section", { className: "w6w-server-resources w6w-server-resources--small", "aria-label": n, children: [
1151
+ /* @__PURE__ */ t("h3", { className: "w6w-server-resources__title", children: n }),
1152
+ /* @__PURE__ */ l("ul", { className: "w6w-server-resources__rows", children: [
1126
1153
  /* @__PURE__ */ t(
1127
- Q,
1154
+ ie,
1128
1155
  {
1129
1156
  label: "CPU",
1130
- value: $(B(n)),
1131
- values: l,
1132
- max: Z(l)
1157
+ value: D(V(a)),
1158
+ values: i,
1159
+ max: oe(i)
1133
1160
  }
1134
1161
  ),
1135
- /* @__PURE__ */ o("li", { className: "w6w-server-resources__row", children: [
1162
+ /* @__PURE__ */ l("li", { className: "w6w-server-resources__row", children: [
1136
1163
  /* @__PURE__ */ t("span", { className: "w6w-server-resources__label", children: "Memory" }),
1137
- /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: $(J(n)) })
1164
+ /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: D(Y(a)) })
1138
1165
  ] })
1139
1166
  ] })
1140
1167
  ] });
1141
1168
  }
1142
- function Ds({ samples: e, onExpand: s }) {
1143
- const { last: n, cpuValues: l, memoryValues: d } = xe(e);
1144
- return /* @__PURE__ */ o("aside", { className: "w6w-server-resources w6w-server-resources--rail", children: [
1145
- /* @__PURE__ */ o("div", { className: "w6w-server-resources__rail-row", children: [
1169
+ function wa({ samples: e, onExpand: n }) {
1170
+ const { last: a, cpuValues: i, memoryValues: c } = Ee(e);
1171
+ return /* @__PURE__ */ l("aside", { className: "w6w-server-resources w6w-server-resources--rail", children: [
1172
+ /* @__PURE__ */ l("div", { className: "w6w-server-resources__rail-row", children: [
1146
1173
  /* @__PURE__ */ t("span", { className: "w6w-server-resources__label", children: "CPU" }),
1147
- /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: $(B(n)) }),
1174
+ /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: D(V(a)) }),
1148
1175
  /* @__PURE__ */ t(
1149
- ge,
1176
+ Re,
1150
1177
  {
1151
1178
  className: "w6w-server-resources__spark",
1152
- values: l,
1153
- max: Z(l)
1179
+ values: i,
1180
+ max: oe(i)
1154
1181
  }
1155
1182
  )
1156
1183
  ] }),
1157
- /* @__PURE__ */ o("div", { className: "w6w-server-resources__rail-row", children: [
1184
+ /* @__PURE__ */ l("div", { className: "w6w-server-resources__rail-row", children: [
1158
1185
  /* @__PURE__ */ t("span", { className: "w6w-server-resources__label", children: "MEM" }),
1159
- /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: $(J(n)) }),
1160
- /* @__PURE__ */ t(ge, { className: "w6w-server-resources__spark", values: d, max: 1 })
1186
+ /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: D(Y(a)) }),
1187
+ /* @__PURE__ */ t(Re, { className: "w6w-server-resources__spark", values: c, max: 1 })
1161
1188
  ] }),
1162
- s !== void 0 && /* @__PURE__ */ t(
1189
+ n !== void 0 && /* @__PURE__ */ t(
1163
1190
  "button",
1164
1191
  {
1165
1192
  type: "button",
1166
1193
  className: "w6w-server-resources__expand",
1167
1194
  "aria-label": "Show server resources",
1168
- onClick: s,
1195
+ onClick: n,
1169
1196
  children: "Details"
1170
1197
  }
1171
1198
  )
1172
1199
  ] });
1173
1200
  }
1174
- function Hs({ samples: e }) {
1175
- const s = e[e.length - 1], n = $(B(s)), l = $(J(s));
1176
- return /* @__PURE__ */ t("span", { className: "w6w-server-resources w6w-server-resources--badge", children: `CPU ${n} · MEM ${l}` });
1201
+ function ma({ samples: e }) {
1202
+ const n = e[e.length - 1], a = D(V(n)), i = D(Y(n));
1203
+ return /* @__PURE__ */ t("span", { className: "w6w-server-resources w6w-server-resources--badge", children: `CPU ${a} · MEM ${i}` });
1177
1204
  }
1178
- const ns = 1, as = 1440 * 60 * 1e3;
1179
- function rs(e, s, n) {
1180
- const l = s.startedAt ?? s.updatedAt;
1181
- if (l === void 0) return null;
1182
- const d = Date.parse(l), a = s.resolvedAt !== void 0 ? Date.parse(s.resolvedAt) : s.startedAt !== void 0 ? n : d, r = Date.parse(`${e.from}T00:00:00.000Z`), c = Date.parse(`${e.to}T00:00:00.000Z`) + as, u = c - r;
1183
- if (a < r || d >= c) return null;
1184
- const w = d < r, h = a > c, m = Math.max(d, r), p = Math.min(a, c), N = (m - r) / u * 100, ee = (p - m) / u * 100, y = Math.max(ee, ns);
1185
- return { leftPct: N, widthPct: y, clippedStart: w, clippedEnd: h };
1205
+ const gn = 1, bn = 1440 * 60 * 1e3;
1206
+ function kn(e, n, a) {
1207
+ const i = n.startedAt ?? n.updatedAt;
1208
+ if (i === void 0) return null;
1209
+ const c = Date.parse(i), r = n.resolvedAt !== void 0 ? Date.parse(n.resolvedAt) : n.startedAt !== void 0 ? a : c, s = Date.parse(`${e.from}T00:00:00.000Z`), o = Date.parse(`${e.to}T00:00:00.000Z`) + bn, u = o - s;
1210
+ if (r < s || c >= o) return null;
1211
+ const w = c < s, h = r > o, m = Math.max(c, s), p = Math.min(r, o), g = (m - s) / u * 100, S = (p - m) / u * 100, v = Math.max(S, gn);
1212
+ return { leftPct: g, widthPct: v, clippedStart: w, clippedEnd: h };
1186
1213
  }
1187
- const ls = {
1214
+ const xn = {
1188
1215
  ok: "Operational",
1189
1216
  degraded: "Degraded",
1190
1217
  down: "Down",
1191
1218
  unknown: "Unknown"
1192
- }, is = "This vendor publishes no incident history.", os = "No incidents in this window.";
1193
- function cs(e) {
1194
- const s = e.startedAt ?? e.updatedAt, n = [e.title];
1195
- return e.components !== void 0 && e.components.length > 0 && n.push(`(${e.components.join(", ")})`), s !== void 0 && n.push(
1196
- e.resolvedAt !== void 0 ? `${s} – ${e.resolvedAt}` : `${s} – ongoing`
1197
- ), n.join(" ");
1198
- }
1199
- function js({
1219
+ }, Sn = "This vendor publishes no incident history.", Cn = "No incidents in this window.";
1220
+ function $n(e) {
1221
+ const n = e.startedAt ?? e.updatedAt, a = [e.title];
1222
+ return e.components !== void 0 && e.components.length > 0 && a.push(`(${e.components.join(", ")})`), n !== void 0 && a.push(
1223
+ e.resolvedAt !== void 0 ? `${n} – ${e.resolvedAt}` : `${n} – ongoing`
1224
+ ), a.join(" ");
1225
+ }
1226
+ function ha({
1200
1227
  window: e,
1201
- days: s,
1202
- incidents: n,
1203
- vendorEmptyLabel: l,
1204
- nowMs: d = Date.now(),
1205
- ariaLabel: a
1228
+ days: n,
1229
+ incidents: a,
1230
+ vendorEmptyLabel: i,
1231
+ nowMs: c = Date.now(),
1232
+ ariaLabel: r
1206
1233
  }) {
1207
- const r = s.length, c = r > 0 ? 100 / r : 0, u = n === void 0 ? l ?? is : n.length === 0 ? l ?? os : null;
1208
- return /* @__PURE__ */ t("div", { className: "w6w-history-timeline", role: "img", "aria-label": a ?? `${r}-day history`, children: /* @__PURE__ */ o("div", { className: "w6w-history-plot", children: [
1209
- /* @__PURE__ */ t("div", { className: "w6w-history-lane w6w-history-lane-execution", children: s.map((w, h) => /* @__PURE__ */ t(
1234
+ const s = n.length, o = s > 0 ? 100 / s : 0, u = a === void 0 ? i ?? Sn : a.length === 0 ? i ?? Cn : null;
1235
+ return /* @__PURE__ */ t("div", { className: "w6w-history-timeline", role: "img", "aria-label": r ?? `${s}-day history`, children: /* @__PURE__ */ l("div", { className: "w6w-history-plot", children: [
1236
+ /* @__PURE__ */ t("div", { className: "w6w-history-lane w6w-history-lane-execution", children: n.map((w, h) => /* @__PURE__ */ t(
1210
1237
  "span",
1211
1238
  {
1212
1239
  className: `w6w-history-cell w6w-history-cell-${w.state}`,
1213
- style: { left: `${h * c}%`, width: `${c}%` },
1214
- title: w.label ?? `${w.day} — ${ls[w.state]}`
1240
+ style: { left: `${h * o}%`, width: `${o}%` },
1241
+ title: w.label ?? `${w.day} — ${xn[w.state]}`
1215
1242
  },
1216
1243
  `${w.day}-${h}`
1217
1244
  )) }),
1218
- /* @__PURE__ */ t("div", { className: "w6w-history-lane w6w-history-lane-vendor", children: u !== null ? /* @__PURE__ */ t("span", { className: "w6w-history-empty", title: u, children: u }) : n == null ? void 0 : n.map((w, h) => {
1219
- const m = rs(e, w, d);
1245
+ /* @__PURE__ */ t("div", { className: "w6w-history-lane w6w-history-lane-vendor", children: u !== null ? /* @__PURE__ */ t("span", { className: "w6w-history-empty", title: u, children: u }) : a == null ? void 0 : a.map((w, h) => {
1246
+ const m = kn(e, w, c);
1220
1247
  if (m === null) return null;
1221
1248
  const p = [
1222
1249
  m.clippedStart ? "w6w-history-bar-clip-start" : "",
@@ -1227,103 +1254,103 @@ function js({
1227
1254
  {
1228
1255
  className: `w6w-history-bar w6w-history-bar-${w.state}${p ? ` ${p}` : ""}`,
1229
1256
  style: { left: `${m.leftPct}%`, width: `${m.widthPct}%` },
1230
- title: cs(w)
1257
+ title: $n(w)
1231
1258
  },
1232
1259
  w.id ?? `${w.title}-${h}`
1233
1260
  );
1234
1261
  }) }),
1235
- /* @__PURE__ */ o("div", { className: "w6w-history-axis", children: [
1262
+ /* @__PURE__ */ l("div", { className: "w6w-history-axis", children: [
1236
1263
  /* @__PURE__ */ t("span", { className: "w6w-history-tick w6w-history-tick-start", style: { left: "0%" }, children: e.from }),
1237
1264
  /* @__PURE__ */ t("span", { className: "w6w-history-tick w6w-history-tick-end", style: { left: "100%" }, children: e.to })
1238
1265
  ] })
1239
1266
  ] }) });
1240
1267
  }
1241
- function qs({ label: e, children: s, className: n }) {
1242
- const [l, d] = v(!1), a = Ut();
1243
- return /* @__PURE__ */ o("span", { className: ["w6w-info-tip", n ?? ""].filter(Boolean).join(" "), children: [
1268
+ function pa({ label: e, children: n, className: a }) {
1269
+ const [i, c] = y(!1), r = Gt();
1270
+ return /* @__PURE__ */ l("span", { className: ["w6w-info-tip", a ?? ""].filter(Boolean).join(" "), children: [
1244
1271
  /* @__PURE__ */ t(
1245
- L,
1272
+ z,
1246
1273
  {
1247
1274
  label: e,
1248
1275
  icon: "info",
1249
- "aria-expanded": l,
1250
- "aria-controls": a,
1251
- onClick: () => d((r) => !r)
1276
+ "aria-expanded": i,
1277
+ "aria-controls": r,
1278
+ onClick: () => c((s) => !s)
1252
1279
  }
1253
1280
  ),
1254
- l && /* @__PURE__ */ t("span", { id: a, className: "w6w-info-tip-body w6w-muted w6w-small", children: s })
1281
+ i && /* @__PURE__ */ t("span", { id: r, className: "w6w-info-tip-body w6w-muted w6w-small", children: n })
1255
1282
  ] });
1256
1283
  }
1257
- function Ks(e) {
1258
- const { label: s, onClick: n, disabled: l, className: d, ...a } = e;
1284
+ function An(e) {
1285
+ const { label: n, onClick: a, disabled: i, className: c, ...r } = e;
1259
1286
  return /* @__PURE__ */ t(
1260
- L,
1287
+ z,
1261
1288
  {
1262
- label: s,
1263
- onClick: n,
1264
- disabled: l,
1265
- className: d,
1289
+ label: n,
1290
+ onClick: a,
1291
+ disabled: i,
1292
+ className: c,
1266
1293
  icon: "edit",
1267
- "data-testid": a["data-testid"]
1294
+ "data-testid": r["data-testid"]
1268
1295
  }
1269
1296
  );
1270
1297
  }
1271
- function Ws(e) {
1272
- const { label: s, onClick: n, disabled: l, className: d, ...a } = e;
1298
+ function Tn(e) {
1299
+ const { label: n, onClick: a, disabled: i, className: c, ...r } = e;
1273
1300
  return /* @__PURE__ */ t(
1274
- L,
1301
+ z,
1275
1302
  {
1276
- label: s,
1277
- onClick: n,
1278
- disabled: l,
1279
- className: d,
1303
+ label: n,
1304
+ onClick: a,
1305
+ disabled: i,
1306
+ className: c,
1280
1307
  danger: !0,
1281
1308
  icon: "delete",
1282
- "data-testid": a["data-testid"]
1309
+ "data-testid": r["data-testid"]
1283
1310
  }
1284
1311
  );
1285
1312
  }
1286
- function Vs(e) {
1287
- const { branch: s, shortSha: n, lastSyncLabel: l, onSyncNow: d, syncing: a, className: r, ...c } = e, [u, w] = v(!1), h = Ft(null);
1288
- return G(() => {
1313
+ function fa(e) {
1314
+ const { branch: n, shortSha: a, lastSyncLabel: i, onSyncNow: c, syncing: r, className: s, ...o } = e, [u, w] = y(!1), h = Qt(null);
1315
+ return q(() => {
1289
1316
  if (!u) return;
1290
- const m = (N) => {
1291
- h.current && !h.current.contains(N.target) && w(!1);
1292
- }, p = (N) => N.key === "Escape" && w(!1);
1317
+ const m = (g) => {
1318
+ h.current && !h.current.contains(g.target) && w(!1);
1319
+ }, p = (g) => g.key === "Escape" && w(!1);
1293
1320
  return document.addEventListener("mousedown", m), document.addEventListener("keydown", p), () => {
1294
1321
  document.removeEventListener("mousedown", m), document.removeEventListener("keydown", p);
1295
1322
  };
1296
- }, [u]), /* @__PURE__ */ o(
1323
+ }, [u]), /* @__PURE__ */ l(
1297
1324
  "div",
1298
1325
  {
1299
- className: `w6w-repo-sync${r ? ` ${r}` : ""}`,
1326
+ className: `w6w-repo-sync${s ? ` ${s}` : ""}`,
1300
1327
  ref: h,
1301
- "data-testid": c["data-testid"],
1328
+ "data-testid": o["data-testid"],
1302
1329
  children: [
1303
- /* @__PURE__ */ o(
1330
+ /* @__PURE__ */ l(
1304
1331
  "button",
1305
1332
  {
1306
1333
  type: "button",
1307
1334
  className: "w6w-repo-sync-trigger",
1308
1335
  "aria-haspopup": "menu",
1309
1336
  "aria-expanded": u,
1310
- "aria-busy": a,
1337
+ "aria-busy": r,
1311
1338
  onClick: () => w((m) => !m),
1312
1339
  children: [
1313
- /* @__PURE__ */ o("span", { className: "w6w-repo-sync-icon", children: [
1314
- /* @__PURE__ */ t(ze, { name: "github" }),
1315
- a && /* @__PURE__ */ t(ze, { name: "sync", size: 10, className: "w6w-repo-sync-spin" })
1340
+ /* @__PURE__ */ l("span", { className: "w6w-repo-sync-icon", children: [
1341
+ /* @__PURE__ */ t(et, { name: "github" }),
1342
+ r && /* @__PURE__ */ t(et, { name: "sync", size: 10, className: "w6w-repo-sync-spin" })
1316
1343
  ] }),
1317
- /* @__PURE__ */ t("span", { className: "w6w-repo-sync-branch", children: s }),
1318
- n != null && /* @__PURE__ */ t("code", { className: "w6w-repo-sync-sha", children: n })
1344
+ /* @__PURE__ */ t("span", { className: "w6w-repo-sync-branch", children: n }),
1345
+ a != null && /* @__PURE__ */ t("code", { className: "w6w-repo-sync-sha", children: a })
1319
1346
  ]
1320
1347
  }
1321
1348
  ),
1322
- u && /* @__PURE__ */ o("div", { className: "w6w-repo-sync-menu", role: "menu", children: [
1323
- /* @__PURE__ */ o("div", { className: "w6w-repo-sync-detail", children: [
1324
- /* @__PURE__ */ t("span", { children: s }),
1325
- n != null && /* @__PURE__ */ t("code", { children: n }),
1326
- l != null && /* @__PURE__ */ t("span", { children: l })
1349
+ u && /* @__PURE__ */ l("div", { className: "w6w-repo-sync-menu", role: "menu", children: [
1350
+ /* @__PURE__ */ l("div", { className: "w6w-repo-sync-detail", children: [
1351
+ /* @__PURE__ */ t("span", { children: n }),
1352
+ a != null && /* @__PURE__ */ t("code", { children: a }),
1353
+ i != null && /* @__PURE__ */ t("span", { children: i })
1327
1354
  ] }),
1328
1355
  /* @__PURE__ */ t(
1329
1356
  "button",
@@ -1332,9 +1359,9 @@ function Vs(e) {
1332
1359
  role: "menuitem",
1333
1360
  className: "w6w-repo-sync-item",
1334
1361
  "data-testid": "repo-sync-now",
1335
- disabled: a,
1336
- onClick: d,
1337
- children: a ? "Syncing…" : "Sync now"
1362
+ disabled: r,
1363
+ onClick: c,
1364
+ children: r ? "Syncing…" : "Sync now"
1338
1365
  }
1339
1366
  )
1340
1367
  ] })
@@ -1342,7 +1369,7 @@ function Vs(e) {
1342
1369
  }
1343
1370
  );
1344
1371
  }
1345
- const ds = {
1372
+ const Rn = {
1346
1373
  pending: "Pending",
1347
1374
  running: "Running",
1348
1375
  succeeded: "Succeeded",
@@ -1351,46 +1378,46 @@ const ds = {
1351
1378
  queued: "Queued",
1352
1379
  canceled: "Canceled"
1353
1380
  };
1354
- function Se({ state: e, label: s, ariaLabel: n }) {
1355
- const l = s ?? ds[e];
1356
- return /* @__PURE__ */ o("span", { className: `w6w-step-pill w6w-step-pill-${e}`, "aria-label": n, children: [
1381
+ function Pe({ state: e, label: n, ariaLabel: a }) {
1382
+ const i = n ?? Rn[e];
1383
+ return /* @__PURE__ */ l("span", { className: `w6w-step-pill w6w-step-pill-${e}`, "aria-label": a, children: [
1357
1384
  /* @__PURE__ */ t("span", { className: "w6w-step-pill-dot", "aria-hidden": "true" }),
1358
- /* @__PURE__ */ t("span", { className: "w6w-step-pill-label", children: l })
1385
+ /* @__PURE__ */ t("span", { className: "w6w-step-pill-label", children: i })
1359
1386
  ] });
1360
1387
  }
1361
- const us = "—", he = 1e3, pe = 6e4;
1362
- function $e(e) {
1363
- return e == null || !Number.isFinite(e) || e < 0 ? us : e < he ? `${Math.round(e)} ms` : e < pe ? `${(e / he).toFixed(1)} s` : `${Math.floor(e / pe)}m ${Math.round(e % pe / he)}s`;
1388
+ const On = "—", xe = 1e3, Se = 6e4;
1389
+ function _e(e) {
1390
+ return e == null || !Number.isFinite(e) || e < 0 ? On : e < xe ? `${Math.round(e)} ms` : e < Se ? `${(e / xe).toFixed(1)} s` : `${Math.floor(e / Se)}m ${Math.round(e % Se / xe)}s`;
1364
1391
  }
1365
- function X(e) {
1366
- const s = new Date(e);
1367
- return Number.isNaN(s.getTime()) ? e : s.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" });
1392
+ function ce(e) {
1393
+ const n = new Date(e);
1394
+ return Number.isNaN(n.getTime()) ? e : n.toLocaleString(void 0, { dateStyle: "medium", timeStyle: "short" });
1368
1395
  }
1369
- const ws = {
1396
+ const Mn = {
1370
1397
  function: "Function",
1371
1398
  endpoint: "Endpoint",
1372
1399
  workflow: "Workflow"
1373
1400
  };
1374
- function zs({
1401
+ function Na({
1375
1402
  items: e,
1376
- selectedId: s = null,
1377
- onSelect: n,
1378
- showCallable: l = !1,
1379
- loading: d = !1,
1380
- emptyLabel: a,
1381
- hasPrev: r,
1382
- hasNext: c,
1403
+ selectedId: n = null,
1404
+ onSelect: a,
1405
+ showCallable: i = !1,
1406
+ loading: c = !1,
1407
+ emptyLabel: r,
1408
+ hasPrev: s,
1409
+ hasNext: o,
1383
1410
  onPrev: u,
1384
1411
  onNext: w
1385
1412
  }) {
1386
- const h = u || w ? /* @__PURE__ */ o("div", { className: "w6w-execution-list-pager", children: [
1413
+ const h = u || w ? /* @__PURE__ */ l("div", { className: "w6w-execution-list-pager", children: [
1387
1414
  /* @__PURE__ */ t(
1388
1415
  "button",
1389
1416
  {
1390
1417
  type: "button",
1391
1418
  className: "w6w-btn w6w-btn-ghost",
1392
1419
  "data-testid": "execution-list-prev",
1393
- disabled: !r,
1420
+ disabled: !s,
1394
1421
  onClick: u,
1395
1422
  children: "Previous"
1396
1423
  }
@@ -1401,39 +1428,39 @@ function zs({
1401
1428
  type: "button",
1402
1429
  className: "w6w-btn w6w-btn-ghost",
1403
1430
  "data-testid": "execution-list-next",
1404
- disabled: !c,
1431
+ disabled: !o,
1405
1432
  onClick: w,
1406
1433
  children: "Next"
1407
1434
  }
1408
1435
  )
1409
1436
  ] }) : null;
1410
1437
  let m;
1411
- return d && e.length === 0 ? m = /* @__PURE__ */ t("p", { "data-testid": "execution-list-loading", children: "Loading…" }) : e.length === 0 ? m = /* @__PURE__ */ t("p", { "data-testid": "execution-list-empty", children: a ?? "No executions yet." }) : m = /* @__PURE__ */ t("ul", { className: "w6w-execution-list-rows", children: e.map((p) => /* @__PURE__ */ t("li", { "data-testid": "execution-row", "data-execution-id": p.id, children: /* @__PURE__ */ t(
1412
- Ne,
1438
+ return c && e.length === 0 ? m = /* @__PURE__ */ t("p", { "data-testid": "execution-list-loading", children: "Loading…" }) : e.length === 0 ? m = /* @__PURE__ */ t("p", { "data-testid": "execution-list-empty", children: r ?? "No executions yet." }) : m = /* @__PURE__ */ t("ul", { className: "w6w-execution-list-rows", children: e.map((p) => /* @__PURE__ */ t("li", { "data-testid": "execution-row", "data-execution-id": p.id, children: /* @__PURE__ */ t(
1439
+ H,
1413
1440
  {
1414
- icon: /* @__PURE__ */ t(Se, { state: p.status }),
1415
- title: l ? p.callableName : X(p.startedAt),
1416
- subtitle: l ? `${ws[p.kind]} · ${X(p.startedAt)}` : p.id,
1417
- trailing: $e(p.durationMs),
1418
- active: p.id === s,
1419
- onClick: n ? () => n(p.id) : void 0
1441
+ icon: /* @__PURE__ */ t(Pe, { state: p.status }),
1442
+ title: i ? p.callableName : ce(p.startedAt),
1443
+ subtitle: i ? `${Mn[p.kind]} · ${ce(p.startedAt)}` : p.id,
1444
+ trailing: _e(p.durationMs),
1445
+ active: p.id === n,
1446
+ onClick: a ? () => a(p.id) : void 0
1420
1447
  }
1421
- ) }, p.id)) }), /* @__PURE__ */ o("div", { className: "w6w-execution-list", "data-testid": "execution-list", children: [
1448
+ ) }, p.id)) }), /* @__PURE__ */ l("div", { className: "w6w-execution-list", "data-testid": "execution-list", children: [
1422
1449
  m,
1423
1450
  h
1424
1451
  ] });
1425
1452
  }
1426
- function ms({
1453
+ function In({
1427
1454
  steps: e,
1428
- emptyLabel: s,
1429
- onDismiss: n,
1430
- runError: l,
1431
- stepErrors: d
1455
+ emptyLabel: n,
1456
+ onDismiss: a,
1457
+ runError: i,
1458
+ stepErrors: c
1432
1459
  }) {
1433
- const a = n ? /* @__PURE__ */ t("div", { className: "w6w-execution-log-head", children: /* @__PURE__ */ t(L, { label: "Dismiss run log", "data-testid": "execution-log-dismiss", onClick: n, children: "×" }) }) : null, r = d ?? [], c = l || r.length > 0 ? /* @__PURE__ */ o("div", { className: "w6w-execution-log-errors w6w-stack", children: [
1434
- l && /* @__PURE__ */ t(be, { error: l }),
1435
- r.map((u, w) => /* @__PURE__ */ t(
1436
- be,
1460
+ const r = a ? /* @__PURE__ */ t("div", { className: "w6w-execution-log-head", children: /* @__PURE__ */ t(z, { label: "Dismiss run log", "data-testid": "execution-log-dismiss", onClick: a, children: "×" }) }) : null, s = c ?? [], o = i || s.length > 0 ? /* @__PURE__ */ l("div", { className: "w6w-execution-log-errors w6w-stack", children: [
1461
+ i && /* @__PURE__ */ t(Oe, { error: i }),
1462
+ s.map((u, w) => /* @__PURE__ */ t(
1463
+ Oe,
1437
1464
  {
1438
1465
  label: u.label ?? u.stepId,
1439
1466
  error: u.error
@@ -1441,104 +1468,104 @@ function ms({
1441
1468
  `${u.stepId}:${w}`
1442
1469
  ))
1443
1470
  ] }) : null;
1444
- return e.length === 0 ? /* @__PURE__ */ o(k, { children: [
1445
- a,
1446
- c,
1447
- /* @__PURE__ */ t("div", { className: "w6w-execution-log-empty", children: /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: s ?? "No steps have run yet." }) })
1448
- ] }) : /* @__PURE__ */ o(k, { children: [
1449
- a,
1450
- c,
1451
- /* @__PURE__ */ t("ol", { className: "w6w-execution-log", children: e.map((u) => /* @__PURE__ */ t(hs, { step: u }, u.id)) })
1471
+ return e.length === 0 ? /* @__PURE__ */ l(C, { children: [
1472
+ r,
1473
+ o,
1474
+ /* @__PURE__ */ t("div", { className: "w6w-execution-log-empty", children: /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: n ?? "No steps have run yet." }) })
1475
+ ] }) : /* @__PURE__ */ l(C, { children: [
1476
+ r,
1477
+ o,
1478
+ /* @__PURE__ */ t("ol", { className: "w6w-execution-log", children: e.map((u) => /* @__PURE__ */ t(En, { step: u }, u.id)) })
1452
1479
  ] });
1453
1480
  }
1454
- function hs({ step: e }) {
1455
- const [s, n] = v(!1), l = /* @__PURE__ */ o("div", { className: "w6w-execution-log-row-header", children: [
1456
- /* @__PURE__ */ t(Se, { state: e.status }),
1481
+ function En({ step: e }) {
1482
+ const [n, a] = y(!1), i = /* @__PURE__ */ l("div", { className: "w6w-execution-log-row-header", children: [
1483
+ /* @__PURE__ */ t(Pe, { state: e.status }),
1457
1484
  /* @__PURE__ */ t("span", { className: "w6w-execution-log-row-label", children: e.label ?? e.id }),
1458
- /* @__PURE__ */ t(ps, { startedAt: e.startedAt, finishedAt: e.finishedAt })
1459
- ] }), d = e.error ? /* @__PURE__ */ t(be, { error: e.error }) : null;
1460
- return e.input === void 0 && e.output === void 0 && !e.meta ? /* @__PURE__ */ o("li", { className: "w6w-execution-log-row", children: [
1461
- /* @__PURE__ */ t("div", { className: "w6w-section", children: l }),
1462
- d
1463
- ] }) : /* @__PURE__ */ o("li", { className: "w6w-execution-log-row", children: [
1464
- /* @__PURE__ */ o("details", { className: "w6w-section", open: s, onToggle: (a) => n(a.currentTarget.open), children: [
1465
- /* @__PURE__ */ t("summary", { className: "w6w-section-summary", children: l }),
1466
- s && /* @__PURE__ */ o("div", { className: "w6w-execution-log-row-body w6w-section-body w6w-stack", children: [
1467
- /* @__PURE__ */ t(et, { title: "Input", value: e.input }),
1468
- /* @__PURE__ */ t(et, { title: "Output", value: e.output }),
1469
- e.meta && /* @__PURE__ */ o("div", { className: "w6w-execution-log-json w6w-stack", children: [
1485
+ /* @__PURE__ */ t(Pn, { startedAt: e.startedAt, finishedAt: e.finishedAt })
1486
+ ] }), c = e.error ? /* @__PURE__ */ t(Oe, { error: e.error }) : null;
1487
+ return e.input === void 0 && e.output === void 0 && !e.meta ? /* @__PURE__ */ l("li", { className: "w6w-execution-log-row", children: [
1488
+ /* @__PURE__ */ t("div", { className: "w6w-section", children: i }),
1489
+ c
1490
+ ] }) : /* @__PURE__ */ l("li", { className: "w6w-execution-log-row", children: [
1491
+ /* @__PURE__ */ l("details", { className: "w6w-section", open: n, onToggle: (r) => a(r.currentTarget.open), children: [
1492
+ /* @__PURE__ */ t("summary", { className: "w6w-section-summary", children: i }),
1493
+ n && /* @__PURE__ */ l("div", { className: "w6w-execution-log-row-body w6w-section-body w6w-stack", children: [
1494
+ /* @__PURE__ */ t(it, { title: "Input", value: e.input }),
1495
+ /* @__PURE__ */ t(it, { title: "Output", value: e.output }),
1496
+ e.meta && /* @__PURE__ */ l("div", { className: "w6w-execution-log-json w6w-stack", children: [
1470
1497
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: "Metadata" }),
1471
- /* @__PURE__ */ t(ke, { code: JSON.stringify(e.meta, null, 2), language: "json" })
1498
+ /* @__PURE__ */ t(Me, { code: JSON.stringify(e.meta, null, 2), language: "json" })
1472
1499
  ] })
1473
1500
  ] })
1474
1501
  ] }),
1475
- d
1502
+ c
1476
1503
  ] });
1477
1504
  }
1478
- function be({ error: e, label: s }) {
1479
- return /* @__PURE__ */ o("div", { className: "w6w-result w6w-error", children: [
1480
- s !== void 0 && /* @__PURE__ */ t("strong", { className: "w6w-execution-log-error-label", children: s }),
1505
+ function Oe({ error: e, label: n }) {
1506
+ return /* @__PURE__ */ l("div", { className: "w6w-result w6w-error", children: [
1507
+ n !== void 0 && /* @__PURE__ */ t("strong", { className: "w6w-execution-log-error-label", children: n }),
1481
1508
  e.code && /* @__PURE__ */ t("div", { className: "w6w-small w6w-execution-log-error-code", children: /* @__PURE__ */ t("code", { children: e.code }) }),
1482
1509
  e.message
1483
1510
  ] });
1484
1511
  }
1485
- function ps({ startedAt: e, finishedAt: s }) {
1486
- if (e && s) {
1487
- const n = fs(e, s);
1488
- return /* @__PURE__ */ o("span", { className: "w6w-execution-log-timing", children: [
1512
+ function Pn({ startedAt: e, finishedAt: n }) {
1513
+ if (e && n) {
1514
+ const a = _n(e, n);
1515
+ return /* @__PURE__ */ l("span", { className: "w6w-execution-log-timing", children: [
1489
1516
  e,
1490
1517
  " → ",
1491
- s,
1492
- n && /* @__PURE__ */ o("span", { children: [
1518
+ n,
1519
+ a && /* @__PURE__ */ l("span", { children: [
1493
1520
  " (",
1494
- n,
1521
+ a,
1495
1522
  ")"
1496
1523
  ] })
1497
1524
  ] });
1498
1525
  }
1499
- return e ? /* @__PURE__ */ o("span", { className: "w6w-execution-log-timing", children: [
1526
+ return e ? /* @__PURE__ */ l("span", { className: "w6w-execution-log-timing", children: [
1500
1527
  "Started ",
1501
1528
  e
1502
1529
  ] }) : /* @__PURE__ */ t("span", { className: "w6w-execution-log-timing", children: "—" });
1503
1530
  }
1504
- function fs(e, s) {
1505
- const n = Date.parse(e), l = Date.parse(s);
1506
- if (!Number.isFinite(n) || !Number.isFinite(l) || l < n) return null;
1507
- const d = l - n;
1508
- if (d < 1e3) return `${d}ms`;
1509
- const a = d / 1e3;
1510
- if (a < 60) return `${a.toFixed(1)}s`;
1511
- const r = Math.floor(a / 60), c = Math.round(a % 60);
1512
- return `${r}m ${c}s`;
1513
- }
1514
- function et({ title: e, value: s }) {
1515
- return /* @__PURE__ */ o("div", { className: "w6w-execution-log-json w6w-stack", children: [
1531
+ function _n(e, n) {
1532
+ const a = Date.parse(e), i = Date.parse(n);
1533
+ if (!Number.isFinite(a) || !Number.isFinite(i) || i < a) return null;
1534
+ const c = i - a;
1535
+ if (c < 1e3) return `${c}ms`;
1536
+ const r = c / 1e3;
1537
+ if (r < 60) return `${r.toFixed(1)}s`;
1538
+ const s = Math.floor(r / 60), o = Math.round(r % 60);
1539
+ return `${s}m ${o}s`;
1540
+ }
1541
+ function it({ title: e, value: n }) {
1542
+ return /* @__PURE__ */ l("div", { className: "w6w-execution-log-json w6w-stack", children: [
1516
1543
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: e }),
1517
- s === void 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Not available." }) : /* @__PURE__ */ t(ke, { code: JSON.stringify(s, null, 2), language: "json" })
1544
+ n === void 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Not available." }) : /* @__PURE__ */ t(Me, { code: JSON.stringify(n, null, 2), language: "json" })
1518
1545
  ] });
1519
1546
  }
1520
- const vs = { status: "", kind: "", from: "", to: "", q: "" }, ys = [
1547
+ const Ln = { status: "", kind: "", from: "", to: "", q: "" }, Un = [
1521
1548
  { value: "", label: "Any status" },
1522
1549
  { value: "queued", label: "Queued" },
1523
1550
  { value: "running", label: "Running" },
1524
1551
  { value: "succeeded", label: "Succeeded" },
1525
1552
  { value: "failed", label: "Failed" },
1526
1553
  { value: "canceled", label: "Canceled" }
1527
- ], Ns = [
1554
+ ], Dn = [
1528
1555
  { value: "", label: "Any type" },
1529
1556
  { value: "function", label: "Function" },
1530
1557
  { value: "endpoint", label: "Endpoint" },
1531
1558
  { value: "workflow", label: "Workflow" }
1532
1559
  ];
1533
- function Gs({
1560
+ function va({
1534
1561
  value: e,
1535
- onChange: s,
1536
- showKind: n = !1,
1537
- searchPlaceholder: l = "Search by id or name",
1538
- disabled: d = !1
1562
+ onChange: n,
1563
+ showKind: a = !1,
1564
+ searchPlaceholder: i = "Search by id or name",
1565
+ disabled: c = !1
1539
1566
  }) {
1540
- const a = e.status !== "" || e.kind !== "" || e.from !== "" || e.to !== "" || e.q !== "";
1541
- return /* @__PURE__ */ o("div", { className: "w6w-execution-filters", "data-testid": "execution-filters", children: [
1567
+ const r = e.status !== "" || e.kind !== "" || e.from !== "" || e.to !== "" || e.q !== "";
1568
+ return /* @__PURE__ */ l("div", { className: "w6w-execution-filters", "data-testid": "execution-filters", children: [
1542
1569
  /* @__PURE__ */ t(
1543
1570
  "input",
1544
1571
  {
@@ -1546,10 +1573,10 @@ function Gs({
1546
1573
  className: "w6w-execution-filters-search",
1547
1574
  "data-testid": "execution-filter-q",
1548
1575
  "aria-label": "Search executions",
1549
- placeholder: l,
1576
+ placeholder: i,
1550
1577
  value: e.q,
1551
- disabled: d,
1552
- onChange: (r) => s({ ...e, q: r.target.value })
1578
+ disabled: c,
1579
+ onChange: (s) => n({ ...e, q: s.target.value })
1553
1580
  }
1554
1581
  ),
1555
1582
  /* @__PURE__ */ t(
@@ -1559,21 +1586,21 @@ function Gs({
1559
1586
  "data-testid": "execution-filter-status",
1560
1587
  "aria-label": "Status",
1561
1588
  value: e.status,
1562
- disabled: d,
1563
- onChange: (r) => s({ ...e, status: r.target.value }),
1564
- children: ys.map((r) => /* @__PURE__ */ t("option", { value: r.value, children: r.label }, r.value))
1589
+ disabled: c,
1590
+ onChange: (s) => n({ ...e, status: s.target.value }),
1591
+ children: Un.map((s) => /* @__PURE__ */ t("option", { value: s.value, children: s.label }, s.value))
1565
1592
  }
1566
1593
  ),
1567
- n && /* @__PURE__ */ t(
1594
+ a && /* @__PURE__ */ t(
1568
1595
  "select",
1569
1596
  {
1570
1597
  className: "w6w-execution-filters-select",
1571
1598
  "data-testid": "execution-filter-kind",
1572
1599
  "aria-label": "Type",
1573
1600
  value: e.kind,
1574
- disabled: d,
1575
- onChange: (r) => s({ ...e, kind: r.target.value }),
1576
- children: Ns.map((r) => /* @__PURE__ */ t("option", { value: r.value, children: r.label }, r.value))
1601
+ disabled: c,
1602
+ onChange: (s) => n({ ...e, kind: s.target.value }),
1603
+ children: Dn.map((s) => /* @__PURE__ */ t("option", { value: s.value, children: s.label }, s.value))
1577
1604
  }
1578
1605
  ),
1579
1606
  /* @__PURE__ */ t(
@@ -1584,8 +1611,8 @@ function Gs({
1584
1611
  "data-testid": "execution-filter-from",
1585
1612
  "aria-label": "From date",
1586
1613
  value: e.from,
1587
- disabled: d,
1588
- onChange: (r) => s({ ...e, from: r.target.value })
1614
+ disabled: c,
1615
+ onChange: (s) => n({ ...e, from: s.target.value })
1589
1616
  }
1590
1617
  ),
1591
1618
  /* @__PURE__ */ t(
@@ -1596,217 +1623,999 @@ function Gs({
1596
1623
  "data-testid": "execution-filter-to",
1597
1624
  "aria-label": "To date",
1598
1625
  value: e.to,
1599
- disabled: d,
1600
- onChange: (r) => s({ ...e, to: r.target.value })
1626
+ disabled: c,
1627
+ onChange: (s) => n({ ...e, to: s.target.value })
1601
1628
  }
1602
1629
  ),
1603
- a && /* @__PURE__ */ t(
1630
+ r && /* @__PURE__ */ t(
1604
1631
  "button",
1605
1632
  {
1606
1633
  type: "button",
1607
1634
  className: "w6w-btn w6w-btn-ghost w6w-execution-filters-clear",
1608
1635
  "data-testid": "execution-filter-clear",
1609
- disabled: d,
1610
- onClick: () => s({ ...vs }),
1636
+ disabled: c,
1637
+ onClick: () => n({ ...Ln }),
1611
1638
  children: "Clear"
1612
1639
  }
1613
1640
  )
1614
1641
  ] });
1615
1642
  }
1616
- const Y = "—";
1617
- function Qs({ stats: e, label: s }) {
1618
- const n = [
1643
+ const re = "—";
1644
+ function ya({ stats: e, label: n }) {
1645
+ const a = [
1619
1646
  {
1620
1647
  testid: "execution-stat-total",
1621
1648
  label: "Executions",
1622
- value: e ? String(e.total) : Y
1649
+ value: e ? String(e.total) : re
1623
1650
  },
1624
1651
  {
1625
1652
  testid: "execution-stat-success-rate",
1626
1653
  label: "Success rate",
1627
- value: gs(e == null ? void 0 : e.successRate)
1654
+ value: Bn(e == null ? void 0 : e.successRate)
1628
1655
  },
1629
1656
  {
1630
1657
  testid: "execution-stat-failed",
1631
1658
  label: "Failed",
1632
- value: e ? String(e.failed) : Y
1659
+ value: e ? String(e.failed) : re
1633
1660
  },
1634
1661
  {
1635
1662
  testid: "execution-stat-avg-duration",
1636
1663
  label: "Avg duration",
1637
- value: e ? $e(e.avgDurationMs) : Y
1664
+ value: e ? _e(e.avgDurationMs) : re
1638
1665
  }
1639
1666
  ];
1640
- return e && e.inFlight > 0 && n.push({
1667
+ return e && e.inFlight > 0 && a.push({
1641
1668
  testid: "execution-stat-in-flight",
1642
1669
  label: "In flight",
1643
1670
  value: String(e.inFlight)
1644
- }), /* @__PURE__ */ o("section", { className: "w6w-execution-stats", "data-testid": "execution-stats", children: [
1645
- s != null && /* @__PURE__ */ t("p", { className: "w6w-execution-stats-label", children: s }),
1646
- /* @__PURE__ */ t("div", { className: "w6w-execution-stats-cards", children: n.map((l) => /* @__PURE__ */ o("div", { className: "w6w-execution-stat", "data-testid": l.testid, children: [
1647
- /* @__PURE__ */ t("span", { className: "w6w-execution-stat-value", "data-stat-value": l.value, children: l.value }),
1648
- /* @__PURE__ */ t("span", { className: "w6w-execution-stat-label", children: l.label })
1649
- ] }, l.testid)) })
1671
+ }), /* @__PURE__ */ l("section", { className: "w6w-execution-stats", "data-testid": "execution-stats", children: [
1672
+ n != null && /* @__PURE__ */ t("p", { className: "w6w-execution-stats-label", children: n }),
1673
+ /* @__PURE__ */ t("div", { className: "w6w-execution-stats-cards", children: a.map((i) => /* @__PURE__ */ l("div", { className: "w6w-execution-stat", "data-testid": i.testid, children: [
1674
+ /* @__PURE__ */ t("span", { className: "w6w-execution-stat-value", "data-stat-value": i.value, children: i.value }),
1675
+ /* @__PURE__ */ t("span", { className: "w6w-execution-stat-label", children: i.label })
1676
+ ] }, i.testid)) })
1650
1677
  ] });
1651
1678
  }
1652
- function gs(e) {
1653
- return e == null || !Number.isFinite(e) ? Y : `${Math.round(e * 100)}%`;
1679
+ function Bn(e) {
1680
+ return e == null || !Number.isFinite(e) ? re : `${Math.round(e * 100)}%`;
1654
1681
  }
1655
- const bs = {
1682
+ const Fn = {
1656
1683
  function: "Function",
1657
1684
  endpoint: "Endpoint",
1658
1685
  workflow: "Workflow"
1659
1686
  };
1660
- function ks(e) {
1687
+ function Jn(e) {
1661
1688
  return JSON.stringify(e, null, 2) ?? "null";
1662
1689
  }
1663
- function Ys({
1690
+ function ga({
1664
1691
  execution: e,
1665
- loading: s = !1,
1666
- errorMessage: n,
1667
- onClose: l,
1668
- onOpenInEditor: d
1692
+ loading: n = !1,
1693
+ errorMessage: a,
1694
+ onClose: i,
1695
+ onOpenInEditor: c
1669
1696
  }) {
1670
- return /* @__PURE__ */ o("section", { className: "w6w-execution-detail w6w-stack", "data-testid": "execution-detail", children: [
1671
- n != null && /* @__PURE__ */ t(
1697
+ return /* @__PURE__ */ l("section", { className: "w6w-execution-detail w6w-stack", "data-testid": "execution-detail", children: [
1698
+ a != null && /* @__PURE__ */ t(
1672
1699
  "p",
1673
1700
  {
1674
1701
  role: "alert",
1675
1702
  className: "w6w-execution-detail-error-message",
1676
1703
  "data-testid": "execution-detail-error-message",
1677
- children: n
1704
+ children: a
1678
1705
  }
1679
1706
  ),
1680
- e ? /* @__PURE__ */ t(xs, { execution: e, onClose: l, onOpenInEditor: d }) : s ? /* @__PURE__ */ t("p", { className: "w6w-muted", "data-testid": "execution-detail-loading", children: "Loading…" }) : /* @__PURE__ */ t("p", { className: "w6w-muted", "data-testid": "execution-detail-empty", children: "No execution selected." })
1707
+ e ? /* @__PURE__ */ t(jn, { execution: e, onClose: i, onOpenInEditor: c }) : n ? /* @__PURE__ */ t("p", { className: "w6w-muted", "data-testid": "execution-detail-loading", children: "Loading…" }) : /* @__PURE__ */ t("p", { className: "w6w-muted", "data-testid": "execution-detail-empty", children: "No execution selected." })
1681
1708
  ] });
1682
1709
  }
1683
- function xs({
1710
+ function jn({
1684
1711
  execution: e,
1685
- onClose: s,
1686
- onOpenInEditor: n
1712
+ onClose: n,
1713
+ onOpenInEditor: a
1687
1714
  }) {
1688
- return /* @__PURE__ */ o(k, { children: [
1689
- /* @__PURE__ */ o("div", { className: "w6w-execution-detail-head", children: [
1690
- /* @__PURE__ */ o("div", { className: "w6w-execution-detail-title", children: [
1715
+ return /* @__PURE__ */ l(C, { children: [
1716
+ /* @__PURE__ */ l("div", { className: "w6w-execution-detail-head", children: [
1717
+ /* @__PURE__ */ l("div", { className: "w6w-execution-detail-title", children: [
1691
1718
  /* @__PURE__ */ t("h3", { className: "w6w-execution-detail-name", children: e.callableName }),
1692
- /* @__PURE__ */ o("div", { className: "w6w-execution-detail-meta", children: [
1693
- /* @__PURE__ */ t(Se, { state: e.status }),
1694
- /* @__PURE__ */ t("span", { className: "w6w-execution-detail-kind w6w-muted w6w-small", children: bs[e.kind] })
1719
+ /* @__PURE__ */ l("div", { className: "w6w-execution-detail-meta", children: [
1720
+ /* @__PURE__ */ t(Pe, { state: e.status }),
1721
+ /* @__PURE__ */ t("span", { className: "w6w-execution-detail-kind w6w-muted w6w-small", children: Fn[e.kind] })
1695
1722
  ] })
1696
1723
  ] }),
1697
- (n || s) && /* @__PURE__ */ o("div", { className: "w6w-execution-detail-actions", children: [
1698
- n && /* @__PURE__ */ t(
1724
+ (a || n) && /* @__PURE__ */ l("div", { className: "w6w-execution-detail-actions", children: [
1725
+ a && /* @__PURE__ */ t(
1699
1726
  "button",
1700
1727
  {
1701
1728
  type: "button",
1702
1729
  className: "w6w-btn w6w-btn-ghost",
1703
1730
  "data-testid": "execution-detail-open-editor",
1704
- onClick: n,
1731
+ onClick: a,
1705
1732
  children: "Open in visual editor"
1706
1733
  }
1707
1734
  ),
1708
- s && /* @__PURE__ */ t(L, { label: "Close", "data-testid": "execution-detail-close", onClick: s, children: "×" })
1735
+ n && /* @__PURE__ */ t(z, { label: "Close", "data-testid": "execution-detail-close", onClick: n, children: "×" })
1709
1736
  ] })
1710
1737
  ] }),
1711
1738
  /* @__PURE__ */ t("p", { className: "w6w-execution-detail-id-line", children: /* @__PURE__ */ t("code", { className: "w6w-execution-detail-id", "data-testid": "execution-detail-id", children: e.id }) }),
1712
- /* @__PURE__ */ o("dl", { className: "w6w-execution-detail-timing", children: [
1713
- /* @__PURE__ */ t(fe, { label: "Started", value: X(e.startedAt) }),
1739
+ /* @__PURE__ */ l("dl", { className: "w6w-execution-detail-timing", children: [
1740
+ /* @__PURE__ */ t(Ce, { label: "Started", value: ce(e.startedAt) }),
1714
1741
  /* @__PURE__ */ t(
1715
- fe,
1742
+ Ce,
1716
1743
  {
1717
1744
  label: "Finished",
1718
- value: e.finishedAt ? X(e.finishedAt) : "—"
1745
+ value: e.finishedAt ? ce(e.finishedAt) : "—"
1719
1746
  }
1720
1747
  ),
1721
- /* @__PURE__ */ t(fe, { label: "Duration", value: $e(e.durationMs) })
1748
+ /* @__PURE__ */ t(Ce, { label: "Duration", value: _e(e.durationMs) })
1722
1749
  ] }),
1723
- e.steps !== void 0 && /* @__PURE__ */ o(
1750
+ e.steps !== void 0 && /* @__PURE__ */ l(
1724
1751
  "section",
1725
1752
  {
1726
1753
  className: "w6w-execution-detail-section w6w-stack",
1727
1754
  "data-testid": "execution-detail-steps",
1728
1755
  children: [
1729
1756
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: "Steps" }),
1730
- /* @__PURE__ */ t(ms, { steps: e.steps, emptyLabel: "No steps ran." })
1757
+ /* @__PURE__ */ t(In, { steps: e.steps, emptyLabel: "No steps ran." })
1731
1758
  ]
1732
1759
  }
1733
1760
  ),
1734
- e.input !== void 0 && /* @__PURE__ */ t(ve, { title: "Input", testid: "execution-detail-input", value: e.input }),
1735
- e.output !== void 0 && /* @__PURE__ */ t(ve, { title: "Output", testid: "execution-detail-output", value: e.output }),
1736
- e.error != null && /* @__PURE__ */ t(ve, { title: "Error", testid: "execution-detail-error", value: e.error })
1761
+ e.input !== void 0 && /* @__PURE__ */ t($e, { title: "Input", testid: "execution-detail-input", value: e.input }),
1762
+ e.output !== void 0 && /* @__PURE__ */ t($e, { title: "Output", testid: "execution-detail-output", value: e.output }),
1763
+ e.error != null && /* @__PURE__ */ t($e, { title: "Error", testid: "execution-detail-error", value: e.error })
1737
1764
  ] });
1738
1765
  }
1739
- function fe({ label: e, value: s }) {
1740
- return /* @__PURE__ */ o("div", { className: "w6w-execution-detail-timing-item", children: [
1766
+ function Ce({ label: e, value: n }) {
1767
+ return /* @__PURE__ */ l("div", { className: "w6w-execution-detail-timing-item", children: [
1741
1768
  /* @__PURE__ */ t("dt", { children: e }),
1742
- /* @__PURE__ */ t("dd", { children: s })
1769
+ /* @__PURE__ */ t("dd", { children: n })
1743
1770
  ] });
1744
1771
  }
1745
- function ve({ title: e, testid: s, value: n }) {
1746
- return /* @__PURE__ */ o("section", { className: "w6w-execution-detail-section w6w-stack", "data-testid": s, children: [
1772
+ function $e({ title: e, testid: n, value: a }) {
1773
+ return /* @__PURE__ */ l("section", { className: "w6w-execution-detail-section w6w-stack", "data-testid": n, children: [
1747
1774
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: e }),
1748
- /* @__PURE__ */ t(ke, { code: ks(n), language: "json" })
1775
+ /* @__PURE__ */ t(Me, { code: Jn(a), language: "json" })
1776
+ ] });
1777
+ }
1778
+ function Kn(e) {
1779
+ const n = [];
1780
+ for (const a of e)
1781
+ a.p95Ms !== null && n.push({
1782
+ appId: a.appId,
1783
+ displayName: a.displayName,
1784
+ calls: a.calls,
1785
+ p95Ms: a.p95Ms,
1786
+ state: a.state,
1787
+ errorCount: a.errors.e4xx + a.errors.e429 + a.errors.eAuth + a.errors.e5xx
1788
+ });
1789
+ return n;
1790
+ }
1791
+ function ba(e) {
1792
+ return e.attention === "now" || e.attention === "recent";
1793
+ }
1794
+ function Wn(e) {
1795
+ const n = { now: [], recent: [], clear: [] };
1796
+ for (const a of e)
1797
+ a.attention === "now" ? n.now.push(a) : a.attention === "recent" ? n.recent.push(a) : n.clear.push(a);
1798
+ return n;
1799
+ }
1800
+ function qn(e) {
1801
+ return e.uptime.map((n) => ({ day: n.day, state: n.state }));
1802
+ }
1803
+ const rt = 3, Hn = 5;
1804
+ function zn(e, n = {}) {
1805
+ const a = n.compact ?? !1, { now: i, recent: c } = Wn(e), r = i.length + c.length, s = a ? i.slice(0, rt) : i, o = a ? c.slice(0, Math.max(0, rt - s.length)) : c, u = a ? e.slice(0, n.limit ?? Hn) : [...e];
1806
+ return {
1807
+ attentionCount: r,
1808
+ shownNow: s,
1809
+ shownRecent: o,
1810
+ hiddenAttentionCount: r - s.length - o.length,
1811
+ shownTable: u,
1812
+ hiddenTableCount: e.length - u.length
1813
+ };
1814
+ }
1815
+ const le = 640, W = 340, M = { top: 16, right: 24, bottom: 40, left: 56 };
1816
+ function ot(e) {
1817
+ if (e <= 0) return 1;
1818
+ const n = 10 ** Math.floor(Math.log10(e)), a = [1, 2, 5, 10];
1819
+ for (const i of a)
1820
+ if (e <= i * n) return i * n;
1821
+ return 10 * n;
1822
+ }
1823
+ function ct(e, n = 5) {
1824
+ return Array.from({ length: n + 1 }, (a, i) => Math.round(e * i / n));
1825
+ }
1826
+ function Vn({
1827
+ services: e,
1828
+ getHref: n,
1829
+ onOpen: a
1830
+ }) {
1831
+ const i = Kn(e);
1832
+ if (i.length === 0)
1833
+ return /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "No timed calls in this window yet." });
1834
+ const c = ot(Math.max(...i.map((f) => f.calls))), r = ot(Math.max(...i.map((f) => f.p95Ms))), s = Math.max(1, ...i.map((f) => f.errorCount)), o = le - M.left - M.right, u = W - M.top - M.bottom, w = (f) => M.left + f / c * o, h = (f) => M.top + f / r * u, m = (f) => 16 + f / s * 14, p = ct(c), g = ct(r), S = 18, v = M.top + u / 2;
1835
+ return /* @__PURE__ */ l("div", { className: "w6w-rel-scatter", children: [
1836
+ /* @__PURE__ */ l(
1837
+ "svg",
1838
+ {
1839
+ viewBox: `0 0 ${le} ${W}`,
1840
+ style: { aspectRatio: `${le} / ${W}` },
1841
+ role: "img",
1842
+ "aria-label": "API performance: calls versus p95 latency, one point per API",
1843
+ children: [
1844
+ /* @__PURE__ */ t(
1845
+ "rect",
1846
+ {
1847
+ x: M.left,
1848
+ y: M.top,
1849
+ width: o,
1850
+ height: u,
1851
+ className: "w6w-rel-scatter-plot-bg"
1852
+ }
1853
+ ),
1854
+ g.map((f) => /* @__PURE__ */ l("g", { children: [
1855
+ /* @__PURE__ */ t(
1856
+ "line",
1857
+ {
1858
+ x1: M.left,
1859
+ x2: le - M.right,
1860
+ y1: h(f),
1861
+ y2: h(f),
1862
+ className: "w6w-rel-scatter-grid"
1863
+ }
1864
+ ),
1865
+ /* @__PURE__ */ t("text", { x: M.left - 8, y: h(f), className: "w6w-rel-scatter-axis-label", textAnchor: "end", children: f })
1866
+ ] }, `y-${f}`)),
1867
+ p.map((f) => /* @__PURE__ */ t(
1868
+ "text",
1869
+ {
1870
+ x: w(f),
1871
+ y: W - M.bottom + 18,
1872
+ className: "w6w-rel-scatter-axis-label",
1873
+ textAnchor: "middle",
1874
+ children: f
1875
+ },
1876
+ `x-${f}`
1877
+ )),
1878
+ /* @__PURE__ */ t(
1879
+ "text",
1880
+ {
1881
+ x: S,
1882
+ y: v,
1883
+ className: "w6w-rel-scatter-axis-title",
1884
+ textAnchor: "middle",
1885
+ transform: `rotate(-90, ${S}, ${v})`,
1886
+ children: "p95 (ms)"
1887
+ }
1888
+ ),
1889
+ /* @__PURE__ */ t(
1890
+ "text",
1891
+ {
1892
+ x: M.left + o / 2,
1893
+ y: W - 4,
1894
+ className: "w6w-rel-scatter-axis-title",
1895
+ textAnchor: "middle",
1896
+ children: "calls in this window"
1897
+ }
1898
+ ),
1899
+ i.map((f) => {
1900
+ const A = m(f.errorCount), T = w(f.calls), R = h(f.p95Ms), O = /* @__PURE__ */ l(C, { children: [
1901
+ /* @__PURE__ */ t(
1902
+ "circle",
1903
+ {
1904
+ cx: T,
1905
+ cy: R,
1906
+ r: A / 2 + 2.5,
1907
+ className: `w6w-rel-scatter-ring w6w-rel-scatter-ring-${f.state}`,
1908
+ children: /* @__PURE__ */ l("title", { children: [
1909
+ f.displayName,
1910
+ " — ",
1911
+ f.calls,
1912
+ " calls, ",
1913
+ f.p95Ms,
1914
+ " ms p95, ",
1915
+ f.errorCount,
1916
+ " errors"
1917
+ ] })
1918
+ }
1919
+ ),
1920
+ /* @__PURE__ */ t(
1921
+ "circle",
1922
+ {
1923
+ cx: T,
1924
+ cy: R,
1925
+ r: A / 2,
1926
+ className: `w6w-rel-scatter-point w6w-rel-scatter-point-${f.state}`
1927
+ }
1928
+ )
1929
+ ] });
1930
+ return n ? /* @__PURE__ */ t(
1931
+ "a",
1932
+ {
1933
+ href: n(f.appId),
1934
+ className: "w6w-rel-scatter-point-link",
1935
+ onClick: a ? (k) => a(f.appId, k) : void 0,
1936
+ children: O
1937
+ },
1938
+ f.appId
1939
+ ) : a ? /* @__PURE__ */ t(
1940
+ "g",
1941
+ {
1942
+ role: "button",
1943
+ tabIndex: 0,
1944
+ className: "w6w-rel-scatter-point-link",
1945
+ onClick: (k) => a(f.appId, k),
1946
+ onKeyDown: (k) => {
1947
+ (k.key === "Enter" || k.key === " ") && (k.preventDefault(), k.currentTarget.dispatchEvent(
1948
+ new MouseEvent("click", { bubbles: !0 })
1949
+ ));
1950
+ },
1951
+ children: O
1952
+ },
1953
+ f.appId
1954
+ ) : /* @__PURE__ */ t("g", { children: O }, f.appId);
1955
+ })
1956
+ ]
1957
+ }
1958
+ ),
1959
+ /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small w6w-rel-scatter-note", children: "Up is faster, right is more calls — top-right is the best outcome. Icon size is the error count in this window; ring colour is exec status." })
1960
+ ] });
1961
+ }
1962
+ function dt(e) {
1963
+ const n = new Date(e);
1964
+ return Number.isNaN(n.getTime()) ? e : n.toLocaleDateString(void 0, { month: "short", day: "numeric" });
1965
+ }
1966
+ function ht({
1967
+ appId: e,
1968
+ className: n,
1969
+ title: a,
1970
+ getHref: i,
1971
+ onOpen: c,
1972
+ children: r
1973
+ }) {
1974
+ return i ? /* @__PURE__ */ t(
1975
+ "a",
1976
+ {
1977
+ className: n,
1978
+ href: i(e),
1979
+ title: a,
1980
+ onClick: c ? (s) => c(e, s) : void 0,
1981
+ children: r
1982
+ }
1983
+ ) : c ? /* @__PURE__ */ t("button", { type: "button", className: n, title: a, onClick: (s) => c(e, s), children: r }) : /* @__PURE__ */ t("div", { className: n, title: a, children: r });
1984
+ }
1985
+ function pt({ service: e }) {
1986
+ return /* @__PURE__ */ l("span", { className: "w6w-rel-signal", children: [
1987
+ /* @__PURE__ */ t(Ie, { state: e.state }),
1988
+ e.ongoingOutageId && /* @__PURE__ */ t("span", { className: "w6w-rel-tag", children: "outage open" }),
1989
+ e.calls === 0 && /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "no calls" })
1990
+ ] });
1991
+ }
1992
+ function ft({ vendor: e }) {
1993
+ if (!e) return /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "not published" });
1994
+ const n = e.state === "unknown";
1995
+ return /* @__PURE__ */ l("span", { className: "w6w-rel-signal", title: e.message ?? void 0, children: [
1996
+ /* @__PURE__ */ t(Ie, { state: e.state, label: n ? "Unavailable" : void 0 }),
1997
+ !n && e.message && /* @__PURE__ */ t("span", { className: "w6w-rel-vendor-msg w6w-small", children: e.message })
1998
+ ] });
1999
+ }
2000
+ function Yn({ service: e, getHref: n, onOpen: a }) {
2001
+ return /* @__PURE__ */ l(
2002
+ ht,
2003
+ {
2004
+ appId: e.appId,
2005
+ className: "w6w-rel-issue-card",
2006
+ title: `${e.displayName} — open service detail`,
2007
+ getHref: n,
2008
+ onOpen: a,
2009
+ children: [
2010
+ /* @__PURE__ */ l("span", { className: "w6w-rel-issue-head", children: [
2011
+ /* @__PURE__ */ t(
2012
+ de,
2013
+ {
2014
+ src: e.iconSrc,
2015
+ srcDark: e.iconSrcDark,
2016
+ brandColor: e.brandColor,
2017
+ name: e.displayName,
2018
+ size: 24
2019
+ }
2020
+ ),
2021
+ /* @__PURE__ */ l("span", { className: "w6w-rel-issue-head-text", children: [
2022
+ /* @__PURE__ */ t("strong", { children: e.displayName }),
2023
+ e.attention === "recent" && /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "trouble earlier in this window" })
2024
+ ] })
2025
+ ] }),
2026
+ /* @__PURE__ */ l("span", { className: "w6w-rel-issue-signals", children: [
2027
+ /* @__PURE__ */ l("span", { className: "w6w-rel-issue-signal", children: [
2028
+ /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "w6w exec" }),
2029
+ /* @__PURE__ */ t(pt, { service: e })
2030
+ ] }),
2031
+ /* @__PURE__ */ l("span", { className: "w6w-rel-issue-signal", children: [
2032
+ /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "API status" }),
2033
+ /* @__PURE__ */ t(ft, { vendor: e.vendorStatus })
2034
+ ] })
2035
+ ] })
2036
+ ]
2037
+ }
2038
+ );
2039
+ }
2040
+ function Gn({
2041
+ service: e,
2042
+ getHref: n,
2043
+ onOpen: a
2044
+ }) {
2045
+ const i = e.calls === 0;
2046
+ return /* @__PURE__ */ l(
2047
+ "tr",
2048
+ {
2049
+ className: `w6w-rel-tr${e.attention !== "none" ? " w6w-rel-attention" : ""}`,
2050
+ "data-attention": e.attention === "none" ? void 0 : e.attention,
2051
+ children: [
2052
+ /* @__PURE__ */ t("td", { className: "w6w-rel-td-service", children: /* @__PURE__ */ l(ht, { appId: e.appId, className: "w6w-rel-open", getHref: n, onOpen: a, children: [
2053
+ /* @__PURE__ */ t(
2054
+ de,
2055
+ {
2056
+ src: e.iconSrc,
2057
+ srcDark: e.iconSrcDark,
2058
+ brandColor: e.brandColor,
2059
+ name: e.displayName,
2060
+ size: 28
2061
+ }
2062
+ ),
2063
+ /* @__PURE__ */ l("span", { className: "w6w-rel-td-service-text", children: [
2064
+ /* @__PURE__ */ t("strong", { children: e.displayName }),
2065
+ /* @__PURE__ */ t("code", { className: "w6w-muted w6w-small", children: e.appId })
2066
+ ] })
2067
+ ] }) }),
2068
+ /* @__PURE__ */ l("td", { className: "w6w-rel-td-status", children: [
2069
+ /* @__PURE__ */ l("span", { className: "w6w-rel-status-row", children: [
2070
+ /* @__PURE__ */ t("span", { className: "w6w-rel-status-label w6w-muted w6w-small", children: "Ops" }),
2071
+ /* @__PURE__ */ t(pt, { service: e })
2072
+ ] }),
2073
+ /* @__PURE__ */ l("span", { className: "w6w-rel-status-row", children: [
2074
+ /* @__PURE__ */ t("span", { className: "w6w-rel-status-label w6w-muted w6w-small", children: "API" }),
2075
+ /* @__PURE__ */ t(ft, { vendor: e.vendorStatus })
2076
+ ] })
2077
+ ] }),
2078
+ /* @__PURE__ */ t("td", { className: "w6w-rel-td-uptime", children: i ? (
2079
+ // A zero-call window is one identical hatched strip — the note says it better.
2080
+ /* @__PURE__ */ t("span", { className: "w6w-rel-idle-note", children: "No calls in this window" })
2081
+ ) : /* @__PURE__ */ l(C, { children: [
2082
+ /* @__PURE__ */ t(
2083
+ pn,
2084
+ {
2085
+ days: qn(e),
2086
+ ariaLabel: `${e.displayName}, ${e.uptime.length}-day status, oldest day first`
2087
+ }
2088
+ ),
2089
+ /* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", children: [
2090
+ e.calls,
2091
+ " calls"
2092
+ ] })
2093
+ ] }) }),
2094
+ /* @__PURE__ */ t("td", { className: "w6w-rel-td-p95", children: e.p95Ms === null ? "—" : `${e.p95Ms} ms` })
2095
+ ]
2096
+ }
2097
+ );
2098
+ }
2099
+ function ka({
2100
+ services: e,
2101
+ window: n,
2102
+ days: a,
2103
+ compact: i = !1,
2104
+ showChart: c,
2105
+ limit: r,
2106
+ getHref: s,
2107
+ onOpen: o,
2108
+ showAllHref: u,
2109
+ onShowAll: w,
2110
+ slots: h
2111
+ }) {
2112
+ const m = a ?? (n == null ? void 0 : n.days) ?? 30, p = e.length > 0 && e.every(($) => $.calls > 0 && $.state === "ok"), {
2113
+ attentionCount: g,
2114
+ shownNow: S,
2115
+ shownRecent: v,
2116
+ hiddenAttentionCount: f,
2117
+ shownTable: A,
2118
+ hiddenTableCount: T
2119
+ } = zn(e, { compact: i, limit: r }), R = c ?? !i, O = u !== void 0 || w !== void 0, k = ($) => {
2120
+ const N = $.startsWith("Show") ? "w6w-muted w6w-small" : void 0;
2121
+ return u !== void 0 ? /* @__PURE__ */ t("a", { href: u, className: N, onClick: w, children: $ }) : w ? /* @__PURE__ */ t(
2122
+ "button",
2123
+ {
2124
+ type: "button",
2125
+ className: `w6w-rel-show-all${N ? ` ${N}` : ""}`,
2126
+ onClick: w,
2127
+ children: $
2128
+ }
2129
+ ) : null;
2130
+ };
2131
+ return /* @__PURE__ */ l("section", { className: "w6w-rel-section", children: [
2132
+ /* @__PURE__ */ l("h3", { className: "w6w-rel-heading", children: [
2133
+ /* @__PURE__ */ l("span", { children: [
2134
+ (h == null ? void 0 : h.header) ?? "Service reliability",
2135
+ " ",
2136
+ n && /* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", children: [
2137
+ dt(n.from),
2138
+ " – ",
2139
+ dt(n.to),
2140
+ " · ",
2141
+ n.days,
2142
+ " days"
2143
+ ] })
2144
+ ] }),
2145
+ i && k("Show all services →"),
2146
+ h == null ? void 0 : h.actions
2147
+ ] }),
2148
+ /* @__PURE__ */ l("div", { className: i ? "w6w-rel-card" : void 0, children: [
2149
+ /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small w6w-rel-intro", children: "Connected services across your account. Performance for the selected project." }),
2150
+ p && /* @__PURE__ */ l("div", { className: i ? "w6w-rel-allclear" : "w6w-rel-card w6w-rel-allclear", children: [
2151
+ /* @__PURE__ */ t("h4", { children: "All clear" }),
2152
+ /* @__PURE__ */ l("p", { children: [
2153
+ "Every service you called in the last ",
2154
+ m,
2155
+ " days came back",
2156
+ " ",
2157
+ /* @__PURE__ */ t(Ie, { state: "ok" }),
2158
+ " — no degraded stretches, no outages."
2159
+ ] })
2160
+ ] }),
2161
+ e.length === 0 && ((h == null ? void 0 : h.empty) ?? /* @__PURE__ */ t("div", { className: i ? void 0 : "w6w-rel-card", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No services yet — connect an integration or use a service in this project." }) })),
2162
+ e.length > 0 && /* @__PURE__ */ l(C, { children: [
2163
+ g > 0 && /* @__PURE__ */ l("div", { className: "w6w-rel-group", children: [
2164
+ /* @__PURE__ */ l("h4", { className: "w6w-rel-group-head", children: [
2165
+ "Needs attention",
2166
+ " ",
2167
+ /* @__PURE__ */ l("span", { className: "w6w-muted w6w-small", children: [
2168
+ S.length + v.length,
2169
+ " of ",
2170
+ g
2171
+ ] })
2172
+ ] }),
2173
+ /* @__PURE__ */ t("div", { className: "w6w-rel-issues", children: [...S, ...v].map(($) => /* @__PURE__ */ t(Yn, { service: $, getHref: s, onOpen: o }, $.appId)) }),
2174
+ f > 0 && /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small w6w-rel-more-note", children: [
2175
+ f,
2176
+ " more ",
2177
+ f === 1 ? "needs" : "need",
2178
+ " ",
2179
+ "attention",
2180
+ O && /* @__PURE__ */ l(C, { children: [
2181
+ " — ",
2182
+ k("view all →")
2183
+ ] })
2184
+ ] })
2185
+ ] }),
2186
+ R && /* @__PURE__ */ l("div", { className: "w6w-rel-group", children: [
2187
+ /* @__PURE__ */ t("h4", { className: "w6w-rel-group-head", children: "Performance across your APIs" }),
2188
+ /* @__PURE__ */ t(Vn, { services: e, getHref: s, onOpen: o })
2189
+ ] }),
2190
+ A.length > 0 && /* @__PURE__ */ l("div", { className: "w6w-rel-group", children: [
2191
+ /* @__PURE__ */ l("h4", { className: "w6w-rel-group-head", children: [
2192
+ i ? "Services" : "All services",
2193
+ " ",
2194
+ /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: i ? `${A.length} of ${e.length}` : e.length })
2195
+ ] }),
2196
+ /* @__PURE__ */ t("div", { className: "w6w-rel-table-wrap", children: /* @__PURE__ */ l("table", { className: "w6w-rel-table", children: [
2197
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { children: [
2198
+ /* @__PURE__ */ t("th", { children: "Service" }),
2199
+ /* @__PURE__ */ t("th", { children: "Status" }),
2200
+ /* @__PURE__ */ l("th", { children: [
2201
+ "Last ",
2202
+ m,
2203
+ " days"
2204
+ ] }),
2205
+ /* @__PURE__ */ t("th", { children: "Latency" })
2206
+ ] }) }),
2207
+ /* @__PURE__ */ t("tbody", { children: A.map(($) => /* @__PURE__ */ t(
2208
+ Gn,
2209
+ {
2210
+ service: $,
2211
+ getHref: s,
2212
+ onOpen: o
2213
+ },
2214
+ $.appId
2215
+ )) })
2216
+ ] }) }),
2217
+ T > 0 && /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small w6w-rel-more-note", children: [
2218
+ T,
2219
+ " more",
2220
+ O && /* @__PURE__ */ l(C, { children: [
2221
+ " — ",
2222
+ k("view all →")
2223
+ ] })
2224
+ ] })
2225
+ ] })
2226
+ ] })
2227
+ ] })
2228
+ ] });
2229
+ }
2230
+ function xa({
2231
+ rows: e,
2232
+ title: n,
2233
+ description: a,
2234
+ emptyCopy: i,
2235
+ newLabel: c = "New",
2236
+ openRowTitle: r,
2237
+ testIds: s,
2238
+ loading: o,
2239
+ error: u,
2240
+ onCreate: w,
2241
+ creating: h,
2242
+ onImport: m,
2243
+ onOpen: p,
2244
+ getHref: g,
2245
+ showArchived: S,
2246
+ onShowArchivedChange: v,
2247
+ slots: f
2248
+ }) {
2249
+ const [A, T] = y(!1), R = S !== void 0, O = R ? S : A, k = O ? e : e.filter((N) => !N.archived), $ = p !== void 0 || g !== void 0;
2250
+ return /* @__PURE__ */ l("section", { className: "w6w-callable-list", children: [
2251
+ /* @__PURE__ */ l("div", { className: "w6w-callable-list-head", children: [
2252
+ /* @__PURE__ */ l("div", { className: "w6w-callable-list-heading", children: [
2253
+ (f == null ? void 0 : f.header) ?? /* @__PURE__ */ l(C, { children: [
2254
+ /* @__PURE__ */ t("h2", { className: "w6w-callable-list-title", children: n }),
2255
+ a != null && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small w6w-callable-list-description", children: a })
2256
+ ] }),
2257
+ /* @__PURE__ */ l("label", { className: "w6w-muted w6w-small w6w-callable-list-toggle", children: [
2258
+ /* @__PURE__ */ t(
2259
+ "input",
2260
+ {
2261
+ type: "checkbox",
2262
+ checked: O,
2263
+ "data-testid": s == null ? void 0 : s.showArchived,
2264
+ onChange: (N) => {
2265
+ R || T(N.target.checked), v == null || v(N.target.checked);
2266
+ }
2267
+ }
2268
+ ),
2269
+ "Show archived"
2270
+ ] })
2271
+ ] }),
2272
+ /* @__PURE__ */ l("div", { className: "w6w-callable-list-actions", children: [
2273
+ f == null ? void 0 : f.actions,
2274
+ m && /* @__PURE__ */ t(
2275
+ "button",
2276
+ {
2277
+ type: "button",
2278
+ className: "w6w-btn w6w-btn-ghost",
2279
+ "data-testid": s == null ? void 0 : s.importOpen,
2280
+ onClick: m,
2281
+ children: "Import"
2282
+ }
2283
+ ),
2284
+ w && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", disabled: h, onClick: w, children: h ? "Creating…" : c })
2285
+ ] })
2286
+ ] }),
2287
+ u && /* @__PURE__ */ t("div", { className: "w6w-error", children: u }),
2288
+ /* @__PURE__ */ l("div", { className: "w6w-callable-list-body", children: [
2289
+ o && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
2290
+ e.length === 0 && !o && /* @__PURE__ */ t("div", { className: "w6w-muted", children: (f == null ? void 0 : f.empty) ?? i }),
2291
+ /* @__PURE__ */ t("ul", { className: "w6w-callable-list-rows", children: k.map((N) => /* @__PURE__ */ t("li", { title: $ ? r : void 0, children: /* @__PURE__ */ t(
2292
+ H,
2293
+ {
2294
+ title: N.title,
2295
+ subtitle: N.description,
2296
+ href: g == null ? void 0 : g(N.id),
2297
+ onClick: p ? (x) => p(N.id, x) : void 0,
2298
+ trailing: N.archived || N.badges != null || N.trailing != null ? /* @__PURE__ */ l("span", { className: "w6w-callable-list-trail", children: [
2299
+ N.badges,
2300
+ N.archived && /* @__PURE__ */ t(
2301
+ "span",
2302
+ {
2303
+ className: "w6w-callable-list-badge",
2304
+ "data-testid": s == null ? void 0 : s.archivedBadge,
2305
+ children: "archived"
2306
+ }
2307
+ ),
2308
+ N.trailing
2309
+ ] }) : void 0
2310
+ }
2311
+ ) }, N.id)) })
2312
+ ] })
2313
+ ] });
2314
+ }
2315
+ function Qn(e, n) {
2316
+ if (e.app) return e.app;
2317
+ if (e.app !== null)
2318
+ return n.get(e.appId);
2319
+ }
2320
+ function Sa(e) {
2321
+ const n = /* @__PURE__ */ new Set();
2322
+ for (const a of e)
2323
+ a.app === void 0 && n.add(a.appId);
2324
+ return [...n];
2325
+ }
2326
+ function Ca({
2327
+ connections: e,
2328
+ appsById: n,
2329
+ loading: a,
2330
+ error: i,
2331
+ onOpen: c,
2332
+ getHref: r,
2333
+ onEdit: s,
2334
+ onDelete: o,
2335
+ busy: u,
2336
+ slots: w
2337
+ }) {
2338
+ const h = n ?? /* @__PURE__ */ new Map();
2339
+ return /* @__PURE__ */ l("section", { className: "w6w-connection-list", children: [
2340
+ ((w == null ? void 0 : w.header) != null || (w == null ? void 0 : w.actions) != null) && /* @__PURE__ */ l("div", { className: "w6w-connection-list-head", children: [
2341
+ /* @__PURE__ */ t("div", { className: "w6w-connection-list-heading", children: w == null ? void 0 : w.header }),
2342
+ /* @__PURE__ */ t("div", { className: "w6w-connection-list-actions", children: w == null ? void 0 : w.actions })
2343
+ ] }),
2344
+ i && /* @__PURE__ */ t("div", { className: "w6w-error", children: i }),
2345
+ a && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
2346
+ e.length === 0 && !a && /* @__PURE__ */ t("div", { className: "w6w-muted", children: (w == null ? void 0 : w.empty) ?? "No connections yet." }),
2347
+ /* @__PURE__ */ t("ul", { className: "w6w-connection-rows", children: e.map((m) => {
2348
+ const p = Qn(m, h), g = m.displayName || m.id, S = m.builtIn === !0;
2349
+ return /* @__PURE__ */ l("li", { className: "w6w-connection-row", children: [
2350
+ /* @__PURE__ */ t("div", { className: "w6w-connection-row-main", children: /* @__PURE__ */ t(
2351
+ H,
2352
+ {
2353
+ href: S || r == null ? void 0 : r(m.id),
2354
+ onClick: S || !c ? void 0 : (v) => c(m.id, v),
2355
+ icon: /* @__PURE__ */ t(
2356
+ de,
2357
+ {
2358
+ src: p == null ? void 0 : p.iconSvg,
2359
+ srcDark: p == null ? void 0 : p.iconSvgDark,
2360
+ brandColor: p == null ? void 0 : p.brandColor,
2361
+ name: (p == null ? void 0 : p.displayName) ?? m.appId
2362
+ }
2363
+ ),
2364
+ title: /* @__PURE__ */ l(C, { children: [
2365
+ /* @__PURE__ */ t("strong", { className: "w6w-connection-name", title: g, children: g }),
2366
+ " ",
2367
+ /* @__PURE__ */ t("span", { className: "w6w-muted", children: (p == null ? void 0 : p.displayName) ?? m.appId })
2368
+ ] }),
2369
+ subtitle: /* @__PURE__ */ l(C, { children: [
2370
+ "auth ",
2371
+ /* @__PURE__ */ t("code", { children: m.authKey }),
2372
+ " ·",
2373
+ " ",
2374
+ /* @__PURE__ */ t(
2375
+ "span",
2376
+ {
2377
+ className: `w6w-connection-tag${m.state === "connected" ? "" : " w6w-connection-tag-warn"}`,
2378
+ children: m.state
2379
+ }
2380
+ ),
2381
+ m.lastTestOk === !1 && /* @__PURE__ */ t(
2382
+ "span",
2383
+ {
2384
+ className: "w6w-connection-tag w6w-connection-tag-danger",
2385
+ title: "Last test failed — update or re-test.",
2386
+ children: "invalid"
2387
+ }
2388
+ )
2389
+ ] })
2390
+ }
2391
+ ) }),
2392
+ !S && (s || o) && /* @__PURE__ */ l("div", { className: "w6w-connection-row-actions", children: [
2393
+ s && /* @__PURE__ */ t(
2394
+ An,
2395
+ {
2396
+ label: "Edit",
2397
+ onClick: () => s(m),
2398
+ "data-testid": `connection-edit-${m.id}`
2399
+ }
2400
+ ),
2401
+ o && /* @__PURE__ */ t(
2402
+ Tn,
2403
+ {
2404
+ label: "Delete",
2405
+ onClick: () => o(m),
2406
+ disabled: u,
2407
+ "data-testid": `connection-delete-${m.id}`
2408
+ }
2409
+ )
2410
+ ] })
2411
+ ] }, m.id);
2412
+ }) })
2413
+ ] });
2414
+ }
2415
+ function $a({ connection: e, onClose: n, onSaved: a }) {
2416
+ const i = ut(), c = i.updateConnection, r = e.builtIn === !0, s = !r && typeof c == "function", [o, u] = y(e.displayName ?? ""), [w, h] = y({}), [m, p] = y(null), [g, S] = y(null), [v, f] = y(!1);
2417
+ q(() => {
2418
+ if (!s) return;
2419
+ let N = !1;
2420
+ return p(null), i.getAppAuth(e.appId).then((x) => !N && p(x)).catch((x) => !N && S(x.message)), () => {
2421
+ N = !0;
2422
+ };
2423
+ }, [i, s, e.appId]);
2424
+ const A = m == null ? void 0 : m.find((N) => N.key === e.authKey), T = (A == null ? void 0 : A.type) === "oauth2", R = T ? [] : (A == null ? void 0 : A.fields) ?? [];
2425
+ function O() {
2426
+ const N = {};
2427
+ for (const _ of R) {
2428
+ const E = w[_.key];
2429
+ E !== void 0 && E !== "" && (N[_.key] = E);
2430
+ }
2431
+ const x = {};
2432
+ return o !== (e.displayName ?? "") && (x.displayName = o), Object.keys(N).length > 0 && (x.credential = N), x.displayName === void 0 && x.credential === void 0 ? null : x;
2433
+ }
2434
+ async function k() {
2435
+ if (!s || !c || v) return;
2436
+ S(null);
2437
+ const N = O();
2438
+ if (!N) {
2439
+ S("Nothing to update — change the name or a credential field.");
2440
+ return;
2441
+ }
2442
+ f(!0);
2443
+ try {
2444
+ const x = await c.call(i, e.id, N);
2445
+ h({}), a(x);
2446
+ } catch (x) {
2447
+ S(x.message);
2448
+ } finally {
2449
+ f(!1);
2450
+ }
2451
+ }
2452
+ const $ = Yt(k, { enabled: s && !v });
2453
+ return /* @__PURE__ */ t(Ae, { title: "Edit connection", onClose: n, children: /* @__PURE__ */ l("div", { className: "w6w-stepconfig", children: [
2454
+ /* @__PURE__ */ t("div", { className: "w6w-modal-body", children: /* @__PURE__ */ l("div", { className: "w6w-stack", children: [
2455
+ r && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "This connection is built in — it has no stored credential to edit." }),
2456
+ !r && !s && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Editing connections is not available here." }),
2457
+ s && /* @__PURE__ */ l(C, { children: [
2458
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
2459
+ /* @__PURE__ */ t("span", { children: "Display name" }),
2460
+ /* @__PURE__ */ t(
2461
+ "input",
2462
+ {
2463
+ type: "text",
2464
+ value: o,
2465
+ onChange: (N) => u(N.target.value),
2466
+ placeholder: "Connection name",
2467
+ maxLength: 80,
2468
+ name: "w6w-connection-label",
2469
+ autoComplete: "off",
2470
+ "data-1p-ignore": "true",
2471
+ "data-lpignore": "true",
2472
+ "data-bwignore": "true",
2473
+ "data-form-type": "other",
2474
+ ...$
2475
+ }
2476
+ )
2477
+ ] }),
2478
+ m === null && !g && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Loading auth fields…" }),
2479
+ T && /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "This is an OAuth connection. You can rename it here; its credential is renewed by re-authorizing it." }),
2480
+ R.length > 0 && /* @__PURE__ */ l(C, { children: [
2481
+ /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Leave a field blank to keep it unchanged. Filled fields replace the stored credential." }),
2482
+ /* @__PURE__ */ t(
2483
+ Vt,
2484
+ {
2485
+ mode: "edit",
2486
+ fields: R,
2487
+ values: w,
2488
+ onChange: h,
2489
+ enterSubmitProps: $
2490
+ }
2491
+ )
2492
+ ] })
2493
+ ] }),
2494
+ g && /* @__PURE__ */ t("div", { className: "w6w-result w6w-error", children: g })
2495
+ ] }) }),
2496
+ /* @__PURE__ */ l("div", { className: "w6w-modal-actions", children: [
2497
+ /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: n, children: "Cancel" }),
2498
+ s && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", disabled: v, onClick: k, children: v ? "Saving…" : "Save" })
2499
+ ] })
2500
+ ] }) });
2501
+ }
2502
+ function Aa({ conn: e, app: n, children: a }) {
2503
+ return /* @__PURE__ */ l("div", { className: "w6w-connection-header", "data-testid": "connection-header", children: [
2504
+ /* @__PURE__ */ t(
2505
+ de,
2506
+ {
2507
+ src: n == null ? void 0 : n.iconSvg,
2508
+ srcDark: n == null ? void 0 : n.iconSvgDark,
2509
+ brandColor: n == null ? void 0 : n.brandColor,
2510
+ name: (n == null ? void 0 : n.displayName) ?? e.appId,
2511
+ size: 56
2512
+ }
2513
+ ),
2514
+ /* @__PURE__ */ l("div", { className: "w6w-connection-header-main", children: [
2515
+ /* @__PURE__ */ t("h2", { className: "w6w-connection-header-title", children: e.displayName || e.id }),
2516
+ /* @__PURE__ */ l("p", { className: "w6w-muted w6w-small w6w-connection-header-meta", children: [
2517
+ /* @__PURE__ */ t(wn, { value: e.id, className: "w6w-connection-id-copy" }),
2518
+ " · App",
2519
+ " ",
2520
+ /* @__PURE__ */ t("code", { children: e.appId }),
2521
+ " · Auth ",
2522
+ /* @__PURE__ */ t("code", { children: e.authKey }),
2523
+ " ·",
2524
+ " ",
2525
+ /* @__PURE__ */ t(
2526
+ "span",
2527
+ {
2528
+ className: `w6w-connection-tag${e.state === "connected" ? "" : " w6w-connection-tag-warn"}`,
2529
+ children: e.state
2530
+ }
2531
+ ),
2532
+ e.lastTestOk === !1 && /* @__PURE__ */ t(
2533
+ "span",
2534
+ {
2535
+ className: "w6w-connection-tag w6w-connection-tag-danger",
2536
+ title: "Last test failed — update or re-test.",
2537
+ children: "invalid"
2538
+ }
2539
+ )
2540
+ ] })
2541
+ ] }),
2542
+ a && /* @__PURE__ */ t("div", { className: "w6w-connection-header-actions", children: a })
1749
2543
  ] });
1750
2544
  }
1751
2545
  export {
1752
- Ps as ActionTestForm,
1753
- en as AddConnectionModal,
1754
- Wt as ApiCallsPanel,
1755
- ce as ApiError,
1756
- tn as AppIcon,
1757
- sn as AppPicker,
1758
- nn as AuthFieldsForm,
1759
- ke as CodeBlock,
1760
- an as CodeEditor,
1761
- _t as Combobox,
1762
- Pt as ConfirmModal,
1763
- qt as Copyable,
1764
- Us as CopyableText,
1765
- Ws as DeleteButton,
1766
- Ks as EditButton,
1767
- Ys as ExecutionDetail,
1768
- Gs as ExecutionFilters,
1769
- zs as ExecutionList,
1770
- ms as ExecutionLogPanel,
1771
- Qs as ExecutionStats,
1772
- rn as ExpressionInput,
1773
- ln as ExpressionOptionsProvider,
1774
- Fs as HealthStatusPill,
1775
- js as HistoryTimeline,
1776
- ze as Icon,
1777
- L as IconButton,
1778
- qs as InfoTip,
1779
- z as JsonEditor,
1780
- Ne as ListItem,
1781
- Ve as Modal,
1782
- on as NodeConfigForm,
1783
- Mt as ParamsForm,
1784
- cn as PropertyEntryForm,
1785
- Vs as RepoSyncIndicator,
1786
- dn as RetryPolicyFields,
1787
- Hs as ServerResourcesBadge,
1788
- Bs as ServerResourcesCard,
1789
- Js as ServerResourcesCardSmall,
1790
- Ds as ServerResourcesRail,
1791
- un as StepBuilderModal,
1792
- Se as StepStatusPill,
1793
- Ls as UptimeStrip,
1794
- wn as W6WUIProvider,
1795
- Is as YamlEditor,
1796
- _s as createW6WApi,
1797
- Qt as cropText,
1798
- mn as filterOptions,
1799
- $e as formatDurationMs,
1800
- X as formatExecutionTime,
1801
- xn as iconNames,
1802
- hn as isExprValue,
1803
- pn as isSecretValue,
1804
- fn as isTestRequired,
1805
- vn as requiredParamsFilled,
1806
- yn as shouldUseCombobox,
1807
- Nn as startOAuthPopup,
1808
- gn as useEnterSubmit,
1809
- bn as useExpressionOptions,
1810
- Et as useW6WApi
2546
+ rt as ATTENTION_DISPLAY_CAP,
2547
+ oa as ActionTestForm,
2548
+ Oa as AddConnectionModal,
2549
+ rn as ApiCallsPanel,
2550
+ se as ApiError,
2551
+ de as AppIcon,
2552
+ Ma as AppPicker,
2553
+ Vt as AuthFieldsForm,
2554
+ xa as CallableList,
2555
+ Me as CodeBlock,
2556
+ Ia as CodeEditor,
2557
+ qt as Combobox,
2558
+ Ht as ConfirmModal,
2559
+ Aa as ConnectionHeader,
2560
+ Ca as ConnectionList,
2561
+ sn as Copyable,
2562
+ wn as CopyableText,
2563
+ Tn as DeleteButton,
2564
+ An as EditButton,
2565
+ $a as EditConnectionModal,
2566
+ ga as ExecutionDetail,
2567
+ va as ExecutionFilters,
2568
+ Na as ExecutionList,
2569
+ In as ExecutionLogPanel,
2570
+ ya as ExecutionStats,
2571
+ Ea as ExpressionInput,
2572
+ Pa as ExpressionOptionsProvider,
2573
+ Ie as HealthStatusPill,
2574
+ ha as HistoryTimeline,
2575
+ et as Icon,
2576
+ z as IconButton,
2577
+ pa as InfoTip,
2578
+ ae as JsonEditor,
2579
+ H as ListItem,
2580
+ Ae as Modal,
2581
+ _a as NodeConfigForm,
2582
+ Wt as ParamsForm,
2583
+ La as PropertyEntryForm,
2584
+ Hn as RECENT_DISPLAY_CAP,
2585
+ Vn as ReliabilityChart,
2586
+ ka as ReliabilityList,
2587
+ fa as RepoSyncIndicator,
2588
+ Ua as RetryPolicyFields,
2589
+ ma as ServerResourcesBadge,
2590
+ da as ServerResourcesCard,
2591
+ ua as ServerResourcesCardSmall,
2592
+ wa as ServerResourcesRail,
2593
+ Da as StepBuilderModal,
2594
+ Pe as StepStatusPill,
2595
+ pn as UptimeStrip,
2596
+ Ba as W6WUIProvider,
2597
+ ca as YamlEditor,
2598
+ Sa as connectionAppIdsToLookUp,
2599
+ ra as createW6WApi,
2600
+ un as cropText,
2601
+ zn as displayBoard,
2602
+ Fa as filterOptions,
2603
+ _e as formatDurationMs,
2604
+ ce as formatExecutionTime,
2605
+ Ya as iconNames,
2606
+ Ja as isExprValue,
2607
+ ja as isSecretValue,
2608
+ Ka as isTestRequired,
2609
+ ba as needsAttention,
2610
+ Wn as partitionBoard,
2611
+ Kn as performancePoints,
2612
+ Wa as requiredParamsFilled,
2613
+ Qn as resolveConnectionAppMeta,
2614
+ qa as shouldUseCombobox,
2615
+ Ha as startOAuthPopup,
2616
+ qn as uptimeDays,
2617
+ Yt as useEnterSubmit,
2618
+ za as useExpressionOptions,
2619
+ ut as useW6WApi
1811
2620
  };
1812
2621
  //# sourceMappingURL=index.mjs.map