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

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