@meirblachman/azure-pipelines-visualizer 0.2.3 → 0.2.4

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