@w6w/ui 0.1.0 → 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 (47) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +25 -8
  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-sY1tzkBO.js → ConfirmModal-Wx3i8F1n.js} +4470 -4446
  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/code.cjs +1 -1
  12. package/dist/code.mjs +1 -0
  13. package/dist/code.mjs.map +1 -1
  14. package/dist/components/AuthFieldsForm.d.ts +8 -1
  15. package/dist/components/CallableList.d.ts +57 -0
  16. package/dist/components/ConnectionList.d.ts +44 -0
  17. package/dist/components/ListItem.d.ts +16 -6
  18. package/dist/components/ReliabilityChart.d.ts +10 -0
  19. package/dist/components/ReliabilityList.d.ts +47 -0
  20. package/dist/connection-app-meta.d.ts +32 -0
  21. package/dist/flow.cjs +1 -1
  22. package/dist/flow.cjs.map +1 -1
  23. package/dist/flow.d.ts +3 -1
  24. package/dist/flow.mjs +50 -49
  25. package/dist/flow.mjs.map +1 -1
  26. package/dist/index.cjs +1 -1
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.ts +16 -0
  29. package/dist/index.mjs +1701 -891
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/provider.d.ts +21 -1
  32. package/dist/reliability-board-layout.d.ts +121 -0
  33. package/dist/types.d.ts +8 -0
  34. package/package.json +3 -2
  35. package/src/code.css +23 -4
  36. package/src/styles/_callable-list.scss +60 -0
  37. package/src/styles/_connections.scss +100 -0
  38. package/src/styles/_flow.scss +4 -4
  39. package/src/styles/_lists.scss +4 -0
  40. package/src/styles/_reliability.scss +339 -0
  41. package/src/styles/_tokens.scss +23 -4
  42. package/src/styles.css +4386 -3108
  43. package/src/styles.scss +3 -0
  44. package/dist/ConfirmModal-DJPYXE9t.cjs +0 -11
  45. package/dist/ConfirmModal-DJPYXE9t.cjs.map +0 -1
  46. package/dist/ConfirmModal-sY1tzkBO.js.map +0 -1
  47. package/dist/ui.css +0 -1
package/dist/index.mjs CHANGED
@@ -1,43 +1,44 @@
1
- var Tt = Object.defineProperty;
2
- var At = (e, s, n) => s in e ? Tt(e, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[s] = n;
3
- var V = (e, s, n) => At(e, typeof s != "symbol" ? s + "" : s, n);
4
- 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-sY1tzkBO.js";
5
- 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-sY1tzkBO.js";
6
- import { jsxs as o, jsx as t, Fragment as k } from "react/jsx-runtime";
7
- import { useMemo as ye, useState as v, useEffect as G, useId as Ut, useRef as Ft } from "react";
8
- import { C as ke } from "./CodeBlock-Dot3Pd7P.js";
9
- import { yaml as Lt } from "@codemirror/lang-yaml";
10
- import { EditorView as Bt } from "@codemirror/view";
11
- import Jt from "@uiw/react-codemirror";
12
- import { u as Dt, a as Ht, b as jt, C as qt, I as ze } from "./Copyable-1niV9gUa.js";
13
- import { i as xn } from "./Copyable-1niV9gUa.js";
14
- class ce extends Error {
15
- constructor(n, l, d, a) {
16
- super(d);
17
- V(this, "status");
18
- V(this, "code");
1
+ "use client";
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");
19
20
  /**
20
21
  * The parsed error response body, when the server sent one. Carries the
21
22
  * fields that ride alongside an error — e.g. an invoke's `logs` and
22
23
  * `apiCalls` — which the message alone would drop.
23
24
  */
24
- V(this, "body");
25
- 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;
26
27
  }
27
28
  }
28
- function _s(e) {
29
- const s = e.baseUrl.replace(/\/$/, ""), n = e.fetch ?? globalThis.fetch, l = async () => typeof e.token == "function" ? await e.token() : e.token;
30
- async function d(r, c) {
31
- const u = new Headers(c == null ? void 0 : c.headers), w = await l();
32
- 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");
33
34
  let h;
34
35
  try {
35
- h = await n(`${s}${r}`, { ...c, headers: u });
36
- } catch (N) {
37
- throw new ce(
36
+ h = await a(`${n}${s}`, { ...o, headers: u });
37
+ } catch (g) {
38
+ throw new se(
38
39
  0,
39
40
  "network_error",
40
- `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})`
41
42
  );
42
43
  }
43
44
  const m = await h.text();
@@ -47,66 +48,82 @@ function _s(e) {
47
48
  p = JSON.parse(m);
48
49
  } catch {
49
50
  if (!h.ok)
50
- throw new ce(
51
+ throw new se(
51
52
  h.status,
52
53
  "bad_response",
53
54
  `Server returned a non-JSON ${h.status} response: ${m.slice(0, 200)}`
54
55
  );
55
56
  }
56
57
  if (!h.ok) {
57
- const N = (p == null ? void 0 : p.error) ?? {};
58
- 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);
59
60
  }
60
61
  return { status: h.status, data: p };
61
62
  }
62
- async function a(r, c) {
63
- const { data: u } = await d(r, c);
63
+ async function r(s, o) {
64
+ const { data: u } = await c(s, o);
64
65
  return u;
65
66
  }
66
67
  return {
67
68
  // A bare GET only returns the server's default page (50) — every consumer
68
- // of this client treats the result as the complete catalog, so page
69
- // 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.
70
75
  listApps: async () => {
71
- const r = [];
72
- let c;
73
- for (let u = 0; u < 20; u++) {
74
- const w = new URLSearchParams({ limit: "200" });
75
- c && w.set("cursor", c);
76
- const h = await a(`/apps?${w}`);
77
- if (r.push(...h.apps), !h.nextCursor) break;
78
- 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;
79
93
  }
80
- return r;
81
94
  },
82
95
  // Bounded lookup: dedupe; `[]` sends nothing; chunks of <= 100 (the server's
83
96
  // `MAX_IDS_PER_QUERY`), each `GET /apps?ids=a,b` with no limit/cursor.
84
- listAppsByIds: async (r) => {
85
- const c = Array.from(new Set(r)), u = [];
86
- for (let w = 0; w < c.length; w += 100) {
87
- 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}`);
88
101
  u.push(...p.apps);
89
102
  }
90
103
  return u;
91
104
  },
92
- getAppAuth: async (r) => (await a(`/apps/${encodeURIComponent(r)}/auths`)).auths ?? [],
93
- 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`, {
94
107
  method: "POST",
95
- body: JSON.stringify(c)
108
+ body: JSON.stringify(o)
96
109
  }).then((u) => u.connection),
97
- startAppOAuthFlow: (r, c, u) => a(
98
- `/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`,
99
116
  { method: "POST", body: JSON.stringify(u) }
100
117
  ),
101
- getAppActions: (r) => a(`/apps/${encodeURIComponent(r)}`).then(
102
- (c) => c.actions ?? []
118
+ getAppActions: (s) => r(`/apps/${encodeURIComponent(s)}`).then(
119
+ (o) => o.actions ?? []
103
120
  ),
104
- listConnectionsForApp: (r) => a(
105
- `/apps/${encodeURIComponent(r)}/connections`
106
- ).then((c) => c.connections ?? []),
107
- listConnections: () => a("/connections").then((r) => r.connections ?? []),
108
- invokeAction: (r, c, u, w = {}) => a(
109
- `/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`,
110
127
  // This body is built KEY BY KEY, not by spreading `opts` — so every new
111
128
  // option has to be named here or it is silently dropped before the wire
112
129
  // (the caller compiles, the UI looks right, the field never leaves the
@@ -125,69 +142,69 @@ function _s(e) {
125
142
  })
126
143
  }
127
144
  ),
128
- listSavedTests: (r) => a(
129
- `/connections/${encodeURIComponent(r)}/saved-tests`
130
- ).then((c) => c.savedTests ?? []),
131
- createSavedTest: (r, c) => a(
132
- `/connections/${encodeURIComponent(r)}/saved-tests`,
133
- { 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) }
134
151
  ).then((u) => u.savedTest),
135
- updateSavedTest: (r, c, u) => a(
136
- `/connections/${encodeURIComponent(r)}/saved-tests/${encodeURIComponent(c)}`,
152
+ updateSavedTest: (s, o, u) => r(
153
+ `/connections/${encodeURIComponent(s)}/saved-tests/${encodeURIComponent(o)}`,
137
154
  { method: "PATCH", body: JSON.stringify(u) }
138
155
  ).then((w) => w.savedTest),
139
- deleteSavedTest: (r, c) => a(
140
- `/connections/${encodeURIComponent(r)}/saved-tests/${encodeURIComponent(c)}`,
156
+ deleteSavedTest: (s, o) => r(
157
+ `/connections/${encodeURIComponent(s)}/saved-tests/${encodeURIComponent(o)}`,
141
158
  { method: "DELETE" }
142
159
  ).then(() => {
143
160
  }),
144
- recordTestRun: (r, c) => a(`/connections/${encodeURIComponent(r)}/test-runs`, {
161
+ recordTestRun: (s, o) => r(`/connections/${encodeURIComponent(s)}/test-runs`, {
145
162
  method: "POST",
146
- body: JSON.stringify(c)
163
+ body: JSON.stringify(o)
147
164
  }).then(() => {
148
165
  }),
149
- listTestRuns: (r) => a(
150
- `/connections/${encodeURIComponent(r)}/test-runs`
151
- ).then((c) => c.runs ?? []),
152
- saveStepTest: (r, c, u) => a(
153
- `/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`,
154
171
  { method: "POST", body: JSON.stringify(u) }
155
172
  ).then((w) => w.stepTest),
156
- listStepTests: (r, c) => a(
157
- `/workflows/${encodeURIComponent(r)}/steps/${encodeURIComponent(c)}/tests`
173
+ listStepTests: (s, o) => r(
174
+ `/workflows/${encodeURIComponent(s)}/steps/${encodeURIComponent(o)}/tests`
158
175
  ).then((u) => u.stepTests ?? []),
159
- recordStepTestRun: (r, c, u) => a(
160
- `/workflows/${encodeURIComponent(r)}/steps/${encodeURIComponent(c)}/test-runs`,
176
+ recordStepTestRun: (s, o, u) => r(
177
+ `/workflows/${encodeURIComponent(s)}/steps/${encodeURIComponent(o)}/test-runs`,
161
178
  { method: "POST", body: JSON.stringify(u) }
162
179
  ).then(() => {
163
180
  }),
164
- listFunctions: () => a("/functions").then((r) => r.functions ?? []),
165
- getFunction: (r) => a(
166
- `/functions/${encodeURIComponent(r)}`
167
- ).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 })),
168
185
  // The real synchronous route (`/functions/:id/invoke`) — deliberately NOT
169
186
  // `POST /run`, which would give the test stage a different code path than
170
187
  // the `@w6w/call` node it's standing in for. Returns the raw output,
171
188
  // pinned against the committed `studio/src/repos/functions.ts` signature.
172
- invokeFunction: (r, c) => a(`/functions/${encodeURIComponent(r)}/invoke`, {
189
+ invokeFunction: (s, o) => r(`/functions/${encodeURIComponent(s)}/invoke`, {
173
190
  method: "POST",
174
- body: JSON.stringify({ inputs: c })
191
+ body: JSON.stringify({ inputs: o })
175
192
  }).then((u) => u.output),
176
- listWorkflows: () => a("/workflows").then((r) => r.workflows ?? []),
177
- getWorkflow: (r) => a(`/workflows/${encodeURIComponent(r)}`).then(
178
- (c) => c.workflow
193
+ listWorkflows: () => r("/workflows").then((s) => s.workflows ?? []),
194
+ getWorkflow: (s) => r(`/workflows/${encodeURIComponent(s)}`).then(
195
+ (o) => o.workflow
179
196
  ),
180
197
  // `rawReq`, not `req<T>` — the ONE caller that needs the response's own
181
198
  // status code: `200` (the run reached a terminal state inside the wait
182
199
  // window) vs `202` (the server's own wait-timeout, still running). Both
183
200
  // are 2xx successes; `rawReq` already throws on a non-2xx.
184
- runWorkflow: (r, c = {}) => d(`/workflows/${encodeURIComponent(r)}/run?wait=true`, {
201
+ runWorkflow: (s, o = {}) => c(`/workflows/${encodeURIComponent(s)}/run?wait=true`, {
185
202
  method: "POST",
186
- body: JSON.stringify({ variables: c.variables, input: c.input })
203
+ body: JSON.stringify({ variables: o.variables, input: o.input })
187
204
  }).then(({ status: u, data: w }) => ({ ...w ?? {}, terminal: u === 200 }))
188
205
  };
189
206
  }
190
- function Ge(e) {
207
+ function tt(e) {
191
208
  if (!e) return "";
192
209
  try {
193
210
  return JSON.stringify(JSON.parse(e), null, 2);
@@ -195,308 +212,319 @@ function Ge(e) {
195
212
  return e;
196
213
  }
197
214
  }
198
- function Kt(e, s) {
199
- return `${e.method}-${e.url ?? e.host}-${s}`;
215
+ function ln(e, n) {
216
+ return `${e.method}-${e.url ?? e.host}-${n}`;
200
217
  }
201
- function Wt({ calls: e, defaultOpen: s, keyOf: n, title: l }) {
218
+ function rn({ calls: e, defaultOpen: n, keyOf: a, title: i }) {
202
219
  if (e.length === 0) return null;
203
- const d = n ?? Kt;
204
- return /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: 4 }, children: [
205
- 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: [
206
223
  "API ",
207
224
  e.length === 1 ? "call" : "calls",
208
225
  " (",
209
226
  e.length,
210
227
  ")"
211
228
  ] }) }),
212
- e.map((a, r) => /* @__PURE__ */ o(
229
+ e.map((r, s) => /* @__PURE__ */ l(
213
230
  "details",
214
231
  {
215
- open: s,
232
+ open: n,
216
233
  className: "w6w-result",
217
234
  style: { padding: 8 },
218
235
  children: [
219
- /* @__PURE__ */ t("summary", { style: { cursor: "pointer" }, children: /* @__PURE__ */ o("span", { className: "w6w-small", children: [
220
- a.method,
236
+ /* @__PURE__ */ t("summary", { style: { cursor: "pointer" }, children: /* @__PURE__ */ l("span", { className: "w6w-small", children: [
237
+ r.method,
221
238
  " ",
222
- a.url ?? a.host,
239
+ r.url ?? r.host,
223
240
  " →",
224
241
  " ",
225
- /* @__PURE__ */ t("strong", { children: a.error ? "failed" : a.status }),
226
- 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: [
227
244
  " · ",
228
- a.durationMs,
245
+ r.durationMs,
229
246
  "ms"
230
247
  ] })
231
248
  ] }) }),
232
- /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: 6, marginTop: 8 }, children: [
233
- 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 }),
234
251
  /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "Request headers" }),
235
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(a.requestHeaders ?? {}, null, 2) }),
236
- 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: [
237
254
  /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "Request body" }),
238
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: Ge(a.requestBody) })
255
+ /* @__PURE__ */ t("pre", { className: "w6w-result", children: tt(r.requestBody) })
239
256
  ] }),
240
257
  /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "Response headers" }),
241
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: JSON.stringify(a.responseHeaders ?? {}, null, 2) }),
242
- 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: [
243
260
  /* @__PURE__ */ t("div", { className: "w6w-muted w6w-small", children: "Response body" }),
244
- /* @__PURE__ */ t("pre", { className: "w6w-result", children: Ge(a.responseBody) })
261
+ /* @__PURE__ */ t("pre", { className: "w6w-result", children: tt(r.responseBody) })
245
262
  ] }),
246
- 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." })
247
264
  ] })
248
265
  ]
249
266
  },
250
- d(a, r)
267
+ c(r, s)
251
268
  ))
252
269
  ] });
253
270
  }
254
- function Ne({
271
+ function H({
255
272
  title: e,
256
- subtitle: s,
257
- icon: n,
258
- trailing: l,
259
- active: d = !1,
260
- onClick: a,
261
- ariaLabel: r
273
+ subtitle: n,
274
+ icon: a,
275
+ trailing: i,
276
+ active: c = !1,
277
+ onClick: r,
278
+ href: s,
279
+ ariaLabel: o
262
280
  }) {
263
- const c = /* @__PURE__ */ o(k, { children: [
264
- n != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-icon", children: n }),
265
- /* @__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: [
266
284
  /* @__PURE__ */ t("span", { className: "w6w-list-item-title", children: e }),
267
- 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 })
268
286
  ] }),
269
- l != null && /* @__PURE__ */ t("span", { className: "w6w-list-item-trailing", children: l })
270
- ] }), u = `w6w-list-item${d ? " active" : ""}`;
271
- 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(
272
300
  "button",
273
301
  {
274
302
  type: "button",
275
- className: u,
276
- "aria-pressed": d,
277
- "aria-label": r,
278
- onClick: a,
279
- children: c
303
+ className: w,
304
+ "aria-pressed": c,
305
+ "aria-label": o,
306
+ onClick: r,
307
+ children: u
280
308
  }
281
- ) : /* @__PURE__ */ t("div", { className: u, "aria-label": r, children: c });
282
- }
283
- function de(e) {
284
- const s = Date.parse(e);
285
- if (Number.isNaN(s)) return "";
286
- const n = Math.max(0, Math.round((Date.now() - s) / 1e3));
287
- if (n < 45) return "just now";
288
- const l = Math.round(n / 60);
289
- if (l < 60) return `${l}m ago`;
290
- const d = Math.round(l / 60);
291
- if (d < 24) return `${d}h ago`;
292
- const a = Math.round(d / 24);
293
- return a < 7 ? `${a}d ago` : new Date(s).toLocaleDateString();
294
- }
295
- function Qe(e) {
296
- const s = {};
297
- for (const n of (e == null ? void 0 : e.params) ?? [])
298
- n.key && n.default !== void 0 && (s[n.key] = n.default);
299
- return s;
300
- }
301
- function Vt(e) {
302
- var n, l, d;
303
- const s = e.indexOf("{");
304
- 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)
305
333
  try {
306
- 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);
307
- if (typeof r == "string" && r.trim()) {
308
- const c = e.slice(0, s).replace(/[:\s]+$/, "");
309
- 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();
310
338
  }
311
339
  } catch {
312
340
  }
313
341
  return e;
314
342
  }
315
- function tt(e) {
343
+ function wt(e) {
316
344
  return typeof e == "object" && e !== null && typeof e.status == "number" && typeof e.code == "string";
317
345
  }
318
- function zt(e) {
319
- if (!tt(e))
346
+ function cn(e) {
347
+ if (!wt(e))
320
348
  return { headline: (e == null ? void 0 : e.message) ?? "The action failed to run." };
321
- 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();
322
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(
323
- n
351
+ a
324
352
  ) ? {
325
353
  headline: "Permission denied by the provider — this is a credential/scope problem, not a w6w error.",
326
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.",
327
- detail: s
328
- } : { headline: "The action returned an error.", detail: s };
329
- }
330
- function Gt(e) {
331
- const s = tt(e) ? e.body ?? e.raw : null;
332
- return (s == null ? void 0 : s.apiCalls) ?? [];
333
- }
334
- function ue() {
335
- const [e, s] = v(""), [n, l] = v(void 0), [d, a] = v(!1);
336
- return { text: e, value: n, invalid: d, onChange: (c) => {
337
- s(c);
338
- 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();
339
367
  if (u === "") {
340
- a(!1);
368
+ r(!1);
341
369
  return;
342
370
  }
343
371
  try {
344
372
  const w = JSON.parse(u);
345
- 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);
346
374
  } catch {
347
- a(!0);
375
+ r(!0);
348
376
  }
349
377
  } };
350
378
  }
351
- function Ps({
379
+ function oa({
352
380
  appId: e,
353
- actions: s,
354
- connectionId: n,
355
- action: l,
356
- seedValues: d,
357
- onSavedTestsChanged: a,
358
- seedTestId: r,
359
- onDirtyChange: c,
381
+ actions: n,
382
+ connectionId: a,
383
+ action: i,
384
+ seedValues: c,
385
+ onSavedTestsChanged: r,
386
+ seedTestId: s,
387
+ onDirtyChange: o,
360
388
  onTestSaved: u,
361
389
  onDeleted: w,
362
390
  embedded: h = !1
363
391
  }) {
364
- var qe;
365
- const m = Et(), p = ye(() => {
366
- const i = [...s];
367
- return i.sort((f, g) => (f.title || f.key).localeCompare(g.title || g.key)), i;
368
- }, [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 = () => {
369
- const i = {};
370
- 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;
371
- }, [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(() => ({
372
- key: b,
373
- values: _e
374
- })), [x, U] = v(r ?? null), [Ie, H] = v(_e);
375
- if (Pe.key !== b) {
376
- const i = Qe(y);
377
- 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([]);
378
406
  }
379
- const [ct, dt] = v(r);
380
- r !== ct && (dt(r), U(r ?? null));
381
- const [Ue, ut] = v(d);
382
- if (d !== Ue) {
383
- const i = JSON.stringify(d ?? null) !== JSON.stringify(Ue ?? null);
384
- if (ut(d), d && i) {
385
- const f = { ...d };
386
- 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([]);
387
415
  }
388
416
  }
389
- const S = Pe.values, Fe = (i) => D({ key: b, values: i }), Le = ye(
390
- () => JSON.stringify(S) !== JSON.stringify(Ie),
391
- [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]
392
420
  );
393
- G(() => {
394
- c == null || c(Le);
395
- }, [Le]);
396
- const wt = () => {
397
- Ae(JSON.stringify(S, null, 2)), Ee(!1), ne("json");
398
- }, mt = async (i) => {
399
- if (!y || Te) return;
400
- const f = y.key;
401
- Oe(!0), _(null), P(void 0), E([]);
402
- let g;
403
- 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();
404
432
  try {
405
- const M = await m.invokeAction(e, f, i, {
406
- connectionId: n,
407
- ...Ke ? { overrides: Ke } : {}
433
+ const F = await m.invokeAction(e, b, d, {
434
+ connectionId: a,
435
+ ...Ze ? { overrides: Ze } : {}
408
436
  });
409
- P(M.value), E(M.apiCalls ?? []), g = { ok: !0, summary: "OK", result: M.value };
410
- } catch (M) {
411
- const We = zt(M);
412
- _(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 };
413
441
  } finally {
414
- Oe(!1);
442
+ A(!1);
415
443
  }
416
- if (n)
444
+ if (a)
417
445
  try {
418
- await m.recordTestRun(n, {
419
- savedTestId: x ?? null,
420
- actionKey: f,
421
- ok: g.ok,
422
- summary: g.summary.slice(0, 200),
423
- result: g.result
424
- }), 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();
425
453
  } catch {
426
454
  }
427
- }, 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);
428
- G(() => {
429
- if (!n) {
430
- 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);
431
459
  return;
432
460
  }
433
- let i = !1;
434
- return F(null), m.listSavedTests(n).then((f) => !i && Be(f)).catch((f) => !i && F(f.message)), () => {
435
- 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;
436
464
  };
437
- }, [m, n, pt]);
438
- const Je = b ? (j ?? []).filter((i) => i.actionKey === b) : [], [Nt, oe] = v(null), [gt, bt] = v(0), kt = () => bt((i) => i + 1);
439
- G(() => {
440
- const i = m.listTestRuns;
441
- if (!n || !i) {
442
- 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);
443
471
  return;
444
472
  }
445
- let f = !1;
446
- return i(n).then((g) => !f && oe(g)).catch(() => !f && oe(null)), () => {
447
- f = !0;
473
+ let b = !1;
474
+ return d(a).then((I) => !b && ve(I)).catch(() => !b && ve(null)), () => {
475
+ b = !0;
448
476
  };
449
- }, [m, n, gt]);
450
- const De = b ? (Nt ?? []).filter((i) => i.actionKey === b).slice().sort((i, f) => Date.parse(f.occurredAt) - Date.parse(i.occurredAt)) : [], xt = () => {
451
- !n || !y || (re(""), F(null), K(!0));
452
- }, St = () => {
453
- !n || !y || (x ? He() : xt());
454
- }, He = async () => {
455
- 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))
456
484
  try {
457
- let i;
458
- if (x)
459
- i = await m.updateSavedTest(n, x, { values: S });
485
+ let d;
486
+ if (L)
487
+ d = await m.updateSavedTest(a, L, { values: U });
460
488
  else {
461
- const f = ae.trim();
462
- if (!f) return;
463
- i = await m.createSavedTest(n, {
464
- actionKey: y.key,
465
- name: f,
466
- values: S
467
- }), 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);
468
496
  }
469
- H({ ...S }), K(!1), re(""), ie(), a == null || a(), u == null || u(i);
470
- } catch (i) {
471
- F(i.message);
497
+ Q({ ...U }), ee(!1), pe(""), Ne(), r == null || r(), u == null || u(d);
498
+ } catch (d) {
499
+ K(d.message);
472
500
  }
473
- }, $t = (i) => {
474
- const f = { ...i.values };
475
- D({ key: b, values: f }), H(f), U(i.id), ne("form"), _(null), P(void 0), E([]);
476
- }, Ct = async () => {
477
- if (!n || !x) return;
478
- 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;
479
507
  try {
480
- await m.deleteSavedTest(n, i), U(null), ie(), a == null || a(), w == null || w(i);
481
- } catch (f) {
482
- 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);
483
511
  }
484
- }, Ot = /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1-5)" }, children: [
485
- /* @__PURE__ */ o(
512
+ }, Ft = /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-1-5)" }, children: [
513
+ /* @__PURE__ */ l(
486
514
  "div",
487
515
  {
488
516
  className: "w6w-field-labelrow",
489
517
  style: { display: "flex", justifyContent: "space-between", alignItems: "center" },
490
518
  children: [
491
519
  /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "Parameters" }),
492
- /* @__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: [
493
521
  /* @__PURE__ */ t(
494
522
  "button",
495
523
  {
496
524
  type: "button",
497
- className: `w6w-btn w6w-btn-sm w6w-btn-ghost${I === "form" ? " active" : ""}`,
498
- "aria-pressed": I === "form",
499
- 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"),
500
528
  children: "Form"
501
529
  }
502
530
  ),
@@ -504,9 +532,9 @@ function Ps({
504
532
  "button",
505
533
  {
506
534
  type: "button",
507
- className: `w6w-btn w6w-btn-sm w6w-btn-ghost${I === "json" ? " active" : ""}`,
508
- "aria-pressed": I === "json",
509
- onClick: wt,
535
+ className: `w6w-btn w6w-btn-sm w6w-btn-ghost${J === "json" ? " active" : ""}`,
536
+ "aria-pressed": J === "json",
537
+ onClick: Ct,
510
538
  children: "JSON"
511
539
  }
512
540
  ),
@@ -515,86 +543,86 @@ function Ps({
515
543
  {
516
544
  type: "button",
517
545
  className: "w6w-btn w6w-btn-sm w6w-btn-ghost",
518
- "aria-pressed": T,
519
- title: T ? "Collapse the params editor" : "Open the params editor in a larger view",
520
- "aria-label": T ? "Collapse the params editor" : "Open the params editor in a larger view",
521
- onClick: () => Me((i) => !i),
522
- 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 ? "⤡" : "⤢"
523
551
  }
524
552
  )
525
553
  ] })
526
554
  ]
527
555
  }
528
556
  ),
529
- 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: [
530
558
  /* @__PURE__ */ t(
531
- z,
559
+ ae,
532
560
  {
533
- value: it,
534
- onChange: Ae,
535
- minHeight: T ? "50vh" : "200px",
561
+ value: gt,
562
+ onChange: Ue,
563
+ minHeight: B ? "50vh" : "200px",
536
564
  "aria-label": "Params JSON",
537
- onValidChange: (i) => {
538
- i !== null && typeof i == "object" && !Array.isArray(i) && Fe(i);
565
+ onValidChange: (d) => {
566
+ d !== null && typeof d == "object" && !Array.isArray(d) && We(d);
539
567
  },
540
- onValidityChange: ({ valid: i }) => Ee(!i)
568
+ onValidityChange: ({ valid: d }) => De(!d)
541
569
  }
542
570
  ),
543
- 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" })
544
572
  ] })
545
- ] }), Rt = /* @__PURE__ */ o("details", { className: "w6w-section", "data-testid": "overrides-region", children: [
546
- /* @__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: [
547
575
  /* @__PURE__ */ t("span", { className: "w6w-section-title", children: "Overrides" }),
548
576
  /* @__PURE__ */ t("span", { className: "w6w-section-subtitle", children: "Reach a vendor field this action's own params don't declare" })
549
577
  ] }),
550
- /* @__PURE__ */ o("div", { className: "w6w-stack w6w-section-body", style: { gap: "var(--w6w-sp-2)" }, children: [
551
- /* @__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: [
552
580
  /* @__PURE__ */ t("span", { children: "Body" }),
553
581
  /* @__PURE__ */ t(
554
- z,
582
+ ae,
555
583
  {
556
- value: C.text,
557
- onChange: C.onChange,
584
+ value: x.text,
585
+ onChange: x.onChange,
558
586
  minHeight: "80px",
559
587
  "aria-label": "Overrides body (JSON)"
560
588
  }
561
589
  ),
562
- 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" })
563
591
  ] }),
564
- /* @__PURE__ */ o("div", { className: "w6w-field", children: [
592
+ /* @__PURE__ */ l("div", { className: "w6w-field", children: [
565
593
  /* @__PURE__ */ t("span", { children: "Query" }),
566
594
  /* @__PURE__ */ t(
567
- z,
595
+ ae,
568
596
  {
569
- value: O.text,
570
- onChange: O.onChange,
597
+ value: _.text,
598
+ onChange: _.onChange,
571
599
  minHeight: "80px",
572
600
  "aria-label": "Overrides query (JSON)"
573
601
  }
574
602
  ),
575
- 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" })
576
604
  ] }),
577
- /* @__PURE__ */ o("div", { className: "w6w-field", children: [
605
+ /* @__PURE__ */ l("div", { className: "w6w-field", children: [
578
606
  /* @__PURE__ */ t("span", { children: "Headers" }),
579
607
  /* @__PURE__ */ t(
580
- z,
608
+ ae,
581
609
  {
582
- value: R.text,
583
- onChange: R.onChange,
610
+ value: E.text,
611
+ onChange: E.onChange,
584
612
  minHeight: "80px",
585
613
  "aria-label": "Overrides headers (JSON)"
586
614
  }
587
615
  ),
588
- 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" })
589
617
  ] }),
590
- /* @__PURE__ */ o("label", { className: "w6w-field", children: [
618
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
591
619
  /* @__PURE__ */ t("span", { children: "Target" }),
592
- /* @__PURE__ */ o(
620
+ /* @__PURE__ */ l(
593
621
  "select",
594
622
  {
595
623
  "aria-label": "Overrides target",
596
- value: te,
597
- onChange: (i) => at(i.target.value),
624
+ value: ue,
625
+ onChange: (d) => Nt(d.target.value),
598
626
  children: [
599
627
  /* @__PURE__ */ t("option", { value: "", children: "— default (first) —" }),
600
628
  /* @__PURE__ */ t("option", { value: "first", children: "first" }),
@@ -604,22 +632,22 @@ function Ps({
604
632
  }
605
633
  )
606
634
  ] }),
607
- /* @__PURE__ */ o("label", { className: "w6w-field", children: [
635
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
608
636
  /* @__PURE__ */ t("span", { children: "Match" }),
609
637
  /* @__PURE__ */ t(
610
638
  "input",
611
639
  {
612
640
  type: "text",
613
641
  "aria-label": "Overrides match",
614
- value: se,
642
+ value: we,
615
643
  placeholder: "Restrict to requests whose URL contains…",
616
- onChange: (i) => rt(i.target.value)
644
+ onChange: (d) => vt(d.target.value)
617
645
  }
618
646
  )
619
647
  ] }),
620
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." })
621
649
  ] })
622
- ] }), 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: [
623
651
  /* @__PURE__ */ t(
624
652
  "div",
625
653
  {
@@ -628,35 +656,35 @@ function Ps({
628
656
  children: /* @__PURE__ */ t("span", { className: "w6w-muted w6w-small", children: "Saved tests" })
629
657
  }
630
658
  ),
631
- q && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: q }),
632
- 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(
633
661
  "ul",
634
662
  {
635
663
  className: "w6w-stack",
636
664
  style: { listStyle: "none", margin: 0, padding: 0, gap: "var(--w6w-sp-1-5)" },
637
- children: Je.map((i) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
638
- Ne,
665
+ children: ze.map((d) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
666
+ H,
639
667
  {
640
- title: i.name,
641
- subtitle: i.lastRunAt ? /* @__PURE__ */ o("span", { children: [
668
+ title: d.name,
669
+ subtitle: d.lastRunAt ? /* @__PURE__ */ l("span", { children: [
642
670
  /* @__PURE__ */ t(
643
671
  "span",
644
672
  {
645
- style: { color: i.lastRunOk ? "var(--w6w-success)" : "var(--w6w-danger)" },
646
- children: i.lastRunOk ? "✓" : "✗"
673
+ style: { color: d.lastRunOk ? "var(--w6w-success)" : "var(--w6w-danger)" },
674
+ children: d.lastRunOk ? "✓" : "✗"
647
675
  }
648
676
  ),
649
677
  " ",
650
- i.lastRunSummary ? `${i.lastRunSummary} · ` : "",
651
- de(i.lastRunAt)
652
- ] }) : `saved ${de(i.updatedAt)}`,
653
- active: i.id === x,
654
- 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)
655
683
  }
656
- ) }, i.id))
684
+ ) }, d.id))
657
685
  }
658
686
  ),
659
- m.listTestRuns && De.length > 0 && /* @__PURE__ */ o(k, { children: [
687
+ m.listTestRuns && Ve.length > 0 && /* @__PURE__ */ l(C, { children: [
660
688
  /* @__PURE__ */ t(
661
689
  "div",
662
690
  {
@@ -670,63 +698,63 @@ function Ps({
670
698
  {
671
699
  className: "w6w-stack",
672
700
  style: { listStyle: "none", margin: 0, padding: 0, gap: "var(--w6w-sp-1-5)" },
673
- children: De.map((i) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
674
- Ne,
701
+ children: Ve.map((d) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
702
+ H,
675
703
  {
676
- title: /* @__PURE__ */ o("span", { children: [
677
- /* @__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 ? "✓" : "✗" }),
678
706
  " ",
679
- i.actionKey
707
+ d.actionKey
680
708
  ] }),
681
- subtitle: /* @__PURE__ */ o("span", { children: [
682
- i.summary ? `${i.summary} · ` : "",
683
- de(i.occurredAt)
709
+ subtitle: /* @__PURE__ */ l("span", { children: [
710
+ d.summary ? `${d.summary} · ` : "",
711
+ ye(d.occurredAt)
684
712
  ] })
685
713
  }
686
- ) }, i.id))
714
+ ) }, d.id))
687
715
  }
688
716
  )
689
717
  ] })
690
- ] }) : null, je = (qe = j == null ? void 0 : j.find((i) => i.id === x)) == null ? void 0 : qe.name;
691
- return /* @__PURE__ */ o("div", { className: `w6w-stack${h ? " w6w-tester-embedded-root" : ""}`, children: [
692
- !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." }) : (
693
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.
694
- /* @__PURE__ */ o("label", { className: "w6w-field", children: [
695
- /* @__PURE__ */ o("span", { children: [
722
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
723
+ /* @__PURE__ */ l("span", { children: [
696
724
  "Action",
697
- b ? "" : " *"
725
+ P ? "" : " *"
698
726
  ] }),
699
727
  /* @__PURE__ */ t(
700
- _t,
728
+ qt,
701
729
  {
702
- value: N,
730
+ value: g,
703
731
  placeholder: "— pick an action —",
704
- onChange: ee,
705
- options: p.map((i) => ({
706
- value: i.key,
707
- 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})`
708
736
  }))
709
737
  }
710
738
  )
711
739
  ] })
712
740
  )),
713
- y ? /* @__PURE__ */ o(k, { children: [
714
- /* @__PURE__ */ o("div", { children: [
715
- /* @__PURE__ */ o("strong", { children: [
716
- 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,
717
745
  " ",
718
- /* @__PURE__ */ t("code", { className: "w6w-muted", children: y.key })
746
+ /* @__PURE__ */ t("code", { className: "w6w-muted", children: v.key })
719
747
  ] }),
720
- 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 })
721
749
  ] }),
722
750
  (() => {
723
- const i = /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
724
- Ot,
725
- Rt,
726
- A && /* @__PURE__ */ o("div", { className: "w6w-result w6w-error", children: [
727
- /* @__PURE__ */ t("strong", { children: A.headline }),
728
- A.hint && /* @__PURE__ */ t("div", { style: { marginTop: "var(--w6w-sp-1-5)" }, children: A.hint }),
729
- 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(
730
758
  "div",
731
759
  {
732
760
  className: "w6w-muted w6w-small",
@@ -735,19 +763,19 @@ function Ps({
735
763
  whiteSpace: "pre-wrap",
736
764
  wordBreak: "break-word"
737
765
  },
738
- children: A.detail
766
+ children: T.detail
739
767
  }
740
768
  )
741
769
  ] }),
742
- 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: [
743
771
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: "Result" }),
744
- /* @__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) })
745
773
  ] }),
746
- /* @__PURE__ */ t(Wt, { calls: nt })
747
- ] }), f = /* @__PURE__ */ o(
774
+ /* @__PURE__ */ t(rn, { calls: $ })
775
+ ] }), b = /* @__PURE__ */ l(
748
776
  "div",
749
777
  {
750
- className: `w6w-tester-actions${h || T ? " w6w-tester-actions-footer" : ""}`,
778
+ className: `w6w-tester-actions${h || B ? " w6w-tester-actions-footer" : ""}`,
751
779
  style: { display: "flex", gap: "var(--w6w-sp-2)" },
752
780
  children: [
753
781
  /* @__PURE__ */ t(
@@ -755,42 +783,42 @@ function Ps({
755
783
  {
756
784
  type: "button",
757
785
  className: "w6w-btn",
758
- disabled: Ce || Te,
759
- onClick: ht,
760
- children: Ce ? "Running…" : "Run action"
786
+ disabled: f || Le,
787
+ onClick: At,
788
+ children: f ? "Running…" : "Run action"
761
789
  }
762
790
  ),
763
- n && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: St, children: "Save test" }),
764
- 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(
765
793
  "button",
766
794
  {
767
795
  type: "button",
768
796
  className: "w6w-btn w6w-btn-ghost",
769
797
  style: { marginLeft: "auto", color: "var(--w6w-danger)" },
770
- onClick: () => le(!0),
798
+ onClick: () => fe(!0),
771
799
  children: "Delete"
772
800
  }
773
801
  )
774
802
  ]
775
803
  }
776
- ), g = /* @__PURE__ */ o("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
777
- i,
778
- f
804
+ ), I = /* @__PURE__ */ l("div", { className: "w6w-stack", style: { gap: "var(--w6w-sp-3)" }, children: [
805
+ d,
806
+ b
779
807
  ] });
780
- return h ? /* @__PURE__ */ o("div", { className: "w6w-tester-embedded", children: [
781
- /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-scroll", children: W ? /* @__PURE__ */ o("div", { className: "w6w-tester-embedded-cols", children: [
782
- /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-main", children: i }),
783
- /* @__PURE__ */ t("div", { className: "w6w-tester-embedded-rail", children: W })
784
- ] }) : i }),
785
- f
786
- ] }) : T ? /* @__PURE__ */ t(
787
- 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,
788
816
  {
789
- title: `Edit params — ${y.title ?? y.key}`,
790
- onClose: () => Me(!1),
817
+ title: `Edit params — ${v.title ?? v.key}`,
818
+ onClose: () => Be(!1),
791
819
  size: "full",
792
- children: /* @__PURE__ */ o("div", { className: "w6w-tester-popout", children: [
793
- /* @__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(
794
822
  "div",
795
823
  {
796
824
  style: {
@@ -799,39 +827,39 @@ function Ps({
799
827
  alignItems: "flex-start"
800
828
  },
801
829
  children: [
802
- /* @__PURE__ */ t("div", { style: { flex: 1, minWidth: 0 }, children: i }),
803
- /* @__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 })
804
832
  ]
805
833
  }
806
- ) : i }),
807
- f
834
+ ) : d }),
835
+ b
808
836
  ] })
809
837
  }
810
- ) : g;
838
+ ) : I;
811
839
  })(),
812
- 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(
813
841
  "form",
814
842
  {
815
843
  className: "w6w-stack",
816
844
  style: { gap: "var(--w6w-sp-3)" },
817
- onSubmit: (i) => {
818
- i.preventDefault(), He();
845
+ onSubmit: (d) => {
846
+ d.preventDefault(), Ye();
819
847
  },
820
848
  children: [
821
- /* @__PURE__ */ o("label", { className: "w6w-field", children: [
849
+ /* @__PURE__ */ l("label", { className: "w6w-field", children: [
822
850
  /* @__PURE__ */ t("span", { children: "Name this saved test" }),
823
851
  /* @__PURE__ */ t(
824
852
  "input",
825
853
  {
826
854
  type: "text",
827
- value: ae,
855
+ value: he,
828
856
  placeholder: "e.g. valid sender",
829
- onChange: (i) => re(i.target.value)
857
+ onChange: (d) => pe(d.target.value)
830
858
  }
831
859
  )
832
860
  ] }),
833
- q && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: q }),
834
- /* @__PURE__ */ o(
861
+ X && /* @__PURE__ */ t("span", { className: "w6w-hint", style: { color: "var(--w6w-danger)" }, children: X }),
862
+ /* @__PURE__ */ l(
835
863
  "div",
836
864
  {
837
865
  style: { display: "flex", gap: "var(--w6w-sp-2)", justifyContent: "flex-end" },
@@ -841,37 +869,37 @@ function Ps({
841
869
  {
842
870
  type: "button",
843
871
  className: "w6w-btn w6w-btn-ghost",
844
- onClick: () => K(!1),
872
+ onClick: () => ee(!1),
845
873
  children: "Cancel"
846
874
  }
847
875
  ),
848
- /* @__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" })
849
877
  ]
850
878
  }
851
879
  )
852
880
  ]
853
881
  }
854
882
  ) }),
855
- yt && /* @__PURE__ */ t(
856
- Pt,
883
+ Mt && /* @__PURE__ */ t(
884
+ Ht,
857
885
  {
858
886
  title: "Delete saved test",
859
- 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.",
860
888
  confirmLabel: "Delete",
861
889
  onConfirm: () => {
862
- le(!1), Ct();
890
+ fe(!1), Bt();
863
891
  },
864
- onClose: () => le(!1)
892
+ onClose: () => fe(!1)
865
893
  }
866
894
  )
867
- ] }) : !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." })
868
896
  ] });
869
897
  }
870
- function Is(e) {
871
- 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(
872
900
  () => [
873
- Lt(),
874
- Bt.theme({
901
+ Zt(),
902
+ Xt.theme({
875
903
  "&": {
876
904
  fontSize: "13px",
877
905
  fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
@@ -892,20 +920,20 @@ function Is(e) {
892
920
  ],
893
921
  []
894
922
  );
895
- function a(r) {
896
- e.onChange(r);
923
+ function r(s) {
924
+ e.onChange(s);
897
925
  }
898
- 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: [
899
927
  /* @__PURE__ */ t(
900
- Jt,
928
+ en,
901
929
  {
902
930
  value: e.value,
903
- onChange: a,
904
- extensions: d,
931
+ onChange: r,
932
+ extensions: c,
905
933
  placeholder: e.placeholder,
906
934
  readOnly: e.readOnly,
907
935
  editable: !e.readOnly,
908
- theme: s,
936
+ theme: n,
909
937
  height: e.height,
910
938
  minHeight: e.minHeight ?? "240px",
911
939
  maxHeight: e.maxHeight,
@@ -919,128 +947,128 @@ function Is(e) {
919
947
  }
920
948
  }
921
949
  ),
922
- e.copyable && /* @__PURE__ */ o(k, { children: [
950
+ e.copyable && /* @__PURE__ */ l(C, { children: [
923
951
  /* @__PURE__ */ t(
924
952
  "button",
925
953
  {
926
954
  type: "button",
927
- className: `w6w-icon-btn w6w-copyable-btn${n ? " is-copied" : ""}`,
955
+ className: `w6w-icon-btn w6w-copyable-btn${a ? " is-copied" : ""}`,
928
956
  "aria-label": "Copy",
929
- onClick: () => void l(),
930
- children: n ? /* @__PURE__ */ t(Ht, {}) : /* @__PURE__ */ t(jt, {})
957
+ onClick: () => void i(),
958
+ children: a ? /* @__PURE__ */ t(nn, {}) : /* @__PURE__ */ t(an, {})
931
959
  }
932
960
  ),
933
- /* @__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" : "" })
934
962
  ] })
935
963
  ] });
936
964
  }
937
- const we = "…";
938
- function Qt(e, s, n = "end") {
939
- if (s === void 0 || s < 1 || s >= e.length) return e;
940
- if (n === "start")
941
- return `${we}${e.slice(e.length - s)}`;
942
- if (n === "end")
943
- return `${e.slice(0, s)}${we}`;
944
- const l = Math.ceil(s / 2), d = s - l;
945
- return `${e.slice(0, l)}${we}${e.slice(e.length - d)}`;
946
- }
947
- function Us(e) {
948
- 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(" ");
949
- return /* @__PURE__ */ t(qt, { value: s, readOnly: !0, label: d, className: u, copiedMs: r, children: /* @__PURE__ */ t("span", { children: c }) });
950
- }
951
- 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 = {
952
980
  ok: "Operational",
953
981
  degraded: "Degraded",
954
982
  down: "Down",
955
983
  unknown: "Unknown"
956
984
  };
957
- function Fs({ state: e, label: s, ariaLabel: n }) {
958
- const l = s ?? Yt[e];
959
- 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: [
960
988
  /* @__PURE__ */ t("span", { className: "w6w-health-pill-dot", "aria-hidden": "true" }),
961
- /* @__PURE__ */ t("span", { className: "w6w-health-pill-label", children: l })
989
+ /* @__PURE__ */ t("span", { className: "w6w-health-pill-label", children: i })
962
990
  ] });
963
991
  }
964
- const Zt = {
992
+ const hn = {
965
993
  ok: "Operational",
966
994
  degraded: "Degraded",
967
995
  down: "Down",
968
996
  unknown: "Unknown"
969
997
  };
970
- function Ls({ days: e, ariaLabel: s }) {
998
+ function pn({ days: e, ariaLabel: n }) {
971
999
  return e.length === 0 ? null : /* @__PURE__ */ t(
972
1000
  "div",
973
1001
  {
974
1002
  className: "w6w-uptime-strip",
975
1003
  role: "img",
976
- "aria-label": s ?? `${e.length}-day status`,
977
- children: e.map((n, l) => /* @__PURE__ */ t(
1004
+ "aria-label": n ?? `${e.length}-day status`,
1005
+ children: e.map((a, i) => /* @__PURE__ */ t(
978
1006
  "span",
979
1007
  {
980
- className: `w6w-uptime-cell w6w-uptime-cell-${n.state}`,
981
- 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]}`
982
1010
  },
983
- `${n.day}-${l}`
1011
+ `${a.day}-${i}`
984
1012
  ))
985
1013
  }
986
1014
  );
987
1015
  }
988
- const st = "—", Ye = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
989
- function Xt(e) {
990
- 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;
991
1019
  if (e < 1024) return `${Math.round(e)} B`;
992
- let s = e, n = 0;
993
- for (; s >= 1024 && n < Ye.length - 1; )
994
- s /= 1024, n += 1;
995
- 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]}`;
996
1024
  }
997
- function $(e) {
998
- 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)}%`;
999
1027
  }
1000
- function B(e) {
1028
+ function V(e) {
1001
1029
  if (e === void 0 || e.load1 === null) return null;
1002
- const s = e.cpuLimit ?? e.cpus;
1003
- 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;
1004
1032
  }
1005
- function J(e) {
1033
+ function Y(e) {
1006
1034
  if (e === void 0) return null;
1007
- const { memoryTotal: s, memoryAvailable: n } = e;
1008
- return s === null || n === null || s <= 0 ? null : (s - n) / s;
1009
- }
1010
- function es(e, s, n) {
1011
- return e < s ? s : e > n ? n : e;
1012
- }
1013
- function ts(e, s, n, l) {
1014
- const d = e.length;
1015
- if (d < 2) return "";
1016
- const a = [];
1017
- for (let r = 0; r < d; r++) {
1018
- const c = e[r];
1019
- if (c === null) continue;
1020
- const u = r / (d - 1) * s, w = l <= 0 ? n : n - es(c, 0, l) / l * n;
1021
- 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))}`);
1022
1050
  }
1023
- return a.join(" ");
1051
+ return r.join(" ");
1024
1052
  }
1025
- const ss = "—", Ze = 100, Xe = 24;
1026
- function ge({
1053
+ const yn = "—", st = 100, lt = 24;
1054
+ function Re({
1027
1055
  values: e,
1028
- max: s,
1029
- className: n
1056
+ max: n,
1057
+ className: a
1030
1058
  }) {
1031
- const l = ts(e, Ze, Xe, s);
1032
- return l === "" ? null : /* @__PURE__ */ t(
1059
+ const i = vn(e, st, lt, n);
1060
+ return i === "" ? null : /* @__PURE__ */ t(
1033
1061
  "svg",
1034
1062
  {
1035
- className: n,
1036
- viewBox: `0 0 ${Ze} ${Xe}`,
1063
+ className: a,
1064
+ viewBox: `0 0 ${st} ${lt}`,
1037
1065
  preserveAspectRatio: "none",
1038
1066
  "aria-hidden": "true",
1039
1067
  focusable: "false",
1040
1068
  children: /* @__PURE__ */ t(
1041
1069
  "polyline",
1042
1070
  {
1043
- points: l,
1071
+ points: i,
1044
1072
  fill: "none",
1045
1073
  stroke: "var(--w6w-accent)",
1046
1074
  strokeWidth: 2,
@@ -1050,172 +1078,172 @@ function ge({
1050
1078
  }
1051
1079
  );
1052
1080
  }
1053
- function me(e) {
1054
- return e === null ? ss : e.toFixed(2);
1081
+ function ke(e) {
1082
+ return e === null ? yn : e.toFixed(2);
1055
1083
  }
1056
- function Z(e) {
1057
- let s = 1;
1058
- for (const n of e) n !== null && n > s && (s = n);
1059
- 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;
1060
1088
  }
1061
- function Q({
1089
+ function ie({
1062
1090
  label: e,
1063
- value: s,
1064
- values: n,
1065
- max: l
1091
+ value: n,
1092
+ values: a,
1093
+ max: i
1066
1094
  }) {
1067
- return /* @__PURE__ */ o("li", { className: "w6w-server-resources__row", children: [
1095
+ return /* @__PURE__ */ l("li", { className: "w6w-server-resources__row", children: [
1068
1096
  /* @__PURE__ */ t("span", { className: "w6w-server-resources__label", children: e }),
1069
- /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: s }),
1070
- /* @__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 })
1071
1099
  ] });
1072
1100
  }
1073
- function xe(e) {
1074
- const s = e[e.length - 1], n = e.map((a) => B(a)), l = e.map((a) => J(a)), d = e.map((a) => a.processRss);
1075
- 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 };
1076
1104
  }
1077
- function Bs({
1105
+ function da({
1078
1106
  samples: e,
1079
- title: s = "Server resources",
1080
- intervalMs: n
1107
+ title: n = "Server resources",
1108
+ intervalMs: a
1081
1109
  }) {
1082
- const { last: l, cpuValues: d, memoryValues: a, rssValues: r } = xe(e);
1083
- return /* @__PURE__ */ o("section", { className: "w6w-server-resources w6w-server-resources--card", "aria-label": s, children: [
1084
- /* @__PURE__ */ t("h3", { className: "w6w-server-resources__title", children: s }),
1085
- /* @__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: [
1086
1114
  /* @__PURE__ */ t(
1087
- Q,
1115
+ ie,
1088
1116
  {
1089
1117
  label: "CPU",
1090
- value: $(B(l)),
1091
- values: d,
1092
- max: Z(d)
1118
+ value: D(V(i)),
1119
+ values: c,
1120
+ max: oe(c)
1093
1121
  }
1094
1122
  ),
1095
1123
  /* @__PURE__ */ t(
1096
- Q,
1124
+ ie,
1097
1125
  {
1098
1126
  label: "Memory",
1099
- value: $(J(l)),
1100
- values: a,
1127
+ value: D(Y(i)),
1128
+ values: r,
1101
1129
  max: 1
1102
1130
  }
1103
1131
  ),
1104
1132
  /* @__PURE__ */ t(
1105
- Q,
1133
+ ie,
1106
1134
  {
1107
1135
  label: "Process",
1108
- value: Xt((l == null ? void 0 : l.processRss) ?? null),
1109
- values: r,
1110
- max: Z(r)
1136
+ value: fn((i == null ? void 0 : i.processRss) ?? null),
1137
+ values: s,
1138
+ max: oe(s)
1111
1139
  }
1112
1140
  )
1113
1141
  ] }),
1114
- /* @__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(
1115
- (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
1116
1144
  )}` }),
1117
- 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` })
1118
1146
  ] });
1119
1147
  }
1120
- function Js({ samples: e, title: s = "Server" }) {
1121
- const { last: n, cpuValues: l } = xe(e);
1122
- return /* @__PURE__ */ o("section", { className: "w6w-server-resources w6w-server-resources--small", "aria-label": s, children: [
1123
- /* @__PURE__ */ t("h3", { className: "w6w-server-resources__title", children: s }),
1124
- /* @__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: [
1125
1153
  /* @__PURE__ */ t(
1126
- Q,
1154
+ ie,
1127
1155
  {
1128
1156
  label: "CPU",
1129
- value: $(B(n)),
1130
- values: l,
1131
- max: Z(l)
1157
+ value: D(V(a)),
1158
+ values: i,
1159
+ max: oe(i)
1132
1160
  }
1133
1161
  ),
1134
- /* @__PURE__ */ o("li", { className: "w6w-server-resources__row", children: [
1162
+ /* @__PURE__ */ l("li", { className: "w6w-server-resources__row", children: [
1135
1163
  /* @__PURE__ */ t("span", { className: "w6w-server-resources__label", children: "Memory" }),
1136
- /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: $(J(n)) })
1164
+ /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: D(Y(a)) })
1137
1165
  ] })
1138
1166
  ] })
1139
1167
  ] });
1140
1168
  }
1141
- function Ds({ samples: e, onExpand: s }) {
1142
- const { last: n, cpuValues: l, memoryValues: d } = xe(e);
1143
- return /* @__PURE__ */ o("aside", { className: "w6w-server-resources w6w-server-resources--rail", children: [
1144
- /* @__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: [
1145
1173
  /* @__PURE__ */ t("span", { className: "w6w-server-resources__label", children: "CPU" }),
1146
- /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: $(B(n)) }),
1174
+ /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: D(V(a)) }),
1147
1175
  /* @__PURE__ */ t(
1148
- ge,
1176
+ Re,
1149
1177
  {
1150
1178
  className: "w6w-server-resources__spark",
1151
- values: l,
1152
- max: Z(l)
1179
+ values: i,
1180
+ max: oe(i)
1153
1181
  }
1154
1182
  )
1155
1183
  ] }),
1156
- /* @__PURE__ */ o("div", { className: "w6w-server-resources__rail-row", children: [
1184
+ /* @__PURE__ */ l("div", { className: "w6w-server-resources__rail-row", children: [
1157
1185
  /* @__PURE__ */ t("span", { className: "w6w-server-resources__label", children: "MEM" }),
1158
- /* @__PURE__ */ t("span", { className: "w6w-server-resources__value", children: $(J(n)) }),
1159
- /* @__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 })
1160
1188
  ] }),
1161
- s !== void 0 && /* @__PURE__ */ t(
1189
+ n !== void 0 && /* @__PURE__ */ t(
1162
1190
  "button",
1163
1191
  {
1164
1192
  type: "button",
1165
1193
  className: "w6w-server-resources__expand",
1166
1194
  "aria-label": "Show server resources",
1167
- onClick: s,
1195
+ onClick: n,
1168
1196
  children: "Details"
1169
1197
  }
1170
1198
  )
1171
1199
  ] });
1172
1200
  }
1173
- function Hs({ samples: e }) {
1174
- const s = e[e.length - 1], n = $(B(s)), l = $(J(s));
1175
- 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}` });
1176
1204
  }
1177
- const ns = 1, as = 1440 * 60 * 1e3;
1178
- function rs(e, s, n) {
1179
- const l = s.startedAt ?? s.updatedAt;
1180
- if (l === void 0) return null;
1181
- 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;
1182
- if (a < r || d >= c) return null;
1183
- 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);
1184
- 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 };
1185
1213
  }
1186
- const ls = {
1214
+ const xn = {
1187
1215
  ok: "Operational",
1188
1216
  degraded: "Degraded",
1189
1217
  down: "Down",
1190
1218
  unknown: "Unknown"
1191
- }, is = "This vendor publishes no incident history.", os = "No incidents in this window.";
1192
- function cs(e) {
1193
- const s = e.startedAt ?? e.updatedAt, n = [e.title];
1194
- return e.components !== void 0 && e.components.length > 0 && n.push(`(${e.components.join(", ")})`), s !== void 0 && n.push(
1195
- e.resolvedAt !== void 0 ? `${s} – ${e.resolvedAt}` : `${s} – ongoing`
1196
- ), n.join(" ");
1197
- }
1198
- 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({
1199
1227
  window: e,
1200
- days: s,
1201
- incidents: n,
1202
- vendorEmptyLabel: l,
1203
- nowMs: d = Date.now(),
1204
- ariaLabel: a
1228
+ days: n,
1229
+ incidents: a,
1230
+ vendorEmptyLabel: i,
1231
+ nowMs: c = Date.now(),
1232
+ ariaLabel: r
1205
1233
  }) {
1206
- const r = s.length, c = r > 0 ? 100 / r : 0, u = n === void 0 ? l ?? is : n.length === 0 ? l ?? os : null;
1207
- 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: [
1208
- /* @__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(
1209
1237
  "span",
1210
1238
  {
1211
1239
  className: `w6w-history-cell w6w-history-cell-${w.state}`,
1212
- style: { left: `${h * c}%`, width: `${c}%` },
1213
- title: w.label ?? `${w.day} — ${ls[w.state]}`
1240
+ style: { left: `${h * o}%`, width: `${o}%` },
1241
+ title: w.label ?? `${w.day} — ${xn[w.state]}`
1214
1242
  },
1215
1243
  `${w.day}-${h}`
1216
1244
  )) }),
1217
- /* @__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) => {
1218
- 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);
1219
1247
  if (m === null) return null;
1220
1248
  const p = [
1221
1249
  m.clippedStart ? "w6w-history-bar-clip-start" : "",
@@ -1226,103 +1254,103 @@ function js({
1226
1254
  {
1227
1255
  className: `w6w-history-bar w6w-history-bar-${w.state}${p ? ` ${p}` : ""}`,
1228
1256
  style: { left: `${m.leftPct}%`, width: `${m.widthPct}%` },
1229
- title: cs(w)
1257
+ title: $n(w)
1230
1258
  },
1231
1259
  w.id ?? `${w.title}-${h}`
1232
1260
  );
1233
1261
  }) }),
1234
- /* @__PURE__ */ o("div", { className: "w6w-history-axis", children: [
1262
+ /* @__PURE__ */ l("div", { className: "w6w-history-axis", children: [
1235
1263
  /* @__PURE__ */ t("span", { className: "w6w-history-tick w6w-history-tick-start", style: { left: "0%" }, children: e.from }),
1236
1264
  /* @__PURE__ */ t("span", { className: "w6w-history-tick w6w-history-tick-end", style: { left: "100%" }, children: e.to })
1237
1265
  ] })
1238
1266
  ] }) });
1239
1267
  }
1240
- function qs({ label: e, children: s, className: n }) {
1241
- const [l, d] = v(!1), a = Ut();
1242
- 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: [
1243
1271
  /* @__PURE__ */ t(
1244
- L,
1272
+ z,
1245
1273
  {
1246
1274
  label: e,
1247
1275
  icon: "info",
1248
- "aria-expanded": l,
1249
- "aria-controls": a,
1250
- onClick: () => d((r) => !r)
1276
+ "aria-expanded": i,
1277
+ "aria-controls": r,
1278
+ onClick: () => c((s) => !s)
1251
1279
  }
1252
1280
  ),
1253
- 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 })
1254
1282
  ] });
1255
1283
  }
1256
- function Ks(e) {
1257
- 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;
1258
1286
  return /* @__PURE__ */ t(
1259
- L,
1287
+ z,
1260
1288
  {
1261
- label: s,
1262
- onClick: n,
1263
- disabled: l,
1264
- className: d,
1289
+ label: n,
1290
+ onClick: a,
1291
+ disabled: i,
1292
+ className: c,
1265
1293
  icon: "edit",
1266
- "data-testid": a["data-testid"]
1294
+ "data-testid": r["data-testid"]
1267
1295
  }
1268
1296
  );
1269
1297
  }
1270
- function Ws(e) {
1271
- 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;
1272
1300
  return /* @__PURE__ */ t(
1273
- L,
1301
+ z,
1274
1302
  {
1275
- label: s,
1276
- onClick: n,
1277
- disabled: l,
1278
- className: d,
1303
+ label: n,
1304
+ onClick: a,
1305
+ disabled: i,
1306
+ className: c,
1279
1307
  danger: !0,
1280
1308
  icon: "delete",
1281
- "data-testid": a["data-testid"]
1309
+ "data-testid": r["data-testid"]
1282
1310
  }
1283
1311
  );
1284
1312
  }
1285
- function Vs(e) {
1286
- const { branch: s, shortSha: n, lastSyncLabel: l, onSyncNow: d, syncing: a, className: r, ...c } = e, [u, w] = v(!1), h = Ft(null);
1287
- 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(() => {
1288
1316
  if (!u) return;
1289
- const m = (N) => {
1290
- h.current && !h.current.contains(N.target) && w(!1);
1291
- }, 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);
1292
1320
  return document.addEventListener("mousedown", m), document.addEventListener("keydown", p), () => {
1293
1321
  document.removeEventListener("mousedown", m), document.removeEventListener("keydown", p);
1294
1322
  };
1295
- }, [u]), /* @__PURE__ */ o(
1323
+ }, [u]), /* @__PURE__ */ l(
1296
1324
  "div",
1297
1325
  {
1298
- className: `w6w-repo-sync${r ? ` ${r}` : ""}`,
1326
+ className: `w6w-repo-sync${s ? ` ${s}` : ""}`,
1299
1327
  ref: h,
1300
- "data-testid": c["data-testid"],
1328
+ "data-testid": o["data-testid"],
1301
1329
  children: [
1302
- /* @__PURE__ */ o(
1330
+ /* @__PURE__ */ l(
1303
1331
  "button",
1304
1332
  {
1305
1333
  type: "button",
1306
1334
  className: "w6w-repo-sync-trigger",
1307
1335
  "aria-haspopup": "menu",
1308
1336
  "aria-expanded": u,
1309
- "aria-busy": a,
1337
+ "aria-busy": r,
1310
1338
  onClick: () => w((m) => !m),
1311
1339
  children: [
1312
- /* @__PURE__ */ o("span", { className: "w6w-repo-sync-icon", children: [
1313
- /* @__PURE__ */ t(ze, { name: "github" }),
1314
- 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" })
1315
1343
  ] }),
1316
- /* @__PURE__ */ t("span", { className: "w6w-repo-sync-branch", children: s }),
1317
- 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 })
1318
1346
  ]
1319
1347
  }
1320
1348
  ),
1321
- u && /* @__PURE__ */ o("div", { className: "w6w-repo-sync-menu", role: "menu", children: [
1322
- /* @__PURE__ */ o("div", { className: "w6w-repo-sync-detail", children: [
1323
- /* @__PURE__ */ t("span", { children: s }),
1324
- n != null && /* @__PURE__ */ t("code", { children: n }),
1325
- 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 })
1326
1354
  ] }),
1327
1355
  /* @__PURE__ */ t(
1328
1356
  "button",
@@ -1331,9 +1359,9 @@ function Vs(e) {
1331
1359
  role: "menuitem",
1332
1360
  className: "w6w-repo-sync-item",
1333
1361
  "data-testid": "repo-sync-now",
1334
- disabled: a,
1335
- onClick: d,
1336
- children: a ? "Syncing…" : "Sync now"
1362
+ disabled: r,
1363
+ onClick: c,
1364
+ children: r ? "Syncing…" : "Sync now"
1337
1365
  }
1338
1366
  )
1339
1367
  ] })
@@ -1341,7 +1369,7 @@ function Vs(e) {
1341
1369
  }
1342
1370
  );
1343
1371
  }
1344
- const ds = {
1372
+ const Rn = {
1345
1373
  pending: "Pending",
1346
1374
  running: "Running",
1347
1375
  succeeded: "Succeeded",
@@ -1350,46 +1378,46 @@ const ds = {
1350
1378
  queued: "Queued",
1351
1379
  canceled: "Canceled"
1352
1380
  };
1353
- function Se({ state: e, label: s, ariaLabel: n }) {
1354
- const l = s ?? ds[e];
1355
- 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: [
1356
1384
  /* @__PURE__ */ t("span", { className: "w6w-step-pill-dot", "aria-hidden": "true" }),
1357
- /* @__PURE__ */ t("span", { className: "w6w-step-pill-label", children: l })
1385
+ /* @__PURE__ */ t("span", { className: "w6w-step-pill-label", children: i })
1358
1386
  ] });
1359
1387
  }
1360
- const us = "—", he = 1e3, pe = 6e4;
1361
- function $e(e) {
1362
- 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`;
1363
1391
  }
1364
- function X(e) {
1365
- const s = new Date(e);
1366
- 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" });
1367
1395
  }
1368
- const ws = {
1396
+ const Mn = {
1369
1397
  function: "Function",
1370
1398
  endpoint: "Endpoint",
1371
1399
  workflow: "Workflow"
1372
1400
  };
1373
- function zs({
1401
+ function Na({
1374
1402
  items: e,
1375
- selectedId: s = null,
1376
- onSelect: n,
1377
- showCallable: l = !1,
1378
- loading: d = !1,
1379
- emptyLabel: a,
1380
- hasPrev: r,
1381
- 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,
1382
1410
  onPrev: u,
1383
1411
  onNext: w
1384
1412
  }) {
1385
- 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: [
1386
1414
  /* @__PURE__ */ t(
1387
1415
  "button",
1388
1416
  {
1389
1417
  type: "button",
1390
1418
  className: "w6w-btn w6w-btn-ghost",
1391
1419
  "data-testid": "execution-list-prev",
1392
- disabled: !r,
1420
+ disabled: !s,
1393
1421
  onClick: u,
1394
1422
  children: "Previous"
1395
1423
  }
@@ -1400,39 +1428,39 @@ function zs({
1400
1428
  type: "button",
1401
1429
  className: "w6w-btn w6w-btn-ghost",
1402
1430
  "data-testid": "execution-list-next",
1403
- disabled: !c,
1431
+ disabled: !o,
1404
1432
  onClick: w,
1405
1433
  children: "Next"
1406
1434
  }
1407
1435
  )
1408
1436
  ] }) : null;
1409
1437
  let m;
1410
- 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(
1411
- 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,
1412
1440
  {
1413
- icon: /* @__PURE__ */ t(Se, { state: p.status }),
1414
- title: l ? p.callableName : X(p.startedAt),
1415
- subtitle: l ? `${ws[p.kind]} · ${X(p.startedAt)}` : p.id,
1416
- trailing: $e(p.durationMs),
1417
- active: p.id === s,
1418
- 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
1419
1447
  }
1420
- ) }, 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: [
1421
1449
  m,
1422
1450
  h
1423
1451
  ] });
1424
1452
  }
1425
- function ms({
1453
+ function In({
1426
1454
  steps: e,
1427
- emptyLabel: s,
1428
- onDismiss: n,
1429
- runError: l,
1430
- stepErrors: d
1455
+ emptyLabel: n,
1456
+ onDismiss: a,
1457
+ runError: i,
1458
+ stepErrors: c
1431
1459
  }) {
1432
- 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: [
1433
- l && /* @__PURE__ */ t(be, { error: l }),
1434
- r.map((u, w) => /* @__PURE__ */ t(
1435
- 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,
1436
1464
  {
1437
1465
  label: u.label ?? u.stepId,
1438
1466
  error: u.error
@@ -1440,104 +1468,104 @@ function ms({
1440
1468
  `${u.stepId}:${w}`
1441
1469
  ))
1442
1470
  ] }) : null;
1443
- return e.length === 0 ? /* @__PURE__ */ o(k, { children: [
1444
- a,
1445
- c,
1446
- /* @__PURE__ */ t("div", { className: "w6w-execution-log-empty", children: /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: s ?? "No steps have run yet." }) })
1447
- ] }) : /* @__PURE__ */ o(k, { children: [
1448
- a,
1449
- c,
1450
- /* @__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)) })
1451
1479
  ] });
1452
1480
  }
1453
- function hs({ step: e }) {
1454
- const [s, n] = v(!1), l = /* @__PURE__ */ o("div", { className: "w6w-execution-log-row-header", children: [
1455
- /* @__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 }),
1456
1484
  /* @__PURE__ */ t("span", { className: "w6w-execution-log-row-label", children: e.label ?? e.id }),
1457
- /* @__PURE__ */ t(ps, { startedAt: e.startedAt, finishedAt: e.finishedAt })
1458
- ] }), d = e.error ? /* @__PURE__ */ t(be, { error: e.error }) : null;
1459
- return e.input === void 0 && e.output === void 0 && !e.meta ? /* @__PURE__ */ o("li", { className: "w6w-execution-log-row", children: [
1460
- /* @__PURE__ */ t("div", { className: "w6w-section", children: l }),
1461
- d
1462
- ] }) : /* @__PURE__ */ o("li", { className: "w6w-execution-log-row", children: [
1463
- /* @__PURE__ */ o("details", { className: "w6w-section", open: s, onToggle: (a) => n(a.currentTarget.open), children: [
1464
- /* @__PURE__ */ t("summary", { className: "w6w-section-summary", children: l }),
1465
- s && /* @__PURE__ */ o("div", { className: "w6w-execution-log-row-body w6w-section-body w6w-stack", children: [
1466
- /* @__PURE__ */ t(et, { title: "Input", value: e.input }),
1467
- /* @__PURE__ */ t(et, { title: "Output", value: e.output }),
1468
- 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: [
1469
1497
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: "Metadata" }),
1470
- /* @__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" })
1471
1499
  ] })
1472
1500
  ] })
1473
1501
  ] }),
1474
- d
1502
+ c
1475
1503
  ] });
1476
1504
  }
1477
- function be({ error: e, label: s }) {
1478
- return /* @__PURE__ */ o("div", { className: "w6w-result w6w-error", children: [
1479
- 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 }),
1480
1508
  e.code && /* @__PURE__ */ t("div", { className: "w6w-small w6w-execution-log-error-code", children: /* @__PURE__ */ t("code", { children: e.code }) }),
1481
1509
  e.message
1482
1510
  ] });
1483
1511
  }
1484
- function ps({ startedAt: e, finishedAt: s }) {
1485
- if (e && s) {
1486
- const n = fs(e, s);
1487
- 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: [
1488
1516
  e,
1489
1517
  " → ",
1490
- s,
1491
- n && /* @__PURE__ */ o("span", { children: [
1518
+ n,
1519
+ a && /* @__PURE__ */ l("span", { children: [
1492
1520
  " (",
1493
- n,
1521
+ a,
1494
1522
  ")"
1495
1523
  ] })
1496
1524
  ] });
1497
1525
  }
1498
- return e ? /* @__PURE__ */ o("span", { className: "w6w-execution-log-timing", children: [
1526
+ return e ? /* @__PURE__ */ l("span", { className: "w6w-execution-log-timing", children: [
1499
1527
  "Started ",
1500
1528
  e
1501
1529
  ] }) : /* @__PURE__ */ t("span", { className: "w6w-execution-log-timing", children: "—" });
1502
1530
  }
1503
- function fs(e, s) {
1504
- const n = Date.parse(e), l = Date.parse(s);
1505
- if (!Number.isFinite(n) || !Number.isFinite(l) || l < n) return null;
1506
- const d = l - n;
1507
- if (d < 1e3) return `${d}ms`;
1508
- const a = d / 1e3;
1509
- if (a < 60) return `${a.toFixed(1)}s`;
1510
- const r = Math.floor(a / 60), c = Math.round(a % 60);
1511
- return `${r}m ${c}s`;
1512
- }
1513
- function et({ title: e, value: s }) {
1514
- 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: [
1515
1543
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: e }),
1516
- 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" })
1517
1545
  ] });
1518
1546
  }
1519
- const vs = { status: "", kind: "", from: "", to: "", q: "" }, ys = [
1547
+ const Ln = { status: "", kind: "", from: "", to: "", q: "" }, Un = [
1520
1548
  { value: "", label: "Any status" },
1521
1549
  { value: "queued", label: "Queued" },
1522
1550
  { value: "running", label: "Running" },
1523
1551
  { value: "succeeded", label: "Succeeded" },
1524
1552
  { value: "failed", label: "Failed" },
1525
1553
  { value: "canceled", label: "Canceled" }
1526
- ], Ns = [
1554
+ ], Dn = [
1527
1555
  { value: "", label: "Any type" },
1528
1556
  { value: "function", label: "Function" },
1529
1557
  { value: "endpoint", label: "Endpoint" },
1530
1558
  { value: "workflow", label: "Workflow" }
1531
1559
  ];
1532
- function Gs({
1560
+ function va({
1533
1561
  value: e,
1534
- onChange: s,
1535
- showKind: n = !1,
1536
- searchPlaceholder: l = "Search by id or name",
1537
- disabled: d = !1
1562
+ onChange: n,
1563
+ showKind: a = !1,
1564
+ searchPlaceholder: i = "Search by id or name",
1565
+ disabled: c = !1
1538
1566
  }) {
1539
- const a = e.status !== "" || e.kind !== "" || e.from !== "" || e.to !== "" || e.q !== "";
1540
- 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: [
1541
1569
  /* @__PURE__ */ t(
1542
1570
  "input",
1543
1571
  {
@@ -1545,10 +1573,10 @@ function Gs({
1545
1573
  className: "w6w-execution-filters-search",
1546
1574
  "data-testid": "execution-filter-q",
1547
1575
  "aria-label": "Search executions",
1548
- placeholder: l,
1576
+ placeholder: i,
1549
1577
  value: e.q,
1550
- disabled: d,
1551
- onChange: (r) => s({ ...e, q: r.target.value })
1578
+ disabled: c,
1579
+ onChange: (s) => n({ ...e, q: s.target.value })
1552
1580
  }
1553
1581
  ),
1554
1582
  /* @__PURE__ */ t(
@@ -1558,21 +1586,21 @@ function Gs({
1558
1586
  "data-testid": "execution-filter-status",
1559
1587
  "aria-label": "Status",
1560
1588
  value: e.status,
1561
- disabled: d,
1562
- onChange: (r) => s({ ...e, status: r.target.value }),
1563
- 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))
1564
1592
  }
1565
1593
  ),
1566
- n && /* @__PURE__ */ t(
1594
+ a && /* @__PURE__ */ t(
1567
1595
  "select",
1568
1596
  {
1569
1597
  className: "w6w-execution-filters-select",
1570
1598
  "data-testid": "execution-filter-kind",
1571
1599
  "aria-label": "Type",
1572
1600
  value: e.kind,
1573
- disabled: d,
1574
- onChange: (r) => s({ ...e, kind: r.target.value }),
1575
- 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))
1576
1604
  }
1577
1605
  ),
1578
1606
  /* @__PURE__ */ t(
@@ -1583,8 +1611,8 @@ function Gs({
1583
1611
  "data-testid": "execution-filter-from",
1584
1612
  "aria-label": "From date",
1585
1613
  value: e.from,
1586
- disabled: d,
1587
- onChange: (r) => s({ ...e, from: r.target.value })
1614
+ disabled: c,
1615
+ onChange: (s) => n({ ...e, from: s.target.value })
1588
1616
  }
1589
1617
  ),
1590
1618
  /* @__PURE__ */ t(
@@ -1595,217 +1623,999 @@ function Gs({
1595
1623
  "data-testid": "execution-filter-to",
1596
1624
  "aria-label": "To date",
1597
1625
  value: e.to,
1598
- disabled: d,
1599
- onChange: (r) => s({ ...e, to: r.target.value })
1626
+ disabled: c,
1627
+ onChange: (s) => n({ ...e, to: s.target.value })
1600
1628
  }
1601
1629
  ),
1602
- a && /* @__PURE__ */ t(
1630
+ r && /* @__PURE__ */ t(
1603
1631
  "button",
1604
1632
  {
1605
1633
  type: "button",
1606
1634
  className: "w6w-btn w6w-btn-ghost w6w-execution-filters-clear",
1607
1635
  "data-testid": "execution-filter-clear",
1608
- disabled: d,
1609
- onClick: () => s({ ...vs }),
1636
+ disabled: c,
1637
+ onClick: () => n({ ...Ln }),
1610
1638
  children: "Clear"
1611
1639
  }
1612
1640
  )
1613
1641
  ] });
1614
1642
  }
1615
- const Y = "—";
1616
- function Qs({ stats: e, label: s }) {
1617
- const n = [
1643
+ const re = "—";
1644
+ function ya({ stats: e, label: n }) {
1645
+ const a = [
1618
1646
  {
1619
1647
  testid: "execution-stat-total",
1620
1648
  label: "Executions",
1621
- value: e ? String(e.total) : Y
1649
+ value: e ? String(e.total) : re
1622
1650
  },
1623
1651
  {
1624
1652
  testid: "execution-stat-success-rate",
1625
1653
  label: "Success rate",
1626
- value: gs(e == null ? void 0 : e.successRate)
1654
+ value: Bn(e == null ? void 0 : e.successRate)
1627
1655
  },
1628
1656
  {
1629
1657
  testid: "execution-stat-failed",
1630
1658
  label: "Failed",
1631
- value: e ? String(e.failed) : Y
1659
+ value: e ? String(e.failed) : re
1632
1660
  },
1633
1661
  {
1634
1662
  testid: "execution-stat-avg-duration",
1635
1663
  label: "Avg duration",
1636
- value: e ? $e(e.avgDurationMs) : Y
1664
+ value: e ? _e(e.avgDurationMs) : re
1637
1665
  }
1638
1666
  ];
1639
- return e && e.inFlight > 0 && n.push({
1667
+ return e && e.inFlight > 0 && a.push({
1640
1668
  testid: "execution-stat-in-flight",
1641
1669
  label: "In flight",
1642
1670
  value: String(e.inFlight)
1643
- }), /* @__PURE__ */ o("section", { className: "w6w-execution-stats", "data-testid": "execution-stats", children: [
1644
- s != null && /* @__PURE__ */ t("p", { className: "w6w-execution-stats-label", children: s }),
1645
- /* @__PURE__ */ t("div", { className: "w6w-execution-stats-cards", children: n.map((l) => /* @__PURE__ */ o("div", { className: "w6w-execution-stat", "data-testid": l.testid, children: [
1646
- /* @__PURE__ */ t("span", { className: "w6w-execution-stat-value", "data-stat-value": l.value, children: l.value }),
1647
- /* @__PURE__ */ t("span", { className: "w6w-execution-stat-label", children: l.label })
1648
- ] }, 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)) })
1649
1677
  ] });
1650
1678
  }
1651
- function gs(e) {
1652
- 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)}%`;
1653
1681
  }
1654
- const bs = {
1682
+ const Fn = {
1655
1683
  function: "Function",
1656
1684
  endpoint: "Endpoint",
1657
1685
  workflow: "Workflow"
1658
1686
  };
1659
- function ks(e) {
1687
+ function Jn(e) {
1660
1688
  return JSON.stringify(e, null, 2) ?? "null";
1661
1689
  }
1662
- function Ys({
1690
+ function ga({
1663
1691
  execution: e,
1664
- loading: s = !1,
1665
- errorMessage: n,
1666
- onClose: l,
1667
- onOpenInEditor: d
1692
+ loading: n = !1,
1693
+ errorMessage: a,
1694
+ onClose: i,
1695
+ onOpenInEditor: c
1668
1696
  }) {
1669
- return /* @__PURE__ */ o("section", { className: "w6w-execution-detail w6w-stack", "data-testid": "execution-detail", children: [
1670
- 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(
1671
1699
  "p",
1672
1700
  {
1673
1701
  role: "alert",
1674
1702
  className: "w6w-execution-detail-error-message",
1675
1703
  "data-testid": "execution-detail-error-message",
1676
- children: n
1704
+ children: a
1677
1705
  }
1678
1706
  ),
1679
- 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." })
1680
1708
  ] });
1681
1709
  }
1682
- function xs({
1710
+ function jn({
1683
1711
  execution: e,
1684
- onClose: s,
1685
- onOpenInEditor: n
1712
+ onClose: n,
1713
+ onOpenInEditor: a
1686
1714
  }) {
1687
- return /* @__PURE__ */ o(k, { children: [
1688
- /* @__PURE__ */ o("div", { className: "w6w-execution-detail-head", children: [
1689
- /* @__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: [
1690
1718
  /* @__PURE__ */ t("h3", { className: "w6w-execution-detail-name", children: e.callableName }),
1691
- /* @__PURE__ */ o("div", { className: "w6w-execution-detail-meta", children: [
1692
- /* @__PURE__ */ t(Se, { state: e.status }),
1693
- /* @__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] })
1694
1722
  ] })
1695
1723
  ] }),
1696
- (n || s) && /* @__PURE__ */ o("div", { className: "w6w-execution-detail-actions", children: [
1697
- n && /* @__PURE__ */ t(
1724
+ (a || n) && /* @__PURE__ */ l("div", { className: "w6w-execution-detail-actions", children: [
1725
+ a && /* @__PURE__ */ t(
1698
1726
  "button",
1699
1727
  {
1700
1728
  type: "button",
1701
1729
  className: "w6w-btn w6w-btn-ghost",
1702
1730
  "data-testid": "execution-detail-open-editor",
1703
- onClick: n,
1731
+ onClick: a,
1704
1732
  children: "Open in visual editor"
1705
1733
  }
1706
1734
  ),
1707
- 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: "×" })
1708
1736
  ] })
1709
1737
  ] }),
1710
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 }) }),
1711
- /* @__PURE__ */ o("dl", { className: "w6w-execution-detail-timing", children: [
1712
- /* @__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) }),
1713
1741
  /* @__PURE__ */ t(
1714
- fe,
1742
+ Ce,
1715
1743
  {
1716
1744
  label: "Finished",
1717
- value: e.finishedAt ? X(e.finishedAt) : "—"
1745
+ value: e.finishedAt ? ce(e.finishedAt) : "—"
1718
1746
  }
1719
1747
  ),
1720
- /* @__PURE__ */ t(fe, { label: "Duration", value: $e(e.durationMs) })
1748
+ /* @__PURE__ */ t(Ce, { label: "Duration", value: _e(e.durationMs) })
1721
1749
  ] }),
1722
- e.steps !== void 0 && /* @__PURE__ */ o(
1750
+ e.steps !== void 0 && /* @__PURE__ */ l(
1723
1751
  "section",
1724
1752
  {
1725
1753
  className: "w6w-execution-detail-section w6w-stack",
1726
1754
  "data-testid": "execution-detail-steps",
1727
1755
  children: [
1728
1756
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: "Steps" }),
1729
- /* @__PURE__ */ t(ms, { steps: e.steps, emptyLabel: "No steps ran." })
1757
+ /* @__PURE__ */ t(In, { steps: e.steps, emptyLabel: "No steps ran." })
1730
1758
  ]
1731
1759
  }
1732
1760
  ),
1733
- e.input !== void 0 && /* @__PURE__ */ t(ve, { title: "Input", testid: "execution-detail-input", value: e.input }),
1734
- e.output !== void 0 && /* @__PURE__ */ t(ve, { title: "Output", testid: "execution-detail-output", value: e.output }),
1735
- 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 })
1736
1764
  ] });
1737
1765
  }
1738
- function fe({ label: e, value: s }) {
1739
- 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: [
1740
1768
  /* @__PURE__ */ t("dt", { children: e }),
1741
- /* @__PURE__ */ t("dd", { children: s })
1769
+ /* @__PURE__ */ t("dd", { children: n })
1742
1770
  ] });
1743
1771
  }
1744
- function ve({ title: e, testid: s, value: n }) {
1745
- 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: [
1746
1774
  /* @__PURE__ */ t("strong", { className: "w6w-small", children: e }),
1747
- /* @__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 })
1748
2543
  ] });
1749
2544
  }
1750
2545
  export {
1751
- Ps as ActionTestForm,
1752
- en as AddConnectionModal,
1753
- Wt as ApiCallsPanel,
1754
- ce as ApiError,
1755
- tn as AppIcon,
1756
- sn as AppPicker,
1757
- nn as AuthFieldsForm,
1758
- ke as CodeBlock,
1759
- an as CodeEditor,
1760
- _t as Combobox,
1761
- Pt as ConfirmModal,
1762
- qt as Copyable,
1763
- Us as CopyableText,
1764
- Ws as DeleteButton,
1765
- Ks as EditButton,
1766
- Ys as ExecutionDetail,
1767
- Gs as ExecutionFilters,
1768
- zs as ExecutionList,
1769
- ms as ExecutionLogPanel,
1770
- Qs as ExecutionStats,
1771
- rn as ExpressionInput,
1772
- ln as ExpressionOptionsProvider,
1773
- Fs as HealthStatusPill,
1774
- js as HistoryTimeline,
1775
- ze as Icon,
1776
- L as IconButton,
1777
- qs as InfoTip,
1778
- z as JsonEditor,
1779
- Ne as ListItem,
1780
- Ve as Modal,
1781
- on as NodeConfigForm,
1782
- Mt as ParamsForm,
1783
- cn as PropertyEntryForm,
1784
- Vs as RepoSyncIndicator,
1785
- dn as RetryPolicyFields,
1786
- Hs as ServerResourcesBadge,
1787
- Bs as ServerResourcesCard,
1788
- Js as ServerResourcesCardSmall,
1789
- Ds as ServerResourcesRail,
1790
- un as StepBuilderModal,
1791
- Se as StepStatusPill,
1792
- Ls as UptimeStrip,
1793
- wn as W6WUIProvider,
1794
- Is as YamlEditor,
1795
- _s as createW6WApi,
1796
- Qt as cropText,
1797
- mn as filterOptions,
1798
- $e as formatDurationMs,
1799
- X as formatExecutionTime,
1800
- xn as iconNames,
1801
- hn as isExprValue,
1802
- pn as isSecretValue,
1803
- fn as isTestRequired,
1804
- vn as requiredParamsFilled,
1805
- yn as shouldUseCombobox,
1806
- Nn as startOAuthPopup,
1807
- gn as useEnterSubmit,
1808
- bn as useExpressionOptions,
1809
- 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
1810
2620
  };
1811
2621
  //# sourceMappingURL=index.mjs.map