@kukeon/console 0.0.0-stage → 0.10.0-edge.g21af9f59

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 (93) hide show
  1. package/dist/auth.d.ts +39 -0
  2. package/dist/bulk-ui.d.ts +49 -0
  3. package/dist/bulk.d.mts +14 -0
  4. package/dist/catalog-CBVxh9uQ.js +5005 -0
  5. package/dist/catalog-url-Dr9e92Yq.js +19 -0
  6. package/dist/catalog-url.d.mts +4 -0
  7. package/dist/catalog.d.ts +40 -0
  8. package/dist/cell-filter.d.ts +10 -0
  9. package/dist/cell-sidebar.d.ts +26 -0
  10. package/dist/cells.d.mts +29 -0
  11. package/dist/cgroup-format.d.ts +17 -0
  12. package/dist/cgroup.d.ts +4 -0
  13. package/dist/config-form.d.mts +66 -0
  14. package/dist/connector-ui-lYy-1M3l.js +2692 -0
  15. package/dist/connector-ui.d.ts +127 -0
  16. package/dist/connectors-page-Z7acjRvr.js +1460 -0
  17. package/dist/connectors-page.d.ts +14 -0
  18. package/dist/connectors.d.mts +153 -0
  19. package/dist/container-log.d.ts +11 -0
  20. package/dist/create.d.ts +11 -0
  21. package/dist/creation-schema.d.mts +15 -0
  22. package/dist/daemon.d.ts +24 -0
  23. package/dist/display-name.d.ts +10 -0
  24. package/dist/drift-diff.d.ts +4 -0
  25. package/dist/exec.d.ts +15 -0
  26. package/dist/extensions.d.ts +111 -0
  27. package/dist/get-started.d.ts +9 -0
  28. package/dist/health.d.ts +22 -0
  29. package/dist/image-format.d.ts +6 -0
  30. package/dist/image-inventory.d.ts +12 -0
  31. package/dist/images.d.ts +5 -0
  32. package/dist/index.d.ts +5 -0
  33. package/dist/index.js +5595 -0
  34. package/dist/initialize-CGmYWoaj.js +146 -0
  35. package/dist/initialize.d.ts +21 -0
  36. package/dist/inventory.d.ts +66 -0
  37. package/dist/lifecycle-policy.d.ts +11 -0
  38. package/dist/lifecycle.d.ts +24 -0
  39. package/dist/log-buffer.d.ts +8 -0
  40. package/dist/main.d.ts +13 -0
  41. package/dist/majordomo.d.ts +102 -0
  42. package/dist/manage-nav.d.ts +4 -0
  43. package/dist/manifest-diff.d.mts +11 -0
  44. package/dist/merged-values-BhW2-nlA.js +739 -0
  45. package/dist/merged-values.d.ts +24 -0
  46. package/dist/network-format.d.ts +30 -0
  47. package/dist/network.d.ts +13 -0
  48. package/dist/new-agent-24Fcf0PI.js +201 -0
  49. package/dist/new-agent.d.ts +27 -0
  50. package/dist/new-cell-u87hB9wV.js +1985 -0
  51. package/dist/new-cell.d.ts +29 -0
  52. package/dist/new-config-B_uf4R4e.js +1541 -0
  53. package/dist/new-config.d.ts +7 -0
  54. package/dist/notifications.d.ts +26 -0
  55. package/dist/onboarding-CPDpnS7K.js +395 -0
  56. package/dist/onboarding.d.mts +40 -0
  57. package/dist/panel-cells.d.mts +8 -0
  58. package/dist/registry-credentials.d.ts +13 -0
  59. package/dist/relationships.d.mts +12 -0
  60. package/dist/request.d.ts +16 -0
  61. package/dist/router.d.ts +12 -0
  62. package/dist/routes.d.ts +41 -0
  63. package/dist/schedule-B08uvsJe.js +113 -0
  64. package/dist/schedule-format.d.mts +9 -0
  65. package/dist/schedule.d.ts +16 -0
  66. package/dist/scope-actions.d.ts +9 -0
  67. package/dist/screens.d.ts +6 -0
  68. package/dist/secret-form.d.ts +24 -0
  69. package/dist/settings-nav.d.ts +5 -0
  70. package/dist/settings-page.d.ts +4 -0
  71. package/dist/settings-values.d.mts +18 -0
  72. package/dist/settings.d.ts +50 -0
  73. package/dist/sidebar-shell.d.ts +55 -0
  74. package/dist/sources-page-C4t29wxJ.js +423 -0
  75. package/dist/sources-page.d.ts +5 -0
  76. package/dist/space-subnets.d.ts +3 -0
  77. package/dist/style.css +2 -0
  78. package/dist/team-form.d.mts +56 -0
  79. package/dist/team-plan-CaBIrof0.js +735 -0
  80. package/dist/team-plan.d.ts +22 -0
  81. package/dist/team-wizard.d.ts +8 -0
  82. package/dist/teams-page-CLdQhhgo.js +2206 -0
  83. package/dist/teams-page.d.ts +9 -0
  84. package/dist/teams.d.mts +112 -0
  85. package/dist/terminal-palette.d.ts +8 -0
  86. package/dist/terminal.d.ts +98 -0
  87. package/dist/unread.d.mts +19 -0
  88. package/dist/use-unread.d.ts +4 -0
  89. package/dist/user-menu.d.ts +7 -0
  90. package/dist/views.d.mts +8 -0
  91. package/dist/workbench.d.ts +16 -0
  92. package/package.json +45 -4
  93. package/README.md +0 -3
@@ -0,0 +1,2206 @@
1
+ import { $ as e, An as t, Bn as n, J as r, M as i, O as a, Ot as o, S as s, St as c, U as l, Un as u, Y as d, Zt as f, at as p, et as m, ft as h, ot as g, st as _, tt as v, v as y, w as b, xt as ee } from "./connector-ui-lYy-1M3l.js";
2
+ import { r as x, t as te } from "./schedule-B08uvsJe.js";
3
+ import { A as S, C, D as w, E as T, M as E, N as D, O, S as k, T as A, _ as j, a as ne, b as re, c as ie, d as ae, f as M, g as oe, h as N, i as P, j as F, k as I, l as se, n as ce, o as L, p as le, r as ue, s as de, t as fe, u as pe, v as R, w as z, x as me, y as B } from "./team-plan-CaBIrof0.js";
4
+ import { t as V } from "./initialize-CGmYWoaj.js";
5
+ import { useEffect as H, useMemo as he, useRef as ge, useState as U } from "react";
6
+ import { Fragment as W, jsx as G, jsxs as K } from "react/jsx-runtime";
7
+ import { useModalDialog as _e } from "@kukeon/ui";
8
+ // src/team-wizard.tsx
9
+ function ve({ errors: e }) {
10
+ return e.length ? /* @__PURE__ */ G("ul", {
11
+ className: "setup-error",
12
+ "aria-label": "Step problems",
13
+ children: e.map((e) => /* @__PURE__ */ G("li", { children: e }, e))
14
+ }) : null;
15
+ }
16
+ function ye({ project: e, sources: t, draft: r, pending: i, error: a, onChange: o, onRead: s }) {
17
+ let c = t?.sources.find((t) => t.name === e.stored), l = N(e);
18
+ return /* @__PURE__ */ K("div", {
19
+ className: "wizard-step",
20
+ children: [
21
+ /* @__PURE__ */ K("fieldset", {
22
+ className: "schema-field wizard-choice",
23
+ children: [
24
+ /* @__PURE__ */ G("legend", { children: "The project" }),
25
+ /* @__PURE__ */ K("label", {
26
+ className: "schema-check",
27
+ children: [/* @__PURE__ */ G("input", {
28
+ type: "radio",
29
+ name: "project-mode",
30
+ checked: e.mode === "address",
31
+ disabled: i,
32
+ onChange: () => o({ mode: "address" })
33
+ }), "A repository address"]
34
+ }),
35
+ /* @__PURE__ */ K("label", {
36
+ className: "schema-check",
37
+ children: [/* @__PURE__ */ G("input", {
38
+ type: "radio",
39
+ name: "project-mode",
40
+ checked: e.mode === "stored",
41
+ disabled: i,
42
+ onChange: () => o({ mode: "stored" })
43
+ }), "A stored Source"]
44
+ }),
45
+ /* @__PURE__ */ K("label", {
46
+ className: "schema-check",
47
+ children: [/* @__PURE__ */ G("input", {
48
+ type: "radio",
49
+ name: "project-mode",
50
+ checked: e.mode === "file",
51
+ disabled: i,
52
+ onChange: () => o({ mode: "file" })
53
+ }), /* @__PURE__ */ K("span", { children: ["A pasted ", /* @__PURE__ */ G("code", { children: "kuketeam.yaml" })] })]
54
+ })
55
+ ]
56
+ }),
57
+ /* @__PURE__ */ K("div", {
58
+ className: "schema-fields",
59
+ children: [
60
+ e.mode === "address" && /* @__PURE__ */ K("label", {
61
+ className: "schema-field",
62
+ children: [/* @__PURE__ */ K("span", { children: ["Repository address", /* @__PURE__ */ G("b", {
63
+ "aria-label": "required",
64
+ children: " *"
65
+ })] }), /* @__PURE__ */ G("input", {
66
+ value: e.address,
67
+ disabled: i,
68
+ placeholder: "github.com/owner/repo",
69
+ spellCheck: !1,
70
+ onChange: (e) => o({ address: e.target.value })
71
+ })]
72
+ }),
73
+ e.mode === "stored" && /* @__PURE__ */ K("label", {
74
+ className: "schema-field",
75
+ children: [
76
+ /* @__PURE__ */ K("span", { children: ["Stored Source", /* @__PURE__ */ G("b", {
77
+ "aria-label": "required",
78
+ children: " *"
79
+ })] }),
80
+ /* @__PURE__ */ K("select", {
81
+ value: e.stored,
82
+ disabled: i,
83
+ onChange: (e) => o({ stored: e.target.value }),
84
+ children: [/* @__PURE__ */ G("option", {
85
+ value: "",
86
+ children: "Choose…"
87
+ }), t?.sources.map((e) => /* @__PURE__ */ K("option", {
88
+ value: e.name,
89
+ children: [
90
+ e.name,
91
+ " — ",
92
+ e.url
93
+ ]
94
+ }, e.name))]
95
+ }),
96
+ c && /* @__PURE__ */ K("small", { children: ["Identity: ", c.identity || "Default"] })
97
+ ]
98
+ }),
99
+ e.mode === "file" && /* @__PURE__ */ K("label", {
100
+ className: "schema-field team-yaml",
101
+ children: [
102
+ /* @__PURE__ */ K("span", { children: ["kuketeam.yaml", /* @__PURE__ */ G("b", {
103
+ "aria-label": "required",
104
+ children: " *"
105
+ })] }),
106
+ /* @__PURE__ */ G("textarea", {
107
+ value: e.file,
108
+ disabled: i,
109
+ spellCheck: !1,
110
+ placeholder: "apiVersion: v1beta1\nkind: Team\nmetadata:\n name: …\nspec:\n projectSource: {url: github.com/owner/repo}",
111
+ onChange: (e) => o({ file: e.target.value })
112
+ }),
113
+ /* @__PURE__ */ K("small", { children: [
114
+ "Its ",
115
+ /* @__PURE__ */ G("code", { children: "spec.projectSource.url" }),
116
+ " names the project."
117
+ ] })
118
+ ]
119
+ }),
120
+ e.mode !== "file" && /* @__PURE__ */ G(P, {
121
+ kind: e.refKind,
122
+ value: e.ref,
123
+ disabled: i,
124
+ onChange: (e, t) => o({
125
+ refKind: e,
126
+ ref: t
127
+ })
128
+ }),
129
+ e.mode === "address" && /* @__PURE__ */ G(fe, {
130
+ value: e.identity,
131
+ disabled: i,
132
+ onChange: (e) => o({ identity: e })
133
+ }),
134
+ /* @__PURE__ */ K("label", {
135
+ className: "schema-field",
136
+ children: [/* @__PURE__ */ G("span", { children: "Team name" }), /* @__PURE__ */ G("input", {
137
+ value: e.name,
138
+ disabled: i,
139
+ placeholder: "the file's name, else the repository's",
140
+ spellCheck: !1,
141
+ onChange: (e) => o({ name: e.target.value })
142
+ })]
143
+ }),
144
+ e.mode !== "file" && /* @__PURE__ */ K("label", {
145
+ className: "schema-check",
146
+ children: [/* @__PURE__ */ G("input", {
147
+ type: "checkbox",
148
+ checked: e.useRepoFile,
149
+ disabled: i,
150
+ onChange: (e) => o({ useRepoFile: e.target.checked })
151
+ }), /* @__PURE__ */ K("span", { children: ["Use the repository's ", /* @__PURE__ */ G("code", { children: "kuketeam.yaml" })] })]
152
+ })
153
+ ]
154
+ }),
155
+ (e.address || e.stored || e.file) && /* @__PURE__ */ G(ve, { errors: l }),
156
+ /* @__PURE__ */ G("div", {
157
+ className: "connector-actions",
158
+ children: /* @__PURE__ */ G("button", {
159
+ type: "button",
160
+ disabled: i || !!l.length,
161
+ onClick: s,
162
+ children: i ? "Reading…" : "Read repository"
163
+ })
164
+ }),
165
+ a && /* @__PURE__ */ G(n, {
166
+ error: a,
167
+ kind: "Repository"
168
+ }),
169
+ r && /* @__PURE__ */ K("div", {
170
+ className: "health-sweep-started",
171
+ role: "status",
172
+ "aria-label": "Repository read",
173
+ children: [
174
+ /* @__PURE__ */ G("p", { children: r.origin.kind === "defaults" ? /* @__PURE__ */ K(W, { children: [
175
+ "No ",
176
+ /* @__PURE__ */ G("code", { children: "kuketeam.yaml" }),
177
+ " is read: the team takes the default roles and harnesses."
178
+ ] }) : /* @__PURE__ */ K(W, { children: [
179
+ "Declared by ",
180
+ _(r.origin),
181
+ ": ",
182
+ r.form.roles.inherit ? "the default roles" : `${r.form.roles.items.length} roles`,
183
+ ", ",
184
+ r.form.harnesses.inherit ? "the default harnesses" : `${r.form.harnesses.items.length} harnesses`,
185
+ ", ",
186
+ r.sources.length - 1,
187
+ " other sources."
188
+ ] }) }),
189
+ /* @__PURE__ */ K("p", { children: [
190
+ "Team ",
191
+ /* @__PURE__ */ G("code", { children: r.name }),
192
+ "."
193
+ ] }),
194
+ !!r.notes.length && /* @__PURE__ */ G("ul", {
195
+ className: "description",
196
+ children: r.notes.map((e) => /* @__PURE__ */ G("li", { children: e }, e))
197
+ })
198
+ ]
199
+ })
200
+ ]
201
+ });
202
+ }
203
+ function be({ mode: e, form: t, draft: n, sources: i, disabled: a, onForm: o }) {
204
+ let [s, c] = U(""), l = t.sources ?? [], u = (e) => n?.sources.find((t) => t.alias === e);
205
+ return /* @__PURE__ */ K("div", {
206
+ className: "wizard-step",
207
+ children: [
208
+ e === "edit" && t.project && /* @__PURE__ */ K("fieldset", {
209
+ className: "schema-object",
210
+ children: [
211
+ /* @__PURE__ */ G("legend", { children: "Project" }),
212
+ /* @__PURE__ */ K("p", {
213
+ className: "description",
214
+ children: [t.project.url || t.project.stored, " — the team keeps its project; only its ref changes here."]
215
+ }),
216
+ /* @__PURE__ */ G(P, {
217
+ label: "Project ref",
218
+ allowNone: !0,
219
+ kind: t.project.refKind ?? "",
220
+ value: t.project.ref ?? "",
221
+ disabled: a,
222
+ onChange: (e, n) => o(O(t, {
223
+ refKind: e,
224
+ ref: n
225
+ }))
226
+ })
227
+ ]
228
+ }),
229
+ e === "new" && t.project && /* @__PURE__ */ K("p", {
230
+ className: "description",
231
+ children: [
232
+ "Project: ",
233
+ /* @__PURE__ */ G("code", { children: t.project.url || t.project.stored }),
234
+ " ",
235
+ u("project") && /* @__PURE__ */ G("span", {
236
+ className: "badge",
237
+ children: B(u("project").state)
238
+ })
239
+ ]
240
+ }),
241
+ /* @__PURE__ */ G("p", {
242
+ className: "description",
243
+ children: "Roles and harnesses can also name any stored Source by its name without listing it here. List a source to give it a clone path, its own ref, or to define one by address."
244
+ }),
245
+ l.map((e, n) => {
246
+ let s = u(e.alias);
247
+ return /* @__PURE__ */ K("fieldset", {
248
+ className: "schema-object wizard-source",
249
+ "aria-label": `Source ${e.alias || n + 1}`,
250
+ children: [
251
+ /* @__PURE__ */ K("legend", { children: [
252
+ e.alias || `Source ${n + 1}`,
253
+ " ",
254
+ s && /* @__PURE__ */ G("span", {
255
+ className: `badge team-state-${s.state}`,
256
+ children: B(s.state)
257
+ })
258
+ ] }),
259
+ s?.state === "conflict" && /* @__PURE__ */ K("p", {
260
+ className: "field-error",
261
+ children: [
262
+ "A stored Source ",
263
+ s.stored,
264
+ " holds another repository (",
265
+ s.have,
266
+ "). Store this one under another name."
267
+ ]
268
+ }),
269
+ /* @__PURE__ */ K("div", {
270
+ className: "schema-fields",
271
+ children: [
272
+ /* @__PURE__ */ K("label", {
273
+ className: "schema-field",
274
+ children: [/* @__PURE__ */ G("span", { children: "Name" }), /* @__PURE__ */ G("input", {
275
+ value: e.alias,
276
+ disabled: a,
277
+ spellCheck: !1,
278
+ onChange: (e) => o(E(t, n, { alias: e.target.value }))
279
+ })]
280
+ }),
281
+ e.url === void 0 ? /* @__PURE__ */ K("label", {
282
+ className: "schema-field",
283
+ children: [
284
+ /* @__PURE__ */ G("span", { children: "Stored Source" }),
285
+ /* @__PURE__ */ G("input", {
286
+ value: e.stored ?? "",
287
+ disabled: a,
288
+ placeholder: e.alias,
289
+ spellCheck: !1,
290
+ onChange: (e) => o(E(t, n, { stored: e.target.value }))
291
+ }),
292
+ /* @__PURE__ */ G("small", { children: (() => {
293
+ let t = i?.sources.find((t) => t.name === (e.stored || e.alias));
294
+ return t ? /* @__PURE__ */ K(W, { children: [
295
+ t.url,
296
+ ", identity ",
297
+ t.identity || "Default",
298
+ " — ",
299
+ /* @__PURE__ */ G("a", {
300
+ href: r(t.name),
301
+ children: "Source page"
302
+ })
303
+ ] }) : "Not stored.";
304
+ })() })
305
+ ]
306
+ }) : /* @__PURE__ */ K(W, { children: [
307
+ /* @__PURE__ */ K("label", {
308
+ className: "schema-field",
309
+ children: [/* @__PURE__ */ G("span", { children: "Address" }), /* @__PURE__ */ G("input", {
310
+ value: e.url,
311
+ disabled: a,
312
+ spellCheck: !1,
313
+ onChange: (e) => o(E(t, n, { url: e.target.value }))
314
+ })]
315
+ }),
316
+ /* @__PURE__ */ K("label", {
317
+ className: "schema-field",
318
+ children: [/* @__PURE__ */ G("span", { children: "Stored as" }), /* @__PURE__ */ G("input", {
319
+ value: e.stored ?? "",
320
+ disabled: a,
321
+ placeholder: e.alias,
322
+ spellCheck: !1,
323
+ onChange: (e) => o(E(t, n, { stored: e.target.value }))
324
+ })]
325
+ }),
326
+ /* @__PURE__ */ G(fe, {
327
+ value: e.identity ?? "",
328
+ disabled: a,
329
+ onChange: (e) => o(E(t, n, { identity: e }))
330
+ })
331
+ ] }),
332
+ /* @__PURE__ */ G(P, {
333
+ allowNone: !0,
334
+ kind: e.refKind ?? "",
335
+ value: e.ref ?? "",
336
+ disabled: a,
337
+ onChange: (e, r) => o(E(t, n, {
338
+ refKind: e,
339
+ ref: r
340
+ }))
341
+ }),
342
+ /* @__PURE__ */ K("label", {
343
+ className: "schema-field",
344
+ children: [/* @__PURE__ */ G("span", { children: "Clone path" }), /* @__PURE__ */ G("input", {
345
+ value: e.clonePath ?? "",
346
+ disabled: a,
347
+ placeholder: `/home/user/${e.alias || "name"}`,
348
+ spellCheck: !1,
349
+ onChange: (e) => o(E(t, n, { clonePath: e.target.value }))
350
+ })]
351
+ })
352
+ ]
353
+ }),
354
+ /* @__PURE__ */ G("button", {
355
+ type: "button",
356
+ className: "subtle-button",
357
+ disabled: a,
358
+ onClick: () => o(E(t, n, null)),
359
+ children: "Remove source"
360
+ })
361
+ ]
362
+ }, n);
363
+ }),
364
+ !l.length && /* @__PURE__ */ G("p", {
365
+ className: "description",
366
+ children: "The team lists no other source."
367
+ }),
368
+ /* @__PURE__ */ K("div", {
369
+ className: "connector-actions",
370
+ children: [
371
+ /* @__PURE__ */ K("label", {
372
+ className: "schema-field",
373
+ children: [/* @__PURE__ */ G("span", { children: "Add a stored Source" }), /* @__PURE__ */ K("select", {
374
+ "aria-label": "Add a stored Source",
375
+ value: s,
376
+ disabled: a,
377
+ onChange: (e) => c(e.target.value),
378
+ children: [/* @__PURE__ */ G("option", {
379
+ value: "",
380
+ children: "Choose…"
381
+ }), i?.sources.filter((e) => !l.some((t) => t.alias === e.name)).map((e) => /* @__PURE__ */ G("option", {
382
+ value: e.name,
383
+ children: e.name
384
+ }, e.name))]
385
+ })]
386
+ }),
387
+ /* @__PURE__ */ G("button", {
388
+ type: "button",
389
+ disabled: a || !s,
390
+ onClick: () => {
391
+ o(E(t, void 0, ae({ name: s }))), c("");
392
+ },
393
+ children: "Add"
394
+ }),
395
+ /* @__PURE__ */ G("button", {
396
+ type: "button",
397
+ disabled: a,
398
+ onClick: () => o(E(t, void 0, {})),
399
+ children: "Add by address"
400
+ })
401
+ ]
402
+ })
403
+ ]
404
+ });
405
+ }
406
+ function q({ source: e, inspected: t, onInspect: r, children: i }) {
407
+ let a = t[e.alias];
408
+ return /* @__PURE__ */ K("section", {
409
+ className: "wizard-group",
410
+ "aria-label": `Source ${e.alias}`,
411
+ children: [
412
+ /* @__PURE__ */ K("div", {
413
+ className: "schema-array-heading",
414
+ children: [/* @__PURE__ */ K("h4", { children: [
415
+ /* @__PURE__ */ G("code", { children: e.alias }),
416
+ " ",
417
+ /* @__PURE__ */ K("span", {
418
+ className: "description",
419
+ children: [
420
+ e.url,
421
+ " ",
422
+ e.stored && e.stored !== e.alias ? `(Source ${e.stored})` : ""
423
+ ]
424
+ })
425
+ ] }), /* @__PURE__ */ G("button", {
426
+ type: "button",
427
+ className: "subtle-button",
428
+ disabled: a?.loading,
429
+ onClick: () => r(e),
430
+ children: a?.loading ? "Fetching…" : a?.contents ? "Refresh" : "Show contents"
431
+ })]
432
+ }),
433
+ a?.error && /* @__PURE__ */ G(n, {
434
+ error: a.error,
435
+ kind: "Source"
436
+ }),
437
+ a?.contents && i(a.contents)
438
+ ]
439
+ });
440
+ }
441
+ function xe({ items: e, source: t, path: n, available: r }) {
442
+ let i = R(e, t, n, r);
443
+ return i < 0 || e[i].source === t ? null : /* @__PURE__ */ K("span", {
444
+ className: "description",
445
+ children: [" — selected through ", /* @__PURE__ */ G("code", { children: e[i].source })]
446
+ });
447
+ }
448
+ function Se({ form: e, available: t, inspected: n, inheritedRoles: r, defaultRoles: i, inheritedHarnesses: a, seed: o, disabled: s, onInspect: c, onForm: l }) {
449
+ let u = (e) => n[e.source]?.contents?.roles.find((t) => L(t.path) === L(e.path));
450
+ return /* @__PURE__ */ K("div", {
451
+ className: "wizard-step",
452
+ children: [/* @__PURE__ */ K("fieldset", {
453
+ className: "schema-object",
454
+ "aria-label": "Roles",
455
+ children: [
456
+ /* @__PURE__ */ G("legend", { children: "Roles" }),
457
+ /* @__PURE__ */ K("label", {
458
+ className: "schema-check",
459
+ children: [/* @__PURE__ */ G("input", {
460
+ type: "checkbox",
461
+ checked: e.roles.inherit,
462
+ disabled: s,
463
+ onChange: (t) => l(w(e, "roles", t.target.checked, i, o))
464
+ }), "Use the default roles"]
465
+ }),
466
+ e.roles.inherit ? /* @__PURE__ */ G("p", {
467
+ className: "description",
468
+ children: r.map((e) => e.name).join(", ") || "The defaults have no roles."
469
+ }) : /* @__PURE__ */ K(W, { children: [
470
+ e.roles.items.map((t, n) => {
471
+ let r = u(t)?.harnesses ?? [];
472
+ return /* @__PURE__ */ K("div", {
473
+ className: "wizard-role",
474
+ "aria-label": `Role ${t.name}`,
475
+ children: [/* @__PURE__ */ K("div", {
476
+ className: "schema-array-heading",
477
+ children: [/* @__PURE__ */ K("h4", { children: [
478
+ t.name,
479
+ " ",
480
+ /* @__PURE__ */ K("span", {
481
+ className: "description",
482
+ children: [
483
+ /* @__PURE__ */ G("code", { children: t.source }),
484
+ ":",
485
+ t.path
486
+ ]
487
+ })
488
+ ] }), /* @__PURE__ */ G("button", {
489
+ type: "button",
490
+ className: "subtle-button",
491
+ disabled: s,
492
+ onClick: () => l(I(e, t, !1)),
493
+ children: "Remove"
494
+ })]
495
+ }), /* @__PURE__ */ K("div", {
496
+ className: "schema-fields",
497
+ children: [
498
+ /* @__PURE__ */ K("label", {
499
+ className: "schema-field",
500
+ children: [/* @__PURE__ */ G("span", { children: "Name" }), /* @__PURE__ */ G("input", {
501
+ value: t.name,
502
+ disabled: s,
503
+ spellCheck: !1,
504
+ onChange: (t) => l(F(e, n, { name: t.target.value }))
505
+ })]
506
+ }),
507
+ /* @__PURE__ */ K("label", {
508
+ className: "schema-field",
509
+ children: [/* @__PURE__ */ G("span", { children: "Harness" }), /* @__PURE__ */ K("select", {
510
+ value: t.harness ?? "",
511
+ disabled: s,
512
+ onChange: (t) => l(F(e, n, { harness: t.target.value })),
513
+ children: [/* @__PURE__ */ G("option", {
514
+ value: "",
515
+ children: "Any the role declares"
516
+ }), [.../* @__PURE__ */ new Set([...r, ...t.harness ? [t.harness] : []])].map((e) => /* @__PURE__ */ G("option", {
517
+ value: e,
518
+ children: e
519
+ }, e))]
520
+ })]
521
+ }),
522
+ /* @__PURE__ */ K("label", {
523
+ className: "schema-field",
524
+ children: [
525
+ /* @__PURE__ */ G("span", { children: "Image needs" }),
526
+ /* @__PURE__ */ G("input", {
527
+ value: t.image.join(", "),
528
+ disabled: s,
529
+ placeholder: "go, node",
530
+ spellCheck: !1,
531
+ onChange: (t) => l(F(e, n, { image: M(t.target.value) }))
532
+ }),
533
+ /* @__PURE__ */ G("small", { children: "Capabilities the cell image adds, comma separated." })
534
+ ]
535
+ }),
536
+ /* @__PURE__ */ K("label", {
537
+ className: "schema-field",
538
+ children: [/* @__PURE__ */ G("span", { children: "Initial path" }), /* @__PURE__ */ G("input", {
539
+ value: t.initialPath ?? "",
540
+ disabled: s,
541
+ placeholder: "the project's clone",
542
+ spellCheck: !1,
543
+ onChange: (t) => l(F(e, n, { initialPath: t.target.value }))
544
+ })]
545
+ })
546
+ ]
547
+ })]
548
+ }, `${t.source}:${t.path}`);
549
+ }),
550
+ !e.roles.items.length && /* @__PURE__ */ G("p", {
551
+ className: "description",
552
+ children: "No role is selected."
553
+ }),
554
+ /* @__PURE__ */ G("h4", { children: "Add roles" }),
555
+ t.map((r) => /* @__PURE__ */ G(q, {
556
+ source: r,
557
+ inspected: n,
558
+ onInspect: c,
559
+ children: (n) => n.roles.length ? /* @__PURE__ */ G("div", {
560
+ className: "team-picker",
561
+ children: n.roles.map((n) => /* @__PURE__ */ K("label", {
562
+ className: "schema-check",
563
+ children: [/* @__PURE__ */ G("input", {
564
+ type: "checkbox",
565
+ "aria-label": `Role ${n.name} from ${r.alias}`,
566
+ checked: R(e.roles.items, r.alias, n.path, t) >= 0,
567
+ disabled: s,
568
+ onChange: (i) => l(I(e, {
569
+ name: n.name,
570
+ source: r.alias,
571
+ path: n.path
572
+ }, i.target.checked, [], o, t))
573
+ }), /* @__PURE__ */ K("span", { children: [
574
+ n.name,
575
+ " ",
576
+ /* @__PURE__ */ K("span", {
577
+ className: "description",
578
+ children: [n.path, n.harnesses.length ? ` — ${n.harnesses.join(", ")}` : ""]
579
+ }),
580
+ /* @__PURE__ */ G(xe, {
581
+ items: e.roles.items,
582
+ source: r.alias,
583
+ path: n.path,
584
+ available: t
585
+ })
586
+ ] })]
587
+ }, n.path))
588
+ }) : /* @__PURE__ */ G("p", {
589
+ className: "description",
590
+ children: "No role."
591
+ })
592
+ }, r.alias))
593
+ ] })
594
+ ]
595
+ }), /* @__PURE__ */ K("fieldset", {
596
+ className: "schema-object",
597
+ "aria-label": "Harnesses",
598
+ children: [
599
+ /* @__PURE__ */ G("legend", { children: "Harnesses" }),
600
+ /* @__PURE__ */ K("label", {
601
+ className: "schema-check",
602
+ children: [/* @__PURE__ */ G("input", {
603
+ type: "checkbox",
604
+ checked: e.harnesses.inherit,
605
+ disabled: s,
606
+ onChange: (t) => l(w(e, "harnesses", t.target.checked, a))
607
+ }), "Use the default harnesses"]
608
+ }),
609
+ e.harnesses.inherit ? /* @__PURE__ */ G("p", {
610
+ className: "description",
611
+ children: a.map((e) => e.name).join(", ") || "The defaults have no harnesses."
612
+ }) : /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("ul", {
613
+ className: "state-list",
614
+ children: e.harnesses.items.map((t) => /* @__PURE__ */ K("li", { children: [
615
+ t.name,
616
+ " ",
617
+ /* @__PURE__ */ K("span", {
618
+ className: "description",
619
+ children: [
620
+ /* @__PURE__ */ G("code", { children: t.source }),
621
+ ":",
622
+ t.path
623
+ ]
624
+ }),
625
+ " ",
626
+ /* @__PURE__ */ G("button", {
627
+ type: "button",
628
+ className: "text-button",
629
+ disabled: s,
630
+ onClick: () => l(T(e, t, !1)),
631
+ children: "Remove"
632
+ })
633
+ ] }, `${t.source}:${t.path}`))
634
+ }), t.map((r) => /* @__PURE__ */ G(q, {
635
+ source: r,
636
+ inspected: n,
637
+ onInspect: c,
638
+ children: (n) => n.harnesses.length ? /* @__PURE__ */ G("div", {
639
+ className: "team-picker",
640
+ children: n.harnesses.map((n) => /* @__PURE__ */ K("label", {
641
+ className: "schema-check",
642
+ children: [/* @__PURE__ */ G("input", {
643
+ type: "checkbox",
644
+ "aria-label": `Harness ${n.name} from ${r.alias}`,
645
+ checked: R(e.harnesses.items, r.alias, n.path, t) >= 0,
646
+ disabled: s,
647
+ onChange: (i) => l(T(e, {
648
+ name: n.name,
649
+ source: r.alias,
650
+ path: n.path
651
+ }, i.target.checked, [], t))
652
+ }), /* @__PURE__ */ K("span", { children: [
653
+ n.name,
654
+ " ",
655
+ /* @__PURE__ */ G("span", {
656
+ className: "description",
657
+ children: n.path
658
+ }),
659
+ /* @__PURE__ */ G(xe, {
660
+ items: e.harnesses.items,
661
+ source: r.alias,
662
+ path: n.path,
663
+ available: t
664
+ })
665
+ ] })]
666
+ }, n.path))
667
+ }) : /* @__PURE__ */ G("p", {
668
+ className: "description",
669
+ children: "No harness."
670
+ })
671
+ }, r.alias))] })
672
+ ]
673
+ })]
674
+ });
675
+ }
676
+ function Ce({ form: e, available: t, inspected: n, configured: r, inheritedHarnesses: i, disabled: a, onInspect: o, onForm: s }) {
677
+ return e.roles.inherit ? /* @__PURE__ */ G("div", {
678
+ className: "wizard-step",
679
+ children: /* @__PURE__ */ G("p", {
680
+ className: "description",
681
+ children: "The team uses the default roles, with every task each declares. To choose tasks and schedules, select the roles in Roles and harnesses."
682
+ })
683
+ }) : /* @__PURE__ */ G("div", {
684
+ className: "wizard-step",
685
+ children: e.roles.items.map((c, l) => {
686
+ let u = n[c.source]?.contents?.roles.find((e) => L(e.path) === L(c.path)), d = u?.tasks, f = r.filter((e) => e.role === c.name), p = j(e, c, u, i, f), m = k(c, d, f, p.length > 1 ? p : []), h = m.map((e) => e.name), g = t.find((e) => e.alias === c.source);
687
+ return /* @__PURE__ */ K("fieldset", {
688
+ className: "schema-object",
689
+ "aria-label": `Tasks of ${c.name}`,
690
+ children: [
691
+ /* @__PURE__ */ G("legend", { children: c.name }),
692
+ /* @__PURE__ */ K("label", {
693
+ className: "schema-check",
694
+ children: [/* @__PURE__ */ G("input", {
695
+ type: "checkbox",
696
+ checked: c.tasks.all,
697
+ disabled: a,
698
+ onChange: (t) => s(t.target.checked ? C(e, l) : F(e, l, { tasks: {
699
+ all: !1,
700
+ items: h.map((e) => ({
701
+ name: e,
702
+ suspend: null
703
+ }))
704
+ } }))
705
+ }), "Every task the role declares, with the role's schedules"]
706
+ }),
707
+ !d && g && /* @__PURE__ */ G("div", {
708
+ className: "connector-actions",
709
+ children: /* @__PURE__ */ G("button", {
710
+ type: "button",
711
+ className: "subtle-button",
712
+ disabled: a || n[c.source]?.loading,
713
+ onClick: () => o(g),
714
+ children: n[c.source]?.loading ? "Fetching…" : "Show the role's tasks"
715
+ })
716
+ }),
717
+ m.length ? /* @__PURE__ */ G("div", {
718
+ className: "table-scroll",
719
+ children: /* @__PURE__ */ K("table", {
720
+ "aria-label": `Tasks of ${c.name} table`,
721
+ children: [/* @__PURE__ */ G("thead", { children: /* @__PURE__ */ K("tr", { children: [
722
+ /* @__PURE__ */ G("th", { children: "Task" }),
723
+ /* @__PURE__ */ G("th", { children: "Selected" }),
724
+ /* @__PURE__ */ G("th", { children: "Schedule" }),
725
+ /* @__PURE__ */ G("th", { children: "Cron" }),
726
+ /* @__PURE__ */ G("th", { children: "Arguments" })
727
+ ] }) }), /* @__PURE__ */ G("tbody", { children: m.map((t) => /* @__PURE__ */ K("tr", { children: [
728
+ /* @__PURE__ */ G("td", { children: t.name }),
729
+ /* @__PURE__ */ G("td", { children: /* @__PURE__ */ G("input", {
730
+ type: "checkbox",
731
+ "aria-label": `Select ${c.name} task ${t.name}`,
732
+ checked: t.selected,
733
+ disabled: a,
734
+ onChange: (n) => s(D(e, l, t.name, { selected: n.target.checked }, h))
735
+ }) }),
736
+ /* @__PURE__ */ K("td", { children: [/* @__PURE__ */ K("select", {
737
+ "aria-label": `Schedule of ${c.name} task ${t.name}`,
738
+ value: t.switch,
739
+ disabled: a || !t.selected,
740
+ onChange: (n) => s(D(e, l, t.name, { switch: n.target.value }, h)),
741
+ children: [
742
+ /* @__PURE__ */ K("option", {
743
+ value: "role",
744
+ children: [
745
+ "The role's (",
746
+ t.roleSchedule ? t.roleSuspend ? "off" : "on" : "none",
747
+ ")"
748
+ ]
749
+ }),
750
+ /* @__PURE__ */ G("option", {
751
+ value: "on",
752
+ children: "On"
753
+ }),
754
+ /* @__PURE__ */ G("option", {
755
+ value: "off",
756
+ children: "Off"
757
+ })
758
+ ]
759
+ }), t.harnesses.length > 0 && /* @__PURE__ */ G("ul", {
760
+ className: "state-list",
761
+ "aria-label": `Schedule of ${c.name} task ${t.name} per harness`,
762
+ children: t.harnesses.map((n) => /* @__PURE__ */ K("li", { children: [/* @__PURE__ */ K("label", { children: [
763
+ n.name,
764
+ " ",
765
+ /* @__PURE__ */ K("select", {
766
+ "aria-label": `Schedule of ${c.name} task ${t.name} on ${n.name}`,
767
+ value: n.switch,
768
+ disabled: a || !t.selected,
769
+ onChange: (r) => s(D(e, l, t.name, {
770
+ harness: n.name,
771
+ switch: r.target.value
772
+ }, h)),
773
+ children: [
774
+ /* @__PURE__ */ G("option", {
775
+ value: "same",
776
+ children: "Same as the task"
777
+ }),
778
+ /* @__PURE__ */ G("option", {
779
+ value: "on",
780
+ children: "On"
781
+ }),
782
+ /* @__PURE__ */ G("option", {
783
+ value: "off",
784
+ children: "Off"
785
+ })
786
+ ]
787
+ })
788
+ ] }), n.schedule && /* @__PURE__ */ K("span", {
789
+ className: "description",
790
+ children: [" ", n.schedule]
791
+ })] }, n.name))
792
+ })] }),
793
+ /* @__PURE__ */ G("td", { children: /* @__PURE__ */ G("input", {
794
+ "aria-label": `Cron of ${c.name} task ${t.name}`,
795
+ value: t.schedule,
796
+ disabled: a || !t.selected,
797
+ placeholder: t.roleSchedule || "@daily",
798
+ spellCheck: !1,
799
+ onChange: (n) => s(D(e, l, t.name, { schedule: n.target.value }, h))
800
+ }) }),
801
+ /* @__PURE__ */ G("td", { children: /* @__PURE__ */ G("input", {
802
+ "aria-label": `Arguments of ${c.name} task ${t.name}`,
803
+ value: t.args,
804
+ disabled: a || !t.selected,
805
+ placeholder: t.roleArgs,
806
+ spellCheck: !1,
807
+ onChange: (n) => s(D(e, l, t.name, { args: n.target.value }, h))
808
+ }) })
809
+ ] }, t.name)) })]
810
+ })
811
+ }) : /* @__PURE__ */ K("p", {
812
+ className: "description",
813
+ children: [
814
+ "No task is known for this role yet",
815
+ d ? ": it declares none" : "",
816
+ "."
817
+ ]
818
+ })
819
+ ]
820
+ }, `${c.source}:${c.path}`);
821
+ })
822
+ });
823
+ }
824
+ function we(e, t, n) {
825
+ let r = f(e, t).filter((e) => e.realm === "default" && !e.space);
826
+ return [.../* @__PURE__ */ new Set([...r.map((e) => e.name), ...n ? [n] : []])];
827
+ }
828
+ function Te({ form: e, connectors: t, secrets: n, inheritedRoles: r, viewRows: i, resolving: a, notes: o, disabled: s, onForm: c }) {
829
+ let l = e.roles.inherit, u = l ? r.map((e) => ({ name: e.name })) : e.roles.items;
830
+ return /* @__PURE__ */ K("fieldset", {
831
+ className: "schema-object",
832
+ "aria-label": "Per-role access",
833
+ children: [
834
+ /* @__PURE__ */ G("legend", { children: "Per-role access" }),
835
+ /* @__PURE__ */ G("p", {
836
+ className: "description",
837
+ children: "A connector a role's cells get although the role does not ask for it, such as GitHub access for majordomo's health sweep. Turning one on adds it to the role's entry in the team; a running cell keeps what it started with until it is restarted."
838
+ }),
839
+ l && /* @__PURE__ */ G("p", {
840
+ className: "description",
841
+ role: "note",
842
+ children: "Declare the team's roles to change per-role access."
843
+ }),
844
+ /* @__PURE__ */ G("p", {
845
+ className: "description resolving-note",
846
+ role: "status",
847
+ children: a ? "Resolving…" : ""
848
+ }),
849
+ u.length ? /* @__PURE__ */ G("div", {
850
+ className: "table-scroll",
851
+ children: /* @__PURE__ */ K("table", {
852
+ "aria-label": "Per-role connectors",
853
+ className: a ? "is-resolving" : void 0,
854
+ "aria-busy": a || void 0,
855
+ children: [/* @__PURE__ */ G("thead", { children: /* @__PURE__ */ K("tr", { children: [
856
+ /* @__PURE__ */ G("th", { children: "Role" }),
857
+ /* @__PURE__ */ G("th", { children: "Connector" }),
858
+ /* @__PURE__ */ G("th", { children: "Enabled" }),
859
+ /* @__PURE__ */ G("th", { children: "Identity" }),
860
+ /* @__PURE__ */ G("th", { children: "Resolves to" })
861
+ ] }) }), /* @__PURE__ */ G("tbody", { children: u.flatMap((r, o) => oe(r, t, i).map((t) => {
862
+ let i = s || l;
863
+ return /* @__PURE__ */ K("tr", { children: [
864
+ /* @__PURE__ */ G("td", { children: /* @__PURE__ */ G("code", { children: r.name }) }),
865
+ /* @__PURE__ */ G("td", { children: t.title }),
866
+ /* @__PURE__ */ G("td", { children: t.required ? /* @__PURE__ */ G("span", {
867
+ className: "description",
868
+ children: "Required by the role"
869
+ }) : /* @__PURE__ */ K("label", {
870
+ className: "schema-check",
871
+ children: [/* @__PURE__ */ G("input", {
872
+ type: "checkbox",
873
+ "aria-label": `${t.title} for ${r.name}`,
874
+ checked: t.enabled,
875
+ disabled: i,
876
+ onChange: (n) => c(S(e, o, t.name, { enabled: n.target.checked }))
877
+ }), t.enabled ? "On" : "Off"]
878
+ }) }),
879
+ /* @__PURE__ */ G("td", { children: t.required ? "—" : /* @__PURE__ */ K("select", {
880
+ "aria-label": `Identity of ${t.name} for ${r.name}`,
881
+ value: t.identity,
882
+ disabled: i || !t.enabled,
883
+ onChange: (n) => c(S(e, o, t.name, { identity: n.target.value })),
884
+ children: [/* @__PURE__ */ G("option", {
885
+ value: "",
886
+ children: "Default"
887
+ }), we(n, t.name, t.identity).map((e) => /* @__PURE__ */ G("option", {
888
+ value: e,
889
+ children: e
890
+ }, e))]
891
+ }) }),
892
+ /* @__PURE__ */ G("td", {
893
+ className: "resolves-to",
894
+ children: t.states.length ? /* @__PURE__ */ G("ul", {
895
+ className: "state-list",
896
+ children: t.states.map((e) => /* @__PURE__ */ K("li", { children: [
897
+ /* @__PURE__ */ G("span", {
898
+ className: "mono-id",
899
+ children: e.config
900
+ }),
901
+ ": ",
902
+ e.fill
903
+ ] }, e.config))
904
+ }) : /* @__PURE__ */ G("span", {
905
+ className: "description",
906
+ children: a ? "Resolving…" : "Not rendered"
907
+ })
908
+ })
909
+ ] }, `${r.name}/${t.name}`);
910
+ })) })]
911
+ })
912
+ }) : /* @__PURE__ */ G("p", {
913
+ className: "description",
914
+ children: "No role is selected."
915
+ }),
916
+ !!o.length && /* @__PURE__ */ G("ul", {
917
+ className: "description",
918
+ "aria-label": "Not resolved",
919
+ children: o.map((e) => /* @__PURE__ */ G("li", { children: e }, e))
920
+ })
921
+ ]
922
+ });
923
+ }
924
+ function Ee({ form: e, connectors: t, defaultConnectors: r, missing: i, inheritedRoles: a, viewRows: o, resolving: s, notes: c, resolveError: l, disabled: d, onForm: p }) {
925
+ let m = u("/catalog/secrets", 0);
926
+ return /* @__PURE__ */ K("div", {
927
+ className: "wizard-step",
928
+ children: [
929
+ /* @__PURE__ */ K("label", {
930
+ className: "schema-check",
931
+ children: [/* @__PURE__ */ G("input", {
932
+ type: "checkbox",
933
+ checked: e.connectors.inherit,
934
+ disabled: d,
935
+ onChange: (t) => p(A(e, t.target.checked, r))
936
+ }), "Use the defaults' connector choices"]
937
+ }),
938
+ !e.connectors.inherit && /* @__PURE__ */ K(W, { children: [t.error && /* @__PURE__ */ G(n, {
939
+ error: t.error,
940
+ kind: "Connectors"
941
+ }), /* @__PURE__ */ G("div", {
942
+ className: "table-scroll",
943
+ children: /* @__PURE__ */ K("table", {
944
+ "aria-label": "Connector choices",
945
+ children: [/* @__PURE__ */ G("thead", { children: /* @__PURE__ */ K("tr", { children: [
946
+ /* @__PURE__ */ G("th", { children: "Connector" }),
947
+ /* @__PURE__ */ G("th", { children: "Method" }),
948
+ /* @__PURE__ */ G("th", { children: "Identity" })
949
+ ] }) }), /* @__PURE__ */ G("tbody", { children: (t.data ?? []).map((t) => {
950
+ let n = e.connectors.items[t.name] ?? {}, i = f(m.data, t.name).filter((e) => e.realm === "default" && !e.space);
951
+ return /* @__PURE__ */ K("tr", { children: [
952
+ /* @__PURE__ */ G("td", { children: t.title || t.name }),
953
+ /* @__PURE__ */ G("td", { children: /* @__PURE__ */ K("select", {
954
+ "aria-label": `Method of ${t.name}`,
955
+ value: n.method ?? "",
956
+ disabled: d,
957
+ onChange: (n) => p(z(e, t.name, { method: n.target.value }, r)),
958
+ children: [/* @__PURE__ */ G("option", {
959
+ value: "",
960
+ children: "Default"
961
+ }), t.methods.map((e) => /* @__PURE__ */ G("option", {
962
+ value: e.name,
963
+ children: e.name
964
+ }, e.name))]
965
+ }) }),
966
+ /* @__PURE__ */ G("td", { children: /* @__PURE__ */ K("select", {
967
+ "aria-label": `Identity of ${t.name}`,
968
+ value: n.identity ?? "",
969
+ disabled: d,
970
+ onChange: (n) => p(z(e, t.name, { identity: n.target.value }, r)),
971
+ children: [/* @__PURE__ */ G("option", {
972
+ value: "",
973
+ children: "From the scope defaults"
974
+ }), [.../* @__PURE__ */ new Set([...i.map((e) => e.name), ...n.identity ? [n.identity] : []])].map((e) => /* @__PURE__ */ G("option", {
975
+ value: e,
976
+ children: e
977
+ }, e))]
978
+ }) })
979
+ ] }, t.name);
980
+ }) })]
981
+ })
982
+ })] }),
983
+ /* @__PURE__ */ G(Te, {
984
+ form: e,
985
+ connectors: t.data,
986
+ secrets: m.data,
987
+ inheritedRoles: a,
988
+ viewRows: o,
989
+ resolving: s,
990
+ notes: c,
991
+ disabled: d,
992
+ onForm: p
993
+ }),
994
+ l && !s && /* @__PURE__ */ K("p", {
995
+ className: "description",
996
+ role: "status",
997
+ children: ["Resolves to could not be computed: ", l.message]
998
+ }),
999
+ /* @__PURE__ */ K("p", {
1000
+ className: "description",
1001
+ children: [
1002
+ "Secret bindings (",
1003
+ /* @__PURE__ */ G("code", { children: "spec.secrets" }),
1004
+ ") and a role's ",
1005
+ /* @__PURE__ */ G("code", { children: "needs.secrets" }),
1006
+ " are kept as they are; edit them as YAML."
1007
+ ]
1008
+ }),
1009
+ !!i.length && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("h3", { children: "Missing secrets in the preview" }), /* @__PURE__ */ G("ul", {
1010
+ className: "state-list",
1011
+ "aria-label": "Missing secrets",
1012
+ children: i.map((e) => /* @__PURE__ */ G("li", {
1013
+ className: "mono-id",
1014
+ children: e
1015
+ }, e))
1016
+ })] })
1017
+ ]
1018
+ });
1019
+ }
1020
+ function De({ name: e, document: t, onChanged: r }) {
1021
+ let [i, l] = U(t), [u, f] = U(""), [p, h] = U(), [g, _] = U(), { notify: v } = a();
1022
+ async function y(t) {
1023
+ if (!u) {
1024
+ f(t), h(void 0);
1025
+ try {
1026
+ let n = await s(t === "preview" ? c("preview") : c(), m(e, i));
1027
+ if (t === "preview") {
1028
+ _(n);
1029
+ return;
1030
+ }
1031
+ v({
1032
+ key: `team-apply:${e}`,
1033
+ tone: "success",
1034
+ message: `Team ${e} applied.`
1035
+ }), r(), o(d(e));
1036
+ } catch (e) {
1037
+ h(b(e));
1038
+ } finally {
1039
+ f("");
1040
+ }
1041
+ }
1042
+ }
1043
+ return /* @__PURE__ */ K("section", {
1044
+ className: "panel",
1045
+ "aria-label": "Team declaration",
1046
+ children: [/* @__PURE__ */ K("div", {
1047
+ className: "panel-heading",
1048
+ children: [/* @__PURE__ */ G("h2", { children: "Declaration" }), i !== t && /* @__PURE__ */ G("span", {
1049
+ className: "badge",
1050
+ children: "Edited"
1051
+ })]
1052
+ }), /* @__PURE__ */ K("div", {
1053
+ className: "panel-body creation-form",
1054
+ children: [
1055
+ /* @__PURE__ */ K("label", {
1056
+ className: "schema-field team-yaml",
1057
+ children: [
1058
+ /* @__PURE__ */ G("span", { children: "Team document" }),
1059
+ /* @__PURE__ */ G("textarea", {
1060
+ "aria-label": "Team declaration YAML",
1061
+ value: i,
1062
+ spellCheck: !1,
1063
+ disabled: !!u,
1064
+ onChange: (e) => {
1065
+ l(e.target.value), _(void 0);
1066
+ }
1067
+ }),
1068
+ /* @__PURE__ */ K("small", { children: [
1069
+ "The whole declaration, as ",
1070
+ /* @__PURE__ */ G("code", { children: "kuke team apply -f" }),
1071
+ ": secret bindings, a role's connectors, a source's git block."
1072
+ ] })
1073
+ ]
1074
+ }),
1075
+ /* @__PURE__ */ K("div", {
1076
+ className: "connector-actions",
1077
+ children: [/* @__PURE__ */ G("button", {
1078
+ type: "button",
1079
+ disabled: !!u,
1080
+ onClick: () => void y("preview"),
1081
+ children: u === "preview" ? "Previewing…" : "Preview"
1082
+ }), /* @__PURE__ */ G("button", {
1083
+ type: "button",
1084
+ className: "primary-action",
1085
+ disabled: !!u || !g,
1086
+ onClick: () => void y("apply"),
1087
+ children: u === "apply" ? "Applying…" : "Apply"
1088
+ })]
1089
+ }),
1090
+ p && /* @__PURE__ */ G(n, {
1091
+ error: p,
1092
+ kind: "Team"
1093
+ }),
1094
+ g && /* @__PURE__ */ G(ue, {
1095
+ plan: g.plan,
1096
+ title: "Preview"
1097
+ })
1098
+ ]
1099
+ })]
1100
+ });
1101
+ }
1102
+ function J({ mode: e, team: t, onChanged: r }) {
1103
+ let i = me(e), l = t?.summary.name ?? "", f = u("/sources", 0), [p, m] = U("form"), [_, v] = U(0), [y, ee] = U(pe()), [x, te] = U(), [S, C] = U(t?.form), [w, T] = U({}), [E, D] = U(""), [O, k] = U(), [A, j] = U(), [ae, M] = U(!1), { notify: oe } = a(), N = i[_].key, P = re(N, {
1104
+ project: y,
1105
+ draft: x,
1106
+ form: S
1107
+ }), F = ne(S, f.data?.sources), I = t?.view?.roles.inherited ? t.view.roles.items : f.data?.defaultRoles ?? [], L = t?.view?.harnesses.inherited ? t.view.harnesses.items : f.data?.defaultHarnesses ?? [], fe = f.data?.defaultForm?.roles ?? I, R = f.data?.defaultForm?.connectors ?? {}, z = t?.view?.tasks ?? [], B = u("/connectors", 0), [V, he] = U(), [_e, q] = U(!1), [xe, we] = U(), Te = ge(S);
1108
+ Te.current = S;
1109
+ let J = (e) => {
1110
+ C(e), j(void 0), M(!1), k(void 0);
1111
+ }, Y = (e) => {
1112
+ e.connectors && he({
1113
+ rows: e.connectors,
1114
+ notes: e.connectorNotes ?? []
1115
+ });
1116
+ };
1117
+ async function Oe() {
1118
+ D("draft"), k(void 0);
1119
+ try {
1120
+ let e = await s(c("draft"), ie(y));
1121
+ te(e), C(e.form), j(void 0);
1122
+ let t = {};
1123
+ for (let n of e.sources) n.contents && (t[n.alias] = { contents: n.contents });
1124
+ T(t);
1125
+ } catch (e) {
1126
+ k(b(e));
1127
+ } finally {
1128
+ D("");
1129
+ }
1130
+ }
1131
+ async function ke(e) {
1132
+ T((t) => ({
1133
+ ...t,
1134
+ [e.alias]: {
1135
+ ...t[e.alias],
1136
+ loading: !0,
1137
+ error: void 0
1138
+ }
1139
+ }));
1140
+ let t = le(e);
1141
+ try {
1142
+ let n = await s(t.path, t.body);
1143
+ T((t) => ({
1144
+ ...t,
1145
+ [e.alias]: { contents: n }
1146
+ }));
1147
+ } catch (t) {
1148
+ T((n) => ({
1149
+ ...n,
1150
+ [e.alias]: { error: b(t) }
1151
+ }));
1152
+ }
1153
+ }
1154
+ function X(t = !1, n = S) {
1155
+ return e === "new" ? de(y, x, n, t) : se(l, n);
1156
+ }
1157
+ async function Z(t, n = !1) {
1158
+ if (S && !E) {
1159
+ D(t ? "preview" : "apply"), k(void 0);
1160
+ try {
1161
+ let i = await s(t ? c("preview") : c(), X(n));
1162
+ if (t) {
1163
+ j(i), Y(i);
1164
+ return;
1165
+ }
1166
+ let a = i.result?.team ?? l;
1167
+ oe({
1168
+ key: `team-${e}:${a}`,
1169
+ tone: "success",
1170
+ message: e === "new" ? `Team ${a} added.` : `Team ${a} applied.`
1171
+ }), r(), o(d(a));
1172
+ } catch (t) {
1173
+ let n = b(t);
1174
+ e === "new" && g(n) && M(!0), k(n);
1175
+ } finally {
1176
+ D("");
1177
+ }
1178
+ }
1179
+ }
1180
+ H(() => {
1181
+ if (N !== "credentials" || !S || A || E) return;
1182
+ let e = !0;
1183
+ q(!0);
1184
+ let t = S, n = window.setTimeout(() => {
1185
+ (async () => {
1186
+ try {
1187
+ let n = await s(c("preview"), X(!1, t));
1188
+ if (!e) return;
1189
+ Y(n), we(void 0), Te.current === t && j(n);
1190
+ } catch (t) {
1191
+ e && we(b(t));
1192
+ } finally {
1193
+ e && q(!1);
1194
+ }
1195
+ })();
1196
+ }, 500);
1197
+ return () => {
1198
+ e = !1, window.clearTimeout(n), q(!1);
1199
+ };
1200
+ }, [
1201
+ N,
1202
+ S,
1203
+ A,
1204
+ E
1205
+ ]);
1206
+ let Q = ge(void 0);
1207
+ H(() => {
1208
+ N !== "review" || !S || A || E || O || Q.current === S || (Q.current = S, Z(!0));
1209
+ }, [
1210
+ N,
1211
+ S,
1212
+ A,
1213
+ E,
1214
+ O
1215
+ ]);
1216
+ let $ = !!E, Ae = /* @__PURE__ */ G("ol", {
1217
+ className: "wizard-steps",
1218
+ "aria-label": "Steps",
1219
+ children: i.map((e, t) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ K("button", {
1220
+ type: "button",
1221
+ className: "text-button",
1222
+ "aria-current": t === _ ? "step" : void 0,
1223
+ disabled: $ || t > _ && (!S || t > _ + 1 || !!P.length),
1224
+ onClick: () => v(t),
1225
+ children: [
1226
+ t + 1,
1227
+ ". ",
1228
+ e.title
1229
+ ]
1230
+ }) }, e.key))
1231
+ });
1232
+ return /* @__PURE__ */ K(W, { children: [e === "edit" && /* @__PURE__ */ K("nav", {
1233
+ className: "daemon-tabs",
1234
+ "aria-label": "Edit team",
1235
+ children: [/* @__PURE__ */ G("a", {
1236
+ href: d(l, "edit"),
1237
+ "aria-current": p === "form" ? "page" : void 0,
1238
+ onClick: (e) => {
1239
+ e.preventDefault(), m("form");
1240
+ },
1241
+ children: "Form"
1242
+ }), /* @__PURE__ */ G("a", {
1243
+ href: d(l, "edit"),
1244
+ "aria-current": p === "yaml" ? "page" : void 0,
1245
+ onClick: (e) => {
1246
+ e.preventDefault(), m("yaml");
1247
+ },
1248
+ children: "Edit as YAML"
1249
+ })]
1250
+ }), e === "edit" && p === "yaml" ? /* @__PURE__ */ G(De, {
1251
+ name: l,
1252
+ document: t?.document ?? "",
1253
+ onChanged: r
1254
+ }) : /* @__PURE__ */ K("section", {
1255
+ className: "panel team-wizard",
1256
+ "aria-label": e === "new" ? "New team wizard" : "Edit team form",
1257
+ children: [/* @__PURE__ */ K("div", {
1258
+ className: "panel-heading",
1259
+ children: [/* @__PURE__ */ G("h2", { children: i[_].title }), /* @__PURE__ */ K("span", {
1260
+ className: "badge",
1261
+ children: [
1262
+ "Step ",
1263
+ _ + 1,
1264
+ " of ",
1265
+ i.length
1266
+ ]
1267
+ })]
1268
+ }), /* @__PURE__ */ K("div", {
1269
+ className: "panel-body creation-form",
1270
+ children: [
1271
+ Ae,
1272
+ e === "edit" && !S && /* @__PURE__ */ G(n, {
1273
+ error: {
1274
+ code: "invalid",
1275
+ message: t?.problem ?? "The team's form could not be read; edit it as YAML."
1276
+ },
1277
+ kind: "Team"
1278
+ }),
1279
+ N === "project" && /* @__PURE__ */ G(ye, {
1280
+ project: y,
1281
+ sources: f.data,
1282
+ draft: x,
1283
+ pending: E === "draft",
1284
+ error: E ? void 0 : O,
1285
+ onChange: (e) => {
1286
+ ee((t) => ({
1287
+ ...t,
1288
+ ...e
1289
+ })), te(void 0), C(void 0), k(void 0);
1290
+ },
1291
+ onRead: () => void Oe()
1292
+ }),
1293
+ S && N === "sources" && /* @__PURE__ */ G(be, {
1294
+ mode: e,
1295
+ form: S,
1296
+ draft: x,
1297
+ sources: f.data,
1298
+ disabled: $,
1299
+ onForm: J
1300
+ }),
1301
+ S && N === "roles" && /* @__PURE__ */ G(Se, {
1302
+ form: S,
1303
+ available: F,
1304
+ inspected: w,
1305
+ inheritedRoles: I,
1306
+ defaultRoles: fe,
1307
+ inheritedHarnesses: L,
1308
+ seed: e === "new" ? B.data : void 0,
1309
+ disabled: $,
1310
+ onInspect: (e) => void ke(e),
1311
+ onForm: J
1312
+ }),
1313
+ S && N === "tasks" && /* @__PURE__ */ G(Ce, {
1314
+ form: S,
1315
+ available: F,
1316
+ inspected: w,
1317
+ configured: z,
1318
+ inheritedHarnesses: L,
1319
+ disabled: $,
1320
+ onInspect: (e) => void ke(e),
1321
+ onForm: J
1322
+ }),
1323
+ S && N === "credentials" && /* @__PURE__ */ G(Ee, {
1324
+ form: S,
1325
+ connectors: B,
1326
+ defaultConnectors: R,
1327
+ missing: A?.plan.missingSecrets ?? [],
1328
+ inheritedRoles: I,
1329
+ viewRows: V?.rows ?? t?.view?.connectors.roles ?? [],
1330
+ resolving: _e,
1331
+ notes: V?.notes ?? [],
1332
+ resolveError: xe,
1333
+ disabled: $,
1334
+ onForm: J
1335
+ }),
1336
+ S && N === "review" && /* @__PURE__ */ K("div", {
1337
+ className: "wizard-step",
1338
+ children: [
1339
+ /* @__PURE__ */ K("p", {
1340
+ className: "description",
1341
+ children: [e === "new" ? /* @__PURE__ */ K(W, { children: [
1342
+ "Adds team ",
1343
+ /* @__PURE__ */ G("code", { children: S.name || x?.name }),
1344
+ " from ",
1345
+ /* @__PURE__ */ G("code", { children: S.project?.url || S.project?.stored }),
1346
+ " (",
1347
+ h({ [S.project?.refKind ?? "branch"]: S.project?.ref }),
1348
+ ")."
1349
+ ] }) : /* @__PURE__ */ K(W, { children: [
1350
+ "Applies the form to team ",
1351
+ /* @__PURE__ */ G("code", { children: l }),
1352
+ "."
1353
+ ] }), " The apply composes from scratch again: a branch may have moved since the preview, and the apply result is authoritative."]
1354
+ }),
1355
+ E === "preview" && /* @__PURE__ */ G("p", {
1356
+ role: "status",
1357
+ children: "Previewing…"
1358
+ }),
1359
+ O && /* @__PURE__ */ G(n, {
1360
+ error: O,
1361
+ kind: "Team"
1362
+ }),
1363
+ O && !A && /* @__PURE__ */ G("div", {
1364
+ className: "connector-actions",
1365
+ children: /* @__PURE__ */ G("button", {
1366
+ type: "button",
1367
+ disabled: $,
1368
+ onClick: () => void Z(!0),
1369
+ children: "Retry"
1370
+ })
1371
+ }),
1372
+ ae && /* @__PURE__ */ K("div", {
1373
+ className: "error",
1374
+ role: "alert",
1375
+ children: [/* @__PURE__ */ G("p", { children: "A team of this name is stored. Reapply it from its team page to recompose it with its stored declaration, or replace the declaration with this one." }), /* @__PURE__ */ G("button", {
1376
+ type: "button",
1377
+ className: "danger-action",
1378
+ disabled: $,
1379
+ onClick: () => void Z(!1, !0),
1380
+ children: "Replace the stored declaration"
1381
+ })]
1382
+ }),
1383
+ A && /* @__PURE__ */ G(ce, { outcome: A }),
1384
+ A && /* @__PURE__ */ G(ue, {
1385
+ plan: A.plan,
1386
+ title: "Preview"
1387
+ })
1388
+ ]
1389
+ }),
1390
+ N !== "review" && N !== "project" && O && /* @__PURE__ */ G(n, {
1391
+ error: O,
1392
+ kind: "Team"
1393
+ }),
1394
+ /* @__PURE__ */ G(ve, { errors: N === "project" ? [] : P }),
1395
+ /* @__PURE__ */ K("div", {
1396
+ className: "form-actions",
1397
+ children: [
1398
+ /* @__PURE__ */ G("button", {
1399
+ type: "button",
1400
+ disabled: $ || _ === 0,
1401
+ onClick: () => v(_ - 1),
1402
+ children: "Back"
1403
+ }),
1404
+ _ < i.length - 1 && /* @__PURE__ */ G("button", {
1405
+ type: "button",
1406
+ className: "primary-action",
1407
+ disabled: $ || !!P.length || !S,
1408
+ onClick: () => v(_ + 1),
1409
+ children: "Next"
1410
+ }),
1411
+ S && N === "review" && /* @__PURE__ */ G("button", {
1412
+ type: "button",
1413
+ className: "primary-action",
1414
+ disabled: $ || !A,
1415
+ onClick: () => void Z(!1),
1416
+ children: E === "apply" ? e === "new" ? "Adding…" : "Applying…" : e === "new" ? "Add team" : "Apply"
1417
+ })
1418
+ ]
1419
+ })
1420
+ ]
1421
+ })]
1422
+ })] });
1423
+ }
1424
+ // src/teams-page.tsx
1425
+ function Y({ rows: e, configs: n }) {
1426
+ if (!e.length) return /* @__PURE__ */ G("p", {
1427
+ className: "description",
1428
+ children: "No Config of the team reports its connectors yet."
1429
+ });
1430
+ let r = (e) => n.find((t) => t.name === e)?.scope;
1431
+ return /* @__PURE__ */ G("div", {
1432
+ className: "table-scroll",
1433
+ children: /* @__PURE__ */ K("table", {
1434
+ "aria-label": "Connectors per role",
1435
+ children: [/* @__PURE__ */ G("thead", { children: /* @__PURE__ */ K("tr", { children: [
1436
+ /* @__PURE__ */ G("th", { children: "Role" }),
1437
+ /* @__PURE__ */ G("th", { children: "Config" }),
1438
+ /* @__PURE__ */ G("th", { children: "Connector" }),
1439
+ /* @__PURE__ */ G("th", { children: "Method" }),
1440
+ /* @__PURE__ */ G("th", { children: "Identity" }),
1441
+ /* @__PURE__ */ G("th", { children: "From" }),
1442
+ /* @__PURE__ */ G("th", { children: "Asked by" })
1443
+ ] }) }), /* @__PURE__ */ G("tbody", { children: e.map((e) => {
1444
+ let n = r(e.config), a = e.state !== t;
1445
+ return /* @__PURE__ */ K("tr", { children: [
1446
+ /* @__PURE__ */ G("td", { children: /* @__PURE__ */ G("code", { children: e.role }) }),
1447
+ /* @__PURE__ */ G("td", { children: n ? /* @__PURE__ */ G("a", {
1448
+ className: "resource-name mono-id",
1449
+ href: i(n, e.config),
1450
+ children: e.config
1451
+ }) : /* @__PURE__ */ G("span", {
1452
+ className: "mono-id",
1453
+ children: e.config
1454
+ }) }),
1455
+ /* @__PURE__ */ G("td", { children: /* @__PURE__ */ G("a", {
1456
+ className: "resource-name",
1457
+ href: y(e.connector),
1458
+ children: e.connector
1459
+ }) }),
1460
+ /* @__PURE__ */ G("td", { children: e.method || "—" }),
1461
+ /* @__PURE__ */ G("td", { children: a ? /* @__PURE__ */ G("a", {
1462
+ className: "badge needs-connector",
1463
+ href: y(e.connector),
1464
+ children: "Needs identity"
1465
+ }) : /* @__PURE__ */ G("span", {
1466
+ className: "mono-id",
1467
+ children: e.identity || "—"
1468
+ }) }),
1469
+ /* @__PURE__ */ G("td", { children: e.origin || "—" }),
1470
+ /* @__PURE__ */ G("td", { children: e.setByTeam ? "Team" : "Role definition" })
1471
+ ] }, `${e.config}/${e.connector}`);
1472
+ }) })]
1473
+ })
1474
+ });
1475
+ }
1476
+ function Oe({ teams: e, onChanged: t }) {
1477
+ return /* @__PURE__ */ K("section", {
1478
+ className: "panel",
1479
+ "aria-label": "Teams list",
1480
+ children: [
1481
+ /* @__PURE__ */ K("div", {
1482
+ className: "panel-heading",
1483
+ children: [/* @__PURE__ */ G("h2", { children: "Teams" }), /* @__PURE__ */ G("a", {
1484
+ className: "document-action",
1485
+ href: l(),
1486
+ children: "New team"
1487
+ })]
1488
+ }),
1489
+ /* @__PURE__ */ G("div", {
1490
+ className: "table-scroll",
1491
+ children: /* @__PURE__ */ K("table", { children: [/* @__PURE__ */ G("thead", { children: /* @__PURE__ */ K("tr", { children: [
1492
+ /* @__PURE__ */ G("th", { children: "Team" }),
1493
+ /* @__PURE__ */ G("th", { children: "Project" }),
1494
+ /* @__PURE__ */ G("th", { children: "Roles" }),
1495
+ /* @__PURE__ */ G("th", { children: "Harnesses" }),
1496
+ /* @__PURE__ */ G("th", { children: "Configs" })
1497
+ ] }) }), /* @__PURE__ */ G("tbody", { children: e.map((e) => /* @__PURE__ */ K("tr", { children: [
1498
+ /* @__PURE__ */ K("td", { children: [/* @__PURE__ */ G("a", {
1499
+ className: "resource-name",
1500
+ href: d(e.name),
1501
+ children: e.name
1502
+ }), e.system && /* @__PURE__ */ K(W, { children: [" ", /* @__PURE__ */ G("span", {
1503
+ className: "badge",
1504
+ children: "system"
1505
+ })] })] }),
1506
+ /* @__PURE__ */ G("td", { children: e.projectUrl ? /* @__PURE__ */ K(W, { children: [
1507
+ e.projectUrl,
1508
+ " ",
1509
+ /* @__PURE__ */ G("span", {
1510
+ className: "description",
1511
+ children: e.projectRef
1512
+ })
1513
+ ] }) : "—" }),
1514
+ /* @__PURE__ */ G("td", { children: e.rolesInherited ? /* @__PURE__ */ G("span", {
1515
+ className: "description",
1516
+ children: "defaults"
1517
+ }) : e.roles.join(", ") || "none" }),
1518
+ /* @__PURE__ */ G("td", { children: e.harnessesInherited ? /* @__PURE__ */ G("span", {
1519
+ className: "description",
1520
+ children: "defaults"
1521
+ }) : e.harnesses.join(", ") || "none" }),
1522
+ /* @__PURE__ */ G("td", { children: e.configs.length })
1523
+ ] }, e.name)) })] })
1524
+ }),
1525
+ !e.length && /* @__PURE__ */ K("div", {
1526
+ className: "empty-state",
1527
+ children: [
1528
+ /* @__PURE__ */ G("h3", { children: "No team is stored" }),
1529
+ /* @__PURE__ */ G("p", { children: "Initialize stores the kuke team and the default team, or add one with New team." }),
1530
+ /* @__PURE__ */ G(V, { onChanged: t })
1531
+ ]
1532
+ })
1533
+ ]
1534
+ });
1535
+ }
1536
+ function ke({ team: e, pending: t, onCancel: n, onConfirm: r }) {
1537
+ let i = ge(null), [a, o] = U(!1);
1538
+ return _e(i), /* @__PURE__ */ G("dialog", {
1539
+ className: "cell-action-dialog",
1540
+ ref: i,
1541
+ "aria-labelledby": "team-delete-title",
1542
+ "aria-describedby": "team-delete-description",
1543
+ onCancel: (e) => {
1544
+ e.preventDefault(), n();
1545
+ },
1546
+ children: /* @__PURE__ */ K("form", {
1547
+ onSubmit: (e) => {
1548
+ e.preventDefault(), a && r();
1549
+ },
1550
+ children: [
1551
+ /* @__PURE__ */ G("h2", {
1552
+ id: "team-delete-title",
1553
+ children: "Delete team"
1554
+ }),
1555
+ /* @__PURE__ */ K("p", {
1556
+ id: "team-delete-description",
1557
+ children: [
1558
+ "Deletes the team's ",
1559
+ e.configs.length,
1560
+ " Configs, the shared blueprints no other Config uses, and the team. Cells and volumes stay; the result lists the cells still running and the state volumes kept."
1561
+ ]
1562
+ }),
1563
+ /* @__PURE__ */ K("dl", {
1564
+ className: "cell-action-target",
1565
+ children: [/* @__PURE__ */ G("dt", { children: "Team" }), /* @__PURE__ */ G("dd", { children: /* @__PURE__ */ G("code", { children: e.name }) })]
1566
+ }),
1567
+ /* @__PURE__ */ K("label", {
1568
+ className: "cell-action-acknowledgment",
1569
+ children: [
1570
+ /* @__PURE__ */ G("input", {
1571
+ type: "checkbox",
1572
+ checked: a,
1573
+ onChange: (e) => o(e.target.checked)
1574
+ }),
1575
+ "I understand this deletes team ",
1576
+ e.name,
1577
+ " and its Configs."
1578
+ ]
1579
+ }),
1580
+ /* @__PURE__ */ K("div", {
1581
+ className: "cell-action-dialog-buttons",
1582
+ children: [/* @__PURE__ */ G("button", {
1583
+ type: "button",
1584
+ onClick: n,
1585
+ children: "Cancel"
1586
+ }), /* @__PURE__ */ G("button", {
1587
+ className: "danger-action",
1588
+ type: "submit",
1589
+ disabled: !a || t,
1590
+ children: t ? "Deleting…" : "Confirm Delete"
1591
+ })]
1592
+ })
1593
+ ]
1594
+ })
1595
+ });
1596
+ }
1597
+ function X({ list: e }) {
1598
+ let t = p(e);
1599
+ return /* @__PURE__ */ G("span", {
1600
+ className: `badge team-origin team-origin-${t}`,
1601
+ children: t
1602
+ });
1603
+ }
1604
+ function Z({ source: e }) {
1605
+ return e.stored ? /* @__PURE__ */ G("a", {
1606
+ className: "resource-name",
1607
+ href: r(e.stored),
1608
+ children: e.stored
1609
+ }) : /* @__PURE__ */ G("span", {
1610
+ className: "description",
1611
+ children: "defined by the team"
1612
+ });
1613
+ }
1614
+ function Q({ items: e, label: t }) {
1615
+ return /* @__PURE__ */ G("div", {
1616
+ className: "table-scroll",
1617
+ children: /* @__PURE__ */ K("table", {
1618
+ "aria-label": t,
1619
+ children: [/* @__PURE__ */ G("thead", { children: /* @__PURE__ */ K("tr", { children: [
1620
+ /* @__PURE__ */ G("th", { children: "Name" }),
1621
+ /* @__PURE__ */ G("th", { children: "Stored Source" }),
1622
+ /* @__PURE__ */ G("th", { children: "Address" }),
1623
+ /* @__PURE__ */ G("th", { children: "Ref" }),
1624
+ /* @__PURE__ */ G("th", { children: "Clone path" }),
1625
+ /* @__PURE__ */ G("th", { children: "Git identity" })
1626
+ ] }) }), /* @__PURE__ */ G("tbody", { children: e.map((e) => /* @__PURE__ */ K("tr", { children: [
1627
+ /* @__PURE__ */ K("td", { children: [/* @__PURE__ */ G("code", { children: e.alias }), !e.declared && /* @__PURE__ */ K(W, { children: [" ", /* @__PURE__ */ G("span", {
1628
+ className: "description",
1629
+ children: "(stored, not listed)"
1630
+ })] })] }),
1631
+ /* @__PURE__ */ G("td", { children: /* @__PURE__ */ G(Z, { source: e }) }),
1632
+ /* @__PURE__ */ G("td", {
1633
+ className: "mono-id",
1634
+ children: e.url || "—"
1635
+ }),
1636
+ /* @__PURE__ */ G("td", { children: e.ref || "the Source's" }),
1637
+ /* @__PURE__ */ G("td", {
1638
+ className: "mono-id",
1639
+ children: e.clonePath || "—"
1640
+ }),
1641
+ /* @__PURE__ */ G("td", { children: e.identity || "Default" })
1642
+ ] }, e.alias)) })]
1643
+ })
1644
+ });
1645
+ }
1646
+ function $({ name: t, data: r, onChanged: o }) {
1647
+ let [l, u] = U(""), [f, p] = U(), [m, h] = U(), [g, _] = U(!1), [v, y] = U(), { notify: S } = a(), C = r.summary, w = r.view;
1648
+ async function T() {
1649
+ if (!l) {
1650
+ u("reapply"), p(void 0);
1651
+ try {
1652
+ let e = await s(c(t, "reapply"), {});
1653
+ h(e), S({
1654
+ key: `team-reapply:${t}`,
1655
+ tone: "success",
1656
+ message: `Team ${t} reapplied.`
1657
+ }), o();
1658
+ } catch (e) {
1659
+ p(b(e));
1660
+ } finally {
1661
+ u("");
1662
+ }
1663
+ }
1664
+ }
1665
+ async function E() {
1666
+ u("delete"), p(void 0);
1667
+ try {
1668
+ let e = await s(c(t, "delete"), {});
1669
+ _(!1), y(e), S({
1670
+ key: `team-delete:${t}`,
1671
+ tone: "success",
1672
+ message: `Team ${t} deleted.`
1673
+ }), o();
1674
+ } catch (e) {
1675
+ _(!1), p(b(e));
1676
+ } finally {
1677
+ u("");
1678
+ }
1679
+ }
1680
+ if (v) {
1681
+ let n = e(v);
1682
+ return /* @__PURE__ */ G("section", {
1683
+ className: "panel",
1684
+ "aria-label": "Deleted team",
1685
+ children: /* @__PURE__ */ K("div", {
1686
+ className: "panel-body",
1687
+ children: [
1688
+ /* @__PURE__ */ K("p", {
1689
+ role: "status",
1690
+ children: [
1691
+ "Team ",
1692
+ /* @__PURE__ */ G("code", { children: t }),
1693
+ " deleted."
1694
+ ]
1695
+ }),
1696
+ !!n.removed.length && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("h3", { children: "Removed" }), /* @__PURE__ */ G("ul", {
1697
+ className: "state-list",
1698
+ children: n.removed.map((e) => /* @__PURE__ */ G("li", {
1699
+ className: "mono-id",
1700
+ children: e
1701
+ }, e))
1702
+ })] }),
1703
+ !!n.liveCells.length && /* @__PURE__ */ K(W, { children: [/* @__PURE__ */ G("h3", { children: "Cells still running" }), /* @__PURE__ */ G("ul", {
1704
+ className: "state-list",
1705
+ children: n.liveCells.map((e) => /* @__PURE__ */ G("li", {
1706
+ className: "mono-id",
1707
+ children: e
1708
+ }, e))
1709
+ })] }),
1710
+ !!n.keptVolumes.length && /* @__PURE__ */ K(W, { children: [
1711
+ /* @__PURE__ */ G("h3", { children: "State volumes kept" }),
1712
+ /* @__PURE__ */ G("ul", {
1713
+ className: "state-list",
1714
+ children: n.keptVolumes.map((e) => /* @__PURE__ */ G("li", {
1715
+ className: "mono-id",
1716
+ children: e
1717
+ }, e))
1718
+ }),
1719
+ /* @__PURE__ */ K("p", {
1720
+ className: "description",
1721
+ children: [
1722
+ "Delete them with ",
1723
+ /* @__PURE__ */ G("code", { children: "kuke delete volume" }),
1724
+ " when no longer needed."
1725
+ ]
1726
+ })
1727
+ ] }),
1728
+ /* @__PURE__ */ G("a", {
1729
+ href: d(),
1730
+ children: "Back to teams"
1731
+ })
1732
+ ]
1733
+ })
1734
+ });
1735
+ }
1736
+ let D = (e) => w?.configs.find((t) => t.name === e)?.scope;
1737
+ return /* @__PURE__ */ K(W, { children: [
1738
+ /* @__PURE__ */ K("section", {
1739
+ className: "panel",
1740
+ "aria-label": "Team overview",
1741
+ children: [/* @__PURE__ */ K("div", {
1742
+ className: "panel-heading",
1743
+ children: [/* @__PURE__ */ G("h2", { children: "Overview" }), /* @__PURE__ */ K("div", {
1744
+ className: "connector-actions",
1745
+ children: [
1746
+ /* @__PURE__ */ G("a", {
1747
+ className: "document-action",
1748
+ href: d(t, "edit"),
1749
+ children: "Edit"
1750
+ }),
1751
+ /* @__PURE__ */ G("a", {
1752
+ className: "document-action",
1753
+ href: d(t, "export"),
1754
+ children: "Export"
1755
+ }),
1756
+ /* @__PURE__ */ G("button", {
1757
+ type: "button",
1758
+ disabled: !!l,
1759
+ onClick: () => void T(),
1760
+ children: l === "reapply" ? "Reapplying…" : "Reapply"
1761
+ }),
1762
+ !C.system && /* @__PURE__ */ G("button", {
1763
+ type: "button",
1764
+ className: "danger-action",
1765
+ disabled: !!l,
1766
+ onClick: () => _(!0),
1767
+ children: "Delete"
1768
+ })
1769
+ ]
1770
+ })]
1771
+ }), /* @__PURE__ */ K("div", {
1772
+ className: "panel-body",
1773
+ children: [
1774
+ /* @__PURE__ */ K("dl", {
1775
+ className: "details-grid",
1776
+ children: [
1777
+ /* @__PURE__ */ G("dt", { children: "Realm" }),
1778
+ /* @__PURE__ */ G("dd", { children: C.realm }),
1779
+ /* @__PURE__ */ G("dt", { children: "Configs" }),
1780
+ /* @__PURE__ */ G("dd", { children: C.configs.length })
1781
+ ]
1782
+ }),
1783
+ C.system && /* @__PURE__ */ K("p", {
1784
+ className: "description",
1785
+ children: [
1786
+ "The ",
1787
+ C.name,
1788
+ " system team cannot be deleted; reset it with ",
1789
+ /* @__PURE__ */ G("code", { children: "kuke team init --force" }),
1790
+ "."
1791
+ ]
1792
+ }),
1793
+ w?.unresolved && /* @__PURE__ */ K("div", {
1794
+ className: "error",
1795
+ role: "alert",
1796
+ children: [/* @__PURE__ */ G("strong", { children: "The team does not resolve" }), /* @__PURE__ */ G("p", { children: w.unresolved })]
1797
+ }),
1798
+ r.problem && /* @__PURE__ */ K("div", {
1799
+ className: "error",
1800
+ role: "alert",
1801
+ children: [/* @__PURE__ */ G("strong", { children: "The team's setup could not be read" }), /* @__PURE__ */ G("p", { children: r.problem })]
1802
+ })
1803
+ ]
1804
+ })]
1805
+ }),
1806
+ f && /* @__PURE__ */ G(n, {
1807
+ error: f,
1808
+ kind: "Team"
1809
+ }),
1810
+ m && /* @__PURE__ */ G(ce, { outcome: m }),
1811
+ w && /* @__PURE__ */ K(W, { children: [
1812
+ /* @__PURE__ */ K("section", {
1813
+ className: "panel",
1814
+ "aria-label": "Project",
1815
+ children: [/* @__PURE__ */ G("div", {
1816
+ className: "panel-heading",
1817
+ children: /* @__PURE__ */ G("h2", { children: "Project" })
1818
+ }), /* @__PURE__ */ G("div", {
1819
+ className: "panel-body",
1820
+ children: w.project ? /* @__PURE__ */ G(Q, {
1821
+ items: [w.project],
1822
+ label: "Project source"
1823
+ }) : /* @__PURE__ */ G("p", {
1824
+ className: "description",
1825
+ children: "The team has no project."
1826
+ })
1827
+ })]
1828
+ }),
1829
+ /* @__PURE__ */ K("section", {
1830
+ className: "panel",
1831
+ "aria-label": "Sources",
1832
+ children: [/* @__PURE__ */ K("div", {
1833
+ className: "panel-heading",
1834
+ children: [/* @__PURE__ */ G("h2", { children: "Sources" }), /* @__PURE__ */ G(X, { list: w.sources })]
1835
+ }), /* @__PURE__ */ K("div", {
1836
+ className: "panel-body",
1837
+ children: [w.sources.items.length ? /* @__PURE__ */ G(Q, {
1838
+ items: w.sources.items,
1839
+ label: "Team sources"
1840
+ }) : /* @__PURE__ */ G("p", {
1841
+ className: "description",
1842
+ children: "No source besides the project."
1843
+ }), w.sources.inherited && /* @__PURE__ */ G("p", {
1844
+ className: "description",
1845
+ children: "The team lists no sources: its roles and harnesses read stored Sources by name."
1846
+ })]
1847
+ })]
1848
+ }),
1849
+ /* @__PURE__ */ K("section", {
1850
+ className: "panel",
1851
+ "aria-label": "Roles",
1852
+ children: [/* @__PURE__ */ K("div", {
1853
+ className: "panel-heading",
1854
+ children: [/* @__PURE__ */ G("h2", { children: "Roles" }), /* @__PURE__ */ G(X, { list: w.roles })]
1855
+ }), /* @__PURE__ */ G("div", {
1856
+ className: "panel-body",
1857
+ children: w.roles.items.length ? /* @__PURE__ */ G("div", {
1858
+ className: "table-scroll",
1859
+ children: /* @__PURE__ */ K("table", {
1860
+ "aria-label": "Team roles",
1861
+ children: [/* @__PURE__ */ G("thead", { children: /* @__PURE__ */ K("tr", { children: [
1862
+ /* @__PURE__ */ G("th", { children: "Role" }),
1863
+ /* @__PURE__ */ G("th", { children: "Source" }),
1864
+ /* @__PURE__ */ G("th", { children: "Path" }),
1865
+ /* @__PURE__ */ G("th", { children: "Harness" }),
1866
+ /* @__PURE__ */ G("th", { children: "Image needs" }),
1867
+ /* @__PURE__ */ G("th", { children: "Tasks" })
1868
+ ] }) }), /* @__PURE__ */ G("tbody", { children: w.roles.items.map((e) => /* @__PURE__ */ K("tr", { children: [
1869
+ /* @__PURE__ */ G("td", { children: e.name }),
1870
+ /* @__PURE__ */ G("td", { children: /* @__PURE__ */ G("code", { children: e.source }) }),
1871
+ /* @__PURE__ */ G("td", {
1872
+ className: "mono-id",
1873
+ children: e.path
1874
+ }),
1875
+ /* @__PURE__ */ G("td", { children: e.harness || "any" }),
1876
+ /* @__PURE__ */ G("td", { children: e.image.join(", ") || "—" }),
1877
+ /* @__PURE__ */ G("td", { children: e.allTasks ? /* @__PURE__ */ G("span", {
1878
+ className: "description",
1879
+ children: "all it declares"
1880
+ }) : e.selected.map(ee).join(", ") || "none" })
1881
+ ] }, e.name)) })]
1882
+ })
1883
+ }) : /* @__PURE__ */ G("p", {
1884
+ className: "description",
1885
+ children: "No role."
1886
+ })
1887
+ })]
1888
+ }),
1889
+ /* @__PURE__ */ K("section", {
1890
+ className: "panel",
1891
+ "aria-label": "Tasks",
1892
+ children: [/* @__PURE__ */ K("div", {
1893
+ className: "panel-heading",
1894
+ children: [/* @__PURE__ */ G("h2", { children: "Tasks" }), /* @__PURE__ */ G("span", {
1895
+ className: "badge",
1896
+ children: w.tasks.length
1897
+ })]
1898
+ }), /* @__PURE__ */ G("div", {
1899
+ className: "panel-body",
1900
+ children: w.tasks.length ? /* @__PURE__ */ G("div", {
1901
+ className: "team-tasks",
1902
+ children: w.tasks.map((e) => /* @__PURE__ */ K("section", {
1903
+ className: "team-task",
1904
+ "aria-label": `Task ${e.role} ${e.task}${e.harness ? ` on ${e.harness}` : ""}`,
1905
+ children: [/* @__PURE__ */ K("h3", { children: [
1906
+ e.role,
1907
+ " / ",
1908
+ e.task,
1909
+ e.harness ? ` on ${e.harness}` : "",
1910
+ " ",
1911
+ /* @__PURE__ */ G("a", {
1912
+ className: "resource-name mono-id",
1913
+ href: i(e.scope, e.config),
1914
+ children: e.config
1915
+ })
1916
+ ] }), e.schedule ? /* @__PURE__ */ G(te, {
1917
+ schedule: e.schedule,
1918
+ status: e.status,
1919
+ cellLink: () => void 0
1920
+ }) : /* @__PURE__ */ K("p", {
1921
+ className: "description",
1922
+ children: ["No schedule: the task runs when started by hand.", e.status?.lastScheduleTime ? /* @__PURE__ */ K(W, { children: [
1923
+ " Last run ",
1924
+ x(e.status.lastScheduleTime),
1925
+ "."
1926
+ ] }) : null]
1927
+ })]
1928
+ }, e.config))
1929
+ }) : /* @__PURE__ */ G("p", {
1930
+ className: "description",
1931
+ children: "The team renders no task Config."
1932
+ })
1933
+ })]
1934
+ }),
1935
+ /* @__PURE__ */ K("section", {
1936
+ className: "panel",
1937
+ "aria-label": "Harnesses",
1938
+ children: [/* @__PURE__ */ K("div", {
1939
+ className: "panel-heading",
1940
+ children: [/* @__PURE__ */ G("h2", { children: "Harnesses" }), /* @__PURE__ */ G(X, { list: w.harnesses })]
1941
+ }), /* @__PURE__ */ G("div", {
1942
+ className: "panel-body",
1943
+ children: w.harnesses.items.length ? /* @__PURE__ */ G("ul", {
1944
+ className: "state-list",
1945
+ children: w.harnesses.items.map((e) => /* @__PURE__ */ K("li", { children: [
1946
+ e.name,
1947
+ " ",
1948
+ /* @__PURE__ */ K("span", {
1949
+ className: "description",
1950
+ children: [
1951
+ /* @__PURE__ */ G("code", { children: e.source }),
1952
+ ":",
1953
+ e.path
1954
+ ]
1955
+ })
1956
+ ] }, e.name))
1957
+ }) : /* @__PURE__ */ G("p", {
1958
+ className: "description",
1959
+ children: "No harness."
1960
+ })
1961
+ })]
1962
+ }),
1963
+ /* @__PURE__ */ K("section", {
1964
+ className: "panel",
1965
+ "aria-label": "Connectors",
1966
+ children: [/* @__PURE__ */ K("div", {
1967
+ className: "panel-heading",
1968
+ children: [/* @__PURE__ */ G("h2", { children: "Connectors" }), /* @__PURE__ */ G(X, { list: w.connectors })]
1969
+ }), /* @__PURE__ */ K("div", {
1970
+ className: "panel-body",
1971
+ children: [w.connectors.items.length ? /* @__PURE__ */ G("ul", {
1972
+ className: "state-list",
1973
+ children: w.connectors.items.map((e) => /* @__PURE__ */ K("li", { children: [
1974
+ /* @__PURE__ */ G("code", { children: e.name }),
1975
+ " ",
1976
+ /* @__PURE__ */ K("span", {
1977
+ className: "description",
1978
+ children: [
1979
+ e.method || "default method",
1980
+ ", ",
1981
+ e.identity || "identity from the scope defaults"
1982
+ ]
1983
+ })
1984
+ ] }, e.name))
1985
+ }) : /* @__PURE__ */ G("p", {
1986
+ className: "description",
1987
+ children: "No connector choice: every connector uses its default method and the scope defaults' identity."
1988
+ }), /* @__PURE__ */ G(Y, {
1989
+ rows: w.connectors.roles ?? [],
1990
+ configs: w.configs
1991
+ })]
1992
+ })]
1993
+ })
1994
+ ] }),
1995
+ /* @__PURE__ */ K("section", {
1996
+ className: "panel",
1997
+ "aria-label": "Configs",
1998
+ children: [/* @__PURE__ */ K("div", {
1999
+ className: "panel-heading",
2000
+ children: [/* @__PURE__ */ G("h2", { children: "Configs" }), /* @__PURE__ */ G("span", {
2001
+ className: "badge",
2002
+ children: C.configs.length
2003
+ })]
2004
+ }), /* @__PURE__ */ G("div", {
2005
+ className: "panel-body",
2006
+ children: C.configs.length ? /* @__PURE__ */ G("ul", {
2007
+ className: "state-list",
2008
+ children: C.configs.map((e) => {
2009
+ let t = D(e);
2010
+ return /* @__PURE__ */ G("li", { children: t ? /* @__PURE__ */ G("a", {
2011
+ className: "resource-name",
2012
+ href: i(t, e),
2013
+ children: e
2014
+ }) : /* @__PURE__ */ G("span", {
2015
+ className: "mono-id",
2016
+ children: e
2017
+ }) }, e);
2018
+ })
2019
+ }) : /* @__PURE__ */ G("p", {
2020
+ className: "description",
2021
+ children: "none"
2022
+ })
2023
+ })]
2024
+ }),
2025
+ m && /* @__PURE__ */ G(ue, {
2026
+ plan: m.plan,
2027
+ title: "Applied"
2028
+ }),
2029
+ g && /* @__PURE__ */ G(ke, {
2030
+ team: C,
2031
+ pending: l === "delete",
2032
+ onCancel: () => _(!1),
2033
+ onConfirm: () => void E()
2034
+ })
2035
+ ] });
2036
+ }
2037
+ function Ae({ name: e, revision: t }) {
2038
+ let [r, i] = U(!1), [a, o] = U(!1), s = u(v(e, {
2039
+ hostFields: r,
2040
+ explicit: a
2041
+ }), t), [c, l] = U(!1), d = s.data?.document ?? "", f = he(() => d ? URL.createObjectURL(new Blob([d], { type: "application/yaml" })) : "", [d]);
2042
+ H(() => () => {
2043
+ f && URL.revokeObjectURL(f);
2044
+ }, [f]);
2045
+ async function p() {
2046
+ try {
2047
+ await navigator.clipboard.writeText(d), l(!0);
2048
+ } catch {
2049
+ l(!1);
2050
+ }
2051
+ }
2052
+ return /* @__PURE__ */ K("section", {
2053
+ className: "panel",
2054
+ "aria-label": "Export",
2055
+ children: [/* @__PURE__ */ K("div", {
2056
+ className: "panel-heading",
2057
+ children: [/* @__PURE__ */ G("h2", { children: "kuketeam.yaml" }), /* @__PURE__ */ K("div", {
2058
+ className: "connector-actions",
2059
+ children: [/* @__PURE__ */ G("button", {
2060
+ type: "button",
2061
+ disabled: !d,
2062
+ onClick: () => void p(),
2063
+ children: c ? "Copied" : "Copy"
2064
+ }), f ? /* @__PURE__ */ G("a", {
2065
+ className: "document-action",
2066
+ href: f,
2067
+ download: "kuketeam.yaml",
2068
+ children: "Download"
2069
+ }) : /* @__PURE__ */ G("span", {
2070
+ className: "document-action",
2071
+ "aria-disabled": "true",
2072
+ children: "Download"
2073
+ })]
2074
+ })]
2075
+ }), /* @__PURE__ */ K("div", {
2076
+ className: "panel-body",
2077
+ children: [
2078
+ /* @__PURE__ */ K("p", {
2079
+ className: "description",
2080
+ children: [
2081
+ "The team as a repository's ",
2082
+ /* @__PURE__ */ G("code", { children: "kuketeam.yaml" }),
2083
+ ", the output of ",
2084
+ /* @__PURE__ */ K("code", { children: ["kuke team export ", e] }),
2085
+ ". Commit it to the project repository to create the team from it again."
2086
+ ]
2087
+ }),
2088
+ /* @__PURE__ */ K("div", {
2089
+ className: "connector-actions",
2090
+ children: [/* @__PURE__ */ K("label", {
2091
+ className: "schema-check",
2092
+ children: [/* @__PURE__ */ G("input", {
2093
+ type: "checkbox",
2094
+ checked: r,
2095
+ onChange: (e) => {
2096
+ i(e.target.checked), l(!1);
2097
+ }
2098
+ }), /* @__PURE__ */ K("span", { children: [
2099
+ "Keep host fields (",
2100
+ /* @__PURE__ */ G("code", { children: "--host-fields" }),
2101
+ "): realm, stored Source names, refs, git identities and secret bindings"
2102
+ ] })]
2103
+ }), /* @__PURE__ */ K("label", {
2104
+ className: "schema-check",
2105
+ children: [/* @__PURE__ */ G("input", {
2106
+ type: "checkbox",
2107
+ checked: a,
2108
+ onChange: (e) => {
2109
+ o(e.target.checked), l(!1);
2110
+ }
2111
+ }), /* @__PURE__ */ K("span", { children: [
2112
+ "Write inherited lists out (",
2113
+ /* @__PURE__ */ G("code", { children: "--explicit-defaults" }),
2114
+ ")"
2115
+ ] })]
2116
+ })]
2117
+ }),
2118
+ s.error && /* @__PURE__ */ G(n, {
2119
+ error: s.error,
2120
+ kind: "Team"
2121
+ }),
2122
+ s.loading && !s.data && /* @__PURE__ */ G("p", {
2123
+ role: "status",
2124
+ children: "Exporting…"
2125
+ }),
2126
+ d && /* @__PURE__ */ G("pre", {
2127
+ className: "team-export",
2128
+ tabIndex: 0,
2129
+ "aria-label": "Exported kuketeam.yaml",
2130
+ children: d
2131
+ })
2132
+ ]
2133
+ })]
2134
+ });
2135
+ }
2136
+ function je({ name: e, section: t, revision: r, onChanged: i }) {
2137
+ let a = u(c(e), r);
2138
+ return t === "export" ? /* @__PURE__ */ G(Ae, {
2139
+ name: e,
2140
+ revision: r
2141
+ }) : a.error ? /* @__PURE__ */ G(n, {
2142
+ error: a.error,
2143
+ kind: "Team"
2144
+ }) : a.data ? t === "edit" ? /* @__PURE__ */ G(J, {
2145
+ mode: "edit",
2146
+ team: a.data,
2147
+ onChanged: i
2148
+ }) : /* @__PURE__ */ G($, {
2149
+ name: e,
2150
+ data: a.data,
2151
+ onChanged: i
2152
+ }) : /* @__PURE__ */ G("p", {
2153
+ role: "status",
2154
+ children: "Loading team…"
2155
+ });
2156
+ }
2157
+ function Me({ name: e, section: t, revision: i, onChanged: a }) {
2158
+ let [o, s] = U(0), l = () => {
2159
+ s((e) => e + 1), a();
2160
+ }, d = u(e ? null : c(), i + o);
2161
+ return e ? /* @__PURE__ */ G(je, {
2162
+ name: e,
2163
+ section: t,
2164
+ revision: i + o,
2165
+ onChanged: l
2166
+ }, `${e}/${t ?? ""}`) : /* @__PURE__ */ K(W, { children: [
2167
+ d.error && /* @__PURE__ */ G(n, {
2168
+ error: d.error,
2169
+ kind: "Teams"
2170
+ }),
2171
+ d.loading && !d.data && /* @__PURE__ */ G("p", {
2172
+ role: "status",
2173
+ children: "Loading teams…"
2174
+ }),
2175
+ d.data && /* @__PURE__ */ G(Oe, {
2176
+ teams: d.data.teams,
2177
+ onChanged: l
2178
+ }),
2179
+ d.data && d.data.teams.length > 0 && !d.data.teams.some((e) => e.name === "kuke") && /* @__PURE__ */ K("div", {
2180
+ className: "initialize-empty",
2181
+ role: "note",
2182
+ children: [/* @__PURE__ */ G("p", {
2183
+ className: "description",
2184
+ children: "The kuke team is not stored. Initialize creates it, the default team and the initial defaults."
2185
+ }), /* @__PURE__ */ G(V, { onChanged: l })]
2186
+ }),
2187
+ /* @__PURE__ */ K("p", {
2188
+ className: "description",
2189
+ children: [
2190
+ "Where roles and harnesses come from is on the ",
2191
+ /* @__PURE__ */ G("a", {
2192
+ href: r(),
2193
+ children: "Sources"
2194
+ }),
2195
+ " page."
2196
+ ]
2197
+ })
2198
+ ] });
2199
+ }
2200
+ function Ne({ onChanged: e }) {
2201
+ return /* @__PURE__ */ G(J, {
2202
+ mode: "new",
2203
+ onChanged: e
2204
+ });
2205
+ }
2206
+ export { Ne as NewTeamPage, Me as TeamsPage };