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