@w6w/embed 0.2.24 → 0.2.26

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 (34) hide show
  1. package/dist/{ImportSpecModal-Cpzp8ndt.js → ImportSpecModal-VdYN1QeZ.js} +21 -20
  2. package/dist/{ImportSpecModal-Cpzp8ndt.js.map → ImportSpecModal-VdYN1QeZ.js.map} +1 -1
  3. package/dist/{WorkflowEditor-LesBKjb2.js → WorkflowEditor-CGKoeSG7.js} +6 -6
  4. package/dist/{WorkflowEditor-LesBKjb2.js.map → WorkflowEditor-CGKoeSG7.js.map} +1 -1
  5. package/dist/{apps-CYUgEfGf.js → apps-FMcQfyL2.js} +2 -2
  6. package/dist/{apps-CYUgEfGf.js.map → apps-FMcQfyL2.js.map} +1 -1
  7. package/dist/chrome/ImportSpecModal.d.ts +2 -0
  8. package/dist/{credentials-Cn92LGhJ.js → credentials-CMR_wEvx.js} +96 -71
  9. package/dist/credentials-CMR_wEvx.js.map +1 -0
  10. package/dist/editor-apps-HEOclsxL.js +152 -0
  11. package/dist/{editor-apps-LZmDWMqf.js.map → editor-apps-HEOclsxL.js.map} +1 -1
  12. package/dist/{editor-tools-DHyWiG21.js → editor-tools-Brw0cv2F.js} +4 -4
  13. package/dist/{editor-tools-DHyWiG21.js.map → editor-tools-Brw0cv2F.js.map} +1 -1
  14. package/dist/editor.mjs +1 -1
  15. package/dist/editors.mjs +7 -7
  16. package/dist/index.mjs +15 -15
  17. package/dist/lists/ConnectionList.d.ts +3 -1
  18. package/dist/lists/CredentialCreate.d.ts +25 -0
  19. package/dist/lists/CredentialDetail.d.ts +5 -1
  20. package/dist/lists/CredentialList.d.ts +3 -1
  21. package/dist/lists.d.ts +2 -0
  22. package/dist/lists.mjs +1035 -862
  23. package/dist/lists.mjs.map +1 -1
  24. package/dist/rail.mjs +1 -1
  25. package/dist/repos/credentials.d.ts +16 -2
  26. package/dist/repos.mjs +157 -153
  27. package/dist/{spec-export-DGigBUsP.js → spec-export-DMMET5VM.js} +2 -2
  28. package/dist/{spec-export-DGigBUsP.js.map → spec-export-DMMET5VM.js.map} +1 -1
  29. package/dist/{workflows-BK6IM4if.js → workflows-Dz8LMjnt.js} +37 -34
  30. package/dist/workflows-Dz8LMjnt.js.map +1 -0
  31. package/package.json +2 -2
  32. package/dist/credentials-Cn92LGhJ.js.map +0 -1
  33. package/dist/editor-apps-LZmDWMqf.js +0 -152
  34. package/dist/workflows-BK6IM4if.js.map +0 -1
package/dist/lists.mjs CHANGED
@@ -1,39 +1,39 @@
1
1
  "use client";
2
- import { jsxs as r, jsx as t, Fragment as Q } from "react/jsx-runtime";
3
- import { useState as f, useMemo as ae, useEffect as ut } from "react";
4
- import { F as mt, E as ht } from "./CreateFunctionModal-DScxp_LN.js";
5
- import { d as wt, f as pt, h as ft, b as Ke, n as ke, u as gt, m as yt } from "./endpoints-DSRo1Lc5.js";
6
- import { u as G, b as Ce } from "./project-context-Tvp-La7A.js";
7
- import { CallableList as vt, ReliabilityList as Nt, EmptyState as De, DataTable as $e, EditButton as Qe, DeleteButton as bt, ListItem as Ne, HealthStatusPill as ue, HistoryTimeline as kt, useW6WApi as Fe, connectionAppIdsToLookUp as qe, ConnectionList as Ct, AddConnectionModal as Dt, EditConnectionModal as _e, Modal as $t, resolveConnectionAppMeta as Tt, ConnectionHeader as Lt, IconButton as Mt, locateDataStoreError as xt, tableSchemaOf as It, draftFromEntry as ce, CsvPanel as Et, DataTableGrid as At, NEW_ROW_ID as te, newRowDraft as xe, kvValueTypeOf as Rt, DataEntryList as St, DataEntryEditor as Pt, dirtyColumns as Ot, csvFilenameOf as jt, csvImportMessage as Ie, buildRowValue as Kt, rowWriteOf as Qt, remainingTtlSeconds as We, isVersionConflict as Be, cellErrorsOf as Ft, parseDocText as qt, kvValueOf as _t, serializeCell as Wt, DataStoreList as Bt, DATA_STORE_KINDS as Ut, DATA_STORE_KIND_LABEL as Vt, SCALAR_TYPES as Ht, ColumnsEditor as Jt, errorPlacement as Yt } from "@w6w/ui";
8
- import { I as zt } from "./ImportSpecModal-Cpzp8ndt.js";
9
- import { i as Zt } from "./import-bindings-EUtxZ9Ti.js";
10
- import { a3 as Gt, a1 as Ue, T as Xt, E as en } from "./workflows-BK6IM4if.js";
11
- import { n as tn, b as nn } from "./workflow-blank-BJFLdGyE.js";
12
- import { f as an, e as Ee, g as sn, b as rn, h as ln, i as on } from "./api-calls--JHyif6a.js";
13
- import { C as he, a as cn, M as dn } from "./ConfirmModal-Pv2-A_3U.js";
14
- import { D as un } from "./DocumentFormModal-Br4s8wmi.js";
15
- import { k as mn, i as hn } from "./spec-import-SWOonsNr.js";
16
- import { H as wn, a as Ve } from "./editor-apps-LZmDWMqf.js";
17
- import { ApiError as He } from "@w6w/sdk";
18
- import { useQueryClient as we, useInfiniteQuery as Je } from "@tanstack/react-query";
19
- import { u as pn, o as fn, k as Ye, c as be, b as ze, m as gn, p as yn } from "./connections-CzsCyIxY.js";
20
- import { M as vn } from "./ModelRoutesManager-Bv6qefnq.js";
21
- import { j as Nn } from "./apps-CYUgEfGf.js";
22
- import { u as pe } from "./client-context-CX61Bgw-.js";
23
- import { r as bn, x as kn, p as Cn, A as Dn } from "./models-CK1KHd39.js";
24
- import { n as $n, m as Tn, k as Ln, p as Mn, q as xn, v as In, o as En } from "./credentials-Cn92LGhJ.js";
25
- import { h as An, k as Ze, p as Ge, o as Rn, j as Xe, n as Sn, m as Pn, g as et, i as On, u as jn, f as Kn } from "./data-stores-UeQvwVCa.js";
26
- function Te(e) {
27
- const { kind: n } = e, a = wt(n), [s, i] = f(!1), l = (e.rows ?? []).map((o) => ({
28
- ...e.toRow(o),
29
- id: o.id,
30
- archived: Zt(o)
2
+ import { jsxs as r, jsx as t, Fragment as K } from "react/jsx-runtime";
3
+ import { useState as f, useMemo as ie, useEffect as gt } from "react";
4
+ import { F as yt, E as vt } from "./CreateFunctionModal-DScxp_LN.js";
5
+ import { d as Nt, f as bt, h as kt, b as qe, n as Te, u as Ct, m as Tt } from "./endpoints-DSRo1Lc5.js";
6
+ import { u as X, b as $e } from "./project-context-Tvp-La7A.js";
7
+ import { CallableList as $t, ReliabilityList as Dt, EmptyState as De, DataTable as xe, EditButton as _e, DeleteButton as xt, ListItem as ke, HealthStatusPill as he, HistoryTimeline as Lt, useW6WApi as We, connectionAppIdsToLookUp as Be, ConnectionList as Et, AddConnectionModal as It, EditConnectionModal as Ue, Modal as Mt, resolveConnectionAppMeta as At, ConnectionHeader as Rt, IconButton as St, locateDataStoreError as Pt, tableSchemaOf as Ot, draftFromEntry as ue, CsvPanel as jt, DataTableGrid as Kt, NEW_ROW_ID as ne, newRowDraft as Me, kvValueTypeOf as Ft, DataEntryList as Qt, DataEntryEditor as qt, dirtyColumns as _t, csvFilenameOf as Wt, csvImportMessage as Ae, buildRowValue as Bt, rowWriteOf as Ut, remainingTtlSeconds as Ve, isVersionConflict as He, cellErrorsOf as Vt, parseDocText as Ht, kvValueOf as Jt, serializeCell as Yt, DataStoreList as zt, DATA_STORE_KINDS as Gt, DATA_STORE_KIND_LABEL as Zt, SCALAR_TYPES as Xt, ColumnsEditor as en, errorPlacement as tn } from "@w6w/ui";
8
+ import { I as nn } from "./ImportSpecModal-VdYN1QeZ.js";
9
+ import { i as an } from "./import-bindings-EUtxZ9Ti.js";
10
+ import { a3 as sn, a1 as Je, T as rn, E as ln } from "./workflows-Dz8LMjnt.js";
11
+ import { n as on, b as cn } from "./workflow-blank-BJFLdGyE.js";
12
+ import { f as dn, e as Re, g as un, b as mn, h as hn, i as wn } from "./api-calls--JHyif6a.js";
13
+ import { C as pe, a as pn, M as fn } from "./ConfirmModal-Pv2-A_3U.js";
14
+ import { D as gn } from "./DocumentFormModal-Br4s8wmi.js";
15
+ import { k as yn, i as vn } from "./spec-import-SWOonsNr.js";
16
+ import { H as Nn, a as Ye } from "./editor-apps-HEOclsxL.js";
17
+ import { ApiError as ze } from "@w6w/sdk";
18
+ import { useQueryClient as fe, useInfiniteQuery as Ge } from "@tanstack/react-query";
19
+ import { u as bn, o as kn, k as Ze, c as Ce, b as Xe, m as Cn, p as Tn } from "./connections-CzsCyIxY.js";
20
+ import { M as $n } from "./ModelRoutesManager-Bv6qefnq.js";
21
+ import { j as Dn } from "./apps-FMcQfyL2.js";
22
+ import { u as ge } from "./client-context-CX61Bgw-.js";
23
+ import { r as xn, x as Ln, p as En, A as In } from "./models-CK1KHd39.js";
24
+ import { v as Mn, q as Le, n as An, f as et, p as Rn, o as Sn, x as Pn, y as On, z as jn, w as Kn } from "./credentials-CMR_wEvx.js";
25
+ import { h as Fn, k as tt, p as nt, o as Qn, j as at, n as qn, m as _n, g as it, i as Wn, u as Bn, f as Un } from "./data-stores-UeQvwVCa.js";
26
+ function Ee(e) {
27
+ const { kind: n } = e, a = Nt(n), [s, i] = f(!1), o = (e.rows ?? []).map((l) => ({
28
+ ...e.toRow(l),
29
+ id: l.id,
30
+ archived: an(l)
31
31
  }));
32
32
  return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
33
33
  /* @__PURE__ */ t(
34
- vt,
34
+ $t,
35
35
  {
36
- rows: l,
36
+ rows: o,
37
37
  title: a.listTitle,
38
38
  description: a.listDescription,
39
39
  emptyCopy: a.emptyCopy,
@@ -55,14 +55,14 @@ function Te(e) {
55
55
  }
56
56
  ),
57
57
  s && /* @__PURE__ */ t(
58
- zt,
58
+ nn,
59
59
  {
60
60
  kind: n,
61
61
  project: e.project ?? void 0,
62
- listKeys: { functionsKey: ft, endpointsKey: pt, workflowsKey: Gt },
63
- onOpenImported: (o, c) => {
64
- var d;
65
- return (d = e.onOpen) == null ? void 0 : d.call(e, c);
62
+ listKeys: { functionsKey: kt, endpointsKey: bt, workflowsKey: sn },
63
+ onOpenImported: (l, d) => {
64
+ var u;
65
+ return (u = e.onOpen) == null ? void 0 : u.call(e, d);
66
66
  },
67
67
  onClose: () => i(!1)
68
68
  }
@@ -70,56 +70,56 @@ function Te(e) {
70
70
  e.children
71
71
  ] });
72
72
  }
73
- function ii(e) {
74
- const n = Ke(), a = G(e.project), [s, i] = f(null);
73
+ function mi(e) {
74
+ const n = qe(), a = X(e.project), [s, i] = f(null);
75
75
  return /* @__PURE__ */ t(
76
- Te,
76
+ Ee,
77
77
  {
78
78
  kind: "function",
79
79
  rows: n.data,
80
80
  loading: n.isLoading,
81
81
  error: n.error ? String(n.error) : null,
82
82
  project: a,
83
- toRow: (l) => ({
84
- title: l.displayName || l.key,
85
- description: l.description,
86
- badges: l.valid ? null : /* @__PURE__ */ t("span", { className: "w6w-callable-list-badge", children: "incomplete" })
83
+ toRow: (o) => ({
84
+ title: o.displayName || o.key,
85
+ description: o.description,
86
+ badges: o.valid ? null : /* @__PURE__ */ t("span", { className: "w6w-callable-list-badge", children: "incomplete" })
87
87
  }),
88
88
  onOpen: e.onOpen,
89
89
  getHref: e.getHref,
90
- onCreate: () => i(ke("function")),
90
+ onCreate: () => i(Te("function")),
91
91
  slots: e.slots,
92
92
  children: s !== null && /* @__PURE__ */ t(
93
- mt,
93
+ yt,
94
94
  {
95
95
  newId: s,
96
- takenKeys: (n.data ?? []).map((l) => l.key),
96
+ takenKeys: (n.data ?? []).map((o) => o.key),
97
97
  onClose: () => i(null),
98
- onCreated: (l) => {
99
- var o;
100
- i(null), (o = e.onCreated) == null || o.call(e, l);
98
+ onCreated: (o) => {
99
+ var l;
100
+ i(null), (l = e.onCreated) == null || l.call(e, o);
101
101
  }
102
102
  }
103
103
  )
104
104
  }
105
105
  );
106
106
  }
107
- function si(e) {
108
- const n = gt(), a = G(e.project), [s, i] = f(null);
107
+ function hi(e) {
108
+ const n = Ct(), a = X(e.project), [s, i] = f(null);
109
109
  return /* @__PURE__ */ t(
110
- Te,
110
+ Ee,
111
111
  {
112
112
  kind: "endpoint",
113
113
  rows: n.data,
114
114
  loading: n.isLoading,
115
115
  error: n.error ? String(n.error) : null,
116
116
  project: a,
117
- toRow: (l) => ({
117
+ toRow: (o) => ({
118
118
  // The draft tag sits INSIDE the title, after the name: ui `ListItem` puts `badges` in
119
119
  // a trailing `margin-left: auto` slot, which would strand it at the row's far edge.
120
- title: /* @__PURE__ */ r(Q, { children: [
121
- /* @__PURE__ */ t("strong", { children: l.displayName || l.key }),
122
- yt(l) ? /* @__PURE__ */ t(
120
+ title: /* @__PURE__ */ r(K, { children: [
121
+ /* @__PURE__ */ t("strong", { children: o.displayName || o.key }),
122
+ Tt(o) ? /* @__PURE__ */ t(
123
123
  "span",
124
124
  {
125
125
  className: "tag warn",
@@ -129,61 +129,61 @@ function si(e) {
129
129
  }
130
130
  ) : null
131
131
  ] }),
132
- description: l.description
132
+ description: o.description
133
133
  }),
134
134
  onOpen: e.onOpen,
135
135
  getHref: e.getHref,
136
- onCreate: () => i(ke("endpoint")),
136
+ onCreate: () => i(Te("endpoint")),
137
137
  slots: e.slots,
138
138
  children: s !== null && /* @__PURE__ */ t(
139
- ht,
139
+ vt,
140
140
  {
141
141
  newId: s,
142
- takenKeys: (n.data ?? []).map((l) => l.key),
142
+ takenKeys: (n.data ?? []).map((o) => o.key),
143
143
  onClose: () => i(null),
144
- onCreated: (l) => {
145
- var o;
146
- i(null), (o = e.onCreated) == null || o.call(e, l);
144
+ onCreated: (o) => {
145
+ var l;
146
+ i(null), (l = e.onCreated) == null || l.call(e, o);
147
147
  }
148
148
  }
149
149
  )
150
150
  }
151
151
  );
152
152
  }
153
- function ri(e) {
154
- const n = G(e.project), a = Ue(n ?? void 0, n != null), s = Xt(n ?? void 0), [i, l] = f(null);
153
+ function wi(e) {
154
+ const n = X(e.project), a = Je(n ?? void 0, n != null), s = rn(n ?? void 0), [i, o] = f(null);
155
155
  return /* @__PURE__ */ t(
156
- Te,
156
+ Ee,
157
157
  {
158
158
  kind: "workflow",
159
159
  rows: a.data,
160
160
  loading: a.isLoading,
161
161
  error: i ?? (a.error ? String(a.error) : null),
162
162
  project: n,
163
- toRow: (o) => ({
164
- title: o.displayName || o.name,
165
- description: o.description,
166
- badges: /* @__PURE__ */ r(Q, { children: [
167
- o.tags.length > 0 && /* @__PURE__ */ t("span", { className: "wf-row-tags", children: o.tags.map((c) => /* @__PURE__ */ t("span", { className: "tag", children: c }, c)) }),
168
- o.status !== "archived" && /* @__PURE__ */ t("span", { className: `badge wf-status ${o.status}`, children: o.status })
163
+ toRow: (l) => ({
164
+ title: l.displayName || l.name,
165
+ description: l.description,
166
+ badges: /* @__PURE__ */ r(K, { children: [
167
+ l.tags.length > 0 && /* @__PURE__ */ t("span", { className: "wf-row-tags", children: l.tags.map((d) => /* @__PURE__ */ t("span", { className: "tag", children: d }, d)) }),
168
+ l.status !== "archived" && /* @__PURE__ */ t("span", { className: `badge wf-status ${l.status}`, children: l.status })
169
169
  ] }),
170
170
  trailing: /* @__PURE__ */ r("span", { className: "wf-col wf-col-stats muted small", children: [
171
- o.runCount,
171
+ l.runCount,
172
172
  " ",
173
- o.runCount === 1 ? "run" : "runs"
173
+ l.runCount === 1 ? "run" : "runs"
174
174
  ] })
175
175
  }),
176
176
  onOpen: e.onOpen,
177
177
  getHref: e.getHref,
178
178
  onCreate: () => {
179
- l(null);
180
- const o = tn((a.data ?? []).map((c) => c.displayName || c.name));
181
- s.mutate(nn(ke("workflow"), o), {
182
- onSuccess: (c) => {
183
- var d;
184
- return (d = e.onCreated) == null ? void 0 : d.call(e, c.workflow.id);
179
+ o(null);
180
+ const l = on((a.data ?? []).map((d) => d.displayName || d.name));
181
+ s.mutate(cn(Te("workflow"), l), {
182
+ onSuccess: (d) => {
183
+ var u;
184
+ return (u = e.onCreated) == null ? void 0 : u.call(e, d.workflow.id);
185
185
  },
186
- onError: (c) => l(c instanceof Error ? c.message : String(c))
186
+ onError: (d) => o(d instanceof Error ? d.message : String(d))
187
187
  });
188
188
  },
189
189
  creating: s.isPending,
@@ -191,54 +191,54 @@ function ri(e) {
191
191
  }
192
192
  );
193
193
  }
194
- function li({
194
+ function pi({
195
195
  project: e,
196
196
  variant: n = "full",
197
197
  limit: a,
198
198
  days: s = 30,
199
199
  showChart: i,
200
- getHref: l,
201
- onOpen: o,
202
- showAllHref: c,
203
- onShowAll: d,
200
+ getHref: o,
201
+ onOpen: l,
202
+ showAllHref: d,
203
+ onShowAll: u,
204
204
  slots: h
205
205
  }) {
206
- var g, w;
207
- const N = Ce().project, u = e === void 0 ? N : e, k = u || null, b = an(k ?? void 0, s);
208
- let D = h == null ? void 0 : h.empty;
209
- return k ? b.isLoading ? D = /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) : b.error && (D = /* @__PURE__ */ t("div", { className: "error", children: b.error.message })) : D = /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see its reliability." }), /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ t(
210
- Nt,
206
+ var g, m;
207
+ const v = $e().project, w = e === void 0 ? v : e, b = w || null, N = dn(b ?? void 0, s);
208
+ let $ = h == null ? void 0 : h.empty;
209
+ return b ? N.isLoading ? $ = /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) : N.error && ($ = /* @__PURE__ */ t("div", { className: "error", children: N.error.message })) : $ = /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see its reliability." }), /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ t(
210
+ Dt,
211
211
  {
212
- services: k ? ((g = b.data) == null ? void 0 : g.services) ?? [] : [],
213
- window: k ? (w = b.data) == null ? void 0 : w.window : void 0,
212
+ services: b ? ((g = N.data) == null ? void 0 : g.services) ?? [] : [],
213
+ window: b ? (m = N.data) == null ? void 0 : m.window : void 0,
214
214
  days: s,
215
215
  compact: n === "compact",
216
216
  showChart: i,
217
217
  limit: a,
218
- getHref: l,
219
- onOpen: o,
220
- showAllHref: c,
221
- onShowAll: d,
222
- slots: { ...h, empty: D }
218
+ getHref: o,
219
+ onOpen: l,
220
+ showAllHref: d,
221
+ onShowAll: u,
222
+ slots: { ...h, empty: $ }
223
223
  }
224
224
  ) });
225
225
  }
226
- function Qn(e) {
226
+ function Vn(e) {
227
227
  const n = e.replace(/\s+/g, " ").trim();
228
228
  return n.length > 80 ? `${n.slice(0, 80)}…` : n;
229
229
  }
230
- function oi({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
230
+ function fi({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
231
231
  var g;
232
- const l = G(e), o = mn(l ?? void 0, l != null), c = hn(), [d, h] = f(null), [N, u] = f(null), k = (s == null ? void 0 : s.header) === void 0 ? /* @__PURE__ */ r("div", { children: [
232
+ const o = X(e), l = yn(o ?? void 0, o != null), d = vn(), [u, h] = f(null), [v, w] = f(null), b = (s == null ? void 0 : s.header) === void 0 ? /* @__PURE__ */ r("div", { children: [
233
233
  /* @__PURE__ */ t("h3", { children: "Documents" }),
234
234
  /* @__PURE__ */ t("p", { className: "muted small", children: "Each document is free-form content stored verbatim." })
235
- ] }) : s.header, b = (s == null ? void 0 : s.empty) === void 0 ? /* @__PURE__ */ t(De, { testId: "document-list-empty", children: "No documents yet." }) : s.empty, D = [
235
+ ] }) : s.header, N = (s == null ? void 0 : s.empty) === void 0 ? /* @__PURE__ */ t(De, { testId: "document-list-empty", children: "No documents yet." }) : s.empty, $ = [
236
236
  {
237
237
  key: "key",
238
238
  header: "Document",
239
- render: (w) => {
240
- var x;
241
- const y = (x = i == null ? void 0 : i.lead) == null ? void 0 : x.call(i, w);
239
+ render: (m) => {
240
+ var D;
241
+ const y = (D = i == null ? void 0 : i.lead) == null ? void 0 : D.call(i, m);
242
242
  return /* @__PURE__ */ r("span", { style: { display: "flex", alignItems: "center" }, children: [
243
243
  y,
244
244
  /* @__PURE__ */ r(
@@ -247,14 +247,14 @@ function oi({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
247
247
  className: "list-main",
248
248
  style: { marginLeft: y != null ? "var(--w6w-sp-2)" : 0 },
249
249
  children: [
250
- /* @__PURE__ */ t("strong", { className: "list-name", title: w.key, children: w.key }),
250
+ /* @__PURE__ */ t("strong", { className: "list-name", title: m.key, children: m.key }),
251
251
  " ",
252
- /* @__PURE__ */ t("span", { className: "tag", children: w.format }),
252
+ /* @__PURE__ */ t("span", { className: "tag", children: m.format }),
253
253
  /* @__PURE__ */ r("div", { className: "muted small list-preview", children: [
254
- /* @__PURE__ */ t("code", { children: Qn(w.content) }),
255
- w.description && /* @__PURE__ */ r(Q, { children: [
254
+ /* @__PURE__ */ t("code", { children: Vn(m.content) }),
255
+ m.description && /* @__PURE__ */ r(K, { children: [
256
256
  " · ",
257
- w.description
257
+ m.description
258
258
  ] })
259
259
  ] })
260
260
  ]
@@ -268,31 +268,31 @@ function oi({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
268
268
  header: "",
269
269
  align: "right",
270
270
  link: !1,
271
- render: (w) => {
272
- var x, S;
273
- const y = (x = i == null ? void 0 : i.footer) == null ? void 0 : x.call(i, w);
271
+ render: (m) => {
272
+ var D, E;
273
+ const y = (D = i == null ? void 0 : i.footer) == null ? void 0 : D.call(i, m);
274
274
  return (
275
275
  // Clicks here must not reach the row's onOpen.
276
276
  // biome-ignore lint/a11y/useKeyWithClickEvents: propagation guard only; the buttons inside are the controls.
277
- /* @__PURE__ */ r("div", { onClick: ($) => $.stopPropagation(), children: [
277
+ /* @__PURE__ */ r("div", { onClick: (x) => x.stopPropagation(), children: [
278
278
  /* @__PURE__ */ r("div", { style: { display: "flex", gap: "var(--w6w-sp-1-5)", justifyContent: "flex-end" }, children: [
279
- /* @__PURE__ */ t(cn, { resource: { kind: "document", key: w.key } }),
280
- w.shared ? (S = i == null ? void 0 : i.sharedActions) == null ? void 0 : S.call(i, w) : /* @__PURE__ */ r(Q, { children: [
279
+ /* @__PURE__ */ t(pn, { resource: { kind: "document", key: m.key } }),
280
+ m.shared ? (E = i == null ? void 0 : i.sharedActions) == null ? void 0 : E.call(i, m) : /* @__PURE__ */ r(K, { children: [
281
281
  /* @__PURE__ */ t(
282
- Qe,
282
+ _e,
283
283
  {
284
284
  label: "Edit",
285
- onClick: () => h({ mode: "edit", d: w }),
286
- "data-testid": `document-edit-${w.id}`
285
+ onClick: () => h({ mode: "edit", d: m }),
286
+ "data-testid": `document-edit-${m.id}`
287
287
  }
288
288
  ),
289
289
  /* @__PURE__ */ t(
290
- bt,
290
+ xt,
291
291
  {
292
292
  label: "Delete",
293
- onClick: () => u(w),
294
- disabled: c.isPending,
295
- "data-testid": `document-delete-${w.id}`
293
+ onClick: () => w(m),
294
+ disabled: d.isPending,
295
+ "data-testid": `document-delete-${m.id}`
296
296
  }
297
297
  )
298
298
  ] })
@@ -306,57 +306,57 @@ function oi({ project: e, onOpen: n, getHref: a, slots: s, rowSlots: i }) {
306
306
  return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
307
307
  /* @__PURE__ */ r("section", { className: "section", children: [
308
308
  /* @__PURE__ */ r("div", { className: "section-head", children: [
309
- k,
309
+ b,
310
310
  /* @__PURE__ */ t(
311
311
  "button",
312
312
  {
313
313
  type: "button",
314
314
  className: "btn",
315
- disabled: l == null,
315
+ disabled: o == null,
316
316
  onClick: () => h({ mode: "create" }),
317
317
  children: "+ Add document"
318
318
  }
319
319
  )
320
320
  ] }),
321
321
  /* @__PURE__ */ r("div", { children: [
322
- o.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
323
- ((g = o.data) == null ? void 0 : g.length) === 0 && b,
324
- o.data != null && o.data.length > 0 && /* @__PURE__ */ t(
325
- $e,
322
+ l.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
323
+ ((g = l.data) == null ? void 0 : g.length) === 0 && N,
324
+ l.data != null && l.data.length > 0 && /* @__PURE__ */ t(
325
+ xe,
326
326
  {
327
- columns: D,
328
- rows: o.data,
329
- rowKey: (w) => w.id,
330
- getRowHref: a ? (w) => a(w.id) : void 0,
331
- onRowClick: n ? (w, y) => n(w.id, y) : void 0
327
+ columns: $,
328
+ rows: l.data,
329
+ rowKey: (m) => m.id,
330
+ getRowHref: a ? (m) => a(m.id) : void 0,
331
+ onRowClick: n ? (m, y) => n(m.id, y) : void 0
332
332
  }
333
333
  )
334
334
  ] })
335
335
  ] }),
336
- d && /* @__PURE__ */ t(
337
- un,
336
+ u && /* @__PURE__ */ t(
337
+ gn,
338
338
  {
339
- initial: d.mode === "edit" ? d.d : void 0,
340
- project: l,
339
+ initial: u.mode === "edit" ? u.d : void 0,
340
+ project: o,
341
341
  onClose: () => h(null),
342
342
  onSaved: () => h(null)
343
343
  }
344
344
  ),
345
- N && /* @__PURE__ */ t(
346
- he,
345
+ v && /* @__PURE__ */ t(
346
+ pe,
347
347
  {
348
348
  title: "Delete document",
349
- message: `Delete the document "${N.key}"? This cannot be undone.`,
349
+ message: `Delete the document "${v.key}"? This cannot be undone.`,
350
350
  confirmLabel: "Delete",
351
351
  onConfirm: () => {
352
- l != null && c.mutate({ id: N.id, project: l }), u(null);
352
+ o != null && d.mutate({ id: v.id, project: o }), w(null);
353
353
  },
354
- onClose: () => u(null)
354
+ onClose: () => w(null)
355
355
  }
356
356
  )
357
357
  ] });
358
358
  }
359
- const Fn = {
359
+ const Hn = {
360
360
  workflow: "Workflow run",
361
361
  workflow_step: "Workflow step",
362
362
  connection_test: "Connection test",
@@ -367,10 +367,10 @@ const Fn = {
367
367
  endpoint: "Endpoint call",
368
368
  action: "App action"
369
369
  };
370
- function me(e) {
371
- return Fn[e] ?? e;
370
+ function we(e) {
371
+ return Hn[e] ?? e;
372
372
  }
373
- const tt = {
373
+ const st = {
374
374
  workflow: "workflow",
375
375
  workflow_step: "workflow_step",
376
376
  connection_test: "base",
@@ -379,27 +379,27 @@ const tt = {
379
379
  endpoint: "base",
380
380
  action: "base"
381
381
  };
382
- function qn(e) {
383
- return Object.hasOwn(tt, e);
382
+ function Jn(e) {
383
+ return Object.hasOwn(st, e);
384
384
  }
385
- function nt(e) {
386
- return qn(e) ? tt[e] : "base";
385
+ function rt(e) {
386
+ return Jn(e) ? st[e] : "base";
387
387
  }
388
- function _n(e, n) {
388
+ function Yn(e, n) {
389
389
  const a = /* @__PURE__ */ new Map();
390
390
  for (const i of e ?? []) {
391
- const l = i.displayName || i.key;
392
- l && a.set(i.id, l);
391
+ const o = i.displayName || i.key;
392
+ o && a.set(i.id, o);
393
393
  }
394
394
  const s = /* @__PURE__ */ new Map();
395
395
  for (const i of n ?? []) {
396
- const l = i.displayName || i.name;
397
- l && s.set(i.id, l);
396
+ const o = i.displayName || i.name;
397
+ o && s.set(i.id, o);
398
398
  }
399
399
  return { functions: a, workflows: s };
400
400
  }
401
- function Wn(e, n) {
402
- const a = e.summary ?? me(e.kind), s = nt(e.kind);
401
+ function zn(e, n) {
402
+ const a = e.summary ?? we(e.kind), s = rt(e.kind);
403
403
  if (s === "function" && e.functionId !== null) {
404
404
  const i = n.functions.get(e.functionId);
405
405
  if (i !== void 0)
@@ -411,42 +411,42 @@ function Wn(e, n) {
411
411
  return { text: i, target: { kind: "workflow", id: e.workflowId } };
412
412
  }
413
413
  if (s === "workflow_step") {
414
- const i = e.workflowId, l = i !== null ? n.workflows.get(i) : void 0, o = l ?? i ?? e.summary ?? "Unknown workflow", c = l !== void 0 && i !== null;
414
+ const i = e.workflowId, o = i !== null ? n.workflows.get(i) : void 0, l = o ?? i ?? e.summary ?? "Unknown workflow", d = o !== void 0 && i !== null;
415
415
  return {
416
- text: e.stepId ? `${o} - ${e.stepId}` : o,
417
- target: c ? { kind: "workflow", id: i } : null
416
+ text: e.stepId ? `${l} - ${e.stepId}` : l,
417
+ target: d ? { kind: "workflow", id: i } : null
418
418
  };
419
419
  }
420
420
  return { text: a, target: null };
421
421
  }
422
- const re = (e) => String(e).padStart(2, "0");
423
- function at(e) {
422
+ const oe = (e) => String(e).padStart(2, "0");
423
+ function lt(e) {
424
424
  const n = new Date(e);
425
- return Number.isNaN(n.getTime()) ? e : `${`${n.getFullYear()}-${re(n.getMonth() + 1)}-${re(n.getDate())}`} ${re(n.getHours())}:${re(n.getMinutes())}:${re(n.getSeconds())}`;
425
+ return Number.isNaN(n.getTime()) ? e : `${`${n.getFullYear()}-${oe(n.getMonth() + 1)}-${oe(n.getDate())}`} ${oe(n.getHours())}:${oe(n.getMinutes())}:${oe(n.getSeconds())}`;
426
426
  }
427
- function it(e) {
427
+ function ot(e) {
428
428
  return e == null || !Number.isFinite(e) || e < 0 ? null : e < 1e3 ? `${Math.round(e)} ms` : e < 6e4 ? `${(Math.floor(e / 100) / 10).toFixed(1)} s` : `${Math.floor(e / 6e4)}m ${Math.floor(e % 6e4 / 1e3)}s`;
429
429
  }
430
- function Bn() {
430
+ function Gn() {
431
431
  const e = /* @__PURE__ */ new Date();
432
432
  return e.setHours(0, 0, 0, 0), e.toISOString();
433
433
  }
434
- function Un(e, n) {
434
+ function Zn(e, n) {
435
435
  const a = new Date(e);
436
436
  if (Number.isNaN(a.getTime())) return e;
437
437
  const s = a.toLocaleDateString(void 0, { month: "short", day: "numeric" });
438
438
  return n === "week" ? `Week of ${s}` : s;
439
439
  }
440
- function st({ ok: e }) {
440
+ function ct({ ok: e }) {
441
441
  return e === null ? /* @__PURE__ */ t("span", { className: "muted", children: "–" }) : /* @__PURE__ */ t("span", { className: e ? "ok" : "error", children: e ? "✓" : "✗" });
442
442
  }
443
- function ge({ label: e, value: n }) {
443
+ function ve({ label: e, value: n }) {
444
444
  return /* @__PURE__ */ r("div", { className: "w6w-activity-card w6w-activity-stat", children: [
445
445
  /* @__PURE__ */ t("div", { className: "w6w-activity-stat-value", children: n }),
446
446
  /* @__PURE__ */ t("div", { className: "muted small", children: e })
447
447
  ] });
448
448
  }
449
- function Ae({
449
+ function Se({
450
450
  title: e,
451
451
  headline: n,
452
452
  loading: a
@@ -455,131 +455,131 @@ function Ae({
455
455
  return /* @__PURE__ */ r("section", { className: "w6w-activity-section", children: [
456
456
  /* @__PURE__ */ t("h3", { children: e }),
457
457
  a ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : /* @__PURE__ */ r("div", { className: "w6w-activity-stats", children: [
458
- /* @__PURE__ */ t(ge, { label: "Workflow runs", value: s.workflowRuns }),
459
- /* @__PURE__ */ t(ge, { label: "Succeeded", value: s.succeeded }),
460
- /* @__PURE__ */ t(ge, { label: "Failed", value: s.failed })
458
+ /* @__PURE__ */ t(ve, { label: "Workflow runs", value: s.workflowRuns }),
459
+ /* @__PURE__ */ t(ve, { label: "Succeeded", value: s.succeeded }),
460
+ /* @__PURE__ */ t(ve, { label: "Failed", value: s.failed })
461
461
  ] })
462
462
  ] });
463
463
  }
464
- function Vn({
464
+ function Xn({
465
465
  entry: e,
466
466
  names: n,
467
467
  getHref: a,
468
468
  onOpen: s
469
469
  }) {
470
- const { text: i, target: l } = Wn(e, n);
471
- if (l === null) return /* @__PURE__ */ t(Q, { children: i });
472
- const o = s ? (c) => s(l, c) : void 0;
473
- return a ? /* @__PURE__ */ t("a", { href: a(l), onClick: o, children: i }) : o ? /* @__PURE__ */ t("button", { type: "button", className: "w6w-activity-link", onClick: o, children: i }) : /* @__PURE__ */ t(Q, { children: i });
470
+ const { text: i, target: o } = zn(e, n);
471
+ if (o === null) return /* @__PURE__ */ t(K, { children: i });
472
+ const l = s ? (d) => s(o, d) : void 0;
473
+ return a ? /* @__PURE__ */ t("a", { href: a(o), onClick: l, children: i }) : l ? /* @__PURE__ */ t("button", { type: "button", className: "w6w-activity-link", onClick: l, children: i }) : /* @__PURE__ */ t(K, { children: i });
474
474
  }
475
- function rt({ entry: e, title: n }) {
476
- const a = it(e.durationMs);
475
+ function dt({ entry: e, title: n }) {
476
+ const a = ot(e.durationMs);
477
477
  return /* @__PURE__ */ t(
478
- Ne,
478
+ ke,
479
479
  {
480
- icon: /* @__PURE__ */ t(st, { ok: e.ok }),
481
- title: n ?? e.summary ?? me(e.kind),
482
- subtitle: `${me(e.kind)} · ${at(e.occurredAt)}`,
480
+ icon: /* @__PURE__ */ t(ct, { ok: e.ok }),
481
+ title: n ?? e.summary ?? we(e.kind),
482
+ subtitle: `${we(e.kind)} · ${lt(e.occurredAt)}`,
483
483
  trailing: a === null ? void 0 : /* @__PURE__ */ t("span", { className: "muted small", children: a })
484
484
  }
485
485
  );
486
486
  }
487
- function ye(e) {
488
- return /* @__PURE__ */ t(rt, { entry: e.entry, title: /* @__PURE__ */ t(Vn, { ...e }) });
487
+ function Ne(e) {
488
+ return /* @__PURE__ */ t(dt, { entry: e.entry, title: /* @__PURE__ */ t(Xn, { ...e }) });
489
489
  }
490
- const Hn = {
491
- base: (e) => /* @__PURE__ */ t(rt, { entry: e.entry }),
492
- function: ye,
493
- workflow: ye,
494
- workflow_step: ye
490
+ const ea = {
491
+ base: (e) => /* @__PURE__ */ t(dt, { entry: e.entry }),
492
+ function: Ne,
493
+ workflow: Ne,
494
+ workflow_step: Ne
495
495
  };
496
- function Jn(e) {
497
- const n = Hn[nt(e.entry.kind)];
496
+ function ta(e) {
497
+ const n = ea[rt(e.entry.kind)];
498
498
  return /* @__PURE__ */ t(n, { ...e });
499
499
  }
500
- function ci({ getHref: e, onOpen: n, slots: a }) {
501
- var D, g, w, y, x, S;
502
- const s = Ee("today", { from: Bn(), bucket: "day" }), i = Ee("week", { bucket: "week" }), l = Ke(), o = Ue(), c = ae(
503
- () => _n(l.data, o.data),
504
- [l.data, o.data]
505
- ), d = s.error ?? i.error, h = d ? d.message : null, N = ((D = i.data) == null ? void 0 : D.recent) ?? [], u = ((g = i.data) == null ? void 0 : g.series) ?? [], k = ((w = i.data) == null ? void 0 : w.range.bucket) ?? "week", b = !i.isLoading && N.length === 0 && (((y = i.data) == null ? void 0 : y.headline.workflowRuns) ?? 0) === 0;
500
+ function gi({ getHref: e, onOpen: n, slots: a }) {
501
+ var $, g, m, y, D, E;
502
+ const s = Re("today", { from: Gn(), bucket: "day" }), i = Re("week", { bucket: "week" }), o = qe(), l = Je(), d = ie(
503
+ () => Yn(o.data, l.data),
504
+ [o.data, l.data]
505
+ ), u = s.error ?? i.error, h = u ? u.message : null, v = (($ = i.data) == null ? void 0 : $.recent) ?? [], w = ((g = i.data) == null ? void 0 : g.series) ?? [], b = ((m = i.data) == null ? void 0 : m.range.bucket) ?? "week", N = !i.isLoading && v.length === 0 && (((y = i.data) == null ? void 0 : y.headline.workflowRuns) ?? 0) === 0;
506
506
  return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
507
507
  h && /* @__PURE__ */ t("div", { className: "error", children: h }),
508
508
  a == null ? void 0 : a.header,
509
509
  a == null ? void 0 : a.actions,
510
510
  /* @__PURE__ */ t(
511
- Ae,
511
+ Se,
512
512
  {
513
513
  title: "Today",
514
- headline: (x = s.data) == null ? void 0 : x.headline,
514
+ headline: (D = s.data) == null ? void 0 : D.headline,
515
515
  loading: s.isLoading
516
516
  }
517
517
  ),
518
518
  /* @__PURE__ */ t(
519
- Ae,
519
+ Se,
520
520
  {
521
521
  title: "Last 7 days",
522
- headline: (S = i.data) == null ? void 0 : S.headline,
522
+ headline: (E = i.data) == null ? void 0 : E.headline,
523
523
  loading: i.isLoading
524
524
  }
525
525
  ),
526
526
  a == null ? void 0 : a.betweenHeadlineAndSeries,
527
527
  /* @__PURE__ */ r("section", { className: "w6w-activity-section", children: [
528
528
  /* @__PURE__ */ t("h3", { children: "Activity over time" }),
529
- /* @__PURE__ */ t("div", { className: "w6w-activity-card", children: i.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : u.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No activity in this window yet." }) : /* @__PURE__ */ t("ul", { className: "list", children: u.map(($) => /* @__PURE__ */ r("li", { children: [
529
+ /* @__PURE__ */ t("div", { className: "w6w-activity-card", children: i.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : w.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No activity in this window yet." }) : /* @__PURE__ */ t("ul", { className: "list", children: w.map((x) => /* @__PURE__ */ r("li", { children: [
530
530
  /* @__PURE__ */ r("span", { className: "list-main", children: [
531
- /* @__PURE__ */ t("strong", { children: Un($.bucket, k) }),
531
+ /* @__PURE__ */ t("strong", { children: Zn(x.bucket, b) }),
532
532
  " ",
533
- /* @__PURE__ */ t("span", { className: "muted small", children: me($.kind) })
533
+ /* @__PURE__ */ t("span", { className: "muted small", children: we(x.kind) })
534
534
  ] }),
535
535
  " ",
536
- /* @__PURE__ */ t(st, { ok: $.ok }),
536
+ /* @__PURE__ */ t(ct, { ok: x.ok }),
537
537
  " ",
538
- /* @__PURE__ */ t("span", { className: "muted small", children: $.count })
539
- ] }, `${$.bucket}-${$.kind}-${String($.ok)}`)) }) })
538
+ /* @__PURE__ */ t("span", { className: "muted small", children: x.count })
539
+ ] }, `${x.bucket}-${x.kind}-${String(x.ok)}`)) }) })
540
540
  ] }),
541
541
  /* @__PURE__ */ r("section", { children: [
542
542
  /* @__PURE__ */ t("h3", { className: "w6w-activity-h3", children: "Recent activity" }),
543
- /* @__PURE__ */ t("div", { className: "w6w-activity-card", children: i.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : b ? (a == null ? void 0 : a.empty) ?? /* @__PURE__ */ t("p", { className: "muted", children: "No runs yet — activity shows up here once your workflows run." }) : N.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No recent activity in this window." }) : /* @__PURE__ */ t("div", { className: "list", children: N.map(($) => /* @__PURE__ */ t(
544
- Jn,
543
+ /* @__PURE__ */ t("div", { className: "w6w-activity-card", children: i.isLoading ? /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : N ? (a == null ? void 0 : a.empty) ?? /* @__PURE__ */ t("p", { className: "muted", children: "No runs yet — activity shows up here once your workflows run." }) : v.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No recent activity in this window." }) : /* @__PURE__ */ t("div", { className: "list", children: v.map((x) => /* @__PURE__ */ t(
544
+ ta,
545
545
  {
546
- entry: $,
547
- names: c,
546
+ entry: x,
547
+ names: d,
548
548
  getHref: e,
549
549
  onOpen: n
550
550
  },
551
- $.id
551
+ x.id
552
552
  )) }) })
553
553
  ] })
554
554
  ] });
555
555
  }
556
- function Yn(e) {
556
+ function na(e) {
557
557
  return e !== null && "project" in e;
558
558
  }
559
- function zn(e) {
560
- const n = Ce().project, [a, s] = f(en), i = e.scope !== void 0 ? e.scope : n ? { project: n } : null, l = e.filters !== void 0, o = e.filters ?? a, c = (d) => {
559
+ function aa(e) {
560
+ const n = $e().project, [a, s] = f(ln), i = e.scope !== void 0 ? e.scope : n ? { project: n } : null, o = e.filters !== void 0, l = e.filters ?? a, d = (u) => {
561
561
  var h;
562
- l || s(d), (h = e.onFiltersChange) == null || h.call(e, d);
562
+ o || s(u), (h = e.onFiltersChange) == null || h.call(e, u);
563
563
  };
564
564
  return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ t(
565
- wn,
565
+ Nn,
566
566
  {
567
567
  scope: i,
568
- showKind: e.showKind ?? Yn(i),
569
- filters: o,
570
- onFiltersChange: c,
568
+ showKind: e.showKind ?? na(i),
569
+ filters: l,
570
+ onFiltersChange: d,
571
571
  onOpenInEditor: e.onOpenInEditor
572
572
  }
573
573
  ) });
574
574
  }
575
- function Zn({ title: e = "Logs", ...n }) {
575
+ function ia({ title: e = "Logs", ...n }) {
576
576
  return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-logs", children: [
577
577
  e !== null && /* @__PURE__ */ t("h2", { children: e }),
578
- /* @__PURE__ */ t(zn, { ...n })
578
+ /* @__PURE__ */ t(aa, { ...n })
579
579
  ] });
580
580
  }
581
- const di = Zn, Gn = 1440 * 60 * 1e3;
582
- function Xn(e) {
581
+ const yi = ia, sa = 1440 * 60 * 1e3;
582
+ function ra(e) {
583
583
  if (!(e === null || e.timeline === null))
584
584
  return e.timeline.map((n) => ({
585
585
  id: n.id,
@@ -592,39 +592,39 @@ function Xn(e) {
592
592
  link: n.link
593
593
  }));
594
594
  }
595
- function lt(e) {
595
+ function ut(e) {
596
596
  return e.startedAt !== void 0 && e.resolvedAt === void 0;
597
597
  }
598
- function Re(e) {
598
+ function Pe(e) {
599
599
  const n = new Date(e);
600
600
  return Number.isNaN(n.getTime()) ? e : n.toLocaleDateString("en-US", { month: "short", day: "numeric", timeZone: "UTC" });
601
601
  }
602
- function Se(e, n) {
602
+ function Oe(e, n) {
603
603
  const a = new Date(e).getTime();
604
- return Number.isNaN(a) ? 0 : Math.max(0, Math.floor((n - a) / Gn));
604
+ return Number.isNaN(a) ? 0 : Math.max(0, Math.floor((n - a) / sa));
605
605
  }
606
- function ea(e, n) {
607
- if (!lt(e) || e.startedAt === void 0) return null;
608
- const a = Se(e.startedAt, n), s = Re(e.startedAt), i = a === 0 ? `open since ${s} (today)` : `open ${a}d (since ${s})`, l = e.updatedAt ?? e.startedAt, o = Se(l, n), c = Re(l), d = o === 0 ? `last update ${c} (today)` : `last update ${c} (${o}d ago)`;
609
- return `${i} · ${d}`;
606
+ function la(e, n) {
607
+ if (!ut(e) || e.startedAt === void 0) return null;
608
+ const a = Oe(e.startedAt, n), s = Pe(e.startedAt), i = a === 0 ? `open since ${s} (today)` : `open ${a}d (since ${s})`, o = e.updatedAt ?? e.startedAt, l = Oe(o, n), d = Pe(o), u = l === 0 ? `last update ${d} (today)` : `last update ${d} (${l}d ago)`;
609
+ return `${i} · ${u}`;
610
610
  }
611
- function ta(e) {
611
+ function oa(e) {
612
612
  return e ? Object.entries(e) : [];
613
613
  }
614
- function na(e) {
614
+ function ca(e) {
615
615
  return e.uptime.map((n) => ({ day: n.day, state: n.state }));
616
616
  }
617
- const ie = [
617
+ const se = [
618
618
  ["e4xx", "4xx"],
619
619
  ["e429", "429 rate-limited"],
620
620
  ["eAuth", "auth (401/403)"],
621
621
  ["e5xx", "5xx"]
622
622
  ];
623
- function ot(e) {
623
+ function mt(e) {
624
624
  const n = new Date(e);
625
625
  return Number.isNaN(n.getTime()) ? e : n.toLocaleDateString(void 0, { month: "short", day: "numeric" });
626
626
  }
627
- function Le(e) {
627
+ function Ie(e) {
628
628
  if (!e) return "—";
629
629
  const n = new Date(e);
630
630
  return Number.isNaN(n.getTime()) ? e : n.toLocaleString(void 0, {
@@ -634,14 +634,14 @@ function Le(e) {
634
634
  minute: "2-digit"
635
635
  });
636
636
  }
637
- function de({ label: e, value: n, hint: a }) {
637
+ function me({ label: e, value: n, hint: a }) {
638
638
  return /* @__PURE__ */ r("div", { className: "w6w-rel-card", style: { flex: "1 1 150px", minWidth: 150 }, children: [
639
639
  /* @__PURE__ */ t("div", { style: { fontSize: "1.6rem", fontWeight: "var(--w6w-fw-semibold)", lineHeight: 1.15 }, children: n }),
640
640
  /* @__PURE__ */ t("div", { className: "muted small", children: e }),
641
641
  a && /* @__PURE__ */ t("div", { className: "muted small", children: a })
642
642
  ] });
643
643
  }
644
- function aa({
644
+ function da({
645
645
  vendor: e,
646
646
  displayName: n
647
647
  }) {
@@ -658,13 +658,13 @@ function aa({
658
658
  ", not a gap in the data above."
659
659
  ] })
660
660
  ] });
661
- const a = e.state === "unknown", s = ta(e.components), i = (e.timeline ?? []).filter(lt), l = Date.now();
661
+ const a = e.state === "unknown", s = oa(e.components), i = (e.timeline ?? []).filter(ut), o = Date.now();
662
662
  return /* @__PURE__ */ r("div", { className: "w6w-rel-card", children: [
663
663
  /* @__PURE__ */ r("h4", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: [
664
664
  n,
665
665
  " status",
666
666
  " ",
667
- /* @__PURE__ */ t(ue, { state: e.state, label: a ? "Unavailable" : void 0 })
667
+ /* @__PURE__ */ t(he, { state: e.state, label: a ? "Unavailable" : void 0 })
668
668
  ] }),
669
669
  a && /* @__PURE__ */ t("p", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: "We could not get a status from this API, so we cannot say whether it is up. That is separate from your own calls above, which are measured here regardless." }),
670
670
  e.message && /* @__PURE__ */ t(
@@ -684,32 +684,32 @@ function aa({
684
684
  n,
685
685
  " says about itself, not what your calls did · last checked",
686
686
  " ",
687
- Le(e.checkedAt),
688
- e.attributedTo.length > 0 && /* @__PURE__ */ r(Q, { children: [
687
+ Ie(e.checkedAt),
688
+ e.attributedTo.length > 0 && /* @__PURE__ */ r(K, { children: [
689
689
  " ",
690
690
  "· decided by",
691
691
  " ",
692
- e.attributedTo.map((o) => /* @__PURE__ */ t("code", { children: o }, o))
692
+ e.attributedTo.map((l) => /* @__PURE__ */ t("code", { children: l }, l))
693
693
  ] })
694
694
  ] }),
695
- s.length > 0 && /* @__PURE__ */ t("div", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: s.map(([o, c]) => /* @__PURE__ */ r("span", { className: "w6w-rel-tag", children: [
696
- o,
695
+ s.length > 0 && /* @__PURE__ */ t("div", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: s.map(([l, d]) => /* @__PURE__ */ r("span", { className: "w6w-rel-tag", children: [
696
+ l,
697
697
  ": ",
698
- c.state
699
- ] }, o)) }),
700
- i.length > 0 && /* @__PURE__ */ t("ul", { className: "list", style: { margin: "var(--w6w-sp-2) 0 0" }, children: i.map((o) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ r("div", { className: "list-main", children: [
701
- /* @__PURE__ */ t("strong", { children: o.title }),
698
+ d.state
699
+ ] }, l)) }),
700
+ i.length > 0 && /* @__PURE__ */ t("ul", { className: "list", style: { margin: "var(--w6w-sp-2) 0 0" }, children: i.map((l) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ r("div", { className: "list-main", children: [
701
+ /* @__PURE__ */ t("strong", { children: l.title }),
702
702
  " ",
703
- /* @__PURE__ */ t(ue, { state: o.state }),
704
- /* @__PURE__ */ t("div", { className: "muted small", children: ea(o, l) })
705
- ] }) }, o.id ?? o.title)) }),
703
+ /* @__PURE__ */ t(he, { state: l.state }),
704
+ /* @__PURE__ */ t("div", { className: "muted small", children: la(l, o) })
705
+ ] }) }, l.id ?? l.title)) }),
706
706
  e.statusPageUrl !== null && /* @__PURE__ */ t("p", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: /* @__PURE__ */ r("a", { href: e.statusPageUrl, target: "_blank", rel: "noopener noreferrer", children: [
707
707
  n,
708
708
  "'s status page ↗"
709
709
  ] }) })
710
710
  ] });
711
711
  }
712
- function ia({ service: e }) {
712
+ function ua({ service: e }) {
713
713
  if (e.calls === 0)
714
714
  return /* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t("span", { className: "w6w-rel-idle-note", children: "No calls in this window" }) });
715
715
  const n = e.uptime, a = Math.max(1, ...n.map((s) => s.calls));
@@ -725,7 +725,7 @@ function ia({ service: e }) {
725
725
  {
726
726
  className: `rel-daily-bar rel-daily-bar-${s.state}`,
727
727
  style: { height: `${s.calls > 0 ? Math.max(s.calls / a * 100, 4) : 2}%` },
728
- title: `${ot(`${s.day}T00:00:00.000Z`)} — ${s.calls} calls, ${s.state}`
728
+ title: `${mt(`${s.day}T00:00:00.000Z`)} — ${s.calls} calls, ${s.state}`
729
729
  },
730
730
  s.day
731
731
  ))
@@ -734,19 +734,19 @@ function ia({ service: e }) {
734
734
  /* @__PURE__ */ t("p", { className: "muted small", style: { margin: "var(--w6w-sp-2) 0 0" }, children: "Calls per day, oldest first. Bar colour is that day's own state." })
735
735
  ] });
736
736
  }
737
- function sa({
737
+ function ma({
738
738
  service: e,
739
739
  window: n
740
740
  }) {
741
- const a = [...e.uptime].reverse().filter((o) => o.calls > 0), s = e.vendorStatus, i = Xn(s), l = i === void 0 ? `${e.displayName} publishes no incident history.` : `No incidents from ${e.displayName} in this window.`;
741
+ const a = [...e.uptime].reverse().filter((l) => l.calls > 0), s = e.vendorStatus, i = ra(s), o = i === void 0 ? `${e.displayName} publishes no incident history.` : `No incidents from ${e.displayName} in this window.`;
742
742
  return /* @__PURE__ */ r("div", { className: "w6w-rel-card", children: [
743
743
  /* @__PURE__ */ t(
744
- kt,
744
+ Lt,
745
745
  {
746
746
  window: n,
747
- days: na(e),
747
+ days: ca(e),
748
748
  incidents: i,
749
- vendorEmptyLabel: l,
749
+ vendorEmptyLabel: o,
750
750
  ariaLabel: `${e.displayName}, ${e.uptime.length}-day status and ${e.displayName} incidents, oldest day first`
751
751
  }
752
752
  ),
@@ -755,26 +755,26 @@ function sa({
755
755
  /* @__PURE__ */ t("code", { children: "unknown" }),
756
756
  " — never a quiet green."
757
757
  ] }),
758
- a.length > 0 && /* @__PURE__ */ t("div", { className: "list", style: { marginTop: "var(--w6w-sp-3)" }, children: a.slice(0, 14).map((o) => /* @__PURE__ */ r("div", { className: "rel-day-row", children: [
759
- /* @__PURE__ */ t("span", { style: { minWidth: 96 }, children: /* @__PURE__ */ t("strong", { children: ot(`${o.day}T00:00:00.000Z`) }) }),
760
- /* @__PURE__ */ t(ue, { state: o.state }),
758
+ a.length > 0 && /* @__PURE__ */ t("div", { className: "list", style: { marginTop: "var(--w6w-sp-3)" }, children: a.slice(0, 14).map((l) => /* @__PURE__ */ r("div", { className: "rel-day-row", children: [
759
+ /* @__PURE__ */ t("span", { style: { minWidth: 96 }, children: /* @__PURE__ */ t("strong", { children: mt(`${l.day}T00:00:00.000Z`) }) }),
760
+ /* @__PURE__ */ t(he, { state: l.state }),
761
761
  /* @__PURE__ */ r("span", { className: "muted small", children: [
762
- o.calls,
762
+ l.calls,
763
763
  " calls"
764
764
  ] }),
765
- /* @__PURE__ */ t("span", { className: "rel-errors", children: ie.filter(([c]) => o.errors[c] > 0).map(([c, d]) => /* @__PURE__ */ r("span", { className: "w6w-rel-tag", children: [
766
- d,
765
+ /* @__PURE__ */ t("span", { className: "rel-errors", children: se.filter(([d]) => l.errors[d] > 0).map(([d, u]) => /* @__PURE__ */ r("span", { className: "w6w-rel-tag", children: [
766
+ u,
767
767
  " ×",
768
- o.errors[c]
769
- ] }, c)) })
770
- ] }, o.day)) })
768
+ l.errors[d]
769
+ ] }, d)) })
770
+ ] }, l.day)) })
771
771
  ] });
772
772
  }
773
- function ra({ errors: e }) {
774
- if (ie.reduce((s, [i]) => s + e[i], 0) === 0)
773
+ function ha({ errors: e }) {
774
+ if (se.reduce((s, [i]) => s + e[i], 0) === 0)
775
775
  return /* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t("p", { className: "muted", style: { margin: 0 }, children: "No errors in this window." }) });
776
- const a = Math.max(1, ...ie.map(([s]) => e[s]));
777
- return /* @__PURE__ */ t("div", { className: "w6w-rel-card rel-errormix-chart", children: ie.map(([s, i]) => /* @__PURE__ */ r("div", { className: "rel-errormix-row", children: [
776
+ const a = Math.max(1, ...se.map(([s]) => e[s]));
777
+ return /* @__PURE__ */ t("div", { className: "w6w-rel-card rel-errormix-chart", children: se.map(([s, i]) => /* @__PURE__ */ r("div", { className: "rel-errormix-row", children: [
778
778
  /* @__PURE__ */ t("span", { className: "muted small", children: i }),
779
779
  /* @__PURE__ */ t("span", { className: "rel-errormix-track", children: /* @__PURE__ */ t(
780
780
  "span",
@@ -786,12 +786,12 @@ function ra({ errors: e }) {
786
786
  /* @__PURE__ */ t("span", { className: "rel-errormix-value small", children: e[s] })
787
787
  ] }, s)) });
788
788
  }
789
- function la({ project: e, appId: n }) {
790
- const a = rn(e, n, { limit: 50 });
789
+ function wa({ project: e, appId: n }) {
790
+ const a = mn(e, n, { limit: 50 });
791
791
  if (a.isLoading) return /* @__PURE__ */ t("p", { className: "muted", children: "Loading calls…" });
792
792
  if (a.error) {
793
793
  const i = a.error;
794
- return /* @__PURE__ */ t("div", { className: "error", children: (i instanceof He, i.message) });
794
+ return /* @__PURE__ */ t("div", { className: "error", children: (i instanceof ze, i.message) });
795
795
  }
796
796
  const s = a.data ?? [];
797
797
  return s.length === 0 ? /* @__PURE__ */ t("p", { className: "muted", children: "No calls captured for this service. Calls appear here once a workflow, function or ad-hoc invoke reaches it." }) : /* @__PURE__ */ r("div", { className: "rel-calls", children: [
@@ -802,47 +802,47 @@ function la({ project: e, appId: n }) {
802
802
  /* @__PURE__ */ t("span", { children: "Status" }),
803
803
  /* @__PURE__ */ t("span", { children: "Took" })
804
804
  ] }),
805
- s.map((i, l) => /* @__PURE__ */ r("div", { className: "rel-call", children: [
806
- /* @__PURE__ */ t("span", { className: "muted small", children: Le(i.createdAt) }),
805
+ s.map((i, o) => /* @__PURE__ */ r("div", { className: "rel-call", children: [
806
+ /* @__PURE__ */ t("span", { className: "muted small", children: Ie(i.createdAt) }),
807
807
  /* @__PURE__ */ t("span", { children: /* @__PURE__ */ t("code", { children: i.actionKey ?? "—" }) }),
808
808
  /* @__PURE__ */ t("span", { className: "muted small", children: i.method }),
809
809
  /* @__PURE__ */ t("span", { className: i.status >= 400 || i.status === 0 ? "error" : "ok", children: i.status === 0 ? "no response" : i.status }),
810
810
  /* @__PURE__ */ t("span", { className: "muted small", children: i.durationMs != null ? `${i.durationMs} ms` : "—" })
811
- ] }, i.id ?? `${i.createdAt}-${l}`))
811
+ ] }, i.id ?? `${i.createdAt}-${o}`))
812
812
  ] });
813
813
  }
814
- function oa({
814
+ function pa({
815
815
  backHref: e,
816
816
  onBack: n
817
817
  }) {
818
818
  return e !== void 0 ? /* @__PURE__ */ t("p", { children: /* @__PURE__ */ t("a", { href: e, onClick: n, children: "← Back to all services" }) }) : n ? /* @__PURE__ */ t("p", { children: /* @__PURE__ */ t("button", { type: "button", className: "list-link", onClick: n, children: "← Back to all services" }) }) : null;
819
819
  }
820
- function ui({
820
+ function vi({
821
821
  appId: e,
822
822
  project: n,
823
823
  days: a = 30,
824
824
  backHref: s,
825
825
  onBack: i,
826
- slots: l
826
+ slots: o
827
827
  }) {
828
- var k, b, D, g;
829
- const o = Ce().project, c = (n === void 0 ? o : n) || void 0, d = sn(c, [e], a), h = d.error, N = h ? (h instanceof He, h.message) : null, u = (k = d.data) == null ? void 0 : k.services.find((w) => w.appId === e);
828
+ var b, N, $, g;
829
+ const l = $e().project, d = (n === void 0 ? l : n) || void 0, u = un(d, [e], a), h = u.error, v = h ? (h instanceof ze, h.message) : null, w = (b = u.data) == null ? void 0 : b.services.find((m) => m.appId === e);
830
830
  return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
831
- l == null ? void 0 : l.header,
832
- l == null ? void 0 : l.actions,
833
- !c && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see this service." }),
834
- N && /* @__PURE__ */ t("div", { className: "error", children: N }),
835
- c && d.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
836
- d.data && !u && /* @__PURE__ */ r("div", { className: "w6w-rel-card", children: [
837
- (l == null ? void 0 : l.empty) ?? /* @__PURE__ */ r("p", { className: "muted", children: [
831
+ o == null ? void 0 : o.header,
832
+ o == null ? void 0 : o.actions,
833
+ !d && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Select a project to see this service." }),
834
+ v && /* @__PURE__ */ t("div", { className: "error", children: v }),
835
+ d && u.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
836
+ u.data && !w && /* @__PURE__ */ r("div", { className: "w6w-rel-card", children: [
837
+ (o == null ? void 0 : o.empty) ?? /* @__PURE__ */ r("p", { className: "muted", children: [
838
838
  /* @__PURE__ */ t("code", { children: e }),
839
839
  " is not used by this project's definitions and has no calls in the last ",
840
840
  a,
841
841
  " days."
842
842
  ] }),
843
- /* @__PURE__ */ t(oa, { backHref: s, onBack: i })
843
+ /* @__PURE__ */ t(pa, { backHref: s, onBack: i })
844
844
  ] }),
845
- u && /* @__PURE__ */ r(Q, { children: [
845
+ w && /* @__PURE__ */ r(K, { children: [
846
846
  /* @__PURE__ */ r("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
847
847
  /* @__PURE__ */ r(
848
848
  "div",
@@ -854,55 +854,55 @@ function ui({
854
854
  marginBottom: "var(--w6w-sp-3)"
855
855
  },
856
856
  children: [
857
- /* @__PURE__ */ t(ue, { state: u.state }),
857
+ /* @__PURE__ */ t(he, { state: w.state }),
858
858
  /* @__PURE__ */ t("span", { className: "muted small", children: "from your calls" }),
859
- /* @__PURE__ */ t("code", { className: "muted small", children: u.appId }),
860
- u.ongoingOutageId && /* @__PURE__ */ t("span", { className: "w6w-rel-tag", children: "outage still open" })
859
+ /* @__PURE__ */ t("code", { className: "muted small", children: w.appId }),
860
+ w.ongoingOutageId && /* @__PURE__ */ t("span", { className: "w6w-rel-tag", children: "outage still open" })
861
861
  ]
862
862
  }
863
863
  ),
864
864
  /* @__PURE__ */ r("div", { style: { display: "flex", gap: "var(--w6w-sp-3)", flexWrap: "wrap" }, children: [
865
- /* @__PURE__ */ t(de, { label: "Calls in window", value: String(u.calls) }),
865
+ /* @__PURE__ */ t(me, { label: "Calls in window", value: String(w.calls) }),
866
866
  /* @__PURE__ */ t(
867
- de,
867
+ me,
868
868
  {
869
869
  label: "p95 latency",
870
- value: u.p95Ms === null ? "—" : `${u.p95Ms} ms`,
871
- hint: u.p95Ms === null ? "no timed calls" : void 0
870
+ value: w.p95Ms === null ? "—" : `${w.p95Ms} ms`,
871
+ hint: w.p95Ms === null ? "no timed calls" : void 0
872
872
  }
873
873
  ),
874
- /* @__PURE__ */ t(de, { label: "Last call", value: Le(u.lastCallAt) }),
874
+ /* @__PURE__ */ t(me, { label: "Last call", value: Ie(w.lastCallAt) }),
875
875
  /* @__PURE__ */ t(
876
- de,
876
+ me,
877
877
  {
878
878
  label: "Errors",
879
- value: String(ie.reduce((w, [y]) => w + u.errors[y], 0)),
880
- hint: ie.filter(([w]) => u.errors[w] > 0).map(([w, y]) => `${y} ×${u.errors[w]}`).join(" · ") || "none"
879
+ value: String(se.reduce((m, [y]) => m + w.errors[y], 0)),
880
+ hint: se.filter(([m]) => w.errors[m] > 0).map(([m, y]) => `${y} ×${w.errors[m]}`).join(" · ") || "none"
881
881
  }
882
882
  )
883
883
  ] })
884
884
  ] }),
885
885
  /* @__PURE__ */ r("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
886
886
  /* @__PURE__ */ t("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: "Error mix" }),
887
- /* @__PURE__ */ t(ra, { errors: u.errors })
887
+ /* @__PURE__ */ t(ha, { errors: w.errors })
888
888
  ] }),
889
889
  /* @__PURE__ */ r("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
890
890
  /* @__PURE__ */ t("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: "API status" }),
891
- /* @__PURE__ */ t(aa, { vendor: u.vendorStatus, displayName: u.displayName })
891
+ /* @__PURE__ */ t(da, { vendor: w.vendorStatus, displayName: w.displayName })
892
892
  ] }),
893
893
  /* @__PURE__ */ r("section", { style: { marginBottom: "var(--w6w-sp-5)" }, children: [
894
894
  /* @__PURE__ */ r("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: [
895
895
  "Last ",
896
- ((b = d.data) == null ? void 0 : b.window.days) ?? a,
896
+ ((N = u.data) == null ? void 0 : N.window.days) ?? a,
897
897
  " days",
898
898
  " ",
899
899
  /* @__PURE__ */ r("span", { className: "muted small", children: [
900
900
  "uptime means ",
901
- (D = d.data) == null ? void 0 : D.uptimeMeans
901
+ ($ = u.data) == null ? void 0 : $.uptimeMeans
902
902
  ] })
903
903
  ] }),
904
- /* @__PURE__ */ t(sa, { service: u, window: ((g = d.data) == null ? void 0 : g.window) ?? { from: "", to: "" } }),
905
- /* @__PURE__ */ t(ia, { service: u })
904
+ /* @__PURE__ */ t(ma, { service: w, window: ((g = u.data) == null ? void 0 : g.window) ?? { from: "", to: "" } }),
905
+ /* @__PURE__ */ t(ua, { service: w })
906
906
  ] }),
907
907
  /* @__PURE__ */ r("section", { children: [
908
908
  /* @__PURE__ */ r("h3", { style: { margin: "0 0 var(--w6w-sp-2)" }, children: [
@@ -910,12 +910,12 @@ function ui({
910
910
  " ",
911
911
  /* @__PURE__ */ t("span", { className: "muted small", children: "the requests behind the numbers above" })
912
912
  ] }),
913
- /* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t(la, { project: c, appId: u.appId }) })
913
+ /* @__PURE__ */ t("div", { className: "w6w-rel-card", children: /* @__PURE__ */ t(wa, { project: d, appId: w.appId }) })
914
914
  ] })
915
915
  ] })
916
916
  ] });
917
917
  }
918
- function ca(e) {
918
+ function fa(e) {
919
919
  if (typeof e == "string") return e;
920
920
  if (e && typeof e == "object") {
921
921
  const n = e;
@@ -924,18 +924,18 @@ function ca(e) {
924
924
  }
925
925
  return String(e);
926
926
  }
927
- function da({
927
+ function ga({
928
928
  routes: e,
929
929
  projectId: n
930
930
  }) {
931
- const [a, s] = f(null), i = e.find((l) => l.id === a);
932
- return e.length === 0 ? null : /* @__PURE__ */ r(Q, { children: [
933
- /* @__PURE__ */ t("ul", { className: "list small", "data-testid": "connection-dependent-routes", children: e.map((l) => /* @__PURE__ */ r("li", { "data-testid": `connection-dependent-route-${l.id}`, children: [
931
+ const [a, s] = f(null), i = e.find((o) => o.id === a);
932
+ return e.length === 0 ? null : /* @__PURE__ */ r(K, { children: [
933
+ /* @__PURE__ */ t("ul", { className: "list small", "data-testid": "connection-dependent-routes", children: e.map((o) => /* @__PURE__ */ r("li", { "data-testid": `connection-dependent-route-${o.id}`, children: [
934
934
  /* @__PURE__ */ t("span", { className: "badge", children: "route" }),
935
935
  " ",
936
- /* @__PURE__ */ t("span", { children: l.name }),
936
+ /* @__PURE__ */ t("span", { children: o.name }),
937
937
  " ",
938
- l.status === "broken" && /* @__PURE__ */ r(Q, { children: [
938
+ o.status === "broken" && /* @__PURE__ */ r(K, { children: [
939
939
  /* @__PURE__ */ t("span", { className: "tag warn", children: "broken" }),
940
940
  " ",
941
941
  /* @__PURE__ */ t(
@@ -943,15 +943,15 @@ function da({
943
943
  {
944
944
  type: "button",
945
945
  className: "btn link",
946
- "data-testid": `connection-route-reconnect-${l.id}`,
947
- onClick: () => s(l.id),
946
+ "data-testid": `connection-route-reconnect-${o.id}`,
947
+ onClick: () => s(o.id),
948
948
  children: "Reconnect"
949
949
  }
950
950
  )
951
951
  ] })
952
- ] }, l.id)) }),
952
+ ] }, o.id)) }),
953
953
  i != null && /* @__PURE__ */ t(
954
- ua,
954
+ ya,
955
955
  {
956
956
  routeId: i.id,
957
957
  projectId: i.project ?? n,
@@ -960,29 +960,29 @@ function da({
960
960
  )
961
961
  ] });
962
962
  }
963
- function ua(e) {
963
+ function ya(e) {
964
964
  return /* @__PURE__ */ r("div", { "data-testid": "connection-route-reconnect-host", children: [
965
- /* @__PURE__ */ t(vn, { projectId: e.projectId, initialEditRouteId: e.routeId }),
965
+ /* @__PURE__ */ t($n, { projectId: e.projectId, initialEditRouteId: e.routeId }),
966
966
  /* @__PURE__ */ t("button", { type: "button", className: "btn link", onClick: e.onDone, children: "Done" })
967
967
  ] });
968
968
  }
969
- function ct({
969
+ function ht({
970
970
  callables: e,
971
971
  onOpenCallable: n,
972
972
  routes: a,
973
973
  projectId: s
974
974
  }) {
975
- return /* @__PURE__ */ r(Q, { children: [
976
- /* @__PURE__ */ t(da, { routes: a ?? [], projectId: s }),
977
- /* @__PURE__ */ t(ma, { callables: e, onOpenCallable: n })
975
+ return /* @__PURE__ */ r(K, { children: [
976
+ /* @__PURE__ */ t(ga, { routes: a ?? [], projectId: s }),
977
+ /* @__PURE__ */ t(va, { callables: e, onOpenCallable: n })
978
978
  ] });
979
979
  }
980
- function ma({
980
+ function va({
981
981
  callables: e,
982
982
  onOpenCallable: n
983
983
  }) {
984
984
  return /* @__PURE__ */ t("ul", { className: "list small", children: e.map((a) => {
985
- const s = a.displayName || a.key || a.id, i = a.sites.map(ca);
985
+ const s = a.displayName || a.key || a.id, i = a.sites.map(fa);
986
986
  return /* @__PURE__ */ r("li", { children: [
987
987
  /* @__PURE__ */ t("span", { className: "badge", children: a.kind }),
988
988
  " ",
@@ -1003,119 +1003,121 @@ function ma({
1003
1003
  ] }, `${a.kind}:${a.id}`);
1004
1004
  }) });
1005
1005
  }
1006
- const ha = [];
1007
- function mi({
1006
+ const Na = [];
1007
+ function Ni({
1008
1008
  onOpen: e,
1009
1009
  getHref: n,
1010
1010
  addLabel: a,
1011
1011
  slots: s,
1012
- onOpenCallable: i
1012
+ onOpenCallable: i,
1013
+ onCreateSharedCredential: o
1013
1014
  }) {
1014
- var P, A;
1015
- const l = Fe(), o = we(), c = pn(), h = c.data ?? ha, N = ae(() => qe(h), [h]), { byId: u } = Ve(N), k = fn(), [b, D] = f(!1), [g, w] = f(null), [y, x] = f(null), S = G(void 0), $ = Ye((y == null ? void 0 : y.id) ?? "", y !== null), T = typeof l.updateConnection == "function", j = s && "actions" in s ? s.actions : /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", onClick: () => D(!0), children: a ?? "+ Add connection" });
1015
+ var R, A;
1016
+ const l = We(), d = fe(), u = bn(), v = u.data ?? Na, w = ie(() => Be(v), [v]), { byId: b } = Ye(w), N = kn(), [$, g] = f(!1), [m, y] = f(null), [D, E] = f(null), x = X(void 0), k = Ze((D == null ? void 0 : D.id) ?? "", D !== null), Q = typeof l.updateConnection == "function", j = s && "actions" in s ? s.actions : /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", onClick: () => g(!0), children: a ?? "+ Add connection" });
1016
1017
  return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
1017
1018
  /* @__PURE__ */ t(
1018
- Ct,
1019
+ Et,
1019
1020
  {
1020
- connections: h,
1021
- appsById: u,
1022
- loading: c.isLoading,
1023
- error: c.error ? c.error.message : null,
1021
+ connections: v,
1022
+ appsById: b,
1023
+ loading: u.isLoading,
1024
+ error: u.error ? u.error.message : null,
1024
1025
  onOpen: e,
1025
1026
  getHref: n,
1026
- onEdit: T ? w : void 0,
1027
- onDelete: x,
1028
- busy: k.isPending,
1027
+ onEdit: Q ? y : void 0,
1028
+ onDelete: E,
1029
+ busy: N.isPending,
1029
1030
  slots: { ...s, actions: j }
1030
1031
  }
1031
1032
  ),
1032
- b && /* @__PURE__ */ t(
1033
- Dt,
1033
+ $ && /* @__PURE__ */ t(
1034
+ It,
1034
1035
  {
1035
- onClose: () => D(!1),
1036
+ onCreateSharedCredential: o,
1037
+ onClose: () => g(!1),
1036
1038
  onCreated: () => {
1037
- D(!1), o.invalidateQueries({ queryKey: be });
1039
+ g(!1), d.invalidateQueries({ queryKey: Ce });
1038
1040
  }
1039
1041
  }
1040
1042
  ),
1041
- g && /* @__PURE__ */ t(
1042
- _e,
1043
+ m && /* @__PURE__ */ t(
1044
+ Ue,
1043
1045
  {
1044
- connection: g,
1045
- onClose: () => w(null),
1046
+ connection: m,
1047
+ onClose: () => y(null),
1046
1048
  onSaved: () => {
1047
- const R = g.id;
1048
- w(null), o.invalidateQueries({ queryKey: be }), o.invalidateQueries({ queryKey: ze(R) });
1049
+ const P = m.id;
1050
+ y(null), d.invalidateQueries({ queryKey: Ce }), d.invalidateQueries({ queryKey: Xe(P) });
1049
1051
  }
1050
1052
  }
1051
1053
  ),
1052
- y && /* @__PURE__ */ t(
1053
- wa,
1054
+ D && /* @__PURE__ */ t(
1055
+ ba,
1054
1056
  {
1055
- name: y.displayName || y.id,
1056
- loading: $.isLoading,
1057
- callables: $.isError ? [] : ((P = $.data) == null ? void 0 : P.callables) ?? [],
1058
- routes: $.isError ? [] : ((A = $.data) == null ? void 0 : A.routes) ?? [],
1059
- projectId: S,
1057
+ name: D.displayName || D.id,
1058
+ loading: k.isLoading,
1059
+ callables: k.isError ? [] : ((R = k.data) == null ? void 0 : R.callables) ?? [],
1060
+ routes: k.isError ? [] : ((A = k.data) == null ? void 0 : A.routes) ?? [],
1061
+ projectId: x,
1060
1062
  onOpenCallable: i,
1061
- onClose: () => x(null),
1063
+ onClose: () => E(null),
1062
1064
  onConfirm: () => {
1063
- const R = y.id;
1064
- x(null), k.mutate({ id: R, force: !0 });
1065
+ const P = D.id;
1066
+ E(null), N.mutate({ id: P, force: !0 });
1065
1067
  }
1066
1068
  }
1067
1069
  )
1068
1070
  ] });
1069
1071
  }
1070
- function wa({
1072
+ function ba({
1071
1073
  name: e,
1072
1074
  loading: n,
1073
1075
  callables: a,
1074
1076
  routes: s,
1075
1077
  projectId: i,
1076
- onOpenCallable: l,
1077
- onClose: o,
1078
- onConfirm: c
1078
+ onOpenCallable: o,
1079
+ onClose: l,
1080
+ onConfirm: d
1079
1081
  }) {
1080
- const d = a.length, h = s.length, N = d + h, u = `Delete the connection "${e}"? This cannot be undone.`, k = (g, w, y) => `${g} ${g === 1 ? w : y}`, b = [
1081
- d > 0 ? k(d, "callable", "callables") : null,
1082
- h > 0 ? k(h, "model route", "model routes") : null
1083
- ].filter(Boolean).join(" and "), D = [
1084
- d > 0 ? `Deleting disables ${d === 1 ? "this callable" : `these ${d} callables`} until you reconnect ${d === 1 ? "it" : "them"}.` : null,
1082
+ const u = a.length, h = s.length, v = u + h, w = `Delete the connection "${e}"? This cannot be undone.`, b = (g, m, y) => `${g} ${g === 1 ? m : y}`, N = [
1083
+ u > 0 ? b(u, "callable", "callables") : null,
1084
+ h > 0 ? b(h, "model route", "model routes") : null
1085
+ ].filter(Boolean).join(" and "), $ = [
1086
+ u > 0 ? `Deleting disables ${u === 1 ? "this callable" : `these ${u} callables`} until you reconnect ${u === 1 ? "it" : "them"}.` : null,
1085
1087
  h > 0 ? `${h === 1 ? "The model route becomes" : `The ${h} model routes become`} broken until ${h === 1 ? "it is" : "they are"} pointed at another connection.` : null
1086
1088
  ].filter((g) => g != null);
1087
- return /* @__PURE__ */ r($t, { title: "Delete connection", onClose: o, children: [
1089
+ return /* @__PURE__ */ r(Mt, { title: "Delete connection", onClose: l, children: [
1088
1090
  /* @__PURE__ */ r("div", { className: "w6w-modal-body", children: [
1089
- /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: N === 0 ? u : `Delete the connection "${e}"? Used by ${b}.` }),
1090
- N > 0 && /* @__PURE__ */ r(Q, { children: [
1091
+ /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: v === 0 ? w : `Delete the connection "${e}"? Used by ${N}.` }),
1092
+ v > 0 && /* @__PURE__ */ r(K, { children: [
1091
1093
  /* @__PURE__ */ t(
1092
- ct,
1094
+ ht,
1093
1095
  {
1094
1096
  callables: a,
1095
1097
  routes: s,
1096
1098
  projectId: i,
1097
- onOpenCallable: l
1099
+ onOpenCallable: o
1098
1100
  }
1099
1101
  ),
1100
- /* @__PURE__ */ t("p", { className: "w6w-small", children: D.join(" ") })
1102
+ /* @__PURE__ */ t("p", { className: "w6w-small", children: $.join(" ") })
1101
1103
  ] })
1102
1104
  ] }),
1103
1105
  /* @__PURE__ */ r("div", { className: "w6w-modal-actions", children: [
1104
- /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: o, children: "Cancel" }),
1106
+ /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: l, children: "Cancel" }),
1105
1107
  /* @__PURE__ */ t(
1106
1108
  "button",
1107
1109
  {
1108
1110
  type: "button",
1109
1111
  className: "w6w-btn w6w-btn-danger",
1110
1112
  disabled: n,
1111
- onClick: c,
1113
+ onClick: d,
1112
1114
  children: "Delete"
1113
1115
  }
1114
1116
  )
1115
1117
  ] })
1116
1118
  ] });
1117
1119
  }
1118
- function ve(e) {
1120
+ function be(e) {
1119
1121
  const n = new Date(e).getTime();
1120
1122
  if (Number.isNaN(n)) return "recently";
1121
1123
  const a = Math.max(0, Math.round((Date.now() - n) / 1e3));
@@ -1124,149 +1126,149 @@ function ve(e) {
1124
1126
  if (s < 60) return `${s}m ago`;
1125
1127
  const i = Math.round(s / 60);
1126
1128
  if (i < 24) return `${i}h ago`;
1127
- const l = Math.round(i / 24);
1128
- return l < 30 ? `${l}d ago` : new Date(e).toLocaleDateString();
1129
+ const o = Math.round(i / 24);
1130
+ return o < 30 ? `${o}d ago` : new Date(e).toLocaleDateString();
1129
1131
  }
1130
- const pa = {
1132
+ const ka = {
1131
1133
  ok: 6e3,
1132
1134
  warn: 1e4,
1133
1135
  error: 15e3
1134
- }, fa = { ok: "✓", warn: "!", error: "✕" };
1135
- function hi({
1136
+ }, Ca = { ok: "✓", warn: "!", error: "✕" };
1137
+ function bi({
1136
1138
  connectionId: e,
1137
1139
  onOpenAction: n,
1138
1140
  onBack: a,
1139
1141
  onOpenCallable: s,
1140
1142
  slots: i
1141
1143
  }) {
1142
- var U;
1143
- const l = Fe(), o = we(), c = gn(e), d = (U = c.data) == null ? void 0 : U.appId, h = ae(
1144
- () => qe(c.data ? [c.data] : []),
1145
- [c.data]
1146
- ), { byId: N } = Ve(h), u = c.data ? Tt(c.data, N) : void 0, k = Nn(d, !!d), b = ln(e), D = ae(() => {
1144
+ var _;
1145
+ const o = We(), l = fe(), d = Cn(e), u = (_ = d.data) == null ? void 0 : _.appId, h = ie(
1146
+ () => Be(d.data ? [d.data] : []),
1147
+ [d.data]
1148
+ ), { byId: v } = Ye(h), w = d.data ? At(d.data, v) : void 0, b = Dn(u, !!u), N = hn(e), $ = ie(() => {
1147
1149
  const p = /* @__PURE__ */ new Map();
1148
- for (const E of b.data ?? []) {
1149
- const I = p.get(E.actionKey) ?? [];
1150
- I.push(E), p.set(E.actionKey, I);
1150
+ for (const L of N.data ?? []) {
1151
+ const M = p.get(L.actionKey) ?? [];
1152
+ M.push(L), p.set(L.actionKey, M);
1151
1153
  }
1152
1154
  return p;
1153
- }, [b.data]), g = Ye(e).data, w = G(void 0), y = (g == null ? void 0 : g.callables) ?? [], x = (g == null ? void 0 : g.routes) ?? [], S = on(e).data ?? [], [$, T] = f(!1), [j, P] = f(""), A = yn(e), [R, F] = f(null);
1154
- ut(() => {
1155
- if (!R) return;
1156
- const p = setTimeout(() => F(null), pa[R.kind]);
1155
+ }, [N.data]), g = Ze(e).data, m = X(void 0), y = (g == null ? void 0 : g.callables) ?? [], D = (g == null ? void 0 : g.routes) ?? [], E = wn(e).data ?? [], [x, k] = f(!1), [Q, j] = f(""), R = Tn(e), [A, P] = f(null);
1156
+ gt(() => {
1157
+ if (!A) return;
1158
+ const p = setTimeout(() => P(null), ka[A.kind]);
1157
1159
  return () => clearTimeout(p);
1158
- }, [R]);
1160
+ }, [A]);
1159
1161
  const H = () => {
1160
- F(null), A.mutate(void 0, {
1162
+ P(null), R.mutate(void 0, {
1161
1163
  onSuccess: (p) => {
1162
- var E;
1164
+ var L;
1163
1165
  if (!p.ok) {
1164
- F({
1166
+ P({
1165
1167
  kind: "error",
1166
- text: `Connection test failed${(E = p.error) != null && E.message ? `: ${p.error.message}` : "."}`
1168
+ text: `Connection test failed${(L = p.error) != null && L.message ? `: ${p.error.message}` : "."}`
1167
1169
  });
1168
1170
  return;
1169
1171
  }
1170
- F(
1172
+ P(
1171
1173
  p.untested ? { kind: "warn", text: `Connection stored. ${p.message ?? ""}`.trim() } : {
1172
1174
  kind: "ok",
1173
1175
  text: `Connection is valid${p.actionKey ? ` — probed ${p.actionKey}` : ""}.`
1174
1176
  }
1175
1177
  );
1176
1178
  },
1177
- onError: (p) => F({ kind: "error", text: (p == null ? void 0 : p.message) ?? "Test failed." })
1179
+ onError: (p) => P({ kind: "error", text: (p == null ? void 0 : p.message) ?? "Test failed." })
1178
1180
  });
1179
- }, L = ae(() => {
1180
- var E;
1181
- const p = [...((E = k.data) == null ? void 0 : E.actions) ?? []];
1182
- return p.sort((I, C) => (I.title || I.key).localeCompare(C.title || C.key)), p;
1183
- }, [k.data]), J = ae(() => {
1184
- const p = j.trim().toLowerCase();
1185
- return p ? L.filter(
1186
- (E) => (E.title || "").toLowerCase().includes(p) || E.key.toLowerCase().includes(p) || (E.description || "").toLowerCase().includes(p)
1187
- ) : L;
1188
- }, [L, j]);
1189
- if (c.isLoading || k.isLoading)
1181
+ }, I = ie(() => {
1182
+ var L;
1183
+ const p = [...((L = b.data) == null ? void 0 : L.actions) ?? []];
1184
+ return p.sort((M, z) => (M.title || M.key).localeCompare(z.title || z.key)), p;
1185
+ }, [b.data]), J = ie(() => {
1186
+ const p = Q.trim().toLowerCase();
1187
+ return p ? I.filter(
1188
+ (L) => (L.title || "").toLowerCase().includes(p) || L.key.toLowerCase().includes(p) || (L.description || "").toLowerCase().includes(p)
1189
+ ) : I;
1190
+ }, [I, Q]);
1191
+ if (d.isLoading || b.isLoading)
1190
1192
  return /* @__PURE__ */ t("div", { className: "w6w-embed-root w6w-embed-conn-detail", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) });
1191
- if (!c.data)
1193
+ if (!d.data)
1192
1194
  return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-conn-detail", "data-testid": "connection-not-found", children: [
1193
1195
  (i == null ? void 0 : i.empty) ?? /* @__PURE__ */ t("h2", { children: "Connection not found" }),
1194
1196
  a && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "Back to integrations" })
1195
1197
  ] });
1196
- const K = c.data, B = k.data, Y = !K.builtIn && typeof l.updateConnection == "function";
1198
+ const q = d.data, S = b.data, U = !q.builtIn && typeof o.updateConnection == "function";
1197
1199
  return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-conn-detail w6w-card-stack", children: [
1198
- (i == null ? void 0 : i.header) ?? /* @__PURE__ */ r(Lt, { conn: K, app: u, children: [
1200
+ (i == null ? void 0 : i.header) ?? /* @__PURE__ */ r(Rt, { conn: q, app: w, children: [
1199
1201
  /* @__PURE__ */ t(
1200
1202
  "button",
1201
1203
  {
1202
1204
  type: "button",
1203
1205
  className: "w6w-btn w6w-btn-ghost",
1204
- disabled: A.isPending,
1206
+ disabled: R.isPending,
1205
1207
  onClick: H,
1206
- children: A.isPending ? "Testing…" : "Test connection"
1208
+ children: R.isPending ? "Testing…" : "Test connection"
1207
1209
  }
1208
1210
  ),
1209
- Y && /* @__PURE__ */ t(
1210
- Qe,
1211
+ U && /* @__PURE__ */ t(
1212
+ _e,
1211
1213
  {
1212
1214
  label: "Edit",
1213
- onClick: () => T(!0),
1215
+ onClick: () => k(!0),
1214
1216
  "data-testid": "connection-detail-edit"
1215
1217
  }
1216
1218
  ),
1217
1219
  i == null ? void 0 : i.actions
1218
1220
  ] }),
1219
- R && /* @__PURE__ */ r(
1221
+ A && /* @__PURE__ */ r(
1220
1222
  "div",
1221
1223
  {
1222
- className: `w6w-result w6w-embed-conn-notice w6w-embed-conn-notice-${R.kind}`,
1223
- role: R.kind === "error" ? "alert" : "status",
1224
- "aria-live": R.kind === "error" ? "assertive" : "polite",
1224
+ className: `w6w-result w6w-embed-conn-notice w6w-embed-conn-notice-${A.kind}`,
1225
+ role: A.kind === "error" ? "alert" : "status",
1226
+ "aria-live": A.kind === "error" ? "assertive" : "polite",
1225
1227
  "data-testid": "connection-test-notice",
1226
1228
  children: [
1227
- /* @__PURE__ */ t("span", { "aria-hidden": "true", children: fa[R.kind] }),
1228
- /* @__PURE__ */ t("span", { className: "w6w-embed-conn-notice-text", children: R.text }),
1229
- /* @__PURE__ */ t(Mt, { icon: "close", label: "Dismiss", onClick: () => F(null) })
1229
+ /* @__PURE__ */ t("span", { "aria-hidden": "true", children: Ca[A.kind] }),
1230
+ /* @__PURE__ */ t("span", { className: "w6w-embed-conn-notice-text", children: A.text }),
1231
+ /* @__PURE__ */ t(St, { icon: "close", label: "Dismiss", onClick: () => P(null) })
1230
1232
  ]
1231
1233
  }
1232
1234
  ),
1233
1235
  /* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
1234
1236
  /* @__PURE__ */ r("h3", { children: [
1235
1237
  "App: ",
1236
- (u == null ? void 0 : u.displayName) ?? K.appId
1238
+ (w == null ? void 0 : w.displayName) ?? q.appId
1237
1239
  ] }),
1238
- B && /* @__PURE__ */ r("p", { className: "w6w-muted w6w-small", children: [
1240
+ S && /* @__PURE__ */ r("p", { className: "w6w-muted w6w-small", children: [
1239
1241
  "Version ",
1240
1242
  /* @__PURE__ */ r("code", { children: [
1241
1243
  "v",
1242
- B.version ?? "?"
1244
+ S.version ?? "?"
1243
1245
  ] }),
1244
1246
  " · source ",
1245
- /* @__PURE__ */ t("code", { children: B.sourceRef })
1247
+ /* @__PURE__ */ t("code", { children: S.sourceRef })
1246
1248
  ] }),
1247
1249
  a && /* @__PURE__ */ t("p", { className: "w6w-small", children: /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: a, children: "← Integrations" }) })
1248
1250
  ] }),
1249
1251
  /* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
1250
1252
  /* @__PURE__ */ t("h3", { children: "Actions" }),
1251
- L.length === 0 && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No actions exposed." }),
1252
- L.length > 10 && /* @__PURE__ */ t(
1253
+ I.length === 0 && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No actions exposed." }),
1254
+ I.length > 10 && /* @__PURE__ */ t(
1253
1255
  "input",
1254
1256
  {
1255
1257
  type: "search",
1256
- value: j,
1257
- placeholder: `Search ${L.length} actions…`,
1258
- onChange: (p) => P(p.target.value),
1258
+ value: Q,
1259
+ placeholder: `Search ${I.length} actions…`,
1260
+ onChange: (p) => j(p.target.value),
1259
1261
  "aria-label": "Filter actions",
1260
1262
  className: "w6w-embed-conn-filter"
1261
1263
  }
1262
1264
  ),
1263
- L.length > 0 && J.length === 0 && /* @__PURE__ */ r("p", { className: "w6w-muted w6w-small", children: [
1265
+ I.length > 0 && J.length === 0 && /* @__PURE__ */ r("p", { className: "w6w-muted w6w-small", children: [
1264
1266
  "No actions match “",
1265
- j,
1267
+ Q,
1266
1268
  "”."
1267
1269
  ] }),
1268
1270
  /* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Actions", children: J.map((p) => {
1269
- const E = D.get(p.key) ?? [];
1271
+ const L = $.get(p.key) ?? [];
1270
1272
  return /* @__PURE__ */ r("li", { children: [
1271
1273
  /* @__PURE__ */ r(
1272
1274
  "button",
@@ -1285,30 +1287,30 @@ function hi({
1285
1287
  ]
1286
1288
  }
1287
1289
  ),
1288
- E.length > 0 && /* @__PURE__ */ t(
1290
+ L.length > 0 && /* @__PURE__ */ t(
1289
1291
  "ul",
1290
1292
  {
1291
1293
  className: "w6w-embed-conn-list w6w-embed-conn-tests",
1292
1294
  "aria-label": `Saved tests for ${p.title || p.key}`,
1293
- children: E.map((I) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
1294
- Ne,
1295
+ children: L.map((M) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
1296
+ ke,
1295
1297
  {
1296
- title: I.name,
1297
- subtitle: I.lastRunAt ? /* @__PURE__ */ r("span", { children: [
1298
+ title: M.name,
1299
+ subtitle: M.lastRunAt ? /* @__PURE__ */ r("span", { children: [
1298
1300
  /* @__PURE__ */ t(
1299
1301
  "span",
1300
1302
  {
1301
- className: I.lastRunOk ? "w6w-embed-conn-ok" : "w6w-embed-conn-fail",
1302
- children: I.lastRunOk ? "✓" : "✗"
1303
+ className: M.lastRunOk ? "w6w-embed-conn-ok" : "w6w-embed-conn-fail",
1304
+ children: M.lastRunOk ? "✓" : "✗"
1303
1305
  }
1304
1306
  ),
1305
1307
  " ",
1306
- I.lastRunSummary ? `${I.lastRunSummary} · ` : "",
1307
- ve(I.lastRunAt)
1308
- ] }) : `saved ${ve(I.updatedAt)}`,
1309
- onClick: () => n(p.key, I.id)
1308
+ M.lastRunSummary ? `${M.lastRunSummary} · ` : "",
1309
+ be(M.lastRunAt)
1310
+ ] }) : `saved ${be(M.updatedAt)}`,
1311
+ onClick: () => n(p.key, M.id)
1310
1312
  }
1311
- ) }, I.id))
1313
+ ) }, M.id))
1312
1314
  }
1313
1315
  )
1314
1316
  ] }, p.key);
@@ -1316,63 +1318,63 @@ function hi({
1316
1318
  ] }),
1317
1319
  g && /* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", "data-testid": "connection-used-by", children: [
1318
1320
  /* @__PURE__ */ t("h3", { children: "Used by" }),
1319
- y.length === 0 && x.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Not used by any callable" }) : /* @__PURE__ */ t(
1320
- ct,
1321
+ y.length === 0 && D.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Not used by any callable" }) : /* @__PURE__ */ t(
1322
+ ht,
1321
1323
  {
1322
1324
  callables: y,
1323
- routes: x,
1324
- projectId: w,
1325
+ routes: D,
1326
+ projectId: m,
1325
1327
  onOpenCallable: s
1326
1328
  }
1327
1329
  )
1328
1330
  ] }),
1329
- S.length > 0 && /* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
1331
+ E.length > 0 && /* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
1330
1332
  /* @__PURE__ */ t("h3", { children: "Recent runs" }),
1331
1333
  /* @__PURE__ */ t("p", { className: "w6w-muted w6w-small", children: "Most recent tester runs against this connection." }),
1332
- /* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Recent runs", children: S.map((p) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
1333
- Ne,
1334
+ /* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Recent runs", children: E.map((p) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
1335
+ ke,
1334
1336
  {
1335
1337
  title: p.actionKey,
1336
1338
  subtitle: /* @__PURE__ */ r("span", { children: [
1337
1339
  /* @__PURE__ */ t("span", { className: p.ok ? "w6w-embed-conn-ok" : "w6w-embed-conn-fail", children: p.ok ? "✓" : "✗" }),
1338
1340
  " ",
1339
1341
  p.summary ? `${p.summary} · ` : "",
1340
- ve(p.occurredAt)
1342
+ be(p.occurredAt)
1341
1343
  ] })
1342
1344
  }
1343
1345
  ) }, p.id)) })
1344
1346
  ] }),
1345
- $ && /* @__PURE__ */ t(
1346
- _e,
1347
+ x && /* @__PURE__ */ t(
1348
+ Ue,
1347
1349
  {
1348
- connection: K,
1349
- onClose: () => T(!1),
1350
+ connection: q,
1351
+ onClose: () => k(!1),
1350
1352
  onSaved: () => {
1351
- T(!1), o.invalidateQueries({ queryKey: ze(e) }), o.invalidateQueries({ queryKey: be });
1353
+ k(!1), l.invalidateQueries({ queryKey: Xe(e) }), l.invalidateQueries({ queryKey: Ce });
1352
1354
  }
1353
1355
  }
1354
1356
  )
1355
1357
  ] });
1356
1358
  }
1357
- const ga = {};
1358
- function Pe(e) {
1359
+ const Ta = {};
1360
+ function je(e) {
1359
1361
  return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
1360
1362
  }
1361
- function le(e) {
1363
+ function ce(e) {
1362
1364
  return (e / 100).toFixed(2);
1363
1365
  }
1364
- function ya(e) {
1366
+ function $a(e) {
1365
1367
  if (e == null) return null;
1366
1368
  const n = e.rates, a = [];
1367
- return n.input != null && a.push(`in ${le(n.input)}`), n.output != null && a.push(`out ${le(n.output)}`), n.cachedInput != null && a.push(`cached ${le(n.cachedInput)}`), n.cacheWrite != null && a.push(`cache write ${le(n.cacheWrite)}`), n.perRequest != null && a.push(`${le(n.perRequest)}/request`), a.length === 0 ? null : `${n.currency ?? "USD"} ${a.join(" · ")}`;
1369
+ return n.input != null && a.push(`in ${ce(n.input)}`), n.output != null && a.push(`out ${ce(n.output)}`), n.cachedInput != null && a.push(`cached ${ce(n.cachedInput)}`), n.cacheWrite != null && a.push(`cache write ${ce(n.cacheWrite)}`), n.perRequest != null && a.push(`${ce(n.perRequest)}/request`), a.length === 0 ? null : `${n.currency ?? "USD"} ${a.join(" · ")}`;
1368
1370
  }
1369
- function va(e) {
1371
+ function Da(e) {
1370
1372
  const { maxInputTokens: n, maxOutputTokens: a } = e.limits ?? {};
1371
1373
  if (n == null && a == null) return "—";
1372
1374
  const s = [];
1373
- return n != null && s.push(`${Pe(n)} in`), a != null && s.push(`${Pe(a)} out`), s.join(" · ");
1375
+ return n != null && s.push(`${je(n)} in`), a != null && s.push(`${je(a)} out`), s.join(" · ");
1374
1376
  }
1375
- const Na = [
1377
+ const xa = [
1376
1378
  {
1377
1379
  key: "model",
1378
1380
  header: "Model",
@@ -1401,7 +1403,7 @@ const Na = [
1401
1403
  key: "rate",
1402
1404
  header: "Rate (per 1M tokens)",
1403
1405
  render: (e) => {
1404
- const n = ya(e.currentRate);
1406
+ const n = $a(e.currentRate);
1405
1407
  return n == null ? /* @__PURE__ */ t("span", { className: "muted small", children: "—" }) : /* @__PURE__ */ t(
1406
1408
  "span",
1407
1409
  {
@@ -1415,17 +1417,17 @@ const Na = [
1415
1417
  {
1416
1418
  key: "limits",
1417
1419
  header: "Limits",
1418
- render: (e) => /* @__PURE__ */ t("span", { className: "muted small", children: va(e) })
1420
+ render: (e) => /* @__PURE__ */ t("span", { className: "muted small", children: Da(e) })
1419
1421
  }
1420
1422
  ];
1421
- function wi(e) {
1422
- var l;
1423
- const n = pe(), a = e.filter ?? ga, s = Je({
1424
- queryKey: kn(a),
1423
+ function ki(e) {
1424
+ var o;
1425
+ const n = ge(), a = e.filter ?? Ta, s = Ge({
1426
+ queryKey: Ln(a),
1425
1427
  initialPageParam: void 0,
1426
- getNextPageParam: (o) => o.nextCursor ?? void 0,
1427
- queryFn: ({ pageParam: o }) => bn(n, o ? { ...a, cursor: o } : a)
1428
- }), i = ((l = s.data) == null ? void 0 : l.pages.flatMap((o) => o.models)) ?? [];
1428
+ getNextPageParam: (l) => l.nextCursor ?? void 0,
1429
+ queryFn: ({ pageParam: l }) => xn(n, l ? { ...a, cursor: l } : a)
1430
+ }), i = ((o = s.data) == null ? void 0 : o.pages.flatMap((l) => l.models)) ?? [];
1429
1431
  return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ r("section", { className: "section", children: [
1430
1432
  /* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ r("div", { children: [
1431
1433
  /* @__PURE__ */ t("h3", { children: "Model catalog" }),
@@ -1436,13 +1438,13 @@ function wi(e) {
1436
1438
  s.error != null && /* @__PURE__ */ t("div", { className: "error", children: s.error.message }),
1437
1439
  s.isSuccess && i.length === 0 && /* @__PURE__ */ t(De, { testId: "model-catalog-empty", children: "No models yet. Discover them from a provider connection to start routing to them." }),
1438
1440
  i.length > 0 && /* @__PURE__ */ t(
1439
- $e,
1441
+ xe,
1440
1442
  {
1441
- columns: Na,
1443
+ columns: xa,
1442
1444
  rows: i,
1443
- rowKey: (o) => o.id,
1445
+ rowKey: (l) => l.id,
1444
1446
  testId: "model-catalog-table",
1445
- rowTestId: (o) => `model-catalog-${o.id}`
1447
+ rowTestId: (l) => `model-catalog-${l.id}`
1446
1448
  }
1447
1449
  )
1448
1450
  ] }),
@@ -1459,27 +1461,27 @@ function wi(e) {
1459
1461
  ) })
1460
1462
  ] }) });
1461
1463
  }
1462
- const ba = {};
1463
- function W(e) {
1464
+ const La = {};
1465
+ function B(e) {
1464
1466
  return String(e).replace(/\B(?=(\d{3})+(?!\d))/g, ",");
1465
1467
  }
1466
- function ka(e) {
1468
+ function Ea(e) {
1467
1469
  return `${e.currency} ${(e.amountMinor / 100).toFixed(2)}`;
1468
1470
  }
1469
- function Ca(e, n) {
1470
- return e.length > 0 ? e.map(ka).join(" · ") : n > 0 ? "unpriced" : "—";
1471
+ function Ia(e, n) {
1472
+ return e.length > 0 ? e.map(Ea).join(" · ") : n > 0 ? "unpriced" : "—";
1471
1473
  }
1472
- function Da(e) {
1474
+ function Ma(e) {
1473
1475
  return e.costMinor == null ? null : `${e.currency ?? "USD"} ${(e.costMinor / 100).toFixed(2)}`;
1474
1476
  }
1475
- function $a(e) {
1477
+ function Aa(e) {
1476
1478
  return e.totalsTruncated === !0;
1477
1479
  }
1478
- const Ta = [
1480
+ const Ra = [
1479
1481
  {
1480
1482
  key: "occurredAt",
1481
1483
  header: "When",
1482
- render: (e) => /* @__PURE__ */ t("span", { className: "muted small", title: e.occurredAt, children: at(e.occurredAt) })
1484
+ render: (e) => /* @__PURE__ */ t("span", { className: "muted small", title: e.occurredAt, children: lt(e.occurredAt) })
1483
1485
  },
1484
1486
  {
1485
1487
  key: "model",
@@ -1506,8 +1508,8 @@ const Ta = [
1506
1508
  "span",
1507
1509
  {
1508
1510
  className: "muted small",
1509
- title: `${W(e.inputTokens)} in · ${W(e.outputTokens)} out · ${W(e.cachedInputTokens)} cached input · ${W(e.cacheWriteTokens)} cache write`,
1510
- children: W(e.totalTokens)
1511
+ title: `${B(e.inputTokens)} in · ${B(e.outputTokens)} out · ${B(e.cachedInputTokens)} cached input · ${B(e.cacheWriteTokens)} cache write`,
1512
+ children: B(e.totalTokens)
1511
1513
  }
1512
1514
  )
1513
1515
  },
@@ -1516,7 +1518,7 @@ const Ta = [
1516
1518
  header: "Cost",
1517
1519
  align: "right",
1518
1520
  render: (e) => {
1519
- const n = Da(e);
1521
+ const n = Ma(e);
1520
1522
  return n == null ? /* @__PURE__ */ t("span", { className: "tag warn", "data-testid": "model-usage-unpriced", title: "no usable rate", children: "unpriced" }) : /* @__PURE__ */ t("span", { className: "muted small", children: n });
1521
1523
  }
1522
1524
  },
@@ -1524,10 +1526,10 @@ const Ta = [
1524
1526
  key: "result",
1525
1527
  header: "Result",
1526
1528
  render: (e) => {
1527
- const n = it(e.durationMs);
1529
+ const n = ot(e.durationMs);
1528
1530
  return /* @__PURE__ */ r("span", { className: "muted small", title: e.errorCode ?? void 0, children: [
1529
1531
  /* @__PURE__ */ t("span", { className: e.ok ? "tag" : "tag warn", children: e.ok ? "ok" : e.errorCode ?? "failed" }),
1530
- n != null && /* @__PURE__ */ r(Q, { children: [
1532
+ n != null && /* @__PURE__ */ r(K, { children: [
1531
1533
  " · ",
1532
1534
  n
1533
1535
  ] })
@@ -1535,52 +1537,52 @@ const Ta = [
1535
1537
  }
1536
1538
  }
1537
1539
  ];
1538
- function pi(e) {
1539
- var h, N;
1540
- const n = G(e.projectId), a = pe(), s = e.filter ?? ba, i = Je({
1541
- queryKey: Dn(n ?? void 0, s),
1540
+ function Ci(e) {
1541
+ var h, v;
1542
+ const n = X(e.projectId), a = ge(), s = e.filter ?? La, i = Ge({
1543
+ queryKey: In(n ?? void 0, s),
1542
1544
  enabled: n != null,
1543
1545
  initialPageParam: void 0,
1544
- getNextPageParam: (u) => u.nextCursor ?? void 0,
1545
- queryFn: ({ pageParam: u }) => Cn(
1546
+ getNextPageParam: (w) => w.nextCursor ?? void 0,
1547
+ queryFn: ({ pageParam: w }) => En(
1546
1548
  a,
1547
1549
  n,
1548
- u ? { ...s, cursor: u } : s
1550
+ w ? { ...s, cursor: w } : s
1549
1551
  )
1550
- }), l = ((h = i.data) == null ? void 0 : h.pages) ?? [], o = (N = l[0]) == null ? void 0 : N.totals, c = l.flatMap((u) => u.items), d = l.length > 0 && $a(l[0]);
1552
+ }), o = ((h = i.data) == null ? void 0 : h.pages) ?? [], l = (v = o[0]) == null ? void 0 : v.totals, d = o.flatMap((w) => w.items), u = o.length > 0 && Aa(o[0]);
1551
1553
  return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ r("section", { className: "section", children: [
1552
1554
  /* @__PURE__ */ t("div", { className: "section-head", children: /* @__PURE__ */ r("div", { children: [
1553
1555
  /* @__PURE__ */ t("h3", { children: "Model usage" }),
1554
1556
  /* @__PURE__ */ t("p", { className: "muted small", children: "Every model call this project paid for, priced with the rate card in force when it ran. A call with no usable rate counts as unpriced, not as free." })
1555
1557
  ] }) }),
1556
- n == null ? /* @__PURE__ */ t("div", { className: "card", children: /* @__PURE__ */ t("p", { className: "muted", "data-testid": "model-usage-no-project", children: "Select a project to see its model usage." }) }) : /* @__PURE__ */ r(Q, { children: [
1558
+ n == null ? /* @__PURE__ */ t("div", { className: "card", children: /* @__PURE__ */ t("p", { className: "muted", "data-testid": "model-usage-no-project", children: "Select a project to see its model usage." }) }) : /* @__PURE__ */ r(K, { children: [
1557
1559
  /* @__PURE__ */ r("div", { className: "card", "data-testid": "model-usage-totals", children: [
1558
- d && /* @__PURE__ */ t("p", { className: "result warn", "data-testid": "model-usage-totals-partial", children: "Totals are partial: they cover a bounded scan of this window, not every matching call. Narrow the range for exact totals." }),
1559
- o == null ? (
1560
+ u && /* @__PURE__ */ t("p", { className: "result warn", "data-testid": "model-usage-totals-partial", children: "Totals are partial: they cover a bounded scan of this window, not every matching call. Narrow the range for exact totals." }),
1561
+ l == null ? (
1560
1562
  // A failed query is reported once, below — never as a perpetual "loading".
1561
1563
  i.error == null && /* @__PURE__ */ t("p", { className: "muted", children: "Loading totals…" })
1562
1564
  ) : /* @__PURE__ */ r("p", { className: "muted small", children: [
1563
1565
  /* @__PURE__ */ r("span", { "data-testid": "model-usage-total-requests", children: [
1564
- W(o.requests),
1566
+ B(l.requests),
1565
1567
  " requests"
1566
1568
  ] }),
1567
1569
  " · ",
1568
1570
  /* @__PURE__ */ r("span", { "data-testid": "model-usage-total-tokens", children: [
1569
- W(o.totalTokens),
1571
+ B(l.totalTokens),
1570
1572
  " tokens (",
1571
- W(o.inputTokens),
1573
+ B(l.inputTokens),
1572
1574
  " in /",
1573
1575
  " ",
1574
- W(o.outputTokens),
1576
+ B(l.outputTokens),
1575
1577
  " out / ",
1576
- W(o.cachedInputTokens),
1578
+ B(l.cachedInputTokens),
1577
1579
  " cached / ",
1578
- W(o.cacheWriteTokens),
1580
+ B(l.cacheWriteTokens),
1579
1581
  " cache write)"
1580
1582
  ] }),
1581
1583
  " · ",
1582
- /* @__PURE__ */ t("span", { "data-testid": "model-usage-total-cost", children: Ca(o.cost, o.unpriced) }),
1583
- o.unpriced > 0 && /* @__PURE__ */ r(Q, { children: [
1584
+ /* @__PURE__ */ t("span", { "data-testid": "model-usage-total-cost", children: Ia(l.cost, l.unpriced) }),
1585
+ l.unpriced > 0 && /* @__PURE__ */ r(K, { children: [
1584
1586
  " · ",
1585
1587
  /* @__PURE__ */ r(
1586
1588
  "span",
@@ -1589,7 +1591,7 @@ function pi(e) {
1589
1591
  "data-testid": "model-usage-unpriced-total",
1590
1592
  title: "calls with no usable rate — not included in any cost total",
1591
1593
  children: [
1592
- W(o.unpriced),
1594
+ B(l.unpriced),
1593
1595
  " unpriced"
1594
1596
  ]
1595
1597
  }
@@ -1600,15 +1602,15 @@ function pi(e) {
1600
1602
  i.error != null && /* @__PURE__ */ t("div", { className: "error", role: "alert", "data-testid": "model-usage-error", children: i.error.message }),
1601
1603
  /* @__PURE__ */ r("div", { children: [
1602
1604
  i.isLoading && /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }),
1603
- i.isSuccess && c.length === 0 && /* @__PURE__ */ t(De, { testId: "model-usage-empty", children: "No model calls in this window. Usage rows appear here as routes are invoked." }),
1604
- c.length > 0 && /* @__PURE__ */ t(
1605
- $e,
1605
+ i.isSuccess && d.length === 0 && /* @__PURE__ */ t(De, { testId: "model-usage-empty", children: "No model calls in this window. Usage rows appear here as routes are invoked." }),
1606
+ d.length > 0 && /* @__PURE__ */ t(
1607
+ xe,
1606
1608
  {
1607
- columns: Ta,
1608
- rows: c,
1609
- rowKey: (u) => u.id,
1609
+ columns: Ra,
1610
+ rows: d,
1611
+ rowKey: (w) => w.id,
1610
1612
  testId: "model-usage-table",
1611
- rowTestId: (u) => `model-usage-${u.id}`
1613
+ rowTestId: (w) => `model-usage-${w.id}`
1612
1614
  }
1613
1615
  )
1614
1616
  ] }),
@@ -1626,42 +1628,171 @@ function pi(e) {
1626
1628
  ] })
1627
1629
  ] }) });
1628
1630
  }
1629
- const La = (e) => `${e} connection${e === 1 ? "" : "s"}`;
1630
- function fi({ contract: e, onOpen: n, slots: a }) {
1631
- const s = $n(e ? { contract: e } : void 0), i = s.data ?? [];
1631
+ const Sa = (e) => `${e} connection${e === 1 ? "" : "s"}`;
1632
+ function Ti({ contract: e, onOpen: n, onCreate: a, slots: s }) {
1633
+ const i = Mn(e ? { contract: e } : void 0), o = Le(), l = (i.data ?? []).filter((h) => !h.private), d = (h) => {
1634
+ var v, w;
1635
+ return ((w = (v = o.data) == null ? void 0 : v.find((b) => b.id === h)) == null ? void 0 : w.label) ?? h;
1636
+ }, u = a && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", onClick: a, children: "Add credential" });
1632
1637
  return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-cred-list", children: [
1633
- (a == null ? void 0 : a.header) ?? /* @__PURE__ */ t("h2", { children: "Credentials" }),
1634
- s.isLoading && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
1635
- s.error && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", children: s.error.message }),
1636
- !s.isLoading && !s.error && i.length === 0 && /* @__PURE__ */ t("div", { "data-testid": "credential-list-empty", children: (a == null ? void 0 : a.empty) ?? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No credentials yet." }) }),
1637
- /* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Credentials", children: i.map((l) => {
1638
- const o = Object.values(l.display)[0];
1638
+ /* @__PURE__ */ r("div", { className: "w6w-connection-list-head", "data-testid": "credential-list-header", children: [
1639
+ /* @__PURE__ */ t("div", { className: "w6w-connection-list-heading", children: (s == null ? void 0 : s.header) ?? /* @__PURE__ */ t("h2", { children: "Credentials" }) }),
1640
+ u && /* @__PURE__ */ t("div", { className: "w6w-connection-list-actions", children: u })
1641
+ ] }),
1642
+ i.isLoading && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
1643
+ i.error && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", children: i.error.message }),
1644
+ !i.isLoading && !i.error && l.length === 0 && /* @__PURE__ */ t("div", { "data-testid": "credential-list-empty", children: (s == null ? void 0 : s.empty) ?? /* @__PURE__ */ r(K, { children: [
1645
+ /* @__PURE__ */ t("p", { className: "w6w-muted", children: "No credentials yet." }),
1646
+ u
1647
+ ] }) }),
1648
+ /* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Credentials", children: l.map((h) => {
1649
+ const v = Object.values(h.display)[0];
1639
1650
  return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ r(
1640
1651
  "button",
1641
1652
  {
1642
1653
  type: "button",
1643
1654
  className: "w6w-embed-conn-action",
1644
- "data-testid": `credential-row-${l.id}`,
1645
- onClick: () => n == null ? void 0 : n(l.id),
1655
+ "data-testid": `credential-row-${h.id}`,
1656
+ onClick: () => n == null ? void 0 : n(h.id),
1646
1657
  children: [
1647
- /* @__PURE__ */ t("strong", { children: l.name }),
1658
+ /* @__PURE__ */ t("strong", { children: h.name }),
1648
1659
  " ",
1649
- /* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: l.status }),
1650
- o !== void 0 && /* @__PURE__ */ r("span", { className: "w6w-muted w6w-small", children: [
1660
+ /* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: h.status }),
1661
+ /* @__PURE__ */ r("span", { className: "w6w-muted w6w-small", "data-testid": `credential-type-${h.id}`, children: [
1662
+ " ",
1663
+ d(h.contract)
1664
+ ] }),
1665
+ v !== void 0 && /* @__PURE__ */ r("span", { className: "w6w-muted w6w-small", children: [
1651
1666
  " ",
1652
- o
1667
+ v
1653
1668
  ] }),
1654
1669
  /* @__PURE__ */ r("span", { className: "w6w-muted w6w-small", children: [
1655
1670
  " · ",
1656
- La(l.connectionCount)
1671
+ Sa(h.connectionCount)
1657
1672
  ] })
1658
1673
  ]
1659
1674
  }
1660
- ) }, l.id);
1675
+ ) }, h.id);
1661
1676
  }) })
1662
1677
  ] });
1663
1678
  }
1664
- function Ma(e) {
1679
+ function wt({
1680
+ fields: e,
1681
+ values: n,
1682
+ onChange: a,
1683
+ idPrefix: s
1684
+ }) {
1685
+ return /* @__PURE__ */ t(K, { children: e.map((i) => {
1686
+ const o = {
1687
+ className: i.secret ? "w6w-input w6w-secret-input" : "w6w-input",
1688
+ value: n[i.key] ?? "",
1689
+ name: `${s}-${i.key}`,
1690
+ autoComplete: "off",
1691
+ autoCapitalize: "off",
1692
+ autoCorrect: "off",
1693
+ spellCheck: !1,
1694
+ "data-1p-ignore": "true",
1695
+ "data-lpignore": "true",
1696
+ "data-bwignore": "true",
1697
+ "data-form-type": "other"
1698
+ };
1699
+ return i.multiline ? /* @__PURE__ */ r("label", { className: "w6w-field", children: [
1700
+ /* @__PURE__ */ t("span", { children: i.label }),
1701
+ /* @__PURE__ */ t("textarea", { rows: 5, ...o, onChange: (l) => a(i.key, l.target.value) })
1702
+ ] }, i.key) : /* @__PURE__ */ r("label", { className: "w6w-field", children: [
1703
+ /* @__PURE__ */ t("span", { children: i.label }),
1704
+ /* @__PURE__ */ t("input", { type: "text", ...o, onChange: (l) => a(i.key, l.target.value) })
1705
+ ] }, i.key);
1706
+ }) });
1707
+ }
1708
+ const pt = (e, n) => e.every((a) => (n[a.key] ?? "").length > 0), ft = (e, n) => Object.fromEntries(e.map((a) => [a.key, n[a.key] ?? ""]));
1709
+ function $i({ onCreated: e, onCancel: n }) {
1710
+ const a = Le(), s = An(), [i, o] = f(null), [l, d] = f(""), [u, h] = f({}), [v, w] = f(null), b = a.data ?? [], N = b.find((m) => m.id === i) ?? b[0], $ = (m) => {
1711
+ o(m), h({}), w(null);
1712
+ }, g = () => {
1713
+ if (!N || s.isPending) return;
1714
+ if (l.trim() === "") {
1715
+ w("Give the credential a name.");
1716
+ return;
1717
+ }
1718
+ if (!pt(N.fields, u)) {
1719
+ w("Fill in every field.");
1720
+ return;
1721
+ }
1722
+ w(null);
1723
+ const m = {
1724
+ name: l.trim(),
1725
+ contract: N.id,
1726
+ source: ft(N.fields, u)
1727
+ };
1728
+ h({}), s.mutate(m, {
1729
+ onSuccess: (y) => {
1730
+ s.reset(), e == null || e(y.id);
1731
+ },
1732
+ onError: (y) => {
1733
+ s.reset(), w(et(y, "create"));
1734
+ }
1735
+ });
1736
+ };
1737
+ return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-cred-create", "data-testid": "credential-create", children: [
1738
+ /* @__PURE__ */ t("h2", { children: "Add credential" }),
1739
+ a.isLoading && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
1740
+ a.error && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", "data-testid": "credential-types-error", children: "Could not load the credential types." }),
1741
+ N && /* @__PURE__ */ r(
1742
+ "form",
1743
+ {
1744
+ className: "w6w-card-stack",
1745
+ onSubmit: (m) => {
1746
+ m.preventDefault(), g();
1747
+ },
1748
+ children: [
1749
+ /* @__PURE__ */ r("label", { className: "w6w-field", children: [
1750
+ /* @__PURE__ */ t("span", { children: "Type" }),
1751
+ /* @__PURE__ */ t(
1752
+ "select",
1753
+ {
1754
+ value: N.id,
1755
+ "aria-label": "Credential type",
1756
+ onChange: (m) => $(m.target.value),
1757
+ children: b.map((m) => /* @__PURE__ */ t("option", { value: m.id, children: m.label }, m.id))
1758
+ }
1759
+ )
1760
+ ] }),
1761
+ /* @__PURE__ */ r("label", { className: "w6w-field", children: [
1762
+ /* @__PURE__ */ t("span", { children: "Name" }),
1763
+ /* @__PURE__ */ t(
1764
+ "input",
1765
+ {
1766
+ type: "text",
1767
+ className: "w6w-input",
1768
+ value: l,
1769
+ onChange: (m) => d(m.target.value),
1770
+ maxLength: 120,
1771
+ autoComplete: "off"
1772
+ }
1773
+ )
1774
+ ] }),
1775
+ /* @__PURE__ */ t(
1776
+ wt,
1777
+ {
1778
+ fields: N.fields,
1779
+ values: u,
1780
+ onChange: (m, y) => h((D) => ({ ...D, [m]: y })),
1781
+ idPrefix: "w6w-cred-create"
1782
+ }
1783
+ ),
1784
+ v && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", "data-testid": "credential-create-error", children: v }),
1785
+ /* @__PURE__ */ r("div", { className: "w6w-modal-actions", children: [
1786
+ /* @__PURE__ */ t("button", { type: "submit", className: "w6w-btn", disabled: s.isPending, children: s.isPending ? "Creating…" : "Create credential" }),
1787
+ n && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: n, children: "Cancel" })
1788
+ ] })
1789
+ ]
1790
+ }
1791
+ )
1792
+ ] });
1793
+ }
1794
+ const Ke = "google-service-account.v1";
1795
+ function Pa(e) {
1665
1796
  try {
1666
1797
  const n = JSON.parse(e);
1667
1798
  return n !== null && typeof n == "object" && !Array.isArray(n) ? n : null;
@@ -1669,105 +1800,137 @@ function Ma(e) {
1669
1800
  return null;
1670
1801
  }
1671
1802
  }
1672
- const Oe = (e) => Number.isNaN(Date.parse(e)) ? e : new Date(e).toLocaleString();
1673
- function gi({
1803
+ const Fe = (e) => Number.isNaN(Date.parse(e)) ? e : new Date(e).toLocaleString();
1804
+ function Di(e) {
1805
+ return /* @__PURE__ */ t(Oa, { ...e }, e.credentialId);
1806
+ }
1807
+ function Oa({
1674
1808
  credentialId: e,
1675
1809
  onOpenConnection: n,
1676
1810
  onDeleted: a,
1677
1811
  onBack: s,
1678
1812
  slots: i
1679
1813
  }) {
1680
- var E, I;
1681
- const l = Tn(e), o = Ln(e), c = Mn(e), d = xn(e), h = In(e), N = En(), [u, k] = f(""), [b, D] = f(null), [g, w] = f(!1), [y, x] = f(null), [S, $] = f(null), [T, j] = f(!1), [P, A] = f(null), [R, F] = f(null), H = s && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: s, children: "← Credentials" });
1682
- if (l.isLoading)
1814
+ var ee, de, re;
1815
+ const o = Rn(e), l = Sn(e), d = Pn(e), u = On(e), h = jn(e), v = Kn(), w = Le(), [b, N] = f(""), [$, g] = f({}), [m, y] = f(null), [D, E] = f(!1), [x, k] = f(null), [Q, j] = f(null), [R, A] = f(!1), [P, H] = f(null), [I, J] = f(null), q = s && /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn w6w-btn-ghost", onClick: s, children: "← Credentials" });
1816
+ if (o.isLoading)
1683
1817
  return /* @__PURE__ */ t("div", { className: "w6w-embed-root w6w-embed-cred-detail", children: /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }) });
1684
- const L = l.data;
1685
- if (!L)
1818
+ const S = o.data;
1819
+ if (!S)
1686
1820
  return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-cred-detail", "data-testid": "credential-not-found", children: [
1687
1821
  (i == null ? void 0 : i.empty) ?? /* @__PURE__ */ t("h2", { children: "Credential not found" }),
1688
- H
1822
+ q
1689
1823
  ] });
1690
- const J = ((E = o.data) == null ? void 0 : E.connections) ?? [], K = L.connectionCount, B = L.status === "disabled", Y = () => {
1691
- w(!1);
1692
- const C = Ma(u);
1693
- if (!C) {
1694
- D("Enter the new secret as a JSON object.");
1824
+ const U = ((ee = l.data) == null ? void 0 : ee.connections) ?? [], _ = S.connectionCount, p = S.status === "disabled", L = S.contract === Ke || (de = w.data) == null ? void 0 : de.find((c) => c.id === S.contract), M = S.contract !== Ke && w.isLoading, z = () => {
1825
+ if (!L) return;
1826
+ if (E(!1), !pt(L.fields, $)) {
1827
+ y("Fill in every field.");
1828
+ return;
1829
+ }
1830
+ y(null);
1831
+ const c = ft(L.fields, $);
1832
+ g({}), d.mutate(
1833
+ { source: c },
1834
+ {
1835
+ onSuccess: () => {
1836
+ d.reset(), E(!0);
1837
+ },
1838
+ onError: (T) => {
1839
+ d.reset(), y(et(T, "rotate"));
1840
+ }
1841
+ }
1842
+ );
1843
+ }, C = () => {
1844
+ E(!1);
1845
+ const c = Pa(b);
1846
+ if (!c) {
1847
+ y("Enter the new secret as a JSON object.");
1695
1848
  return;
1696
1849
  }
1697
- D(null), c.mutate(
1698
- { source: C },
1850
+ y(null), d.mutate(
1851
+ { source: c },
1699
1852
  {
1700
1853
  onSuccess: () => {
1701
- k(""), w(!0);
1854
+ N(""), E(!0);
1702
1855
  },
1703
- onError: (v) => D((v == null ? void 0 : v.message) ?? "Rotate failed.")
1856
+ onError: (T) => y((T == null ? void 0 : T.message) ?? "Rotate failed.")
1704
1857
  }
1705
1858
  );
1706
- }, U = () => {
1707
- x(null), $(null), h.mutate(void 0, {
1708
- onSuccess: x,
1709
- onError: (C) => $((C == null ? void 0 : C.message) ?? "Test failed.")
1859
+ }, O = () => {
1860
+ k(null), j(null), h.mutate(void 0, {
1861
+ onSuccess: k,
1862
+ onError: (c) => j((c == null ? void 0 : c.message) ?? "Test failed.")
1710
1863
  });
1711
- }, p = () => {
1712
- F(null), N.mutate(e, {
1713
- onSuccess: (C) => {
1714
- j(!1), C.ok ? a == null || a() : A(C.dependents.connections);
1864
+ }, G = () => {
1865
+ J(null), v.mutate(e, {
1866
+ onSuccess: (c) => {
1867
+ A(!1), c.ok ? a == null || a() : H(c.dependents.connections);
1715
1868
  },
1716
- onError: (C) => F((C == null ? void 0 : C.message) ?? "Delete failed.")
1869
+ onError: (c) => J((c == null ? void 0 : c.message) ?? "Delete failed.")
1717
1870
  });
1718
1871
  };
1719
1872
  return /* @__PURE__ */ r("div", { className: "w6w-embed-root w6w-embed-cred-detail w6w-card-stack", children: [
1720
1873
  /* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
1721
- /* @__PURE__ */ t("h2", { children: L.name }),
1874
+ /* @__PURE__ */ t("h2", { children: S.name }),
1722
1875
  /* @__PURE__ */ r("p", { className: "w6w-small", children: [
1723
- /* @__PURE__ */ t("code", { children: L.contract }),
1876
+ /* @__PURE__ */ t("code", { children: S.contract }),
1724
1877
  " ",
1725
- /* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: L.status })
1878
+ /* @__PURE__ */ t("span", { className: "w6w-embed-conn-badge", children: S.status })
1726
1879
  ] }),
1727
- /* @__PURE__ */ t("dl", { className: "w6w-small", "data-testid": "credential-display", children: Object.entries(L.display).map(([C, v]) => /* @__PURE__ */ r("div", { children: [
1728
- /* @__PURE__ */ t("dt", { className: "w6w-muted", children: C }),
1729
- /* @__PURE__ */ t("dd", { children: v })
1730
- ] }, C)) }),
1880
+ /* @__PURE__ */ t("dl", { className: "w6w-small", "data-testid": "credential-display", children: Object.entries(S.display).map(([c, T]) => /* @__PURE__ */ r("div", { children: [
1881
+ /* @__PURE__ */ t("dt", { className: "w6w-muted", children: c }),
1882
+ /* @__PURE__ */ t("dd", { children: T })
1883
+ ] }, c)) }),
1731
1884
  /* @__PURE__ */ r("p", { className: "w6w-muted w6w-small", children: [
1732
- K,
1885
+ _,
1733
1886
  " connection",
1734
- K === 1 ? "" : "s",
1887
+ _ === 1 ? "" : "s",
1735
1888
  " · created ",
1736
- Oe(L.createdAt),
1889
+ Fe(S.createdAt),
1737
1890
  " · updated",
1738
1891
  " ",
1739
- Oe(L.updatedAt)
1892
+ Fe(S.updatedAt)
1740
1893
  ] }),
1741
- H
1894
+ q
1742
1895
  ] }),
1743
1896
  /* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", "data-testid": "credential-connections", children: [
1744
1897
  /* @__PURE__ */ t("h3", { children: "Connected apps" }),
1745
- J.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Not used by any connection." }) : /* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Connected apps", children: J.map((C) => /* @__PURE__ */ t("li", { children: n ? /* @__PURE__ */ t(
1898
+ U.length === 0 ? /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Not used by any connection." }) : /* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", "aria-label": "Connected apps", children: U.map((c) => /* @__PURE__ */ t("li", { children: n ? /* @__PURE__ */ t(
1746
1899
  "button",
1747
1900
  {
1748
1901
  type: "button",
1749
1902
  className: "w6w-embed-conn-action",
1750
- onClick: () => n(C.id),
1751
- children: C.displayName || C.appId
1903
+ onClick: () => n(c.id),
1904
+ children: c.displayName || c.appId
1752
1905
  }
1753
- ) : /* @__PURE__ */ t("span", { children: C.displayName || C.appId }) }, C.id)) })
1906
+ ) : /* @__PURE__ */ t("span", { children: c.displayName || c.appId }) }, c.id)) })
1754
1907
  ] }),
1755
1908
  /* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
1756
1909
  /* @__PURE__ */ t("h3", { children: "Rotate secret" }),
1757
1910
  /* @__PURE__ */ r("p", { className: "w6w-muted w6w-small", "data-testid": "credential-rotation-impact", children: [
1758
- K,
1911
+ _,
1759
1912
  " connection",
1760
- K === 1 ? "" : "s",
1913
+ _ === 1 ? "" : "s",
1761
1914
  " will be marked untested"
1762
1915
  ] }),
1763
- /* @__PURE__ */ t(
1916
+ M && /* @__PURE__ */ t("p", { className: "w6w-muted", children: "Loading…" }),
1917
+ L && /* @__PURE__ */ t(
1918
+ wt,
1919
+ {
1920
+ fields: L.fields,
1921
+ values: $,
1922
+ onChange: (c, T) => g((F) => ({ ...F, [c]: T })),
1923
+ idPrefix: "w6w-cred-rotate"
1924
+ }
1925
+ ),
1926
+ !M && !L && /* @__PURE__ */ t(
1764
1927
  "textarea",
1765
1928
  {
1766
1929
  className: "w6w-input w6w-secret-input",
1767
1930
  "aria-label": "New secret (JSON object)",
1768
1931
  rows: 5,
1769
- value: u,
1770
- onChange: (C) => k(C.target.value),
1932
+ value: b,
1933
+ onChange: (c) => N(c.target.value),
1771
1934
  name: "w6w-cred-rotate",
1772
1935
  autoComplete: "off",
1773
1936
  autoCapitalize: "off",
@@ -1779,9 +1942,18 @@ function gi({
1779
1942
  "data-form-type": "other"
1780
1943
  }
1781
1944
  ),
1782
- b && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", "data-testid": "credential-rotate-error", children: b }),
1783
- g && /* @__PURE__ */ t("output", { children: "Secret rotated." }),
1784
- /* @__PURE__ */ t("button", { type: "button", className: "w6w-btn", disabled: c.isPending, onClick: Y, children: c.isPending ? "Rotating…" : "Rotate" })
1945
+ m && /* @__PURE__ */ t("p", { className: "w6w-error", role: "alert", "data-testid": "credential-rotate-error", children: m }),
1946
+ D && /* @__PURE__ */ t("output", { children: "Secret rotated." }),
1947
+ /* @__PURE__ */ t(
1948
+ "button",
1949
+ {
1950
+ type: "button",
1951
+ className: "w6w-btn",
1952
+ disabled: d.isPending || M,
1953
+ onClick: L ? z : C,
1954
+ children: d.isPending ? "Rotating…" : "Rotate"
1955
+ }
1956
+ )
1785
1957
  ] }),
1786
1958
  /* @__PURE__ */ r("div", { className: "w6w-embed-conn-card", children: [
1787
1959
  /* @__PURE__ */ t("h3", { children: "Manage" }),
@@ -1791,9 +1963,9 @@ function gi({
1791
1963
  {
1792
1964
  type: "button",
1793
1965
  className: "w6w-btn w6w-btn-ghost",
1794
- disabled: d.isPending,
1795
- onClick: () => d.mutate(B ? "active" : "disabled"),
1796
- children: B ? "Enable" : "Disable"
1966
+ disabled: u.isPending,
1967
+ onClick: () => u.mutate(p ? "active" : "disabled"),
1968
+ children: p ? "Enable" : "Disable"
1797
1969
  }
1798
1970
  ),
1799
1971
  /* @__PURE__ */ t(
@@ -1802,7 +1974,7 @@ function gi({
1802
1974
  type: "button",
1803
1975
  className: "w6w-btn w6w-btn-ghost",
1804
1976
  disabled: h.isPending,
1805
- onClick: U,
1977
+ onClick: O,
1806
1978
  children: h.isPending ? "Testing…" : "Test credential"
1807
1979
  }
1808
1980
  ),
@@ -1812,19 +1984,19 @@ function gi({
1812
1984
  type: "button",
1813
1985
  className: "w6w-btn w6w-btn-danger",
1814
1986
  onClick: () => {
1815
- A(null), j(!0);
1987
+ H(null), A(!0);
1816
1988
  },
1817
1989
  children: "Delete"
1818
1990
  }
1819
1991
  )
1820
1992
  ] }),
1821
- y && /* @__PURE__ */ t("output", { "data-testid": "credential-test-result", children: y.ok ? "ok" : y.code ?? "failed" }),
1822
- S && /* @__PURE__ */ t("p", { role: "alert", children: S }),
1823
- d.isError && /* @__PURE__ */ t("p", { role: "alert", children: ((I = d.error) == null ? void 0 : I.message) ?? "Update failed." }),
1824
- T && /* @__PURE__ */ r("div", { "data-testid": "credential-delete-confirm", children: [
1993
+ x && /* @__PURE__ */ t("output", { "data-testid": "credential-test-result", children: x.ok ? "ok" : x.code ?? "failed" }),
1994
+ Q && /* @__PURE__ */ t("p", { role: "alert", children: Q }),
1995
+ u.isError && /* @__PURE__ */ t("p", { role: "alert", children: ((re = u.error) == null ? void 0 : re.message) ?? "Update failed." }),
1996
+ R && /* @__PURE__ */ r("div", { "data-testid": "credential-delete-confirm", children: [
1825
1997
  /* @__PURE__ */ r("p", { className: "w6w-small", children: [
1826
1998
  'Delete the credential "',
1827
- L.name,
1999
+ S.name,
1828
2000
  '"? This cannot be undone.'
1829
2001
  ] }),
1830
2002
  /* @__PURE__ */ t(
@@ -1832,8 +2004,8 @@ function gi({
1832
2004
  {
1833
2005
  type: "button",
1834
2006
  className: "w6w-btn w6w-btn-danger",
1835
- disabled: N.isPending,
1836
- onClick: p,
2007
+ disabled: v.isPending,
2008
+ onClick: G,
1837
2009
  children: "Confirm delete"
1838
2010
  }
1839
2011
  ),
@@ -1843,7 +2015,7 @@ function gi({
1843
2015
  {
1844
2016
  type: "button",
1845
2017
  className: "w6w-btn w6w-btn-ghost",
1846
- onClick: () => j(!1),
2018
+ onClick: () => A(!1),
1847
2019
  children: "Cancel"
1848
2020
  }
1849
2021
  )
@@ -1856,341 +2028,341 @@ function gi({
1856
2028
  P.length === 1 ? "" : "s",
1857
2029
  ". Delete those integrations first, or rotate this credential instead of deleting it."
1858
2030
  ] }),
1859
- /* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", children: P.map((C) => /* @__PURE__ */ t("li", { children: C.displayName || C.appId }, C.id)) })
2031
+ /* @__PURE__ */ t("ul", { className: "w6w-embed-conn-list", children: P.map((c) => /* @__PURE__ */ t("li", { children: c.displayName || c.appId }, c.id)) })
1860
2032
  ] }),
1861
- R && /* @__PURE__ */ t("p", { role: "alert", children: R })
2033
+ I && /* @__PURE__ */ t("p", { role: "alert", children: I })
1862
2034
  ] })
1863
2035
  ] });
1864
2036
  }
1865
2037
  function V(e) {
1866
- const n = xt(e), a = e == null ? void 0 : e.code;
2038
+ const n = Pt(e), a = e == null ? void 0 : e.code;
1867
2039
  return n.code === void 0 && typeof a == "string" && a !== "" ? { ...n, code: a } : n;
1868
2040
  }
1869
- const je = 80;
1870
- function xa(e, n) {
2041
+ const Qe = 80;
2042
+ function ja(e, n) {
1871
2043
  if (typeof URL > "u" || typeof URL.createObjectURL != "function") return;
1872
2044
  const a = URL.createObjectURL(new Blob([n], { type: "text/csv" })), s = document.createElement("a");
1873
2045
  s.href = a, s.download = e, s.click(), URL.revokeObjectURL(a);
1874
2046
  }
1875
- function Ia({ store: e, project: n }) {
1876
- var Me;
1877
- const a = It(e), s = (a == null ? void 0 : a.columns) ?? [], i = (a == null ? void 0 : a.key) ?? "", [l, o] = f(""), [c, d] = f({}), [h, N] = f({}), [u, k] = f({}), [b, D] = f({}), [g, w] = f(null), [y, x] = f(null), [S, $] = f(null), T = pe(), j = we(), P = Ze(e.id, n, l), A = Ge(), R = Rn(), F = Xe(), H = Sn(), L = Pn(), J = (((Me = P.data) == null ? void 0 : Me.pages.flatMap((m) => m.items)) ?? []).map(
1878
- (m) => b[m.key] ?? m
1879
- ), K = new Map(J.map((m) => [m.key, m])), B = [], Y = (m) => c[m], U = Y(te), p = (m, M, q) => {
1880
- const Z = q === void 0 ? null : ce(q, s);
1881
- B.push({
1882
- id: m,
1883
- isNew: m === te,
1884
- cells: M.cells,
1885
- version: M.version,
1886
- dirty: Z === null ? !0 : Ot(M, Z, s).length > 0,
1887
- conflict: u[m] === !0,
1888
- cellErrors: h[m]
2047
+ function Ka({ store: e, project: n }) {
2048
+ var re;
2049
+ const a = Ot(e), s = (a == null ? void 0 : a.columns) ?? [], i = (a == null ? void 0 : a.key) ?? "", [o, l] = f(""), [d, u] = f({}), [h, v] = f({}), [w, b] = f({}), [N, $] = f({}), [g, m] = f(null), [y, D] = f(null), [E, x] = f(null), k = ge(), Q = fe(), j = tt(e.id, n, o), R = nt(), A = Qn(), P = at(), H = qn(), I = _n(), J = (((re = j.data) == null ? void 0 : re.pages.flatMap((c) => c.items)) ?? []).map(
2050
+ (c) => N[c.key] ?? c
2051
+ ), q = new Map(J.map((c) => [c.key, c])), S = [], U = (c) => d[c], _ = U(ne), p = (c, T, F) => {
2052
+ const Z = F === void 0 ? null : ue(F, s);
2053
+ S.push({
2054
+ id: c,
2055
+ isNew: c === ne,
2056
+ cells: T.cells,
2057
+ version: T.version,
2058
+ dirty: Z === null ? !0 : _t(T, Z, s).length > 0,
2059
+ conflict: w[c] === !0,
2060
+ cellErrors: h[c]
1889
2061
  });
1890
2062
  };
1891
- U !== void 0 && p(te, U, void 0);
1892
- for (const m of J)
1893
- p(m.key, Y(m.key) ?? ce(m, s), m);
1894
- const E = (m) => {
1895
- N((M) => ne(M, m)), k((M) => ne(M, m));
1896
- }, I = (m) => {
1897
- d((M) => ne(M, m)), E(m);
2063
+ _ !== void 0 && p(ne, _, void 0);
2064
+ for (const c of J)
2065
+ p(c.key, U(c.key) ?? ue(c, s), c);
2066
+ const L = (c) => {
2067
+ v((T) => ae(T, c)), b((T) => ae(T, c));
2068
+ }, M = (c) => {
2069
+ u((T) => ae(T, c)), L(c);
1898
2070
  };
1899
- function C(m, M, q) {
1900
- const Z = K.get(m), z = Y(m) ?? (Z ? ce(Z, s) : xe(s));
1901
- d((_) => ({ ..._, [m]: { ...z, cells: { ...z.cells, [M]: q } } })), N((_) => {
1902
- const ee = _[m];
1903
- if (ee === void 0 || !(M in ee)) return _;
1904
- const se = ne(ee, M);
1905
- return Object.keys(se).length === 0 ? ne(_, m) : { ..._, [m]: se };
2071
+ function z(c, T, F) {
2072
+ const Z = q.get(c), Y = U(c) ?? (Z ? ue(Z, s) : Me(s));
2073
+ u((W) => ({ ...W, [c]: { ...Y, cells: { ...Y.cells, [T]: F } } })), v((W) => {
2074
+ const te = W[c];
2075
+ if (te === void 0 || !(T in te)) return W;
2076
+ const le = ae(te, T);
2077
+ return Object.keys(le).length === 0 ? ae(W, c) : { ...W, [c]: le };
1906
2078
  });
1907
2079
  }
1908
- async function v(m) {
1909
- const M = K.get(m), q = Y(m) ?? (M ? ce(M, s) : void 0);
1910
- if (q === void 0) return;
1911
- w(null), E(m);
1912
- const Z = Kt(q, s);
2080
+ async function C(c) {
2081
+ const T = q.get(c), F = U(c) ?? (T ? ue(T, s) : void 0);
2082
+ if (F === void 0) return;
2083
+ m(null), L(c);
2084
+ const Z = Bt(F, s);
1913
2085
  if (!Z.ok) {
1914
- N((_) => ({ ..._, [m]: Z.errors }));
2086
+ v((W) => ({ ...W, [c]: Z.errors }));
1915
2087
  return;
1916
2088
  }
1917
- const z = Qt(
1918
- q,
2089
+ const Y = Ut(
2090
+ F,
1919
2091
  Z.value,
1920
- We((M == null ? void 0 : M.expiresAt) ?? null, Date.now())
2092
+ Ve((T == null ? void 0 : T.expiresAt) ?? null, Date.now())
1921
2093
  );
1922
2094
  try {
1923
- z.kind === "insert" ? await R.mutateAsync({
2095
+ Y.kind === "insert" ? await A.mutateAsync({
1924
2096
  id: e.id,
1925
- row: z.value,
1926
- ttlSeconds: z.ttlSeconds,
2097
+ row: Y.value,
2098
+ ttlSeconds: Y.ttlSeconds,
1927
2099
  project: n
1928
- }) : await A.mutateAsync({
2100
+ }) : await R.mutateAsync({
1929
2101
  id: e.id,
1930
- key: z.key,
1931
- value: z.value,
1932
- ifVersion: z.ifVersion,
1933
- ttlSeconds: z.ttlSeconds,
2102
+ key: Y.key,
2103
+ value: Y.value,
2104
+ ifVersion: Y.ifVersion,
2105
+ ttlSeconds: Y.ttlSeconds,
1934
2106
  project: n
1935
- }), D((_) => ne(_, m)), I(m);
1936
- } catch (_) {
1937
- const ee = V(_);
1938
- if (Be(ee)) {
1939
- k((fe) => ({ ...fe, [m]: !0 }));
2107
+ }), $((W) => ae(W, c)), M(c);
2108
+ } catch (W) {
2109
+ const te = V(W);
2110
+ if (He(te)) {
2111
+ b((ye) => ({ ...ye, [c]: !0 }));
1940
2112
  return;
1941
2113
  }
1942
- const se = Ft(ee, s);
1943
- if (se !== null) {
1944
- N((fe) => ({ ...fe, [m]: se }));
2114
+ const le = Vt(te, s);
2115
+ if (le !== null) {
2116
+ v((ye) => ({ ...ye, [c]: le }));
1945
2117
  return;
1946
2118
  }
1947
- w(ee.message);
2119
+ m(te.message);
1948
2120
  }
1949
2121
  }
1950
- async function O(m) {
2122
+ async function O(c) {
1951
2123
  try {
1952
- const M = await et(T, e.id, m, n);
1953
- D((q) => ({ ...q, [m]: M })), I(m), await j.invalidateQueries({ queryKey: ["data-stores"] });
1954
- } catch (M) {
1955
- w(V(M).message);
2124
+ const T = await it(k, e.id, c, n);
2125
+ $((F) => ({ ...F, [c]: T })), M(c), await Q.invalidateQueries({ queryKey: ["data-stores"] });
2126
+ } catch (T) {
2127
+ m(V(T).message);
1956
2128
  }
1957
2129
  }
1958
- function X() {
1959
- const m = y;
1960
- x(null), m !== null && (m !== te && F.mutate({ id: e.id, key: m, project: n }), I(m));
2130
+ function G() {
2131
+ const c = y;
2132
+ D(null), c !== null && (c !== ne && P.mutate({ id: e.id, key: c, project: n }), M(c));
1961
2133
  }
1962
- async function oe(m) {
1963
- $(null);
2134
+ async function ee(c) {
2135
+ x(null);
1964
2136
  try {
1965
- const M = await H.mutateAsync({ id: e.id, csv: await m.text(), project: n });
1966
- $(Ie({ status: 200, text: JSON.stringify(M) }));
1967
- } catch (M) {
1968
- const q = M;
1969
- $(
1970
- typeof q.status == "number" ? Ie({ status: q.status, text: JSON.stringify(q.raw ?? null) }) : { ok: !1, message: V(M).message }
2137
+ const T = await H.mutateAsync({ id: e.id, csv: await c.text(), project: n });
2138
+ x(Ae({ status: 200, text: JSON.stringify(T) }));
2139
+ } catch (T) {
2140
+ const F = T;
2141
+ x(
2142
+ typeof F.status == "number" ? Ae({ status: F.status, text: JSON.stringify(F.raw ?? null) }) : { ok: !1, message: V(T).message }
1971
2143
  );
1972
2144
  }
1973
2145
  }
1974
- async function dt() {
2146
+ async function de() {
1975
2147
  try {
1976
- const m = await L.mutateAsync({ id: e.id, project: n });
1977
- xa(jt(null, e.name), m), $(null);
1978
- } catch (m) {
1979
- $({ ok: !1, message: V(m).message });
2148
+ const c = await I.mutateAsync({ id: e.id, project: n });
2149
+ ja(Wt(null, e.name), c), x(null);
2150
+ } catch (c) {
2151
+ x({ ok: !1, message: V(c).message });
1980
2152
  }
1981
2153
  }
1982
2154
  return /* @__PURE__ */ r("div", { children: [
1983
2155
  /* @__PURE__ */ t(
1984
- Et,
2156
+ jt,
1985
2157
  {
1986
- result: S,
1987
- busy: L.isPending,
1988
- onImport: oe,
1989
- onRefuse: (m) => $({ ok: !1, message: m }),
1990
- onExport: dt
2158
+ result: E,
2159
+ busy: I.isPending,
2160
+ onImport: ee,
2161
+ onRefuse: (c) => x({ ok: !1, message: c }),
2162
+ onExport: de
1991
2163
  }
1992
2164
  ),
1993
2165
  /* @__PURE__ */ t(
1994
- At,
2166
+ Kt,
1995
2167
  {
1996
2168
  columns: s,
1997
2169
  keyColumn: i,
1998
- rows: B,
2170
+ rows: S,
1999
2171
  error: g,
2000
- loading: P.isPending,
2001
- hasMore: P.hasNextPage,
2172
+ loading: j.isPending,
2173
+ hasMore: j.hasNextPage,
2002
2174
  empty: /* @__PURE__ */ t("p", { className: "muted small", children: "No rows match this key prefix." }),
2003
- onCellChange: C,
2004
- onSave: (m) => void v(m),
2005
- onDelete: x,
2006
- onReload: (m) => void O(m),
2175
+ onCellChange: z,
2176
+ onSave: (c) => void C(c),
2177
+ onDelete: D,
2178
+ onReload: (c) => void O(c),
2007
2179
  onAddRow: () => {
2008
- te in c || (d((m) => ({ ...m, [te]: xe(s) })), w(null));
2180
+ ne in d || (u((c) => ({ ...c, [ne]: Me(s) })), m(null));
2009
2181
  },
2010
- onLoadMore: () => void P.fetchNextPage(),
2011
- onSearch: o
2182
+ onLoadMore: () => void j.fetchNextPage(),
2183
+ onSearch: l
2012
2184
  }
2013
2185
  ),
2014
2186
  y !== null && /* @__PURE__ */ t(
2015
- he,
2187
+ pe,
2016
2188
  {
2017
2189
  title: "Delete entry",
2018
- message: y === te ? "Discard this unsaved row?" : `Delete "${y}"? This cannot be undone.`,
2190
+ message: y === ne ? "Discard this unsaved row?" : `Delete "${y}"? This cannot be undone.`,
2019
2191
  confirmLabel: "Delete",
2020
- onConfirm: X,
2021
- onClose: () => x(null)
2192
+ onConfirm: G,
2193
+ onClose: () => D(null)
2022
2194
  }
2023
2195
  )
2024
2196
  ] });
2025
2197
  }
2026
- function Ea({ store: e, project: n }) {
2027
- var C;
2028
- const a = e.kind === "doc", s = Rt(e), [i, l] = f(""), [o, c] = f(null), [d, h] = f(!1), [N, u] = f(""), [k, b] = f(""), [D, g] = f(null), [w, y] = f(!1), [x, S] = f({}), [$, T] = f(null), j = pe(), P = we(), A = Ze(e.id, n, i), R = Ge(), F = Xe(), H = (((C = A.data) == null ? void 0 : C.pages.flatMap((v) => v.items)) ?? []).map(
2029
- (v) => x[v.key] ?? v
2030
- ), L = o === null ? void 0 : H.find((v) => v.key === o), J = d || o !== null, K = (v) => a ? JSON.stringify(v.value ?? null, null, 2) : Wt(s, v.value), B = (v) => {
2031
- const O = K(v).replace(/\s+/g, " ");
2032
- return O.length > je ? `${O.slice(0, je)}…` : O;
2198
+ function Fa({ store: e, project: n }) {
2199
+ var z;
2200
+ const a = e.kind === "doc", s = Ft(e), [i, o] = f(""), [l, d] = f(null), [u, h] = f(!1), [v, w] = f(""), [b, N] = f(""), [$, g] = f(null), [m, y] = f(!1), [D, E] = f({}), [x, k] = f(null), Q = ge(), j = fe(), R = tt(e.id, n, i), A = nt(), P = at(), H = (((z = R.data) == null ? void 0 : z.pages.flatMap((C) => C.items)) ?? []).map(
2201
+ (C) => D[C.key] ?? C
2202
+ ), I = l === null ? void 0 : H.find((C) => C.key === l), J = u || l !== null, q = (C) => a ? JSON.stringify(C.value ?? null, null, 2) : Yt(s, C.value), S = (C) => {
2203
+ const O = q(C).replace(/\s+/g, " ");
2204
+ return O.length > Qe ? `${O.slice(0, Qe)}…` : O;
2033
2205
  };
2034
- function Y(v) {
2035
- c(v.key), h(!1), b(K(v)), g(null), y(!1);
2206
+ function U(C) {
2207
+ d(C.key), h(!1), N(q(C)), g(null), y(!1);
2036
2208
  }
2037
- function U() {
2038
- c(null), h(!1), u(""), b(""), g(null), y(!1);
2209
+ function _() {
2210
+ d(null), h(!1), w(""), N(""), g(null), y(!1);
2039
2211
  }
2040
2212
  async function p() {
2041
2213
  g(null), y(!1);
2042
- const v = a ? qt(k) : _t(s, k);
2043
- if (!v.ok) {
2044
- g(v.message);
2214
+ const C = a ? Ht(b) : Jt(s, b);
2215
+ if (!C.ok) {
2216
+ g(C.message);
2045
2217
  return;
2046
2218
  }
2047
- const O = d ? N.trim() : o;
2219
+ const O = u ? v.trim() : l;
2048
2220
  if (O === null || O === "") {
2049
2221
  g("Enter a key.");
2050
2222
  return;
2051
2223
  }
2052
2224
  try {
2053
- await R.mutateAsync({
2225
+ await A.mutateAsync({
2054
2226
  id: e.id,
2055
2227
  key: O,
2056
- value: v.value,
2228
+ value: C.value,
2057
2229
  // A new entry must not exist yet; an existing one is guarded by the version loaded.
2058
- ifVersion: d ? 0 : (L == null ? void 0 : L.version) ?? 0,
2059
- ttlSeconds: d ? void 0 : We((L == null ? void 0 : L.expiresAt) ?? null, Date.now()),
2230
+ ifVersion: u ? 0 : (I == null ? void 0 : I.version) ?? 0,
2231
+ ttlSeconds: u ? void 0 : Ve((I == null ? void 0 : I.expiresAt) ?? null, Date.now()),
2060
2232
  project: n
2061
- }), S((X) => ne(X, O)), U();
2062
- } catch (X) {
2063
- const oe = V(X);
2064
- Be(oe) ? y(!0) : g(oe.message);
2233
+ }), E((G) => ae(G, O)), _();
2234
+ } catch (G) {
2235
+ const ee = V(G);
2236
+ He(ee) ? y(!0) : g(ee.message);
2065
2237
  }
2066
2238
  }
2067
- async function E() {
2068
- if (o !== null)
2239
+ async function L() {
2240
+ if (l !== null)
2069
2241
  try {
2070
- const v = await et(j, e.id, o, n);
2071
- S((O) => ({ ...O, [o]: v })), b(K(v)), y(!1), g(null), await P.invalidateQueries({ queryKey: ["data-stores"] });
2072
- } catch (v) {
2073
- g(V(v).message);
2242
+ const C = await it(Q, e.id, l, n);
2243
+ E((O) => ({ ...O, [l]: C })), N(q(C)), y(!1), g(null), await j.invalidateQueries({ queryKey: ["data-stores"] });
2244
+ } catch (C) {
2245
+ g(V(C).message);
2074
2246
  }
2075
2247
  }
2076
- async function I() {
2077
- const v = $;
2078
- if (T(null), v !== null)
2248
+ async function M() {
2249
+ const C = x;
2250
+ if (k(null), C !== null)
2079
2251
  try {
2080
- await F.mutateAsync({ id: e.id, key: v, project: n }), v === o && U();
2252
+ await P.mutateAsync({ id: e.id, key: C, project: n }), C === l && _();
2081
2253
  } catch (O) {
2082
2254
  g(V(O).message);
2083
2255
  }
2084
2256
  }
2085
2257
  return /* @__PURE__ */ r("div", { children: [
2086
2258
  /* @__PURE__ */ t(
2087
- St,
2259
+ Qt,
2088
2260
  {
2089
- rows: H.map((v) => ({ key: v.key, version: v.version, preview: B(v) })),
2090
- loading: A.isPending,
2261
+ rows: H.map((C) => ({ key: C.key, version: C.version, preview: S(C) })),
2262
+ loading: R.isPending,
2091
2263
  empty: /* @__PURE__ */ t("p", { className: "muted small", children: "No entries match this key prefix." }),
2092
- hasMore: A.hasNextPage,
2093
- onOpen: (v) => {
2094
- const O = H.find((X) => X.key === v);
2095
- O && Y(O);
2264
+ hasMore: R.hasNextPage,
2265
+ onOpen: (C) => {
2266
+ const O = H.find((G) => G.key === C);
2267
+ O && U(O);
2096
2268
  },
2097
- onSearch: l,
2269
+ onSearch: o,
2098
2270
  onNew: () => {
2099
- c(null), h(!0), u(""), b(""), g(null), y(!1);
2271
+ d(null), h(!0), w(""), N(""), g(null), y(!1);
2100
2272
  },
2101
- onLoadMore: () => void A.fetchNextPage()
2273
+ onLoadMore: () => void R.fetchNextPage()
2102
2274
  }
2103
2275
  ),
2104
2276
  J && /* @__PURE__ */ t(
2105
- Pt,
2277
+ qt,
2106
2278
  {
2107
2279
  kind: a ? "doc" : "kv",
2108
- isNew: d,
2109
- entryKey: o ?? void 0,
2110
- newKey: N,
2111
- version: (L == null ? void 0 : L.version) ?? null,
2112
- expiresAt: (L == null ? void 0 : L.expiresAt) ?? null,
2113
- text: k,
2114
- error: D,
2115
- conflict: w,
2116
- saving: R.isPending || F.isPending,
2117
- onDelete: d ? void 0 : () => T(o),
2118
- onTextChange: (v) => {
2119
- b(v), g(null);
2280
+ isNew: u,
2281
+ entryKey: l ?? void 0,
2282
+ newKey: v,
2283
+ version: (I == null ? void 0 : I.version) ?? null,
2284
+ expiresAt: (I == null ? void 0 : I.expiresAt) ?? null,
2285
+ text: b,
2286
+ error: $,
2287
+ conflict: m,
2288
+ saving: A.isPending || P.isPending,
2289
+ onDelete: u ? void 0 : () => k(l),
2290
+ onTextChange: (C) => {
2291
+ N(C), g(null);
2120
2292
  },
2121
- onKeyChange: u,
2293
+ onKeyChange: w,
2122
2294
  onSave: () => void p(),
2123
- onCancel: U,
2124
- onReload: () => void E()
2295
+ onCancel: _,
2296
+ onReload: () => void L()
2125
2297
  }
2126
2298
  ),
2127
- $ !== null && /* @__PURE__ */ t(
2128
- he,
2299
+ x !== null && /* @__PURE__ */ t(
2300
+ pe,
2129
2301
  {
2130
2302
  title: "Delete entry",
2131
- message: `Delete "${$}"? This cannot be undone.`,
2303
+ message: `Delete "${x}"? This cannot be undone.`,
2132
2304
  confirmLabel: "Delete",
2133
- onConfirm: I,
2134
- onClose: () => T(null)
2305
+ onConfirm: M,
2306
+ onClose: () => k(null)
2135
2307
  }
2136
2308
  )
2137
2309
  ] });
2138
2310
  }
2139
- function ne(e, n) {
2311
+ function ae(e, n) {
2140
2312
  if (!(n in e)) return e;
2141
2313
  const a = { ...e };
2142
2314
  return delete a[n], a;
2143
2315
  }
2144
- function yi({ id: e, project: n, slots: a }) {
2145
- const s = G(n), i = An(e, s ?? void 0), l = i.data;
2146
- let o;
2147
- s == null ? o = /* @__PURE__ */ t("p", { className: "muted", children: "No project selected." }) : i.isError ? o = /* @__PURE__ */ t("p", { className: "result error", children: V(i.error).message }) : l === void 0 ? o = /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : l.kind === "table" ? o = /* @__PURE__ */ t(Ia, { store: l, project: s }, l.id) : o = /* @__PURE__ */ t(Ea, { store: l, project: s }, l.id);
2148
- const c = (a == null ? void 0 : a.header) === void 0 ? l && /* @__PURE__ */ r("div", { children: [
2149
- /* @__PURE__ */ t("h3", { children: l.name }),
2316
+ function xi({ id: e, project: n, slots: a }) {
2317
+ const s = X(n), i = Fn(e, s ?? void 0), o = i.data;
2318
+ let l;
2319
+ s == null ? l = /* @__PURE__ */ t("p", { className: "muted", children: "No project selected." }) : i.isError ? l = /* @__PURE__ */ t("p", { className: "result error", children: V(i.error).message }) : o === void 0 ? l = /* @__PURE__ */ t("p", { className: "muted", children: "Loading…" }) : o.kind === "table" ? l = /* @__PURE__ */ t(Ka, { store: o, project: s }, o.id) : l = /* @__PURE__ */ t(Fa, { store: o, project: s }, o.id);
2320
+ const d = (a == null ? void 0 : a.header) === void 0 ? o && /* @__PURE__ */ r("div", { children: [
2321
+ /* @__PURE__ */ t("h3", { children: o.name }),
2150
2322
  /* @__PURE__ */ r("p", { className: "muted small", children: [
2151
- l.kind,
2323
+ o.kind,
2152
2324
  " · ",
2153
- l.entryCount,
2325
+ o.entryCount,
2154
2326
  " ",
2155
- l.entryCount === 1 ? "entry" : "entries"
2327
+ o.entryCount === 1 ? "entry" : "entries"
2156
2328
  ] })
2157
2329
  ] }) : a.header;
2158
2330
  return /* @__PURE__ */ t("div", { className: "w6w-embed-root", children: /* @__PURE__ */ r("section", { className: "section", children: [
2159
- c,
2160
- o
2331
+ d,
2332
+ l
2161
2333
  ] }) });
2162
2334
  }
2163
- const Aa = ["name", "kind", "description", "schema"];
2164
- function Ra(e) {
2165
- const [n, a] = f(""), [s, i] = f(""), [l, o] = f("kv"), [c, d] = f("string"), [h, N] = f([]), [u, k] = f(""), [b, D] = f({}), [g, w] = f({}), [y, x] = f(null), S = Kn();
2166
- function $() {
2167
- D({}), w({}), x(null);
2168
- const T = {
2169
- kind: l,
2335
+ const Qa = ["name", "kind", "description", "schema"];
2336
+ function qa(e) {
2337
+ const [n, a] = f(""), [s, i] = f(""), [o, l] = f("kv"), [d, u] = f("string"), [h, v] = f([]), [w, b] = f(""), [N, $] = f({}), [g, m] = f({}), [y, D] = f(null), E = Un();
2338
+ function x() {
2339
+ $({}), m({}), D(null);
2340
+ const k = {
2341
+ kind: o,
2170
2342
  name: n
2171
2343
  };
2172
- l === "kv" && (T.schema = { valueType: c }), l === "table" && (T.schema = u === "" ? { columns: h } : { columns: h, key: u }), s !== "" && (T.description = s), S.mutate(
2344
+ o === "kv" && (k.schema = { valueType: d }), o === "table" && (k.schema = w === "" ? { columns: h } : { columns: h, key: w }), s !== "" && (k.description = s), E.mutate(
2173
2345
  // The SDK's create body types `schema` as table columns only; the wire takes the S-2 shape
2174
2346
  // per kind, so the kv `{valueType}` schema is passed through as the host defines it.
2175
- { input: T, project: e.project },
2347
+ { input: k, project: e.project },
2176
2348
  {
2177
2349
  onSuccess: () => e.onClose(),
2178
- onError: (j) => {
2179
- const P = V(j), A = Yt(P);
2180
- if (A.kind === "cell" && h.some((R) => R.name === A.column)) {
2181
- w({ [A.column]: P.message });
2350
+ onError: (Q) => {
2351
+ const j = V(Q), R = tn(j);
2352
+ if (R.kind === "cell" && h.some((A) => A.name === R.column)) {
2353
+ m({ [R.column]: j.message });
2182
2354
  return;
2183
2355
  }
2184
- if (A.kind === "field" && Aa.includes(A.field)) {
2185
- D({ [A.field]: P.message });
2356
+ if (R.kind === "field" && Qa.includes(R.field)) {
2357
+ $({ [R.field]: j.message });
2186
2358
  return;
2187
2359
  }
2188
- x(P.message);
2360
+ D(j.message);
2189
2361
  }
2190
2362
  }
2191
2363
  );
2192
2364
  }
2193
- return /* @__PURE__ */ r(dn, { title: "New data store", onClose: e.onClose, children: [
2365
+ return /* @__PURE__ */ r(fn, { title: "New data store", onClose: e.onClose, children: [
2194
2366
  /* @__PURE__ */ r("div", { className: "modal-body", children: [
2195
2367
  /* @__PURE__ */ r("label", { className: "field", children: [
2196
2368
  /* @__PURE__ */ t("span", { children: "Name" }),
@@ -2200,12 +2372,12 @@ function Ra(e) {
2200
2372
  type: "text",
2201
2373
  "data-testid": "data-store-name",
2202
2374
  value: n,
2203
- onChange: (T) => a(T.target.value),
2375
+ onChange: (k) => a(k.target.value),
2204
2376
  placeholder: "e.g. counters"
2205
2377
  }
2206
2378
  )
2207
2379
  ] }),
2208
- b.name !== void 0 && /* @__PURE__ */ t("div", { className: "result error", "data-testid": "data-store-field-error-name", children: b.name }),
2380
+ N.name !== void 0 && /* @__PURE__ */ t("div", { className: "result error", "data-testid": "data-store-field-error-name", children: N.name }),
2209
2381
  /* @__PURE__ */ r("label", { className: "field", children: [
2210
2382
  /* @__PURE__ */ t("span", { children: "Description" }),
2211
2383
  /* @__PURE__ */ t(
@@ -2213,7 +2385,7 @@ function Ra(e) {
2213
2385
  {
2214
2386
  type: "text",
2215
2387
  value: s,
2216
- onChange: (T) => i(T.target.value),
2388
+ onChange: (k) => i(k.target.value),
2217
2389
  placeholder: "What this store holds"
2218
2390
  }
2219
2391
  )
@@ -2224,31 +2396,31 @@ function Ra(e) {
2224
2396
  "select",
2225
2397
  {
2226
2398
  "data-testid": "data-store-kind",
2227
- value: l,
2228
- onChange: (T) => {
2229
- o(T.target.value), k("");
2399
+ value: o,
2400
+ onChange: (k) => {
2401
+ l(k.target.value), b("");
2230
2402
  },
2231
- children: Ut.map((T) => /* @__PURE__ */ t("option", { value: T, children: Vt[T] }, T))
2403
+ children: Gt.map((k) => /* @__PURE__ */ t("option", { value: k, children: Zt[k] }, k))
2232
2404
  }
2233
2405
  ),
2234
2406
  /* @__PURE__ */ t("span", { className: "hint", children: "The kind is fixed once the store exists." })
2235
2407
  ] }),
2236
- b.kind !== void 0 && /* @__PURE__ */ t("div", { className: "result error", children: b.kind }),
2237
- l === "kv" && /* @__PURE__ */ r("label", { className: "field", children: [
2408
+ N.kind !== void 0 && /* @__PURE__ */ t("div", { className: "result error", children: N.kind }),
2409
+ o === "kv" && /* @__PURE__ */ r("label", { className: "field", children: [
2238
2410
  /* @__PURE__ */ t("span", { children: "Value type" }),
2239
- /* @__PURE__ */ t("select", { value: c, onChange: (T) => d(T.target.value), children: Ht.map((T) => /* @__PURE__ */ t("option", { value: T, children: T }, T)) })
2411
+ /* @__PURE__ */ t("select", { value: d, onChange: (k) => u(k.target.value), children: Xt.map((k) => /* @__PURE__ */ t("option", { value: k, children: k }, k)) })
2240
2412
  ] }),
2241
- l === "table" && /* @__PURE__ */ t(
2242
- Jt,
2413
+ o === "table" && /* @__PURE__ */ t(
2414
+ en,
2243
2415
  {
2244
2416
  columns: h,
2245
- onChange: N,
2246
- keyColumn: u,
2247
- onKeyColumnChange: k,
2417
+ onChange: v,
2418
+ keyColumn: w,
2419
+ onKeyColumnChange: b,
2248
2420
  columnErrors: g
2249
2421
  }
2250
2422
  ),
2251
- b.schema !== void 0 && /* @__PURE__ */ t("div", { className: "result error", children: b.schema }),
2423
+ N.schema !== void 0 && /* @__PURE__ */ t("div", { className: "result error", children: N.schema }),
2252
2424
  y !== null && /* @__PURE__ */ t("div", { className: "result error", "data-testid": "data-store-form-error", children: y })
2253
2425
  ] }),
2254
2426
  /* @__PURE__ */ r("div", { className: "modal-actions", children: [
@@ -2259,34 +2431,34 @@ function Ra(e) {
2259
2431
  type: "button",
2260
2432
  className: "btn",
2261
2433
  "data-testid": "data-store-create",
2262
- disabled: S.isPending,
2263
- onClick: $,
2264
- children: S.isPending ? "Creating…" : "Create"
2434
+ disabled: E.isPending,
2435
+ onClick: x,
2436
+ children: E.isPending ? "Creating…" : "Create"
2265
2437
  }
2266
2438
  )
2267
2439
  ] })
2268
2440
  ] });
2269
2441
  }
2270
- function vi({ project: e, onOpen: n, getHref: a, slots: s }) {
2271
- const i = G(e), l = On(i ?? void 0), o = jn(), [c, d] = f(!1), [h, N] = f(null), [u, k] = f(null), b = (s == null ? void 0 : s.header) === void 0 ? /* @__PURE__ */ r("div", { children: [
2442
+ function Li({ project: e, onOpen: n, getHref: a, slots: s }) {
2443
+ const i = X(e), o = Wn(i ?? void 0), l = Bn(), [d, u] = f(!1), [h, v] = f(null), [w, b] = f(null), N = (s == null ? void 0 : s.header) === void 0 ? /* @__PURE__ */ r("div", { children: [
2272
2444
  /* @__PURE__ */ t("h3", { children: "Data stores" }),
2273
2445
  /* @__PURE__ */ t("p", { className: "muted small", children: "Key-value, document and table storage for this project." })
2274
2446
  ] }) : s.header;
2275
2447
  return /* @__PURE__ */ r("div", { className: "w6w-embed-root", children: [
2276
2448
  /* @__PURE__ */ t(
2277
- Bt,
2449
+ zt,
2278
2450
  {
2279
- stores: l.data ?? [],
2280
- loading: l.isLoading,
2281
- error: u ?? (l.error != null ? V(l.error).message : null),
2451
+ stores: o.data ?? [],
2452
+ loading: o.isLoading,
2453
+ error: w ?? (o.error != null ? V(o.error).message : null),
2282
2454
  onOpen: n,
2283
2455
  getHref: a,
2284
- onArchive: (D) => {
2285
- k(null), N(D);
2456
+ onArchive: ($) => {
2457
+ b(null), v($);
2286
2458
  },
2287
- busy: o.isPending,
2459
+ busy: l.isPending,
2288
2460
  slots: {
2289
- header: b,
2461
+ header: N,
2290
2462
  actions: /* @__PURE__ */ t(
2291
2463
  "button",
2292
2464
  {
@@ -2294,7 +2466,7 @@ function vi({ project: e, onOpen: n, getHref: a, slots: s }) {
2294
2466
  className: "btn",
2295
2467
  "data-testid": "data-store-new",
2296
2468
  disabled: i == null,
2297
- onClick: () => d(!0),
2469
+ onClick: () => u(!0),
2298
2470
  children: "+ New data store"
2299
2471
  }
2300
2472
  ),
@@ -2302,43 +2474,44 @@ function vi({ project: e, onOpen: n, getHref: a, slots: s }) {
2302
2474
  }
2303
2475
  }
2304
2476
  ),
2305
- c && i != null && /* @__PURE__ */ t(Ra, { project: i, onClose: () => d(!1) }),
2477
+ d && i != null && /* @__PURE__ */ t(qa, { project: i, onClose: () => u(!1) }),
2306
2478
  h && /* @__PURE__ */ t(
2307
- he,
2479
+ pe,
2308
2480
  {
2309
2481
  title: "Archive data store",
2310
2482
  message: `Archive "${h.name}" and its ${h.entryCount} ${h.entryCount === 1 ? "entry" : "entries"}? Workflows and the API can no longer reach it.`,
2311
2483
  confirmLabel: "Archive",
2312
2484
  onConfirm: () => {
2313
- const D = h;
2314
- N(null), i != null && o.mutate(
2315
- { id: D.id, project: i },
2316
- { onError: (g) => k(V(g).message) }
2485
+ const $ = h;
2486
+ v(null), i != null && l.mutate(
2487
+ { id: $.id, project: i },
2488
+ { onError: (g) => b(V(g).message) }
2317
2489
  );
2318
2490
  },
2319
- onClose: () => N(null)
2491
+ onClose: () => v(null)
2320
2492
  }
2321
2493
  )
2322
2494
  ] });
2323
2495
  }
2324
2496
  export {
2325
- ci as ActivitySummary,
2326
- hi as ConnectionDetail,
2327
- mi as ConnectionList,
2328
- gi as CredentialDetail,
2329
- fi as CredentialList,
2330
- vi as DataStoreList,
2331
- yi as DataStoreView,
2332
- oi as DocumentList,
2333
- si as EndpointList,
2334
- ii as FunctionList,
2335
- Zn as Logs,
2336
- di as LogsView,
2337
- wi as ModelCatalog,
2338
- pi as ModelUsage,
2339
- li as ReliabilityBoard,
2340
- zn as RunHistory,
2341
- ui as ServiceDetail,
2342
- ri as WorkflowList
2497
+ gi as ActivitySummary,
2498
+ bi as ConnectionDetail,
2499
+ Ni as ConnectionList,
2500
+ $i as CredentialCreate,
2501
+ Di as CredentialDetail,
2502
+ Ti as CredentialList,
2503
+ Li as DataStoreList,
2504
+ xi as DataStoreView,
2505
+ fi as DocumentList,
2506
+ hi as EndpointList,
2507
+ mi as FunctionList,
2508
+ ia as Logs,
2509
+ yi as LogsView,
2510
+ ki as ModelCatalog,
2511
+ Ci as ModelUsage,
2512
+ pi as ReliabilityBoard,
2513
+ aa as RunHistory,
2514
+ vi as ServiceDetail,
2515
+ wi as WorkflowList
2343
2516
  };
2344
2517
  //# sourceMappingURL=lists.mjs.map