@meirblachman/azure-pipelines-visualizer 0.2.3 → 0.2.5

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.
@@ -1,19 +1,19 @@
1
- import { jsx as s, jsxs as l, Fragment as Je } from "react/jsx-runtime";
2
- import { memo as Ze, useMemo as ve, useEffect as ee, useCallback as ne, useState as L, useRef as Q, Component as yt, createContext as wt, useContext as Pt, createElement as Et } from "react";
3
- import { collapsePath as Rt, parseAdoCommitUrl as xt, parseYaml as ue, extractTaskReferences as kt, resolveTaskDocUrl as Tt, extractVariableValues as Pe, detectTemplateReferences as Oe, extractParameterDefaults as ze, buildAdoFileUrl as rt, getEffectiveRepoAlias as ie, extractDeclaredParameterNames as Qe, pathHasExpressions as me, resolveExpressionPath as Te, resolveTemplateRefPaths as it, evaluateExpression as $t, resolveTemplateSource as lt, parseTemplatePath as St, resolveAllExpressions as Ct, parseAdoUrl as Dt } from "@meirblachman/azure-pipelines-visualizer-core";
4
- import $e from "@dagrejs/dagre";
5
- import { Handle as Se, Position as Ce, useNodesState as ct, useEdgesState as dt, ReactFlow as pt, Background as ut, Controls as mt, getBezierPath as At, BaseEdge as It, EdgeLabelRenderer as Lt, MarkerType as De, BackgroundVariant as Ft } from "@xyflow/react";
6
- import Bt from "@monaco-editor/react";
7
- import { create as Ut } from "zustand";
8
- import Mt from "react-dom";
9
- const Le = "7.1";
10
- function Fe(e, t) {
1
+ import { jsx as n, jsxs as i, Fragment as Qe } from "react/jsx-runtime";
2
+ import { useState as I, useEffect as Q, useMemo as ie, useCallback as se, memo as tt, useRef as ne, Component as Rt, createContext as kt, useContext as $t, createElement as xt } from "react";
3
+ import { collapsePath as Ct, parseAdoCommitUrl as St, parseYaml as fe, extractTaskReferences as Dt, resolveTaskDocUrl as It, extractVariableValues as Te, detectTemplateReferences as je, extractParameterDefaults as We, buildAdoFileUrl as pt, getEffectiveRepoAlias as de, extractDeclaredParameterNames as at, pathHasExpressions as ge, resolveExpressionPath as Ce, resolveTemplateRefPaths as ut, evaluateExpression as At, resolveTemplateSource as mt, parseTemplatePath as Lt, resolveAllExpressions as Bt, parseAdoUrl as Ft } from "@meirblachman/azure-pipelines-visualizer-core";
4
+ import Se from "@dagrejs/dagre";
5
+ import { Handle as De, Position as Ie, useNodesState as ht, useEdgesState as ft, ReactFlow as gt, Background as _t, Controls as Nt, getBezierPath as Ut, BaseEdge as Mt, EdgeLabelRenderer as Ot, MarkerType as Ae, BackgroundVariant as Vt } from "@xyflow/react";
6
+ import jt from "@monaco-editor/react";
7
+ import { create as Wt } from "zustand";
8
+ import zt from "react-dom";
9
+ const Fe = "7.1";
10
+ function Ue(e, t) {
11
11
  return `https://dev.azure.com/${encodeURIComponent(e)}/${encodeURIComponent(t)}/_apis`;
12
12
  }
13
- function Vt(e) {
13
+ function Ht(e) {
14
14
  return e.startsWith("refs/heads/") ? { version: e.slice(11), versionType: "branch" } : e.startsWith("refs/tags/") ? { version: e.slice(10), versionType: "tag" } : /^[0-9a-f]{40}$/i.test(e) ? { version: e, versionType: "commit" } : { version: e, versionType: "branch" };
15
15
  }
16
- async function Be(e) {
16
+ async function Me(e) {
17
17
  const t = await fetch(e, { credentials: "include" });
18
18
  if (!t.ok) {
19
19
  const a = await t.text();
@@ -21,228 +21,515 @@ async function Be(e) {
21
21
  }
22
22
  return t;
23
23
  }
24
- async function ht(e, t, a, o, r) {
25
- const n = o.startsWith("/") ? o : `/${o}`, c = Rt(n);
26
- let d = `${Fe(e, t)}/git/repositories/${encodeURIComponent(a)}/items?path=${encodeURIComponent(c)}&api-version=${Le}&includeContent=true&$format=text`;
27
- if (r) {
28
- const h = Vt(r);
29
- d += `&versionDescriptor.version=${encodeURIComponent(h.version)}&versionDescriptor.versionType=${h.versionType}`;
24
+ async function vt(e, t, a, r, o) {
25
+ const s = r.startsWith("/") ? r : `/${r}`, d = Ct(s);
26
+ let m = `${Ue(e, t)}/git/repositories/${encodeURIComponent(a)}/items?path=${encodeURIComponent(d)}&api-version=${Fe}&includeContent=true&$format=text`;
27
+ if (o) {
28
+ const c = Ht(o);
29
+ m += `&versionDescriptor.version=${encodeURIComponent(c.version)}&versionDescriptor.versionType=${c.versionType}`;
30
30
  }
31
- return (await Be(d)).text();
32
- }
33
- async function Ot(e, t) {
34
- const a = `${Fe(e, t)}/pipelines?api-version=${Le}`;
35
- return (await (await Be(a)).json()).value;
36
- }
37
- async function zt(e, t, a) {
38
- var u, h, i, m, f;
39
- const o = `${Fe(e, t)}/build/definitions/${a}?api-version=${Le}`, n = await (await Be(o)).json(), c = {
40
- id: n.id,
41
- name: n.name,
42
- path: ((u = n.process) == null ? void 0 : u.yamlFilename) ?? n.path,
31
+ return (await Me(m)).text();
32
+ }
33
+ async function Gt(e, t) {
34
+ const a = `${Ue(e, t)}/pipelines?api-version=${Fe}`;
35
+ return (await (await Me(a)).json()).value;
36
+ }
37
+ async function Kt(e, t, a) {
38
+ var u, c, l, h, g;
39
+ const r = `${Ue(e, t)}/build/definitions/${a}?api-version=${Fe}`, s = await (await Me(r)).json(), d = {
40
+ id: s.id,
41
+ name: s.name,
42
+ path: ((u = s.process) == null ? void 0 : u.yamlFilename) ?? s.path,
43
43
  repository: {
44
- id: (h = n.repository) == null ? void 0 : h.id,
45
- name: (i = n.repository) == null ? void 0 : i.name,
46
- type: (m = n.repository) == null ? void 0 : m.type,
47
- defaultBranch: (f = n.repository) == null ? void 0 : f.defaultBranch
44
+ id: (c = s.repository) == null ? void 0 : c.id,
45
+ name: (l = s.repository) == null ? void 0 : l.name,
46
+ type: (h = s.repository) == null ? void 0 : h.type,
47
+ defaultBranch: (g = s.repository) == null ? void 0 : g.defaultBranch
48
48
  }
49
- }, d = await ht(
49
+ }, m = await vt(
50
50
  e,
51
51
  t,
52
- c.repository.id,
53
- c.path,
54
- c.repository.defaultBranch
52
+ d.repository.id,
53
+ d.path,
54
+ d.repository.defaultBranch
55
55
  );
56
- return { definition: c, yaml: d };
56
+ return { definition: d, yaml: m };
57
57
  }
58
- async function jt(e, t, a, o, r) {
59
- return { content: await ht(e, t, a, o, r), path: o, repoId: a, repoName: a, branch: r || "" };
58
+ async function Yt(e, t, a, r, o) {
59
+ return { content: await vt(e, t, a, r, o), path: r, repoId: a, repoName: a, branch: o || "" };
60
60
  }
61
- async function Wt() {
61
+ async function qt() {
62
62
  return { customTaskDocs: {} };
63
63
  }
64
- async function Ht(e) {
64
+ async function Jt(e) {
65
65
  return { tasks: [], cached: !1 };
66
66
  }
67
- async function Kt(e, t, a, o) {
68
- const r = new URLSearchParams({
69
- "api-version": Le,
67
+ async function Xt(e, t, a, r) {
68
+ const o = new URLSearchParams({
69
+ "api-version": Fe,
70
70
  repositoryId: a,
71
71
  repositoryType: "TfsGit",
72
- sourceVersion: o,
72
+ sourceVersion: r,
73
73
  queryOrder: "queueTimeAscending",
74
74
  maxBuildsPerDefinition: "50"
75
- }), n = `${Fe(e, t)}/build/builds?${r}`;
76
- return (await (await Be(n)).json()).value ?? [];
77
- }
78
- const ft = "/api";
79
- var ot;
80
- const he = typeof window < "u" && ((ot = window.location) == null ? void 0 : ot.protocol) === "chrome-extension:";
81
- async function Ne(e) {
82
- const t = await fetch(`${ft}${e}`);
75
+ }), s = `${Ue(e, t)}/build/builds?${o}`;
76
+ return (await (await Me(s)).json()).value ?? [];
77
+ }
78
+ const bt = "/api";
79
+ var dt;
80
+ const _e = typeof window < "u" && ((dt = window.location) == null ? void 0 : dt.protocol) === "chrome-extension:";
81
+ async function ye(e) {
82
+ const t = await fetch(`${bt}${e}`);
83
83
  if (!t.ok) {
84
84
  const a = await t.text();
85
85
  throw new Error(`API error (${t.status}): ${a}`);
86
86
  }
87
87
  return t.json();
88
88
  }
89
- function Ka(e, t) {
90
- return he ? Ot(e, t) : Ne(`/${e}/${t}/pipelines`);
89
+ function nn(e, t) {
90
+ return _e ? Gt(e, t) : ye(`/${e}/${t}/pipelines`);
91
91
  }
92
- function Gt(e, t, a) {
93
- return he ? zt(e, t, a) : Ne(`/${e}/${t}/pipelines/${a}/yaml`);
92
+ function Zt(e, t, a) {
93
+ return _e ? Kt(e, t, a) : ye(`/${e}/${t}/pipelines/${a}/yaml`);
94
94
  }
95
- function gt(e, t, a, o, r) {
96
- if (he)
97
- return jt(e, t, a, o, r);
98
- const n = new URLSearchParams({ repo: a, path: o });
99
- return r && n.set("branch", r), Ne(`/${e}/${t}/file-by-repo-name?${n}`);
95
+ function yt(e, t, a, r, o) {
96
+ if (_e)
97
+ return Yt(e, t, a, r, o);
98
+ const s = new URLSearchParams({ repo: a, path: r });
99
+ return o && s.set("branch", o), ye(`/${e}/${t}/file-by-repo-name?${s}`);
100
100
  }
101
- function qt() {
102
- return he ? Wt() : Ne("/config/task-docs");
101
+ function Qt() {
102
+ return _e ? qt() : ye("/config/task-docs");
103
103
  }
104
- function Yt(e) {
105
- return he ? Ht() : Ne(`/${e}/schema/tasks`);
104
+ function ea(e) {
105
+ return _e ? Jt() : ye(`/${e}/schema/tasks`);
106
106
  }
107
- function Jt(e, t, a, o, r, n, c) {
108
- const d = new AbortController();
109
- if (he)
110
- return Kt(e, t, a, o).then((m) => {
111
- r(m), n();
107
+ function ta(e, t, a, r, o, s, d) {
108
+ const m = new AbortController();
109
+ if (_e)
110
+ return Xt(e, t, a, r).then((h) => {
111
+ o(h), s();
112
112
  }).catch(
113
- (m) => c(m instanceof Error ? m.message : String(m))
114
- ), d;
115
- const u = new URLSearchParams({ repoName: a, commitSha: o }), h = `${ft}/${e}/${t}/commit-flow/stream?${u}`, i = new EventSource(h);
116
- return d.signal.addEventListener("abort", () => i.close()), i.addEventListener("builds", (m) => {
113
+ (h) => d(h instanceof Error ? h.message : String(h))
114
+ ), m;
115
+ const u = new URLSearchParams({ repoName: a, commitSha: r }), c = `${bt}/${e}/${t}/commit-flow/stream?${u}`, l = new EventSource(c);
116
+ return m.signal.addEventListener("abort", () => l.close()), l.addEventListener("builds", (h) => {
117
117
  try {
118
- const f = JSON.parse(m.data);
119
- r(f);
118
+ const g = JSON.parse(h.data);
119
+ o(g);
120
120
  } catch {
121
121
  }
122
- }), i.addEventListener("done", () => {
123
- i.close(), n();
124
- }), i.addEventListener("error", (m) => {
125
- i.close();
126
- const f = m instanceof MessageEvent && m.data ? JSON.parse(m.data).error : "Connection lost";
127
- c(f);
128
- }), d;
129
- }
130
- function je(e) {
122
+ }), l.addEventListener("done", () => {
123
+ l.close(), s();
124
+ }), l.addEventListener("error", (h) => {
125
+ l.close();
126
+ const g = h instanceof MessageEvent && h.data ? JSON.parse(h.data).error : "Connection lost";
127
+ d(g);
128
+ }), m;
129
+ }
130
+ const aa = {
131
+ succeeded: "#28a745",
132
+ succeededWithIssues: "#dbab09",
133
+ failed: "#d73a49",
134
+ canceled: "#dbab09",
135
+ skipped: "#6a737d",
136
+ abandoned: "#6a737d"
137
+ }, ze = 28, He = 280, na = 4;
138
+ function nt(e) {
139
+ return e.state === "pending" || e.state === "inProgress" ? e.state === "inProgress" ? "#58a6ff" : "#6a737d" : aa[e.result ?? ""] ?? "#6a737d";
140
+ }
141
+ function st(e) {
142
+ if (e < 1e3) return `${e}ms`;
143
+ const t = Math.floor(e / 1e3);
144
+ if (t < 60) return `${t}s`;
145
+ const a = Math.floor(t / 60), r = t % 60;
146
+ if (a < 60) return `${a}m ${r}s`;
147
+ const o = Math.floor(a / 60), s = a % 60;
148
+ return `${o}h ${s}m`;
149
+ }
150
+ function sa(e) {
151
+ const t = /* @__PURE__ */ new Map(), a = [];
152
+ for (const o of e)
153
+ t.set(o.id, { record: o, children: [], depth: 0 });
154
+ for (const o of t.values())
155
+ o.record.parentId && t.has(o.record.parentId) ? t.get(o.record.parentId).children.push(o) : a.push(o);
156
+ const r = (o, s) => {
157
+ for (const d of o)
158
+ d.depth = s, d.children.sort((m, u) => m.record.order - u.record.order), r(d.children, s + 1);
159
+ };
160
+ return a.sort((o, s) => o.record.order - s.record.order), r(a, 0), a;
161
+ }
162
+ function ra(e) {
163
+ const t = [], a = (r) => {
164
+ for (const o of r)
165
+ t.push(o), a(o.children);
166
+ };
167
+ return a(e), t;
168
+ }
169
+ function oa({ org: e, project: t, buildId: a }) {
170
+ const [r, o] = I([]), [s, d] = I(!1), [m, u] = I(null), [c, l] = I(null);
171
+ Q(() => {
172
+ !e || !t || !a || (d(!0), u(null), l(null), fetch(
173
+ `/api/${encodeURIComponent(e)}/${encodeURIComponent(t)}/builds/${encodeURIComponent(String(a))}/timeline`
174
+ ).then((_) => {
175
+ if (!_.ok) throw new Error(`HTTP ${_.status}`);
176
+ return _.json();
177
+ }).then((_) => {
178
+ o(_), d(!1);
179
+ }).catch((_) => {
180
+ u(_.message), d(!1);
181
+ }));
182
+ }, [e, t, a]);
183
+ const h = ie(() => sa(r), [r]), g = ie(() => ra(h), [h]), { minTime: p, maxTime: w } = ie(() => {
184
+ let _ = Number.POSITIVE_INFINITY, T = Number.NEGATIVE_INFINITY;
185
+ for (const x of g) {
186
+ if (x.record.startTime) {
187
+ const k = new Date(x.record.startTime).getTime();
188
+ k < _ && (_ = k);
189
+ }
190
+ if (x.record.finishTime) {
191
+ const k = new Date(x.record.finishTime).getTime();
192
+ k > T && (T = k);
193
+ }
194
+ }
195
+ return Number.isFinite(_) || (_ = Date.now()), Number.isFinite(T) || (T = _ + 1e3), { minTime: _, maxTime: T };
196
+ }, [g]), R = w - p || 1, f = se((_) => {
197
+ l((T) => (T == null ? void 0 : T.id) === _.id ? null : _);
198
+ }, []);
199
+ if (s)
200
+ return /* @__PURE__ */ n("div", { className: "gantt-loading", children: "Loading timeline…" });
201
+ if (m)
202
+ return /* @__PURE__ */ i("div", { className: "gantt-error", children: [
203
+ "Error: ",
204
+ m
205
+ ] });
206
+ if (g.length === 0)
207
+ return /* @__PURE__ */ n("div", { className: "gantt-empty", children: "No timeline records found." });
208
+ const y = 6, P = [];
209
+ for (let _ = 0; _ <= y; _++)
210
+ P.push(p + R * _ / y);
211
+ const b = 600, F = g.length * ze + 30;
212
+ return /* @__PURE__ */ i("div", { className: "gantt-container", children: [
213
+ /* @__PURE__ */ i(
214
+ "div",
215
+ {
216
+ className: "gantt-chart",
217
+ style: { minWidth: He + b + 16 },
218
+ children: [
219
+ /* @__PURE__ */ i("div", { className: "gantt-header", style: { height: 30 }, children: [
220
+ /* @__PURE__ */ n("div", { className: "gantt-label-col", style: { width: He }, children: "Task" }),
221
+ /* @__PURE__ */ n(
222
+ "div",
223
+ {
224
+ className: "gantt-bar-col",
225
+ style: { width: b, position: "relative" },
226
+ children: P.map((_) => {
227
+ const T = (_ - p) / R * b;
228
+ return /* @__PURE__ */ n("span", { className: "gantt-tick", style: { left: T }, children: new Date(_).toLocaleTimeString() }, _);
229
+ })
230
+ }
231
+ )
232
+ ] }),
233
+ /* @__PURE__ */ n("div", { className: "gantt-body", style: { height: F - 30 }, children: g.map((_, T) => {
234
+ const x = _.record, k = x.startTime ? new Date(x.startTime).getTime() : null, L = x.finishTime ? new Date(x.finishTime).getTime() : null;
235
+ let z = 0, ee = 0;
236
+ if (k != null) {
237
+ z = (k - p) / R * b;
238
+ const pe = L ?? Date.now();
239
+ ee = Math.max(
240
+ na,
241
+ (pe - k) / R * b
242
+ );
243
+ }
244
+ const G = nt(x), Ne = (c == null ? void 0 : c.id) === x.id, te = k && L ? st(L - k) : "";
245
+ return /* @__PURE__ */ i(
246
+ "div",
247
+ {
248
+ className: `gantt-row ${Ne ? "gantt-row--selected" : ""}`,
249
+ style: { height: ze, top: T * ze },
250
+ children: [
251
+ /* @__PURE__ */ i(
252
+ "div",
253
+ {
254
+ className: "gantt-label-col",
255
+ style: {
256
+ width: He,
257
+ paddingLeft: 8 + _.depth * 16
258
+ },
259
+ title: x.name,
260
+ children: [
261
+ /* @__PURE__ */ n(
262
+ "span",
263
+ {
264
+ className: `gantt-type-badge gantt-type-badge--${x.type.toLowerCase()}`,
265
+ children: x.type === "Stage" ? "▶" : x.type === "Job" ? "◆" : "•"
266
+ }
267
+ ),
268
+ /* @__PURE__ */ n("span", { className: "gantt-label-text", children: x.name })
269
+ ]
270
+ }
271
+ ),
272
+ /* @__PURE__ */ n("div", { className: "gantt-bar-col", style: { width: b }, children: k != null && /* @__PURE__ */ n(
273
+ "button",
274
+ {
275
+ type: "button",
276
+ className: "gantt-bar",
277
+ style: {
278
+ left: z,
279
+ width: ee,
280
+ background: G
281
+ },
282
+ onClick: () => f(x),
283
+ title: `${x.name} — ${te}`,
284
+ children: ee > 50 && /* @__PURE__ */ n("span", { className: "gantt-bar-label", children: te })
285
+ }
286
+ ) })
287
+ ]
288
+ },
289
+ x.id
290
+ );
291
+ }) })
292
+ ]
293
+ }
294
+ ),
295
+ c && /* @__PURE__ */ i("div", { className: "gantt-detail", children: [
296
+ /* @__PURE__ */ i("div", { className: "gantt-detail__header", children: [
297
+ /* @__PURE__ */ n("h3", { children: c.name }),
298
+ /* @__PURE__ */ n(
299
+ "button",
300
+ {
301
+ className: "gantt-detail__close",
302
+ onClick: () => l(null),
303
+ type: "button",
304
+ children: "×"
305
+ }
306
+ )
307
+ ] }),
308
+ /* @__PURE__ */ i("div", { className: "gantt-detail__body", children: [
309
+ /* @__PURE__ */ i("div", { className: "gantt-detail__row", children: [
310
+ /* @__PURE__ */ n("span", { className: "gantt-detail__label", children: "Type" }),
311
+ /* @__PURE__ */ n("span", { children: c.type })
312
+ ] }),
313
+ /* @__PURE__ */ i("div", { className: "gantt-detail__row", children: [
314
+ /* @__PURE__ */ n("span", { className: "gantt-detail__label", children: "State" }),
315
+ /* @__PURE__ */ n("span", { children: c.state })
316
+ ] }),
317
+ /* @__PURE__ */ i("div", { className: "gantt-detail__row", children: [
318
+ /* @__PURE__ */ n("span", { className: "gantt-detail__label", children: "Result" }),
319
+ /* @__PURE__ */ n("span", { style: { color: nt(c) }, children: c.result ?? "—" })
320
+ ] }),
321
+ c.workerName && /* @__PURE__ */ i("div", { className: "gantt-detail__row", children: [
322
+ /* @__PURE__ */ n("span", { className: "gantt-detail__label", children: "Worker" }),
323
+ /* @__PURE__ */ n("span", { children: c.workerName })
324
+ ] }),
325
+ c.startTime && c.finishTime && /* @__PURE__ */ i("div", { className: "gantt-detail__row", children: [
326
+ /* @__PURE__ */ n("span", { className: "gantt-detail__label", children: "Duration" }),
327
+ /* @__PURE__ */ n("span", { children: st(
328
+ new Date(c.finishTime).getTime() - new Date(c.startTime).getTime()
329
+ ) })
330
+ ] }),
331
+ c.startTime && /* @__PURE__ */ i("div", { className: "gantt-detail__row", children: [
332
+ /* @__PURE__ */ n("span", { className: "gantt-detail__label", children: "Start" }),
333
+ /* @__PURE__ */ n("span", { children: new Date(c.startTime).toLocaleString() })
334
+ ] }),
335
+ c.finishTime && /* @__PURE__ */ i("div", { className: "gantt-detail__row", children: [
336
+ /* @__PURE__ */ n("span", { className: "gantt-detail__label", children: "Finish" }),
337
+ /* @__PURE__ */ n("span", { children: new Date(c.finishTime).toLocaleString() })
338
+ ] }),
339
+ (c.errorCount > 0 || c.warningCount > 0) && /* @__PURE__ */ i("div", { className: "gantt-detail__row", children: [
340
+ /* @__PURE__ */ n("span", { className: "gantt-detail__label", children: "Issues" }),
341
+ /* @__PURE__ */ i("span", { children: [
342
+ c.errorCount > 0 && /* @__PURE__ */ i("span", { className: "gantt-detail__errors", children: [
343
+ c.errorCount,
344
+ " error",
345
+ c.errorCount !== 1 ? "s" : ""
346
+ ] }),
347
+ c.errorCount > 0 && c.warningCount > 0 && ", ",
348
+ c.warningCount > 0 && /* @__PURE__ */ i("span", { className: "gantt-detail__warnings", children: [
349
+ c.warningCount,
350
+ " warning",
351
+ c.warningCount !== 1 ? "s" : ""
352
+ ] })
353
+ ] })
354
+ ] }),
355
+ c.issues && c.issues.length > 0 && /* @__PURE__ */ i("div", { className: "gantt-detail__issues", children: [
356
+ /* @__PURE__ */ n("span", { className: "gantt-detail__label", children: "Messages" }),
357
+ /* @__PURE__ */ n("ul", { children: c.issues.map((_, T) => /* @__PURE__ */ n(
358
+ "li",
359
+ {
360
+ className: `gantt-detail__issue gantt-detail__issue--${_.type}`,
361
+ children: _.message
362
+ },
363
+ `${_.type}-${T}`
364
+ )) })
365
+ ] })
366
+ ] })
367
+ ] })
368
+ ] });
369
+ }
370
+ function Ge(e) {
131
371
  return e ? new Date(e).toLocaleString() : "—";
132
372
  }
133
- function Xt(e, t) {
373
+ function ia(e, t) {
134
374
  if (!e || !t) return null;
135
375
  const a = new Date(t).getTime() - new Date(e).getTime();
136
376
  if (a < 0) return null;
137
- const o = Math.floor(a / 1e3);
138
- if (o < 60) return `${o}s`;
139
- const r = Math.floor(o / 60), n = o % 60;
140
- if (r < 60) return `${r}m ${n}s`;
141
- const c = Math.floor(r / 60), d = r % 60;
142
- return `${c}h ${d}m`;
143
- }
144
- function Zt(e, t) {
377
+ const r = Math.floor(a / 1e3);
378
+ if (r < 60) return `${r}s`;
379
+ const o = Math.floor(r / 60), s = r % 60;
380
+ if (o < 60) return `${o}m ${s}s`;
381
+ const d = Math.floor(o / 60), m = o % 60;
382
+ return `${d}h ${m}m`;
383
+ }
384
+ function la(e, t) {
145
385
  return e === "inProgress" ? { label: "In Progress", className: "badge--in-progress" } : e === "notStarted" ? { label: "Not Started", className: "badge--pending" } : t === "succeeded" ? { label: "Succeeded", className: "badge--succeeded" } : t === "partiallySucceeded" ? { label: "Partial Success", className: "badge--partial" } : t === "failed" ? { label: "Failed", className: "badge--failed" } : t === "canceled" ? { label: "Canceled", className: "badge--canceled" } : { label: e, className: "" };
146
386
  }
147
- function Qt({
387
+ function ca(e) {
388
+ var r, o;
389
+ const t = (o = (r = e._links) == null ? void 0 : r.web) == null ? void 0 : o.href;
390
+ if (!t) return null;
391
+ const a = t.match(/(https:\/\/dev\.azure\.com\/[^/]+\/[^/]+)/);
392
+ return a ? a[1] : null;
393
+ }
394
+ function Ee({
395
+ href: e,
396
+ children: t
397
+ }) {
398
+ return e ? /* @__PURE__ */ i(
399
+ "a",
400
+ {
401
+ href: e,
402
+ target: "_blank",
403
+ rel: "noopener noreferrer",
404
+ className: "build-popup__link",
405
+ children: [
406
+ t,
407
+ " ↗"
408
+ ]
409
+ }
410
+ ) : /* @__PURE__ */ n("span", { children: t });
411
+ }
412
+ function da({
148
413
  build: e,
149
- onClose: t
414
+ org: t,
415
+ onClose: a
150
416
  }) {
151
- var n, c;
152
- const a = Zt(e.status, e.result), o = Xt(e.startTime, e.finishTime), r = (c = (n = e._links) == null ? void 0 : n.web) == null ? void 0 : c.href;
153
- return /* @__PURE__ */ s(
417
+ var w, R;
418
+ const [r, o] = I(!1), s = la(e.status, e.result), d = ia(e.startTime, e.finishTime), m = ((R = (w = e._links) == null ? void 0 : w.web) == null ? void 0 : R.href) ?? null, u = ca(e), c = e.sourceBranch.replace("refs/heads/", ""), l = m, h = u ? `${u}/_build?definitionId=${e.definition.id}` : null, g = u ? `${u}/_git/?version=GC${e.sourceVersion}` : null, p = u ? `${u}/_git/?version=GB${c}` : null;
419
+ return /* @__PURE__ */ n(
154
420
  "div",
155
421
  {
156
422
  className: "build-popup-overlay",
157
- onClick: t,
158
- onKeyDown: (d) => {
159
- d.key === "Escape" && t();
423
+ onClick: a,
424
+ onKeyDown: (f) => {
425
+ f.key === "Escape" && a();
160
426
  },
161
427
  role: "dialog",
162
428
  "aria-modal": "true",
163
- children: /* @__PURE__ */ l(
429
+ children: /* @__PURE__ */ i(
164
430
  "div",
165
431
  {
166
- className: "build-popup",
167
- onClick: (d) => d.stopPropagation(),
168
- onKeyDown: (d) => d.stopPropagation(),
432
+ className: `build-popup ${r ? "build-popup--wide" : ""}`,
433
+ onClick: (f) => f.stopPropagation(),
434
+ onKeyDown: (f) => f.stopPropagation(),
169
435
  children: [
170
- /* @__PURE__ */ l("div", { className: "build-popup__header", children: [
171
- /* @__PURE__ */ s("h2", { children: e.definition.name }),
172
- /* @__PURE__ */ s(
436
+ /* @__PURE__ */ i("div", { className: "build-popup__header", children: [
437
+ /* @__PURE__ */ n("h2", { children: /* @__PURE__ */ n(Ee, { href: h, children: e.definition.name }) }),
438
+ /* @__PURE__ */ n(
173
439
  "button",
174
440
  {
175
441
  className: "build-popup__close",
176
- onClick: t,
442
+ onClick: a,
177
443
  type: "button",
178
444
  children: "✕"
179
445
  }
180
446
  )
181
447
  ] }),
182
- /* @__PURE__ */ l("div", { className: "build-popup__body", children: [
183
- /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
184
- /* @__PURE__ */ s("span", { className: "build-popup__label", children: "Build Number" }),
185
- /* @__PURE__ */ l("span", { children: [
448
+ /* @__PURE__ */ i("div", { className: "build-popup__body", children: [
449
+ /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
450
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Build Number" }),
451
+ /* @__PURE__ */ i(Ee, { href: l, children: [
186
452
  "#",
187
453
  e.buildNumber
188
454
  ] })
189
455
  ] }),
190
- /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
191
- /* @__PURE__ */ s("span", { className: "build-popup__label", children: "Status" }),
192
- /* @__PURE__ */ s("span", { className: `build-popup__badge ${a.className}`, children: a.label })
456
+ /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
457
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Status" }),
458
+ /* @__PURE__ */ n("span", { className: `build-popup__badge ${s.className}`, children: s.label })
459
+ ] }),
460
+ /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
461
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Project" }),
462
+ /* @__PURE__ */ n("span", { children: e.project.name })
193
463
  ] }),
194
- /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
195
- /* @__PURE__ */ s("span", { className: "build-popup__label", children: "Queued" }),
196
- /* @__PURE__ */ s("span", { children: je(e.queueTime) })
464
+ /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
465
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Queued" }),
466
+ /* @__PURE__ */ n("span", { children: Ge(e.queueTime) })
197
467
  ] }),
198
- /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
199
- /* @__PURE__ */ s("span", { className: "build-popup__label", children: "Started" }),
200
- /* @__PURE__ */ s("span", { children: je(e.startTime) })
468
+ /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
469
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Started" }),
470
+ /* @__PURE__ */ n("span", { children: Ge(e.startTime) })
201
471
  ] }),
202
- /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
203
- /* @__PURE__ */ s("span", { className: "build-popup__label", children: "Finished" }),
204
- /* @__PURE__ */ s("span", { children: je(e.finishTime) })
472
+ /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
473
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Finished" }),
474
+ /* @__PURE__ */ n("span", { children: Ge(e.finishTime) })
205
475
  ] }),
206
- o && /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
207
- /* @__PURE__ */ s("span", { className: "build-popup__label", children: "Duration" }),
208
- /* @__PURE__ */ s("span", { children: o })
476
+ d && /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
477
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Duration" }),
478
+ /* @__PURE__ */ n("span", { children: d })
209
479
  ] }),
210
- /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
211
- /* @__PURE__ */ s("span", { className: "build-popup__label", children: "Branch" }),
212
- /* @__PURE__ */ s("span", { children: e.sourceBranch.replace("refs/heads/", "") })
480
+ /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
481
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Branch" }),
482
+ /* @__PURE__ */ n(Ee, { href: p, children: c })
213
483
  ] }),
214
- /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
215
- /* @__PURE__ */ s("span", { className: "build-popup__label", children: "Commit" }),
216
- /* @__PURE__ */ s("span", { className: "build-popup__mono", children: e.sourceVersion.slice(0, 8) })
484
+ /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
485
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Commit" }),
486
+ /* @__PURE__ */ n(Ee, { href: g, children: /* @__PURE__ */ n("span", { className: "build-popup__mono", children: e.sourceVersion.slice(0, 8) }) })
217
487
  ] }),
218
- e.requestedFor && /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
219
- /* @__PURE__ */ s("span", { className: "build-popup__label", children: "Requested For" }),
220
- /* @__PURE__ */ s("span", { children: e.requestedFor.displayName })
488
+ e.requestedFor && /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
489
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Requested For" }),
490
+ /* @__PURE__ */ n("span", { children: e.requestedFor.displayName })
221
491
  ] }),
222
- e.triggeredByBuild && /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
223
- /* @__PURE__ */ s("span", { className: "build-popup__label", children: "Triggered By" }),
224
- /* @__PURE__ */ l("span", { children: [
492
+ e.triggeredByBuild && /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
493
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Triggered By" }),
494
+ /* @__PURE__ */ i("span", { children: [
225
495
  e.triggeredByBuild.definition.name,
226
496
  " #",
227
497
  e.triggeredByBuild.buildNumber
228
498
  ] })
229
499
  ] }),
230
- Object.keys(e.triggerInfo).length > 0 && /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
231
- /* @__PURE__ */ s("span", { className: "build-popup__label", children: "Trigger Info" }),
232
- /* @__PURE__ */ s("span", { className: "build-popup__mono", children: Object.entries(e.triggerInfo).map(([d, u]) => `${d}: ${u}`).join(", ") })
500
+ Object.keys(e.triggerInfo).length > 0 && /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
501
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Trigger Info" }),
502
+ /* @__PURE__ */ n("span", { className: "build-popup__mono", children: Object.entries(e.triggerInfo).map(([f, y]) => `${f}: ${y}`).join(", ") })
233
503
  ] }),
234
- e.tags.length > 0 && /* @__PURE__ */ l("div", { className: "build-popup__row", children: [
235
- /* @__PURE__ */ s("span", { className: "build-popup__label", children: "Tags" }),
236
- /* @__PURE__ */ s("span", { className: "build-popup__tags", children: e.tags.map((d) => /* @__PURE__ */ s("span", { className: "build-popup__tag", children: d }, d)) })
504
+ e.tags.length > 0 && /* @__PURE__ */ i("div", { className: "build-popup__row", children: [
505
+ /* @__PURE__ */ n("span", { className: "build-popup__label", children: "Tags" }),
506
+ /* @__PURE__ */ n("span", { className: "build-popup__tags", children: e.tags.map((f) => /* @__PURE__ */ n("span", { className: "build-popup__tag", children: f }, f)) })
237
507
  ] }),
238
- r && /* @__PURE__ */ s("div", { className: "build-popup__row", children: /* @__PURE__ */ s(
508
+ m && /* @__PURE__ */ n("div", { className: "build-popup__actions", children: /* @__PURE__ */ n(
239
509
  "a",
240
510
  {
241
- href: r,
511
+ href: m,
242
512
  target: "_blank",
243
513
  rel: "noopener noreferrer",
244
- className: "build-popup__link",
245
- children: "Open in Azure DevOps ↗"
514
+ className: "build-popup__action-link",
515
+ children: "Open Build in Azure DevOps ↗"
516
+ }
517
+ ) }),
518
+ /* @__PURE__ */ n("div", { className: "build-popup__actions", children: /* @__PURE__ */ n(
519
+ "button",
520
+ {
521
+ type: "button",
522
+ className: "build-popup__gantt-toggle",
523
+ onClick: () => o((f) => !f),
524
+ children: r ? "▾ Hide Gantt Timeline" : "▸ Show Gantt Timeline"
525
+ }
526
+ ) }),
527
+ r && /* @__PURE__ */ n("div", { className: "build-popup__gantt", children: /* @__PURE__ */ n(
528
+ oa,
529
+ {
530
+ org: t,
531
+ project: e.project.name,
532
+ buildId: e.id
246
533
  }
247
534
  ) })
248
535
  ] })
@@ -252,7 +539,7 @@ function Qt({
252
539
  }
253
540
  );
254
541
  }
255
- function ea(e) {
542
+ function pa(e) {
256
543
  return e ? new Date(e).toLocaleString(void 0, {
257
544
  month: "short",
258
545
  day: "numeric",
@@ -261,286 +548,299 @@ function ea(e) {
261
548
  second: "2-digit"
262
549
  }) : "—";
263
550
  }
264
- function ta(e, t) {
551
+ function ua(e, t) {
265
552
  if (!e || !t) return null;
266
553
  const a = new Date(t).getTime() - new Date(e).getTime();
267
554
  if (a < 0) return null;
268
- const o = Math.floor(a / 1e3);
269
- if (o < 60) return `${o}s`;
270
- const r = Math.floor(o / 60), n = o % 60;
271
- if (r < 60) return `${r}m ${n}s`;
272
- const c = Math.floor(r / 60), d = r % 60;
273
- return `${c}h ${d}m`;
274
- }
275
- function aa(e, t) {
555
+ const r = Math.floor(a / 1e3);
556
+ if (r < 60) return `${r}s`;
557
+ const o = Math.floor(r / 60), s = r % 60;
558
+ if (o < 60) return `${o}m ${s}s`;
559
+ const d = Math.floor(o / 60), m = o % 60;
560
+ return `${d}h ${m}m`;
561
+ }
562
+ function ma(e, t) {
276
563
  return e === "inProgress" ? "⏳" : e === "notStarted" ? "⏸️" : t === "succeeded" ? "✅" : t === "partiallySucceeded" ? "⚠️" : t === "failed" ? "❌" : t === "canceled" ? "🚫" : "❓";
277
564
  }
278
- function na(e, t) {
565
+ function ha(e, t) {
279
566
  return e === "inProgress" ? "build-node--in-progress" : t === "succeeded" ? "build-node--succeeded" : t === "partiallySucceeded" ? "build-node--partial" : t === "failed" ? "build-node--failed" : t === "canceled" ? "build-node--canceled" : "";
280
567
  }
281
- function sa({ data: e }) {
282
- const t = e, a = ta(t.startTime, t.finishTime);
283
- return /* @__PURE__ */ l("div", { className: `build-node ${na(t.status, t.result)}`, children: [
284
- !t.isRoot && /* @__PURE__ */ s(Se, { type: "target", position: Ce.Left }),
285
- /* @__PURE__ */ l("div", { className: "build-node__header", children: [
286
- /* @__PURE__ */ s("span", { className: "build-node__status", children: aa(t.status, t.result) }),
287
- /* @__PURE__ */ s("span", { className: "build-node__name", title: t.pipelineName, children: t.pipelineName })
568
+ function fa({ data: e }) {
569
+ const t = e, a = ua(t.startTime, t.finishTime);
570
+ return /* @__PURE__ */ i("div", { className: `build-node ${ha(t.status, t.result)}`, children: [
571
+ !t.isRoot && /* @__PURE__ */ n(De, { type: "target", position: Ie.Left }),
572
+ /* @__PURE__ */ i("div", { className: "build-node__header", children: [
573
+ /* @__PURE__ */ n("span", { className: "build-node__status", children: ma(t.status, t.result) }),
574
+ /* @__PURE__ */ n("span", { className: "build-node__name", title: t.pipelineName, children: t.pipelineName })
288
575
  ] }),
289
- /* @__PURE__ */ l("div", { className: "build-node__number", children: [
576
+ !t.isRoot && t.projectName && /* @__PURE__ */ i(
577
+ "div",
578
+ {
579
+ className: "build-node__project",
580
+ title: `Project: ${t.projectName}`,
581
+ children: [
582
+ "📁 ",
583
+ t.projectName
584
+ ]
585
+ }
586
+ ),
587
+ /* @__PURE__ */ i("div", { className: "build-node__number", children: [
290
588
  "#",
291
589
  t.buildNumber
292
590
  ] }),
293
- /* @__PURE__ */ l("div", { className: "build-node__times", children: [
294
- /* @__PURE__ */ l("span", { title: "Start time", children: [
591
+ /* @__PURE__ */ i("div", { className: "build-node__times", children: [
592
+ /* @__PURE__ */ i("span", { title: "Start time", children: [
295
593
  "🕐 ",
296
- ea(t.startTime)
594
+ pa(t.startTime)
297
595
  ] }),
298
- a && /* @__PURE__ */ l("span", { title: "Duration", children: [
596
+ a && /* @__PURE__ */ i("span", { title: "Duration", children: [
299
597
  "⏱️ ",
300
598
  a
301
599
  ] })
302
600
  ] }),
303
- /* @__PURE__ */ l("div", { className: "build-node__branch", title: t.sourceBranch, children: [
601
+ /* @__PURE__ */ i("div", { className: "build-node__branch", title: t.sourceBranch, children: [
304
602
  "🌿 ",
305
603
  t.sourceBranch.replace("refs/heads/", "")
306
604
  ] }),
307
- /* @__PURE__ */ s(Se, { type: "source", position: Ce.Right })
605
+ /* @__PURE__ */ n(De, { type: "source", position: Ie.Right })
308
606
  ] });
309
607
  }
310
- const oa = Ze(sa), We = 280, _e = 130, He = 20, ra = { build: oa };
311
- function ia(e, t) {
608
+ const ga = tt(fa), Ke = 280, be = 130, Ye = 20, _a = { build: ga };
609
+ function Na(e, t) {
312
610
  if (e.length === 0) return { nodes: e, edges: t };
313
611
  const a = /* @__PURE__ */ new Set();
314
- for (const c of t)
315
- a.add(c.source), a.add(c.target);
316
- const o = e.filter((c) => !a.has(c.id)), r = e.filter((c) => a.has(c.id));
317
- let n = [];
318
- if (r.length > 0) {
319
- const c = new $e.graphlib.Graph();
320
- c.setDefaultEdgeLabel(() => ({})), c.setGraph({ rankdir: "LR", ranksep: 80, nodesep: 30 });
321
- for (const d of r)
322
- c.setNode(d.id, { width: We, height: _e });
323
- for (const d of t)
324
- c.setEdge(d.source, d.target);
325
- $e.layout(c), n = r.map((d) => {
326
- const u = c.node(d.id);
612
+ for (const d of t)
613
+ a.add(d.source), a.add(d.target);
614
+ const r = e.filter((d) => !a.has(d.id)), o = e.filter((d) => a.has(d.id));
615
+ let s = [];
616
+ if (o.length > 0) {
617
+ const d = new Se.graphlib.Graph();
618
+ d.setDefaultEdgeLabel(() => ({})), d.setGraph({ rankdir: "LR", ranksep: 80, nodesep: 30 });
619
+ for (const m of o)
620
+ d.setNode(m.id, { width: Ke, height: be });
621
+ for (const m of t)
622
+ d.setEdge(m.source, m.target);
623
+ Se.layout(d), s = o.map((m) => {
624
+ const u = d.node(m.id);
327
625
  return {
328
- ...d,
329
- position: { x: u.x - We / 2, y: u.y - _e / 2 }
626
+ ...m,
627
+ position: { x: u.x - Ke / 2, y: u.y - be / 2 }
330
628
  };
331
629
  });
332
630
  }
333
- if (o.length > 0) {
334
- let c = 0;
335
- for (const i of n) c = Math.max(c, i.position.y + _e);
336
- const d = n.length > 0 ? c + 60 : 0, u = [...o].sort((i, m) => {
337
- const f = i.data.startTime ?? "", p = m.data.startTime ?? "";
338
- return f < p ? -1 : f > p ? 1 : 0;
339
- }), h = u.map((i) => {
340
- const m = i.data.startTime;
341
- return m ? new Date(m).getTime() : null;
342
- }).filter((i) => i !== null);
343
- if (h.length > 0) {
344
- const i = Math.min(...h), f = Math.max(...h) - i || 1, p = Math.max(u.length * (We + He), 1200);
631
+ if (r.length > 0) {
632
+ let d = 0;
633
+ for (const l of s) d = Math.max(d, l.position.y + be);
634
+ const m = s.length > 0 ? d + 60 : 0, u = [...r].sort((l, h) => {
635
+ const g = l.data.startTime ?? "", p = h.data.startTime ?? "";
636
+ return g < p ? -1 : g > p ? 1 : 0;
637
+ }), c = u.map((l) => {
638
+ const h = l.data.startTime;
639
+ return h ? new Date(h).getTime() : null;
640
+ }).filter((l) => l !== null);
641
+ if (c.length > 0) {
642
+ const l = Math.min(...c), g = Math.max(...c) - l || 1, p = Math.max(u.length * (Ke + Ye), 1200);
345
643
  let w = 0;
346
- for (const E of u) {
347
- const _ = E.data.startTime, y = ((_ ? new Date(_).getTime() : i) - i) / f * p;
348
- E.position = {
349
- x: y,
350
- y: d + w * (_e + He)
644
+ for (const R of u) {
645
+ const f = R.data.startTime, P = ((f ? new Date(f).getTime() : l) - l) / g * p;
646
+ R.position = {
647
+ x: P,
648
+ y: m + w * (be + Ye)
351
649
  }, w++;
352
650
  }
353
651
  } else
354
- u.forEach((i, m) => {
355
- i.position = { x: 0, y: d + m * (_e + He) };
652
+ u.forEach((l, h) => {
653
+ l.position = { x: 0, y: m + h * (be + Ye) };
356
654
  });
357
- n = [...n, ...u];
655
+ s = [...s, ...u];
358
656
  }
359
- return { nodes: n, edges: t };
657
+ return { nodes: s, edges: t };
360
658
  }
361
- function la(e) {
659
+ function va(e) {
362
660
  const t = /* @__PURE__ */ new Map();
363
- for (const n of e)
364
- t.set(n.id, n);
661
+ for (const s of e)
662
+ t.set(s.id, s);
365
663
  const a = /* @__PURE__ */ new Set();
366
- for (const n of e)
367
- n.upstreamBuildId && t.has(n.upstreamBuildId) && a.add(n.id);
368
- const o = e.map((n) => {
369
- var c, d;
664
+ for (const s of e)
665
+ s.upstreamBuildId && t.has(s.upstreamBuildId) && a.add(s.id);
666
+ const r = e.map((s) => {
667
+ var d, m;
370
668
  return {
371
- id: String(n.id),
669
+ id: String(s.id),
372
670
  type: "build",
373
671
  position: { x: 0, y: 0 },
374
672
  data: {
375
- buildId: n.id,
376
- pipelineName: n.definition.name,
377
- buildNumber: n.buildNumber,
378
- status: n.status,
379
- result: n.result,
380
- startTime: n.startTime,
381
- finishTime: n.finishTime,
382
- sourceBranch: n.sourceBranch,
383
- webUrl: ((d = (c = n._links) == null ? void 0 : c.web) == null ? void 0 : d.href) ?? null,
384
- isRoot: !a.has(n.id)
673
+ buildId: s.id,
674
+ pipelineName: s.definition.name,
675
+ buildNumber: s.buildNumber,
676
+ status: s.status,
677
+ result: s.result,
678
+ startTime: s.startTime,
679
+ finishTime: s.finishTime,
680
+ sourceBranch: s.sourceBranch,
681
+ webUrl: ((m = (d = s._links) == null ? void 0 : d.web) == null ? void 0 : m.href) ?? null,
682
+ isRoot: !a.has(s.id),
683
+ projectName: s.project.name
385
684
  }
386
685
  };
387
- }), r = [];
388
- for (const n of e)
389
- n.upstreamBuildId && t.has(n.upstreamBuildId) && r.push({
390
- id: `e-${n.upstreamBuildId}-${n.id}`,
391
- source: String(n.upstreamBuildId),
392
- target: String(n.id),
393
- animated: n.status === "inProgress",
686
+ }), o = [];
687
+ for (const s of e)
688
+ s.upstreamBuildId && t.has(s.upstreamBuildId) && o.push({
689
+ id: `e-${s.upstreamBuildId}-${s.id}`,
690
+ source: String(s.upstreamBuildId),
691
+ target: String(s.id),
692
+ animated: s.status === "inProgress",
394
693
  style: { stroke: "#89b4fa", strokeWidth: 2 }
395
694
  });
396
- return ia(o, r);
695
+ return Na(r, o);
397
696
  }
398
- function ca({
697
+ function ba({
399
698
  builds: e,
400
699
  onNodeClick: t
401
700
  }) {
402
- const { nodes: a, edges: o } = ve(
403
- () => la(e),
701
+ const { nodes: a, edges: r } = ie(
702
+ () => va(e),
404
703
  [e]
405
- ), [r, n, c] = ct(a), [d, u, h] = dt(o);
406
- ee(() => {
407
- n(a), u(o);
408
- }, [a, o, n, u]);
409
- const i = ve(() => {
410
- const f = /* @__PURE__ */ new Map();
411
- for (const p of e) f.set(p.id, p);
412
- return f;
413
- }, [e]), m = ne(
414
- (f, p) => {
415
- const w = i.get(Number(p.id));
704
+ ), [o, s, d] = ht(a), [m, u, c] = ft(r);
705
+ Q(() => {
706
+ s(a), u(r);
707
+ }, [a, r, s, u]);
708
+ const l = ie(() => {
709
+ const g = /* @__PURE__ */ new Map();
710
+ for (const p of e) g.set(p.id, p);
711
+ return g;
712
+ }, [e]), h = se(
713
+ (g, p) => {
714
+ const w = l.get(Number(p.id));
416
715
  w && t(w);
417
716
  },
418
- [i, t]
717
+ [l, t]
419
718
  );
420
- return /* @__PURE__ */ s("div", { className: "commit-flow-diagram", children: /* @__PURE__ */ l(
421
- pt,
719
+ return /* @__PURE__ */ n("div", { className: "commit-flow-diagram", children: /* @__PURE__ */ i(
720
+ gt,
422
721
  {
423
- nodes: r,
424
- edges: d,
425
- nodeTypes: ra,
426
- onNodesChange: c,
427
- onEdgesChange: h,
428
- onNodeClick: m,
722
+ nodes: o,
723
+ edges: m,
724
+ nodeTypes: _a,
725
+ onNodesChange: d,
726
+ onEdgesChange: c,
727
+ onNodeClick: h,
429
728
  fitView: !0,
430
729
  minZoom: 0.2,
431
730
  maxZoom: 2,
432
731
  proOptions: { hideAttribution: !0 },
433
732
  children: [
434
- /* @__PURE__ */ s(ut, {}),
435
- /* @__PURE__ */ s(mt, {})
733
+ /* @__PURE__ */ n(_t, {}),
734
+ /* @__PURE__ */ n(Nt, {})
436
735
  ]
437
736
  }
438
737
  ) });
439
738
  }
440
- function da({
739
+ function ya({
441
740
  onLoad: e,
442
741
  loading: t
443
742
  }) {
444
- const [a, o] = L(""), [r, n] = L(null), c = () => {
743
+ const [a, r] = I(""), [o, s] = I(null), d = () => {
445
744
  const u = a.trim();
446
745
  if (!u) return;
447
- n(null);
448
- const h = xt(u);
449
- if (!h) {
450
- n(
746
+ s(null);
747
+ const c = St(u);
748
+ if (!c) {
749
+ s(
451
750
  "Invalid URL. Expected: https://dev.azure.com/{org}/{project}/_git/{repo}/commit/{sha}"
452
751
  );
453
752
  return;
454
753
  }
455
754
  e({
456
- org: h.org,
457
- project: h.project,
458
- repoName: h.repoName,
459
- commitSha: h.commitSha
755
+ org: c.org,
756
+ project: c.project,
757
+ repoName: c.repoName,
758
+ commitSha: c.commitSha
460
759
  });
461
760
  };
462
- return /* @__PURE__ */ l("div", { className: "commit-flow-selector", children: [
463
- /* @__PURE__ */ s(
761
+ return /* @__PURE__ */ i("div", { className: "commit-flow-selector", children: [
762
+ /* @__PURE__ */ n(
464
763
  "input",
465
764
  {
466
765
  type: "text",
467
766
  placeholder: "https://dev.azure.com/{org}/{project}/_git/{repo}/commit/{sha}",
468
767
  value: a,
469
- onChange: (u) => o(u.target.value),
768
+ onChange: (u) => r(u.target.value),
470
769
  onKeyDown: (u) => {
471
- u.key === "Enter" && (u.preventDefault(), c());
770
+ u.key === "Enter" && (u.preventDefault(), d());
472
771
  },
473
772
  className: "commit-flow-selector__input commit-flow-selector__input--url"
474
773
  }
475
774
  ),
476
- /* @__PURE__ */ s(
775
+ /* @__PURE__ */ n(
477
776
  "button",
478
777
  {
479
778
  className: "commit-flow-selector__btn",
480
- onClick: c,
779
+ onClick: d,
481
780
  disabled: !a.trim() || t,
482
781
  type: "button",
483
782
  children: t ? "⏳ Loading..." : "Load Builds"
484
783
  }
485
784
  ),
486
- r && /* @__PURE__ */ s("div", { className: "commit-flow-selector__error", children: r })
785
+ o && /* @__PURE__ */ n("div", { className: "commit-flow-selector__error", children: o })
487
786
  ] });
488
787
  }
489
- function pa() {
490
- const [e, t] = L([]), [a, o] = L(!1), [r, n] = L(null), [c, d] = L(null), [u, h] = L(null), i = Q(null), m = ne((p) => {
788
+ function wa() {
789
+ const [e, t] = I([]), [a, r] = I(!1), [o, s] = I(null), [d, m] = I(null), [u, c] = I(null), l = ne(null), h = se((p) => {
491
790
  var w;
492
- (w = i.current) == null || w.abort(), o(!0), n(null), t([]), d(null), h(p), i.current = Jt(
791
+ (w = l.current) == null || w.abort(), r(!0), s(null), t([]), m(null), c(p), l.current = ta(
493
792
  p.org,
494
793
  p.project,
495
794
  p.repoName,
496
795
  p.commitSha,
497
- (E) => {
498
- t((_) => [..._, ...E]);
796
+ (R) => {
797
+ t((f) => [...f, ...R]);
499
798
  },
500
799
  () => {
501
- o(!1), t((E) => (E.length === 0 && n("No builds found for this commit."), E));
800
+ r(!1), t((R) => (R.length === 0 && s("No builds found for this commit."), R));
502
801
  },
503
- (E) => {
504
- o(!1), n(E);
802
+ (R) => {
803
+ r(!1), s(R);
505
804
  }
506
805
  );
507
- }, []), f = ne(() => {
508
- u && m(u);
509
- }, [u, m]);
510
- return /* @__PURE__ */ l("div", { className: "commit-flow-page", children: [
511
- /* @__PURE__ */ l("div", { className: "commit-flow-page__selector", children: [
512
- /* @__PURE__ */ s(da, { onLoad: m, loading: a }),
513
- u && !a && /* @__PURE__ */ s(
806
+ }, []), g = se(() => {
807
+ u && h(u);
808
+ }, [u, h]);
809
+ return /* @__PURE__ */ i("div", { className: "commit-flow-page", children: [
810
+ /* @__PURE__ */ i("div", { className: "commit-flow-page__selector", children: [
811
+ /* @__PURE__ */ n(ya, { onLoad: h, loading: a }),
812
+ u && !a && /* @__PURE__ */ n(
514
813
  "button",
515
814
  {
516
815
  className: "commit-flow-page__refresh",
517
- onClick: f,
816
+ onClick: g,
518
817
  type: "button",
519
818
  children: "🔄 Refresh"
520
819
  }
521
820
  )
522
821
  ] }),
523
- r && /* @__PURE__ */ s("div", { className: "commit-flow-page__error", children: r }),
524
- e.length > 0 && /* @__PURE__ */ l("div", { className: "commit-flow-page__diagram", children: [
525
- /* @__PURE__ */ l("div", { className: "commit-flow-page__summary", children: [
822
+ o && /* @__PURE__ */ n("div", { className: "commit-flow-page__error", children: o }),
823
+ e.length > 0 && /* @__PURE__ */ i("div", { className: "commit-flow-page__diagram", children: [
824
+ /* @__PURE__ */ i("div", { className: "commit-flow-page__summary", children: [
526
825
  e.length,
527
826
  " build",
528
827
  e.length !== 1 ? "s" : "",
529
828
  " found",
530
829
  a && " (loading…)"
531
830
  ] }),
532
- /* @__PURE__ */ s(ca, { builds: e, onNodeClick: d })
831
+ /* @__PURE__ */ n(ba, { builds: e, onNodeClick: m })
533
832
  ] }),
534
- c && /* @__PURE__ */ s(
535
- Qt,
833
+ d && u && /* @__PURE__ */ n(
834
+ da,
536
835
  {
537
- build: c,
538
- onClose: () => d(null)
836
+ build: d,
837
+ org: u.org,
838
+ onClose: () => m(null)
539
839
  }
540
840
  )
541
841
  ] });
542
842
  }
543
- const Ue = Ut((e) => ({
843
+ const Oe = Wt((e) => ({
544
844
  org: "",
545
845
  project: "",
546
846
  setConnection: (t, a) => e({ org: t, project: a }),
@@ -554,15 +854,15 @@ const Ue = Ut((e) => ({
554
854
  }),
555
855
  setSelectedPipelineLoading: (t) => e({ selectedPipelineLoading: t }),
556
856
  setSelectedPipelineError: (t) => e({ selectedPipelineError: t }),
557
- expandedTemplates: new Map(ua()),
558
- setExpandedTemplate: (t, a) => e((o) => {
559
- const r = new Map(o.expandedTemplates);
560
- return r.set(t, a), ma(r), { expandedTemplates: r };
857
+ expandedTemplates: new Map(Pa()),
858
+ setExpandedTemplate: (t, a) => e((r) => {
859
+ const o = new Map(r.expandedTemplates);
860
+ return o.set(t, a), Ta(o), { expandedTemplates: o };
561
861
  }),
562
862
  expandedNodes: /* @__PURE__ */ new Set(),
563
863
  toggleNode: (t) => e((a) => {
564
- const o = new Set(a.expandedNodes);
565
- return o.has(t) ? o.delete(t) : o.add(t), { expandedNodes: o };
864
+ const r = new Set(a.expandedNodes);
865
+ return r.has(t) ? r.delete(t) : r.add(t), { expandedNodes: r };
566
866
  }),
567
867
  selectedNodeDetail: null,
568
868
  setSelectedNodeDetail: (t) => e({ selectedNodeDetail: t }),
@@ -571,84 +871,84 @@ const Ue = Ut((e) => ({
571
871
  taskSchema: /* @__PURE__ */ new Map(),
572
872
  setTaskSchema: (t) => e(() => {
573
873
  const a = /* @__PURE__ */ new Map();
574
- for (const o of t)
575
- a.set(`${o.name}@${o.version}`, o);
874
+ for (const r of t)
875
+ a.set(`${r.name}@${r.version}`, r);
576
876
  return { taskSchema: a };
577
877
  })
578
- })), _t = "apv-template-cache";
579
- function ua() {
878
+ })), wt = "apv-template-cache";
879
+ function Pa() {
580
880
  try {
581
- const e = localStorage.getItem(_t);
881
+ const e = localStorage.getItem(wt);
582
882
  if (e)
583
883
  return JSON.parse(e);
584
884
  } catch {
585
885
  }
586
886
  return [];
587
887
  }
588
- function ma(e) {
888
+ function Ta(e) {
589
889
  try {
590
890
  const a = Array.from(e.entries()).slice(-100);
591
- localStorage.setItem(_t, JSON.stringify(a));
891
+ localStorage.setItem(wt, JSON.stringify(a));
592
892
  } catch {
593
893
  }
594
894
  }
595
- function ha() {
895
+ function Ea() {
596
896
  const {
597
897
  selectedNodeDetail: e,
598
898
  customTaskDocs: t,
599
899
  taskSchema: a,
600
- setSelectedNodeDetail: o
601
- } = Ue(), r = ve(() => {
900
+ setSelectedNodeDetail: r
901
+ } = Oe(), o = ie(() => {
602
902
  if (!(e != null && e.yaml)) return [];
603
903
  try {
604
- const n = ue(e.yaml);
605
- return kt(n ?? {});
904
+ const s = fe(e.yaml);
905
+ return Dt(s ?? {});
606
906
  } catch {
607
907
  return [];
608
908
  }
609
909
  }, [e == null ? void 0 : e.yaml]);
610
- return e ? /* @__PURE__ */ l("div", { className: "detail-panel", children: [
611
- /* @__PURE__ */ l("div", { className: "detail-panel__header", children: [
612
- /* @__PURE__ */ l("div", { className: "detail-panel__header-row", children: [
613
- /* @__PURE__ */ s("h3", { className: "detail-panel__title", children: e.label }),
614
- /* @__PURE__ */ s(
910
+ return e ? /* @__PURE__ */ i("div", { className: "detail-panel", children: [
911
+ /* @__PURE__ */ i("div", { className: "detail-panel__header", children: [
912
+ /* @__PURE__ */ i("div", { className: "detail-panel__header-row", children: [
913
+ /* @__PURE__ */ n("h3", { className: "detail-panel__title", children: e.label }),
914
+ /* @__PURE__ */ n(
615
915
  "button",
616
916
  {
617
917
  className: "detail-panel__close",
618
- onClick: () => o(null),
918
+ onClick: () => r(null),
619
919
  "aria-label": "Close detail panel",
620
920
  title: "Close",
621
921
  children: "✕"
622
922
  }
623
923
  )
624
924
  ] }),
625
- /* @__PURE__ */ l("div", { className: "detail-panel__path", children: [
925
+ /* @__PURE__ */ i("div", { className: "detail-panel__path", children: [
626
926
  e.filePath,
627
- e.repoAlias && /* @__PURE__ */ l("span", { className: "detail-panel__repo", children: [
927
+ e.repoAlias && /* @__PURE__ */ i("span", { className: "detail-panel__repo", children: [
628
928
  " ",
629
929
  "@",
630
930
  e.repoAlias
631
931
  ] })
632
932
  ] })
633
933
  ] }),
634
- r.length > 0 && /* @__PURE__ */ l("div", { className: "detail-panel__tasks", children: [
635
- /* @__PURE__ */ l("h4", { className: "detail-panel__section-title", children: [
934
+ o.length > 0 && /* @__PURE__ */ i("div", { className: "detail-panel__tasks", children: [
935
+ /* @__PURE__ */ i("h4", { className: "detail-panel__section-title", children: [
636
936
  "Tasks (",
637
- r.length,
937
+ o.length,
638
938
  ")"
639
939
  ] }),
640
- /* @__PURE__ */ s("ul", { className: "task-list", children: r.map((n) => /* @__PURE__ */ s(
641
- fa,
940
+ /* @__PURE__ */ n("ul", { className: "task-list", children: o.map((s) => /* @__PURE__ */ n(
941
+ Ra,
642
942
  {
643
- ref_: n,
943
+ ref_: s,
644
944
  customDocs: t,
645
- schemaEntry: a.get(n.raw) ?? a.get(`${n.name}@${n.version}`)
945
+ schemaEntry: a.get(s.raw) ?? a.get(`${s.name}@${s.version}`)
646
946
  },
647
- n.raw
947
+ s.raw
648
948
  )) })
649
949
  ] }),
650
- /* @__PURE__ */ s("div", { className: "detail-panel__editor", children: /* @__PURE__ */ s(
651
- Bt,
950
+ /* @__PURE__ */ n("div", { className: "detail-panel__editor", children: /* @__PURE__ */ n(
951
+ jt,
652
952
  {
653
953
  height: "100%",
654
954
  language: "yaml",
@@ -666,46 +966,46 @@ function ha() {
666
966
  }
667
967
  }
668
968
  ) })
669
- ] }) : /* @__PURE__ */ s("div", { className: "detail-panel detail-panel--empty", children: /* @__PURE__ */ s("p", { children: "Click a node to view its contents" }) });
969
+ ] }) : /* @__PURE__ */ n("div", { className: "detail-panel detail-panel--empty", children: /* @__PURE__ */ n("p", { children: "Click a node to view its contents" }) });
670
970
  }
671
- function fa({
971
+ function Ra({
672
972
  ref_: e,
673
973
  customDocs: t,
674
974
  schemaEntry: a
675
975
  }) {
676
- const o = Tt(e, t);
677
- return /* @__PURE__ */ l("li", { className: "task-item", children: [
678
- /* @__PURE__ */ s("span", { className: "task-item__icon", children: "⚙️" }),
679
- /* @__PURE__ */ l("div", { className: "task-item__content", children: [
680
- o ? /* @__PURE__ */ l(
976
+ const r = It(e, t);
977
+ return /* @__PURE__ */ i("li", { className: "task-item", children: [
978
+ /* @__PURE__ */ n("span", { className: "task-item__icon", children: "⚙️" }),
979
+ /* @__PURE__ */ i("div", { className: "task-item__content", children: [
980
+ r ? /* @__PURE__ */ i(
681
981
  "a",
682
982
  {
683
- href: o,
983
+ href: r,
684
984
  target: "_blank",
685
985
  rel: "noopener noreferrer",
686
986
  className: "task-item__link",
687
987
  title: (a == null ? void 0 : a.description) || `Open docs for ${e.name}`,
688
988
  children: [
689
989
  e.name,
690
- /* @__PURE__ */ l("span", { className: "task-item__version", children: [
990
+ /* @__PURE__ */ i("span", { className: "task-item__version", children: [
691
991
  "@",
692
992
  e.version
693
993
  ] }),
694
- /* @__PURE__ */ s("span", { className: "task-item__external", children: "↗" })
994
+ /* @__PURE__ */ n("span", { className: "task-item__external", children: "↗" })
695
995
  ]
696
996
  }
697
- ) : /* @__PURE__ */ l("span", { className: "task-item__name", children: [
997
+ ) : /* @__PURE__ */ i("span", { className: "task-item__name", children: [
698
998
  e.name,
699
- /* @__PURE__ */ l("span", { className: "task-item__version", children: [
999
+ /* @__PURE__ */ i("span", { className: "task-item__version", children: [
700
1000
  "@",
701
1001
  e.version
702
1002
  ] })
703
1003
  ] }),
704
- (a == null ? void 0 : a.description) && /* @__PURE__ */ s("div", { className: "task-item__description", children: a.description })
1004
+ (a == null ? void 0 : a.description) && /* @__PURE__ */ n("div", { className: "task-item__description", children: a.description })
705
1005
  ] })
706
1006
  ] });
707
1007
  }
708
- class Ee extends yt {
1008
+ class Re extends Rt {
709
1009
  constructor(t) {
710
1010
  super(t), this.state = { hasError: !1, error: null };
711
1011
  }
@@ -717,10 +1017,10 @@ class Ee extends yt {
717
1017
  }
718
1018
  render() {
719
1019
  var t;
720
- return this.state.hasError ? this.props.fallback || /* @__PURE__ */ l("div", { className: "error", children: [
721
- /* @__PURE__ */ s("h3", { children: "Something went wrong" }),
722
- /* @__PURE__ */ s("p", { children: (t = this.state.error) == null ? void 0 : t.message }),
723
- /* @__PURE__ */ s(
1020
+ return this.state.hasError ? this.props.fallback || /* @__PURE__ */ i("div", { className: "error", children: [
1021
+ /* @__PURE__ */ n("h3", { children: "Something went wrong" }),
1022
+ /* @__PURE__ */ n("p", { children: (t = this.state.error) == null ? void 0 : t.message }),
1023
+ /* @__PURE__ */ n(
724
1024
  "button",
725
1025
  {
726
1026
  onClick: () => this.setState({ hasError: !1, error: null }),
@@ -731,43 +1031,43 @@ class Ee extends yt {
731
1031
  ] }) : this.props.children;
732
1032
  }
733
1033
  }
734
- const vt = wt(null), ga = vt.Provider;
735
- function _a() {
736
- const e = Pt(vt);
1034
+ const Pt = kt(null), ka = Pt.Provider;
1035
+ function $a() {
1036
+ const e = $t(Pt);
737
1037
  if (!e)
738
1038
  throw new Error(
739
1039
  "useFileFetch must be used within a FileFetchProvider. Wrap your component tree with <FileFetchProvider value={...}>."
740
1040
  );
741
1041
  return e;
742
1042
  }
743
- const et = 300, tt = 100;
744
- function Ke(e, t, a = "TB") {
745
- const o = new $e.graphlib.Graph();
746
- o.setDefaultEdgeLabel(() => ({})), o.setGraph({ rankdir: a, ranksep: 80, nodesep: 40 });
747
- for (const n of e)
748
- o.setNode(n.id, { width: et, height: tt });
749
- for (const n of t)
750
- o.setEdge(n.source, n.target);
751
- return $e.layout(o), { nodes: e.map((n) => {
752
- const c = o.node(n.id);
1043
+ const rt = 300, ot = 100;
1044
+ function qe(e, t, a = "TB") {
1045
+ const r = new Se.graphlib.Graph();
1046
+ r.setDefaultEdgeLabel(() => ({})), r.setGraph({ rankdir: a, ranksep: 80, nodesep: 40 });
1047
+ for (const s of e)
1048
+ r.setNode(s.id, { width: rt, height: ot });
1049
+ for (const s of t)
1050
+ r.setEdge(s.source, s.target);
1051
+ return Se.layout(r), { nodes: e.map((s) => {
1052
+ const d = r.node(s.id);
753
1053
  return {
754
- ...n,
1054
+ ...s,
755
1055
  position: {
756
- x: c.x - et / 2,
757
- y: c.y - tt / 2
1056
+ x: d.x - rt / 2,
1057
+ y: d.y - ot / 2
758
1058
  }
759
1059
  };
760
1060
  }), edges: t };
761
1061
  }
762
- function va({ data: e }) {
763
- var c;
764
- const t = e, [a, o] = L(!1), r = t.status === "root" ? "file-node--root" : t.status === "expanded" ? "file-node--expanded" : t.status === "loading" ? "file-node--loading" : t.status === "error" ? "file-node--error" : "file-node--collapsed", n = t.repoAlias ? "file-node--cross-repo" : "";
765
- return /* @__PURE__ */ l("div", { className: `file-node ${r} ${n}`, children: [
766
- !t.isRoot && /* @__PURE__ */ s(Se, { type: "target", position: Ce.Top }),
767
- /* @__PURE__ */ l("div", { className: "file-node__header", children: [
768
- /* @__PURE__ */ s("span", { className: "file-node__icon", children: t.isRoot ? "📄" : t.status === "expanded" ? "📋" : t.repoAlias ? "🔗" : "📁" }),
769
- /* @__PURE__ */ s("span", { className: "file-node__label", title: t.filePath, children: t.label }),
770
- /* @__PURE__ */ s("span", { className: "file-node__actions", children: t.adoUrl && /* @__PURE__ */ s(
1062
+ function xa({ data: e }) {
1063
+ var d;
1064
+ const t = e, [a, r] = I(!1), o = t.status === "root" ? "file-node--root" : t.status === "expanded" ? "file-node--expanded" : t.status === "loading" ? "file-node--loading" : t.status === "error" ? "file-node--error" : "file-node--collapsed", s = t.repoAlias ? "file-node--cross-repo" : "";
1065
+ return /* @__PURE__ */ i("div", { className: `file-node ${o} ${s}`, children: [
1066
+ !t.isRoot && /* @__PURE__ */ n(De, { type: "target", position: Ie.Top }),
1067
+ /* @__PURE__ */ i("div", { className: "file-node__header", children: [
1068
+ /* @__PURE__ */ n("span", { className: "file-node__icon", children: t.isRoot ? "📄" : t.status === "expanded" ? "📋" : t.repoAlias ? "🔗" : "📁" }),
1069
+ /* @__PURE__ */ n("span", { className: "file-node__label", title: t.filePath, children: t.label }),
1070
+ /* @__PURE__ */ n("span", { className: "file-node__actions", children: t.adoUrl && /* @__PURE__ */ n(
771
1071
  "a",
772
1072
  {
773
1073
  href: t.adoUrl,
@@ -775,61 +1075,61 @@ function va({ data: e }) {
775
1075
  rel: "noopener noreferrer",
776
1076
  className: "file-node__action-btn",
777
1077
  title: "Open in Azure DevOps",
778
- onClick: (d) => d.stopPropagation(),
779
- children: /* @__PURE__ */ s(Na, {})
1078
+ onClick: (m) => m.stopPropagation(),
1079
+ children: /* @__PURE__ */ n(Ca, {})
780
1080
  }
781
1081
  ) })
782
1082
  ] }),
783
- t.repoAlias && /* @__PURE__ */ l(
1083
+ t.repoAlias && /* @__PURE__ */ i(
784
1084
  "div",
785
1085
  {
786
1086
  className: "file-node__repo-row",
787
- onMouseEnter: () => o(!0),
788
- onMouseLeave: () => o(!1),
1087
+ onMouseEnter: () => r(!0),
1088
+ onMouseLeave: () => r(!1),
789
1089
  children: [
790
- /* @__PURE__ */ l("span", { className: "file-node__repo", children: [
1090
+ /* @__PURE__ */ i("span", { className: "file-node__repo", children: [
791
1091
  "@",
792
1092
  t.repoAlias
793
1093
  ] }),
794
- t.repoInfo && a && /* @__PURE__ */ l("div", { className: "file-node__repo-tooltip", children: [
795
- /* @__PURE__ */ l("div", { className: "file-node__repo-tooltip-row", children: [
796
- /* @__PURE__ */ s("span", { className: "file-node__repo-tooltip-label", children: "Repo" }),
797
- /* @__PURE__ */ s("span", { children: t.repoInfo.fullName })
1094
+ t.repoInfo && a && /* @__PURE__ */ i("div", { className: "file-node__repo-tooltip", children: [
1095
+ /* @__PURE__ */ i("div", { className: "file-node__repo-tooltip-row", children: [
1096
+ /* @__PURE__ */ n("span", { className: "file-node__repo-tooltip-label", children: "Repo" }),
1097
+ /* @__PURE__ */ n("span", { children: t.repoInfo.fullName })
798
1098
  ] }),
799
- /* @__PURE__ */ l("div", { className: "file-node__repo-tooltip-row", children: [
800
- /* @__PURE__ */ s("span", { className: "file-node__repo-tooltip-label", children: "Type" }),
801
- /* @__PURE__ */ s("span", { children: t.repoInfo.type })
1099
+ /* @__PURE__ */ i("div", { className: "file-node__repo-tooltip-row", children: [
1100
+ /* @__PURE__ */ n("span", { className: "file-node__repo-tooltip-label", children: "Type" }),
1101
+ /* @__PURE__ */ n("span", { children: t.repoInfo.type })
802
1102
  ] }),
803
- t.repoInfo.ref && /* @__PURE__ */ l("div", { className: "file-node__repo-tooltip-row", children: [
804
- /* @__PURE__ */ s("span", { className: "file-node__repo-tooltip-label", children: "Ref" }),
805
- /* @__PURE__ */ s("span", { children: t.repoInfo.ref })
1103
+ t.repoInfo.ref && /* @__PURE__ */ i("div", { className: "file-node__repo-tooltip-row", children: [
1104
+ /* @__PURE__ */ n("span", { className: "file-node__repo-tooltip-label", children: "Ref" }),
1105
+ /* @__PURE__ */ n("span", { children: t.repoInfo.ref })
806
1106
  ] }),
807
- t.repoInfo.project && /* @__PURE__ */ l("div", { className: "file-node__repo-tooltip-row", children: [
808
- /* @__PURE__ */ s("span", { className: "file-node__repo-tooltip-label", children: "Project" }),
809
- /* @__PURE__ */ s("span", { children: t.repoInfo.project })
1107
+ t.repoInfo.project && /* @__PURE__ */ i("div", { className: "file-node__repo-tooltip-row", children: [
1108
+ /* @__PURE__ */ n("span", { className: "file-node__repo-tooltip-label", children: "Project" }),
1109
+ /* @__PURE__ */ n("span", { children: t.repoInfo.project })
810
1110
  ] })
811
1111
  ] })
812
1112
  ]
813
1113
  }
814
1114
  ),
815
- /* @__PURE__ */ l("div", { className: "file-node__meta", children: [
816
- t.status === "loading" && /* @__PURE__ */ s("span", { className: "file-node__spinner", children: "⏳ Loading..." }),
817
- t.status === "error" && /* @__PURE__ */ l("span", { className: "file-node__error", title: t.errorMessage, children: [
1115
+ /* @__PURE__ */ i("div", { className: "file-node__meta", children: [
1116
+ t.status === "loading" && /* @__PURE__ */ n("span", { className: "file-node__spinner", children: "⏳ Loading..." }),
1117
+ t.status === "error" && /* @__PURE__ */ i("span", { className: "file-node__error", title: t.errorMessage, children: [
818
1118
  "❌ ",
819
- (c = t.errorMessage) == null ? void 0 : c.slice(0, 80)
1119
+ (d = t.errorMessage) == null ? void 0 : d.slice(0, 80)
820
1120
  ] }),
821
- t.status === "collapsed" && /* @__PURE__ */ s("span", { className: "file-node__hint", children: "Click to expand" }),
822
- t.status === "expanded" && t.templateCount === 0 && !t.isRoot && /* @__PURE__ */ s("span", { className: "file-node__leaf", children: "✓ no nested templates" }),
823
- (t.status === "root" || t.status === "expanded") && t.templateCount > 0 && /* @__PURE__ */ l("span", { className: "file-node__count", children: [
1121
+ t.status === "collapsed" && /* @__PURE__ */ n("span", { className: "file-node__hint", children: "Click to expand" }),
1122
+ t.status === "expanded" && t.templateCount === 0 && !t.isRoot && /* @__PURE__ */ n("span", { className: "file-node__leaf", children: "✓ no nested templates" }),
1123
+ (t.status === "root" || t.status === "expanded") && t.templateCount > 0 && /* @__PURE__ */ i("span", { className: "file-node__count", children: [
824
1124
  t.templateCount,
825
1125
  " template ref(s)"
826
1126
  ] })
827
1127
  ] }),
828
- /* @__PURE__ */ s(Se, { type: "source", position: Ce.Bottom })
1128
+ /* @__PURE__ */ n(De, { type: "source", position: Ie.Bottom })
829
1129
  ] });
830
1130
  }
831
- function Na() {
832
- return /* @__PURE__ */ s(
1131
+ function Ca() {
1132
+ return /* @__PURE__ */ n(
833
1133
  "svg",
834
1134
  {
835
1135
  width: "14",
@@ -837,7 +1137,7 @@ function Na() {
837
1137
  viewBox: "0 0 18 18",
838
1138
  className: "file-node__ado-icon",
839
1139
  "aria-label": "Azure DevOps",
840
- children: /* @__PURE__ */ s(
1140
+ children: /* @__PURE__ */ n(
841
1141
  "path",
842
1142
  {
843
1143
  d: "M17 4v9.74l-4 3.28-6.2-2.26V17l-3.51-4.59 10.23.8V4.44zm-3.41.49L7.85 1v2.29L2.58 4.84 1 6.87v4.61l2.26 1V6.57z",
@@ -847,132 +1147,132 @@ function Na() {
847
1147
  }
848
1148
  );
849
1149
  }
850
- const ba = Ze(va);
851
- function Ge({
1150
+ const Sa = tt(xa);
1151
+ function Je({
852
1152
  className: e,
853
1153
  label: t,
854
1154
  children: a
855
1155
  }) {
856
- const [o, r] = L(!1);
857
- return /* @__PURE__ */ l(
1156
+ const [r, o] = I(!1);
1157
+ return /* @__PURE__ */ i(
858
1158
  "span",
859
1159
  {
860
1160
  className: e,
861
- onMouseEnter: () => r(!0),
862
- onMouseLeave: () => r(!1),
1161
+ onMouseEnter: () => o(!0),
1162
+ onMouseLeave: () => o(!1),
863
1163
  children: [
864
1164
  t,
865
- o && /* @__PURE__ */ s("div", { className: "template-edge__badge-tooltip", children: a })
1165
+ r && /* @__PURE__ */ n("div", { className: "template-edge__badge-tooltip", children: a })
866
1166
  ]
867
1167
  }
868
1168
  );
869
1169
  }
870
- function ya({
1170
+ function Da({
871
1171
  id: e,
872
1172
  sourceX: t,
873
1173
  sourceY: a,
874
- targetX: o,
875
- targetY: r,
876
- sourcePosition: n,
877
- targetPosition: c,
878
- data: d,
1174
+ targetX: r,
1175
+ targetY: o,
1176
+ sourcePosition: s,
1177
+ targetPosition: d,
1178
+ data: m,
879
1179
  markerEnd: u,
880
- style: h
1180
+ style: c
881
1181
  }) {
882
- var P;
883
- const i = d, [m, f] = L(!1), [p, w, E] = At({
1182
+ var b;
1183
+ const l = m, [h, g] = I(!1), [p, w, R] = Ut({
884
1184
  sourceX: t,
885
1185
  sourceY: a,
886
- sourcePosition: n,
887
- targetX: o,
888
- targetY: r,
889
- targetPosition: c
890
- }), _ = ne(() => f(!0), []), b = ne(() => f(!1), []), y = ((P = i == null ? void 0 : i.parameterNames) == null ? void 0 : P.length) ?? 0;
891
- return /* @__PURE__ */ l(Je, { children: [
892
- /* @__PURE__ */ s(It, { id: e, path: p, markerEnd: u, style: h }),
893
- /* @__PURE__ */ s(Lt, { children: /* @__PURE__ */ l(
1186
+ sourcePosition: s,
1187
+ targetX: r,
1188
+ targetY: o,
1189
+ targetPosition: d
1190
+ }), f = se(() => g(!0), []), y = se(() => g(!1), []), P = ((b = l == null ? void 0 : l.parameterNames) == null ? void 0 : b.length) ?? 0;
1191
+ return /* @__PURE__ */ i(Qe, { children: [
1192
+ /* @__PURE__ */ n(Mt, { id: e, path: p, markerEnd: u, style: c }),
1193
+ /* @__PURE__ */ n(Ot, { children: /* @__PURE__ */ i(
894
1194
  "div",
895
1195
  {
896
1196
  className: "template-edge__label-container",
897
1197
  style: {
898
1198
  position: "absolute",
899
- transform: `translate(-50%, -50%) translate(${w}px,${E}px)`,
1199
+ transform: `translate(-50%, -50%) translate(${w}px,${R}px)`,
900
1200
  pointerEvents: "all"
901
1201
  },
902
1202
  children: [
903
- /* @__PURE__ */ l("div", { className: "template-edge__top-row", children: [
904
- /* @__PURE__ */ s("span", { className: "template-edge__category", children: i == null ? void 0 : i.edgeLabel }),
905
- (i == null ? void 0 : i.conditional) && /* @__PURE__ */ l(
906
- Ge,
1203
+ /* @__PURE__ */ i("div", { className: "template-edge__top-row", children: [
1204
+ /* @__PURE__ */ n("span", { className: "template-edge__category", children: l == null ? void 0 : l.edgeLabel }),
1205
+ (l == null ? void 0 : l.conditional) && /* @__PURE__ */ i(
1206
+ Je,
907
1207
  {
908
- className: `template-edge__badge template-edge__badge--conditional${i.conditionResult === !1 ? " template-edge__badge--condition-false" : i.conditionResult === !0 ? " template-edge__badge--condition-true" : ""}`,
909
- label: i.conditionResult === !1 ? "⊘ false" : i.conditionResult === !0 ? "✓ conditional" : "conditional",
1208
+ className: `template-edge__badge template-edge__badge--conditional${l.conditionResult === !1 ? " template-edge__badge--condition-false" : l.conditionResult === !0 ? " template-edge__badge--condition-true" : ""}`,
1209
+ label: l.conditionResult === !1 ? "⊘ false" : l.conditionResult === !0 ? "✓ conditional" : "conditional",
910
1210
  children: [
911
- /* @__PURE__ */ s("div", { className: "template-edge__badge-tooltip-title", children: "⚡ Conditional Reference" }),
912
- /* @__PURE__ */ s("p", { children: i.conditionResult === !0 ? "Condition evaluated to true — this template will be included." : i.conditionResult === !1 ? "Condition evaluated to false — this template will NOT be included in this pipeline run." : "This template is inside a conditional block. The condition could not be fully evaluated." }),
913
- i.conditionExpression && /* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
914
- /* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Condition" }),
915
- /* @__PURE__ */ s("code", { children: i.conditionExpression })
1211
+ /* @__PURE__ */ n("div", { className: "template-edge__badge-tooltip-title", children: "⚡ Conditional Reference" }),
1212
+ /* @__PURE__ */ n("p", { children: l.conditionResult === !0 ? "Condition evaluated to true — this template will be included." : l.conditionResult === !1 ? "Condition evaluated to false — this template will NOT be included in this pipeline run." : "This template is inside a conditional block. The condition could not be fully evaluated." }),
1213
+ l.conditionExpression && /* @__PURE__ */ i("div", { className: "template-edge__badge-tooltip-row", children: [
1214
+ /* @__PURE__ */ n("span", { className: "template-edge__badge-tooltip-label", children: "Condition" }),
1215
+ /* @__PURE__ */ n("code", { children: l.conditionExpression })
916
1216
  ] }),
917
- i.conditionResult != null && /* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
918
- /* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Result" }),
919
- /* @__PURE__ */ s("code", { children: String(i.conditionResult) })
1217
+ l.conditionResult != null && /* @__PURE__ */ i("div", { className: "template-edge__badge-tooltip-row", children: [
1218
+ /* @__PURE__ */ n("span", { className: "template-edge__badge-tooltip-label", children: "Result" }),
1219
+ /* @__PURE__ */ n("code", { children: String(l.conditionResult) })
920
1220
  ] })
921
1221
  ]
922
1222
  }
923
1223
  ),
924
- (i == null ? void 0 : i.dynamicPath) && i.expressionResolved && /* @__PURE__ */ l(
925
- Ge,
1224
+ (l == null ? void 0 : l.dynamicPath) && l.expressionResolved && /* @__PURE__ */ i(
1225
+ Je,
926
1226
  {
927
1227
  className: "template-edge__badge template-edge__badge--resolved",
928
1228
  label: "🔮 resolved",
929
1229
  children: [
930
- /* @__PURE__ */ s("div", { className: "template-edge__badge-tooltip-title", children: "🔮 Expression Resolved" }),
931
- /* @__PURE__ */ s("p", { children: "The template path contained expressions that were successfully evaluated." }),
932
- /* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
933
- /* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Original" }),
934
- /* @__PURE__ */ s("code", { children: i.originalPath })
1230
+ /* @__PURE__ */ n("div", { className: "template-edge__badge-tooltip-title", children: "🔮 Expression Resolved" }),
1231
+ /* @__PURE__ */ n("p", { children: "The template path contained expressions that were successfully evaluated." }),
1232
+ /* @__PURE__ */ i("div", { className: "template-edge__badge-tooltip-row", children: [
1233
+ /* @__PURE__ */ n("span", { className: "template-edge__badge-tooltip-label", children: "Original" }),
1234
+ /* @__PURE__ */ n("code", { children: l.originalPath })
935
1235
  ] }),
936
- i.resolvedPath && /* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
937
- /* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Resolved" }),
938
- /* @__PURE__ */ s("code", { children: i.resolvedPath })
1236
+ l.resolvedPath && /* @__PURE__ */ i("div", { className: "template-edge__badge-tooltip-row", children: [
1237
+ /* @__PURE__ */ n("span", { className: "template-edge__badge-tooltip-label", children: "Resolved" }),
1238
+ /* @__PURE__ */ n("code", { children: l.resolvedPath })
939
1239
  ] })
940
1240
  ]
941
1241
  }
942
1242
  ),
943
- (i == null ? void 0 : i.dynamicPath) && !i.expressionResolved && /* @__PURE__ */ l(
944
- Ge,
1243
+ (l == null ? void 0 : l.dynamicPath) && !l.expressionResolved && /* @__PURE__ */ i(
1244
+ Je,
945
1245
  {
946
1246
  className: "template-edge__badge template-edge__badge--unresolved",
947
1247
  label: "⚠️ dynamic",
948
1248
  children: [
949
- /* @__PURE__ */ s("div", { className: "template-edge__badge-tooltip-title", children: "⚠️ Unresolved Expressions" }),
950
- /* @__PURE__ */ s("p", { children: "The template path contains expressions that could not be evaluated at analysis time." }),
951
- /* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
952
- /* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Original" }),
953
- /* @__PURE__ */ s("code", { children: i.originalPath })
1249
+ /* @__PURE__ */ n("div", { className: "template-edge__badge-tooltip-title", children: "⚠️ Unresolved Expressions" }),
1250
+ /* @__PURE__ */ n("p", { children: "The template path contains expressions that could not be evaluated at analysis time." }),
1251
+ /* @__PURE__ */ i("div", { className: "template-edge__badge-tooltip-row", children: [
1252
+ /* @__PURE__ */ n("span", { className: "template-edge__badge-tooltip-label", children: "Original" }),
1253
+ /* @__PURE__ */ n("code", { children: l.originalPath })
954
1254
  ] }),
955
- i.resolvedPath && i.resolvedPath !== i.originalPath && /* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
956
- /* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Partial" }),
957
- /* @__PURE__ */ s("code", { children: i.resolvedPath })
1255
+ l.resolvedPath && l.resolvedPath !== l.originalPath && /* @__PURE__ */ i("div", { className: "template-edge__badge-tooltip-row", children: [
1256
+ /* @__PURE__ */ n("span", { className: "template-edge__badge-tooltip-label", children: "Partial" }),
1257
+ /* @__PURE__ */ n("code", { children: l.resolvedPath })
958
1258
  ] }),
959
- i.unresolvedExpressions && i.unresolvedExpressions.length > 0 && /* @__PURE__ */ l("div", { className: "template-edge__badge-tooltip-row", children: [
960
- /* @__PURE__ */ s("span", { className: "template-edge__badge-tooltip-label", children: "Unresolved" }),
961
- /* @__PURE__ */ s("span", { children: i.unresolvedExpressions.join(", ") })
1259
+ l.unresolvedExpressions && l.unresolvedExpressions.length > 0 && /* @__PURE__ */ i("div", { className: "template-edge__badge-tooltip-row", children: [
1260
+ /* @__PURE__ */ n("span", { className: "template-edge__badge-tooltip-label", children: "Unresolved" }),
1261
+ /* @__PURE__ */ n("span", { children: l.unresolvedExpressions.join(", ") })
962
1262
  ] })
963
1263
  ]
964
1264
  }
965
1265
  )
966
1266
  ] }),
967
- y > 0 && /* @__PURE__ */ l(
1267
+ P > 0 && /* @__PURE__ */ i(
968
1268
  "span",
969
1269
  {
970
1270
  className: "template-edge__params-badge",
971
- onMouseEnter: _,
972
- onMouseLeave: b,
1271
+ onMouseEnter: f,
1272
+ onMouseLeave: y,
973
1273
  children: [
974
- wa(i),
975
- m && /* @__PURE__ */ s(Pa, { data: i })
1274
+ Ia(l),
1275
+ h && /* @__PURE__ */ n(Aa, { data: l })
976
1276
  ]
977
1277
  }
978
1278
  )
@@ -981,326 +1281,326 @@ function ya({
981
1281
  ) })
982
1282
  ] });
983
1283
  }
984
- function wa(e) {
1284
+ function Ia(e) {
985
1285
  var a;
986
1286
  const t = ((a = e.parameterNames) == null ? void 0 : a.length) ?? 0;
987
1287
  return e.totalParameterCount != null ? `${t}/${e.totalParameterCount} params` : `${t} params`;
988
1288
  }
989
- function Pa({ data: e }) {
990
- var a, o;
1289
+ function Aa({ data: e }) {
1290
+ var a, r;
991
1291
  const t = (a = e.declaredParameterNames) == null ? void 0 : a.filter(
992
- (r) => {
993
- var n;
994
- return !((n = e.parameterNames) != null && n.includes(r));
1292
+ (o) => {
1293
+ var s;
1294
+ return !((s = e.parameterNames) != null && s.includes(o));
995
1295
  }
996
1296
  );
997
- return /* @__PURE__ */ l("div", { className: "template-edge__params-tooltip", children: [
998
- e.parameterNames && e.parameterNames.length > 0 && /* @__PURE__ */ l("div", { className: "template-edge__params-section", children: [
999
- /* @__PURE__ */ l("div", { className: "template-edge__params-heading", children: [
1297
+ return /* @__PURE__ */ i("div", { className: "template-edge__params-tooltip", children: [
1298
+ e.parameterNames && e.parameterNames.length > 0 && /* @__PURE__ */ i("div", { className: "template-edge__params-section", children: [
1299
+ /* @__PURE__ */ i("div", { className: "template-edge__params-heading", children: [
1000
1300
  "✓ Passed (",
1001
1301
  e.parameterNames.length,
1002
1302
  ")"
1003
1303
  ] }),
1004
- /* @__PURE__ */ s("ul", { className: "template-edge__params-list", children: e.parameterNames.map((r) => /* @__PURE__ */ s(
1304
+ /* @__PURE__ */ n("ul", { className: "template-edge__params-list", children: e.parameterNames.map((o) => /* @__PURE__ */ n(
1005
1305
  "li",
1006
1306
  {
1007
1307
  className: "template-edge__params-item template-edge__params-item--passed",
1008
- children: r
1308
+ children: o
1009
1309
  },
1010
- r
1310
+ o
1011
1311
  )) })
1012
1312
  ] }),
1013
- t && t.length > 0 && /* @__PURE__ */ l("div", { className: "template-edge__params-section", children: [
1014
- /* @__PURE__ */ l("div", { className: "template-edge__params-heading", children: [
1313
+ t && t.length > 0 && /* @__PURE__ */ i("div", { className: "template-edge__params-section", children: [
1314
+ /* @__PURE__ */ i("div", { className: "template-edge__params-heading", children: [
1015
1315
  "○ Not passed (",
1016
1316
  t.length,
1017
1317
  ")"
1018
1318
  ] }),
1019
- /* @__PURE__ */ s("ul", { className: "template-edge__params-list", children: t.map((r) => /* @__PURE__ */ s(
1319
+ /* @__PURE__ */ n("ul", { className: "template-edge__params-list", children: t.map((o) => /* @__PURE__ */ n(
1020
1320
  "li",
1021
1321
  {
1022
1322
  className: "template-edge__params-item template-edge__params-item--missing",
1023
- children: r
1323
+ children: o
1024
1324
  },
1025
- r
1325
+ o
1026
1326
  )) })
1027
1327
  ] }),
1028
- e.totalParameterCount == null && !((o = e.declaredParameterNames) != null && o.length) && /* @__PURE__ */ s("div", { className: "template-edge__params-hint", children: "Expand node to see all declared params" })
1328
+ e.totalParameterCount == null && !((r = e.declaredParameterNames) != null && r.length) && /* @__PURE__ */ n("div", { className: "template-edge__params-hint", children: "Expand node to see all declared params" })
1029
1329
  ] });
1030
1330
  }
1031
- const Ea = Ze(ya), Ra = { fileNode: ba }, xa = { templateEdge: Ea }, ka = {
1331
+ const La = tt(Da), Ba = { fileNode: Sa }, Fa = { templateEdge: La }, Ua = {
1032
1332
  animated: !0,
1033
1333
  style: { stroke: "var(--accent)", strokeWidth: 2 },
1034
- markerEnd: { type: De.ArrowClosed, color: "var(--accent)" }
1334
+ markerEnd: { type: Ae.ArrowClosed, color: "var(--accent)" }
1035
1335
  };
1036
- function Ta() {
1037
- var le, be;
1336
+ function Ma() {
1337
+ var te, pe;
1038
1338
  const {
1039
1339
  org: e,
1040
1340
  project: t,
1041
1341
  selectedPipeline: a,
1042
- selectedPipelineLoading: o,
1043
- selectedPipelineError: r,
1044
- expandedTemplates: n,
1045
- setExpandedTemplate: c,
1046
- setSelectedNodeDetail: d
1047
- } = Ue(), u = _a(), [h, i, m] = ct([]), [f, p, w] = dt([]), E = Q(null), _ = Q(null), b = Q(""), y = Q([]);
1048
- ee(() => {
1049
- y.current = f;
1050
- }, [f]);
1051
- const [P, B] = L(/* @__PURE__ */ new Set()), k = Q(/* @__PURE__ */ new Set()), [T, se] = L(!1), C = ((be = (le = a == null ? void 0 : a.definition) == null ? void 0 : le.repository) == null ? void 0 : be.name) ?? "", V = ve(() => {
1342
+ selectedPipelineLoading: r,
1343
+ selectedPipelineError: o,
1344
+ expandedTemplates: s,
1345
+ setExpandedTemplate: d,
1346
+ setSelectedNodeDetail: m
1347
+ } = Oe(), u = $a(), [c, l, h] = ht([]), [g, p, w] = ft([]), R = ne(null), f = ne(null), y = ne(""), P = ne([]);
1348
+ Q(() => {
1349
+ P.current = g;
1350
+ }, [g]);
1351
+ const [b, F] = I(/* @__PURE__ */ new Set()), _ = ne(/* @__PURE__ */ new Set()), [T, x] = I(!1), k = ((pe = (te = a == null ? void 0 : a.definition) == null ? void 0 : te.repository) == null ? void 0 : pe.name) ?? "", L = ie(() => {
1052
1352
  if (!(a != null && a.yaml)) return [];
1053
1353
  try {
1054
- const N = ue(a.yaml), g = N == null ? void 0 : N.resources;
1055
- return (g == null ? void 0 : g.repositories) ?? [];
1354
+ const E = fe(a.yaml), N = E == null ? void 0 : E.resources;
1355
+ return (N == null ? void 0 : N.repositories) ?? [];
1056
1356
  } catch {
1057
1357
  return [];
1058
1358
  }
1059
- }, [a == null ? void 0 : a.yaml]), K = ve(() => {
1359
+ }, [a == null ? void 0 : a.yaml]), z = ie(() => {
1060
1360
  if (!(a != null && a.yaml)) return {};
1061
1361
  try {
1062
- const N = ue(a.yaml);
1063
- return Pe(N ?? {});
1362
+ const E = fe(a.yaml);
1363
+ return Te(E ?? {});
1064
1364
  } catch {
1065
1365
  return {};
1066
1366
  }
1067
1367
  }, [a == null ? void 0 : a.yaml]);
1068
- ee(() => {
1069
- var R, F, j, ce, de, pe, oe;
1368
+ Q(() => {
1369
+ var $, M, H, ue, me, he, le;
1070
1370
  if (!(a != null && a.yaml)) {
1071
- i([]), p([]);
1371
+ l([]), p([]);
1072
1372
  return;
1073
1373
  }
1074
- const N = ue(a.yaml), g = ((R = a.definition) == null ? void 0 : R.path) ?? "", v = Oe(N ?? {}, { sourcePath: g }), x = ((F = a.definition) == null ? void 0 : F.name) ?? g.split("/").pop() ?? "Pipeline", $ = Ie(g), A = ze(N ?? {}), D = ((ce = (j = a.definition) == null ? void 0 : j.repository) == null ? void 0 : ce.name) ?? "", W = (oe = (pe = (de = a.definition) == null ? void 0 : de.repository) == null ? void 0 : pe.defaultBranch) == null ? void 0 : oe.replace(
1374
+ const E = fe(a.yaml), N = (($ = a.definition) == null ? void 0 : $.path) ?? "", v = je(E ?? {}, { sourcePath: N }), C = ((M = a.definition) == null ? void 0 : M.name) ?? N.split("/").pop() ?? "Pipeline", S = Be(N), B = We(E ?? {}), A = ((ue = (H = a.definition) == null ? void 0 : H.repository) == null ? void 0 : ue.name) ?? "", K = (le = (he = (me = a.definition) == null ? void 0 : me.repository) == null ? void 0 : he.defaultBranch) == null ? void 0 : le.replace(
1075
1375
  /^refs\/heads\//,
1076
1376
  ""
1077
- ), I = e && t && D ? rt({
1377
+ ), U = e && t && A ? pt({
1078
1378
  org: e,
1079
1379
  project: t,
1080
- repoName: D,
1081
- filePath: g,
1082
- branch: W
1083
- }) : void 0, te = {
1380
+ repoName: A,
1381
+ filePath: N,
1382
+ branch: K
1383
+ }) : void 0, re = {
1084
1384
  id: "root",
1085
1385
  type: "fileNode",
1086
1386
  position: { x: 0, y: 0 },
1087
1387
  data: {
1088
- label: x,
1089
- filePath: g,
1388
+ label: C,
1389
+ filePath: N,
1090
1390
  templateCount: v.length,
1091
1391
  status: "root",
1092
1392
  isRoot: !0,
1093
- baseDir: $,
1094
- adoUrl: I
1393
+ baseDir: S,
1394
+ adoUrl: U
1095
1395
  }
1096
- }, { templateNodes: H, templateEdges: Z } = qe(
1396
+ }, { templateNodes: Y, templateEdges: ae } = Xe(
1097
1397
  "root",
1098
1398
  v,
1099
1399
  e,
1100
1400
  t,
1101
- C,
1102
- V,
1103
- A,
1401
+ k,
1402
+ L,
1403
+ B,
1104
1404
  void 0,
1105
1405
  // existingNodeIds
1106
- K
1107
- ), q = [te, ...H], ae = [...Z], { nodes: O, edges: U } = Ke(
1406
+ z
1407
+ ), q = [re, ...Y], oe = [...ae], { nodes: j, edges: O } = qe(
1108
1408
  q,
1109
- ae
1409
+ oe
1110
1410
  );
1111
- i(O), p(U), k.current = /* @__PURE__ */ new Set();
1112
- }, [a, i, p]);
1113
- const fe = Q(!1);
1114
- ee(() => {
1115
- if (!T || !E.current || h.length === 0) return;
1116
- const N = `${h.length}:${f.length}`;
1117
- if (N !== b.current)
1118
- return b.current = N, _.current != null && cancelAnimationFrame(_.current), _.current = requestAnimationFrame(() => {
1119
- var g;
1120
- (g = E.current) == null || g.fitView({
1411
+ l(j), p(O), _.current = /* @__PURE__ */ new Set();
1412
+ }, [a, l, p]);
1413
+ const ee = ne(!1);
1414
+ Q(() => {
1415
+ if (!T || !R.current || c.length === 0) return;
1416
+ const E = `${c.length}:${g.length}`;
1417
+ if (E !== y.current)
1418
+ return y.current = E, f.current != null && cancelAnimationFrame(f.current), f.current = requestAnimationFrame(() => {
1419
+ var N;
1420
+ (N = R.current) == null || N.fitView({
1121
1421
  padding: 0.2,
1122
1422
  duration: 300
1123
- }), _.current = null;
1423
+ }), f.current = null;
1124
1424
  }), () => {
1125
- _.current != null && (cancelAnimationFrame(_.current), _.current = null);
1425
+ f.current != null && (cancelAnimationFrame(f.current), f.current = null);
1126
1426
  };
1127
- }, [T, h.length, f.length]), ee(() => {
1128
- if (fe.current) return;
1129
- const N = h.filter((g) => {
1130
- const v = g.data;
1131
- if (v.status !== "collapsed" || k.current.has(g.id) || P.has(g.id)) return !1;
1132
- const x = v._conditionResult;
1133
- return !(x === !1 || x === "unknown" && !T);
1427
+ }, [T, c.length, g.length]), Q(() => {
1428
+ if (ee.current) return;
1429
+ const E = c.filter((N) => {
1430
+ const v = N.data;
1431
+ if (v.status !== "collapsed" || _.current.has(N.id) || b.has(N.id)) return !1;
1432
+ const C = v._conditionResult;
1433
+ return !(C === !1 || C === "unknown" && !T);
1134
1434
  });
1135
- if (N.length !== 0) {
1136
- N.sort((g, v) => {
1137
- const x = g.data.templateLocation === "variables" ? 0 : 1, $ = v.data.templateLocation === "variables" ? 0 : 1;
1138
- return x - $;
1435
+ if (E.length !== 0) {
1436
+ E.sort((N, v) => {
1437
+ const C = N.data.templateLocation === "variables" ? 0 : 1, S = v.data.templateLocation === "variables" ? 0 : 1;
1438
+ return C - S;
1139
1439
  });
1140
- for (const g of N) {
1141
- const v = g.data;
1142
- v.dynamicPath && !v.expressionResolved || k.current.add(g.id);
1440
+ for (const N of E) {
1441
+ const v = N.data;
1442
+ v.dynamicPath && !v.expressionResolved || _.current.add(N.id);
1143
1443
  }
1144
- fe.current = !0, (async () => {
1145
- for (const g of N) {
1146
- const v = g.data;
1444
+ ee.current = !0, (async () => {
1445
+ for (const N of E) {
1446
+ const v = N.data;
1147
1447
  if (!(v.dynamicPath && !v.expressionResolved))
1148
1448
  try {
1149
- const { content: x, actualPath: $ } = await Ye(
1449
+ const { content: C, actualPath: S } = await Ze(
1150
1450
  e,
1151
1451
  t,
1152
- C,
1452
+ k,
1153
1453
  v,
1154
- V,
1155
- n,
1156
- c,
1454
+ L,
1455
+ s,
1456
+ d,
1157
1457
  u
1158
- ), A = ue(x) ?? {}, D = v._ref, W = Oe(A, {
1159
- contextRepoAlias: ie(D ?? {}),
1160
- sourcePath: $
1161
- }), I = Qe(A);
1162
- if (W.length === 0) {
1163
- const H = v.templateLocation === "variables" ? Pe(A) : void 0, Z = H && Object.keys(H).length > 0, q = /* @__PURE__ */ new Set(), ae = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ new Map();
1164
- if (Z)
1165
- for (const U of h) {
1166
- const R = U.data;
1167
- if (R.dynamicPath && !R.expressionResolved) {
1168
- const F = xe(
1169
- U,
1170
- H,
1458
+ ), B = fe(C) ?? {}, A = v._ref, K = je(B, {
1459
+ contextRepoAlias: de(A ?? {}),
1460
+ sourcePath: S
1461
+ }), U = at(B);
1462
+ if (K.length === 0) {
1463
+ const Y = v.templateLocation === "variables" ? Te(B) : void 0, ae = Y && Object.keys(Y).length > 0, q = /* @__PURE__ */ new Set(), oe = /* @__PURE__ */ new Set(), j = /* @__PURE__ */ new Map();
1464
+ if (ae)
1465
+ for (const O of c) {
1466
+ const $ = O.data;
1467
+ if ($.dynamicPath && !$.expressionResolved) {
1468
+ const M = $e(
1469
+ O,
1470
+ Y,
1171
1471
  e,
1172
1472
  t,
1173
- C,
1174
- V
1473
+ k,
1474
+ L
1175
1475
  );
1176
- if (F !== U) {
1177
- q.add(U.id);
1178
- const j = F.data;
1179
- j.repoAlias && ae.add(U.id), O.set(U.id, j.filePath);
1476
+ if (M !== O) {
1477
+ q.add(O.id);
1478
+ const H = M.data;
1479
+ H.repoAlias && oe.add(O.id), j.set(O.id, H.filePath);
1180
1480
  }
1181
1481
  }
1182
1482
  }
1183
- i(
1184
- (U) => U.map((R) => R.id === g.id ? {
1185
- ...R,
1483
+ l(
1484
+ (O) => O.map(($) => $.id === N.id ? {
1485
+ ...$,
1186
1486
  data: {
1187
- ...R.data,
1487
+ ...$.data,
1188
1488
  status: "expanded",
1189
1489
  templateCount: 0,
1190
- totalParameterCount: I.length || void 0,
1191
- declaredParameterNames: I.length ? I : void 0
1490
+ totalParameterCount: U.length || void 0,
1491
+ declaredParameterNames: U.length ? U : void 0
1192
1492
  }
1193
- } : Z && q.has(R.id) ? xe(
1194
- R,
1195
- H,
1493
+ } : ae && q.has($.id) ? $e(
1494
+ $,
1495
+ Y,
1196
1496
  e,
1197
1497
  t,
1198
- C,
1199
- V
1200
- ) : R)
1498
+ k,
1499
+ L
1500
+ ) : $)
1201
1501
  ), q.size > 0 && p(
1202
- (U) => U.map((R) => {
1203
- if (!q.has(R.target)) return R;
1204
- const F = R.data;
1205
- if (!(F != null && F.dynamicPath)) return R;
1206
- const j = ae.has(R.target);
1502
+ (O) => O.map(($) => {
1503
+ if (!q.has($.target)) return $;
1504
+ const M = $.data;
1505
+ if (!(M != null && M.dynamicPath)) return $;
1506
+ const H = oe.has($.target);
1207
1507
  return {
1208
- ...R,
1508
+ ...$,
1209
1509
  data: {
1210
- ...F,
1510
+ ...M,
1211
1511
  expressionResolved: !0,
1212
- isExternal: j || F.isExternal || void 0,
1213
- resolvedPath: O.get(R.target) ?? F.resolvedPath,
1512
+ isExternal: H || M.isExternal || void 0,
1513
+ resolvedPath: j.get($.target) ?? M.resolvedPath,
1214
1514
  unresolvedExpressions: void 0
1215
1515
  },
1216
- style: j ? {
1516
+ style: H ? {
1217
1517
  stroke: "var(--badge-resources)",
1218
1518
  strokeWidth: 2,
1219
1519
  strokeDasharray: "6 3"
1220
- } : R.style,
1221
- markerEnd: j ? {
1222
- type: De.ArrowClosed,
1520
+ } : $.style,
1521
+ markerEnd: H ? {
1522
+ type: Ae.ArrowClosed,
1223
1523
  color: "var(--badge-resources)"
1224
- } : R.markerEnd
1524
+ } : $.markerEnd
1225
1525
  };
1226
1526
  })
1227
1527
  );
1228
1528
  } else if (T) {
1229
- const te = ze(A), H = v._parentParamContext, Z = v._accumulatedVariables, q = D == null ? void 0 : D.parameters, ae = Ae(
1529
+ const re = We(B), Y = v._parentParamContext, ae = v._accumulatedVariables, q = A == null ? void 0 : A.parameters, oe = Le(
1230
1530
  q,
1231
- H,
1232
- Z
1233
- ), O = { ...te, ...ae }, U = Pe(A), R = {
1234
- ...Z ?? K,
1235
- ...U
1236
- }, F = v._accumulatedResources, j = at(A), ce = nt([
1237
- ...F ?? V,
1238
- ...j
1531
+ Y,
1532
+ ae
1533
+ ), j = { ...re, ...oe }, O = Te(B), $ = {
1534
+ ...ae ?? z,
1535
+ ...O
1536
+ }, M = v._accumulatedResources, H = it(B), ue = lt([
1537
+ ...M ?? L,
1538
+ ...H
1239
1539
  ]);
1240
- await new Promise((z) => setTimeout(z, 0));
1241
- const de = new Set(h.map((z) => z.id)), { templateNodes: pe, templateEdges: oe } = qe(
1242
- g.id,
1243
- W,
1540
+ await new Promise((W) => setTimeout(W, 0));
1541
+ const me = new Set(c.map((W) => W.id)), { templateNodes: he, templateEdges: le } = Xe(
1542
+ N.id,
1543
+ K,
1244
1544
  e,
1245
1545
  t,
1246
- C,
1247
- ce,
1248
- O,
1249
- de,
1250
- R
1546
+ k,
1547
+ ue,
1548
+ j,
1549
+ me,
1550
+ $
1251
1551
  );
1252
- i((z) => {
1253
- const re = new Set(z.map((S) => S.id)), ye = pe.filter(
1254
- (S) => !re.has(S.id)
1255
- ), we = [...z.map(
1256
- (S) => S.id === g.id ? {
1257
- ...S,
1552
+ l((W) => {
1553
+ const ce = new Set(W.map((D) => D.id)), we = he.filter(
1554
+ (D) => !ce.has(D.id)
1555
+ ), Pe = [...W.map(
1556
+ (D) => D.id === N.id ? {
1557
+ ...D,
1258
1558
  data: {
1259
- ...S.data,
1559
+ ...D.data,
1260
1560
  status: "expanded",
1261
- templateCount: W.length,
1262
- totalParameterCount: I.length || void 0,
1263
- declaredParameterNames: I.length ? I : void 0
1561
+ templateCount: K.length,
1562
+ totalParameterCount: U.length || void 0,
1563
+ declaredParameterNames: U.length ? U : void 0
1264
1564
  }
1265
- } : S
1266
- ), ...ye], Y = [...I.length ? Re(
1267
- y.current,
1268
- g.id,
1269
- I
1270
- ) : y.current, ...oe];
1271
- return Ke(we, Y).nodes;
1272
- }), p((z) => [...I.length ? Re(
1273
- z,
1274
- g.id,
1275
- I
1276
- ) : z, ...oe]), await new Promise((z) => setTimeout(z, 50));
1565
+ } : D
1566
+ ), ...we], J = [...U.length ? ke(
1567
+ P.current,
1568
+ N.id,
1569
+ U
1570
+ ) : P.current, ...le];
1571
+ return qe(Pe, J).nodes;
1572
+ }), p((W) => [...U.length ? ke(
1573
+ W,
1574
+ N.id,
1575
+ U
1576
+ ) : W, ...le]), await new Promise((W) => setTimeout(W, 50));
1277
1577
  }
1278
1578
  } catch {
1279
1579
  }
1280
1580
  }
1281
- fe.current = !1, T && i((g) => [...g]);
1581
+ ee.current = !1, T && l((N) => [...N]);
1282
1582
  })();
1283
1583
  }
1284
1584
  }, [
1285
- h,
1585
+ c,
1286
1586
  e,
1287
1587
  t,
1288
- C,
1289
- V,
1290
- n,
1291
- c,
1292
- P,
1293
- i,
1588
+ k,
1589
+ L,
1590
+ s,
1591
+ d,
1592
+ b,
1593
+ l,
1294
1594
  p,
1295
1595
  T,
1296
1596
  u
1297
1597
  ]);
1298
- const G = ne(
1299
- async (N, g) => {
1300
- const v = g.data;
1598
+ const G = se(
1599
+ async (E, N) => {
1600
+ const v = N.data;
1301
1601
  if (v.status === "root" && (a != null && a.yaml)) {
1302
- d({
1303
- nodeId: g.id,
1602
+ m({
1603
+ nodeId: N.id,
1304
1604
  label: v.label,
1305
1605
  filePath: v.filePath,
1306
1606
  yaml: a.yaml
@@ -1308,173 +1608,173 @@ function Ta() {
1308
1608
  return;
1309
1609
  }
1310
1610
  if (v.status === "expanded") {
1311
- const x = v._ref, $ = ie(x ?? {}) || "", A = `${$}:${v.filePath}`, D = v._fallbackPath, W = D ? `${$}:${D}` : void 0, I = n.get(A) ?? (W ? n.get(W) : void 0);
1312
- if (I) {
1313
- d({
1314
- nodeId: g.id,
1611
+ const C = v._ref, S = de(C ?? {}) || "", B = `${S}:${v.filePath}`, A = v._fallbackPath, K = A ? `${S}:${A}` : void 0, U = s.get(B) ?? (K ? s.get(K) : void 0);
1612
+ if (U) {
1613
+ m({
1614
+ nodeId: N.id,
1315
1615
  label: v.label,
1316
1616
  filePath: v.filePath,
1317
- yaml: I,
1617
+ yaml: U,
1318
1618
  repoAlias: v.repoAlias
1319
1619
  });
1320
1620
  return;
1321
1621
  }
1322
1622
  try {
1323
- const { content: te } = await Ye(
1623
+ const { content: re } = await Ze(
1324
1624
  e,
1325
1625
  t,
1326
- C,
1626
+ k,
1327
1627
  v,
1328
- V,
1329
- n,
1330
- c,
1628
+ L,
1629
+ s,
1630
+ d,
1331
1631
  u
1332
1632
  );
1333
- d({
1334
- nodeId: g.id,
1633
+ m({
1634
+ nodeId: N.id,
1335
1635
  label: v.label,
1336
1636
  filePath: v.filePath,
1337
- yaml: te,
1637
+ yaml: re,
1338
1638
  repoAlias: v.repoAlias
1339
1639
  });
1340
1640
  } catch {
1341
1641
  }
1342
1642
  return;
1343
1643
  }
1344
- if (v.status === "collapsed" && !P.has(g.id)) {
1345
- B((x) => new Set(x).add(g.id)), i(
1346
- (x) => x.map(
1347
- ($) => $.id === g.id ? { ...$, data: { ...$.data, status: "loading" } } : $
1644
+ if (v.status === "collapsed" && !b.has(N.id)) {
1645
+ F((C) => new Set(C).add(N.id)), l(
1646
+ (C) => C.map(
1647
+ (S) => S.id === N.id ? { ...S, data: { ...S.data, status: "loading" } } : S
1348
1648
  )
1349
1649
  );
1350
1650
  try {
1351
- const { content: x, actualPath: $ } = await Ye(
1651
+ const { content: C, actualPath: S } = await Ze(
1352
1652
  e,
1353
1653
  t,
1354
- C,
1654
+ k,
1355
1655
  v,
1356
- V,
1357
- n,
1358
- c,
1656
+ L,
1657
+ s,
1658
+ d,
1359
1659
  u
1360
- ), A = ue(x) ?? {}, D = v._ref, W = Oe(A, {
1361
- contextRepoAlias: ie(D ?? {}),
1362
- sourcePath: $
1363
- }), I = ze(A), te = v._parentParamContext, H = v._accumulatedVariables, Z = D == null ? void 0 : D.parameters, q = Ae(
1364
- Z,
1365
- te,
1366
- H
1367
- ), ae = { ...I, ...q }, O = Qe(A), U = Ie($), R = Pe(A), F = {
1368
- ...H ?? K,
1369
- ...R
1370
- }, j = v._accumulatedResources, ce = at(A), de = nt([
1371
- ...j ?? V,
1372
- ...ce
1373
- ]), pe = new Set(h.map((M) => M.id)), { templateNodes: oe, templateEdges: z } = qe(
1374
- g.id,
1375
- W,
1660
+ ), B = fe(C) ?? {}, A = v._ref, K = je(B, {
1661
+ contextRepoAlias: de(A ?? {}),
1662
+ sourcePath: S
1663
+ }), U = We(B), re = v._parentParamContext, Y = v._accumulatedVariables, ae = A == null ? void 0 : A.parameters, q = Le(
1664
+ ae,
1665
+ re,
1666
+ Y
1667
+ ), oe = { ...U, ...q }, j = at(B), O = Be(S), $ = Te(B), M = {
1668
+ ...Y ?? z,
1669
+ ...$
1670
+ }, H = v._accumulatedResources, ue = it(B), me = lt([
1671
+ ...H ?? L,
1672
+ ...ue
1673
+ ]), he = new Set(c.map((V) => V.id)), { templateNodes: le, templateEdges: W } = Xe(
1674
+ N.id,
1675
+ K,
1376
1676
  e,
1377
1677
  t,
1378
- C,
1379
- de,
1380
- ae,
1381
- pe,
1382
- F
1383
- ), re = /* @__PURE__ */ new Set(), ye = /* @__PURE__ */ new Set(), Ve = /* @__PURE__ */ new Map(), we = v.templateLocation === "variables" && Object.keys(R).length > 0;
1384
- if (we)
1385
- for (const M of h) {
1386
- const Y = M.data;
1387
- if (Y.dynamicPath && !Y.expressionResolved) {
1388
- const S = xe(
1389
- M,
1390
- R,
1678
+ k,
1679
+ me,
1680
+ oe,
1681
+ he,
1682
+ M
1683
+ ), ce = /* @__PURE__ */ new Set(), we = /* @__PURE__ */ new Set(), Ve = /* @__PURE__ */ new Map(), Pe = v.templateLocation === "variables" && Object.keys($).length > 0;
1684
+ if (Pe)
1685
+ for (const V of c) {
1686
+ const J = V.data;
1687
+ if (J.dynamicPath && !J.expressionResolved) {
1688
+ const D = $e(
1689
+ V,
1690
+ $,
1391
1691
  e,
1392
1692
  t,
1393
- C,
1394
- V
1693
+ k,
1694
+ L
1395
1695
  );
1396
- if (S !== M) {
1397
- re.add(M.id);
1398
- const J = S.data;
1399
- J.repoAlias && ye.add(M.id), Ve.set(M.id, J.filePath);
1696
+ if (D !== V) {
1697
+ ce.add(V.id);
1698
+ const X = D.data;
1699
+ X.repoAlias && we.add(V.id), Ve.set(V.id, X.filePath);
1400
1700
  }
1401
1701
  }
1402
1702
  }
1403
- i((M) => {
1404
- const Y = new Set(M.map((X) => X.id)), S = oe.filter((X) => !Y.has(X.id)), ge = [...M.map((X) => X.id === g.id ? {
1405
- ...X,
1703
+ l((V) => {
1704
+ const J = new Set(V.map((Z) => Z.id)), D = le.filter((Z) => !J.has(Z.id)), ve = [...V.map((Z) => Z.id === N.id ? {
1705
+ ...Z,
1406
1706
  data: {
1407
- ...X.data,
1707
+ ...Z.data,
1408
1708
  status: "expanded",
1409
- templateCount: W.length,
1410
- totalParameterCount: O.length || void 0,
1411
- declaredParameterNames: O.length ? O : void 0
1709
+ templateCount: K.length,
1710
+ totalParameterCount: j.length || void 0,
1711
+ declaredParameterNames: j.length ? j : void 0
1412
1712
  }
1413
- } : we && re.has(X.id) ? xe(
1414
- X,
1415
- R,
1713
+ } : Pe && ce.has(Z.id) ? $e(
1714
+ Z,
1715
+ $,
1416
1716
  e,
1417
1717
  t,
1418
- C,
1419
- V
1420
- ) : X), ...S], bt = [...O.length ? Re(
1421
- y.current,
1422
- g.id,
1423
- O
1424
- ) : y.current, ...z];
1425
- return Ke(ge, bt).nodes;
1426
- }), p((M) => {
1427
- let Y = O.length ? Re(
1428
- M,
1429
- g.id,
1430
- O
1431
- ) : M;
1432
- return re.size > 0 && (Y = Y.map((S) => {
1433
- if (!re.has(S.target)) return S;
1434
- const J = S.data;
1435
- if (!(J != null && J.dynamicPath)) return S;
1436
- const ge = ye.has(S.target);
1718
+ k,
1719
+ L
1720
+ ) : Z), ...D], Et = [...j.length ? ke(
1721
+ P.current,
1722
+ N.id,
1723
+ j
1724
+ ) : P.current, ...W];
1725
+ return qe(ve, Et).nodes;
1726
+ }), p((V) => {
1727
+ let J = j.length ? ke(
1728
+ V,
1729
+ N.id,
1730
+ j
1731
+ ) : V;
1732
+ return ce.size > 0 && (J = J.map((D) => {
1733
+ if (!ce.has(D.target)) return D;
1734
+ const X = D.data;
1735
+ if (!(X != null && X.dynamicPath)) return D;
1736
+ const ve = we.has(D.target);
1437
1737
  return {
1438
- ...S,
1738
+ ...D,
1439
1739
  data: {
1440
- ...J,
1740
+ ...X,
1441
1741
  expressionResolved: !0,
1442
- isExternal: ge || J.isExternal || void 0,
1443
- resolvedPath: Ve.get(S.target) ?? J.resolvedPath,
1742
+ isExternal: ve || X.isExternal || void 0,
1743
+ resolvedPath: Ve.get(D.target) ?? X.resolvedPath,
1444
1744
  unresolvedExpressions: void 0
1445
1745
  },
1446
- style: ge ? {
1746
+ style: ve ? {
1447
1747
  stroke: "var(--badge-resources)",
1448
1748
  strokeWidth: 2,
1449
1749
  strokeDasharray: "6 3"
1450
- } : S.style,
1451
- markerEnd: ge ? {
1452
- type: De.ArrowClosed,
1750
+ } : D.style,
1751
+ markerEnd: ve ? {
1752
+ type: Ae.ArrowClosed,
1453
1753
  color: "var(--badge-resources)"
1454
- } : S.markerEnd
1754
+ } : D.markerEnd
1455
1755
  };
1456
- })), [...Y, ...z];
1457
- }), d({
1458
- nodeId: g.id,
1756
+ })), [...J, ...W];
1757
+ }), m({
1758
+ nodeId: N.id,
1459
1759
  label: v.label,
1460
1760
  filePath: v.filePath,
1461
- yaml: x,
1761
+ yaml: C,
1462
1762
  repoAlias: v.repoAlias
1463
1763
  });
1464
- } catch (x) {
1465
- const $ = x instanceof Error ? x.message : String(x);
1466
- i(
1467
- (A) => A.map(
1468
- (D) => D.id === g.id ? {
1469
- ...D,
1470
- data: { ...D.data, status: "error", errorMessage: $ }
1471
- } : D
1764
+ } catch (C) {
1765
+ const S = C instanceof Error ? C.message : String(C);
1766
+ l(
1767
+ (B) => B.map(
1768
+ (A) => A.id === N.id ? {
1769
+ ...A,
1770
+ data: { ...A.data, status: "error", errorMessage: S }
1771
+ } : A
1472
1772
  )
1473
1773
  );
1474
1774
  } finally {
1475
- B((x) => {
1476
- const $ = new Set(x);
1477
- return $.delete(g.id), $;
1775
+ F((C) => {
1776
+ const S = new Set(C);
1777
+ return S.delete(N.id), S;
1478
1778
  });
1479
1779
  }
1480
1780
  }
@@ -1482,102 +1782,102 @@ function Ta() {
1482
1782
  [
1483
1783
  e,
1484
1784
  t,
1485
- C,
1785
+ k,
1486
1786
  a,
1487
- V,
1488
- n,
1489
- c,
1787
+ L,
1788
+ s,
1490
1789
  d,
1491
- P,
1492
- i,
1790
+ m,
1791
+ b,
1792
+ l,
1493
1793
  p,
1494
1794
  u
1495
1795
  ]
1496
- ), Me = ne(() => {
1497
- se((N) => (N || (k.current = /* @__PURE__ */ new Set(), b.current = ""), !N));
1796
+ ), Ne = se(() => {
1797
+ x((E) => (E || (_.current = /* @__PURE__ */ new Set(), y.current = ""), !E));
1498
1798
  }, []);
1499
- return o ? /* @__PURE__ */ s("div", { className: "pipeline-tree__empty", children: /* @__PURE__ */ l("div", { className: "loading-indicator", children: [
1500
- /* @__PURE__ */ s("span", { className: "loading-indicator__spinner", children: "⏳" }),
1501
- /* @__PURE__ */ s("span", { children: "Loading pipeline..." })
1502
- ] }) }) : r ? /* @__PURE__ */ s("div", { className: "error", children: r }) : a ? /* @__PURE__ */ l("div", { style: { width: "100%", height: "100%", position: "relative" }, children: [
1503
- /* @__PURE__ */ l(
1504
- pt,
1799
+ return r ? /* @__PURE__ */ n("div", { className: "pipeline-tree__empty", children: /* @__PURE__ */ i("div", { className: "loading-indicator", children: [
1800
+ /* @__PURE__ */ n("span", { className: "loading-indicator__spinner", children: "⏳" }),
1801
+ /* @__PURE__ */ n("span", { children: "Loading pipeline..." })
1802
+ ] }) }) : o ? /* @__PURE__ */ n("div", { className: "error", children: o }) : a ? /* @__PURE__ */ i("div", { style: { width: "100%", height: "100%", position: "relative" }, children: [
1803
+ /* @__PURE__ */ i(
1804
+ gt,
1505
1805
  {
1506
- nodes: h,
1507
- edges: f,
1508
- onInit: (N) => {
1509
- E.current = N;
1806
+ nodes: c,
1807
+ edges: g,
1808
+ onInit: (E) => {
1809
+ R.current = E;
1510
1810
  },
1511
- onNodesChange: m,
1811
+ onNodesChange: h,
1512
1812
  onEdgesChange: w,
1513
1813
  onNodeClick: G,
1514
- nodeTypes: Ra,
1515
- edgeTypes: xa,
1516
- defaultEdgeOptions: ka,
1814
+ nodeTypes: Ba,
1815
+ edgeTypes: Fa,
1816
+ defaultEdgeOptions: Ua,
1517
1817
  fitView: !0,
1518
1818
  fitViewOptions: { padding: 0.2 },
1519
1819
  minZoom: 0.1,
1520
1820
  maxZoom: 2,
1521
1821
  proOptions: { hideAttribution: !0 },
1522
1822
  children: [
1523
- /* @__PURE__ */ s(
1524
- ut,
1823
+ /* @__PURE__ */ n(
1824
+ _t,
1525
1825
  {
1526
- variant: Ft.Dots,
1826
+ variant: Vt.Dots,
1527
1827
  color: "var(--border)",
1528
1828
  gap: 20
1529
1829
  }
1530
1830
  ),
1531
- /* @__PURE__ */ s(mt, {})
1831
+ /* @__PURE__ */ n(Nt, {})
1532
1832
  ]
1533
1833
  }
1534
1834
  ),
1535
- /* @__PURE__ */ l("label", { className: "auto-expand-toggle", children: [
1536
- /* @__PURE__ */ s(
1835
+ /* @__PURE__ */ i("label", { className: "auto-expand-toggle", children: [
1836
+ /* @__PURE__ */ n(
1537
1837
  "input",
1538
1838
  {
1539
1839
  type: "checkbox",
1540
1840
  checked: T,
1541
- onChange: Me
1841
+ onChange: Ne
1542
1842
  }
1543
1843
  ),
1544
- /* @__PURE__ */ s("span", { children: "Auto-expand all" })
1844
+ /* @__PURE__ */ n("span", { children: "Auto-expand all" })
1545
1845
  ] })
1546
- ] }) : /* @__PURE__ */ s("div", { className: "pipeline-tree__empty", children: "Select a pipeline to visualize" });
1846
+ ] }) : /* @__PURE__ */ n("div", { className: "pipeline-tree__empty", children: "Select a pipeline to visualize" });
1547
1847
  }
1548
- function Re(e, t, a) {
1549
- return e.map((o) => {
1550
- if (o.target !== t) return o;
1551
- const r = o.data ?? {};
1848
+ function ke(e, t, a) {
1849
+ return e.map((r) => {
1850
+ if (r.target !== t) return r;
1851
+ const o = r.data ?? {};
1552
1852
  return {
1553
- ...o,
1853
+ ...r,
1554
1854
  data: {
1555
- ...r,
1855
+ ...o,
1556
1856
  totalParameterCount: a.length,
1557
1857
  declaredParameterNames: a
1558
1858
  }
1559
1859
  };
1560
1860
  });
1561
1861
  }
1562
- function Ae(e, t, a) {
1862
+ function Le(e, t, a) {
1563
1863
  if (!e || !t && !a)
1564
1864
  return e;
1565
- const o = {};
1566
- for (const [r, n] of Object.entries(e))
1567
- if (typeof n == "string" && me(n)) {
1568
- const { result: c, isFullyResolved: d } = Ct(n, {
1865
+ const r = {};
1866
+ for (const [o, s] of Object.entries(e))
1867
+ if (typeof s == "string" && ge(s)) {
1868
+ const { result: d, isFullyResolved: m } = Bt(s, {
1569
1869
  parameters: t,
1570
1870
  variables: a
1571
1871
  });
1572
- o[r] = d ? $a(c) : n;
1573
- } else n && typeof n == "object" && !Array.isArray(n) ? o[r] = Ae(
1574
- n,
1872
+ r[o] = m ? Oa(d) : s;
1873
+ } else s && typeof s == "object" && !Array.isArray(s) ? r[o] = Le(
1874
+ s,
1575
1875
  t,
1576
1876
  a
1577
- ) ?? n : o[r] = n;
1578
- return o;
1877
+ ) ?? s : r[o] = s;
1878
+ return r;
1579
1879
  }
1580
- function $a(e) {
1880
+ function Oa(e) {
1581
1881
  if (e === "True" || e === "true") return !0;
1582
1882
  if (e === "False" || e === "false") return !1;
1583
1883
  if (e === "null") return null;
@@ -1588,119 +1888,119 @@ function $a(e) {
1588
1888
  }
1589
1889
  return e;
1590
1890
  }
1591
- function at(e) {
1891
+ function it(e) {
1592
1892
  const t = e.resources;
1593
1893
  if (!t) return [];
1594
1894
  const a = t.repositories;
1595
1895
  return Array.isArray(a) ? a.filter(
1596
- (o) => o != null && typeof o == "object" && "repository" in o && "name" in o && typeof o.repository == "string" && typeof o.name == "string"
1896
+ (r) => r != null && typeof r == "object" && "repository" in r && "name" in r && typeof r.repository == "string" && typeof r.name == "string"
1597
1897
  ) : [];
1598
1898
  }
1599
- function nt(e) {
1899
+ function lt(e) {
1600
1900
  const t = /* @__PURE__ */ new Map();
1601
1901
  for (const a of e)
1602
1902
  t.set(a.repository, a);
1603
1903
  return Array.from(t.values());
1604
1904
  }
1605
- function Sa(e, t) {
1905
+ function Va(e, t) {
1606
1906
  return `tpl::${e || "self"}::${t}`;
1607
1907
  }
1608
- function qe(e, t, a, o, r, n, c, d, u) {
1609
- const h = /* @__PURE__ */ new Set(), i = [], m = [];
1610
- for (let f = 0; f < t.length; f++) {
1611
- const p = t[f];
1612
- let w = p.normalizedPath, E = !1, _ = !0, b, y;
1613
- if (me(p.normalizedPath)) {
1614
- E = !0, b = p.normalizedPath;
1615
- const N = Te(
1908
+ function Xe(e, t, a, r, o, s, d, m, u) {
1909
+ const c = /* @__PURE__ */ new Set(), l = [], h = [];
1910
+ for (let g = 0; g < t.length; g++) {
1911
+ const p = t[g];
1912
+ let w = p.normalizedPath, R = !1, f = !0, y, P;
1913
+ if (ge(p.normalizedPath)) {
1914
+ R = !0, y = p.normalizedPath;
1915
+ const E = Ce(
1616
1916
  p.normalizedPath,
1617
- c,
1917
+ d,
1618
1918
  void 0,
1619
1919
  u
1620
1920
  );
1621
- w = N.resolvedPath, _ = N.isFullyResolved, y = N.unresolved.length ? N.unresolved : void 0;
1921
+ w = E.resolvedPath, f = E.isFullyResolved, P = E.unresolved.length ? E.unresolved : void 0;
1622
1922
  }
1623
- let P = ie(p), B = !1, k = !0;
1624
- if (P && me(P)) {
1625
- B = !0;
1626
- const N = Te(
1627
- P,
1628
- c,
1923
+ let b = de(p), F = !1, _ = !0;
1924
+ if (b && ge(b)) {
1925
+ F = !0;
1926
+ const E = Ce(
1927
+ b,
1928
+ d,
1629
1929
  void 0,
1630
1930
  u
1631
1931
  );
1632
- N.isFullyResolved ? P = N.resolvedPath : (k = !1, y = [
1633
- ...y ?? [],
1634
- ...N.unresolved
1932
+ E.isFullyResolved ? b = E.resolvedPath : (_ = !1, P = [
1933
+ ...P ?? [],
1934
+ ...E.unresolved
1635
1935
  ]);
1636
1936
  }
1637
- const T = E || B, se = _ && k, { primary: C, fallback: V } = it({
1937
+ const T = R || F, x = f && _, { primary: k, fallback: L } = ut({
1638
1938
  ...p,
1639
1939
  normalizedPath: w,
1640
1940
  repoAlias: p.repoAlias,
1641
1941
  sourcePath: p.sourcePath
1642
- }), K = Sa(P, C);
1643
- if (h.has(K)) continue;
1644
- h.add(K);
1645
- const fe = d == null ? void 0 : d.has(K);
1942
+ }), z = Va(b, k);
1943
+ if (c.has(z)) continue;
1944
+ c.add(z);
1945
+ const ee = m == null ? void 0 : m.has(z);
1646
1946
  let G;
1647
1947
  if (p.conditional && p.conditionExpression)
1648
1948
  try {
1649
- const N = $t(p.conditionExpression, {
1650
- parameters: c,
1949
+ const E = At(p.conditionExpression, {
1950
+ parameters: d,
1651
1951
  variables: u
1652
1952
  });
1653
- typeof N == "boolean" ? G = N : N === void 0 || N === p.conditionExpression ? G = "unknown" : G = !!N;
1953
+ typeof E == "boolean" ? G = E : E === void 0 || E === p.conditionExpression ? G = "unknown" : G = !!E;
1654
1954
  } catch {
1655
1955
  G = "unknown";
1656
1956
  }
1657
1957
  else p.conditional && (G = "unknown");
1658
1958
  if (G === !1) continue;
1659
- if (!fe) {
1660
- const N = w.length > 40 ? `...${w.slice(-37)}` : w, { repoInfo: g, adoUrl: v } = Nt(
1959
+ if (!ee) {
1960
+ const E = w.length > 40 ? `...${w.slice(-37)}` : w, { repoInfo: N, adoUrl: v } = Tt(
1661
1961
  p,
1662
- P,
1663
- C,
1962
+ b,
1963
+ k,
1664
1964
  a,
1665
- o,
1666
1965
  r,
1667
- n
1668
- ), x = Ae(
1966
+ o,
1967
+ s
1968
+ ), C = Le(
1669
1969
  p.parameters,
1670
- c,
1970
+ d,
1671
1971
  u
1672
- ), $ = P !== ie(p) || x !== p.parameters ? {
1972
+ ), S = b !== de(p) || C !== p.parameters ? {
1673
1973
  ...p,
1674
- repoAlias: P || p.repoAlias,
1675
- contextRepoAlias: P || p.contextRepoAlias,
1676
- parameters: x
1974
+ repoAlias: b || p.repoAlias,
1975
+ contextRepoAlias: b || p.contextRepoAlias,
1976
+ parameters: C
1677
1977
  } : p;
1678
- i.push({
1679
- id: K,
1978
+ l.push({
1979
+ id: z,
1680
1980
  type: "fileNode",
1681
1981
  position: { x: 0, y: 0 },
1682
1982
  data: {
1683
- label: N,
1684
- filePath: C,
1685
- repoAlias: P,
1983
+ label: E,
1984
+ filePath: k,
1985
+ repoAlias: b,
1686
1986
  templateCount: 0,
1687
1987
  status: "collapsed",
1688
1988
  isRoot: !1,
1689
- baseDir: Ie(C),
1989
+ baseDir: Be(k),
1690
1990
  adoUrl: v,
1691
- repoInfo: g,
1991
+ repoInfo: N,
1692
1992
  templateLocation: p.location,
1693
1993
  // Dynamic path info for auto-expand to skip unresolved expression paths
1694
1994
  dynamicPath: T || void 0,
1695
- expressionResolved: T ? se : void 0,
1995
+ expressionResolved: T ? x : void 0,
1696
1996
  // Stash the resolved ref for expansion (with resolved repo alias + params)
1697
- _ref: $,
1997
+ _ref: S,
1698
1998
  // Stash fallback path for fetch retry (repo-root-relative)
1699
- _fallbackPath: V,
1999
+ _fallbackPath: L,
1700
2000
  // Stash the parent's parameter context so it can flow down during expansion
1701
- _parentParamContext: c,
2001
+ _parentParamContext: d,
1702
2002
  // Stash accumulated resources (root + all ancestor template resources)
1703
- _accumulatedResources: n,
2003
+ _accumulatedResources: s,
1704
2004
  // Stash accumulated variables for expression resolution in descendants
1705
2005
  _accumulatedVariables: u,
1706
2006
  // Condition evaluation result for conditional refs
@@ -1709,383 +2009,383 @@ function qe(e, t, a, o, r, n, c, d, u) {
1709
2009
  }
1710
2010
  });
1711
2011
  }
1712
- const Me = p.location === "extends" ? "extends" : p.location === "extends-parameters" ? "extends param" : p.location, le = !!P, be = p.parameters ? Object.keys(p.parameters) : void 0;
1713
- m.push({
1714
- id: `${e}->${K}`,
2012
+ const Ne = p.location === "extends" ? "extends" : p.location === "extends-parameters" ? "extends param" : p.location, te = !!b, pe = p.parameters ? Object.keys(p.parameters) : void 0;
2013
+ h.push({
2014
+ id: `${e}->${z}`,
1715
2015
  source: e,
1716
- target: K,
2016
+ target: z,
1717
2017
  type: "templateEdge",
1718
2018
  data: {
1719
- edgeLabel: Me,
1720
- parameterNames: be,
1721
- isExternal: le || void 0,
2019
+ edgeLabel: Ne,
2020
+ parameterNames: pe,
2021
+ isExternal: te || void 0,
1722
2022
  conditional: p.conditional || void 0,
1723
2023
  conditionExpression: p.conditionExpression,
1724
2024
  conditionResult: G,
1725
2025
  dynamicPath: T || void 0,
1726
- expressionResolved: T ? se : void 0,
1727
- originalPath: b || (B ? p.rawPath : void 0),
1728
- resolvedPath: T ? C : void 0,
1729
- unresolvedExpressions: y
2026
+ expressionResolved: T ? x : void 0,
2027
+ originalPath: y || (F ? p.rawPath : void 0),
2028
+ resolvedPath: T ? k : void 0,
2029
+ unresolvedExpressions: P
1730
2030
  },
1731
- style: le ? {
2031
+ style: te ? {
1732
2032
  stroke: "var(--badge-resources)",
1733
2033
  strokeWidth: 2,
1734
2034
  strokeDasharray: "6 3"
1735
2035
  } : void 0,
1736
- markerEnd: le ? { type: De.ArrowClosed, color: "var(--badge-resources)" } : void 0
2036
+ markerEnd: te ? { type: Ae.ArrowClosed, color: "var(--badge-resources)" } : void 0
1737
2037
  });
1738
2038
  }
1739
- return { templateNodes: i, templateEdges: m };
2039
+ return { templateNodes: l, templateEdges: h };
1740
2040
  }
1741
- async function Ye(e, t, a, o, r, n, c, d) {
1742
- const u = o._ref;
2041
+ async function Ze(e, t, a, r, o, s, d, m) {
2042
+ const u = r._ref;
1743
2043
  if (!u) throw new Error("No template reference on this node");
1744
- const h = o.filePath, i = o._fallbackPath, m = ie(u), f = `${m || ""}:${h}`, p = n.get(f);
1745
- if (p) return { content: p, actualPath: h };
1746
- if (i) {
1747
- const k = `${m || ""}:${i}`, T = n.get(k);
2044
+ const c = r.filePath, l = r._fallbackPath, h = de(u), g = `${h || ""}:${c}`, p = s.get(g);
2045
+ if (p) return { content: p, actualPath: c };
2046
+ if (l) {
2047
+ const _ = `${h || ""}:${l}`, T = s.get(_);
1748
2048
  if (T)
1749
- return { content: T, actualPath: i };
2049
+ return { content: T, actualPath: l };
1750
2050
  }
1751
- const E = o._accumulatedResources ?? r;
1752
- let _ = t, b = a, y;
1753
- if (m && E.length) {
1754
- const k = lt(m, E);
1755
- k ? (_ = k.project || t, b = k.repoName, y = k.ref) : b = m;
1756
- } else m && (b = m);
1757
- let P, B = h;
2051
+ const R = r._accumulatedResources ?? o;
2052
+ let f = t, y = a, P;
2053
+ if (h && R.length) {
2054
+ const _ = mt(h, R);
2055
+ _ ? (f = _.project || t, y = _.repoName, P = _.ref) : y = h;
2056
+ } else h && (y = h);
2057
+ let b, F = c;
1758
2058
  try {
1759
- P = await d(
2059
+ b = await m(
1760
2060
  e,
1761
- _,
1762
- b,
1763
- h,
1764
- y
2061
+ f,
2062
+ y,
2063
+ c,
2064
+ P
1765
2065
  );
1766
- } catch (k) {
1767
- if (i)
1768
- P = await d(
2066
+ } catch (_) {
2067
+ if (l)
2068
+ b = await m(
1769
2069
  e,
1770
- _,
1771
- b,
1772
- i,
1773
- y
1774
- ), B = i;
2070
+ f,
2071
+ y,
2072
+ l,
2073
+ P
2074
+ ), F = l;
1775
2075
  else
1776
- throw k;
2076
+ throw _;
1777
2077
  }
1778
- return c(`${m || ""}:${B}`, P.content), { content: P.content, actualPath: B };
2078
+ return d(`${h || ""}:${F}`, b.content), { content: b.content, actualPath: F };
1779
2079
  }
1780
- function Ie(e) {
2080
+ function Be(e) {
1781
2081
  const t = e.replace(/\\/g, "/"), a = t.lastIndexOf("/");
1782
2082
  return a > 0 ? t.slice(0, a) : "";
1783
2083
  }
1784
- function Nt(e, t, a, o, r, n, c) {
1785
- let d = r, u = n, h, i;
1786
- if (t && c.length) {
1787
- const f = lt(t, c), p = c.find(
2084
+ function Tt(e, t, a, r, o, s, d) {
2085
+ let m = o, u = s, c, l;
2086
+ if (t && d.length) {
2087
+ const g = mt(t, d), p = d.find(
1788
2088
  (w) => w.repository === t
1789
2089
  );
1790
- f ? (d = f.project || r, u = f.repoName, h = f.ref) : u = t, p && (i = {
2090
+ g ? (m = g.project || o, u = g.repoName, c = g.ref) : u = t, p && (l = {
1791
2091
  alias: t,
1792
2092
  fullName: p.name,
1793
2093
  type: p.type,
1794
2094
  ref: p.ref,
1795
- project: f == null ? void 0 : f.project
2095
+ project: g == null ? void 0 : g.project
1796
2096
  });
1797
2097
  } else t && (u = t);
1798
- const m = o && d && u ? rt({
1799
- org: o,
1800
- project: d,
2098
+ const h = r && m && u ? pt({
2099
+ org: r,
2100
+ project: m,
1801
2101
  repoName: u,
1802
2102
  filePath: a,
1803
- ref: h
2103
+ ref: c
1804
2104
  }) : void 0;
1805
- return { repoInfo: i, adoUrl: m };
1806
- }
1807
- function xe(e, t, a, o, r, n) {
1808
- const c = e.data, u = { ...c._accumulatedVariables ?? {}, ...t }, h = c._ref;
1809
- if (!h) return e;
1810
- const i = c._parentParamContext;
1811
- let m = h.normalizedPath, f = !1, p = !0, w = ie(h);
1812
- if (me(h.normalizedPath)) {
1813
- f = !0;
1814
- const k = Te(
1815
- h.normalizedPath,
1816
- i,
2105
+ return { repoInfo: l, adoUrl: h };
2106
+ }
2107
+ function $e(e, t, a, r, o, s) {
2108
+ const d = e.data, u = { ...d._accumulatedVariables ?? {}, ...t }, c = d._ref;
2109
+ if (!c) return e;
2110
+ const l = d._parentParamContext;
2111
+ let h = c.normalizedPath, g = !1, p = !0, w = de(c);
2112
+ if (ge(c.normalizedPath)) {
2113
+ g = !0;
2114
+ const _ = Ce(
2115
+ c.normalizedPath,
2116
+ l,
1817
2117
  void 0,
1818
2118
  u
1819
2119
  );
1820
- if (m = k.resolvedPath, p = k.isFullyResolved, p && !me(m)) {
1821
- const T = St(m);
1822
- m = T.normalizedPath, T.repoAlias && (w = T.repoAlias);
2120
+ if (h = _.resolvedPath, p = _.isFullyResolved, p && !ge(h)) {
2121
+ const T = Lt(h);
2122
+ h = T.normalizedPath, T.repoAlias && (w = T.repoAlias);
1823
2123
  }
1824
2124
  }
1825
- if (w && me(w)) {
1826
- f = !0;
1827
- const k = Te(
2125
+ if (w && ge(w)) {
2126
+ g = !0;
2127
+ const _ = Ce(
1828
2128
  w,
1829
- i,
2129
+ l,
1830
2130
  void 0,
1831
2131
  u
1832
2132
  );
1833
- k.isFullyResolved ? w = k.resolvedPath : p = !1;
2133
+ _.isFullyResolved ? w = _.resolvedPath : p = !1;
1834
2134
  }
1835
- const E = {
1836
- ...h,
1837
- normalizedPath: m,
1838
- repoAlias: w || h.repoAlias,
1839
- contextRepoAlias: w || h.contextRepoAlias
1840
- }, { primary: _, fallback: b } = it({
1841
- ...E,
1842
- normalizedPath: m,
1843
- repoAlias: E.repoAlias,
1844
- sourcePath: h.sourcePath
1845
- }), y = m.length > 40 ? `...${m.slice(-37)}` : m, { repoInfo: P, adoUrl: B } = a && o && r && n ? Nt(
1846
- E,
2135
+ const R = {
2136
+ ...c,
2137
+ normalizedPath: h,
2138
+ repoAlias: w || c.repoAlias,
2139
+ contextRepoAlias: w || c.contextRepoAlias
2140
+ }, { primary: f, fallback: y } = ut({
2141
+ ...R,
2142
+ normalizedPath: h,
2143
+ repoAlias: R.repoAlias,
2144
+ sourcePath: c.sourcePath
2145
+ }), P = h.length > 40 ? `...${h.slice(-37)}` : h, { repoInfo: b, adoUrl: F } = a && r && o && s ? Tt(
2146
+ R,
1847
2147
  w,
1848
- _,
2148
+ f,
1849
2149
  a,
1850
- o,
1851
2150
  r,
1852
- n
2151
+ o,
2152
+ s
1853
2153
  ) : { repoInfo: void 0, adoUrl: void 0 };
1854
2154
  return {
1855
2155
  ...e,
1856
2156
  data: {
1857
2157
  ...e.data,
1858
- label: y,
1859
- filePath: _,
2158
+ label: P,
2159
+ filePath: f,
1860
2160
  repoAlias: w,
1861
- baseDir: Ie(_),
1862
- dynamicPath: f || void 0,
1863
- expressionResolved: f ? p : void 0,
1864
- adoUrl: B || e.data.adoUrl,
1865
- repoInfo: P || e.data.repoInfo,
1866
- _ref: E,
2161
+ baseDir: Be(f),
2162
+ dynamicPath: g || void 0,
2163
+ expressionResolved: g ? p : void 0,
2164
+ adoUrl: F || e.data.adoUrl,
2165
+ repoInfo: b || e.data.repoInfo,
2166
+ _ref: R,
1867
2167
  _accumulatedVariables: u,
1868
- _fallbackPath: b
2168
+ _fallbackPath: y
1869
2169
  }
1870
2170
  };
1871
2171
  }
1872
- function Ca(e) {
2172
+ function ja(e) {
1873
2173
  const {
1874
2174
  setConnection: t,
1875
2175
  setSelectedPipeline: a,
1876
- setSelectedPipelineLoading: o,
1877
- setSelectedPipelineError: r
1878
- } = Ue(), [n, c] = L(""), [d, u] = L(null), [h, i] = L(!1), m = Q(!1);
1879
- ee(() => {
1880
- if (m.current) return;
1881
- m.current = !0;
1882
- const _ = new URLSearchParams(window.location.search), b = e.fileUrl || _.get("url"), y = e.org || _.get("org"), P = e.project || _.get("project"), B = e.repo || _.get("repo"), k = e.path || _.get("path"), T = e.branch || _.get("branch") || void 0, se = e.pipelineId ?? (_.get("pipelineId") ? Number(_.get("pipelineId")) : null);
1883
- if (b)
1884
- c(b), f(b);
1885
- else if (y && P && B && k) {
1886
- const C = `https://dev.azure.com/${y}/${P}/_git/${B}?path=${k}${T ? `&version=GB${T}` : ""}`;
1887
- c(C), f(C);
1888
- } else y && P && se != null && p(y, P, se);
2176
+ setSelectedPipelineLoading: r,
2177
+ setSelectedPipelineError: o
2178
+ } = Oe(), [s, d] = I(""), [m, u] = I(null), [c, l] = I(!1), h = ne(!1);
2179
+ Q(() => {
2180
+ if (h.current) return;
2181
+ h.current = !0;
2182
+ const f = new URLSearchParams(window.location.search), y = e.fileUrl || f.get("url"), P = e.org || f.get("org"), b = e.project || f.get("project"), F = e.repo || f.get("repo"), _ = e.path || f.get("path"), T = e.branch || f.get("branch") || void 0, x = e.pipelineId ?? (f.get("pipelineId") ? Number(f.get("pipelineId")) : null);
2183
+ if (y)
2184
+ d(y), g(y);
2185
+ else if (P && b && F && _) {
2186
+ const k = `https://dev.azure.com/${P}/${b}/_git/${F}?path=${_}${T ? `&version=GB${T}` : ""}`;
2187
+ d(k), g(k);
2188
+ } else P && b && x != null && p(P, b, x);
1889
2189
  }, []);
1890
- const f = async (_) => {
1891
- const b = Dt(_);
1892
- if (!b) {
2190
+ const g = async (f) => {
2191
+ const y = Ft(f);
2192
+ if (!y) {
1893
2193
  u("Invalid Azure DevOps URL");
1894
2194
  return;
1895
2195
  }
1896
- t(b.org, b.project), o(!0), r(null), i(!0);
2196
+ t(y.org, y.project), r(!0), o(null), l(!0);
1897
2197
  try {
1898
- const y = await gt(
1899
- b.org,
1900
- b.project,
1901
- b.repoName,
1902
- b.filePath,
1903
- b.branch
2198
+ const P = await yt(
2199
+ y.org,
2200
+ y.project,
2201
+ y.repoName,
2202
+ y.filePath,
2203
+ y.branch
1904
2204
  );
1905
2205
  a({
1906
2206
  definition: {
1907
2207
  id: 0,
1908
- name: b.filePath.split("/").pop() || b.filePath,
1909
- path: b.filePath,
2208
+ name: y.filePath.split("/").pop() || y.filePath,
2209
+ path: y.filePath,
1910
2210
  repository: {
1911
- id: y.repoId,
1912
- name: y.repoName,
2211
+ id: P.repoId,
2212
+ name: P.repoName,
1913
2213
  type: "git",
1914
- defaultBranch: y.branch || ""
2214
+ defaultBranch: P.branch || ""
1915
2215
  }
1916
2216
  },
1917
- yaml: y.content
2217
+ yaml: P.content
1918
2218
  });
1919
- } catch (y) {
1920
- r(
1921
- y instanceof Error ? y.message : String(y)
2219
+ } catch (P) {
2220
+ o(
2221
+ P instanceof Error ? P.message : String(P)
1922
2222
  );
1923
2223
  } finally {
1924
- o(!1), i(!1);
2224
+ r(!1), l(!1);
1925
2225
  }
1926
- }, p = async (_, b, y) => {
1927
- t(_, b), o(!0), r(null);
2226
+ }, p = async (f, y, P) => {
2227
+ t(f, y), r(!0), o(null);
1928
2228
  try {
1929
- const P = await Gt(_, b, y);
1930
- a(P);
1931
- } catch (P) {
1932
- r(
1933
- P instanceof Error ? P.message : String(P)
2229
+ const b = await Zt(f, y, P);
2230
+ a(b);
2231
+ } catch (b) {
2232
+ o(
2233
+ b instanceof Error ? b.message : String(b)
1934
2234
  );
1935
2235
  } finally {
1936
- o(!1);
2236
+ r(!1);
1937
2237
  }
1938
2238
  }, w = async () => {
1939
- n.trim() && (u(null), await f(n.trim()));
2239
+ s.trim() && (u(null), await g(s.trim()));
1940
2240
  };
1941
- return /* @__PURE__ */ l("div", { className: "pipeline-url-bar", children: [
1942
- /* @__PURE__ */ s(
2241
+ return /* @__PURE__ */ i("div", { className: "pipeline-url-bar", children: [
2242
+ /* @__PURE__ */ n(
1943
2243
  "input",
1944
2244
  {
1945
2245
  type: "text",
1946
2246
  className: "pipeline-url-bar__input",
1947
2247
  placeholder: "https://dev.azure.com/{org}/{project}/_git/{repo}?path=/{pipeline}.yml",
1948
- value: n,
1949
- onChange: (_) => c(_.target.value),
1950
- onKeyDown: (_) => {
1951
- _.key === "Enter" && (_.preventDefault(), w());
2248
+ value: s,
2249
+ onChange: (f) => d(f.target.value),
2250
+ onKeyDown: (f) => {
2251
+ f.key === "Enter" && (f.preventDefault(), w());
1952
2252
  }
1953
2253
  }
1954
2254
  ),
1955
- /* @__PURE__ */ s(
2255
+ /* @__PURE__ */ n(
1956
2256
  "button",
1957
2257
  {
1958
2258
  className: "pipeline-url-bar__btn",
1959
2259
  onClick: w,
1960
- disabled: !n.trim() || h,
1961
- children: h ? "⏳ Loading..." : "Load"
2260
+ disabled: !s.trim() || c,
2261
+ children: c ? "⏳ Loading..." : "Load"
1962
2262
  }
1963
2263
  ),
1964
- d && /* @__PURE__ */ s("div", { className: "pipeline-url-bar__error", children: d })
2264
+ m && /* @__PURE__ */ n("div", { className: "pipeline-url-bar__error", children: m })
1965
2265
  ] });
1966
2266
  }
1967
- function Da() {
1968
- const e = () => window.location.hash.startsWith("#/commit-flow") ? "commit-flow" : "pipeline", [t, a] = L(e);
1969
- return ee(() => {
1970
- const r = () => a(e());
1971
- return window.addEventListener("hashchange", r), () => window.removeEventListener("hashchange", r);
1972
- }, []), [t, (r) => {
1973
- window.location.hash = r === "pipeline" ? "#/" : `#/${r}`;
2267
+ function Wa() {
2268
+ const e = () => window.location.hash.startsWith("#/commit-flow") ? "commit-flow" : "pipeline", [t, a] = I(e);
2269
+ return Q(() => {
2270
+ const o = () => a(e());
2271
+ return window.addEventListener("hashchange", o), () => window.removeEventListener("hashchange", o);
2272
+ }, []), [t, (o) => {
2273
+ window.location.hash = o === "pipeline" ? "#/" : `#/${o}`;
1974
2274
  }];
1975
2275
  }
1976
- const Aa = 280, Ia = 900, La = 420;
1977
- function Fa(e) {
1978
- const { setCustomTaskDocs: t, setTaskSchema: a, selectedNodeDetail: o, org: r } = Ue(), [n, c] = L(La), d = Q(!1), [u, h] = Da();
1979
- ee(() => {
1980
- qt().then((m) => t(m.customTaskDocs)).catch(() => {
2276
+ const za = 280, Ha = 900, Ga = 420;
2277
+ function Ka(e) {
2278
+ const { setCustomTaskDocs: t, setTaskSchema: a, selectedNodeDetail: r, org: o } = Oe(), [s, d] = I(Ga), m = ne(!1), [u, c] = Wa();
2279
+ Q(() => {
2280
+ Qt().then((h) => t(h.customTaskDocs)).catch(() => {
1981
2281
  });
1982
- }, [t]), ee(() => {
1983
- r && Yt(r).then((m) => a(m.tasks)).catch(() => {
2282
+ }, [t]), Q(() => {
2283
+ o && ea(o).then((h) => a(h.tasks)).catch(() => {
1984
2284
  });
1985
- }, [r, a]);
1986
- const i = ne(
1987
- (m) => {
1988
- m.preventDefault(), d.current = !0;
1989
- const f = m.clientX, p = n;
2285
+ }, [o, a]);
2286
+ const l = se(
2287
+ (h) => {
2288
+ h.preventDefault(), m.current = !0;
2289
+ const g = h.clientX, p = s;
1990
2290
  document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
1991
- const w = (_) => {
1992
- const b = f - _.clientX, y = Math.min(
1993
- Ia,
1994
- Math.max(Aa, p + b)
2291
+ const w = (f) => {
2292
+ const y = g - f.clientX, P = Math.min(
2293
+ Ha,
2294
+ Math.max(za, p + y)
1995
2295
  );
1996
- c(y);
1997
- }, E = () => {
1998
- d.current = !1, document.body.style.cursor = "", document.body.style.userSelect = "", window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", E);
2296
+ d(P);
2297
+ }, R = () => {
2298
+ m.current = !1, document.body.style.cursor = "", document.body.style.userSelect = "", window.removeEventListener("mousemove", w), window.removeEventListener("mouseup", R);
1999
2299
  };
2000
- window.addEventListener("mousemove", w), window.addEventListener("mouseup", E);
2300
+ window.addEventListener("mousemove", w), window.addEventListener("mouseup", R);
2001
2301
  },
2002
- [n]
2302
+ [s]
2003
2303
  );
2004
- return /* @__PURE__ */ s(ga, { value: gt, children: /* @__PURE__ */ l("div", { className: "app", children: [
2005
- /* @__PURE__ */ l("header", { className: "app__header", children: [
2006
- /* @__PURE__ */ s("h1", { children: "🔧 Azure Pipelines Visualizer" }),
2007
- /* @__PURE__ */ l("nav", { className: "app__nav", children: [
2008
- /* @__PURE__ */ s(
2304
+ return /* @__PURE__ */ n(ka, { value: yt, children: /* @__PURE__ */ i("div", { className: "app", children: [
2305
+ /* @__PURE__ */ i("header", { className: "app__header", children: [
2306
+ /* @__PURE__ */ n("h1", { children: "🔧 Azure Pipelines Visualizer" }),
2307
+ /* @__PURE__ */ i("nav", { className: "app__nav", children: [
2308
+ /* @__PURE__ */ n(
2009
2309
  "button",
2010
2310
  {
2011
2311
  className: `app__nav-btn ${u === "pipeline" ? "app__nav-btn--active" : ""}`,
2012
- onClick: () => h("pipeline"),
2312
+ onClick: () => c("pipeline"),
2013
2313
  type: "button",
2014
2314
  children: "Pipeline Templates"
2015
2315
  }
2016
2316
  ),
2017
- /* @__PURE__ */ s(
2317
+ /* @__PURE__ */ n(
2018
2318
  "button",
2019
2319
  {
2020
2320
  className: `app__nav-btn ${u === "commit-flow" ? "app__nav-btn--active" : ""}`,
2021
- onClick: () => h("commit-flow"),
2321
+ onClick: () => c("commit-flow"),
2022
2322
  type: "button",
2023
2323
  children: "Commit Flow"
2024
2324
  }
2025
2325
  )
2026
2326
  ] }),
2027
- u === "pipeline" && /* @__PURE__ */ s(Ee, { children: /* @__PURE__ */ s(Ca, { ...e }) })
2327
+ u === "pipeline" && /* @__PURE__ */ n(Re, { children: /* @__PURE__ */ n(ja, { ...e }) })
2028
2328
  ] }),
2029
- /* @__PURE__ */ l("main", { className: "app__main", children: [
2030
- u === "pipeline" && /* @__PURE__ */ l(Je, { children: [
2031
- /* @__PURE__ */ s("section", { className: "app__content", children: /* @__PURE__ */ s(Ee, { children: /* @__PURE__ */ s(Ta, {}) }) }),
2032
- o && /* @__PURE__ */ l(Je, { children: [
2033
- /* @__PURE__ */ s(
2329
+ /* @__PURE__ */ i("main", { className: "app__main", children: [
2330
+ u === "pipeline" && /* @__PURE__ */ i(Qe, { children: [
2331
+ /* @__PURE__ */ n("section", { className: "app__content", children: /* @__PURE__ */ n(Re, { children: /* @__PURE__ */ n(Ma, {}) }) }),
2332
+ r && /* @__PURE__ */ i(Qe, { children: [
2333
+ /* @__PURE__ */ n(
2034
2334
  "div",
2035
2335
  {
2036
2336
  className: "app__detail-resize-handle",
2037
- onMouseDown: i,
2337
+ onMouseDown: l,
2038
2338
  title: "Drag to resize"
2039
2339
  }
2040
2340
  ),
2041
- /* @__PURE__ */ s("aside", { className: "app__detail", style: { width: n }, children: /* @__PURE__ */ s(Ee, { children: /* @__PURE__ */ s(ha, {}) }) })
2341
+ /* @__PURE__ */ n("aside", { className: "app__detail", style: { width: s }, children: /* @__PURE__ */ n(Re, { children: /* @__PURE__ */ n(Ea, {}) }) })
2042
2342
  ] })
2043
2343
  ] }),
2044
- u === "commit-flow" && /* @__PURE__ */ s("section", { className: "app__content", children: /* @__PURE__ */ s(Ee, { children: /* @__PURE__ */ s(pa, {}) }) })
2344
+ u === "commit-flow" && /* @__PURE__ */ n("section", { className: "app__content", children: /* @__PURE__ */ n(Re, { children: /* @__PURE__ */ n(wa, {}) }) })
2045
2345
  ] })
2046
2346
  ] }) });
2047
2347
  }
2048
- var Xe, ke = Mt;
2348
+ var et, xe = zt;
2049
2349
  if (process.env.NODE_ENV === "production")
2050
- Xe = ke.createRoot, ke.hydrateRoot;
2350
+ et = xe.createRoot, xe.hydrateRoot;
2051
2351
  else {
2052
- var st = ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2053
- Xe = function(e, t) {
2054
- st.usingClientEntryPoint = !0;
2352
+ var ct = xe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2353
+ et = function(e, t) {
2354
+ ct.usingClientEntryPoint = !0;
2055
2355
  try {
2056
- return ke.createRoot(e, t);
2356
+ return xe.createRoot(e, t);
2057
2357
  } finally {
2058
- st.usingClientEntryPoint = !1;
2358
+ ct.usingClientEntryPoint = !1;
2059
2359
  }
2060
2360
  };
2061
2361
  }
2062
- function Ga(e, t = {}) {
2362
+ function sn(e, t = {}) {
2063
2363
  let a = { ...t };
2064
- const o = Xe(e);
2065
- function r(n) {
2066
- o.render(Et(Fa, n));
2364
+ const r = et(e);
2365
+ function o(s) {
2366
+ r.render(xt(Ka, s));
2067
2367
  }
2068
- return r(a), {
2069
- unmount: () => o.unmount(),
2070
- update: (n) => {
2071
- a = { ...a, ...n }, r(a);
2368
+ return o(a), {
2369
+ unmount: () => r.unmount(),
2370
+ update: (s) => {
2371
+ a = { ...a, ...s }, o(a);
2072
2372
  }
2073
2373
  };
2074
2374
  }
2075
2375
  export {
2076
- Fa as App,
2077
- ha as DetailPanel,
2078
- Ee as ErrorBoundary,
2079
- ba as FileNode,
2080
- Ta as PipelineDiagram,
2081
- Ca as PipelineSelector,
2082
- Ea as TemplateEdge,
2083
- gt as fetchFileByRepoName,
2084
- Gt as fetchPipelineYaml,
2085
- Ka as fetchPipelines,
2086
- qt as fetchTaskDocsConfig,
2087
- Yt as fetchTaskSchema,
2088
- Ke as getLayoutedElements,
2089
- Ga as mount,
2090
- Ue as usePipelineStore
2376
+ Ka as App,
2377
+ Ea as DetailPanel,
2378
+ Re as ErrorBoundary,
2379
+ Sa as FileNode,
2380
+ Ma as PipelineDiagram,
2381
+ ja as PipelineSelector,
2382
+ La as TemplateEdge,
2383
+ yt as fetchFileByRepoName,
2384
+ Zt as fetchPipelineYaml,
2385
+ nn as fetchPipelines,
2386
+ Qt as fetchTaskDocsConfig,
2387
+ ea as fetchTaskSchema,
2388
+ qe as getLayoutedElements,
2389
+ sn as mount,
2390
+ Oe as usePipelineStore
2091
2391
  };